diff --git a/.gitignore b/.gitignore index 6f9f1f1..80ef888 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ data/ data_bak/ +static-bak +static-files diff --git a/.pnpm-store/v10/files/00/879645d028f36f1a1eeed52e47ad8e1c8a689dccf2b3cfe642d26d40735ffe59a624974e85a52c85fd4debf88392da9809b1cfd4eaf96e1db9234dc8c29a90 b/.pnpm-store/v10/files/00/879645d028f36f1a1eeed52e47ad8e1c8a689dccf2b3cfe642d26d40735ffe59a624974e85a52c85fd4debf88392da9809b1cfd4eaf96e1db9234dc8c29a90 new file mode 100644 index 0000000..ef7548c --- /dev/null +++ b/.pnpm-store/v10/files/00/879645d028f36f1a1eeed52e47ad8e1c8a689dccf2b3cfe642d26d40735ffe59a624974e85a52c85fd4debf88392da9809b1cfd4eaf96e1db9234dc8c29a90 @@ -0,0 +1,7 @@ +'use strict'; +const path = require('path'); +const binaryExtensions = require('binary-extensions'); + +const extensions = new Set(binaryExtensions); + +module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/.pnpm-store/v10/files/01/ac9cebce73d39a859ccac8cff3ec7ca6c330cc6a7683ebc037f09814ed29e3c580a2621e9bb178f7e8e88b0f9bb46a1afa34d3c09c702434e46d57f2812fa5 b/.pnpm-store/v10/files/01/ac9cebce73d39a859ccac8cff3ec7ca6c330cc6a7683ebc037f09814ed29e3c580a2621e9bb178f7e8e88b0f9bb46a1afa34d3c09c702434e46d57f2812fa5 new file mode 100644 index 0000000..63d537d --- /dev/null +++ b/.pnpm-store/v10/files/01/ac9cebce73d39a859ccac8cff3ec7ca6c330cc6a7683ebc037f09814ed29e3c580a2621e9bb178f7e8e88b0f9bb46a1afa34d3c09c702434e46d57f2812fa5 @@ -0,0 +1,114 @@ +1.0.0 / 2024-08-31 +================== + + * Drop support for node <18 + * Added an option preferred encodings array #59 + +0.6.3 / 2022-01-22 +================== + + * Revert "Lazy-load modules from main entry point" + +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * Fix including type extensions in parameters in `Accept` parsing + * Fix parsing `Accept` parameters with quoted equals + * Fix parsing `Accept` parameters with quoted semicolons + * Lazy-load modules from main entry point + * perf: delay type concatenation until needed + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove closures getting spec properties + * perf: remove a closure from media type parsing + * perf: remove property delete from media type parsing + +0.5.3 / 2015-05-10 +================== + + * Fix media type parameter matching to be case-insensitive + +0.5.2 / 2015-05-06 +================== + + * Fix comparing media types with quoted values + * Fix splitting media types with quoted commas + +0.5.1 / 2015-02-14 +================== + + * Fix preference sorting to be stable for long acceptable lists + +0.5.0 / 2014-12-18 +================== + + * Fix list return order when large accepted list + * Fix missing identity encoding when q=0 exists + * Remove dynamic building of Negotiator class + +0.4.9 / 2014-10-14 +================== + + * Fix error when media type has invalid parameter + +0.4.8 / 2014-09-28 +================== + + * Fix all negotiations to be case-insensitive + * Stable sort preferences of same quality according to client order + * Support Node.js 0.6 + +0.4.7 / 2014-06-24 +================== + + * Handle invalid provided languages + * Handle invalid provided media types + +0.4.6 / 2014-06-11 +================== + + * Order by specificity when quality is the same + +0.4.5 / 2014-05-29 +================== + + * Fix regression in empty header handling + +0.4.4 / 2014-05-29 +================== + + * Fix behaviors when headers are not present + +0.4.3 / 2014-04-16 +================== + + * Handle slashes on media params correctly + +0.4.2 / 2014-02-28 +================== + + * Fix media type sorting + * Handle media types params strictly + +0.4.1 / 2014-01-16 +================== + + * Use most specific matches + +0.4.0 / 2014-01-09 +================== + + * Remove preferred prefix from methods diff --git a/.pnpm-store/v10/files/01/d599e6f99e95a4a87d5682803b397672bd04e50cd0c7ea3f83fb9b492564222d45daad40527d663e26921e80f0c02a03545a272b31e35d94e8878df9703cfa b/.pnpm-store/v10/files/01/d599e6f99e95a4a87d5682803b397672bd04e50cd0c7ea3f83fb9b492564222d45daad40527d663e26921e80f0c02a03545a272b31e35d94e8878df9703cfa new file mode 100644 index 0000000..a90243e --- /dev/null +++ b/.pnpm-store/v10/files/01/d599e6f99e95a4a87d5682803b397672bd04e50cd0c7ea3f83fb9b492564222d45daad40527d663e26921e80f0c02a03545a272b31e35d94e8878df9703cfa @@ -0,0 +1,29 @@ +(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.graphql=e()}})(function(){"use strict";var ce=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var xe=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},Nt=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Tt(t))!_t.call(e,r)&&r!==n&&ce(e,r,{get:()=>t[r],enumerable:!(i=Et(t,r))||i.enumerable});return e};var xt=e=>Nt(ce({},"__esModule",{value:!0}),e);var En={};xe(En,{languages:()=>Qe,options:()=>Ke,parsers:()=>Ne,printers:()=>mn});var yt=(e,t,n,i)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},G=yt;var j="indent";var $="group";var w="if-break";var S="line";var X="break-parent";var Re=()=>{},L=Re,pe=Re;function N(e){return L(e),{type:j,contents:e}}function y(e,t={}){return L(e),pe(t.expandedStates,!0),{type:$,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function I(e,t="",n={}){return L(e),t!==""&&L(t),{type:w,breakContents:e,flatContents:t,groupId:n.groupId}}var Dt={type:X};var gt={type:S,hard:!0};var k={type:S},p={type:S,soft:!0},f=[gt,Dt];function E(e,t){L(e),pe(t);let n=[];for(let i=0;i{let r=!!(i!=null&&i.backwards);if(n===!1)return!1;let{length:s}=t,a=n;for(;a>=0&&a0}var fe=Lt;var he=class extends Error{name="UnexpectedNodeError";constructor(t,n,i="type"){super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`),this.node=t}},Be=he;var F=null;function B(e){if(F!==null&&typeof F.property){let t=F;return F=B.prototype=null,t}return F=B.prototype=e??Object.create(null),new B}var bt=10;for(let e=0;e<=bt;e++)B();function de(e){return B(e)}function Pt(e,t="type"){de(e);function n(i){let r=i[t],s=e[r];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:i});return s}return n}var Ue=Pt;var Q=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},U=class{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},W={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},xr=new Set(Object.keys(W));var C;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(C||(C={}));var wt=Ue(W,"kind"),Me=wt;function K(e){return e.loc.start}function z(e){return e.loc.end}var Ve="format",Ye=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,Ge=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;function je(e){return Ge.test(e)}function $e(e){return Ye.test(e)}function Xe(e){return`# @${Ve} + +${e}`}function Ft(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return i.kind==="InputValueDefinition"&&!i.description.block?r.push(k):r.push(f),r}var D=Ft;function Bt(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...E(f,g(e,t,n,"definitions")),f];case"OperationDefinition":{let r=t.originalText[K(i)]!=="{",s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&fe(i.variableDefinitions)?" ":"",He(e,n),x(e,n,i),!r&&!s?"":" ",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),He(e,n)," on ",n("typeCondition"),x(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",N([f,E(f,g(e,t,n,"selections"))]),f,"}"];case"Field":return y([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?y(["(",N([p,E([I("",", "),p],g(e,t,n,"arguments"))]),p,")"]):"",x(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":return i.value;case"StringValue":if(i.block){let r=G(!1,i.value,'"""',String.raw`\"""`).split(` +`);return r.length===1&&(r[0]=r[0].trim()),r.every(s=>s==="")&&(r.length=0),E(f,['"""',...r,'"""'])}return['"',G(!1,G(!1,i.value,/["\\]/gu,String.raw`\$&`),` +`,String.raw`\n`),'"'];case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return y(["[",N([p,E([I("",", "),p],e.map(n,"values"))]),p,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return y(["{",r,N([p,E([I("",", "),p],e.map(n,"fields"))]),p,I("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?y(["(",N([p,E([I("",", "),p],g(e,t,n,"arguments"))]),p,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",x(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(D(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...Vt(e,t,n)),s.push(x(e,n,i)),i.fields.length>0&&s.push([" {",N([f,E(f,g(e,t,n,"fields"))]),f,"}"]),s}case"FieldDefinition":return[D(e,t,n),n("name"),i.arguments.length>0?y(["(",N([p,E([I("",", "),p],g(e,t,n,"arguments"))]),p,")"]):"",": ",n("type"),x(e,n,i)];case"DirectiveDefinition":return[D(e,t,n),"directive ","@",n("name"),i.arguments.length>0?y(["(",N([p,E([I("",", "),p],g(e,t,n,"arguments"))]),p,")"]):"",i.repeatable?" repeatable":""," on ",...E(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[D(e,t,n),i.kind==="EnumTypeExtension"?"extend ":"","enum ",n("name"),x(e,n,i),i.values.length>0?[" {",N([f,E(f,g(e,t,n,"values"))]),f,"}"]:""];case"EnumValueDefinition":return[D(e,t,n),n("name"),x(e,n,i)];case"InputValueDefinition":return[D(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",x(e,n,i)];case"SchemaExtension":return["extend schema",x(e,n,i),...i.operationTypes.length>0?[" {",N([f,E(f,g(e,t,n,"operationTypes"))]),f,"}"]:[]];case"SchemaDefinition":return[D(e,t,n),"schema",x(e,n,i)," {",i.operationTypes.length>0?N([f,E(f,g(e,t,n,"operationTypes"))]):"",f,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),x(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",x(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return y([D(e,t,n),y([i.kind==="UnionTypeExtension"?"extend ":"","union ",n("name"),x(e,n,i),i.types.length>0?[" =",I(""," "),N([I([k,"| "]),E([k,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[D(e,t,n),i.kind==="ScalarTypeExtension"?"extend ":"","scalar ",n("name"),x(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new Be(i,"Graphql","kind")}}function x(e,t,n){if(n.directives.length===0)return"";let i=E(k,e.map(t,"directives"));return n.kind==="FragmentDefinition"||n.kind==="OperationDefinition"?y([k,i]):[" ",y(N([p,i]))]}function g(e,t,n,i){return e.map(({isLast:r,node:s})=>{let a=n();return!r&&Fe(t.originalText,z(s))?[a,f]:a},i)}function Ut(e){return e.kind!=="Comment"}function Mt(e){let t=e.node;if(t.kind==="Comment")return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))}function Vt(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let u=0;ui.value.trim()==="prettier-ignore")}var Gt={print:Bt,massageAstNode:Je,hasPrettierIgnore:Yt,insertPragma:Xe,printComment:Mt,canAttachComment:Ut,getVisitorKeys:Me},qe=Gt;var Qe=[{name:"GraphQL",type:"data",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}];var We={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var jt={bracketSpacing:We.bracketSpacing},Ke=jt;var Ne={};xe(Ne,{graphql:()=>dn});function ze(e){return typeof e=="object"&&e!==null}function Ze(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}var $t=/\r\n|[\n\r]/g;function M(e,t){let n=0,i=1;for(let r of e.body.matchAll($t)){if(typeof r.index=="number"||Ze(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function tt(e){return me(e.source,M(e.source,e.start))}function me(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,u=t.line===1?n:0,l=t.column+u,T=`${e.name}:${a}:${l} +`,h=i.split(/\r\n|[\n\r]/g),A=h[r];if(A.length>120){let O=Math.floor(l/80),ae=l%80,_=[];for(let v=0;v["|",v]),["|","^".padStart(ae)],["|",_[O+1]]])}return T+et([[`${a-1} |`,h[r-1]],[`${a} |`,A],["|","^".padStart(l)],[`${a+1} |`,h[r+1]]])}function et(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` +`)}function Xt(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var Z=class e extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:u,positions:l,path:T,originalError:h,extensions:A}=Xt(n);super(t),this.name="GraphQLError",this.path=T??void 0,this.originalError=h??void 0,this.nodes=nt(Array.isArray(a)?a:a?[a]:void 0);let O=nt((i=this.nodes)===null||i===void 0?void 0:i.map(_=>_.loc).filter(_=>_!=null));this.source=u??(O==null||(r=O[0])===null||r===void 0?void 0:r.source),this.positions=l??(O==null?void 0:O.map(_=>_.start)),this.locations=l&&u?l.map(_=>M(u,_)):O==null?void 0:O.map(_=>M(_.source,_.start));let ae=ze(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(s=A??ae)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + +`+tt(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` + +`+me(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function nt(e){return e===void 0||e.length===0?void 0:e}function d(e,t,n){return new Z(`Syntax Error: ${n}`,{source:e,positions:[t]})}var ee;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(ee||(ee={}));var c;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(c||(c={}));function rt(e){return e===9||e===32}function b(e){return e>=48&&e<=57}function it(e){return e>=97&&e<=122||e>=65&&e<=90}function Ee(e){return it(e)||e===95}function st(e){return it(e)||b(e)||e===95}function ot(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;au===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function Ht(e){let t=0;for(;t=0&&e<=55295||e>=57344&&e<=1114111}function ne(e,t){return ut(e.charCodeAt(t))&<(e.charCodeAt(t+1))}function ut(e){return e>=55296&&e<=56319}function lt(e){return e>=56320&&e<=57343}function R(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return o.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function m(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new U(t,n,i,s,a,r)}function Jt(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zt(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw d(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function en(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,u="",l=[];for(;s2?"["+an(e)+"]":"{ "+n.map(([r,s])=>r+": "+se(s,t)).join(", ")+" }"}function on(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let s=0;s1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function an(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}var cn=globalThis.process&&!0,pt=cn?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){let a=ie(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};var Y=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||re(!1,`Body must be a string. Received: ${ie(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||re(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||re(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ft(e){return pt(e,Y)}function ht(e,t){let n=new _e(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var _e=class{constructor(t,n={}){let i=ft(t)?t:new Y(t);this._lexer=new te(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(o.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(o.SOF,this.parseDefinition,o.EOF)})}parseDefinition(){if(this.peek(o.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===o.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw d(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(o.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:C.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(o.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(o.NAME);switch(t.value){case"query":return C.QUERY;case"mutation":return C.MUTATION;case"subscription":return C.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(o.PAREN_L,this.parseVariableDefinition,o.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(o.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(o.BRACE_L,this.parseSelection,o.BRACE_R)})}parseSelection(){return this.peek(o.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(o.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.PAREN_L,n,o.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(o.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(o.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case o.BRACKET_L:return this.parseList(t);case o.BRACE_L:return this.parseObject(t);case o.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case o.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case o.STRING:case o.BLOCK_STRING:return this.parseStringLiteral();case o.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case o.DOLLAR:if(t)if(this.expectToken(o.DOLLAR),this._lexer.token.kind===o.NAME){let i=this._lexer.token.value;throw d(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===o.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(o.BRACKET_L,n,o.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(o.BRACE_L,n,o.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(o.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(o.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(o.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(o.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(o.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(o.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(o.STRING)||this.peek(o.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(o.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(o.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseFieldDefinition,o.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(o.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(o.PAREN_L,this.parseInputValueDef,o.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(o.COLON);let r=this.parseTypeReference(),s;this.expectOptionalToken(o.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(o.EQUALS)?this.delimitedMany(o.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(o.BRACE_L,this.parseEnumValueDefinition,o.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw d(this._lexer.source,this._lexer.token.start,`${oe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(o.BRACE_L,this.parseInputValueDef,o.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===o.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(o.BRACE_L,this.parseOperationTypeDefinition,o.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.AT);let i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(o.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(ee,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Q(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${dt(t)}, found ${oe(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===o.NAME&&n.value===t)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${t}", found ${oe(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===o.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${oe(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==o.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw d(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function oe(e){let t=e.value;return dt(e.kind)+(t!=null?` "${t}"`:"")}function dt(e){return ct(e)?`"${e}"`:e}function un(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}var mt=un;function ln(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let r=n;r!==i;r=r.next)r.kind==="Comment"&&t.push({...r,loc:{start:r.start,end:r.end}});return t}var pn={allowLegacyFragmentVariables:!0};function fn(e){if((e==null?void 0:e.name)==="GraphQLError"){let{message:t,locations:[n]}=e;return mt(t,{loc:{start:n},cause:e})}return e}function hn(e){let t;try{t=ht(e,pn)}catch(n){throw fn(n)}return t.comments=ln(t),t}var dn={parse:hn,astFormat:"graphql",hasPragma:je,hasIgnorePragma:$e,locStart:K,locEnd:z};var mn={graphql:qe};return xt(En);}); \ No newline at end of file diff --git a/.pnpm-store/v10/files/01/ef1a1afa6998fd88d360bcf78bca04a0c7b7faaffd89b92118ddfe1a22268eb597e29fd9277b59c5a571556e5ef7d0603f43383a09ab29d58c8c3bee435da0 b/.pnpm-store/v10/files/01/ef1a1afa6998fd88d360bcf78bca04a0c7b7faaffd89b92118ddfe1a22268eb597e29fd9277b59c5a571556e5ef7d0603f43383a09ab29d58c8c3bee435da0 new file mode 100644 index 0000000..a8a9b05 --- /dev/null +++ b/.pnpm-store/v10/files/01/ef1a1afa6998fd88d360bcf78bca04a0c7b7faaffd89b92118ddfe1a22268eb597e29fd9277b59c5a571556e5ef7d0603f43383a09ab29d58c8c3bee435da0 @@ -0,0 +1,43 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); +var inspect = require('object-inspect'); +var getSideChannelList = require('side-channel-list'); +var getSideChannelMap = require('side-channel-map'); +var getSideChannelWeakMap = require('side-channel-weakmap'); + +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; + +/** @type {import('.')} */ +module.exports = function getSideChannel() { + /** @typedef {ReturnType} Channel */ + + /** @type {Channel | undefined} */ var $channelData; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + + $channelData.set(key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; diff --git a/.pnpm-store/v10/files/02/1b1fdee225c6a10ca408fcc45d7c247e532f7115c1065e8adf6f370eaad1f859174d72dbc344664cd09cbc8dad6fec1d0a6a01fb989047bd87377bf8404261 b/.pnpm-store/v10/files/02/1b1fdee225c6a10ca408fcc45d7c247e532f7115c1065e8adf6f370eaad1f859174d72dbc344664cd09cbc8dad6fec1d0a6a01fb989047bd87377bf8404261 new file mode 100644 index 0000000..0b9db8d --- /dev/null +++ b/.pnpm-store/v10/files/02/1b1fdee225c6a10ca408fcc45d7c247e532f7115c1065e8adf6f370eaad1f859174d72dbc344664cd09cbc8dad6fec1d0a6a01fb989047bd87377bf8404261 @@ -0,0 +1,19117 @@ +import { createRequire as __prettierCreateRequire } from "module"; +import { fileURLToPath as __prettierFileUrlToPath } from "url"; +import { dirname as __prettierDirname } from "path"; +const require = __prettierCreateRequire(import.meta.url); +const __filename = __prettierFileUrlToPath(import.meta.url); +const __dirname = __prettierDirname(__filename); + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; +var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] +}) : x)(function(x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key2 of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key2) && key2 !== except) + __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// node_modules/fast-glob/out/utils/array.js +var require_array = __commonJS({ + "node_modules/fast-glob/out/utils/array.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.splitWhen = exports.flatten = void 0; + function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); + } + exports.flatten = flatten; + function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } else { + result[groupIndex].push(item); + } + } + return result; + } + exports.splitWhen = splitWhen; + } +}); + +// node_modules/fast-glob/out/utils/errno.js +var require_errno = __commonJS({ + "node_modules/fast-glob/out/utils/errno.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isEnoentCodeError = void 0; + function isEnoentCodeError(error) { + return error.code === "ENOENT"; + } + exports.isEnoentCodeError = isEnoentCodeError; + } +}); + +// node_modules/fast-glob/out/utils/fs.js +var require_fs = __commonJS({ + "node_modules/fast-glob/out/utils/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); + } + exports.createDirentFromStats = createDirentFromStats; + } +}); + +// node_modules/fast-glob/out/utils/path.js +var require_path = __commonJS({ + "node_modules/fast-glob/out/utils/path.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; + var os = __require("os"); + var path14 = __require("path"); + var IS_WINDOWS_PLATFORM = os.platform() === "win32"; + var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; + var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; + var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; + var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; + var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; + function unixify(filepath) { + return filepath.replace(/\\/g, "/"); + } + exports.unixify = unixify; + function makeAbsolute(cwd, filepath) { + return path14.resolve(cwd, filepath); + } + exports.makeAbsolute = makeAbsolute; + function removeLeadingDotSegment(entry) { + if (entry.charAt(0) === ".") { + const secondCharactery = entry.charAt(1); + if (secondCharactery === "/" || secondCharactery === "\\") { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; + } + exports.removeLeadingDotSegment = removeLeadingDotSegment; + exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; + function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapeWindowsPath = escapeWindowsPath; + function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); + } + exports.escapePosixPath = escapePosixPath; + exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; + function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); + } + exports.convertWindowsPathToPattern = convertWindowsPathToPattern; + function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); + } + exports.convertPosixPathToPattern = convertPosixPathToPattern; + } +}); + +// node_modules/is-extglob/index.js +var require_is_extglob = __commonJS({ + "node_modules/is-extglob/index.js"(exports, module) { + module.exports = function isExtglob(str) { + if (typeof str !== "string" || str === "") { + return false; + } + var match; + while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + return false; + }; + } +}); + +// node_modules/is-glob/index.js +var require_is_glob = __commonJS({ + "node_modules/is-glob/index.js"(exports, module) { + var isExtglob = require_is_extglob(); + var chars = { "{": "}", "(": ")", "[": "]" }; + var strictCheck = function(str) { + if (str[0] === "!") { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === "*") { + return true; + } + if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) { + return true; + } + if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf("]", index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") { + closeCurlyIndex = str.indexOf("}", index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") { + closeParenIndex = str.indexOf(")", index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf("\\", index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") { + if (pipeIndex < index) { + pipeIndex = str.indexOf("|", index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") { + closeParenIndex = str.indexOf(")", pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf("\\", pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + if (str[index] === "\\") { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + if (str[index] === "!") { + return true; + } + } else { + index++; + } + } + return false; + }; + var relaxedCheck = function(str) { + if (str[0] === "!") { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + if (str[index] === "\\") { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + if (str[index] === "!") { + return true; + } + } else { + index++; + } + } + return false; + }; + module.exports = function isGlob(str, options8) { + if (typeof str !== "string" || str === "") { + return false; + } + if (isExtglob(str)) { + return true; + } + var check2 = strictCheck; + if (options8 && options8.strict === false) { + check2 = relaxedCheck; + } + return check2(str); + }; + } +}); + +// node_modules/glob-parent/index.js +var require_glob_parent = __commonJS({ + "node_modules/glob-parent/index.js"(exports, module) { + "use strict"; + var isGlob = require_is_glob(); + var pathPosixDirname = __require("path").posix.dirname; + var isWin32 = __require("os").platform() === "win32"; + var slash2 = "/"; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + module.exports = function globParent(str, opts) { + var options8 = Object.assign({ flipBackslashes: true }, opts); + if (options8.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) { + str = str.replace(backslash, slash2); + } + if (enclosure.test(str)) { + str += slash2; + } + str += "a"; + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + return str.replace(escaped, "$1"); + }; + } +}); + +// node_modules/braces/lib/utils.js +var require_utils = __commonJS({ + "node_modules/braces/lib/utils.js"(exports) { + "use strict"; + exports.isInteger = (num) => { + if (typeof num === "number") { + return Number.isInteger(num); + } + if (typeof num === "string" && num.trim() !== "") { + return Number.isInteger(Number(num)); + } + return false; + }; + exports.find = (node, type) => node.nodes.find((node2) => node2.type === type); + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return (Number(max) - Number(min)) / Number(step) >= limit; + }; + exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + if (type && node.type === type || node.type === "open" || node.type === "close") { + if (node.escaped !== true) { + node.value = "\\" + node.value; + node.escaped = true; + } + } + }; + exports.encloseBrace = (node) => { + if (node.type !== "brace") return false; + if (node.commas >> 0 + node.ranges >> 0 === 0) { + node.invalid = true; + return true; + } + return false; + }; + exports.isInvalidBrace = (block) => { + if (block.type !== "brace") return false; + if (block.invalid === true || block.dollar) return true; + if (block.commas >> 0 + block.ranges >> 0 === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + exports.isOpenOrClose = (node) => { + if (node.type === "open" || node.type === "close") { + return true; + } + return node.open === true || node.close === true; + }; + exports.reduce = (nodes) => nodes.reduce((acc, node) => { + if (node.type === "text") acc.push(node.value); + if (node.type === "range") node.type = "text"; + return acc; + }, []); + exports.flatten = (...args) => { + const result = []; + const flat = (arr) => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + if (Array.isArray(ele)) { + flat(ele); + continue; + } + if (ele !== void 0) { + result.push(ele); + } + } + return result; + }; + flat(args); + return result; + }; + } +}); + +// node_modules/braces/lib/stringify.js +var require_stringify = __commonJS({ + "node_modules/braces/lib/stringify.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = (ast, options8 = {}) => { + const stringify2 = (node, parent = {}) => { + const invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options8.escapeInvalid === true; + let output = ""; + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return "\\" + node.value; + } + return node.value; + } + if (node.value) { + return node.value; + } + if (node.nodes) { + for (const child of node.nodes) { + output += stringify2(child); + } + } + return output; + }; + return stringify2(ast); + }; + } +}); + +// node_modules/is-number/index.js +var require_is_number = __commonJS({ + "node_modules/is-number/index.js"(exports, module) { + "use strict"; + module.exports = function(num) { + if (typeof num === "number") { + return num - num === 0; + } + if (typeof num === "string" && num.trim() !== "") { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; + }; + } +}); + +// node_modules/to-regex-range/index.js +var require_to_regex_range = __commonJS({ + "node_modules/to-regex-range/index.js"(exports, module) { + "use strict"; + var isNumber = require_is_number(); + var toRegexRange = (min, max, options8) => { + if (isNumber(min) === false) { + throw new TypeError("toRegexRange: expected the first argument to be a number"); + } + if (max === void 0 || min === max) { + return String(min); + } + if (isNumber(max) === false) { + throw new TypeError("toRegexRange: expected the second argument to be a number."); + } + let opts = { relaxZeros: true, ...options8 }; + if (typeof opts.strictZeros === "boolean") { + opts.relaxZeros = opts.strictZeros === false; + } + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap; + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + let a = Math.min(min, max); + let b = Math.max(min, max); + if (Math.abs(a - b) === 1) { + let result = min + "|" + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && positives.length + negatives.length > 1) { + state.result = `(?:${state.result})`; + } + toRegexRange.cache[cacheKey] = state; + return state.result; + }; + function collatePatterns(neg, pos2, options8) { + let onlyNegative = filterPatterns(neg, pos2, "-", false, options8) || []; + let onlyPositive = filterPatterns(pos2, neg, "", false, options8) || []; + let intersected = filterPatterns(neg, pos2, "-?", true, options8) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join("|"); + } + function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + let stop = countNines(min, nines); + let stops = /* @__PURE__ */ new Set([max]); + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + stop = countZeros(max + 1, zeros) - 1; + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + stops = [...stops]; + stops.sort(compare); + return stops; + } + function rangeToPattern(start, stop, options8) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ""; + let count = 0; + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + if (startDigit === stopDigit) { + pattern += startDigit; + } else if (startDigit !== "0" || stopDigit !== "9") { + pattern += toCharacterClass(startDigit, stopDigit, options8); + } else { + count++; + } + } + if (count) { + pattern += options8.shorthand === true ? "\\d" : "[0-9]"; + } + return { pattern, count: [count], digits }; + } + function splitToPatterns(min, max, tok, options8) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + for (let i = 0; i < ranges.length; i++) { + let max2 = ranges[i]; + let obj = rangeToPattern(String(start), String(max2), options8); + let zeros = ""; + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max2 + 1; + continue; + } + if (tok.isPadded) { + zeros = padZeros(max2, tok, options8); + } + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max2 + 1; + prev = obj; + } + return tokens; + } + function filterPatterns(arr, comparison, prefix, intersection, options8) { + let result = []; + for (let ele of arr) { + let { string } = ele; + if (!intersection && !contains(comparison, "string", string)) { + result.push(prefix + string); + } + if (intersection && contains(comparison, "string", string)) { + result.push(prefix + string); + } + } + return result; + } + function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; + } + function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; + } + function contains(arr, key2, val) { + return arr.some((ele) => ele[key2] === val); + } + function countNines(min, len) { + return Number(String(min).slice(0, -len) + "9".repeat(len)); + } + function countZeros(integer, zeros) { + return integer - integer % Math.pow(10, zeros); + } + function toQuantifier(digits) { + let [start = 0, stop = ""] = digits; + if (stop || start > 1) { + return `{${start + (stop ? "," + stop : "")}}`; + } + return ""; + } + function toCharacterClass(a, b, options8) { + return `[${a}${b - a === 1 ? "" : "-"}${b}]`; + } + function hasPadding(str) { + return /^-?(0+)\d/.test(str); + } + function padZeros(value, tok, options8) { + if (!tok.isPadded) { + return value; + } + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options8.relaxZeros !== false; + switch (diff) { + case 0: + return ""; + case 1: + return relax ? "0?" : "0"; + case 2: + return relax ? "0{0,2}" : "00"; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } + } + toRegexRange.cache = {}; + toRegexRange.clearCache = () => toRegexRange.cache = {}; + module.exports = toRegexRange; + } +}); + +// node_modules/fill-range/index.js +var require_fill_range = __commonJS({ + "node_modules/fill-range/index.js"(exports, module) { + "use strict"; + var util2 = __require("util"); + var toRegexRange = require_to_regex_range(); + var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val); + var transform = (toNumber) => { + return (value) => toNumber === true ? Number(value) : String(value); + }; + var isValidValue = (value) => { + return typeof value === "number" || typeof value === "string" && value !== ""; + }; + var isNumber = (num) => Number.isInteger(+num); + var zeros = (input) => { + let value = `${input}`; + let index = -1; + if (value[0] === "-") value = value.slice(1); + if (value === "0") return false; + while (value[++index] === "0") ; + return index > 0; + }; + var stringify2 = (start, end, options8) => { + if (typeof start === "string" || typeof end === "string") { + return true; + } + return options8.stringify === true; + }; + var pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === "-" ? "-" : ""; + if (dash) input = input.slice(1); + input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0"); + } + if (toNumber === false) { + return String(input); + } + return input; + }; + var toMaxLen = (input, maxLength) => { + let negative = input[0] === "-" ? "-" : ""; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = "0" + input; + return negative ? "-" + input : input; + }; + var toSequence = (parts, options8, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + let prefix = options8.capture ? "" : "?:"; + let positives = ""; + let negatives = ""; + let result; + if (parts.positives.length) { + positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|"); + } + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`; + } + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + if (options8.wrap) { + return `(${prefix}${result})`; + } + return result; + }; + var toRange = (a, b, isNumbers, options8) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options8 }); + } + let start = String.fromCharCode(a); + if (a === b) return start; + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; + }; + var toRegex = (start, end, options8) => { + if (Array.isArray(start)) { + let wrap = options8.wrap === true; + let prefix = options8.capture ? "" : "?:"; + return wrap ? `(${prefix}${start.join("|")})` : start.join("|"); + } + return toRegexRange(start, end, options8); + }; + var rangeError = (...args) => { + return new RangeError("Invalid range arguments: " + util2.inspect(...args)); + }; + var invalidRange = (start, end, options8) => { + if (options8.strictRanges === true) throw rangeError([start, end]); + return []; + }; + var invalidStep = (step, options8) => { + if (options8.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; + }; + var fillNumbers = (start, end, step = 1, options8 = {}) => { + let a = Number(start); + let b = Number(end); + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options8.strictRanges === true) throw rangeError([start, end]); + return []; + } + if (a === 0) a = 0; + if (b === 0) b = 0; + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify2(start, end, options8) === false; + let format3 = options8.transform || transform(toNumber); + if (options8.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8); + } + let parts = { negatives: [], positives: [] }; + let push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)); + let range = []; + let index = 0; + while (descending ? a >= b : a <= b) { + if (options8.toRegex === true && step > 1) { + push2(a); + } else { + range.push(pad(format3(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + if (options8.toRegex === true) { + return step > 1 ? toSequence(parts, options8, maxLen) : toRegex(range, null, { wrap: false, ...options8 }); + } + return range; + }; + var fillLetters = (start, end, step = 1, options8 = {}) => { + if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { + return invalidRange(start, end, options8); + } + let format3 = options8.transform || ((val) => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + if (options8.toRegex && step === 1) { + return toRange(min, max, false, options8); + } + let range = []; + let index = 0; + while (descending ? a >= b : a <= b) { + range.push(format3(a, index)); + a = descending ? a - step : a + step; + index++; + } + if (options8.toRegex === true) { + return toRegex(range, null, { wrap: false, options: options8 }); + } + return range; + }; + var fill = (start, end, step, options8 = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options8); + } + if (typeof step === "function") { + return fill(start, end, 1, { transform: step }); + } + if (isObject2(step)) { + return fill(start, end, 0, step); + } + let opts = { ...options8 }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + if (!isNumber(step)) { + if (step != null && !isObject2(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); + }; + module.exports = fill; + } +}); + +// node_modules/braces/lib/compile.js +var require_compile = __commonJS({ + "node_modules/braces/lib/compile.js"(exports, module) { + "use strict"; + var fill = require_fill_range(); + var utils = require_utils(); + var compile = (ast, options8 = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options8.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options8.escapeInvalid === true ? "\\" : ""; + let output = ""; + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + console.log("node.isClose", prefix, node.value); + return prefix + node.value; + } + if (node.type === "open") { + return invalid ? prefix + node.value : "("; + } + if (node.type === "close") { + return invalid ? prefix + node.value : ")"; + } + if (node.type === "comma") { + return node.prev.type === "comma" ? "" : invalid ? node.value : "|"; + } + if (node.value) { + return node.value; + } + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options8, wrap: false, toRegex: true, strictZeros: true }); + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; + return walk(ast); + }; + module.exports = compile; + } +}); + +// node_modules/braces/lib/expand.js +var require_expand = __commonJS({ + "node_modules/braces/lib/expand.js"(exports, module) { + "use strict"; + var fill = require_fill_range(); + var stringify2 = require_stringify(); + var utils = require_utils(); + var append = (queue = "", stash = "", enclose = false) => { + const result = []; + queue = [].concat(queue); + stash = [].concat(stash); + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash; + } + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === "string") ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); + }; + var expand = (ast, options8 = {}) => { + const rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit; + const walk = (node, parent = {}) => { + node.queue = []; + let p = parent; + let q = parent.queue; + while (p.type !== "brace" && p.type !== "root" && p.parent) { + p = p.parent; + q = p.queue; + } + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify2(node, options8))); + return; + } + if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ["{}"])); + return; + } + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + if (utils.exceedsLimit(...args, options8.step, rangeLimit)) { + throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit."); + } + let range = fill(...args, options8); + if (range.length === 0) { + range = stringify2(node, options8); + } + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + while (block.type !== "brace" && block.type !== "root" && block.parent) { + block = block.parent; + queue = block.queue; + } + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + if (child.type === "comma" && node.type === "brace") { + if (i === 1) queue.push(""); + queue.push(""); + continue; + } + if (child.type === "close") { + q.push(append(q.pop(), queue, enclose)); + continue; + } + if (child.value && child.type !== "open") { + queue.push(append(queue.pop(), child.value)); + continue; + } + if (child.nodes) { + walk(child, node); + } + } + return queue; + }; + return utils.flatten(walk(ast)); + }; + module.exports = expand; + } +}); + +// node_modules/braces/lib/constants.js +var require_constants = __commonJS({ + "node_modules/braces/lib/constants.js"(exports, module) { + "use strict"; + module.exports = { + MAX_LENGTH: 1e4, + // Digits + CHAR_0: "0", + /* 0 */ + CHAR_9: "9", + /* 9 */ + // Alphabet chars. + CHAR_UPPERCASE_A: "A", + /* A */ + CHAR_LOWERCASE_A: "a", + /* a */ + CHAR_UPPERCASE_Z: "Z", + /* Z */ + CHAR_LOWERCASE_Z: "z", + /* z */ + CHAR_LEFT_PARENTHESES: "(", + /* ( */ + CHAR_RIGHT_PARENTHESES: ")", + /* ) */ + CHAR_ASTERISK: "*", + /* * */ + // Non-alphabetic chars. + CHAR_AMPERSAND: "&", + /* & */ + CHAR_AT: "@", + /* @ */ + CHAR_BACKSLASH: "\\", + /* \ */ + CHAR_BACKTICK: "`", + /* ` */ + CHAR_CARRIAGE_RETURN: "\r", + /* \r */ + CHAR_CIRCUMFLEX_ACCENT: "^", + /* ^ */ + CHAR_COLON: ":", + /* : */ + CHAR_COMMA: ",", + /* , */ + CHAR_DOLLAR: "$", + /* . */ + CHAR_DOT: ".", + /* . */ + CHAR_DOUBLE_QUOTE: '"', + /* " */ + CHAR_EQUAL: "=", + /* = */ + CHAR_EXCLAMATION_MARK: "!", + /* ! */ + CHAR_FORM_FEED: "\f", + /* \f */ + CHAR_FORWARD_SLASH: "/", + /* / */ + CHAR_HASH: "#", + /* # */ + CHAR_HYPHEN_MINUS: "-", + /* - */ + CHAR_LEFT_ANGLE_BRACKET: "<", + /* < */ + CHAR_LEFT_CURLY_BRACE: "{", + /* { */ + CHAR_LEFT_SQUARE_BRACKET: "[", + /* [ */ + CHAR_LINE_FEED: "\n", + /* \n */ + CHAR_NO_BREAK_SPACE: "\xA0", + /* \u00A0 */ + CHAR_PERCENT: "%", + /* % */ + CHAR_PLUS: "+", + /* + */ + CHAR_QUESTION_MARK: "?", + /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: ">", + /* > */ + CHAR_RIGHT_CURLY_BRACE: "}", + /* } */ + CHAR_RIGHT_SQUARE_BRACKET: "]", + /* ] */ + CHAR_SEMICOLON: ";", + /* ; */ + CHAR_SINGLE_QUOTE: "'", + /* ' */ + CHAR_SPACE: " ", + /* */ + CHAR_TAB: " ", + /* \t */ + CHAR_UNDERSCORE: "_", + /* _ */ + CHAR_VERTICAL_LINE: "|", + /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF" + /* \uFEFF */ + }; + } +}); + +// node_modules/braces/lib/parse.js +var require_parse = __commonJS({ + "node_modules/braces/lib/parse.js"(exports, module) { + "use strict"; + var stringify2 = require_stringify(); + var { + MAX_LENGTH, + CHAR_BACKSLASH, + /* \ */ + CHAR_BACKTICK, + /* ` */ + CHAR_COMMA, + /* , */ + CHAR_DOT, + /* . */ + CHAR_LEFT_PARENTHESES, + /* ( */ + CHAR_RIGHT_PARENTHESES, + /* ) */ + CHAR_LEFT_CURLY_BRACE, + /* { */ + CHAR_RIGHT_CURLY_BRACE, + /* } */ + CHAR_LEFT_SQUARE_BRACKET, + /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, + /* ] */ + CHAR_DOUBLE_QUOTE, + /* " */ + CHAR_SINGLE_QUOTE, + /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE + } = require_constants(); + var parse7 = (input, options8 = {}) => { + if (typeof input !== "string") { + throw new TypeError("Expected a string"); + } + const opts = options8 || {}; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + const ast = { type: "root", input, nodes: [] }; + const stack2 = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + const advance = () => input[index++]; + const push2 = (node) => { + if (node.type === "text" && prev.type === "dot") { + prev.type = "text"; + } + if (prev && prev.type === "text" && node.type === "text") { + prev.value += node.value; + return; + } + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + push2({ type: "bos" }); + while (index < length) { + block = stack2[stack2.length - 1]; + value = advance(); + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + if (value === CHAR_BACKSLASH) { + push2({ type: "text", value: (options8.keepEscaping ? value : "") + advance() }); + continue; + } + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push2({ type: "text", value: "\\" + value }); + continue; + } + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + let next; + while (index < length && (next = advance())) { + value += next; + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + if (brackets === 0) { + break; + } + } + } + push2({ type: "text", value }); + continue; + } + if (value === CHAR_LEFT_PARENTHESES) { + block = push2({ type: "paren", nodes: [] }); + stack2.push(block); + push2({ type: "text", value }); + continue; + } + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== "paren") { + push2({ type: "text", value }); + continue; + } + block = stack2.pop(); + push2({ type: "text", value }); + block = stack2[stack2.length - 1]; + continue; + } + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + if (options8.keepQuotes !== true) { + value = ""; + } + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + if (next === open) { + if (options8.keepQuotes === true) value += next; + break; + } + value += next; + } + push2({ type: "text", value }); + continue; + } + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true; + const brace = { + type: "brace", + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + block = push2(brace); + stack2.push(block); + push2({ type: "open", value }); + continue; + } + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== "brace") { + push2({ type: "text", value }); + continue; + } + const type = "close"; + block = stack2.pop(); + block.close = true; + push2({ type, value }); + depth--; + block = stack2[stack2.length - 1]; + continue; + } + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: "text", value: stringify2(block) }]; + } + push2({ type: "comma", value }); + block.commas++; + continue; + } + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + if (depth === 0 || siblings.length === 0) { + push2({ type: "text", value }); + continue; + } + if (prev.type === "dot") { + block.range = []; + prev.value += value; + prev.type = "range"; + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = "text"; + continue; + } + block.ranges++; + block.args = []; + continue; + } + if (prev.type === "range") { + siblings.pop(); + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + push2({ type: "dot", value }); + continue; + } + push2({ type: "text", value }); + } + do { + block = stack2.pop(); + if (block.type !== "root") { + block.nodes.forEach((node) => { + if (!node.nodes) { + if (node.type === "open") node.isOpen = true; + if (node.type === "close") node.isClose = true; + if (!node.nodes) node.type = "text"; + node.invalid = true; + } + }); + const parent = stack2[stack2.length - 1]; + const index2 = parent.nodes.indexOf(block); + parent.nodes.splice(index2, 1, ...block.nodes); + } + } while (stack2.length > 0); + push2({ type: "eos" }); + return ast; + }; + module.exports = parse7; + } +}); + +// node_modules/braces/index.js +var require_braces = __commonJS({ + "node_modules/braces/index.js"(exports, module) { + "use strict"; + var stringify2 = require_stringify(); + var compile = require_compile(); + var expand = require_expand(); + var parse7 = require_parse(); + var braces = (input, options8 = {}) => { + let output = []; + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options8); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options8)); + } + if (options8 && options8.expand === true && options8.nodupes === true) { + output = [...new Set(output)]; + } + return output; + }; + braces.parse = (input, options8 = {}) => parse7(input, options8); + braces.stringify = (input, options8 = {}) => { + if (typeof input === "string") { + return stringify2(braces.parse(input, options8), options8); + } + return stringify2(input, options8); + }; + braces.compile = (input, options8 = {}) => { + if (typeof input === "string") { + input = braces.parse(input, options8); + } + return compile(input, options8); + }; + braces.expand = (input, options8 = {}) => { + if (typeof input === "string") { + input = braces.parse(input, options8); + } + let result = expand(input, options8); + if (options8.noempty === true) { + result = result.filter(Boolean); + } + if (options8.nodupes === true) { + result = [...new Set(result)]; + } + return result; + }; + braces.create = (input, options8 = {}) => { + if (input === "" || input.length < 3) { + return [input]; + } + return options8.expand !== true ? braces.compile(input, options8) : braces.expand(input, options8); + }; + module.exports = braces; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/constants.js +var require_constants2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports, module) { + "use strict"; + var path14 = __require("path"); + var WIN_SLASH = "\\\\/"; + var WIN_NO_SLASH = `[^${WIN_SLASH}]`; + var DOT_LITERAL = "\\."; + var PLUS_LITERAL = "\\+"; + var QMARK_LITERAL = "\\?"; + var SLASH_LITERAL = "\\/"; + var ONE_CHAR = "(?=.)"; + var QMARK = "[^/]"; + var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + var START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + var NO_DOT = `(?!${DOT_LITERAL})`; + var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + var STAR = `${QMARK}*?`; + var POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + var WINDOWS_CHARS = { + ...POSIX_CHARS, + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + var POSIX_REGEX_SOURCE = { + alnum: "a-zA-Z0-9", + alpha: "a-zA-Z", + ascii: "\\x00-\\x7F", + blank: " \\t", + cntrl: "\\x00-\\x1F\\x7F", + digit: "0-9", + graph: "\\x21-\\x7E", + lower: "a-z", + print: "\\x20-\\x7E ", + punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~", + space: " \\t\\r\\n\\v\\f", + upper: "A-Z", + word: "A-Za-z0-9_", + xdigit: "A-Fa-f0-9" + }; + module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + "***": "*", + "**/**": "**", + "**/**/**": "**" + }, + // Digits + CHAR_0: 48, + /* 0 */ + CHAR_9: 57, + /* 9 */ + // Alphabet chars. + CHAR_UPPERCASE_A: 65, + /* A */ + CHAR_LOWERCASE_A: 97, + /* a */ + CHAR_UPPERCASE_Z: 90, + /* Z */ + CHAR_LOWERCASE_Z: 122, + /* z */ + CHAR_LEFT_PARENTHESES: 40, + /* ( */ + CHAR_RIGHT_PARENTHESES: 41, + /* ) */ + CHAR_ASTERISK: 42, + /* * */ + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, + /* & */ + CHAR_AT: 64, + /* @ */ + CHAR_BACKWARD_SLASH: 92, + /* \ */ + CHAR_CARRIAGE_RETURN: 13, + /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, + /* ^ */ + CHAR_COLON: 58, + /* : */ + CHAR_COMMA: 44, + /* , */ + CHAR_DOT: 46, + /* . */ + CHAR_DOUBLE_QUOTE: 34, + /* " */ + CHAR_EQUAL: 61, + /* = */ + CHAR_EXCLAMATION_MARK: 33, + /* ! */ + CHAR_FORM_FEED: 12, + /* \f */ + CHAR_FORWARD_SLASH: 47, + /* / */ + CHAR_GRAVE_ACCENT: 96, + /* ` */ + CHAR_HASH: 35, + /* # */ + CHAR_HYPHEN_MINUS: 45, + /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, + /* < */ + CHAR_LEFT_CURLY_BRACE: 123, + /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, + /* [ */ + CHAR_LINE_FEED: 10, + /* \n */ + CHAR_NO_BREAK_SPACE: 160, + /* \u00A0 */ + CHAR_PERCENT: 37, + /* % */ + CHAR_PLUS: 43, + /* + */ + CHAR_QUESTION_MARK: 63, + /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, + /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, + /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, + /* ] */ + CHAR_SEMICOLON: 59, + /* ; */ + CHAR_SINGLE_QUOTE: 39, + /* ' */ + CHAR_SPACE: 32, + /* */ + CHAR_TAB: 9, + /* \t */ + CHAR_UNDERSCORE: 95, + /* _ */ + CHAR_VERTICAL_LINE: 124, + /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, + /* \uFEFF */ + SEP: path14.sep, + /** + * Create EXTGLOB_CHARS + */ + extglobChars(chars) { + return { + "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` }, + "?": { type: "qmark", open: "(?:", close: ")?" }, + "+": { type: "plus", open: "(?:", close: ")+" }, + "*": { type: "star", open: "(?:", close: ")*" }, + "@": { type: "at", open: "(?:", close: ")" } + }; + }, + /** + * Create GLOB_CHARS + */ + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/utils.js +var require_utils2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports) { + "use strict"; + var path14 = __require("path"); + var win32 = process.platform === "win32"; + var { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = require_constants2(); + exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); + exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1"); + exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/"); + exports.removeBackslashes = (str) => { + return str.replace(REGEX_REMOVE_BACKSLASH, (match) => { + return match === "\\" ? "" : match; + }); + }; + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split(".").map(Number); + if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) { + return true; + } + return false; + }; + exports.isWindows = (options8) => { + if (options8 && typeof options8.windows === "boolean") { + return options8.windows; + } + return win32 === true || path14.sep === "\\"; + }; + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith("./")) { + output = output.slice(2); + state.prefix = "./"; + } + return output; + }; + exports.wrapOutput = (input, state = {}, options8 = {}) => { + const prepend = options8.contains ? "" : "^"; + const append = options8.contains ? "" : "$"; + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/scan.js +var require_scan = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/scan.js"(exports, module) { + "use strict"; + var utils = require_utils2(); + var { + CHAR_ASTERISK, + /* * */ + CHAR_AT, + /* @ */ + CHAR_BACKWARD_SLASH, + /* \ */ + CHAR_COMMA, + /* , */ + CHAR_DOT, + /* . */ + CHAR_EXCLAMATION_MARK, + /* ! */ + CHAR_FORWARD_SLASH, + /* / */ + CHAR_LEFT_CURLY_BRACE, + /* { */ + CHAR_LEFT_PARENTHESES, + /* ( */ + CHAR_LEFT_SQUARE_BRACKET, + /* [ */ + CHAR_PLUS, + /* + */ + CHAR_QUESTION_MARK, + /* ? */ + CHAR_RIGHT_CURLY_BRACE, + /* } */ + CHAR_RIGHT_PARENTHESES, + /* ) */ + CHAR_RIGHT_SQUARE_BRACKET + /* ] */ + } = require_constants2(); + var isPathSeparator = (code) => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + var depth = (token2) => { + if (token2.isPrefix !== true) { + token2.depth = token2.isGlobstar ? Infinity : 1; + } + }; + var scan = (input, options8) => { + const opts = options8 || {}; + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token2 = { value: "", depth: 0, isGlob: false }; + const eos = () => index >= length; + const peek2 = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + while (index < length) { + code = advance(); + let next; + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + code = advance(); + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + advance(); + continue; + } + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token2.isBrace = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + if (braces === 0) { + braceEscaped = false; + isBrace = token2.isBrace = true; + finished = true; + break; + } + } + } + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token2); + token2 = { value: "", depth: 0, isGlob: false }; + if (finished === true) continue; + if (prev === CHAR_DOT && index === start + 1) { + start += 2; + continue; + } + lastIndex = index + 1; + continue; + } + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; + if (isExtglobChar === true && peek2() === CHAR_LEFT_PARENTHESES) { + isGlob = token2.isGlob = true; + isExtglob = token2.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + code = advance(); + continue; + } + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token2.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token2.isGlobstar = true; + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_QUESTION_MARK) { + isGlob = token2.isGlob = true; + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token2.backslashes = true; + advance(); + continue; + } + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token2.isBracket = true; + isGlob = token2.isGlob = true; + finished = true; + break; + } + } + if (scanToEnd === true) { + continue; + } + break; + } + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token2.negated = true; + start++; + continue; + } + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token2.isGlob = true; + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token2.backslashes = true; + code = advance(); + continue; + } + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + if (isGlob === true) { + finished = true; + if (scanToEnd === true) { + continue; + } + break; + } + } + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + let base = str; + let prefix = ""; + let glob = ""; + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ""; + glob = str; + } else { + base = str; + } + if (base && base !== "" && base !== "/" && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token2); + } + state.tokens = tokens; + } + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== "") { + parts.push(value); + } + prevIndex = i; + } + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + state.slashes = slashes; + state.parts = parts; + } + return state; + }; + module.exports = scan; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/parse.js +var require_parse2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/parse.js"(exports, module) { + "use strict"; + var constants = require_constants2(); + var utils = require_utils2(); + var { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + var expandRange = (args, options8) => { + if (typeof options8.expandRange === "function") { + return options8.expandRange(...args, options8); + } + args.sort(); + const value = `[${args.join("-")}]`; + try { + new RegExp(value); + } catch (ex) { + return args.map((v) => utils.escapeRegex(v)).join(".."); + } + return value; + }; + var syntaxError2 = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + var parse7 = (input, options8) => { + if (typeof input !== "string") { + throw new TypeError("Expected a string"); + } + input = REPLACEMENTS[input] || input; + const opts = { ...options8 }; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + const bos = { type: "bos", value: "", output: opts.prepend || "" }; + const tokens = [bos]; + const capture = opts.capture ? "" : "?:"; + const win32 = utils.isWindows(options8); + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + const globstar = (opts2) => { + return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + const nodot = opts.dot ? "" : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + if (opts.capture) { + star = `(${star})`; + } + if (typeof opts.noext === "boolean") { + opts.noextglob = opts.noext; + } + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: "", + output: "", + prefix: "", + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + input = utils.removePrefix(input, state); + len = input.length; + const extglobs = []; + const braces = []; + const stack2 = []; + let prev = bos; + let value; + const eos = () => state.index === len - 1; + const peek2 = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ""; + const remaining = () => input.slice(state.index + 1); + const consume = (value2 = "", num = 0) => { + state.consumed += value2; + state.index += num; + }; + const append = (token2) => { + state.output += token2.output != null ? token2.output : token2.value; + consume(token2.value); + }; + const negate = () => { + let count = 1; + while (peek2() === "!" && (peek2(2) !== "(" || peek2(3) === "?")) { + advance(); + state.start++; + count++; + } + if (count % 2 === 0) { + return false; + } + state.negated = true; + state.start++; + return true; + }; + const increment = (type) => { + state[type]++; + stack2.push(type); + }; + const decrement = (type) => { + state[type]--; + stack2.pop(); + }; + const push2 = (tok) => { + if (prev.type === "globstar") { + const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"); + const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren"); + if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = "star"; + prev.value = "*"; + prev.output = star; + state.output += prev.output; + } + } + if (extglobs.length && tok.type !== "paren") { + extglobs[extglobs.length - 1].inner += tok.value; + } + if (tok.value || tok.output) append(tok); + if (prev && prev.type === "text" && tok.type === "text") { + prev.value += tok.value; + prev.output = (prev.output || "") + tok.value; + return; + } + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + const extglobOpen = (type, value2) => { + const token2 = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" }; + token2.prev = prev; + token2.parens = state.parens; + token2.output = state.output; + const output = (opts.capture ? "(" : "") + token2.open; + increment("parens"); + push2({ type, value: value2, output: state.output ? "" : ONE_CHAR }); + push2({ type: "paren", extglob: true, value: advance(), output }); + extglobs.push(token2); + }; + const extglobClose = (token2) => { + let output = token2.close + (opts.capture ? ")" : ""); + let rest; + if (token2.type === "negate") { + let extglobStar = star; + if (token2.inner && token2.inner.length > 1 && token2.inner.includes("/")) { + extglobStar = globstar(opts); + } + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token2.close = `)$))${extglobStar}`; + } + if (token2.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + const expression = parse7(rest, { ...options8, fastpaths: false }).output; + output = token2.close = `)${expression})${extglobStar})`; + } + if (token2.prev.type === "bos") { + state.negatedExtglob = true; + } + } + push2({ type: "paren", extglob: true, value, output }); + decrement("parens"); + }; + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === "\\") { + backslashes = true; + return m; + } + if (first === "?") { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ""); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); + } + return QMARK.repeat(chars.length); + } + if (first === ".") { + return DOT_LITERAL.repeat(chars.length); + } + if (first === "*") { + if (esc) { + return esc + first + (rest ? star : ""); + } + return star; + } + return esc ? m : `\\${m}`; + }); + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ""); + } else { + output = output.replace(/\\+/g, (m) => { + return m.length % 2 === 0 ? "\\\\" : m ? "\\" : ""; + }); + } + } + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + state.output = utils.wrapOutput(output, state, options8); + return state; + } + while (!eos()) { + value = advance(); + if (value === "\0") { + continue; + } + if (value === "\\") { + const next = peek2(); + if (next === "/" && opts.bash !== true) { + continue; + } + if (next === "." || next === ";") { + continue; + } + if (!next) { + value += "\\"; + push2({ type: "text", value }); + continue; + } + const match = /^\\+/.exec(remaining()); + let slashes = 0; + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += "\\"; + } + } + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + if (state.brackets === 0) { + push2({ type: "text", value }); + continue; + } + } + if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) { + if (opts.posix !== false && value === ":") { + const inner = prev.value.slice(1); + if (inner.includes("[")) { + prev.posix = true; + if (inner.includes(":")) { + const idx = prev.value.lastIndexOf("["); + const pre = prev.value.slice(0, idx); + const rest2 = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest2]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + if (value === "[" && peek2() !== ":" || value === "-" && peek2() === "]") { + value = `\\${value}`; + } + if (value === "]" && (prev.value === "[" || prev.value === "[^")) { + value = `\\${value}`; + } + if (opts.posix === true && value === "!" && prev.value === "[") { + value = "^"; + } + prev.value += value; + append({ value }); + continue; + } + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push2({ type: "text", value }); + } + continue; + } + if (value === "(") { + increment("parens"); + push2({ type: "paren", value }); + continue; + } + if (value === ")") { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("opening", "(")); + } + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + push2({ type: "paren", value, output: state.parens ? ")" : "\\)" }); + decrement("parens"); + continue; + } + if (value === "[") { + if (opts.nobracket === true || !remaining().includes("]")) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("closing", "]")); + } + value = `\\${value}`; + } else { + increment("brackets"); + } + push2({ type: "bracket", value }); + continue; + } + if (value === "]") { + if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) { + push2({ type: "text", value, output: `\\${value}` }); + continue; + } + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError2("opening", "[")); + } + push2({ type: "text", value, output: `\\${value}` }); + continue; + } + decrement("brackets"); + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) { + value = `/${value}`; + } + prev.value += value; + append({ value }); + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + if (value === "{" && opts.nobrace !== true) { + increment("braces"); + const open = { + type: "brace", + value, + output: "(", + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + braces.push(open); + push2(open); + continue; + } + if (value === "}") { + const brace = braces[braces.length - 1]; + if (opts.nobrace === true || !brace) { + push2({ type: "text", value, output: value }); + continue; + } + let output = ")"; + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === "brace") { + break; + } + if (arr[i].type !== "dots") { + range.unshift(arr[i].value); + } + } + output = expandRange(range, opts); + state.backtrack = true; + } + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = "\\{"; + value = output = "\\}"; + state.output = out; + for (const t of toks) { + state.output += t.output || t.value; + } + } + push2({ type: "brace", value, output }); + decrement("braces"); + braces.pop(); + continue; + } + if (value === "|") { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push2({ type: "text", value }); + continue; + } + if (value === ",") { + let output = value; + const brace = braces[braces.length - 1]; + if (brace && stack2[stack2.length - 1] === "braces") { + brace.comma = true; + output = "|"; + } + push2({ type: "comma", value, output }); + continue; + } + if (value === "/") { + if (prev.type === "dot" && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ""; + state.output = ""; + tokens.pop(); + prev = bos; + continue; + } + push2({ type: "slash", value, output: SLASH_LITERAL }); + continue; + } + if (value === ".") { + if (state.braces > 0 && prev.type === "dot") { + if (prev.value === ".") prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = "dots"; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") { + push2({ type: "text", value, output: DOT_LITERAL }); + continue; + } + push2({ type: "dot", value, output: DOT_LITERAL }); + continue; + } + if (value === "?") { + const isGroup = prev && prev.value === "("; + if (!isGroup && opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + extglobOpen("qmark", value); + continue; + } + if (prev && prev.type === "paren") { + const next = peek2(); + let output = value; + if (next === "<" && !utils.supportsLookbehinds()) { + throw new Error("Node.js v10 or higher is required for regex lookbehinds"); + } + if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) { + output = `\\${value}`; + } + push2({ type: "text", value, output }); + continue; + } + if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) { + push2({ type: "qmark", value, output: QMARK_NO_DOT }); + continue; + } + push2({ type: "qmark", value, output: QMARK }); + continue; + } + if (value === "!") { + if (opts.noextglob !== true && peek2() === "(") { + if (peek2(2) !== "?" || !/[!=<:]/.test(peek2(3))) { + extglobOpen("negate", value); + continue; + } + } + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + if (value === "+") { + if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + extglobOpen("plus", value); + continue; + } + if (prev && prev.value === "(" || opts.regex === false) { + push2({ type: "plus", value, output: PLUS_LITERAL }); + continue; + } + if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) { + push2({ type: "plus", value }); + continue; + } + push2({ type: "plus", value: PLUS_LITERAL }); + continue; + } + if (value === "@") { + if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") { + push2({ type: "at", extglob: true, value, output: "" }); + continue; + } + push2({ type: "text", value }); + continue; + } + if (value !== "*") { + if (value === "$" || value === "^") { + value = `\\${value}`; + } + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + push2({ type: "text", value }); + continue; + } + if (prev && (prev.type === "globstar" || prev.star === true)) { + prev.type = "star"; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen("star", value); + continue; + } + if (prev.type === "star") { + if (opts.noglobstar === true) { + consume(value); + continue; + } + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === "slash" || prior.type === "bos"; + const afterStar = before && (before.type === "star" || before.type === "globstar"); + if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) { + push2({ type: "star", value, output: "" }); + continue; + } + const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"); + const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren"); + if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) { + push2({ type: "star", value, output: "" }); + continue; + } + while (rest.slice(0, 3) === "/**") { + const after = input[state.index + 4]; + if (after && after !== "/") { + break; + } + rest = rest.slice(3); + consume("/**", 3); + } + if (prior.type === "bos" && eos()) { + prev.type = "globstar"; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + prev.type = "globstar"; + prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") { + const end = rest[1] !== void 0 ? "|$" : ""; + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + prev.type = "globstar"; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + state.output += prior.output + prev.output; + state.globstar = true; + consume(value + advance()); + push2({ type: "slash", value: "/", output: "" }); + continue; + } + if (prior.type === "bos" && rest[0] === "/") { + prev.type = "globstar"; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push2({ type: "slash", value: "/", output: "" }); + continue; + } + state.output = state.output.slice(0, -prev.output.length); + prev.type = "globstar"; + prev.output = globstar(opts); + prev.value += value; + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + const token2 = { type: "star", value, output: star }; + if (opts.bash === true) { + token2.output = ".*?"; + if (prev.type === "bos" || prev.type === "slash") { + token2.output = nodot + token2.output; + } + push2(token2); + continue; + } + if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) { + token2.output = value; + push2(token2); + continue; + } + if (state.index === state.start || prev.type === "slash" || prev.type === "dot") { + if (prev.type === "dot") { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + } else { + state.output += nodot; + prev.output += nodot; + } + if (peek2() !== "*") { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + push2(token2); + } + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]")); + state.output = utils.escapeLast(state.output, "["); + decrement("brackets"); + } + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")")); + state.output = utils.escapeLast(state.output, "("); + decrement("parens"); + } + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}")); + state.output = utils.escapeLast(state.output, "{"); + decrement("braces"); + } + if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) { + push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }); + } + if (state.backtrack === true) { + state.output = ""; + for (const token2 of state.tokens) { + state.output += token2.output != null ? token2.output : token2.value; + if (token2.suffix) { + state.output += token2.suffix; + } + } + } + return state; + }; + parse7.fastpaths = (input, options8) => { + const opts = { ...options8 }; + const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options8); + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? "" : "?:"; + const state = { negated: false, prefix: "" }; + let star = opts.bash === true ? ".*?" : STAR; + if (opts.capture) { + star = `(${star})`; + } + const globstar = (opts2) => { + if (opts2.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + const create = (str) => { + switch (str) { + case "*": + return `${nodot}${ONE_CHAR}${star}`; + case ".*": + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + case "*.*": + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + case "*/*": + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + case "**": + return nodot + globstar(opts); + case "**/*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + case "**/*.*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + case "**/.*": + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + const source3 = create(match[1]); + if (!source3) return; + return source3 + DOT_LITERAL + match[2]; + } + } + }; + const output = utils.removePrefix(input, state); + let source2 = create(output); + if (source2 && opts.strictSlashes !== true) { + source2 += `${SLASH_LITERAL}?`; + } + return source2; + }; + module.exports = parse7; + } +}); + +// node_modules/micromatch/node_modules/picomatch/lib/picomatch.js +var require_picomatch = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports, module) { + "use strict"; + var path14 = __require("path"); + var scan = require_scan(); + var parse7 = require_parse2(); + var utils = require_utils2(); + var constants = require_constants2(); + var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val); + var picomatch = (glob, options8, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map((input) => picomatch(input, options8, returnState)); + const arrayMatcher = (str) => { + for (const isMatch of fns) { + const state2 = isMatch(str); + if (state2) return state2; + } + return false; + }; + return arrayMatcher; + } + const isState = isObject2(glob) && glob.tokens && glob.input; + if (glob === "" || typeof glob !== "string" && !isState) { + throw new TypeError("Expected pattern to be a non-empty string"); + } + const opts = options8 || {}; + const posix = utils.isWindows(options8); + const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true); + const state = regex.state; + delete regex.state; + let isIgnored2 = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null }; + isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState); + } + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + if (typeof opts.onResult === "function") { + opts.onResult(result); + } + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + if (isIgnored2(input)) { + if (typeof opts.onIgnore === "function") { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + if (typeof opts.onMatch === "function") { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + if (returnState) { + matcher.state = state; + } + return matcher; + }; + picomatch.test = (input, regex, options8, { glob, posix } = {}) => { + if (typeof input !== "string") { + throw new TypeError("Expected input to be a string"); + } + if (input === "") { + return { isMatch: false, output: "" }; + } + const opts = options8 || {}; + const format3 = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = match && format3 ? format3(input) : input; + if (match === false) { + output = format3 ? format3(input) : input; + match = output === glob; + } + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options8, posix); + } else { + match = regex.exec(output); + } + } + return { isMatch: Boolean(match), match, output }; + }; + picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8); + return regex.test(path14.basename(input)); + }; + picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str); + picomatch.parse = (pattern, options8) => { + if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options8)); + return parse7(pattern, { ...options8, fastpaths: false }); + }; + picomatch.scan = (input, options8) => scan(input, options8); + picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + const opts = options8 || {}; + const prepend = opts.contains ? "" : "^"; + const append = opts.contains ? "" : "$"; + let source2 = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source2 = `^(?!${source2}).*$`; + } + const regex = picomatch.toRegex(source2, options8); + if (returnState === true) { + regex.state = state; + } + return regex; + }; + picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== "string") { + throw new TypeError("Expected a non-empty string"); + } + let parsed = { negated: false, fastpaths: true }; + if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) { + parsed.output = parse7.fastpaths(input, options8); + } + if (!parsed.output) { + parsed = parse7(input, options8); + } + return picomatch.compileRe(parsed, options8, returnOutput, returnState); + }; + picomatch.toRegex = (source2, options8) => { + try { + const opts = options8 || {}; + return new RegExp(source2, opts.flags || (opts.nocase ? "i" : "")); + } catch (err) { + if (options8 && options8.debug === true) throw err; + return /$^/; + } + }; + picomatch.constants = constants; + module.exports = picomatch; + } +}); + +// node_modules/micromatch/node_modules/picomatch/index.js +var require_picomatch2 = __commonJS({ + "node_modules/micromatch/node_modules/picomatch/index.js"(exports, module) { + "use strict"; + module.exports = require_picomatch(); + } +}); + +// node_modules/micromatch/index.js +var require_micromatch = __commonJS({ + "node_modules/micromatch/index.js"(exports, module) { + "use strict"; + var util2 = __require("util"); + var braces = require_braces(); + var picomatch = require_picomatch2(); + var utils = require_utils2(); + var isEmptyString = (v) => v === "" || v === "./"; + var hasBraces = (v) => { + const index = v.indexOf("{"); + return index > -1 && v.indexOf("}", index) > -1; + }; + var micromatch2 = (list, patterns, options8) => { + patterns = [].concat(patterns); + list = [].concat(list); + let omit2 = /* @__PURE__ */ new Set(); + let keep = /* @__PURE__ */ new Set(); + let items = /* @__PURE__ */ new Set(); + let negatives = 0; + let onResult = (state) => { + items.add(state.output); + if (options8 && options8.onResult) { + options8.onResult(state); + } + }; + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; + for (let item of list) { + let matched = isMatch(item, true); + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; + if (negated) { + omit2.add(matched.output); + } else { + omit2.delete(matched.output); + keep.add(matched.output); + } + } + } + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter((item) => !omit2.has(item)); + if (options8 && matches.length === 0) { + if (options8.failglob === true) { + throw new Error(`No matches found for "${patterns.join(", ")}"`); + } + if (options8.nonull === true || options8.nullglob === true) { + return options8.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns; + } + } + return matches; + }; + micromatch2.match = micromatch2; + micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8); + micromatch2.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str); + micromatch2.any = micromatch2.isMatch; + micromatch2.not = (list, patterns, options8 = {}) => { + patterns = [].concat(patterns).map(String); + let result = /* @__PURE__ */ new Set(); + let items = []; + let onResult = (state) => { + if (options8.onResult) options8.onResult(state); + items.push(state.output); + }; + let matches = new Set(micromatch2(list, patterns, { ...options8, onResult })); + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; + }; + micromatch2.contains = (str, pattern, options8) => { + if (typeof str !== "string") { + throw new TypeError(`Expected a string: "${util2.inspect(str)}"`); + } + if (Array.isArray(pattern)) { + return pattern.some((p) => micromatch2.contains(str, p, options8)); + } + if (typeof pattern === "string") { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } + if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) { + return true; + } + } + return micromatch2.isMatch(str, pattern, { ...options8, contains: true }); + }; + micromatch2.matchKeys = (obj, patterns, options8) => { + if (!utils.isObject(obj)) { + throw new TypeError("Expected the first argument to be an object"); + } + let keys = micromatch2(Object.keys(obj), patterns, options8); + let res = {}; + for (let key2 of keys) res[key2] = obj[key2]; + return res; + }; + micromatch2.some = (list, patterns, options8) => { + let items = [].concat(list); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options8); + if (items.some((item) => isMatch(item))) { + return true; + } + } + return false; + }; + micromatch2.every = (list, patterns, options8) => { + let items = [].concat(list); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options8); + if (!items.every((item) => isMatch(item))) { + return false; + } + } + return true; + }; + micromatch2.all = (str, patterns, options8) => { + if (typeof str !== "string") { + throw new TypeError(`Expected a string: "${util2.inspect(str)}"`); + } + return [].concat(patterns).every((p) => picomatch(p, options8)(str)); + }; + micromatch2.capture = (glob, input, options8) => { + let posix = utils.isWindows(options8); + let regex = picomatch.makeRe(String(glob), { ...options8, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); + if (match) { + return match.slice(1).map((v) => v === void 0 ? "" : v); + } + }; + micromatch2.makeRe = (...args) => picomatch.makeRe(...args); + micromatch2.scan = (...args) => picomatch.scan(...args); + micromatch2.parse = (patterns, options8) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces(String(pattern), options8)) { + res.push(picomatch.parse(str, options8)); + } + } + return res; + }; + micromatch2.braces = (pattern, options8) => { + if (typeof pattern !== "string") throw new TypeError("Expected a string"); + if (options8 && options8.nobrace === true || !hasBraces(pattern)) { + return [pattern]; + } + return braces(pattern, options8); + }; + micromatch2.braceExpand = (pattern, options8) => { + if (typeof pattern !== "string") throw new TypeError("Expected a string"); + return micromatch2.braces(pattern, { ...options8, expand: true }); + }; + micromatch2.hasBraces = hasBraces; + module.exports = micromatch2; + } +}); + +// node_modules/fast-glob/out/utils/pattern.js +var require_pattern = __commonJS({ + "node_modules/fast-glob/out/utils/pattern.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; + var path14 = __require("path"); + var globParent = require_glob_parent(); + var micromatch2 = require_micromatch(); + var GLOBSTAR = "**"; + var ESCAPE_SYMBOL = "\\"; + var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; + var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; + var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; + var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; + var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; + var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; + function isStaticPattern(pattern, options8 = {}) { + return !isDynamicPattern(pattern, options8); + } + exports.isStaticPattern = isStaticPattern; + function isDynamicPattern(pattern, options8 = {}) { + if (pattern === "") { + return false; + } + if (options8.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options8.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options8.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; + } + return false; + } + exports.isDynamicPattern = isDynamicPattern; + function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf("{"); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); + } + function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; + } + exports.convertToPositivePattern = convertToPositivePattern; + function convertToNegativePattern(pattern) { + return "!" + pattern; + } + exports.convertToNegativePattern = convertToNegativePattern; + function isNegativePattern(pattern) { + return pattern.startsWith("!") && pattern[1] !== "("; + } + exports.isNegativePattern = isNegativePattern; + function isPositivePattern(pattern) { + return !isNegativePattern(pattern); + } + exports.isPositivePattern = isPositivePattern; + function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); + } + exports.getNegativePatterns = getNegativePatterns; + function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); + } + exports.getPositivePatterns = getPositivePatterns; + function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); + } + exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; + function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); + } + exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; + function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith("..") || pattern.startsWith("./.."); + } + exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; + function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); + } + exports.getBaseDirectory = getBaseDirectory; + function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); + } + exports.hasGlobStar = hasGlobStar; + function endsWithSlashGlobStar(pattern) { + return pattern.endsWith("/" + GLOBSTAR); + } + exports.endsWithSlashGlobStar = endsWithSlashGlobStar; + function isAffectDepthOfReadingPattern(pattern) { + const basename = path14.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); + } + exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; + function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); + } + exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; + function expandBraceExpansion(pattern) { + const patterns = micromatch2.braces(pattern, { expand: true, nodupes: true, keepEscaping: true }); + patterns.sort((a, b) => a.length - b.length); + return patterns.filter((pattern2) => pattern2 !== ""); + } + exports.expandBraceExpansion = expandBraceExpansion; + function getPatternParts(pattern, options8) { + let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({}, options8), { parts: true })); + if (parts.length === 0) { + parts = [pattern]; + } + if (parts[0].startsWith("/")) { + parts[0] = parts[0].slice(1); + parts.unshift(""); + } + return parts; + } + exports.getPatternParts = getPatternParts; + function makeRe(pattern, options8) { + return micromatch2.makeRe(pattern, options8); + } + exports.makeRe = makeRe; + function convertPatternsToRe(patterns, options8) { + return patterns.map((pattern) => makeRe(pattern, options8)); + } + exports.convertPatternsToRe = convertPatternsToRe; + function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); + } + exports.matchAny = matchAny; + function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, "/"); + } + exports.removeDuplicateSlashes = removeDuplicateSlashes; + function partitionAbsoluteAndRelative(patterns) { + const absolute = []; + const relative2 = []; + for (const pattern of patterns) { + if (isAbsolute(pattern)) { + absolute.push(pattern); + } else { + relative2.push(pattern); + } + } + return [absolute, relative2]; + } + exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative; + function isAbsolute(pattern) { + return path14.isAbsolute(pattern); + } + exports.isAbsolute = isAbsolute; + } +}); + +// node_modules/merge2/index.js +var require_merge2 = __commonJS({ + "node_modules/merge2/index.js"(exports, module) { + "use strict"; + var Stream = __require("stream"); + var PassThrough = Stream.PassThrough; + var slice = Array.prototype.slice; + module.exports = merge2; + function merge2() { + const streamsQueue = []; + const args = slice.call(arguments); + let merging = false; + let options8 = args[args.length - 1]; + if (options8 && !Array.isArray(options8) && options8.pipe == null) { + args.pop(); + } else { + options8 = {}; + } + const doEnd = options8.end !== false; + const doPipeError = options8.pipeError === true; + if (options8.objectMode == null) { + options8.objectMode = true; + } + if (options8.highWaterMark == null) { + options8.highWaterMark = 64 * 1024; + } + const mergedStream = PassThrough(options8); + function addStream() { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options8)); + } + mergeStream(); + return this; + } + function mergeStream() { + if (merging) { + return; + } + merging = true; + let streams = streamsQueue.shift(); + if (!streams) { + process.nextTick(endStream); + return; + } + if (!Array.isArray(streams)) { + streams = [streams]; + } + let pipesCount = streams.length + 1; + function next() { + if (--pipesCount > 0) { + return; + } + merging = false; + mergeStream(); + } + function pipe(stream) { + function onend() { + stream.removeListener("merge2UnpipeEnd", onend); + stream.removeListener("end", onend); + if (doPipeError) { + stream.removeListener("error", onerror); + } + next(); + } + function onerror(err) { + mergedStream.emit("error", err); + } + if (stream._readableState.endEmitted) { + return next(); + } + stream.on("merge2UnpipeEnd", onend); + stream.on("end", onend); + if (doPipeError) { + stream.on("error", onerror); + } + stream.pipe(mergedStream, { end: false }); + stream.resume(); + } + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]); + } + next(); + } + function endStream() { + merging = false; + mergedStream.emit("queueDrain"); + if (doEnd) { + mergedStream.end(); + } + } + mergedStream.setMaxListeners(0); + mergedStream.add = addStream; + mergedStream.on("unpipe", function(stream) { + stream.emit("merge2UnpipeEnd"); + }); + if (args.length) { + addStream.apply(null, args); + } + return mergedStream; + } + function pauseStreams(streams, options8) { + if (!Array.isArray(streams)) { + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options8)); + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error("Only readable stream can be merged."); + } + streams.pause(); + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options8); + } + } + return streams; + } + } +}); + +// node_modules/fast-glob/out/utils/stream.js +var require_stream = __commonJS({ + "node_modules/fast-glob/out/utils/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = void 0; + var merge2 = require_merge2(); + function merge(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once("error", (error) => mergedStream.emit("error", error)); + }); + mergedStream.once("close", () => propagateCloseEventToSources(streams)); + mergedStream.once("end", () => propagateCloseEventToSources(streams)); + return mergedStream; + } + exports.merge = merge; + function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit("close")); + } + } +}); + +// node_modules/fast-glob/out/utils/string.js +var require_string = __commonJS({ + "node_modules/fast-glob/out/utils/string.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isEmpty = exports.isString = void 0; + function isString(input) { + return typeof input === "string"; + } + exports.isString = isString; + function isEmpty(input) { + return input === ""; + } + exports.isEmpty = isEmpty; + } +}); + +// node_modules/fast-glob/out/utils/index.js +var require_utils3 = __commonJS({ + "node_modules/fast-glob/out/utils/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; + var array2 = require_array(); + exports.array = array2; + var errno = require_errno(); + exports.errno = errno; + var fs4 = require_fs(); + exports.fs = fs4; + var path14 = require_path(); + exports.path = path14; + var pattern = require_pattern(); + exports.pattern = pattern; + var stream = require_stream(); + exports.stream = stream; + var string = require_string(); + exports.string = string; + } +}); + +// node_modules/fast-glob/out/managers/tasks.js +var require_tasks = __commonJS({ + "node_modules/fast-glob/out/managers/tasks.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; + var utils = require_utils3(); + function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks( + staticPatterns, + negativePatterns, + /* dynamic */ + false + ); + const dynamicTasks = convertPatternsToTasks( + dynamicPatterns, + negativePatterns, + /* dynamic */ + true + ); + return staticTasks.concat(dynamicTasks); + } + exports.generate = generate; + function processPatterns(input, settings) { + let patterns = input; + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); + } + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); + } + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); + } + function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + if ("." in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); + } else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; + } + exports.convertPatternsToTasks = convertPatternsToTasks; + function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); + } + exports.getPositivePatterns = getPositivePatterns; + function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; + } + exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; + function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } else { + collection[base] = [pattern]; + } + return collection; + }, group); + } + exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; + function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); + } + exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; + function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; + } + exports.convertPatternGroupToTask = convertPatternGroupToTask; + } +}); + +// node_modules/@nodelib/fs.stat/out/providers/async.js +var require_async = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.read = void 0; + function read3(path14, settings, callback) { + settings.fs.lstat(path14, (lstatError, lstat2) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat2.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat2); + return; + } + settings.fs.stat(path14, (statError, stat2) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat2); + return; + } + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat2); + }); + }); + } + exports.read = read3; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, result) { + callback(null, result); + } + } +}); + +// node_modules/@nodelib/fs.stat/out/providers/sync.js +var require_sync = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.read = void 0; + function read3(path14, settings) { + const lstat2 = settings.fs.lstatSync(path14); + if (!lstat2.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat2; + } + try { + const stat2 = settings.fs.statSync(path14); + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; + } + return stat2; + } catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat2; + } + throw error; + } + } + exports.read = read3; + } +}); + +// node_modules/@nodelib/fs.stat/out/adapters/fs.js +var require_fs2 = __commonJS({ + "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs4 = __require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs4.lstat, + stat: fs4.stat, + lstatSync: fs4.lstatSync, + statSync: fs4.statSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; + } +}); + +// node_modules/@nodelib/fs.stat/out/settings.js +var require_settings = __commonJS({ + "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs4 = require_fs2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs4.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.stat/out/index.js +var require_out = __commonJS({ + "node_modules/@nodelib/fs.stat/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.statSync = exports.stat = exports.Settings = void 0; + var async = require_async(); + var sync = require_sync(); + var settings_1 = require_settings(); + exports.Settings = settings_1.default; + function stat2(path14, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path14, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path14, getSettings(optionsOrSettingsOrCallback), callback); + } + exports.stat = stat2; + function statSync2(path14, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path14, settings); + } + exports.statSync = statSync2; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/queue-microtask/index.js +var require_queue_microtask = __commonJS({ + "node_modules/queue-microtask/index.js"(exports, module) { + var promise; + module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { + throw err; + }, 0)); + } +}); + +// node_modules/run-parallel/index.js +var require_run_parallel = __commonJS({ + "node_modules/run-parallel/index.js"(exports, module) { + module.exports = runParallel; + var queueMicrotask2 = require_queue_microtask(); + function runParallel(tasks, cb) { + let results, pending, keys; + let isSync = true; + if (Array.isArray(tasks)) { + results = []; + pending = tasks.length; + } else { + keys = Object.keys(tasks); + results = {}; + pending = keys.length; + } + function done(err) { + function end() { + if (cb) cb(err, results); + cb = null; + } + if (isSync) queueMicrotask2(end); + else end(); + } + function each(i, err, result) { + results[i] = result; + if (--pending === 0 || err) { + done(err); + } + } + if (!pending) { + done(null); + } else if (keys) { + keys.forEach(function(key2) { + tasks[key2](function(err, result) { + each(key2, err, result); + }); + }); + } else { + tasks.forEach(function(task, i) { + task(function(err, result) { + each(i, err, result); + }); + }); + } + isSync = false; + } + } +}); + +// node_modules/@nodelib/fs.scandir/out/constants.js +var require_constants3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; + var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); + if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); + } + var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); + var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); + var SUPPORTED_MAJOR_VERSION = 10; + var SUPPORTED_MINOR_VERSION = 10; + var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; + var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; + } +}); + +// node_modules/@nodelib/fs.scandir/out/utils/fs.js +var require_fs3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); + } + exports.createDirentFromStats = createDirentFromStats; + } +}); + +// node_modules/@nodelib/fs.scandir/out/utils/index.js +var require_utils4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.fs = void 0; + var fs4 = require_fs3(); + exports.fs = fs4; + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/common.js +var require_common = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.joinPathSegments = void 0; + function joinPathSegments(a, b, separator) { + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; + } + exports.joinPathSegments = joinPathSegments; + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/async.js +var require_async2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var rpl = require_run_parallel(); + var constants_1 = require_constants3(); + var utils = require_utils4(); + var common = require_common(); + function read3(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); + } + exports.read = read3; + function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; + } + function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path14 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path14, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path: path14, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); + } + exports.readdir = readdir; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, result) { + callback(null, result); + } + } +}); + +// node_modules/@nodelib/fs.scandir/out/providers/sync.js +var require_sync2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var constants_1 = require_constants3(); + var utils = require_utils4(); + var common = require_common(); + function read3(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); + } + exports.read = read3; + function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); + } + exports.readdir = readdir; + } +}); + +// node_modules/@nodelib/fs.scandir/out/adapters/fs.js +var require_fs4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs4 = __require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs4.lstat, + stat: fs4.stat, + lstatSync: fs4.lstatSync, + statSync: fs4.statSync, + readdir: fs4.readdir, + readdirSync: fs4.readdirSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; + } +}); + +// node_modules/@nodelib/fs.scandir/out/settings.js +var require_settings2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path14 = __require("path"); + var fsStat = require_out(); + var fs4 = require_fs4(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs4.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path14.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.scandir/out/index.js +var require_out2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.scandirSync = exports.scandir = void 0; + var async = require_async2(); + var sync = require_sync2(); + var settings_1 = require_settings2(); + exports.Settings = settings_1.default; + function scandir(path14, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path14, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path14, getSettings(optionsOrSettingsOrCallback), callback); + } + exports.scandir = scandir; + function scandirSync(path14, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path14, settings); + } + exports.scandirSync = scandirSync; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/reusify/reusify.js +var require_reusify = __commonJS({ + "node_modules/reusify/reusify.js"(exports, module) { + "use strict"; + function reusify(Constructor) { + var head = new Constructor(); + var tail = head; + function get() { + var current = head; + if (current.next) { + head = current.next; + } else { + head = new Constructor(); + tail = head; + } + current.next = null; + return current; + } + function release(obj) { + tail.next = obj; + tail = obj; + } + return { + get, + release + }; + } + module.exports = reusify; + } +}); + +// node_modules/fastq/queue.js +var require_queue = __commonJS({ + "node_modules/fastq/queue.js"(exports, module) { + "use strict"; + var reusify = require_reusify(); + function fastqueue(context, worker, _concurrency) { + if (typeof context === "function") { + _concurrency = worker; + worker = context; + context = null; + } + if (!(_concurrency >= 1)) { + throw new Error("fastqueue concurrency must be equal to or greater than 1"); + } + var cache3 = reusify(Task); + var queueHead = null; + var queueTail = null; + var _running = 0; + var errorHandler = null; + var self = { + push: push2, + drain: noop2, + saturated: noop2, + pause, + paused: false, + get concurrency() { + return _concurrency; + }, + set concurrency(value) { + if (!(value >= 1)) { + throw new Error("fastqueue concurrency must be equal to or greater than 1"); + } + _concurrency = value; + if (self.paused) return; + for (; queueHead && _running < _concurrency; ) { + _running++; + release(); + } + }, + running, + resume, + idle, + length, + getQueue, + unshift, + empty: noop2, + kill, + killAndDrain, + error + }; + return self; + function running() { + return _running; + } + function pause() { + self.paused = true; + } + function length() { + var current = queueHead; + var counter = 0; + while (current) { + current = current.next; + counter++; + } + return counter; + } + function getQueue() { + var current = queueHead; + var tasks = []; + while (current) { + tasks.push(current.value); + current = current.next; + } + return tasks; + } + function resume() { + if (!self.paused) return; + self.paused = false; + if (queueHead === null) { + _running++; + release(); + return; + } + for (; queueHead && _running < _concurrency; ) { + _running++; + release(); + } + } + function idle() { + return _running === 0 && self.length() === 0; + } + function push2(value, done) { + var current = cache3.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop2; + current.errorHandler = errorHandler; + if (_running >= _concurrency || self.paused) { + if (queueTail) { + queueTail.next = current; + queueTail = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + function unshift(value, done) { + var current = cache3.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop2; + current.errorHandler = errorHandler; + if (_running >= _concurrency || self.paused) { + if (queueHead) { + current.next = queueHead; + queueHead = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + function release(holder) { + if (holder) { + cache3.release(holder); + } + var next = queueHead; + if (next && _running <= _concurrency) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null; + } + queueHead = next.next; + next.next = null; + worker.call(context, next.value, next.worked); + if (queueTail === null) { + self.empty(); + } + } else { + _running--; + } + } else if (--_running === 0) { + self.drain(); + } + } + function kill() { + queueHead = null; + queueTail = null; + self.drain = noop2; + } + function killAndDrain() { + queueHead = null; + queueTail = null; + self.drain(); + self.drain = noop2; + } + function error(handler) { + errorHandler = handler; + } + } + function noop2() { + } + function Task() { + this.value = null; + this.callback = noop2; + this.next = null; + this.release = noop2; + this.context = null; + this.errorHandler = null; + var self = this; + this.worked = function worked(err, result) { + var callback = self.callback; + var errorHandler = self.errorHandler; + var val = self.value; + self.value = null; + self.callback = noop2; + if (self.errorHandler) { + errorHandler(err, val); + } + callback.call(self.context, err, result); + self.release(self); + }; + } + function queueAsPromised(context, worker, _concurrency) { + if (typeof context === "function") { + _concurrency = worker; + worker = context; + context = null; + } + function asyncWrapper(arg, cb) { + worker.call(this, arg).then(function(res) { + cb(null, res); + }, cb); + } + var queue = fastqueue(context, asyncWrapper, _concurrency); + var pushCb = queue.push; + var unshiftCb = queue.unshift; + queue.push = push2; + queue.unshift = unshift; + queue.drained = drained; + return queue; + function push2(value) { + var p = new Promise(function(resolve3, reject) { + pushCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve3(result); + }); + }); + p.catch(noop2); + return p; + } + function unshift(value) { + var p = new Promise(function(resolve3, reject) { + unshiftCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve3(result); + }); + }); + p.catch(noop2); + return p; + } + function drained() { + var p = new Promise(function(resolve3) { + process.nextTick(function() { + if (queue.idle()) { + resolve3(); + } else { + var previousDrain = queue.drain; + queue.drain = function() { + if (typeof previousDrain === "function") previousDrain(); + resolve3(); + queue.drain = previousDrain; + }; + } + }); + }); + return p; + } + } + module.exports = fastqueue; + module.exports.promise = queueAsPromised; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/common.js +var require_common2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; + function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); + } + exports.isFatalError = isFatalError; + function isAppliedFilter(filter2, value) { + return filter2 === null || filter2(value); + } + exports.isAppliedFilter = isAppliedFilter; + function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); + } + exports.replacePathSegmentSeparator = replacePathSegmentSeparator; + function joinPathSegments(a, b, separator) { + if (a === "") { + return b; + } + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; + } + exports.joinPathSegments = joinPathSegments; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/reader.js +var require_reader = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var common = require_common2(); + var Reader = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } + }; + exports.default = Reader; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/async.js +var require_async3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var events_1 = __require("events"); + var fsScandir = require_out2(); + var fastq = require_queue(); + var common = require_common2(); + var reader_1 = require_reader(); + var AsyncReader = class extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit("end"); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error("The reader is already destroyed"); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on("entry", callback); + } + onError(callback) { + this._emitter.once("error", callback); + } + onEnd(callback) { + this._emitter.once("end", callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, void 0); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, void 0); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit("error", error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit("entry", entry); + } + }; + exports.default = AsyncReader; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/async.js +var require_async4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async3(); + var AsyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } + }; + exports.default = AsyncProvider; + function callFailureCallback(callback, error) { + callback(error); + } + function callSuccessCallback(callback, entries) { + callback(null, entries); + } + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/stream.js +var require_stream2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var async_1 = require_async3(); + var StreamProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { + }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit("error", error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } + }; + exports.default = StreamProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/sync.js +var require_sync3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsScandir = require_out2(); + var common = require_common2(); + var reader_1 = require_reader(); + var SyncReader = class extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = /* @__PURE__ */ new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } + }; + exports.default = SyncReader; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/sync.js +var require_sync4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync3(); + var SyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } + }; + exports.default = SyncProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/settings.js +var require_settings3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path14 = __require("path"); + var fsScandir = require_out2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, void 0); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path14.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.walk/out/index.js +var require_out3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; + var async_1 = require_async4(); + var stream_1 = require_stream2(); + var sync_1 = require_sync4(); + var settings_1 = require_settings3(); + exports.Settings = settings_1.default; + function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); + } + exports.walk = walk; + function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); + } + exports.walkSync = walkSync; + function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); + } + exports.walkStream = walkStream; + function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/fast-glob/out/readers/reader.js +var require_reader2 = __commonJS({ + "node_modules/fast-glob/out/readers/reader.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path14 = __require("path"); + var fsStat = require_out(); + var utils = require_utils3(); + var Reader = class { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path14.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } + }; + exports.default = Reader; + } +}); + +// node_modules/fast-glob/out/readers/stream.js +var require_stream3 = __commonJS({ + "node_modules/fast-glob/out/readers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderStream = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; + } + dynamic(root2, options8) { + return this._walkStream(root2, options8); + } + static(patterns, options8) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options8).then((entry) => { + if (entry !== null && options8.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }).catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options8) { + return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => { + if (options8.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve3, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve3(stats) : reject(error); + }); + }); + } + }; + exports.default = ReaderStream; + } +}); + +// node_modules/fast-glob/out/readers/async.js +var require_async5 = __commonJS({ + "node_modules/fast-glob/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var stream_1 = require_stream3(); + var ReaderAsync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); + } + dynamic(root2, options8) { + return new Promise((resolve3, reject) => { + this._walkAsync(root2, options8, (error, entries) => { + if (error === null) { + resolve3(entries); + } else { + reject(error); + } + }); + }); + } + async static(patterns, options8) { + const entries = []; + const stream = this._readerStream.static(patterns, options8); + return new Promise((resolve3, reject) => { + stream.once("error", reject); + stream.on("data", (entry) => entries.push(entry)); + stream.once("end", () => resolve3(entries)); + }); + } + }; + exports.default = ReaderAsync; + } +}); + +// node_modules/fast-glob/out/providers/matchers/matcher.js +var require_matcher = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var Matcher = class { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } + }; + exports.default = Matcher; + } +}); + +// node_modules/fast-glob/out/providers/matchers/partial.js +var require_partial = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var matcher_1 = require_matcher(); + var PartialMatcher = class extends matcher_1.default { + match(filepath) { + const parts = filepath.split("/"); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } + }; + exports.default = PartialMatcher; + } +}); + +// node_modules/fast-glob/out/providers/filters/deep.js +var require_deep = __commonJS({ + "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var partial_1 = require_partial(); + var DeepFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split("/").length; + if (basePath === "") { + return entryPathDepth; + } + const basePathDepth = basePath.split("/").length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } + }; + exports.default = DeepFilter; + } +}); + +// node_modules/fast-glob/out/providers/filters/entry.js +var require_entry = __commonJS({ + "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var EntryFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = /* @__PURE__ */ new Map(); + } + getFilter(positive, negative) { + const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative); + const patterns = { + positive: { + all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions) + }, + negative: { + absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })), + relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })) + } + }; + return (entry) => this._filter(entry, patterns); + } + _filter(entry, patterns) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory()); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); + } + return isMatched; + } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); + } + _createIndexRecord(filepath) { + this.index.set(filepath, void 0); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isMatchToPatternsSet(filepath, patterns, isDirectory2) { + const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory2); + if (!isMatched) { + return false; + } + const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory2); + if (isMatchedByRelativeNegative) { + return false; + } + const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory2); + if (isMatchedByAbsoluteNegative) { + return false; + } + return true; + } + _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory2) { + if (patternsRe.length === 0) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath); + return this._isMatchToPatterns(fullpath, patternsRe, isDirectory2); + } + _isMatchToPatterns(filepath, patternsRe, isDirectory2) { + if (patternsRe.length === 0) { + return false; + } + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + if (!isMatched && isDirectory2) { + return utils.pattern.matchAny(filepath + "/", patternsRe); + } + return isMatched; + } + }; + exports.default = EntryFilter; + } +}); + +// node_modules/fast-glob/out/providers/filters/error.js +var require_error = __commonJS({ + "node_modules/fast-glob/out/providers/filters/error.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var ErrorFilter = class { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } + }; + exports.default = ErrorFilter; + } +}); + +// node_modules/fast-glob/out/providers/transformers/entry.js +var require_entry2 = __commonJS({ + "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils3(); + var EntryTransformer = class { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += "/"; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } + }; + exports.default = EntryTransformer; + } +}); + +// node_modules/fast-glob/out/providers/provider.js +var require_provider = __commonJS({ + "node_modules/fast-glob/out/providers/provider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path14 = __require("path"); + var deep_1 = require_deep(); + var entry_1 = require_entry(); + var error_1 = require_error(); + var entry_2 = require_entry2(); + var Provider = class { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path14.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === "." ? "" : task.base; + return { + basePath, + pathSegmentSeparator: "/", + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } + }; + exports.default = Provider; + } +}); + +// node_modules/fast-glob/out/providers/async.js +var require_async6 = __commonJS({ + "node_modules/fast-glob/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async5(); + var provider_1 = require_provider(); + var ProviderAsync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); + } + async read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const entries = await this.api(root2, task, options8); + return entries.map((entry) => options8.transform(entry)); + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderAsync; + } +}); + +// node_modules/fast-glob/out/providers/stream.js +var require_stream4 = __commonJS({ + "node_modules/fast-glob/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = __require("stream"); + var stream_2 = require_stream3(); + var provider_1 = require_provider(); + var ProviderStream = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const source2 = this.api(root2, task, options8); + const destination = new stream_1.Readable({ objectMode: true, read: () => { + } }); + source2.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options8.transform(entry))).once("end", () => destination.emit("end")); + destination.once("close", () => source2.destroy()); + return destination; + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderStream; + } +}); + +// node_modules/fast-glob/out/readers/sync.js +var require_sync5 = __commonJS({ + "node_modules/fast-glob/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderSync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root2, options8) { + return this._walkSync(root2, options8); + } + static(patterns, options8) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options8); + if (entry === null || !options8.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options8) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } catch (error) { + if (options8.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } + }; + exports.default = ReaderSync; + } +}); + +// node_modules/fast-glob/out/providers/sync.js +var require_sync6 = __commonJS({ + "node_modules/fast-glob/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync5(); + var provider_1 = require_provider(); + var ProviderSync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); + } + read(task) { + const root2 = this._getRootDirectory(task); + const options8 = this._getReaderOptions(task); + const entries = this.api(root2, task, options8); + return entries.map(options8.transform); + } + api(root2, task, options8) { + if (task.dynamic) { + return this._reader.dynamic(root2, options8); + } + return this._reader.static(task.patterns, options8); + } + }; + exports.default = ProviderSync; + } +}); + +// node_modules/fast-glob/out/settings.js +var require_settings4 = __commonJS({ + "node_modules/fast-glob/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; + var fs4 = __require("fs"); + var os = __require("os"); + var CPU_COUNT = Math.max(os.cpus().length, 1); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs4.lstat, + lstatSync: fs4.lstatSync, + stat: fs4.stat, + statSync: fs4.statSync, + readdir: fs4.readdir, + readdirSync: fs4.readdirSync + }; + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === void 0 ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } + }; + exports.default = Settings; + } +}); + +// node_modules/fast-glob/out/index.js +var require_out4 = __commonJS({ + "node_modules/fast-glob/out/index.js"(exports, module) { + "use strict"; + var taskManager = require_tasks(); + var async_1 = require_async6(); + var stream_1 = require_stream4(); + var sync_1 = require_sync6(); + var settings_1 = require_settings4(); + var utils = require_utils3(); + async function FastGlob(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, async_1.default, options8); + const result = await Promise.all(works); + return utils.array.flatten(result); + } + (function(FastGlob2) { + FastGlob2.glob = FastGlob2; + FastGlob2.globSync = sync; + FastGlob2.globStream = stream; + FastGlob2.async = FastGlob2; + function sync(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, sync_1.default, options8); + return utils.array.flatten(works); + } + FastGlob2.sync = sync; + function stream(source2, options8) { + assertPatternsInput(source2); + const works = getWorks(source2, stream_1.default, options8); + return utils.stream.merge(works); + } + FastGlob2.stream = stream; + function generateTasks(source2, options8) { + assertPatternsInput(source2); + const patterns = [].concat(source2); + const settings = new settings_1.default(options8); + return taskManager.generate(patterns, settings); + } + FastGlob2.generateTasks = generateTasks; + function isDynamicPattern(source2, options8) { + assertPatternsInput(source2); + const settings = new settings_1.default(options8); + return utils.pattern.isDynamicPattern(source2, settings); + } + FastGlob2.isDynamicPattern = isDynamicPattern; + function escapePath(source2) { + assertPatternsInput(source2); + return utils.path.escape(source2); + } + FastGlob2.escapePath = escapePath; + function convertPathToPattern(source2) { + assertPatternsInput(source2); + return utils.path.convertPathToPattern(source2); + } + FastGlob2.convertPathToPattern = convertPathToPattern; + let posix; + (function(posix2) { + function escapePath2(source2) { + assertPatternsInput(source2); + return utils.path.escapePosixPath(source2); + } + posix2.escapePath = escapePath2; + function convertPathToPattern2(source2) { + assertPatternsInput(source2); + return utils.path.convertPosixPathToPattern(source2); + } + posix2.convertPathToPattern = convertPathToPattern2; + })(posix = FastGlob2.posix || (FastGlob2.posix = {})); + let win32; + (function(win322) { + function escapePath2(source2) { + assertPatternsInput(source2); + return utils.path.escapeWindowsPath(source2); + } + win322.escapePath = escapePath2; + function convertPathToPattern2(source2) { + assertPatternsInput(source2); + return utils.path.convertWindowsPathToPattern(source2); + } + win322.convertPathToPattern = convertPathToPattern2; + })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); + })(FastGlob || (FastGlob = {})); + function getWorks(source2, _Provider, options8) { + const patterns = [].concat(source2); + const settings = new settings_1.default(options8); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); + } + function assertPatternsInput(input) { + const source2 = [].concat(input); + const isValidSource = source2.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError("Patterns must be a string (non empty) or an array of strings"); + } + } + module.exports = FastGlob; + } +}); + +// node_modules/picocolors/picocolors.js +var require_picocolors = __commonJS({ + "node_modules/picocolors/picocolors.js"(exports, module) { + var p = process || {}; + var argv = p.argv || []; + var env = p.env || {}; + var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI); + var formatter = (open, close, replace = open) => (input) => { + let string = "" + input, index = string.indexOf(close, open.length); + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close; + }; + var replaceClose = (string, close, replace, index) => { + let result = "", cursor2 = 0; + do { + result += string.substring(cursor2, index) + replace; + cursor2 = index + close.length; + index = string.indexOf(close, cursor2); + } while (~index); + return result + string.substring(cursor2); + }; + var createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: f("\x1B[0m", "\x1B[0m"), + bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), + dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), + italic: f("\x1B[3m", "\x1B[23m"), + underline: f("\x1B[4m", "\x1B[24m"), + inverse: f("\x1B[7m", "\x1B[27m"), + hidden: f("\x1B[8m", "\x1B[28m"), + strikethrough: f("\x1B[9m", "\x1B[29m"), + black: f("\x1B[30m", "\x1B[39m"), + red: f("\x1B[31m", "\x1B[39m"), + green: f("\x1B[32m", "\x1B[39m"), + yellow: f("\x1B[33m", "\x1B[39m"), + blue: f("\x1B[34m", "\x1B[39m"), + magenta: f("\x1B[35m", "\x1B[39m"), + cyan: f("\x1B[36m", "\x1B[39m"), + white: f("\x1B[37m", "\x1B[39m"), + gray: f("\x1B[90m", "\x1B[39m"), + bgBlack: f("\x1B[40m", "\x1B[49m"), + bgRed: f("\x1B[41m", "\x1B[49m"), + bgGreen: f("\x1B[42m", "\x1B[49m"), + bgYellow: f("\x1B[43m", "\x1B[49m"), + bgBlue: f("\x1B[44m", "\x1B[49m"), + bgMagenta: f("\x1B[45m", "\x1B[49m"), + bgCyan: f("\x1B[46m", "\x1B[49m"), + bgWhite: f("\x1B[47m", "\x1B[49m"), + blackBright: f("\x1B[90m", "\x1B[39m"), + redBright: f("\x1B[91m", "\x1B[39m"), + greenBright: f("\x1B[92m", "\x1B[39m"), + yellowBright: f("\x1B[93m", "\x1B[39m"), + blueBright: f("\x1B[94m", "\x1B[39m"), + magentaBright: f("\x1B[95m", "\x1B[39m"), + cyanBright: f("\x1B[96m", "\x1B[39m"), + whiteBright: f("\x1B[97m", "\x1B[39m"), + bgBlackBright: f("\x1B[100m", "\x1B[49m"), + bgRedBright: f("\x1B[101m", "\x1B[49m"), + bgGreenBright: f("\x1B[102m", "\x1B[49m"), + bgYellowBright: f("\x1B[103m", "\x1B[49m"), + bgBlueBright: f("\x1B[104m", "\x1B[49m"), + bgMagentaBright: f("\x1B[105m", "\x1B[49m"), + bgCyanBright: f("\x1B[106m", "\x1B[49m"), + bgWhiteBright: f("\x1B[107m", "\x1B[49m") + }; + }; + module.exports = createColors(); + module.exports.createColors = createColors; + } +}); + +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports, module) { + "use strict"; + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module.exports = debug; + } +}); + +// node_modules/semver/internal/constants.js +var require_constants4 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports, module) { + "use strict"; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports, module) { + "use strict"; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants4(); + var debug = require_debug(); + exports = module.exports = {}; + var re = exports.re = []; + var safeRe = exports.safeRe = []; + var src = exports.src = []; + var safeSrc = exports.safeSrc = []; + var t = exports.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token2, max] of safeRegexReplacements) { + value = value.split(`${token2}*`).join(`${token2}{0,${max}}`).split(`${token2}+`).join(`${token2}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name, index, value); + t[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports, module) { + "use strict"; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options8) => { + if (!options8) { + return emptyOpts; + } + if (typeof options8 !== "object") { + return looseOption; + } + return options8; + }; + module.exports = parseOptions; + } +}); + +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports, module) { + "use strict"; + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports, module) { + "use strict"; + var debug = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4(); + var { safeRe: re, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version, options8) { + options8 = parseOptions(options8); + if (version instanceof _SemVer) { + if (version.loose === !!options8.loose && version.includePrerelease === !!options8.includePrerelease) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); + } + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug("SemVer", version, options8); + this.options = options8; + this.loose = !!options8.loose; + this.includePrerelease = !!options8.includePrerelease; + const m = version.trim().match(options8.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module.exports = SemVer; + } +}); + +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports, module) { + "use strict"; + var SemVer = require_semver(); + var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); + module.exports = compare; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports, module) { + "use strict"; + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module.exports = gte; + } +}); + +// node_modules/pseudomap/pseudomap.js +var require_pseudomap = __commonJS({ + "node_modules/pseudomap/pseudomap.js"(exports, module) { + var hasOwnProperty3 = Object.prototype.hasOwnProperty; + module.exports = PseudoMap; + function PseudoMap(set2) { + if (!(this instanceof PseudoMap)) + throw new TypeError("Constructor PseudoMap requires 'new'"); + this.clear(); + if (set2) { + if (set2 instanceof PseudoMap || typeof Map === "function" && set2 instanceof Map) + set2.forEach(function(value, key2) { + this.set(key2, value); + }, this); + else if (Array.isArray(set2)) + set2.forEach(function(kv) { + this.set(kv[0], kv[1]); + }, this); + else + throw new TypeError("invalid argument"); + } + } + PseudoMap.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + Object.keys(this._data).forEach(function(k) { + if (k !== "size") + fn.call(thisp, this._data[k].value, this._data[k].key); + }, this); + }; + PseudoMap.prototype.has = function(k) { + return !!find(this._data, k); + }; + PseudoMap.prototype.get = function(k) { + var res = find(this._data, k); + return res && res.value; + }; + PseudoMap.prototype.set = function(k, v) { + set(this._data, k, v); + }; + PseudoMap.prototype.delete = function(k) { + var res = find(this._data, k); + if (res) { + delete this._data[res._index]; + this._data.size--; + } + }; + PseudoMap.prototype.clear = function() { + var data = /* @__PURE__ */ Object.create(null); + data.size = 0; + Object.defineProperty(this, "_data", { + value: data, + enumerable: false, + configurable: true, + writable: false + }); + }; + Object.defineProperty(PseudoMap.prototype, "size", { + get: function() { + return this._data.size; + }, + set: function(n) { + }, + enumerable: true, + configurable: true + }); + PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() { + throw new Error("iterators are not implemented in this version"); + }; + function same(a, b) { + return a === b || a !== a && b !== b; + } + function Entry(k, v, i) { + this.key = k; + this.value = v; + this._index = i; + } + function find(data, k) { + for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) { + if (same(data[key2].key, k)) + return data[key2]; + } + } + function set(data, k, v) { + for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) { + if (same(data[key2].key, k)) { + data[key2].value = v; + return; + } + } + data.size++; + data[key2] = new Entry(k, v, key2); + } + } +}); + +// node_modules/pseudomap/map.js +var require_map = __commonJS({ + "node_modules/pseudomap/map.js"(exports, module) { + if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test") + process.env.TEST_PSEUDOMAP = "true"; + if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) { + module.exports = Map; + } else { + module.exports = require_pseudomap(); + } + } +}); + +// node_modules/yallist/yallist.js +var require_yallist = __commonJS({ + "node_modules/yallist/yallist.js"(exports, module) { + module.exports = Yallist; + Yallist.Node = Node; + Yallist.create = Yallist; + function Yallist(list) { + var self = this; + if (!(self instanceof Yallist)) { + self = new Yallist(); + } + self.tail = null; + self.head = null; + self.length = 0; + if (list && typeof list.forEach === "function") { + list.forEach(function(item) { + self.push(item); + }); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]); + } + } + return self; + } + Yallist.prototype.removeNode = function(node) { + if (node.list !== this) { + throw new Error("removing node which does not belong to this list"); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + }; + Yallist.prototype.unshiftNode = function(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + }; + Yallist.prototype.pushNode = function(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + }; + Yallist.prototype.push = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + push2(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.unshift = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.pop = function() { + if (!this.tail) { + return void 0; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; + }; + Yallist.prototype.shift = function() { + if (!this.head) { + return void 0; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; + }; + Yallist.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + }; + Yallist.prototype.forEachReverse = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + }; + Yallist.prototype.get = function(n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + walker = walker.next; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.getReverse = function(n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + walker = walker.prev; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.map = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + }; + Yallist.prototype.mapReverse = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.tail; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + }; + Yallist.prototype.reduce = function(fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + }; + Yallist.prototype.reduceReverse = function(fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError("Reduce of empty list with no initial value"); + } + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + }; + Yallist.prototype.toArray = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + }; + Yallist.prototype.toArrayReverse = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + }; + Yallist.prototype.slice = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.sliceReverse = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev; + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.reverse = function() { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + }; + function push2(self, item) { + self.tail = new Node(item, self.tail, null, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; + } + function unshift(self, item) { + self.head = new Node(item, null, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; + } + function Node(value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list); + } + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } + } +}); + +// node_modules/editorconfig/node_modules/lru-cache/index.js +var require_lru_cache = __commonJS({ + "node_modules/editorconfig/node_modules/lru-cache/index.js"(exports, module) { + "use strict"; + module.exports = LRUCache; + var Map2 = require_map(); + var util2 = __require("util"); + var Yallist = require_yallist(); + var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1"; + var makeSymbol; + if (hasSymbol) { + makeSymbol = function(key2) { + return Symbol(key2); + }; + } else { + makeSymbol = function(key2) { + return "_" + key2; + }; + } + var MAX = makeSymbol("max"); + var LENGTH = makeSymbol("length"); + var LENGTH_CALCULATOR = makeSymbol("lengthCalculator"); + var ALLOW_STALE = makeSymbol("allowStale"); + var MAX_AGE = makeSymbol("maxAge"); + var DISPOSE = makeSymbol("dispose"); + var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet"); + var LRU_LIST = makeSymbol("lruList"); + var CACHE = makeSymbol("cache"); + function naiveLength() { + return 1; + } + function LRUCache(options8) { + if (!(this instanceof LRUCache)) { + return new LRUCache(options8); + } + if (typeof options8 === "number") { + options8 = { max: options8 }; + } + if (!options8) { + options8 = {}; + } + var max = this[MAX] = options8.max; + if (!max || !(typeof max === "number") || max <= 0) { + this[MAX] = Infinity; + } + var lc = options8.length || naiveLength; + if (typeof lc !== "function") { + lc = naiveLength; + } + this[LENGTH_CALCULATOR] = lc; + this[ALLOW_STALE] = options8.stale || false; + this[MAX_AGE] = options8.maxAge || 0; + this[DISPOSE] = options8.dispose; + this[NO_DISPOSE_ON_SET] = options8.noDisposeOnSet || false; + this.reset(); + } + Object.defineProperty(LRUCache.prototype, "max", { + set: function(mL) { + if (!mL || !(typeof mL === "number") || mL <= 0) { + mL = Infinity; + } + this[MAX] = mL; + trim2(this); + }, + get: function() { + return this[MAX]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "allowStale", { + set: function(allowStale) { + this[ALLOW_STALE] = !!allowStale; + }, + get: function() { + return this[ALLOW_STALE]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "maxAge", { + set: function(mA) { + if (!mA || !(typeof mA === "number") || mA < 0) { + mA = 0; + } + this[MAX_AGE] = mA; + trim2(this); + }, + get: function() { + return this[MAX_AGE]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "lengthCalculator", { + set: function(lC) { + if (typeof lC !== "function") { + lC = naiveLength; + } + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC; + this[LENGTH] = 0; + this[LRU_LIST].forEach(function(hit) { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); + this[LENGTH] += hit.length; + }, this); + } + trim2(this); + }, + get: function() { + return this[LENGTH_CALCULATOR]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "length", { + get: function() { + return this[LENGTH]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, "itemCount", { + get: function() { + return this[LRU_LIST].length; + }, + enumerable: true + }); + LRUCache.prototype.rforEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].tail; walker !== null; ) { + var prev = walker.prev; + forEachStep(this, fn, walker, thisp); + walker = prev; + } + }; + function forEachStep(self, fn, node, thisp) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) { + hit = void 0; + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self); + } + } + LRUCache.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].head; walker !== null; ) { + var next = walker.next; + forEachStep(this, fn, walker, thisp); + walker = next; + } + }; + LRUCache.prototype.keys = function() { + return this[LRU_LIST].toArray().map(function(k) { + return k.key; + }, this); + }; + LRUCache.prototype.values = function() { + return this[LRU_LIST].toArray().map(function(k) { + return k.value; + }, this); + }; + LRUCache.prototype.reset = function() { + if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { + this[LRU_LIST].forEach(function(hit) { + this[DISPOSE](hit.key, hit.value); + }, this); + } + this[CACHE] = new Map2(); + this[LRU_LIST] = new Yallist(); + this[LENGTH] = 0; + }; + LRUCache.prototype.dump = function() { + return this[LRU_LIST].map(function(hit) { + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }; + } + }, this).toArray().filter(function(h) { + return h; + }); + }; + LRUCache.prototype.dumpLru = function() { + return this[LRU_LIST]; + }; + LRUCache.prototype.inspect = function(n, opts) { + var str = "LRUCache {"; + var extras = false; + var as = this[ALLOW_STALE]; + if (as) { + str += "\n allowStale: true"; + extras = true; + } + var max = this[MAX]; + if (max && max !== Infinity) { + if (extras) { + str += ","; + } + str += "\n max: " + util2.inspect(max, opts); + extras = true; + } + var maxAge = this[MAX_AGE]; + if (maxAge) { + if (extras) { + str += ","; + } + str += "\n maxAge: " + util2.inspect(maxAge, opts); + extras = true; + } + var lc = this[LENGTH_CALCULATOR]; + if (lc && lc !== naiveLength) { + if (extras) { + str += ","; + } + str += "\n length: " + util2.inspect(this[LENGTH], opts); + extras = true; + } + var didFirst = false; + this[LRU_LIST].forEach(function(item) { + if (didFirst) { + str += ",\n "; + } else { + if (extras) { + str += ",\n"; + } + didFirst = true; + str += "\n "; + } + var key2 = util2.inspect(item.key).split("\n").join("\n "); + var val = { value: item.value }; + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge; + } + if (lc !== naiveLength) { + val.length = item.length; + } + if (isStale(this, item)) { + val.stale = true; + } + val = util2.inspect(val, opts).split("\n").join("\n "); + str += key2 + " => " + val; + }); + if (didFirst || extras) { + str += "\n"; + } + str += "}"; + return str; + }; + LRUCache.prototype.set = function(key2, value, maxAge) { + maxAge = maxAge || this[MAX_AGE]; + var now = maxAge ? Date.now() : 0; + var len = this[LENGTH_CALCULATOR](value, key2); + if (this[CACHE].has(key2)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key2)); + return false; + } + var node = this[CACHE].get(key2); + var item = node.value; + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) { + this[DISPOSE](key2, item.value); + } + } + item.now = now; + item.maxAge = maxAge; + item.value = value; + this[LENGTH] += len - item.length; + item.length = len; + this.get(key2); + trim2(this); + return true; + } + var hit = new Entry(key2, value, len, now, maxAge); + if (hit.length > this[MAX]) { + if (this[DISPOSE]) { + this[DISPOSE](key2, value); + } + return false; + } + this[LENGTH] += hit.length; + this[LRU_LIST].unshift(hit); + this[CACHE].set(key2, this[LRU_LIST].head); + trim2(this); + return true; + }; + LRUCache.prototype.has = function(key2) { + if (!this[CACHE].has(key2)) return false; + var hit = this[CACHE].get(key2).value; + if (isStale(this, hit)) { + return false; + } + return true; + }; + LRUCache.prototype.get = function(key2) { + return get(this, key2, true); + }; + LRUCache.prototype.peek = function(key2) { + return get(this, key2, false); + }; + LRUCache.prototype.pop = function() { + var node = this[LRU_LIST].tail; + if (!node) return null; + del(this, node); + return node.value; + }; + LRUCache.prototype.del = function(key2) { + del(this, this[CACHE].get(key2)); + }; + LRUCache.prototype.load = function(arr) { + this.reset(); + var now = Date.now(); + for (var l = arr.length - 1; l >= 0; l--) { + var hit = arr[l]; + var expiresAt = hit.e || 0; + if (expiresAt === 0) { + this.set(hit.k, hit.v); + } else { + var maxAge = expiresAt - now; + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge); + } + } + } + }; + LRUCache.prototype.prune = function() { + var self = this; + this[CACHE].forEach(function(value, key2) { + get(self, key2, false); + }); + }; + function get(self, key2, doUse) { + var node = self[CACHE].get(key2); + if (node) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) hit = void 0; + } else { + if (doUse) { + self[LRU_LIST].unshiftNode(node); + } + } + if (hit) hit = hit.value; + } + return hit; + } + function isStale(self, hit) { + if (!hit || !hit.maxAge && !self[MAX_AGE]) { + return false; + } + var stale = false; + var diff = Date.now() - hit.now; + if (hit.maxAge) { + stale = diff > hit.maxAge; + } else { + stale = self[MAX_AGE] && diff > self[MAX_AGE]; + } + return stale; + } + function trim2(self) { + if (self[LENGTH] > self[MAX]) { + for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) { + var prev = walker.prev; + del(self, walker); + walker = prev; + } + } + } + function del(self, node) { + if (node) { + var hit = node.value; + if (self[DISPOSE]) { + self[DISPOSE](hit.key, hit.value); + } + self[LENGTH] -= hit.length; + self[CACHE].delete(hit.key); + self[LRU_LIST].removeNode(node); + } + } + function Entry(key2, value, length, now, maxAge) { + this.key = key2; + this.value = value; + this.length = length; + this.now = now; + this.maxAge = maxAge || 0; + } + } +}); + +// node_modules/sigmund/sigmund.js +var require_sigmund = __commonJS({ + "node_modules/sigmund/sigmund.js"(exports, module) { + module.exports = sigmund; + function sigmund(subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ""; + var RE = RegExp; + function psychoAnalyze(subject2, session) { + if (session > maxSessions) return; + if (typeof subject2 === "function" || typeof subject2 === "undefined") { + return; + } + if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) { + analysis += subject2; + return; + } + if (notes.indexOf(subject2) !== -1 || session === maxSessions) return; + notes.push(subject2); + analysis += "{"; + Object.keys(subject2).forEach(function(issue, _, __) { + if (issue.charAt(0) === "_") return; + var to = typeof subject2[issue]; + if (to === "function" || to === "undefined") return; + analysis += issue; + psychoAnalyze(subject2[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; + } + } +}); + +// node_modules/editorconfig/src/lib/fnmatch.js +var require_fnmatch = __commonJS({ + "node_modules/editorconfig/src/lib/fnmatch.js"(exports, module) { + var platform = typeof process === "object" ? process.platform : "win32"; + if (module) module.exports = minimatch; + else exports.minimatch = minimatch; + minimatch.Minimatch = Minimatch; + var LRU = require_lru_cache(); + var cache3 = minimatch.cache = new LRU({ max: 100 }); + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var sigmund = require_sigmund(); + var path14 = __require("path"); + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set, c2) { + set[c2] = true; + return set; + }, {}); + } + var slashSplit = /\/+/; + minimatch.monkeyPatch = monkeyPatch; + function monkeyPatch() { + var desc = Object.getOwnPropertyDescriptor(String.prototype, "match"); + var orig = desc.value; + desc.value = function(p) { + if (p instanceof Minimatch) return p.match(this); + return orig.call(this, p); + }; + Object.defineProperty(String.prototype, desc); + } + minimatch.filter = filter2; + function filter2(pattern, options8) { + options8 = options8 || {}; + return function(p, i, list) { + return minimatch(p, pattern, options8); + }; + } + function ext(a, b) { + a = a || {}; + b = b || {}; + var t = {}; + Object.keys(b).forEach(function(k) { + t[k] = b[k]; + }); + Object.keys(a).forEach(function(k) { + t[k] = a[k]; + }); + return t; + } + minimatch.defaults = function(def) { + if (!def || !Object.keys(def).length) return minimatch; + var orig = minimatch; + var m = function minimatch2(p, pattern, options8) { + return orig.minimatch(p, pattern, ext(def, options8)); + }; + m.Minimatch = function Minimatch2(pattern, options8) { + return new orig.Minimatch(pattern, ext(def, options8)); + }; + return m; + }; + Minimatch.defaults = function(def) { + if (!def || !Object.keys(def).length) return Minimatch; + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options8) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required"); + } + if (!options8) options8 = {}; + if (!options8.nocomment && pattern.charAt(0) === "#") { + return false; + } + if (pattern.trim() === "") return p === ""; + return new Minimatch(pattern, options8).match(p); + } + function Minimatch(pattern, options8) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options8, cache3); + } + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required"); + } + if (!options8) options8 = {}; + if (platform === "win32") { + pattern = pattern.split("\\").join("/"); + } + var cacheKey = pattern + "\n" + sigmund(options8); + var cached = minimatch.cache.get(cacheKey); + if (cached) return cached; + minimatch.cache.set(cacheKey, this); + this.options = options8; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.make(); + } + Minimatch.prototype.make = make; + function make() { + if (this._made) return; + var pattern = this.pattern; + var options8 = this.options; + if (!options8.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + this.parseNegate(); + var set = this.globSet = this.braceExpand(); + if (options8.debug) console.error(this.pattern, set); + set = this.globParts = set.map(function(s) { + return s.split(slashSplit); + }); + if (options8.debug) console.error(this.pattern, set); + set = set.map(function(s, si, set2) { + return s.map(this.parse, this); + }, this); + if (options8.debug) console.error(this.pattern, set); + set = set.filter(function(s) { + return -1 === s.indexOf(false); + }); + if (options8.debug) console.error(this.pattern, set); + this.set = set; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0; + if (options8.nonegate) return; + for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options8) { + return new Minimatch(pattern, options8).braceExpand(); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options8) { + options8 = options8 || this.options; + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + if (typeof pattern === "undefined") { + throw new Error("undefined pattern"); + } + if (options8.nobrace || !pattern.match(/\{.*\}/)) { + return [pattern]; + } + var escaping = false; + if (pattern.charAt(0) !== "{") { + var prefix = null; + for (var i = 0, l = pattern.length; i < l; i++) { + var c2 = pattern.charAt(i); + if (c2 === "\\") { + escaping = !escaping; + } else if (c2 === "{" && !escaping) { + prefix = pattern.substr(0, i); + break; + } + } + if (prefix === null) { + return [pattern]; + } + var tail = braceExpand(pattern.substr(i), options8); + return tail.map(function(t) { + return prefix + t; + }); + } + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/); + if (numset) { + var suf = braceExpand(pattern.substr(numset[0].length), options8), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set = []; + for (var i = start; i != end + inc; i += inc) { + for (var ii = 0, ll = suf.length; ii < ll; ii++) { + set.push(i + suf[ii]); + } + } + return set; + } + var i = 1, depth = 1, set = [], member = "", sawEnd = false, escaping = false; + function addMember() { + set.push(member); + member = ""; + } + FOR: for (i = 1, l = pattern.length; i < l; i++) { + var c2 = pattern.charAt(i); + if (escaping) { + escaping = false; + member += "\\" + c2; + } else { + switch (c2) { + case "\\": + escaping = true; + continue; + case "{": + depth++; + member += "{"; + continue; + case "}": + depth--; + if (depth === 0) { + addMember(); + i++; + break FOR; + } else { + member += c2; + continue; + } + case ",": + if (depth === 1) { + addMember(); + } else { + member += c2; + } + continue; + default: + member += c2; + continue; + } + } + } + if (depth !== 0) { + return braceExpand("\\" + pattern, options8); + } + var suf = braceExpand(pattern.substr(i), options8); + var addBraces = set.length === 1; + set = set.map(function(p) { + return braceExpand(p, options8); + }); + set = set.reduce(function(l2, r) { + return l2.concat(r); + }); + if (addBraces) { + set = set.map(function(s) { + return "{" + s + "}"; + }); + } + var ret = []; + for (var i = 0, l = set.length; i < l; i++) { + for (var ii = 0, ll = suf.length; ii < ll; ii++) { + ret.push(set[i] + suf[ii]); + } + } + return ret; + } + Minimatch.prototype.parse = parse7; + var SUBPARSE = {}; + function parse7(pattern, isSub) { + var options8 = this.options; + if (!options8.noglobstar && pattern === "**") return GLOBSTAR; + if (pattern === "") return ""; + var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; + } + stateChar = false; + } + } + for (var i = 0, len = pattern.length, c2; i < len && (c2 = pattern.charAt(i)); i++) { + if (options8.debug) { + console.error("%s %s %s %j", pattern, i, re, c2); + } + if (escaping && reSpecials[c2]) { + re += "\\" + c2; + escaping = false; + continue; + } + SWITCH: switch (c2) { + case "/": + return false; + case "\\": + clearStateChar(); + escaping = true; + continue; + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + if (options8.debug) { + console.error("%s %s %s %j <-- stateChar", pattern, i, re, c2); + } + if (inClass) { + if (c2 === "!" && i === classStart + 1) c2 = "^"; + re += c2; + continue; + } + clearStateChar(); + stateChar = c2; + if (options8.noext) clearStateChar(); + continue; + case "(": + if (inClass) { + re += "("; + continue; + } + if (!stateChar) { + re += "\\("; + continue; + } + plType = stateChar; + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }); + re += stateChar === "!" ? "(?:(?!" : "(?:"; + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re += "\\)"; + continue; + } + hasMagic = true; + re += ")"; + plType = patternListStack.pop().type; + switch (plType) { + case "!": + re += "[^/]*?)"; + break; + case "?": + case "+": + case "*": + re += plType; + case "@": + break; + } + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|"; + escaping = false; + continue; + } + re += "|"; + continue; + // these are mostly the same in regexp and glob + case "[": + clearStateChar(); + if (inClass) { + re += "\\" + c2; + continue; + } + inClass = true; + classStart = i; + reClassStart = re.length; + re += c2; + continue; + case "]": + if (i === classStart + 1 || !inClass) { + re += "\\" + c2; + escaping = false; + continue; + } + hasMagic = true; + inClass = false; + re += c2; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c2] && !(c2 === "^" && inClass)) { + re += "\\"; + } + re += c2; + } + } + if (inClass) { + var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + var pl; + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3); + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case ".": + case "[": + case "(": + addPatternStart = true; + } + if (re !== "" && hasMagic) re = "(?=.)" + re; + if (addPatternStart) re = patternStart + re; + if (isSub === SUBPARSE) { + return [re, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern); + } + var flags = options8.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options8) { + return new Minimatch(pattern, options8 || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set = this.set; + if (!set.length) return this.regexp = false; + var options8 = this.options; + var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : ""; + var re = set.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) re = "^(?!" + re + ").*$"; + try { + return this.regexp = new RegExp(re, flags); + } catch (ex) { + return this.regexp = false; + } + } + minimatch.match = function(list, pattern, options8) { + var mm = new Minimatch(pattern, options8); + list = list.filter(function(f) { + return mm.match(f); + }); + if (options8.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = match; + function match(f, partial) { + if (this.comment) return false; + if (this.empty) return f === ""; + if (f === "/" && partial) return true; + var options8 = this.options; + if (platform === "win32") { + f = f.split("\\").join("/"); + } + f = f.split(slashSplit); + if (options8.debug) { + console.error(this.pattern, "split", f); + } + var set = this.set; + for (var i = 0, l = set.length; i < l; i++) { + var pattern = set[i]; + var hit = this.matchOne(f, pattern, partial); + if (hit) { + if (options8.flipNegate) return true; + return !this.negate; + } + } + if (options8.flipNegate) return false; + return this.negate; + } + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options8 = this.options; + if (options8.debug) { + console.error( + "matchOne", + { + "this": this, + file, + pattern + } + ); + } + if (options8.matchBase && pattern.length === 1) { + file = path14.basename(file.join("/")).split("/"); + } + if (options8.debug) { + console.error("matchOne", file.length, pattern.length); + } + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + if (options8.debug) { + console.error("matchOne loop"); + } + var p = pattern[pi], f = file[fi]; + if (options8.debug) { + console.error(pattern, p, f); + } + if (p === false) return false; + if (p === GLOBSTAR) { + if (options8.debug) + console.error("GLOBSTAR", [pattern, p, f]); + var fr = fi, pr = pi + 1; + if (pr === pl) { + if (options8.debug) + console.error("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + WHILE: while (fr < fl) { + var swallowee = file[fr]; + if (options8.debug) { + console.error( + "\nglobstar while", + file, + fr, + pattern, + pr, + swallowee + ); + } + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + if (options8.debug) + console.error("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") { + if (options8.debug) + console.error("dot detected!", file, fr, pattern, pr); + break WHILE; + } + if (options8.debug) + console.error("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + if (fr === fl) return true; + } + return false; + } + var hit; + if (typeof p === "string") { + if (options8.nocase) { + hit = f.toLowerCase() === p.toLowerCase(); + } else { + hit = f === p; + } + if (options8.debug) { + console.error("string match", p, f, hit); + } + } else { + hit = f.match(p); + if (options8.debug) { + console.error("pattern match", p, f, hit); + } + } + if (!hit) return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + var emptyFileEnd = fi === fl - 1 && file[fi] === ""; + return emptyFileEnd; + } + throw new Error("wtf?"); + }; + function globUnescape(s) { + return s.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + } +}); + +// node_modules/editorconfig/src/lib/ini.js +var require_ini = __commonJS({ + "node_modules/editorconfig/src/lib/ini.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function(resolve3, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve3(result.value) : new P(function(resolve4) { + resolve4(result.value); + }).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = exports && exports.__generator || function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + } + result["default"] = mod; + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs4 = __importStar(__require("fs")); + var regex = { + section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/, + param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/, + comment: /^\s*[#;].*$/ + }; + function parse7(file) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + return [2, new Promise(function(resolve3, reject) { + fs4.readFile(file, "utf8", function(err, data) { + if (err) { + reject(err); + return; + } + resolve3(parseString2(data)); + }); + })]; + }); + }); + } + exports.parse = parse7; + function parseSync(file) { + return parseString2(fs4.readFileSync(file, "utf8")); + } + exports.parseSync = parseSync; + function parseString2(data) { + var sectionBody = {}; + var sectionName = null; + var value = [[sectionName, sectionBody]]; + var lines = data.split(/\r\n|\r|\n/); + lines.forEach(function(line3) { + var match; + if (regex.comment.test(line3)) { + return; + } + if (regex.param.test(line3)) { + match = line3.match(regex.param); + sectionBody[match[1]] = match[2]; + } else if (regex.section.test(line3)) { + match = line3.match(regex.section); + sectionName = match[1]; + sectionBody = {}; + value.push([sectionName, sectionBody]); + } + }); + return value; + } + exports.parseString = parseString2; + } +}); + +// node_modules/editorconfig/package.json +var require_package = __commonJS({ + "node_modules/editorconfig/package.json"(exports, module) { + module.exports = { + name: "editorconfig", + version: "0.15.3", + description: "EditorConfig File Locator and Interpreter for Node.js", + keywords: [ + "editorconfig", + "core" + ], + main: "src/index.js", + contributors: [ + "Hong Xu (topbug.net)", + "Jed Mao (https://github.com/jedmao/)", + "Trey Hunner (http://treyhunner.com)" + ], + directories: { + bin: "./bin", + lib: "./lib" + }, + scripts: { + clean: "rimraf dist", + prebuild: "npm run clean", + build: "tsc", + pretest: "npm run lint && npm run build && npm run copy && cmake .", + test: "ctest .", + "pretest:ci": "npm run pretest", + "test:ci": "ctest -VV --output-on-failure .", + lint: "npm run eclint && npm run tslint", + eclint: 'eclint check --indent_size ignore "src/**"', + tslint: "tslint --project tsconfig.json --exclude package.json", + copy: "cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib", + prepub: "npm run lint && npm run build && npm run copy", + pub: "npm publish ./dist" + }, + repository: { + type: "git", + url: "git://github.com/editorconfig/editorconfig-core-js.git" + }, + bugs: "https://github.com/editorconfig/editorconfig-core-js/issues", + author: "EditorConfig Team", + license: "MIT", + dependencies: { + commander: "^2.19.0", + "lru-cache": "^4.1.5", + semver: "^5.6.0", + sigmund: "^1.0.1" + }, + devDependencies: { + "@types/mocha": "^5.2.6", + "@types/node": "^10.12.29", + "@types/semver": "^5.5.0", + "cpy-cli": "^2.0.0", + eclint: "^2.8.1", + mocha: "^5.2.0", + rimraf: "^2.6.3", + should: "^13.2.3", + tslint: "^5.13.1", + typescript: "^3.3.3333" + } + }; + } +}); + +// node_modules/editorconfig/src/index.js +var require_src = __commonJS({ + "node_modules/editorconfig/src/index.js"(exports) { + "use strict"; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function(resolve3, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve3(result.value) : new P(function(resolve4) { + resolve4(result.value); + }).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = exports && exports.__generator || function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + } + result["default"] = mod; + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var fs4 = __importStar(__require("fs")); + var path14 = __importStar(__require("path")); + var semver = { + gte: require_gte() + }; + var fnmatch_1 = __importDefault(require_fnmatch()); + var ini_1 = require_ini(); + exports.parseString = ini_1.parseString; + var package_json_1 = __importDefault(require_package()); + var knownProps = { + end_of_line: true, + indent_style: true, + indent_size: true, + insert_final_newline: true, + trim_trailing_whitespace: true, + charset: true + }; + function fnmatch(filepath, glob) { + var matchOptions = { matchBase: true, dot: true, noext: true }; + glob = glob.replace(/\*\*/g, "{*,**/**/**}"); + return fnmatch_1.default(filepath, glob, matchOptions); + } + function getConfigFileNames(filepath, options8) { + var paths = []; + do { + filepath = path14.dirname(filepath); + paths.push(path14.join(filepath, options8.config)); + } while (filepath !== options8.root); + return paths; + } + function processMatches(matches, version) { + if ("indent_style" in matches && matches.indent_style === "tab" && !("indent_size" in matches) && semver.gte(version, "0.10.0")) { + matches.indent_size = "tab"; + } + if ("indent_size" in matches && !("tab_width" in matches) && matches.indent_size !== "tab") { + matches.tab_width = matches.indent_size; + } + if ("indent_size" in matches && "tab_width" in matches && matches.indent_size === "tab") { + matches.indent_size = matches.tab_width; + } + return matches; + } + function processOptions(options8, filepath) { + if (options8 === void 0) { + options8 = {}; + } + return { + config: options8.config || ".editorconfig", + version: options8.version || package_json_1.default.version, + root: path14.resolve(options8.root || path14.parse(filepath).root) + }; + } + function buildFullGlob(pathPrefix, glob) { + switch (glob.indexOf("/")) { + case -1: + glob = "**/" + glob; + break; + case 0: + glob = glob.substring(1); + break; + default: + break; + } + return path14.join(pathPrefix, glob); + } + function extendProps(props, options8) { + if (props === void 0) { + props = {}; + } + if (options8 === void 0) { + options8 = {}; + } + for (var key2 in options8) { + if (options8.hasOwnProperty(key2)) { + var value = options8[key2]; + var key22 = key2.toLowerCase(); + var value2 = value; + if (knownProps[key22]) { + value2 = value.toLowerCase(); + } + try { + value2 = JSON.parse(value); + } catch (e) { + } + if (typeof value === "undefined" || value === null) { + value2 = String(value); + } + props[key22] = value2; + } + } + return props; + } + function parseFromConfigs(configs, filepath, options8) { + return processMatches(configs.reverse().reduce(function(matches, file) { + var pathPrefix = path14.dirname(file.name); + file.contents.forEach(function(section) { + var glob = section[0]; + var options22 = section[1]; + if (!glob) { + return; + } + var fullGlob = buildFullGlob(pathPrefix, glob); + if (!fnmatch(filepath, fullGlob)) { + return; + } + matches = extendProps(matches, options22); + }); + return matches; + }, {}), options8.version); + } + function getConfigsForFiles(files) { + var configs = []; + for (var i in files) { + if (files.hasOwnProperty(i)) { + var file = files[i]; + var contents = ini_1.parseString(file.contents); + configs.push({ + name: file.name, + contents + }); + if ((contents[0][1].root || "").toLowerCase() === "true") { + break; + } + } + } + return configs; + } + function readConfigFiles(filepaths) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + return [2, Promise.all(filepaths.map(function(name) { + return new Promise(function(resolve3) { + fs4.readFile(name, "utf8", function(err, data) { + resolve3({ + name, + contents: err ? "" : data + }); + }); + }); + }))]; + }); + }); + } + function readConfigFilesSync(filepaths) { + var files = []; + var file; + filepaths.forEach(function(filepath) { + try { + file = fs4.readFileSync(filepath, "utf8"); + } catch (e) { + file = ""; + } + files.push({ + name: filepath, + contents: file + }); + }); + return files; + } + function opts(filepath, options8) { + if (options8 === void 0) { + options8 = {}; + } + var resolvedFilePath = path14.resolve(filepath); + return [ + resolvedFilePath, + processOptions(options8, resolvedFilePath) + ]; + } + function parseFromFiles(filepath, files, options8) { + if (options8 === void 0) { + options8 = {}; + } + return __awaiter(this, void 0, void 0, function() { + var _a, resolvedFilePath, processedOptions; + return __generator(this, function(_b) { + _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1]; + return [2, files.then(getConfigsForFiles).then(function(configs) { + return parseFromConfigs(configs, resolvedFilePath, processedOptions); + })]; + }); + }); + } + exports.parseFromFiles = parseFromFiles; + function parseFromFilesSync(filepath, files, options8) { + if (options8 === void 0) { + options8 = {}; + } + var _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1]; + return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions); + } + exports.parseFromFilesSync = parseFromFilesSync; + function parse7(_filepath, _options) { + if (_options === void 0) { + _options = {}; + } + return __awaiter(this, void 0, void 0, function() { + var _a, resolvedFilePath, processedOptions, filepaths; + return __generator(this, function(_b) { + _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1]; + filepaths = getConfigFileNames(resolvedFilePath, processedOptions); + return [2, readConfigFiles(filepaths).then(getConfigsForFiles).then(function(configs) { + return parseFromConfigs(configs, resolvedFilePath, processedOptions); + })]; + }); + }); + } + exports.parse = parse7; + function parseSync(_filepath, _options) { + if (_options === void 0) { + _options = {}; + } + var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1]; + var filepaths = getConfigFileNames(resolvedFilePath, processedOptions); + var files = readConfigFilesSync(filepaths); + return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions); + } + exports.parseSync = parseSync; + } +}); + +// node_modules/js-tokens/index.js +var require_js_tokens = __commonJS({ + "node_modules/js-tokens/index.js"(exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; + exports.matchToToken = function(match) { + var token2 = { type: "invalid", value: match[0], closed: void 0 }; + if (match[1]) token2.type = "string", token2.closed = !!(match[3] || match[4]); + else if (match[5]) token2.type = "comment"; + else if (match[6]) token2.type = "comment", token2.closed = !!match[7]; + else if (match[8]) token2.type = "regex"; + else if (match[9]) token2.type = "number"; + else if (match[10]) token2.type = "name"; + else if (match[11]) token2.type = "punctuator"; + else if (match[12]) token2.type = "whitespace"; + return token2; + }; + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/identifier.js +var require_identifier = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isIdentifierChar = isIdentifierChar; + exports.isIdentifierName = isIdentifierName; + exports.isIdentifierStart = isIdentifierStart; + var nonASCIIidentifierStartChars = "\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-\u088E\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\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"; + var nonASCIIidentifierChars = "\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-\u1ACE\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"; + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + function isInAstralSet(code, set) { + let pos2 = 65536; + for (let i = 0, length = set.length; i < length; i += 2) { + pos2 += set[i]; + if (pos2 > code) return false; + pos2 += set[i + 1]; + if (pos2 >= code) return true; + } + return false; + } + function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); + } + function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); + } + function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 64512) === 55296 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 64512) === 56320) { + cp = 65536 + ((cp & 1023) << 10) + (trail & 1023); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/keyword.js +var require_keyword = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isKeyword = isKeyword; + exports.isReservedWord = isReservedWord; + exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; + exports.isStrictBindReservedWord = isStrictBindReservedWord; + exports.isStrictReservedWord = isStrictReservedWord; + var reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] + }; + var keywords = new Set(reservedWords.keyword); + var reservedWordsStrictSet = new Set(reservedWords.strict); + var reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; + } + function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); + } + function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); + } + function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); + } + function isKeyword(word) { + return keywords.has(word); + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/index.js +var require_lib = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function() { + return _identifier.isIdentifierChar; + } + }); + Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function() { + return _identifier.isIdentifierName; + } + }); + Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function() { + return _identifier.isIdentifierStart; + } + }); + Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function() { + return _keyword.isKeyword; + } + }); + Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function() { + return _keyword.isReservedWord; + } + }); + Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindOnlyReservedWord; + } + }); + Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindReservedWord; + } + }); + Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictReservedWord; + } + }); + var _identifier = require_identifier(); + var _keyword = require_keyword(); + } +}); + +// node_modules/@babel/code-frame/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/@babel/code-frame/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var picocolors5 = require_picocolors(); + var jsTokens = require_js_tokens(); + var helperValidatorIdentifier = require_lib(); + function isColorSupported() { + return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors5.isColorSupported; + } + var compose = (f, g) => (v) => f(g(v)); + function buildDefs(colors) { + return { + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: compose(compose(colors.white, colors.bgRed), colors.bold), + gutter: colors.gray, + marker: compose(colors.red, colors.bold), + message: compose(colors.red, colors.bold), + reset: colors.reset + }; + } + var defsOn = buildDefs(picocolors5.createColors(true)); + var defsOff = buildDefs(picocolors5.createColors(false)); + function getDefs(enabled) { + return enabled ? defsOn : defsOff; + } + var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]); + var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; + var BRACKET = /^[()[\]{}]$/; + var tokenize2; + { + const JSX_TAG = /^[a-z][\w-]*$/i; + const getTokenType = function(token2, offset, text) { + if (token2.type === "name") { + if (helperValidatorIdentifier.isKeyword(token2.value) || helperValidatorIdentifier.isStrictReservedWord(token2.value, true) || sometimesKeywords.has(token2.value)) { + return "keyword"; + } + if (JSX_TAG.test(token2.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type](str)).join("\n"); + } else { + highlighted += value; + } + } + return highlighted; + } + var deprecationWarningShown = false; + var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + function getMarkerLines(loc, source2, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source2.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source2.length; + } + const lineDiff2 = endLine - startLine; + const markerLines = {}; + if (lineDiff2) { + for (let i = 0; i <= lineDiff2; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source2[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff2) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source2[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; + } + function codeFrameColumns3(rawLines, loc, opts = {}) { + const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; + const defs = getDefs(shouldHighlight); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line3, index2) => { + const number = start + 1 + index2; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line3.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + defs.message(opts.message); + } + } + return [defs.marker(">"), defs.gutter(gutter), line3.length > 0 ? ` ${line3}` : "", markerLine].join(""); + } else { + return ` ${defs.gutter(gutter)}${line3.length > 0 ? ` ${line3}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message} +${frame}`; + } + if (shouldHighlight) { + return defs.reset(frame); + } else { + return frame; + } + } + function index(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns3(rawLines, location, opts); + } + exports.codeFrameColumns = codeFrameColumns3; + exports.default = index; + exports.highlight = highlight; + } +}); + +// node_modules/n-readlines/readlines.js +var require_readlines = __commonJS({ + "node_modules/n-readlines/readlines.js"(exports, module) { + "use strict"; + var fs4 = __require("fs"); + var LineByLine = class { + constructor(file, options8) { + options8 = options8 || {}; + if (!options8.readChunk) options8.readChunk = 1024; + if (!options8.newLineCharacter) { + options8.newLineCharacter = 10; + } else { + options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0); + } + if (typeof file === "number") { + this.fd = file; + } else { + this.fd = fs4.openSync(file, "r"); + } + this.options = options8; + this.newLineCharacter = options8.newLineCharacter; + this.reset(); + } + _searchInBuffer(buffer2, hexNeedle) { + let found = -1; + for (let i = 0; i <= buffer2.length; i++) { + let b_byte = buffer2[i]; + if (b_byte === hexNeedle) { + found = i; + break; + } + } + return found; + } + reset() { + this.eofReached = false; + this.linesCache = []; + this.fdPosition = 0; + } + close() { + fs4.closeSync(this.fd); + this.fd = null; + } + _extractLines(buffer2) { + let line3; + const lines = []; + let bufferPosition = 0; + let lastNewLineBufferPosition = 0; + while (true) { + let bufferPositionValue = buffer2[bufferPosition++]; + if (bufferPositionValue === this.newLineCharacter) { + line3 = buffer2.slice(lastNewLineBufferPosition, bufferPosition); + lines.push(line3); + lastNewLineBufferPosition = bufferPosition; + } else if (bufferPositionValue === void 0) { + break; + } + } + let leftovers = buffer2.slice(lastNewLineBufferPosition, bufferPosition); + if (leftovers.length) { + lines.push(leftovers); + } + return lines; + } + _readChunk(lineLeftovers) { + let totalBytesRead = 0; + let bytesRead; + const buffers = []; + do { + const readBuffer = Buffer.alloc(this.options.readChunk); + bytesRead = fs4.readSync(this.fd, readBuffer, 0, this.options.readChunk, this.fdPosition); + totalBytesRead = totalBytesRead + bytesRead; + this.fdPosition = this.fdPosition + bytesRead; + buffers.push(readBuffer); + } while (bytesRead && this._searchInBuffer(buffers[buffers.length - 1], this.options.newLineCharacter) === -1); + let bufferData = Buffer.concat(buffers); + if (bytesRead < this.options.readChunk) { + this.eofReached = true; + bufferData = bufferData.slice(0, totalBytesRead); + } + if (totalBytesRead) { + this.linesCache = this._extractLines(bufferData); + if (lineLeftovers) { + this.linesCache[0] = Buffer.concat([lineLeftovers, this.linesCache[0]]); + } + } + return totalBytesRead; + } + next() { + if (!this.fd) return false; + let line3 = false; + if (this.eofReached && this.linesCache.length === 0) { + return line3; + } + let bytesRead; + if (!this.linesCache.length) { + bytesRead = this._readChunk(); + } + if (this.linesCache.length) { + line3 = this.linesCache.shift(); + const lastLineCharacter = line3[line3.length - 1]; + if (lastLineCharacter !== this.newLineCharacter) { + bytesRead = this._readChunk(line3); + if (bytesRead) { + line3 = this.linesCache.shift(); + } + } + } + if (this.eofReached && this.linesCache.length === 0) { + this.close(); + } + if (line3 && line3[line3.length - 1] === this.newLineCharacter) { + line3 = line3.slice(0, line3.length - 1); + } + return line3; + } + }; + module.exports = LineByLine; + } +}); + +// node_modules/ignore/index.js +var require_ignore = __commonJS({ + "node_modules/ignore/index.js"(exports, module) { + function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; + } + var UNDEFINED = void 0; + var EMPTY = ""; + var SPACE = " "; + var ESCAPE = "\\"; + var REGEX_TEST_BLANK_LINE = /^\s+$/; + var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; + var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; + var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; + var REGEX_SPLITALL_CRLF = /\r?\n/g; + var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/; + var REGEX_TEST_TRAILING_SLASH = /\/$/; + var SLASH = "/"; + var TMP_KEY_IGNORE = "node-ignore"; + if (typeof Symbol !== "undefined") { + TMP_KEY_IGNORE = Symbol.for("node-ignore"); + } + var KEY_IGNORE = TMP_KEY_IGNORE; + var define = (object, key2, value) => { + Object.defineProperty(object, key2, { value }); + return value; + }; + var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + var RETURN_FALSE = () => false; + var sanitizeRange = (range) => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY + ); + var cleanRangeBackSlash = (slashes) => { + const { length } = slashes; + return slashes.slice(0, length - length % 2); + }; + var REPLACERS = [ + [ + // Remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a ) -> (a) + // (a \ ) -> (a ) + /((?:\\\\)*?)(\\?\s+)$/, + (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY) + ], + // Replace (\ ) with ' ' + // (\ ) -> ' ' + // (\\ ) -> '\\ ' + // (\\\ ) -> '\\ ' + [ + /(\\+?)\s/g, + (_, m1) => { + const { length } = m1; + return m1.slice(0, length - length % 2) + SPACE; + } + ], + // Escape metacharacters + // which is written down by users but means special for regular expressions. + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\$.|*+(){^]/g, + (match) => `\\${match}` + ], + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => "[^/]" + ], + // leading slash + [ + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => "^" + ], + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => "\\/" + ], + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + // '**/foo' <-> 'foo' + () => "^(?:.*\\/)?" + ], + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer() { + return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; + } + ], + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + // Check if it is not the last `'/**'` + (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" + ], + // normal intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + // 'abc.*/' -> go + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (_, p1, p2) => { + const unescaped = p2.replace(/\\\*/g, "[^\\/]*"); + return p1 + unescaped; + } + ], + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + [ + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" + ], + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*])$/, + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` + ] + ]; + var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/; + var MODE_IGNORE = "regex"; + var MODE_CHECK_IGNORE = "checkRegex"; + var UNDERSCORE = "_"; + var TRAILING_WILD_CARD_REPLACERS = { + [MODE_IGNORE](_, p1) { + const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + }, + [MODE_CHECK_IGNORE](_, p1) { + const prefix = p1 ? `${p1}[^/]*` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + } + }; + var makeRegexPrefix = (pattern) => REPLACERS.reduce( + (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)), + pattern + ); + var isString = (subject) => typeof subject === "string"; + var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; + var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean); + var IgnoreRule = class { + constructor(pattern, mark, body, ignoreCase, negative, prefix) { + this.pattern = pattern; + this.mark = mark; + this.negative = negative; + define(this, "body", body); + define(this, "ignoreCase", ignoreCase); + define(this, "regexPrefix", prefix); + } + get regex() { + const key2 = UNDERSCORE + MODE_IGNORE; + if (this[key2]) { + return this[key2]; + } + return this._make(MODE_IGNORE, key2); + } + get checkRegex() { + const key2 = UNDERSCORE + MODE_CHECK_IGNORE; + if (this[key2]) { + return this[key2]; + } + return this._make(MODE_CHECK_IGNORE, key2); + } + _make(mode, key2) { + const str = this.regexPrefix.replace( + REGEX_REPLACE_TRAILING_WILDCARD, + // It does not need to bind pattern + TRAILING_WILD_CARD_REPLACERS[mode] + ); + const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str); + return define(this, key2, regex); + } + }; + var createRule = ({ + pattern, + mark + }, ignoreCase) => { + let negative = false; + let body = pattern; + if (body.indexOf("!") === 0) { + negative = true; + body = body.substr(1); + } + body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); + const regexPrefix = makeRegexPrefix(body); + return new IgnoreRule( + pattern, + mark, + body, + ignoreCase, + negative, + regexPrefix + ); + }; + var RuleManager = class { + constructor(ignoreCase) { + this._ignoreCase = ignoreCase; + this._rules = []; + } + _add(pattern) { + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules._rules); + this._added = true; + return; + } + if (isString(pattern)) { + pattern = { + pattern + }; + } + if (checkPattern(pattern.pattern)) { + const rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + // @param {Array | string | Ignore} pattern + add(pattern) { + this._added = false; + makeArray( + isString(pattern) ? splitPattern(pattern) : pattern + ).forEach(this._add, this); + return this._added; + } + // Test one single path without recursively checking parent directories + // + // - checkUnignored `boolean` whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE` + // @returns {TestResult} true if a file is ignored + test(path14, checkUnignored, mode) { + let ignored = false; + let unignored = false; + let matchedRule; + this._rules.forEach((rule) => { + const { negative } = rule; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + const matched = rule[mode].test(path14); + if (!matched) { + return; + } + ignored = !negative; + unignored = negative; + matchedRule = negative ? UNDEFINED : rule; + }); + const ret = { + ignored, + unignored + }; + if (matchedRule) { + ret.rule = matchedRule; + } + return ret; + } + }; + var throwError = (message, Ctor) => { + throw new Ctor(message); + }; + var checkPath = (path14, originalPath, doThrow) => { + if (!isString(path14)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ); + } + if (!path14) { + return doThrow(`path must not be empty`, TypeError); + } + if (checkPath.isNotRelative(path14)) { + const r = "`path.relative()`d"; + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ); + } + return true; + }; + var isNotRelative = (path14) => REGEX_TEST_INVALID_PATH.test(path14); + checkPath.isNotRelative = isNotRelative; + checkPath.convert = (p) => p; + var Ignore = class { + constructor({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define(this, KEY_IGNORE, true); + this._rules = new RuleManager(ignoreCase); + this._strictPathCheck = !allowRelativePaths; + this._initCache(); + } + _initCache() { + this._ignoreCache = /* @__PURE__ */ Object.create(null); + this._testCache = /* @__PURE__ */ Object.create(null); + } + add(pattern) { + if (this._rules.add(pattern)) { + this._initCache(); + } + return this; + } + // legacy + addPattern(pattern) { + return this.add(pattern); + } + // @returns {TestResult} + _test(originalPath, cache3, checkUnignored, slices) { + const path14 = originalPath && checkPath.convert(originalPath); + checkPath( + path14, + originalPath, + this._strictPathCheck ? throwError : RETURN_FALSE + ); + return this._t(path14, cache3, checkUnignored, slices); + } + checkIgnore(path14) { + if (!REGEX_TEST_TRAILING_SLASH.test(path14)) { + return this.test(path14); + } + const slices = path14.split(SLASH).filter(Boolean); + slices.pop(); + if (slices.length) { + const parent = this._t( + slices.join(SLASH) + SLASH, + this._testCache, + true, + slices + ); + if (parent.ignored) { + return parent; + } + } + return this._rules.test(path14, false, MODE_CHECK_IGNORE); + } + _t(path14, cache3, checkUnignored, slices) { + if (path14 in cache3) { + return cache3[path14]; + } + if (!slices) { + slices = path14.split(SLASH).filter(Boolean); + } + slices.pop(); + if (!slices.length) { + return cache3[path14] = this._rules.test(path14, checkUnignored, MODE_IGNORE); + } + const parent = this._t( + slices.join(SLASH) + SLASH, + cache3, + checkUnignored, + slices + ); + return cache3[path14] = parent.ignored ? parent : this._rules.test(path14, checkUnignored, MODE_IGNORE); + } + ignores(path14) { + return this._test(path14, this._ignoreCache, false).ignored; + } + createFilter() { + return (path14) => !this.ignores(path14); + } + filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + // @returns {TestResult} + test(path14) { + return this._test(path14, this._testCache, true); + } + }; + var factory = (options8) => new Ignore(options8); + var isPathValid = (path14) => checkPath(path14 && checkPath.convert(path14), path14, RETURN_FALSE); + var setupWindows = () => { + const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"); + checkPath.convert = makePosix; + const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = (path14) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path14) || isNotRelative(path14); + }; + if ( + // Detect `process` so that it can run in browsers. + typeof process !== "undefined" && process.platform === "win32" + ) { + setupWindows(); + } + module.exports = factory; + factory.default = factory; + module.exports.isPathValid = isPathValid; + define(module.exports, Symbol.for("setupWindows"), setupWindows); + } +}); + +// src/index.js +var index_exports = {}; +__export(index_exports, { + __debug: () => debugApis, + __internal: () => sharedWithCli, + check: () => check, + clearConfigCache: () => clearCache3, + doc: () => doc, + format: () => format2, + formatWithCursor: () => formatWithCursor2, + getFileInfo: () => get_file_info_default, + getSupportInfo: () => getSupportInfo2, + resolveConfig: () => resolveConfig, + resolveConfigFile: () => resolveConfigFile, + util: () => public_exports, + version: () => version_evaluate_default +}); + +// node_modules/diff/libesm/diff/base.js +var Diff = class { + diff(oldStr, newStr, options8 = {}) { + let callback; + if (typeof options8 === "function") { + callback = options8; + options8 = {}; + } else if ("callback" in options8) { + callback = options8.callback; + } + const oldString = this.castInput(oldStr, options8); + const newString = this.castInput(newStr, options8); + const oldTokens = this.removeEmpty(this.tokenize(oldString, options8)); + const newTokens = this.removeEmpty(this.tokenize(newString, options8)); + return this.diffWithOptionsObj(oldTokens, newTokens, options8, callback); + } + diffWithOptionsObj(oldTokens, newTokens, options8, callback) { + var _a; + const done = (value) => { + value = this.postProcess(value, options8); + if (callback) { + setTimeout(function() { + callback(value); + }, 0); + return void 0; + } else { + return value; + } + }; + const newLen = newTokens.length, oldLen = oldTokens.length; + let editLength = 1; + let maxEditLength = newLen + oldLen; + if (options8.maxEditLength != null) { + maxEditLength = Math.min(maxEditLength, options8.maxEditLength); + } + const maxExecutionTime = (_a = options8.timeout) !== null && _a !== void 0 ? _a : Infinity; + const abortAfterTimestamp = Date.now() + maxExecutionTime; + const bestPath = [{ oldPos: -1, lastComponent: void 0 }]; + let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options8); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens)); + } + let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; + const execEditLength = () => { + for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { + let basePath; + const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; + if (removePath) { + bestPath[diagonalPath - 1] = void 0; + } + let canAdd = false; + if (addPath) { + const addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + const canRemove = removePath && removePath.oldPos + 1 < oldLen; + if (!canAdd && !canRemove) { + bestPath[diagonalPath] = void 0; + continue; + } + if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { + basePath = this.addToPath(addPath, true, false, 0, options8); + } else { + basePath = this.addToPath(removePath, false, true, 1, options8); + } + newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options8); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true; + } else { + bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } + } + } + editLength++; + }; + if (callback) { + (function exec() { + setTimeout(function() { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { + return callback(void 0); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { + const ret = execEditLength(); + if (ret) { + return ret; + } + } + } + } + addToPath(path14, added, removed, oldPosInc, options8) { + const last = path14.lastComponent; + if (last && !options8.oneChangePerToken && last.added === added && last.removed === removed) { + return { + oldPos: path14.oldPos + oldPosInc, + lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent } + }; + } else { + return { + oldPos: path14.oldPos + oldPosInc, + lastComponent: { count: 1, added, removed, previousComponent: last } + }; + } + } + extractCommon(basePath, newTokens, oldTokens, diagonalPath, options8) { + const newLen = newTokens.length, oldLen = oldTokens.length; + let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options8)) { + newPos++; + oldPos++; + commonCount++; + if (options8.oneChangePerToken) { + basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false }; + } + } + if (commonCount && !options8.oneChangePerToken) { + basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false }; + } + basePath.oldPos = oldPos; + return newPos; + } + equals(left, right, options8) { + if (options8.comparator) { + return options8.comparator(left, right); + } else { + return left === right || !!options8.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + } + removeEmpty(array2) { + const ret = []; + for (let i = 0; i < array2.length; i++) { + if (array2[i]) { + ret.push(array2[i]); + } + } + return ret; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + castInput(value, options8) { + return value; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + tokenize(value, options8) { + return Array.from(value); + } + join(chars) { + return chars.join(""); + } + postProcess(changeObjects, options8) { + return changeObjects; + } + get useLongestToken() { + return false; + } + buildValues(lastComponent, newTokens, oldTokens) { + const components = []; + let nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); + const componentLen = components.length; + let componentPos = 0, newPos = 0, oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + const component = components[componentPos]; + if (!component.removed) { + if (!component.added && this.useLongestToken) { + let value = newTokens.slice(newPos, newPos + component.count); + value = value.map(function(value2, i) { + const oldValue = oldTokens[oldPos + i]; + return oldValue.length > value2.length ? oldValue : value2; + }); + component.value = this.join(value); + } else { + component.value = this.join(newTokens.slice(newPos, newPos + component.count)); + } + newPos += component.count; + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + } + } + return components; + } +}; + +// node_modules/diff/libesm/diff/line.js +var LineDiff = class extends Diff { + constructor() { + super(...arguments); + this.tokenize = tokenize; + } + equals(left, right, options8) { + if (options8.ignoreWhitespace) { + if (!options8.newlineIsToken || !left.includes("\n")) { + left = left.trim(); + } + if (!options8.newlineIsToken || !right.includes("\n")) { + right = right.trim(); + } + } else if (options8.ignoreNewlineAtEof && !options8.newlineIsToken) { + if (left.endsWith("\n")) { + left = left.slice(0, -1); + } + if (right.endsWith("\n")) { + right = right.slice(0, -1); + } + } + return super.equals(left, right, options8); + } +}; +var lineDiff = new LineDiff(); +function diffLines(oldStr, newStr, options8) { + return lineDiff.diff(oldStr, newStr, options8); +} +function tokenize(value, options8) { + if (options8.stripTrailingCr) { + value = value.replace(/\r\n/g, "\n"); + } + const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + for (let i = 0; i < linesAndNewlines.length; i++) { + const line3 = linesAndNewlines[i]; + if (i % 2 && !options8.newlineIsToken) { + retLines[retLines.length - 1] += line3; + } else { + retLines.push(line3); + } + } + return retLines; +} + +// node_modules/diff/libesm/diff/array.js +var ArrayDiff = class extends Diff { + tokenize(value) { + return value.slice(); + } + join(value) { + return value; + } + removeEmpty(value) { + return value; + } +}; +var arrayDiff = new ArrayDiff(); +function diffArrays(oldArr, newArr, options8) { + return arrayDiff.diff(oldArr, newArr, options8); +} + +// node_modules/diff/libesm/patch/create.js +function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) { + let optionsObj; + if (!options8) { + optionsObj = {}; + } else if (typeof options8 === "function") { + optionsObj = { callback: options8 }; + } else { + optionsObj = options8; + } + if (typeof optionsObj.context === "undefined") { + optionsObj.context = 4; + } + const context = optionsObj.context; + if (optionsObj.newlineIsToken) { + throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions"); + } + if (!optionsObj.callback) { + return diffLinesResultToPatch(diffLines(oldStr, newStr, optionsObj)); + } else { + const { callback } = optionsObj; + diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => { + const patch = diffLinesResultToPatch(diff); + callback(patch); + } })); + } + function diffLinesResultToPatch(diff) { + if (!diff) { + return; + } + diff.push({ value: "", lines: [] }); + function contextLines(lines) { + return lines.map(function(entry) { + return " " + entry; + }); + } + const hunks = []; + let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; + for (let i = 0; i < diff.length; i++) { + const current = diff[i], lines = current.lines || splitLines(current.value); + current.lines = lines; + if (current.added || current.removed) { + if (!oldRangeStart) { + const prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + for (const line3 of lines) { + curRange.push((current.added ? "+" : "-") + line3); + } + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + if (oldRangeStart) { + if (lines.length <= context * 2 && i < diff.length - 2) { + for (const line3 of contextLines(lines)) { + curRange.push(line3); + } + } else { + const contextSize = Math.min(lines.length, context); + for (const line3 of contextLines(lines.slice(0, contextSize))) { + curRange.push(line3); + } + const hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + hunks.push(hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + } + for (const hunk of hunks) { + for (let i = 0; i < hunk.lines.length; i++) { + if (hunk.lines[i].endsWith("\n")) { + hunk.lines[i] = hunk.lines[i].slice(0, -1); + } else { + hunk.lines.splice(i + 1, 0, "\\ No newline at end of file"); + i++; + } + } + } + return { + oldFileName, + newFileName, + oldHeader, + newHeader, + hunks + }; + } +} +function formatPatch(patch) { + if (Array.isArray(patch)) { + return patch.map(formatPatch).join("\n"); + } + const ret = []; + if (patch.oldFileName == patch.newFileName) { + ret.push("Index: " + patch.oldFileName); + } + ret.push("==================================================================="); + ret.push("--- " + patch.oldFileName + (typeof patch.oldHeader === "undefined" ? "" : " " + patch.oldHeader)); + ret.push("+++ " + patch.newFileName + (typeof patch.newHeader === "undefined" ? "" : " " + patch.newHeader)); + for (let i = 0; i < patch.hunks.length; i++) { + const hunk = patch.hunks[i]; + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); + for (const line3 of hunk.lines) { + ret.push(line3); + } + } + return ret.join("\n") + "\n"; +} +function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) { + if (typeof options8 === "function") { + options8 = { callback: options8 }; + } + if (!(options8 === null || options8 === void 0 ? void 0 : options8.callback)) { + const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8); + if (!patchObj) { + return; + } + return formatPatch(patchObj); + } else { + const { callback } = options8; + structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options8), { callback: (patchObj) => { + if (!patchObj) { + callback(void 0); + } else { + callback(formatPatch(patchObj)); + } + } })); + } +} +function splitLines(text) { + const hasTrailingNl = text.endsWith("\n"); + const result = text.split("\n").map((line3) => line3 + "\n"); + if (hasTrailingNl) { + result.pop(); + } else { + result.push(result.pop().slice(0, -1)); + } + return result; +} + +// src/index.js +var import_fast_glob = __toESM(require_out4(), 1); + +// node_modules/leven/index.js +var array = []; +var characterCodeCache = []; +function leven(first, second) { + if (first === second) { + return 0; + } + const swap = first; + if (first.length > second.length) { + first = second; + second = swap; + } + let firstLength = first.length; + let secondLength = second.length; + while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) { + firstLength--; + secondLength--; + } + let start = 0; + while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) { + start++; + } + firstLength -= start; + secondLength -= start; + if (firstLength === 0) { + return secondLength; + } + let bCharacterCode; + let result; + let temporary; + let temporary2; + let index = 0; + let index2 = 0; + while (index < firstLength) { + characterCodeCache[index] = first.charCodeAt(start + index); + array[index] = ++index; + } + while (index2 < secondLength) { + bCharacterCode = second.charCodeAt(start + index2); + temporary = index2++; + result = index2; + for (index = 0; index < firstLength; index++) { + temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1; + temporary = array[index]; + result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2; + } + } + return result; +} + +// src/index.js +var import_picocolors4 = __toESM(require_picocolors(), 1); + +// node_modules/vnopts/lib/descriptors/api.js +var apiDescriptor = { + key: (key2) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key2) ? key2 : JSON.stringify(key2), + value(value) { + if (value === null || typeof value !== "object") { + return JSON.stringify(value); + } + if (Array.isArray(value)) { + return `[${value.map((subValue) => apiDescriptor.value(subValue)).join(", ")}]`; + } + const keys = Object.keys(value); + return keys.length === 0 ? "{}" : `{ ${keys.map((key2) => `${apiDescriptor.key(key2)}: ${apiDescriptor.value(value[key2])}`).join(", ")} }`; + }, + pair: ({ key: key2, value }) => apiDescriptor.value({ [key2]: value }) +}; + +// node_modules/vnopts/lib/handlers/deprecated/common.js +var import_picocolors = __toESM(require_picocolors(), 1); +var commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => { + const messages2 = [ + `${import_picocolors.default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated` + ]; + if (redirectTo) { + messages2.push(`we now treat it as ${import_picocolors.default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`); + } + return messages2.join("; ") + "."; +}; + +// node_modules/vnopts/lib/handlers/invalid/common.js +var import_picocolors2 = __toESM(require_picocolors(), 1); + +// node_modules/vnopts/lib/constants.js +var VALUE_NOT_EXIST = Symbol.for("vnopts.VALUE_NOT_EXIST"); +var VALUE_UNCHANGED = Symbol.for("vnopts.VALUE_UNCHANGED"); + +// node_modules/vnopts/lib/handlers/invalid/common.js +var INDENTATION = " ".repeat(2); +var commonInvalidHandler = (key2, value, utils) => { + const { text, list } = utils.normalizeExpectedResult(utils.schemas[key2].expected(utils)); + const descriptions = []; + if (text) { + descriptions.push(getDescription(key2, value, text, utils.descriptor)); + } + if (list) { + descriptions.push([getDescription(key2, value, list.title, utils.descriptor)].concat(list.values.map((valueDescription) => getListDescription(valueDescription, utils.loggerPrintWidth))).join("\n")); + } + return chooseDescription(descriptions, utils.loggerPrintWidth); +}; +function getDescription(key2, value, expected, descriptor) { + return [ + `Invalid ${import_picocolors2.default.red(descriptor.key(key2))} value.`, + `Expected ${import_picocolors2.default.blue(expected)},`, + `but received ${value === VALUE_NOT_EXIST ? import_picocolors2.default.gray("nothing") : import_picocolors2.default.red(descriptor.value(value))}.` + ].join(" "); +} +function getListDescription({ text, list }, printWidth) { + const descriptions = []; + if (text) { + descriptions.push(`- ${import_picocolors2.default.blue(text)}`); + } + if (list) { + descriptions.push([`- ${import_picocolors2.default.blue(list.title)}:`].concat(list.values.map((valueDescription) => getListDescription(valueDescription, printWidth - INDENTATION.length).replace(/^|\n/g, `$&${INDENTATION}`))).join("\n")); + } + return chooseDescription(descriptions, printWidth); +} +function chooseDescription(descriptions, printWidth) { + if (descriptions.length === 1) { + return descriptions[0]; + } + const [firstDescription, secondDescription] = descriptions; + const [firstWidth, secondWidth] = descriptions.map((description) => description.split("\n", 1)[0].length); + return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription; +} + +// node_modules/vnopts/lib/handlers/unknown/leven.js +var import_picocolors3 = __toESM(require_picocolors(), 1); +var levenUnknownHandler = (key2, value, { descriptor, logger, schemas }) => { + const messages2 = [ + `Ignored unknown option ${import_picocolors3.default.yellow(descriptor.pair({ key: key2, value }))}.` + ]; + const suggestion = Object.keys(schemas).sort().find((knownKey) => leven(key2, knownKey) < 3); + if (suggestion) { + messages2.push(`Did you mean ${import_picocolors3.default.blue(descriptor.key(suggestion))}?`); + } + logger.warn(messages2.join(" ")); +}; + +// node_modules/vnopts/lib/schema.js +var HANDLER_KEYS = [ + "default", + "expected", + "validate", + "deprecated", + "forward", + "redirect", + "overlap", + "preprocess", + "postprocess" +]; +function createSchema(SchemaConstructor, parameters) { + const schema = new SchemaConstructor(parameters); + const subSchema = Object.create(schema); + for (const handlerKey of HANDLER_KEYS) { + if (handlerKey in parameters) { + subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema, Schema.prototype[handlerKey].length); + } + } + return subSchema; +} +var Schema = class { + static create(parameters) { + return createSchema(this, parameters); + } + constructor(parameters) { + this.name = parameters.name; + } + default(_utils) { + return void 0; + } + // this is actually an abstract method but we need a placeholder to get `function.length` + /* c8 ignore start */ + expected(_utils) { + return "nothing"; + } + /* c8 ignore stop */ + // this is actually an abstract method but we need a placeholder to get `function.length` + /* c8 ignore start */ + validate(_value, _utils) { + return false; + } + /* c8 ignore stop */ + deprecated(_value, _utils) { + return false; + } + forward(_value, _utils) { + return void 0; + } + redirect(_value, _utils) { + return void 0; + } + overlap(currentValue, _newValue, _utils) { + return currentValue; + } + preprocess(value, _utils) { + return value; + } + postprocess(_value, _utils) { + return VALUE_UNCHANGED; + } +}; +function normalizeHandler(handler, superSchema, handlerArgumentsLength) { + return typeof handler === "function" ? (...args) => handler(...args.slice(0, handlerArgumentsLength - 1), superSchema, ...args.slice(handlerArgumentsLength - 1)) : () => handler; +} + +// node_modules/vnopts/lib/schemas/alias.js +var AliasSchema = class extends Schema { + constructor(parameters) { + super(parameters); + this._sourceName = parameters.sourceName; + } + expected(utils) { + return utils.schemas[this._sourceName].expected(utils); + } + validate(value, utils) { + return utils.schemas[this._sourceName].validate(value, utils); + } + redirect(_value, _utils) { + return this._sourceName; + } +}; + +// node_modules/vnopts/lib/schemas/any.js +var AnySchema = class extends Schema { + expected() { + return "anything"; + } + validate() { + return true; + } +}; + +// node_modules/vnopts/lib/schemas/array.js +var ArraySchema = class extends Schema { + constructor({ valueSchema, name = valueSchema.name, ...handlers }) { + super({ ...handlers, name }); + this._valueSchema = valueSchema; + } + expected(utils) { + const { text, list } = utils.normalizeExpectedResult(this._valueSchema.expected(utils)); + return { + text: text && `an array of ${text}`, + list: list && { + title: `an array of the following values`, + values: [{ list }] + } + }; + } + validate(value, utils) { + if (!Array.isArray(value)) { + return false; + } + const invalidValues = []; + for (const subValue of value) { + const subValidateResult = utils.normalizeValidateResult(this._valueSchema.validate(subValue, utils), subValue); + if (subValidateResult !== true) { + invalidValues.push(subValidateResult.value); + } + } + return invalidValues.length === 0 ? true : { value: invalidValues }; + } + deprecated(value, utils) { + const deprecatedResult = []; + for (const subValue of value) { + const subDeprecatedResult = utils.normalizeDeprecatedResult(this._valueSchema.deprecated(subValue, utils), subValue); + if (subDeprecatedResult !== false) { + deprecatedResult.push(...subDeprecatedResult.map(({ value: deprecatedValue }) => ({ + value: [deprecatedValue] + }))); + } + } + return deprecatedResult; + } + forward(value, utils) { + const forwardResult = []; + for (const subValue of value) { + const subForwardResult = utils.normalizeForwardResult(this._valueSchema.forward(subValue, utils), subValue); + forwardResult.push(...subForwardResult.map(wrapTransferResult)); + } + return forwardResult; + } + redirect(value, utils) { + const remain = []; + const redirect = []; + for (const subValue of value) { + const subRedirectResult = utils.normalizeRedirectResult(this._valueSchema.redirect(subValue, utils), subValue); + if ("remain" in subRedirectResult) { + remain.push(subRedirectResult.remain); + } + redirect.push(...subRedirectResult.redirect.map(wrapTransferResult)); + } + return remain.length === 0 ? { redirect } : { redirect, remain }; + } + overlap(currentValue, newValue) { + return currentValue.concat(newValue); + } +}; +function wrapTransferResult({ from, to }) { + return { from: [from], to }; +} + +// node_modules/vnopts/lib/schemas/boolean.js +var BooleanSchema = class extends Schema { + expected() { + return "true or false"; + } + validate(value) { + return typeof value === "boolean"; + } +}; + +// node_modules/vnopts/lib/utils.js +function recordFromArray(array2, mainKey) { + const record = /* @__PURE__ */ Object.create(null); + for (const value of array2) { + const key2 = value[mainKey]; + if (record[key2]) { + throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`); + } + record[key2] = value; + } + return record; +} +function mapFromArray(array2, mainKey) { + const map = /* @__PURE__ */ new Map(); + for (const value of array2) { + const key2 = value[mainKey]; + if (map.has(key2)) { + throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`); + } + map.set(key2, value); + } + return map; +} +function createAutoChecklist() { + const map = /* @__PURE__ */ Object.create(null); + return (id) => { + const idString = JSON.stringify(id); + if (map[idString]) { + return true; + } + map[idString] = true; + return false; + }; +} +function partition(array2, predicate) { + const trueArray = []; + const falseArray = []; + for (const value of array2) { + if (predicate(value)) { + trueArray.push(value); + } else { + falseArray.push(value); + } + } + return [trueArray, falseArray]; +} +function isInt(value) { + return value === Math.floor(value); +} +function comparePrimitive(a, b) { + if (a === b) { + return 0; + } + const typeofA = typeof a; + const typeofB = typeof b; + const orders = [ + "undefined", + "object", + // null + "boolean", + "number", + "string" + ]; + if (typeofA !== typeofB) { + return orders.indexOf(typeofA) - orders.indexOf(typeofB); + } + if (typeofA !== "string") { + return Number(a) - Number(b); + } + return a.localeCompare(b); +} +function normalizeInvalidHandler(invalidHandler) { + return (...args) => { + const errorMessageOrError = invalidHandler(...args); + return typeof errorMessageOrError === "string" ? new Error(errorMessageOrError) : errorMessageOrError; + }; +} +function normalizeDefaultResult(result) { + return result === void 0 ? {} : result; +} +function normalizeExpectedResult(result) { + if (typeof result === "string") { + return { text: result }; + } + const { text, list } = result; + assert((text || list) !== void 0, "Unexpected `expected` result, there should be at least one field."); + if (!list) { + return { text }; + } + return { + text, + list: { + title: list.title, + values: list.values.map(normalizeExpectedResult) + } + }; +} +function normalizeValidateResult(result, value) { + return result === true ? true : result === false ? { value } : result; +} +function normalizeDeprecatedResult(result, value, doNotNormalizeTrue = false) { + return result === false ? false : result === true ? doNotNormalizeTrue ? true : [{ value }] : "value" in result ? [result] : result.length === 0 ? false : result; +} +function normalizeTransferResult(result, value) { + return typeof result === "string" || "key" in result ? { from: value, to: result } : "from" in result ? { from: result.from, to: result.to } : { from: value, to: result.to }; +} +function normalizeForwardResult(result, value) { + return result === void 0 ? [] : Array.isArray(result) ? result.map((transferResult) => normalizeTransferResult(transferResult, value)) : [normalizeTransferResult(result, value)]; +} +function normalizeRedirectResult(result, value) { + const redirect = normalizeForwardResult(typeof result === "object" && "redirect" in result ? result.redirect : result, value); + return redirect.length === 0 ? { remain: value, redirect } : typeof result === "object" && "remain" in result ? { remain: result.remain, redirect } : { redirect }; +} +function assert(isValid, message) { + if (!isValid) { + throw new Error(message); + } +} + +// node_modules/vnopts/lib/schemas/choice.js +var ChoiceSchema = class extends Schema { + constructor(parameters) { + super(parameters); + this._choices = mapFromArray(parameters.choices.map((choice) => choice && typeof choice === "object" ? choice : { value: choice }), "value"); + } + expected({ descriptor }) { + const choiceDescriptions = Array.from(this._choices.keys()).map((value) => this._choices.get(value)).filter(({ hidden }) => !hidden).map((choiceInfo) => choiceInfo.value).sort(comparePrimitive).map(descriptor.value); + const head = choiceDescriptions.slice(0, -2); + const tail = choiceDescriptions.slice(-2); + const message = head.concat(tail.join(" or ")).join(", "); + return { + text: message, + list: { + title: "one of the following values", + values: choiceDescriptions + } + }; + } + validate(value) { + return this._choices.has(value); + } + deprecated(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo && choiceInfo.deprecated ? { value } : false; + } + forward(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo ? choiceInfo.forward : void 0; + } + redirect(value) { + const choiceInfo = this._choices.get(value); + return choiceInfo ? choiceInfo.redirect : void 0; + } +}; + +// node_modules/vnopts/lib/schemas/number.js +var NumberSchema = class extends Schema { + expected() { + return "a number"; + } + validate(value, _utils) { + return typeof value === "number"; + } +}; + +// node_modules/vnopts/lib/schemas/integer.js +var IntegerSchema = class extends NumberSchema { + expected() { + return "an integer"; + } + validate(value, utils) { + return utils.normalizeValidateResult(super.validate(value, utils), value) === true && isInt(value); + } +}; + +// node_modules/vnopts/lib/schemas/string.js +var StringSchema = class extends Schema { + expected() { + return "a string"; + } + validate(value) { + return typeof value === "string"; + } +}; + +// node_modules/vnopts/lib/defaults.js +var defaultDescriptor = apiDescriptor; +var defaultUnknownHandler = levenUnknownHandler; +var defaultInvalidHandler = commonInvalidHandler; +var defaultDeprecatedHandler = commonDeprecatedHandler; + +// node_modules/vnopts/lib/normalize.js +var Normalizer = class { + constructor(schemas, opts) { + const { logger = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required = () => false, preprocess = (x) => x, postprocess = () => VALUE_UNCHANGED } = opts || {}; + this._utils = { + descriptor, + logger: ( + /* c8 ignore next */ + logger || { warn: () => { + } } + ), + loggerPrintWidth, + schemas: recordFromArray(schemas, "name"), + normalizeDefaultResult, + normalizeExpectedResult, + normalizeDeprecatedResult, + normalizeForwardResult, + normalizeRedirectResult, + normalizeValidateResult + }; + this._unknownHandler = unknown; + this._invalidHandler = normalizeInvalidHandler(invalid); + this._deprecatedHandler = deprecated; + this._identifyMissing = (k, o) => !(k in o) || missing(k, o); + this._identifyRequired = required; + this._preprocess = preprocess; + this._postprocess = postprocess; + this.cleanHistory(); + } + cleanHistory() { + this._hasDeprecationWarned = createAutoChecklist(); + } + normalize(options8) { + const newOptions = {}; + const preprocessed = this._preprocess(options8, this._utils); + const restOptionsArray = [preprocessed]; + const applyNormalization = () => { + while (restOptionsArray.length !== 0) { + const currentOptions = restOptionsArray.shift(); + const transferredOptionsArray = this._applyNormalization(currentOptions, newOptions); + restOptionsArray.push(...transferredOptionsArray); + } + }; + applyNormalization(); + for (const key2 of Object.keys(this._utils.schemas)) { + const schema = this._utils.schemas[key2]; + if (!(key2 in newOptions)) { + const defaultResult = normalizeDefaultResult(schema.default(this._utils)); + if ("value" in defaultResult) { + restOptionsArray.push({ [key2]: defaultResult.value }); + } + } + } + applyNormalization(); + for (const key2 of Object.keys(this._utils.schemas)) { + if (!(key2 in newOptions)) { + continue; + } + const schema = this._utils.schemas[key2]; + const value = newOptions[key2]; + const newValue = schema.postprocess(value, this._utils); + if (newValue === VALUE_UNCHANGED) { + continue; + } + this._applyValidation(newValue, key2, schema); + newOptions[key2] = newValue; + } + this._applyPostprocess(newOptions); + this._applyRequiredCheck(newOptions); + return newOptions; + } + _applyNormalization(options8, newOptions) { + const transferredOptionsArray = []; + const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8); + for (const key2 of knownKeys) { + const schema = this._utils.schemas[key2]; + const value = schema.preprocess(options8[key2], this._utils); + this._applyValidation(value, key2, schema); + const appendTransferredOptions = ({ from, to }) => { + transferredOptionsArray.push(typeof to === "string" ? { [to]: from } : { [to.key]: to.value }); + }; + const warnDeprecated = ({ value: currentValue, redirectTo }) => { + const deprecatedResult = normalizeDeprecatedResult( + schema.deprecated(currentValue, this._utils), + value, + /* doNotNormalizeTrue */ + true + ); + if (deprecatedResult === false) { + return; + } + if (deprecatedResult === true) { + if (!this._hasDeprecationWarned(key2)) { + this._utils.logger.warn(this._deprecatedHandler(key2, redirectTo, this._utils)); + } + } else { + for (const { value: deprecatedValue } of deprecatedResult) { + const pair = { key: key2, value: deprecatedValue }; + if (!this._hasDeprecationWarned(pair)) { + const redirectToPair = typeof redirectTo === "string" ? { key: redirectTo, value: deprecatedValue } : redirectTo; + this._utils.logger.warn(this._deprecatedHandler(pair, redirectToPair, this._utils)); + } + } + } + }; + const forwardResult = normalizeForwardResult(schema.forward(value, this._utils), value); + forwardResult.forEach(appendTransferredOptions); + const redirectResult = normalizeRedirectResult(schema.redirect(value, this._utils), value); + redirectResult.redirect.forEach(appendTransferredOptions); + if ("remain" in redirectResult) { + const remainingValue = redirectResult.remain; + newOptions[key2] = key2 in newOptions ? schema.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue; + warnDeprecated({ value: remainingValue }); + } + for (const { from, to } of redirectResult.redirect) { + warnDeprecated({ value: from, redirectTo: to }); + } + } + for (const key2 of unknownKeys) { + const value = options8[key2]; + this._applyUnknownHandler(key2, value, newOptions, (knownResultKey, knownResultValue) => { + transferredOptionsArray.push({ [knownResultKey]: knownResultValue }); + }); + } + return transferredOptionsArray; + } + _applyRequiredCheck(options8) { + for (const key2 of Object.keys(this._utils.schemas)) { + if (this._identifyMissing(key2, options8)) { + if (this._identifyRequired(key2)) { + throw this._invalidHandler(key2, VALUE_NOT_EXIST, this._utils); + } + } + } + } + _partitionOptionKeys(options8) { + const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => key2 in this._utils.schemas); + return { knownKeys, unknownKeys }; + } + _applyValidation(value, key2, schema) { + const validateResult = normalizeValidateResult(schema.validate(value, this._utils), value); + if (validateResult !== true) { + throw this._invalidHandler(key2, validateResult.value, this._utils); + } + } + _applyUnknownHandler(key2, value, newOptions, knownResultHandler) { + const unknownResult = this._unknownHandler(key2, value, this._utils); + if (!unknownResult) { + return; + } + for (const resultKey of Object.keys(unknownResult)) { + if (this._identifyMissing(resultKey, unknownResult)) { + continue; + } + const resultValue = unknownResult[resultKey]; + if (resultKey in this._utils.schemas) { + knownResultHandler(resultKey, resultValue); + } else { + newOptions[resultKey] = resultValue; + } + } + } + _applyPostprocess(options8) { + const postprocessed = this._postprocess(options8, this._utils); + if (postprocessed === VALUE_UNCHANGED) { + return; + } + if (postprocessed.delete) { + for (const deleteKey of postprocessed.delete) { + delete options8[deleteKey]; + } + } + if (postprocessed.override) { + const { knownKeys, unknownKeys } = this._partitionOptionKeys(postprocessed.override); + for (const key2 of knownKeys) { + const value = postprocessed.override[key2]; + this._applyValidation(value, key2, this._utils.schemas[key2]); + options8[key2] = value; + } + for (const key2 of unknownKeys) { + const value = postprocessed.override[key2]; + this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => { + const schema = this._utils.schemas[knownResultKey]; + this._applyValidation(knownResultValue, knownResultKey, schema); + options8[knownResultKey] = knownResultValue; + }); + } + } + } +}; + +// src/common/errors.js +var errors_exports = {}; +__export(errors_exports, { + ArgExpansionBailout: () => ArgExpansionBailout, + ConfigError: () => ConfigError, + UndefinedParserError: () => UndefinedParserError +}); +var ConfigError = class extends Error { + name = "ConfigError"; +}; +var UndefinedParserError = class extends Error { + name = "UndefinedParserError"; +}; +var ArgExpansionBailout = class extends Error { + name = "ArgExpansionBailout"; +}; + +// src/utils/create-mockable.js +function createMockable(implementations) { + const mocked = { ...implementations }; + const mockImplementation = (functionality, implementation) => { + if (!Object.prototype.hasOwnProperty.call(implementations, functionality)) { + throw new Error(`Unexpected mock '${functionality}'.`); + } + mocked[functionality] = implementation; + }; + const mockImplementations = (overrideImplementations) => { + for (const [functionality, implementation] of Object.entries( + overrideImplementations + )) { + mockImplementation(functionality, implementation); + } + }; + const mockRestore = () => { + Object.assign(mocked, implementations); + }; + return { + mocked, + implementations, + mockImplementation, + mockImplementations, + mockRestore + }; +} +var create_mockable_default = createMockable; + +// src/common/mockable.js +var mockable = create_mockable_default({ + getPrettierConfigSearchStopDirectory: () => void 0 +}); +var mockable_default = mockable.mocked; + +// src/config/resolve-config.js +var import_micromatch = __toESM(require_micromatch(), 1); +import path10 from "path"; + +// node_modules/url-or-path/index.js +import * as path from "path"; +import * as url from "url"; +var URL_STRING_PREFIX = "file:"; +var isUrlInstance = (value) => value instanceof URL; +var isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX); +var isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath); +var toPath = (urlOrPath) => isUrl(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath; +var toAbsolutePath = (urlOrPath) => urlOrPath ? path.resolve(isUrl(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath) : urlOrPath; + +// src/utils/partition.js +function partition2(array2, predicate) { + const result = [[], []]; + for (const value of array2) { + result[predicate(value) ? 0 : 1].push(value); + } + return result; +} +var partition_default = partition2; + +// src/config/editorconfig/index.js +var import_editorconfig = __toESM(require_src(), 1); +import path5 from "path"; + +// src/config/find-project-root.js +import * as path4 from "path"; + +// node_modules/find-in-directory/index.js +import * as fs from "fs/promises"; +import * as path2 from "path"; +import process2 from "process"; +var isFile = (stats) => stats == null ? void 0 : stats.isFile(); +var isDirectory = (stats) => stats == null ? void 0 : stats.isDirectory(); +async function findInDirectory(nameOrNames, { typeCheck, cwd, allowSymlinks = true, filter: filter2 }) { + const directory = toAbsolutePath(cwd) ?? process2.cwd(); + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames]; + for (const name of names) { + const fileOrDirectory = path2.join(directory, name); + const stats = await safeStat(fileOrDirectory, allowSymlinks); + if (await typeCheck(stats) && (!filter2 || await filter2({ name, path: fileOrDirectory, stats }))) { + return fileOrDirectory; + } + } +} +async function safeStat(path14, allowSymlinks = true) { + try { + return await (allowSymlinks ? fs.stat : fs.lstat)(path14); + } catch { + } +} +function findFile(nameOrNames, options8) { + return findInDirectory(nameOrNames, { ...options8, typeCheck: isFile }); +} +function findDirectory(nameOrNames, options8) { + return findInDirectory(nameOrNames, { ...options8, typeCheck: isDirectory }); +} + +// node_modules/iterate-directory-up/index.js +import * as path3 from "path"; +import process3 from "process"; +function* iterateDirectoryUp(from, to) { + let directory = toAbsolutePath(from) ?? process3.cwd(); + let stopDirectory = toAbsolutePath(to); + if (stopDirectory) { + const relation = path3.relative(stopDirectory, directory); + if (relation[0] === "." || relation === directory) { + return; + } + } + stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path3.parse(directory).root; + while (directory !== stopDirectory) { + yield directory; + directory = path3.dirname(directory); + } + yield stopDirectory; +} +var iterate_directory_up_default = iterateDirectoryUp; + +// node_modules/search-closest/index.js +var _stopDirectory, _cache, _resultCache, _searchWithoutCache, _Searcher_instances, search_fn; +var Searcher = class { + /** + @param {NameOrNames} nameOrNames + @param {SearcherOptions} [options] + */ + constructor(nameOrNames, { allowSymlinks, filter: filter2, stopDirectory, cache: cache3 } = {}) { + __privateAdd(this, _Searcher_instances); + __privateAdd(this, _stopDirectory); + __privateAdd(this, _cache); + __privateAdd(this, _resultCache, /* @__PURE__ */ new Map()); + __privateAdd(this, _searchWithoutCache); + /** + @protected + @type {typeof findFile | typeof findDirectory} + */ + __publicField(this, "findInDirectory"); + __privateSet(this, _stopDirectory, stopDirectory); + __privateSet(this, _cache, cache3 ?? true); + __privateSet(this, _searchWithoutCache, (directory) => this.findInDirectory(nameOrNames, { cwd: directory, filter: filter2, allowSymlinks })); + } + /** + Find closest file or directory matches name or names. + + @param {OptionalUrlOrPath} [startDirectory] + @param {SearchOptions} [options] + @returns {SearchResult} + */ + async search(startDirectory, options8) { + for (const directory of iterate_directory_up_default( + startDirectory, + __privateGet(this, _stopDirectory) + )) { + const result = await __privateMethod(this, _Searcher_instances, search_fn).call(this, directory, (options8 == null ? void 0 : options8.cache) ?? __privateGet(this, _cache)); + if (result) { + return result; + } + } + } + /** + Clear caches. + + @returns {void} + */ + clearCache() { + __privateGet(this, _resultCache).clear(); + } +}; +_stopDirectory = new WeakMap(); +_cache = new WeakMap(); +_resultCache = new WeakMap(); +_searchWithoutCache = new WeakMap(); +_Searcher_instances = new WeakSet(); +search_fn = function(directory, cache3 = true) { + const resultCache = __privateGet(this, _resultCache); + if (!cache3 || !resultCache.has(directory)) { + resultCache.set(directory, __privateGet(this, _searchWithoutCache).call(this, directory)); + } + return resultCache.get(directory); +}; +var FileSearcher = class extends Searcher { + /** @protected */ + findInDirectory = findFile; +}; +var DirectorySearcher = class extends Searcher { + /** @protected */ + findInDirectory = findDirectory; +}; + +// src/config/find-project-root.js +var DIRECTORIES = [".git", ".hg"]; +var searcher; +async function findProjectRoot(startDirectory, options8) { + searcher ?? (searcher = new DirectorySearcher(DIRECTORIES, { allowSymlinks: false })); + const directory = await searcher.search(startDirectory, { + cache: options8.shouldCache + }); + return directory ? path4.dirname(directory) : void 0; +} +function clearFindProjectRootCache() { + searcher == null ? void 0 : searcher.clearCache(); +} + +// src/config/editorconfig/editorconfig-to-prettier.js +function removeUnset(editorConfig) { + const result = {}; + const keys = Object.keys(editorConfig); + for (let i = 0; i < keys.length; i++) { + const key2 = keys[i]; + if (editorConfig[key2] === "unset") { + continue; + } + result[key2] = editorConfig[key2]; + } + return result; +} +function editorConfigToPrettier(editorConfig) { + if (!editorConfig) { + return null; + } + editorConfig = removeUnset(editorConfig); + if (Object.keys(editorConfig).length === 0) { + return null; + } + const result = {}; + if (editorConfig.indent_style) { + result.useTabs = editorConfig.indent_style === "tab"; + } + if (editorConfig.indent_size === "tab") { + result.useTabs = true; + } + if (result.useTabs && editorConfig.tab_width) { + result.tabWidth = editorConfig.tab_width; + } else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") { + result.tabWidth = editorConfig.indent_size; + } else if (editorConfig.tab_width !== void 0) { + result.tabWidth = editorConfig.tab_width; + } + if (editorConfig.max_line_length) { + if (editorConfig.max_line_length === "off") { + result.printWidth = Number.POSITIVE_INFINITY; + } else { + result.printWidth = editorConfig.max_line_length; + } + } + if (editorConfig.quote_type === "single") { + result.singleQuote = true; + } else if (editorConfig.quote_type === "double") { + result.singleQuote = false; + } + if (["cr", "crlf", "lf"].includes(editorConfig.end_of_line)) { + result.endOfLine = editorConfig.end_of_line; + } + return result; +} +var editorconfig_to_prettier_default = editorConfigToPrettier; + +// src/config/editorconfig/index.js +var editorconfigCache = /* @__PURE__ */ new Map(); +function clearEditorconfigCache() { + clearFindProjectRootCache(); + editorconfigCache.clear(); +} +async function loadEditorconfigInternal(file, { shouldCache }) { + const directory = path5.dirname(file); + const root2 = await findProjectRoot(directory, { shouldCache }); + const editorConfig = await import_editorconfig.default.parse(file, { root: root2 }); + const config = editorconfig_to_prettier_default(editorConfig); + return config; +} +function loadEditorconfig(file, { shouldCache }) { + file = path5.resolve(file); + if (!shouldCache || !editorconfigCache.has(file)) { + editorconfigCache.set( + file, + loadEditorconfigInternal(file, { shouldCache }) + ); + } + return editorconfigCache.get(file); +} + +// src/config/prettier-config/index.js +import path9 from "path"; + +// src/config/prettier-config/loaders.js +import { pathToFileURL as pathToFileURL2 } from "url"; + +// node_modules/json5/dist/index.mjs +var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; +var ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\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]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\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]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\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-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; +var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\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\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\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\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\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-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; +var unicode = { + Space_Separator, + ID_Start, + ID_Continue +}; +var util = { + isSpaceSeparator(c2) { + return typeof c2 === "string" && unicode.Space_Separator.test(c2); + }, + isIdStartChar(c2) { + return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 === "$" || c2 === "_" || unicode.ID_Start.test(c2)); + }, + isIdContinueChar(c2) { + return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 >= "0" && c2 <= "9" || c2 === "$" || c2 === "_" || c2 === "\u200C" || c2 === "\u200D" || unicode.ID_Continue.test(c2)); + }, + isDigit(c2) { + return typeof c2 === "string" && /[0-9]/.test(c2); + }, + isHexDigit(c2) { + return typeof c2 === "string" && /[0-9A-Fa-f]/.test(c2); + } +}; +var source; +var parseState; +var stack; +var pos; +var line; +var column; +var token; +var key; +var root; +var parse2 = function parse3(text, reviver) { + source = String(text); + parseState = "start"; + stack = []; + pos = 0; + line = 1; + column = 0; + token = void 0; + key = void 0; + root = void 0; + do { + token = lex(); + parseStates[parseState](); + } while (token.type !== "eof"); + if (typeof reviver === "function") { + return internalize({ "": root }, "", reviver); + } + return root; +}; +function internalize(holder, name, reviver) { + const value = holder[name]; + if (value != null && typeof value === "object") { + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + const key2 = String(i); + const replacement = internalize(value, key2, reviver); + if (replacement === void 0) { + delete value[key2]; + } else { + Object.defineProperty(value, key2, { + value: replacement, + writable: true, + enumerable: true, + configurable: true + }); + } + } + } else { + for (const key2 in value) { + const replacement = internalize(value, key2, reviver); + if (replacement === void 0) { + delete value[key2]; + } else { + Object.defineProperty(value, key2, { + value: replacement, + writable: true, + enumerable: true, + configurable: true + }); + } + } + } + } + return reviver.call(holder, name, value); +} +var lexState; +var buffer; +var doubleQuote; +var sign; +var c; +function lex() { + lexState = "default"; + buffer = ""; + doubleQuote = false; + sign = 1; + for (; ; ) { + c = peek(); + const token2 = lexStates[lexState](); + if (token2) { + return token2; + } + } +} +function peek() { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)); + } +} +function read() { + const c2 = peek(); + if (c2 === "\n") { + line++; + column = 0; + } else if (c2) { + column += c2.length; + } else { + column++; + } + if (c2) { + pos += c2.length; + } + return c2; +} +var lexStates = { + default() { + switch (c) { + case " ": + case "\v": + case "\f": + case " ": + case "\xA0": + case "\uFEFF": + case "\n": + case "\r": + case "\u2028": + case "\u2029": + read(); + return; + case "/": + read(); + lexState = "comment"; + return; + case void 0: + read(); + return newToken("eof"); + } + if (util.isSpaceSeparator(c)) { + read(); + return; + } + return lexStates[parseState](); + }, + comment() { + switch (c) { + case "*": + read(); + lexState = "multiLineComment"; + return; + case "/": + read(); + lexState = "singleLineComment"; + return; + } + throw invalidChar(read()); + }, + multiLineComment() { + switch (c) { + case "*": + read(); + lexState = "multiLineCommentAsterisk"; + return; + case void 0: + throw invalidChar(read()); + } + read(); + }, + multiLineCommentAsterisk() { + switch (c) { + case "*": + read(); + return; + case "/": + read(); + lexState = "default"; + return; + case void 0: + throw invalidChar(read()); + } + read(); + lexState = "multiLineComment"; + }, + singleLineComment() { + switch (c) { + case "\n": + case "\r": + case "\u2028": + case "\u2029": + read(); + lexState = "default"; + return; + case void 0: + read(); + return newToken("eof"); + } + read(); + }, + value() { + switch (c) { + case "{": + case "[": + return newToken("punctuator", read()); + case "n": + read(); + literal("ull"); + return newToken("null", null); + case "t": + read(); + literal("rue"); + return newToken("boolean", true); + case "f": + read(); + literal("alse"); + return newToken("boolean", false); + case "-": + case "+": + if (read() === "-") { + sign = -1; + } + lexState = "sign"; + return; + case ".": + buffer = read(); + lexState = "decimalPointLeading"; + return; + case "0": + buffer = read(); + lexState = "zero"; + return; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + buffer = read(); + lexState = "decimalInteger"; + return; + case "I": + read(); + literal("nfinity"); + return newToken("numeric", Infinity); + case "N": + read(); + literal("aN"); + return newToken("numeric", NaN); + case '"': + case "'": + doubleQuote = read() === '"'; + buffer = ""; + lexState = "string"; + return; + } + throw invalidChar(read()); + }, + identifierNameStartEscape() { + if (c !== "u") { + throw invalidChar(read()); + } + read(); + const u = unicodeEscape(); + switch (u) { + case "$": + case "_": + break; + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier(); + } + break; + } + buffer += u; + lexState = "identifierName"; + }, + identifierName() { + switch (c) { + case "$": + case "_": + case "\u200C": + case "\u200D": + buffer += read(); + return; + case "\\": + read(); + lexState = "identifierNameEscape"; + return; + } + if (util.isIdContinueChar(c)) { + buffer += read(); + return; + } + return newToken("identifier", buffer); + }, + identifierNameEscape() { + if (c !== "u") { + throw invalidChar(read()); + } + read(); + const u = unicodeEscape(); + switch (u) { + case "$": + case "_": + case "\u200C": + case "\u200D": + break; + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier(); + } + break; + } + buffer += u; + lexState = "identifierName"; + }, + sign() { + switch (c) { + case ".": + buffer = read(); + lexState = "decimalPointLeading"; + return; + case "0": + buffer = read(); + lexState = "zero"; + return; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + buffer = read(); + lexState = "decimalInteger"; + return; + case "I": + read(); + literal("nfinity"); + return newToken("numeric", sign * Infinity); + case "N": + read(); + literal("aN"); + return newToken("numeric", NaN); + } + throw invalidChar(read()); + }, + zero() { + switch (c) { + case ".": + buffer += read(); + lexState = "decimalPoint"; + return; + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + case "x": + case "X": + buffer += read(); + lexState = "hexadecimal"; + return; + } + return newToken("numeric", sign * 0); + }, + decimalInteger() { + switch (c) { + case ".": + buffer += read(); + lexState = "decimalPoint"; + return; + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalPointLeading() { + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalFraction"; + return; + } + throw invalidChar(read()); + }, + decimalPoint() { + switch (c) { + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalFraction"; + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalFraction() { + switch (c) { + case "e": + case "E": + buffer += read(); + lexState = "decimalExponent"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + decimalExponent() { + switch (c) { + case "+": + case "-": + buffer += read(); + lexState = "decimalExponentSign"; + return; + } + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalExponentInteger"; + return; + } + throw invalidChar(read()); + }, + decimalExponentSign() { + if (util.isDigit(c)) { + buffer += read(); + lexState = "decimalExponentInteger"; + return; + } + throw invalidChar(read()); + }, + decimalExponentInteger() { + if (util.isDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + hexadecimal() { + if (util.isHexDigit(c)) { + buffer += read(); + lexState = "hexadecimalInteger"; + return; + } + throw invalidChar(read()); + }, + hexadecimalInteger() { + if (util.isHexDigit(c)) { + buffer += read(); + return; + } + return newToken("numeric", sign * Number(buffer)); + }, + string() { + switch (c) { + case "\\": + read(); + buffer += escape(); + return; + case '"': + if (doubleQuote) { + read(); + return newToken("string", buffer); + } + buffer += read(); + return; + case "'": + if (!doubleQuote) { + read(); + return newToken("string", buffer); + } + buffer += read(); + return; + case "\n": + case "\r": + throw invalidChar(read()); + case "\u2028": + case "\u2029": + separatorChar(c); + break; + case void 0: + throw invalidChar(read()); + } + buffer += read(); + }, + start() { + switch (c) { + case "{": + case "[": + return newToken("punctuator", read()); + } + lexState = "value"; + }, + beforePropertyName() { + switch (c) { + case "$": + case "_": + buffer = read(); + lexState = "identifierName"; + return; + case "\\": + read(); + lexState = "identifierNameStartEscape"; + return; + case "}": + return newToken("punctuator", read()); + case '"': + case "'": + doubleQuote = read() === '"'; + lexState = "string"; + return; + } + if (util.isIdStartChar(c)) { + buffer += read(); + lexState = "identifierName"; + return; + } + throw invalidChar(read()); + }, + afterPropertyName() { + if (c === ":") { + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + beforePropertyValue() { + lexState = "value"; + }, + afterPropertyValue() { + switch (c) { + case ",": + case "}": + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + beforeArrayValue() { + if (c === "]") { + return newToken("punctuator", read()); + } + lexState = "value"; + }, + afterArrayValue() { + switch (c) { + case ",": + case "]": + return newToken("punctuator", read()); + } + throw invalidChar(read()); + }, + end() { + throw invalidChar(read()); + } +}; +function newToken(type, value) { + return { + type, + value, + line, + column + }; +} +function literal(s) { + for (const c2 of s) { + const p = peek(); + if (p !== c2) { + throw invalidChar(read()); + } + read(); + } +} +function escape() { + const c2 = peek(); + switch (c2) { + case "b": + read(); + return "\b"; + case "f": + read(); + return "\f"; + case "n": + read(); + return "\n"; + case "r": + read(); + return "\r"; + case "t": + read(); + return " "; + case "v": + read(); + return "\v"; + case "0": + read(); + if (util.isDigit(peek())) { + throw invalidChar(read()); + } + return "\0"; + case "x": + read(); + return hexEscape(); + case "u": + read(); + return unicodeEscape(); + case "\n": + case "\u2028": + case "\u2029": + read(); + return ""; + case "\r": + read(); + if (peek() === "\n") { + read(); + } + return ""; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + throw invalidChar(read()); + case void 0: + throw invalidChar(read()); + } + return read(); +} +function hexEscape() { + let buffer2 = ""; + let c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + return String.fromCodePoint(parseInt(buffer2, 16)); +} +function unicodeEscape() { + let buffer2 = ""; + let count = 4; + while (count-- > 0) { + const c2 = peek(); + if (!util.isHexDigit(c2)) { + throw invalidChar(read()); + } + buffer2 += read(); + } + return String.fromCodePoint(parseInt(buffer2, 16)); +} +var parseStates = { + start() { + if (token.type === "eof") { + throw invalidEOF(); + } + push(); + }, + beforePropertyName() { + switch (token.type) { + case "identifier": + case "string": + key = token.value; + parseState = "afterPropertyName"; + return; + case "punctuator": + pop(); + return; + case "eof": + throw invalidEOF(); + } + }, + afterPropertyName() { + if (token.type === "eof") { + throw invalidEOF(); + } + parseState = "beforePropertyValue"; + }, + beforePropertyValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + push(); + }, + beforeArrayValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + if (token.type === "punctuator" && token.value === "]") { + pop(); + return; + } + push(); + }, + afterPropertyValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + switch (token.value) { + case ",": + parseState = "beforePropertyName"; + return; + case "}": + pop(); + } + }, + afterArrayValue() { + if (token.type === "eof") { + throw invalidEOF(); + } + switch (token.value) { + case ",": + parseState = "beforeArrayValue"; + return; + case "]": + pop(); + } + }, + end() { + } +}; +function push() { + let value; + switch (token.type) { + case "punctuator": + switch (token.value) { + case "{": + value = {}; + break; + case "[": + value = []; + break; + } + break; + case "null": + case "boolean": + case "numeric": + case "string": + value = token.value; + break; + } + if (root === void 0) { + root = value; + } else { + const parent = stack[stack.length - 1]; + if (Array.isArray(parent)) { + parent.push(value); + } else { + Object.defineProperty(parent, key, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + } + if (value !== null && typeof value === "object") { + stack.push(value); + if (Array.isArray(value)) { + parseState = "beforeArrayValue"; + } else { + parseState = "beforePropertyName"; + } + } else { + const current = stack[stack.length - 1]; + if (current == null) { + parseState = "end"; + } else if (Array.isArray(current)) { + parseState = "afterArrayValue"; + } else { + parseState = "afterPropertyValue"; + } + } +} +function pop() { + stack.pop(); + const current = stack[stack.length - 1]; + if (current == null) { + parseState = "end"; + } else if (Array.isArray(current)) { + parseState = "afterArrayValue"; + } else { + parseState = "afterPropertyValue"; + } +} +function invalidChar(c2) { + if (c2 === void 0) { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`); + } + return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`); +} +function invalidEOF() { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`); +} +function invalidIdentifier() { + column -= 5; + return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`); +} +function separatorChar(c2) { + console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`); +} +function formatChar(c2) { + const replacements = { + "'": "\\'", + '"': '\\"', + "\\": "\\\\", + "\b": "\\b", + "\f": "\\f", + "\n": "\\n", + "\r": "\\r", + " ": "\\t", + "\v": "\\v", + "\0": "\\0", + "\u2028": "\\u2028", + "\u2029": "\\u2029" + }; + if (replacements[c2]) { + return replacements[c2]; + } + if (c2 < " ") { + const hexString = c2.charCodeAt(0).toString(16); + return "\\x" + ("00" + hexString).substring(hexString.length); + } + return c2; +} +function syntaxError(message) { + const err = new SyntaxError(message); + err.lineNumber = line; + err.columnNumber = column; + return err; +} +var dist_default = { parse: parse2 }; + +// node_modules/parse-json/index.js +var import_code_frame = __toESM(require_lib2(), 1); + +// node_modules/index-to-position/index.js +function getPosition(text, textIndex) { + const lineBreakBefore = textIndex === 0 ? -1 : text.lastIndexOf("\n", textIndex - 1); + return { + line: lineBreakBefore === -1 ? 0 : text.slice(0, lineBreakBefore + 1).match(/\n/g).length, + column: textIndex - lineBreakBefore - 1 + }; +} +function indexToPosition(text, textIndex, { oneBased = false } = {}) { + if (typeof text !== "string") { + throw new TypeError("Text parameter should be a string"); + } + if (!Number.isInteger(textIndex)) { + throw new TypeError("Index parameter should be an integer"); + } + if (textIndex < 0 || textIndex > text.length) { + throw new RangeError("Index out of bounds"); + } + const position = getPosition(text, textIndex); + return oneBased ? { line: position.line + 1, column: position.column + 1 } : position; +} + +// node_modules/parse-json/index.js +var getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`; +var _input, _jsonParseError, _message, _codeFrame, _rawCodeFrame, _JSONError_instances, getCodeFrame_fn; +var _JSONError = class _JSONError extends Error { + constructor(messageOrOptions) { + var __super = (...args) => { + super(...args); + __privateAdd(this, _JSONError_instances); + __publicField(this, "name", "JSONError"); + __publicField(this, "fileName"); + __privateAdd(this, _input); + __privateAdd(this, _jsonParseError); + __privateAdd(this, _message); + __privateAdd(this, _codeFrame); + __privateAdd(this, _rawCodeFrame); + return this; + }; + var _a; + if (typeof messageOrOptions === "string") { + __super(); + __privateSet(this, _message, messageOrOptions); + } else { + const { jsonParseError, fileName, input } = messageOrOptions; + __super(void 0, { cause: jsonParseError }); + __privateSet(this, _input, input); + __privateSet(this, _jsonParseError, jsonParseError); + this.fileName = fileName; + } + (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, _JSONError); + } + get message() { + __privateGet(this, _message) ?? __privateSet(this, _message, `${addCodePointToUnexpectedToken(__privateGet(this, _jsonParseError).message)}${__privateGet(this, _input) === "" ? " while parsing empty string" : ""}`); + const { codeFrame } = this; + return `${__privateGet(this, _message)}${this.fileName ? ` in ${this.fileName}` : ""}${codeFrame ? ` + +${codeFrame} +` : ""}`; + } + set message(message) { + __privateSet(this, _message, message); + } + get codeFrame() { + __privateGet(this, _codeFrame) ?? __privateSet(this, _codeFrame, __privateMethod(this, _JSONError_instances, getCodeFrame_fn).call( + this, + /* highlightCode */ + true + )); + return __privateGet(this, _codeFrame); + } + get rawCodeFrame() { + __privateGet(this, _rawCodeFrame) ?? __privateSet(this, _rawCodeFrame, __privateMethod(this, _JSONError_instances, getCodeFrame_fn).call( + this, + /* highlightCode */ + false + )); + return __privateGet(this, _rawCodeFrame); + } +}; +_input = new WeakMap(); +_jsonParseError = new WeakMap(); +_message = new WeakMap(); +_codeFrame = new WeakMap(); +_rawCodeFrame = new WeakMap(); +_JSONError_instances = new WeakSet(); +getCodeFrame_fn = function(highlightCode) { + if (!__privateGet(this, _jsonParseError)) { + return; + } + const input = __privateGet(this, _input); + const location = getErrorLocation(input, __privateGet(this, _jsonParseError).message); + if (!location) { + return; + } + return (0, import_code_frame.codeFrameColumns)(input, { start: location }, { highlightCode }); +}; +var JSONError = _JSONError; +var getErrorLocation = (string, message) => { + const match = message.match(/in JSON at position (?\d+)(?: \(line (?\d+) column (?\d+)\))?$/); + if (!match) { + return; + } + const { index, line: line3, column: column2 } = match.groups; + if (line3 && column2) { + return { line: Number(line3), column: Number(column2) }; + } + return indexToPosition(string, Number(index), { oneBased: true }); +}; +var addCodePointToUnexpectedToken = (message) => message.replace( + // TODO[engine:node@>=20]: The token always quoted after Node.js 20 + /(?<=^Unexpected token )(?')?(.)\k/, + (_, _quote, token2) => `"${token2}"(${getCodePoint(token2)})` +); +function parseJson(string, reviver, fileName) { + if (typeof reviver === "string") { + fileName = reviver; + reviver = void 0; + } + try { + return JSON.parse(string, reviver); + } catch (error) { + throw new JSONError({ + jsonParseError: error, + fileName, + input: string + }); + } +} + +// node_modules/smol-toml/dist/error.js +function getLineColFromPtr(string, ptr) { + let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); + return [lines.length, lines.pop().length + 1]; +} +function makeCodeBlock(string, line3, column2) { + let lines = string.split(/\r\n|\n|\r/g); + let codeblock = ""; + let numberLen = (Math.log10(line3 + 1) | 0) + 1; + for (let i = line3 - 1; i <= line3 + 1; i++) { + let l = lines[i - 1]; + if (!l) + continue; + codeblock += i.toString().padEnd(numberLen, " "); + codeblock += ": "; + codeblock += l; + codeblock += "\n"; + if (i === line3) { + codeblock += " ".repeat(numberLen + column2 + 2); + codeblock += "^\n"; + } + } + return codeblock; +} +var TomlError = class extends Error { + line; + column; + codeblock; + constructor(message, options8) { + const [line3, column2] = getLineColFromPtr(options8.toml, options8.ptr); + const codeblock = makeCodeBlock(options8.toml, line3, column2); + super(`Invalid TOML document: ${message} + +${codeblock}`, options8); + this.line = line3; + this.column = column2; + this.codeblock = codeblock; + } +}; + +// node_modules/smol-toml/dist/util.js +function indexOfNewline(str, start = 0, end = str.length) { + let idx = str.indexOf("\n", start); + if (str[idx - 1] === "\r") + idx--; + return idx <= end ? idx : -1; +} +function skipComment(str, ptr) { + for (let i = ptr; i < str.length; i++) { + let c2 = str[i]; + if (c2 === "\n") + return i; + if (c2 === "\r" && str[i + 1] === "\n") + return i + 1; + if (c2 < " " && c2 !== " " || c2 === "\x7F") { + throw new TomlError("control characters are not allowed in comments", { + toml: str, + ptr + }); + } + } + return str.length; +} +function skipVoid(str, ptr, banNewLines, banComments) { + let c2; + while ((c2 = str[ptr]) === " " || c2 === " " || !banNewLines && (c2 === "\n" || c2 === "\r" && str[ptr + 1] === "\n")) + ptr++; + return banComments || c2 !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines); +} +function skipUntil(str, ptr, sep, end, banNewLines = false) { + if (!end) { + ptr = indexOfNewline(str, ptr); + return ptr < 0 ? str.length : ptr; + } + for (let i = ptr; i < str.length; i++) { + let c2 = str[i]; + if (c2 === "#") { + i = indexOfNewline(str, i); + } else if (c2 === sep) { + return i + 1; + } else if (c2 === end || banNewLines && (c2 === "\n" || c2 === "\r" && str[i + 1] === "\n")) { + return i; + } + } + throw new TomlError("cannot find end of structure", { + toml: str, + ptr + }); +} +function getStringEnd(str, seek) { + let first = str[seek]; + let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first; + seek += target.length - 1; + do + seek = str.indexOf(target, ++seek); + while (seek > -1 && first !== "'" && str[seek - 1] === "\\" && (str[seek - 2] !== "\\" || str[seek - 3] === "\\")); + if (seek > -1) { + seek += target.length; + if (target.length > 1) { + if (str[seek] === first) + seek++; + if (str[seek] === first) + seek++; + } + } + return seek; +} + +// node_modules/smol-toml/dist/date.js +var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i; +var _hasDate, _hasTime, _offset; +var _TomlDate = class _TomlDate extends Date { + constructor(date) { + let hasDate = true; + let hasTime = true; + let offset = "Z"; + if (typeof date === "string") { + let match = date.match(DATE_TIME_RE); + if (match) { + if (!match[1]) { + hasDate = false; + date = `0000-01-01T${date}`; + } + hasTime = !!match[2]; + hasTime && date[10] === " " && (date = date.replace(" ", "T")); + if (match[2] && +match[2] > 23) { + date = ""; + } else { + offset = match[3] || null; + date = date.toUpperCase(); + if (!offset && hasTime) + date += "Z"; + } + } else { + date = ""; + } + } + super(date); + __privateAdd(this, _hasDate, false); + __privateAdd(this, _hasTime, false); + __privateAdd(this, _offset, null); + if (!isNaN(this.getTime())) { + __privateSet(this, _hasDate, hasDate); + __privateSet(this, _hasTime, hasTime); + __privateSet(this, _offset, offset); + } + } + isDateTime() { + return __privateGet(this, _hasDate) && __privateGet(this, _hasTime); + } + isLocal() { + return !__privateGet(this, _hasDate) || !__privateGet(this, _hasTime) || !__privateGet(this, _offset); + } + isDate() { + return __privateGet(this, _hasDate) && !__privateGet(this, _hasTime); + } + isTime() { + return __privateGet(this, _hasTime) && !__privateGet(this, _hasDate); + } + isValid() { + return __privateGet(this, _hasDate) || __privateGet(this, _hasTime); + } + toISOString() { + let iso = super.toISOString(); + if (this.isDate()) + return iso.slice(0, 10); + if (this.isTime()) + return iso.slice(11, 23); + if (__privateGet(this, _offset) === null) + return iso.slice(0, -1); + if (__privateGet(this, _offset) === "Z") + return iso; + let offset = +__privateGet(this, _offset).slice(1, 3) * 60 + +__privateGet(this, _offset).slice(4, 6); + offset = __privateGet(this, _offset)[0] === "-" ? offset : -offset; + let offsetDate = new Date(this.getTime() - offset * 6e4); + return offsetDate.toISOString().slice(0, -1) + __privateGet(this, _offset); + } + static wrapAsOffsetDateTime(jsDate, offset = "Z") { + let date = new _TomlDate(jsDate); + __privateSet(date, _offset, offset); + return date; + } + static wrapAsLocalDateTime(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _offset, null); + return date; + } + static wrapAsLocalDate(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _hasTime, false); + __privateSet(date, _offset, null); + return date; + } + static wrapAsLocalTime(jsDate) { + let date = new _TomlDate(jsDate); + __privateSet(date, _hasDate, false); + __privateSet(date, _offset, null); + return date; + } +}; +_hasDate = new WeakMap(); +_hasTime = new WeakMap(); +_offset = new WeakMap(); +var TomlDate = _TomlDate; + +// node_modules/smol-toml/dist/primitive.js +var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; +var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; +var LEADING_ZERO = /^[+-]?0[0-9_]/; +var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i; +var ESC_MAP = { + b: "\b", + t: " ", + n: "\n", + f: "\f", + r: "\r", + '"': '"', + "\\": "\\" +}; +function parseString(str, ptr = 0, endPtr = str.length) { + let isLiteral = str[ptr] === "'"; + let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1]; + if (isMultiline) { + endPtr -= 2; + if (str[ptr += 2] === "\r") + ptr++; + if (str[ptr] === "\n") + ptr++; + } + let tmp = 0; + let isEscape; + let parsed = ""; + let sliceStart = ptr; + while (ptr < endPtr - 1) { + let c2 = str[ptr++]; + if (c2 === "\n" || c2 === "\r" && str[ptr] === "\n") { + if (!isMultiline) { + throw new TomlError("newlines are not allowed in strings", { + toml: str, + ptr: ptr - 1 + }); + } + } else if (c2 < " " && c2 !== " " || c2 === "\x7F") { + throw new TomlError("control characters are not allowed in strings", { + toml: str, + ptr: ptr - 1 + }); + } + if (isEscape) { + isEscape = false; + if (c2 === "u" || c2 === "U") { + let code = str.slice(ptr, ptr += c2 === "u" ? 4 : 8); + if (!ESCAPE_REGEX.test(code)) { + throw new TomlError("invalid unicode escape", { + toml: str, + ptr: tmp + }); + } + try { + parsed += String.fromCodePoint(parseInt(code, 16)); + } catch { + throw new TomlError("invalid unicode escape", { + toml: str, + ptr: tmp + }); + } + } else if (isMultiline && (c2 === "\n" || c2 === " " || c2 === " " || c2 === "\r")) { + ptr = skipVoid(str, ptr - 1, true); + if (str[ptr] !== "\n" && str[ptr] !== "\r") { + throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { + toml: str, + ptr: tmp + }); + } + ptr = skipVoid(str, ptr); + } else if (c2 in ESC_MAP) { + parsed += ESC_MAP[c2]; + } else { + throw new TomlError("unrecognized escape sequence", { + toml: str, + ptr: tmp + }); + } + sliceStart = ptr; + } else if (!isLiteral && c2 === "\\") { + tmp = ptr - 1; + isEscape = true; + parsed += str.slice(sliceStart, tmp); + } + } + return parsed + str.slice(sliceStart, endPtr - 1); +} +function parseValue(value, toml, ptr) { + if (value === "true") + return true; + if (value === "false") + return false; + if (value === "-inf") + return -Infinity; + if (value === "inf" || value === "+inf") + return Infinity; + if (value === "nan" || value === "+nan" || value === "-nan") + return NaN; + if (value === "-0") + return 0; + let isInt2; + if ((isInt2 = INT_REGEX.test(value)) || FLOAT_REGEX.test(value)) { + if (LEADING_ZERO.test(value)) { + throw new TomlError("leading zeroes are not allowed", { + toml, + ptr + }); + } + let numeric = +value.replace(/_/g, ""); + if (isNaN(numeric)) { + throw new TomlError("invalid number", { + toml, + ptr + }); + } + if (isInt2 && !Number.isSafeInteger(numeric)) { + throw new TomlError("integer value cannot be represented losslessly", { + toml, + ptr + }); + } + return numeric; + } + let date = new TomlDate(value); + if (!date.isValid()) { + throw new TomlError("invalid value", { + toml, + ptr + }); + } + return date; +} + +// node_modules/smol-toml/dist/extract.js +function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) { + let value = str.slice(startPtr, endPtr); + let commentIdx = value.indexOf("#"); + if (commentIdx > -1) { + skipComment(str, commentIdx); + value = value.slice(0, commentIdx); + } + let trimmed = value.trimEnd(); + if (!allowNewLines) { + let newlineIdx = value.indexOf("\n", trimmed.length); + if (newlineIdx > -1) { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str, + ptr: startPtr + newlineIdx + }); + } + } + return [trimmed, commentIdx]; +} +function extractValue(str, ptr, end, depth = -1) { + if (depth === 0) { + throw new TomlError("document contains excessively nested structures. aborting.", { + toml: str, + ptr + }); + } + let c2 = str[ptr]; + if (c2 === "[" || c2 === "{") { + let [value, endPtr2] = c2 === "[" ? parseArray(str, ptr, depth) : parseInlineTable(str, ptr, depth); + let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2; + if (endPtr2 - newPtr && end === "}") { + let nextNewLine = indexOfNewline(str, endPtr2, newPtr); + if (nextNewLine > -1) { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str, + ptr: nextNewLine + }); + } + } + return [value, newPtr]; + } + let endPtr; + if (c2 === '"' || c2 === "'") { + endPtr = getStringEnd(str, ptr); + let parsed = parseString(str, ptr, endPtr); + if (end) { + endPtr = skipVoid(str, endPtr, end !== "]"); + if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") { + throw new TomlError("unexpected character encountered", { + toml: str, + ptr: endPtr + }); + } + endPtr += +(str[endPtr] === ","); + } + return [parsed, endPtr]; + } + endPtr = skipUntil(str, ptr, ",", end); + let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]"); + if (!slice[0]) { + throw new TomlError("incomplete key-value declaration: no value specified", { + toml: str, + ptr + }); + } + if (end && slice[1] > -1) { + endPtr = skipVoid(str, ptr + slice[1]); + endPtr += +(str[endPtr] === ","); + } + return [ + parseValue(slice[0], str, ptr), + endPtr + ]; +} + +// node_modules/smol-toml/dist/struct.js +var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; +function parseKey(str, ptr, end = "=") { + let dot = ptr - 1; + let parsed = []; + let endPtr = str.indexOf(end, ptr); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str, + ptr + }); + } + do { + let c2 = str[ptr = ++dot]; + if (c2 !== " " && c2 !== " ") { + if (c2 === '"' || c2 === "'") { + if (c2 === str[ptr + 1] && c2 === str[ptr + 2]) { + throw new TomlError("multiline strings are not allowed in keys", { + toml: str, + ptr + }); + } + let eos = getStringEnd(str, ptr); + if (eos < 0) { + throw new TomlError("unfinished string encountered", { + toml: str, + ptr + }); + } + dot = str.indexOf(".", eos); + let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); + let newLine = indexOfNewline(strEnd); + if (newLine > -1) { + throw new TomlError("newlines are not allowed in keys", { + toml: str, + ptr: ptr + dot + newLine + }); + } + if (strEnd.trimStart()) { + throw new TomlError("found extra tokens after the string part", { + toml: str, + ptr: eos + }); + } + if (endPtr < eos) { + endPtr = str.indexOf(end, eos); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str, + ptr + }); + } + } + parsed.push(parseString(str, ptr, eos)); + } else { + dot = str.indexOf(".", ptr); + let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); + if (!KEY_PART_RE.test(part)) { + throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { + toml: str, + ptr + }); + } + parsed.push(part.trimEnd()); + } + } + } while (dot + 1 && dot < endPtr); + return [parsed, skipVoid(str, endPtr + 1, true, true)]; +} +function parseInlineTable(str, ptr, depth = -1) { + let res = {}; + let seen = /* @__PURE__ */ new Set(); + let c2; + let comma = 0; + ptr++; + while ((c2 = str[ptr++]) !== "}" && c2) { + if (c2 === "\n") { + throw new TomlError("newlines are not allowed in inline tables", { + toml: str, + ptr: ptr - 1 + }); + } else if (c2 === "#") { + throw new TomlError("inline tables cannot contain comments", { + toml: str, + ptr: ptr - 1 + }); + } else if (c2 === ",") { + throw new TomlError("expected key-value, found comma", { + toml: str, + ptr: ptr - 1 + }); + } else if (c2 !== " " && c2 !== " ") { + let k; + let t = res; + let hasOwn = false; + let [key2, keyEndPtr] = parseKey(str, ptr - 1); + for (let i = 0; i < key2.length; i++) { + if (i) + t = hasOwn ? t[k] : t[k] = {}; + k = key2[i]; + if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { + throw new TomlError("trying to redefine an already defined value", { + toml: str, + ptr + }); + } + if (!hasOwn && k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + } + } + if (hasOwn) { + throw new TomlError("trying to redefine an already defined value", { + toml: str, + ptr + }); + } + let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1); + seen.add(value); + t[k] = value; + ptr = valueEndPtr; + comma = str[ptr - 1] === "," ? ptr - 1 : 0; + } + } + if (comma) { + throw new TomlError("trailing commas are not allowed in inline tables", { + toml: str, + ptr: comma + }); + } + if (!c2) { + throw new TomlError("unfinished table encountered", { + toml: str, + ptr + }); + } + return [res, ptr]; +} +function parseArray(str, ptr, depth = -1) { + let res = []; + let c2; + ptr++; + while ((c2 = str[ptr++]) !== "]" && c2) { + if (c2 === ",") { + throw new TomlError("expected value, found comma", { + toml: str, + ptr: ptr - 1 + }); + } else if (c2 === "#") + ptr = skipComment(str, ptr); + else if (c2 !== " " && c2 !== " " && c2 !== "\n" && c2 !== "\r") { + let e = extractValue(str, ptr - 1, "]", depth - 1); + res.push(e[0]); + ptr = e[1]; + } + } + if (!c2) { + throw new TomlError("unfinished array encountered", { + toml: str, + ptr + }); + } + return [res, ptr]; +} + +// node_modules/smol-toml/dist/parse.js +function peekTable(key2, table, meta, type) { + var _a, _b; + let t = table; + let m = meta; + let k; + let hasOwn = false; + let state; + for (let i = 0; i < key2.length; i++) { + if (i) { + t = hasOwn ? t[k] : t[k] = {}; + m = (state = m[k]).c; + if (type === 0 && (state.t === 1 || state.t === 2)) { + return null; + } + if (state.t === 2) { + let l = t.length - 1; + t = t[l]; + m = m[l].c; + } + } + k = key2[i]; + if ((hasOwn = Object.hasOwn(t, k)) && ((_a = m[k]) == null ? void 0 : _a.t) === 0 && ((_b = m[k]) == null ? void 0 : _b.d)) { + return null; + } + if (!hasOwn) { + if (k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); + } + m[k] = { + t: i < key2.length - 1 && type === 2 ? 3 : type, + d: false, + i: 0, + c: {} + }; + } + } + state = m[k]; + if (state.t !== type && !(type === 1 && state.t === 3)) { + return null; + } + if (type === 2) { + if (!state.d) { + state.d = true; + t[k] = []; + } + t[k].push(t = {}); + state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} }; + } + if (state.d) { + return null; + } + state.d = true; + if (type === 1) { + t = hasOwn ? t[k] : t[k] = {}; + } else if (type === 0 && hasOwn) { + return null; + } + return [k, t, state.c]; +} +function parse4(toml, opts) { + let maxDepth = (opts == null ? void 0 : opts.maxDepth) ?? 1e3; + let res = {}; + let meta = {}; + let tbl = res; + let m = meta; + for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { + if (toml[ptr] === "[") { + let isTableArray = toml[++ptr] === "["; + let k = parseKey(toml, ptr += +isTableArray, "]"); + if (isTableArray) { + if (toml[k[1] - 1] !== "]") { + throw new TomlError("expected end of table declaration", { + toml, + ptr: k[1] - 1 + }); + } + k[1]++; + } + let p = peekTable( + k[0], + res, + meta, + isTableArray ? 2 : 1 + /* Type.EXPLICIT */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + m = p[2]; + tbl = p[1]; + ptr = k[1]; + } else { + let k = parseKey(toml, ptr); + let p = peekTable( + k[0], + tbl, + m, + 0 + /* Type.DOTTED */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + let v = extractValue(toml, k[1], void 0, maxDepth); + p[1][p[0]] = v[0]; + ptr = v[1]; + } + ptr = skipVoid(toml, ptr, true); + if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { + throw new TomlError("each key-value declaration must be followed by an end-of-line", { + toml, + ptr + }); + } + ptr = skipVoid(toml, ptr); + } + return res; +} + +// src/utils/read-file.js +import fs2 from "fs/promises"; +async function readFile(file) { + if (isUrlString(file)) { + file = new URL(file); + } + try { + return await fs2.readFile(file, "utf8"); + } catch (error) { + if (error.code === "ENOENT") { + return; + } + throw new Error(`Unable to read '${file}': ${error.message}`); + } +} +var read_file_default = readFile; + +// src/config/prettier-config/loaders.js +async function readJson(file) { + const content = await read_file_default(file); + try { + return parseJson(content); + } catch (error) { + error.message = `JSON Error in ${file}: +${error.message}`; + throw error; + } +} +async function importModuleDefault(file) { + const module = await import(pathToFileURL2(file).href); + return module.default; +} +async function readBunPackageJson(file) { + try { + return await readJson(file); + } catch (error) { + try { + return await importModuleDefault(file); + } catch { + } + throw error; + } +} +var loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file) { + const { prettier } = await readBunPackageJson(file); + return prettier; +} : async function loadConfigFromPackageJson2(file) { + const { prettier } = await readJson(file); + return prettier; +}; +async function loadConfigFromPackageYaml(file) { + const { prettier } = await loadYaml(file); + return prettier; +} +var parseYaml; +async function loadYaml(file) { + const content = await read_file_default(file); + if (!parseYaml) { + ({ __parsePrettierYamlConfig: parseYaml } = await import("./plugins/yaml.mjs")); + } + try { + return parseYaml(content); + } catch (error) { + error.message = `YAML Error in ${file}: +${error.message}`; + throw error; + } +} +async function loadToml(file) { + const content = await read_file_default(file); + try { + return parse4(content); + } catch (error) { + error.message = `TOML Error in ${file}: +${error.message}`; + throw error; + } +} +async function loadJson5(file) { + const content = await read_file_default(file); + try { + return dist_default.parse(content); + } catch (error) { + error.message = `JSON5 Error in ${file}: +${error.message}`; + throw error; + } +} +var loaders = { + ".toml": loadToml, + ".json5": loadJson5, + ".json": readJson, + ".js": importModuleDefault, + ".mjs": importModuleDefault, + ".cjs": importModuleDefault, + ".ts": importModuleDefault, + ".mts": importModuleDefault, + ".cts": importModuleDefault, + ".yaml": loadYaml, + ".yml": loadYaml, + // No extension + "": loadYaml +}; +var loaders_default = loaders; + +// src/config/prettier-config/config-searcher.js +var CONFIG_FILE_NAMES = [ + "package.json", + "package.yaml", + ".prettierrc", + ".prettierrc.json", + ".prettierrc.yaml", + ".prettierrc.yml", + ".prettierrc.json5", + ".prettierrc.js", + ".prettierrc.ts", + ".prettierrc.mjs", + ".prettierrc.mts", + ".prettierrc.cjs", + ".prettierrc.cts", + "prettier.config.js", + "prettier.config.ts", + "prettier.config.mjs", + "prettier.config.mts", + "prettier.config.cjs", + "prettier.config.cts", + ".prettierrc.toml" +]; +async function filter({ name, path: file }) { + if (name === "package.json") { + try { + return Boolean(await loadConfigFromPackageJson(file)); + } catch { + return false; + } + } + if (name === "package.yaml") { + try { + return Boolean(await loadConfigFromPackageYaml(file)); + } catch { + return false; + } + } + return true; +} +function getSearcher(stopDirectory) { + return new FileSearcher(CONFIG_FILE_NAMES, { filter, stopDirectory }); +} +var config_searcher_default = getSearcher; + +// src/config/prettier-config/load-config.js +import path8 from "path"; + +// src/utils/import-from-file.js +import { pathToFileURL as pathToFileURL4 } from "url"; + +// node_modules/import-meta-resolve/lib/resolve.js +import assert3 from "assert"; +import { statSync, realpathSync } from "fs"; +import process4 from "process"; +import { URL as URL2, fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "url"; +import path7 from "path"; +import { builtinModules } from "module"; + +// node_modules/import-meta-resolve/lib/get-format.js +import { fileURLToPath as fileURLToPath3 } from "url"; + +// node_modules/import-meta-resolve/lib/package-json-reader.js +import fs3 from "fs"; +import path6 from "path"; +import { fileURLToPath as fileURLToPath2 } from "url"; + +// node_modules/import-meta-resolve/lib/errors.js +import v8 from "v8"; +import assert2 from "assert"; +import { format, inspect } from "util"; +var own = {}.hasOwnProperty; +var classRegExp = /^([A-Z][a-z\d]*)+$/; +var kTypes = /* @__PURE__ */ new Set([ + "string", + "function", + "number", + "object", + // Accept 'Function' and 'Object' as alternative to the lower cased version. + "Function", + "Object", + "boolean", + "bigint", + "symbol" +]); +var codes = {}; +function formatList(array2, type = "and") { + return array2.length < 3 ? array2.join(` ${type} `) : `${array2.slice(0, -1).join(", ")}, ${type} ${array2[array2.length - 1]}`; +} +var messages = /* @__PURE__ */ new Map(); +var nodeInternalPrefix = "__node_internal_"; +var userStackTraceLimit; +codes.ERR_INVALID_ARG_TYPE = createError( + "ERR_INVALID_ARG_TYPE", + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + assert2(typeof name === "string", "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let message = "The "; + if (name.endsWith(" argument")) { + message += `${name} `; + } else { + const type = name.includes(".") ? "property" : "argument"; + message += `"${name}" ${type} `; + } + message += "must be "; + const types = []; + const instances = []; + const other = []; + for (const value of expected) { + assert2( + typeof value === "string", + "All expected entries have to be of type string" + ); + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + assert2( + value !== "object", + 'The value "object" should be written as "Object"' + ); + other.push(value); + } else { + instances.push(value); + } + } + if (instances.length > 0) { + const pos2 = types.indexOf("object"); + if (pos2 !== -1) { + types.slice(pos2, 1); + instances.push("Object"); + } + } + if (types.length > 0) { + message += `${types.length > 1 ? "one of type" : "of type"} ${formatList( + types, + "or" + )}`; + if (instances.length > 0 || other.length > 0) message += " or "; + } + if (instances.length > 0) { + message += `an instance of ${formatList(instances, "or")}`; + if (other.length > 0) message += " or "; + } + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, "or")}`; + } else { + if (other[0].toLowerCase() !== other[0]) message += "an "; + message += `${other[0]}`; + } + } + message += `. Received ${determineSpecificType(actual)}`; + return message; + }, + TypeError +); +codes.ERR_INVALID_MODULE_SPECIFIER = createError( + "ERR_INVALID_MODULE_SPECIFIER", + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; + }, + TypeError +); +codes.ERR_INVALID_PACKAGE_CONFIG = createError( + "ERR_INVALID_PACKAGE_CONFIG", + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path14, base, message) => { + return `Invalid package config ${path14}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; + }, + Error +); +codes.ERR_INVALID_PACKAGE_TARGET = createError( + "ERR_INVALID_PACKAGE_TARGET", + /** + * @param {string} packagePath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (packagePath, key2, target, isImport = false, base = void 0) => { + const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); + if (key2 === ".") { + assert2(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`; + } + return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( + target + )} defined for '${key2}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`; + }, + Error +); +codes.ERR_MODULE_NOT_FOUND = createError( + "ERR_MODULE_NOT_FOUND", + /** + * @param {string} path + * @param {string} base + * @param {boolean} [exactUrl] + */ + (path14, base, exactUrl = false) => { + return `Cannot find ${exactUrl ? "module" : "package"} '${path14}' imported from ${base}`; + }, + Error +); +codes.ERR_NETWORK_IMPORT_DISALLOWED = createError( + "ERR_NETWORK_IMPORT_DISALLOWED", + "import of '%s' by %s is not supported: %s", + Error +); +codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + "ERR_PACKAGE_IMPORT_NOT_DEFINED", + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; + }, + TypeError +); +codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + /** + * @param {string} packagePath + * @param {string} subpath + * @param {string} [base] + */ + (packagePath, subpath, base = void 0) => { + if (subpath === ".") + return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + }, + Error +); +codes.ERR_UNSUPPORTED_DIR_IMPORT = createError( + "ERR_UNSUPPORTED_DIR_IMPORT", + "Directory import '%s' is not supported resolving ES modules imported from %s", + Error +); +codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError( + "ERR_UNSUPPORTED_RESOLVE_REQUEST", + 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', + TypeError +); +codes.ERR_UNKNOWN_FILE_EXTENSION = createError( + "ERR_UNKNOWN_FILE_EXTENSION", + /** + * @param {string} extension + * @param {string} path + */ + (extension, path14) => { + return `Unknown file extension "${extension}" for ${path14}`; + }, + TypeError +); +codes.ERR_INVALID_ARG_VALUE = createError( + "ERR_INVALID_ARG_VALUE", + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = "is invalid") => { + let inspected = inspect(value); + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; + } + const type = name.includes(".") ? "property" : "argument"; + return `The ${type} '${name}' ${reason}. Received ${inspected}`; + }, + TypeError + // Note: extra classes have been shaken out. + // , RangeError +); +function createError(sym, value, constructor) { + messages.set(sym, value); + return makeNodeErrorWithCode(constructor, sym); +} +function makeNodeErrorWithCode(Base, key2) { + return NodeError; + function NodeError(...parameters) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; + const error = new Base(); + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; + const message = getMessage(key2, parameters, error); + Object.defineProperties(error, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key2}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true + } + }); + captureLargerStackTrace(error); + error.code = key2; + return error; + } +} +function isErrorStackTraceLimitWritable() { + try { + if (v8.startupSnapshot.isBuildingSnapshot()) { + return false; + } + } catch { + } + const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); + if (desc === void 0) { + return Object.isExtensible(Error); + } + return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; +} +function hideStackFrames(wrappedFunction) { + const hidden = nodeInternalPrefix + wrappedFunction.name; + Object.defineProperty(wrappedFunction, "name", { value: hidden }); + return wrappedFunction; +} +var captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function(error) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + Error.captureStackTrace(error); + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; + return error; + } +); +function getMessage(key2, parameters, self) { + const message = messages.get(key2); + assert2(message !== void 0, "expected `message` to be found"); + if (typeof message === "function") { + assert2( + message.length <= parameters.length, + // Default options do not count. + `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).` + ); + return Reflect.apply(message, self, parameters); + } + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) expectedLength++; + assert2( + expectedLength === parameters.length, + `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).` + ); + if (parameters.length === 0) return message; + parameters.unshift(message); + return Reflect.apply(format, null, parameters); +} +function determineSpecificType(value) { + if (value === null || value === void 0) { + return String(value); + } + if (typeof value === "function" && value.name) { + return `function ${value.name}`; + } + if (typeof value === "object") { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}`; + } + return `${inspect(value, { depth: -1 })}`; + } + let inspected = inspect(value, { colors: false }); + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; + } + return `type ${typeof value} (${inspected})`; +} + +// node_modules/import-meta-resolve/lib/package-json-reader.js +var hasOwnProperty = {}.hasOwnProperty; +var { ERR_INVALID_PACKAGE_CONFIG } = codes; +var cache = /* @__PURE__ */ new Map(); +function read2(jsonPath, { base, specifier }) { + const existing = cache.get(jsonPath); + if (existing) { + return existing; + } + let string; + try { + string = fs3.readFileSync(path6.toNamespacedPath(jsonPath), "utf8"); + } catch (error) { + const exception = ( + /** @type {ErrnoException} */ + error + ); + if (exception.code !== "ENOENT") { + throw exception; + } + } + const result = { + exists: false, + pjsonPath: jsonPath, + main: void 0, + name: void 0, + type: "none", + // Ignore unknown types for forwards compatibility + exports: void 0, + imports: void 0 + }; + if (string !== void 0) { + let parsed; + try { + parsed = JSON.parse(string); + } catch (error_) { + const cause = ( + /** @type {ErrnoException} */ + error_ + ); + const error = new ERR_INVALID_PACKAGE_CONFIG( + jsonPath, + (base ? `"${specifier}" from ` : "") + fileURLToPath2(base || specifier), + cause.message + ); + error.cause = cause; + throw error; + } + result.exists = true; + if (hasOwnProperty.call(parsed, "name") && typeof parsed.name === "string") { + result.name = parsed.name; + } + if (hasOwnProperty.call(parsed, "main") && typeof parsed.main === "string") { + result.main = parsed.main; + } + if (hasOwnProperty.call(parsed, "exports")) { + result.exports = parsed.exports; + } + if (hasOwnProperty.call(parsed, "imports")) { + result.imports = parsed.imports; + } + if (hasOwnProperty.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) { + result.type = parsed.type; + } + } + cache.set(jsonPath, result); + return result; +} +function getPackageScopeConfig(resolved) { + let packageJSONUrl = new URL("package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if (packageJSONPath2.endsWith("node_modules/package.json")) { + break; + } + const packageConfig = read2(fileURLToPath2(packageJSONUrl), { + specifier: resolved + }); + if (packageConfig.exists) { + return packageConfig; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = fileURLToPath2(packageJSONUrl); + return { + pjsonPath: packageJSONPath, + exists: false, + type: "none" + }; +} +function getPackageType(url3) { + return getPackageScopeConfig(url3).type; +} + +// node_modules/import-meta-resolve/lib/get-format.js +var { ERR_UNKNOWN_FILE_EXTENSION } = codes; +var hasOwnProperty2 = {}.hasOwnProperty; +var extensionFormatMap = { + // @ts-expect-error: hush. + __proto__: null, + ".cjs": "commonjs", + ".js": "module", + ".json": "json", + ".mjs": "module" +}; +function mimeToFormat(mime) { + if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) + return "module"; + if (mime === "application/json") return "json"; + return null; +} +var protocolHandlers = { + // @ts-expect-error: hush. + __proto__: null, + "data:": getDataProtocolModuleFormat, + "file:": getFileProtocolModuleFormat, + "http:": getHttpProtocolModuleFormat, + "https:": getHttpProtocolModuleFormat, + "node:"() { + return "builtin"; + } +}; +function getDataProtocolModuleFormat(parsed) { + const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( + parsed.pathname + ) || [null, null, null]; + return mimeToFormat(mime); +} +function extname(url3) { + const pathname = url3.pathname; + let index = pathname.length; + while (index--) { + const code = pathname.codePointAt(index); + if (code === 47) { + return ""; + } + if (code === 46) { + return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index); + } + } + return ""; +} +function getFileProtocolModuleFormat(url3, _context, ignoreErrors) { + const value = extname(url3); + if (value === ".js") { + const packageType = getPackageType(url3); + if (packageType !== "none") { + return packageType; + } + return "commonjs"; + } + if (value === "") { + const packageType = getPackageType(url3); + if (packageType === "none" || packageType === "commonjs") { + return "commonjs"; + } + return "module"; + } + const format3 = extensionFormatMap[value]; + if (format3) return format3; + if (ignoreErrors) { + return void 0; + } + const filepath = fileURLToPath3(url3); + throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath); +} +function getHttpProtocolModuleFormat() { +} +function defaultGetFormatWithoutErrors(url3, context) { + const protocol = url3.protocol; + if (!hasOwnProperty2.call(protocolHandlers, protocol)) { + return null; + } + return protocolHandlers[protocol](url3, context, true) || null; +} + +// node_modules/import-meta-resolve/lib/utils.js +var { ERR_INVALID_ARG_VALUE } = codes; +var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); +var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); +function getDefaultConditions() { + return DEFAULT_CONDITIONS; +} +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET; +} +function getConditionsSet(conditions) { + if (conditions !== void 0 && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE( + "conditions", + conditions, + "expected an array" + ); + } + return new Set(conditions); + } + return getDefaultConditionsSet(); +} + +// node_modules/import-meta-resolve/lib/resolve.js +var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; +var { + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_RESOLVE_REQUEST +} = codes; +var own2 = {}.hasOwnProperty; +var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; +var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +var invalidPackageNameRegEx = /^\.|%|\\/; +var patternRegEx = /\*/g; +var encodedSeparatorRegEx = /%2f|%5c/i; +var emittedPackageWarnings = /* @__PURE__ */ new Set(); +var doubleSlashRegEx = /[/\\]{2}/; +function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { + if (process4.noDeprecation) { + return; + } + const pjsonPath = fileURLToPath4(packageJsonUrl); + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; + process4.emitWarning( + `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}.`, + "DeprecationWarning", + "DEP0166" + ); +} +function emitLegacyIndexDeprecation(url3, packageJsonUrl, base, main) { + if (process4.noDeprecation) { + return; + } + const format3 = defaultGetFormatWithoutErrors(url3, { parentURL: base.href }); + if (format3 !== "module") return; + const urlPath = fileURLToPath4(url3.href); + const packagePath = fileURLToPath4(new URL2(".", packageJsonUrl)); + const basePath = fileURLToPath4(base); + if (!main) { + process4.emitWarning( + `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}. +Default "index" lookups for the main are deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + } else if (path7.resolve(packagePath, main) !== urlPath) { + process4.emitWarning( + `Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice( + packagePath.length + )}", imported from ${basePath}. + Automatic extension resolution of the "main" field is deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + } +} +function tryStatSync(path14) { + try { + return statSync(path14); + } catch { + } +} +function fileExists(url3) { + const stats = statSync(url3, { throwIfNoEntry: false }); + const isFile2 = stats ? stats.isFile() : void 0; + return isFile2 === null || isFile2 === void 0 ? false : isFile2; +} +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== void 0) { + guess = new URL2(packageConfig.main, packageJsonUrl); + if (fileExists(guess)) return guess; + const tries2 = [ + `./${packageConfig.main}.js`, + `./${packageConfig.main}.json`, + `./${packageConfig.main}.node`, + `./${packageConfig.main}/index.js`, + `./${packageConfig.main}/index.json`, + `./${packageConfig.main}/index.node` + ]; + let i2 = -1; + while (++i2 < tries2.length) { + guess = new URL2(tries2[i2], packageJsonUrl); + if (fileExists(guess)) break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation( + guess, + packageJsonUrl, + base, + packageConfig.main + ); + return guess; + } + } + const tries = ["./index.js", "./index.json", "./index.node"]; + let i = -1; + while (++i < tries.length) { + guess = new URL2(tries[i], packageJsonUrl); + if (fileExists(guess)) break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + throw new ERR_MODULE_NOT_FOUND( + fileURLToPath4(new URL2(".", packageJsonUrl)), + fileURLToPath4(base) + ); +} +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) { + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + fileURLToPath4(base) + ); + } + let filePath; + try { + filePath = fileURLToPath4(resolved); + } catch (error) { + const cause = ( + /** @type {ErrnoException} */ + error + ); + Object.defineProperty(cause, "input", { value: String(resolved) }); + Object.defineProperty(cause, "module", { value: String(base) }); + throw cause; + } + const stats = tryStatSync( + filePath.endsWith("/") ? filePath.slice(-1) : filePath + ); + if (stats && stats.isDirectory()) { + const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath4(base)); + error.url = String(resolved); + throw error; + } + if (!stats || !stats.isFile()) { + const error = new ERR_MODULE_NOT_FOUND( + filePath || resolved.pathname, + base && fileURLToPath4(base), + true + ); + error.url = String(resolved); + throw error; + } + if (!preserveSymlinks) { + const real = realpathSync(filePath); + const { search, hash } = resolved; + resolved = pathToFileURL3(real + (filePath.endsWith(path7.sep) ? "/" : "")); + resolved.search = search; + resolved.hash = hash; + } + return resolved; +} +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJsonUrl && fileURLToPath4(new URL2(".", packageJsonUrl)), + fileURLToPath4(base) + ); +} +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED( + fileURLToPath4(new URL2(".", packageJsonUrl)), + subpath, + base && fileURLToPath4(base) + ); +} +function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath4(packageJsonUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + request, + reason, + base && fileURLToPath4(base) + ); +} +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; + return new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath4(new URL2(".", packageJsonUrl)), + subpath, + target, + internal, + base && fileURLToPath4(base) + ); +} +function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (!target.startsWith("./")) { + if (internal && !target.startsWith("../") && !target.startsWith("/")) { + let isURL2 = false; + try { + new URL2(target); + isURL2 = true; + } catch { + } + if (!isURL2) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target + subpath; + return packageResolve(exportTarget, packageJsonUrl, conditions); + } + } + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern ? match.replace("*", () => subpath) : match + subpath; + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + true + ); + } + } else { + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + } + const resolved = new URL2(target, packageJsonUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL2(".", packageJsonUrl).pathname; + if (!resolvedPath.startsWith(packagePath)) + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (subpath === "") return resolved; + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern ? match.replace("*", () => subpath) : match + subpath; + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match, + packageJsonUrl, + internal, + base, + false + ); + } + } else { + throwInvalidSubpath(request, match, packageJsonUrl, internal, base); + } + } + if (pattern) { + return new URL2( + RegExpPrototypeSymbolReplace.call( + patternRegEx, + resolved.href, + () => subpath + ) + ); + } + return new URL2(subpath, resolved); +} +function isArrayIndex(key2) { + const keyNumber = Number(key2); + if (`${keyNumber}` !== key2) return false; + return keyNumber >= 0 && keyNumber < 4294967295; +} +function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions + ); + } + if (Array.isArray(target)) { + const targetList = target; + if (targetList.length === 0) return null; + let lastException; + let i = -1; + while (++i < targetList.length) { + const targetItem = targetList[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJsonUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + } catch (error) { + const exception = ( + /** @type {ErrnoException} */ + error + ); + lastException = exception; + if (exception.code === "ERR_INVALID_PACKAGE_TARGET") continue; + throw error; + } + if (resolveResult === void 0) continue; + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === void 0 || lastException === null) { + return null; + } + throw lastException; + } + if (typeof target === "object" && target !== null) { + const keys = Object.getOwnPropertyNames(target); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + if (isArrayIndex(key2)) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + fileURLToPath4(packageJsonUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } + } + i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + if (key2 === "default" || conditions && conditions.has(key2)) { + const conditionalTarget = ( + /** @type {unknown} */ + target[key2] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + if (resolveResult === void 0) continue; + return resolveResult; + } + } + return null; + } + if (target === null) { + return null; + } + throw invalidPackageTarget( + packageSubpath, + target, + packageJsonUrl, + internal, + base + ); +} +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === "string" || Array.isArray(exports)) return true; + if (typeof exports !== "object" || exports === null) return false; + const keys = Object.getOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + let keyIndex = -1; + while (++keyIndex < keys.length) { + const key2 = keys[keyIndex]; + const currentIsConditionalSugar = key2 === "" || key2[0] !== "."; + if (i++ === 0) { + isConditionalSugar = currentIsConditionalSugar; + } else if (isConditionalSugar !== currentIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + fileURLToPath4(packageJsonUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); + } + } + return isConditionalSugar; +} +function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + if (process4.noDeprecation) { + return; + } + const pjsonPath = fileURLToPath4(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return; + emittedPackageWarnings.add(pjsonPath + "|" + match); + process4.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, + "DeprecationWarning", + "DEP0155" + ); +} +function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = { ".": exports }; + } + if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + "", + packageSubpath, + base, + false, + false, + false, + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys = Object.getOwnPropertyNames(exports); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + const patternIndex = key2.indexOf("*"); + if (patternIndex !== -1 && packageSubpath.startsWith(key2.slice(0, patternIndex))) { + if (packageSubpath.endsWith("/")) { + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJsonUrl, + base + ); + } + const patternTrailer = key2.slice(patternIndex + 1); + if (packageSubpath.length >= key2.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) { + bestMatch = key2; + bestMatchSubpath = packageSubpath.slice( + patternIndex, + packageSubpath.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = ( + /** @type {unknown} */ + exports[bestMatch] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + packageSubpath.endsWith("/"), + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + throw exportsNotFound(packageSubpath, packageJsonUrl, base); +} +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLengthA > baseLengthB) return -1; + if (baseLengthB > baseLengthA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + return 0; +} +function packageImportsResolve(name, base, conditions) { + if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath4(base)); + } + let packageJsonUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJsonUrl = pathToFileURL3(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (own2.call(imports, name) && !name.includes("*")) { + const resolveResult = resolvePackageTarget( + packageJsonUrl, + imports[name], + "", + name, + base, + false, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys = Object.getOwnPropertyNames(imports); + let i = -1; + while (++i < keys.length) { + const key2 = keys[i]; + const patternIndex = key2.indexOf("*"); + if (patternIndex !== -1 && name.startsWith(key2.slice(0, -1))) { + const patternTrailer = key2.slice(patternIndex + 1); + if (name.length >= key2.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) { + bestMatch = key2; + bestMatchSubpath = name.slice( + patternIndex, + name.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } + } + } + } + } + throw importNotDefined(name, packageJsonUrl, base); +} +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf("/"); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === "@") { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = specifier.indexOf("/", separatorIndex + 1); + } + } + const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); + if (invalidPackageNameRegEx.exec(packageName) !== null) { + validPackageName = false; + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + "is not a valid package name", + fileURLToPath4(base) + ); + } + const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); + return { packageName, packageSubpath, isScoped }; +} +function packageResolve(specifier, base, conditions) { + if (builtinModules.includes(specifier)) { + return new URL2("node:" + specifier); + } + const { packageName, packageSubpath, isScoped } = parsePackageName( + specifier, + base + ); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJsonUrl2 = pathToFileURL3(packageConfig.pjsonPath); + if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) { + return packageExportsResolve( + packageJsonUrl2, + packageSubpath, + packageConfig, + base, + conditions + ); + } + } + let packageJsonUrl = new URL2( + "./node_modules/" + packageName + "/package.json", + base + ); + let packageJsonPath = fileURLToPath4(packageJsonUrl); + let lastPath; + do { + const stat2 = tryStatSync(packageJsonPath.slice(0, -13)); + if (!stat2 || !stat2.isDirectory()) { + lastPath = packageJsonPath; + packageJsonUrl = new URL2( + (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", + packageJsonUrl + ); + packageJsonPath = fileURLToPath4(packageJsonUrl); + continue; + } + const packageConfig2 = read2(packageJsonPath, { base, specifier }); + if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig2, + base, + conditions + ); + } + if (packageSubpath === ".") { + return legacyMainResolve(packageJsonUrl, packageConfig2, base); + } + return new URL2(packageSubpath, packageJsonUrl); + } while (packageJsonPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath4(base), false); +} +function isRelativeSpecifier(specifier) { + if (specifier[0] === ".") { + if (specifier.length === 1 || specifier[1] === "/") return true; + if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + return true; + } + } + return false; +} +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === "") return false; + if (specifier[0] === "/") return true; + return isRelativeSpecifier(specifier); +} +function moduleResolve(specifier, base, conditions, preserveSymlinks) { + const protocol = base.protocol; + const isData = protocol === "data:"; + const isRemote = isData || protocol === "http:" || protocol === "https:"; + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + try { + resolved = new URL2(specifier, base); + } catch (error_) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + } else if (protocol === "file:" && specifier[0] === "#") { + resolved = packageImportsResolve(specifier, base, conditions); + } else { + try { + resolved = new URL2(specifier); + } catch (error_) { + if (isRemote && !builtinModules.includes(specifier)) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + resolved = packageResolve(specifier, base, conditions); + } + } + assert3(resolved !== void 0, "expected to be defined"); + if (resolved.protocol !== "file:") { + return resolved; + } + return finalizeResolution(resolved, base, preserveSymlinks); +} +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + const parentProtocol = parsedParentURL.protocol; + if (parentProtocol === "http:" || parentProtocol === "https:") { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + const parsedProtocol = parsed == null ? void 0 : parsed.protocol; + if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); + } + return { url: (parsed == null ? void 0 : parsed.href) || "" }; + } + if (builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); + } + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "only relative and absolute specifiers are supported." + ); + } + } +} +function isURL(self) { + return Boolean( + self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol + ); +} +function throwIfInvalidParentURL(parentURL) { + if (parentURL === void 0) { + return; + } + if (typeof parentURL !== "string" && !isURL(parentURL)) { + throw new codes.ERR_INVALID_ARG_TYPE( + "parentURL", + ["string", "URL"], + parentURL + ); + } +} +function defaultResolve(specifier, context = {}) { + const { parentURL } = context; + assert3(parentURL !== void 0, "expected `parentURL` to be defined"); + throwIfInvalidParentURL(parentURL); + let parsedParentURL; + if (parentURL) { + try { + parsedParentURL = new URL2(parentURL); + } catch { + } + } + let parsed; + let protocol; + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL2(specifier, parsedParentURL) : new URL2(specifier); + protocol = parsed.protocol; + if (protocol === "data:") { + return { url: parsed.href, format: null }; + } + } catch { + } + const maybeReturn = checkIfDisallowedImport( + specifier, + parsed, + parsedParentURL + ); + if (maybeReturn) return maybeReturn; + if (protocol === void 0 && parsed) { + protocol = parsed.protocol; + } + if (protocol === "node:") { + return { url: specifier }; + } + if (parsed && parsed.protocol === "node:") return { url: specifier }; + const conditions = getConditionsSet(context.conditions); + const url3 = moduleResolve(specifier, new URL2(parentURL), conditions, false); + return { + // Do NOT cast `url` to a string: that will work even when there are real + // problems, silencing them + url: url3.href, + format: defaultGetFormatWithoutErrors(url3, { parentURL }) + }; +} + +// node_modules/import-meta-resolve/index.js +function resolve2(specifier, parent) { + if (!parent) { + throw new Error( + "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" + ); + } + try { + return defaultResolve(specifier, { parentURL: parent }).url; + } catch (error) { + const exception = ( + /** @type {ErrnoException} */ + error + ); + if ((exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" || exception.code === "ERR_MODULE_NOT_FOUND") && typeof exception.url === "string") { + return exception.url; + } + throw error; + } +} + +// src/utils/import-from-file.js +function importFromFile(specifier, parent) { + const url3 = resolve2(specifier, pathToFileURL4(parent).href); + return import(url3); +} +var import_from_file_default = importFromFile; + +// src/utils/require-from-file.js +import { createRequire } from "module"; +function requireFromFile(id, parent) { + const require2 = createRequire(parent); + return require2(id); +} +var require_from_file_default = requireFromFile; + +// src/config/prettier-config/load-external-config.js +var requireErrorCodesShouldBeIgnored = /* @__PURE__ */ new Set([ + "MODULE_NOT_FOUND", + "ERR_REQUIRE_ESM", + "ERR_PACKAGE_PATH_NOT_EXPORTED", + "ERR_REQUIRE_ASYNC_MODULE" +]); +async function loadExternalConfig(externalConfig, configFile) { + try { + const required = require_from_file_default(externalConfig, configFile); + if (process.features.require_module && required.__esModule) { + return required.default; + } + return required; + } catch (error) { + if (!requireErrorCodesShouldBeIgnored.has(error == null ? void 0 : error.code)) { + throw error; + } + } + const module = await import_from_file_default(externalConfig, configFile); + return module.default; +} +var load_external_config_default = loadExternalConfig; + +// src/config/prettier-config/load-config.js +async function loadConfig(configFile) { + const { base: fileName, ext: extension } = path8.parse(configFile); + const load = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension]; + if (!load) { + throw new Error( + `No loader specified for extension "${extension || "noExt"}"` + ); + } + let config = await load(configFile); + if (!config) { + return; + } + if (typeof config === "string") { + config = await load_external_config_default(config, configFile); + } + if (typeof config !== "object") { + throw new TypeError( + `Config is only allowed to be an object, but received ${typeof config} in "${configFile}"` + ); + } + delete config.$schema; + return config; +} +var load_config_default = loadConfig; + +// src/config/prettier-config/index.js +var loadCache = /* @__PURE__ */ new Map(); +var searchCache = /* @__PURE__ */ new Map(); +function clearPrettierConfigCache() { + loadCache.clear(); + searchCache.clear(); +} +function loadPrettierConfig(configFile, { shouldCache }) { + configFile = path9.resolve(configFile); + if (!shouldCache || !loadCache.has(configFile)) { + loadCache.set(configFile, load_config_default(configFile)); + } + return loadCache.get(configFile); +} +function getSearchFunction(stopDirectory) { + stopDirectory = stopDirectory ? path9.resolve(stopDirectory) : void 0; + if (!searchCache.has(stopDirectory)) { + const searcher2 = config_searcher_default(stopDirectory); + const searchFunction = searcher2.search.bind(searcher2); + searchCache.set(stopDirectory, searchFunction); + } + return searchCache.get(stopDirectory); +} +function searchPrettierConfig(startDirectory, options8 = {}) { + startDirectory = startDirectory ? path9.resolve(startDirectory) : process.cwd(); + const stopDirectory = mockable_default.getPrettierConfigSearchStopDirectory(); + const search = getSearchFunction(stopDirectory); + return search(startDirectory, { cache: options8.shouldCache }); +} + +// src/config/resolve-config.js +function clearCache() { + clearPrettierConfigCache(); + clearEditorconfigCache(); +} +function loadEditorconfig2(file, options8) { + if (!file || !options8.editorconfig) { + return; + } + const shouldCache = options8.useCache; + return loadEditorconfig(file, { shouldCache }); +} +async function loadPrettierConfig2(file, options8) { + const shouldCache = options8.useCache; + let configFile = options8.config; + if (!configFile) { + const directory = file ? path10.dirname(path10.resolve(file)) : void 0; + configFile = await searchPrettierConfig(directory, { shouldCache }); + } + if (!configFile) { + return; + } + configFile = toPath(configFile); + const config = await loadPrettierConfig(configFile, { shouldCache }); + return { config, configFile }; +} +async function resolveConfig(fileUrlOrPath, options8) { + options8 = { useCache: true, ...options8 }; + const filePath = toPath(fileUrlOrPath); + const [result, editorConfigured] = await Promise.all([ + loadPrettierConfig2(filePath, options8), + loadEditorconfig2(filePath, options8) + ]); + if (!result && !editorConfigured) { + return null; + } + const merged = { + ...editorConfigured, + ...mergeOverrides(result, filePath) + }; + if (Array.isArray(merged.plugins)) { + merged.plugins = merged.plugins.map( + (value) => typeof value === "string" && value.startsWith(".") ? path10.resolve(path10.dirname(result.configFile), value) : value + ); + } + return merged; +} +async function resolveConfigFile(fileUrlOrPath) { + const directory = fileUrlOrPath ? path10.dirname(path10.resolve(toPath(fileUrlOrPath))) : void 0; + const result = await searchPrettierConfig(directory, { shouldCache: false }); + return result ?? null; +} +function mergeOverrides(configResult, filePath) { + const { config, configFile } = configResult || {}; + const { overrides, ...options8 } = config || {}; + if (filePath && overrides) { + const relativeFilePath = path10.relative(path10.dirname(configFile), filePath); + for (const override of overrides) { + if (pathMatchesGlobs( + relativeFilePath, + override.files, + override.excludeFiles + )) { + Object.assign(options8, override.options); + } + } + } + return options8; +} +function pathMatchesGlobs(filePath, patterns, excludedPatterns) { + const patternList = Array.isArray(patterns) ? patterns : [patterns]; + const [withSlashes, withoutSlashes] = partition_default( + patternList, + (pattern) => pattern.includes("/") + ); + return import_micromatch.default.isMatch(filePath, withoutSlashes, { + ignore: excludedPatterns, + basename: true, + dot: true + }) || import_micromatch.default.isMatch(filePath, withSlashes, { + ignore: excludedPatterns, + basename: false, + dot: true + }); +} + +// scripts/build/shims/string-replace-all.js +var stringReplaceAll = (isOptionalObject, original, pattern, replacement) => { + if (isOptionalObject && (original === void 0 || original === null)) { + return; + } + if (original.replaceAll) { + return original.replaceAll(pattern, replacement); + } + if (pattern.global) { + return original.replace(pattern, replacement); + } + return original.split(pattern).join(replacement); +}; +var string_replace_all_default = stringReplaceAll; + +// src/common/end-of-line.js +function guessEndOfLine(text) { + const index = text.indexOf("\r"); + if (index !== -1) { + return text.charAt(index + 1) === "\n" ? "crlf" : "cr"; + } + return "lf"; +} +function convertEndOfLineToChars(value) { + switch (value) { + case "cr": + return "\r"; + case "crlf": + return "\r\n"; + default: + return "\n"; + } +} +function countEndOfLineChars(text, eol) { + let regex; + switch (eol) { + case "\n": + regex = /\n/gu; + break; + case "\r": + regex = /\r/gu; + break; + case "\r\n": + regex = /\r\n/gu; + break; + default: + throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`); + } + const endOfLines = text.match(regex); + return endOfLines ? endOfLines.length : 0; +} +function normalizeEndOfLine(text) { + return string_replace_all_default( + /* isOptionalObject */ + false, + text, + /\r\n?/gu, + "\n" + ); +} + +// src/document/constants.js +var DOC_TYPE_STRING = "string"; +var DOC_TYPE_ARRAY = "array"; +var DOC_TYPE_CURSOR = "cursor"; +var DOC_TYPE_INDENT = "indent"; +var DOC_TYPE_ALIGN = "align"; +var DOC_TYPE_TRIM = "trim"; +var DOC_TYPE_GROUP = "group"; +var DOC_TYPE_FILL = "fill"; +var DOC_TYPE_IF_BREAK = "if-break"; +var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break"; +var DOC_TYPE_LINE_SUFFIX = "line-suffix"; +var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary"; +var DOC_TYPE_LINE = "line"; +var DOC_TYPE_LABEL = "label"; +var DOC_TYPE_BREAK_PARENT = "break-parent"; +var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([ + DOC_TYPE_CURSOR, + DOC_TYPE_INDENT, + DOC_TYPE_ALIGN, + DOC_TYPE_TRIM, + DOC_TYPE_GROUP, + DOC_TYPE_FILL, + DOC_TYPE_IF_BREAK, + DOC_TYPE_INDENT_IF_BREAK, + DOC_TYPE_LINE_SUFFIX, + DOC_TYPE_LINE_SUFFIX_BOUNDARY, + DOC_TYPE_LINE, + DOC_TYPE_LABEL, + DOC_TYPE_BREAK_PARENT +]); + +// scripts/build/shims/at.js +var at = (isOptionalObject, object, index) => { + if (isOptionalObject && (object === void 0 || object === null)) { + return; + } + if (Array.isArray(object) || typeof object === "string") { + return object[index < 0 ? object.length + index : index]; + } + return object.at(index); +}; +var at_default = at; + +// node_modules/trim-newlines/index.js +function trimNewlinesEnd(string) { + let end = string.length; + while (end > 0 && (string[end - 1] === "\r" || string[end - 1] === "\n")) { + end--; + } + return end < string.length ? string.slice(0, end) : string; +} + +// src/document/utils/get-doc-type.js +function getDocType(doc2) { + if (typeof doc2 === "string") { + return DOC_TYPE_STRING; + } + if (Array.isArray(doc2)) { + return DOC_TYPE_ARRAY; + } + if (!doc2) { + return; + } + const { type } = doc2; + if (VALID_OBJECT_DOC_TYPES.has(type)) { + return type; + } +} +var get_doc_type_default = getDocType; + +// src/document/invalid-doc-error.js +var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list); +function getDocErrorMessage(doc2) { + const type = doc2 === null ? "null" : typeof doc2; + if (type !== "string" && type !== "object") { + return `Unexpected doc '${type}', +Expected it to be 'string' or 'object'.`; + } + if (get_doc_type_default(doc2)) { + throw new Error("doc is valid."); + } + const objectType = Object.prototype.toString.call(doc2); + if (objectType !== "[object Object]") { + return `Unexpected doc '${objectType}'.`; + } + const EXPECTED_TYPE_VALUES = disjunctionListFormat( + [...VALID_OBJECT_DOC_TYPES].map((type2) => `'${type2}'`) + ); + return `Unexpected doc.type '${doc2.type}'. +Expected it to be ${EXPECTED_TYPE_VALUES}.`; +} +var InvalidDocError = class extends Error { + name = "InvalidDocError"; + constructor(doc2) { + super(getDocErrorMessage(doc2)); + this.doc = doc2; + } +}; +var invalid_doc_error_default = InvalidDocError; + +// src/document/utils/traverse-doc.js +var traverseDocOnExitStackMarker = {}; +function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) { + const docsStack = [doc2]; + while (docsStack.length > 0) { + const doc3 = docsStack.pop(); + if (doc3 === traverseDocOnExitStackMarker) { + onExit(docsStack.pop()); + continue; + } + if (onExit) { + docsStack.push(doc3, traverseDocOnExitStackMarker); + } + const docType = get_doc_type_default(doc3); + if (!docType) { + throw new invalid_doc_error_default(doc3); + } + if ((onEnter == null ? void 0 : onEnter(doc3)) === false) { + continue; + } + switch (docType) { + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc3 : doc3.parts; + for (let ic = parts.length, i = ic - 1; i >= 0; --i) { + docsStack.push(parts[i]); + } + break; + } + case DOC_TYPE_IF_BREAK: + docsStack.push(doc3.flatContents, doc3.breakContents); + break; + case DOC_TYPE_GROUP: + if (shouldTraverseConditionalGroups && doc3.expandedStates) { + for (let ic = doc3.expandedStates.length, i = ic - 1; i >= 0; --i) { + docsStack.push(doc3.expandedStates[i]); + } + } else { + docsStack.push(doc3.contents); + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + docsStack.push(doc3.contents); + break; + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc3); + } + } +} +var traverse_doc_default = traverseDoc; + +// src/document/utils.js +function mapDoc(doc2, cb) { + if (typeof doc2 === "string") { + return cb(doc2); + } + const mapped = /* @__PURE__ */ new Map(); + return rec(doc2); + function rec(doc3) { + if (mapped.has(doc3)) { + return mapped.get(doc3); + } + const result = process5(doc3); + mapped.set(doc3, result); + return result; + } + function process5(doc3) { + switch (get_doc_type_default(doc3)) { + case DOC_TYPE_ARRAY: + return cb(doc3.map(rec)); + case DOC_TYPE_FILL: + return cb({ ...doc3, parts: doc3.parts.map(rec) }); + case DOC_TYPE_IF_BREAK: + return cb({ + ...doc3, + breakContents: rec(doc3.breakContents), + flatContents: rec(doc3.flatContents) + }); + case DOC_TYPE_GROUP: { + let { expandedStates, contents } = doc3; + if (expandedStates) { + expandedStates = expandedStates.map(rec); + contents = expandedStates[0]; + } else { + contents = rec(contents); + } + return cb({ ...doc3, contents, expandedStates }); + } + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + case DOC_TYPE_LINE_SUFFIX: + return cb({ ...doc3, contents: rec(doc3.contents) }); + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + return cb(doc3); + default: + throw new invalid_doc_error_default(doc3); + } + } +} +function breakParentGroup(groupStack) { + if (groupStack.length > 0) { + const parentGroup = at_default( + /* isOptionalObject */ + false, + groupStack, + -1 + ); + if (!parentGroup.expandedStates && !parentGroup.break) { + parentGroup.break = "propagated"; + } + } + return null; +} +function propagateBreaks(doc2) { + const alreadyVisitedSet = /* @__PURE__ */ new Set(); + const groupStack = []; + function propagateBreaksOnEnterFn(doc3) { + if (doc3.type === DOC_TYPE_BREAK_PARENT) { + breakParentGroup(groupStack); + } + if (doc3.type === DOC_TYPE_GROUP) { + groupStack.push(doc3); + if (alreadyVisitedSet.has(doc3)) { + return false; + } + alreadyVisitedSet.add(doc3); + } + } + function propagateBreaksOnExitFn(doc3) { + if (doc3.type === DOC_TYPE_GROUP) { + const group = groupStack.pop(); + if (group.break) { + breakParentGroup(groupStack); + } + } + } + traverse_doc_default( + doc2, + propagateBreaksOnEnterFn, + propagateBreaksOnExitFn, + /* shouldTraverseConditionalGroups */ + true + ); +} +function stripTrailingHardlineFromParts(parts) { + parts = [...parts]; + while (parts.length >= 2 && at_default( + /* isOptionalObject */ + false, + parts, + -2 + ).type === DOC_TYPE_LINE && at_default( + /* isOptionalObject */ + false, + parts, + -1 + ).type === DOC_TYPE_BREAK_PARENT) { + parts.length -= 2; + } + if (parts.length > 0) { + const lastPart = stripTrailingHardlineFromDoc(at_default( + /* isOptionalObject */ + false, + parts, + -1 + )); + parts[parts.length - 1] = lastPart; + } + return parts; +} +function stripTrailingHardlineFromDoc(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_GROUP: + case DOC_TYPE_LINE_SUFFIX: + case DOC_TYPE_LABEL: { + const contents = stripTrailingHardlineFromDoc(doc2.contents); + return { ...doc2, contents }; + } + case DOC_TYPE_IF_BREAK: + return { + ...doc2, + breakContents: stripTrailingHardlineFromDoc(doc2.breakContents), + flatContents: stripTrailingHardlineFromDoc(doc2.flatContents) + }; + case DOC_TYPE_FILL: + return { ...doc2, parts: stripTrailingHardlineFromParts(doc2.parts) }; + case DOC_TYPE_ARRAY: + return stripTrailingHardlineFromParts(doc2); + case DOC_TYPE_STRING: + return trimNewlinesEnd(doc2); + case DOC_TYPE_ALIGN: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + return doc2; +} +function stripTrailingHardline(doc2) { + return stripTrailingHardlineFromDoc(cleanDoc(doc2)); +} +function cleanDocFn(doc2) { + switch (get_doc_type_default(doc2)) { + case DOC_TYPE_FILL: + if (doc2.parts.every((part) => part === "")) { + return ""; + } + break; + case DOC_TYPE_GROUP: + if (!doc2.contents && !doc2.id && !doc2.break && !doc2.expandedStates) { + return ""; + } + if (doc2.contents.type === DOC_TYPE_GROUP && doc2.contents.id === doc2.id && doc2.contents.break === doc2.break && doc2.contents.expandedStates === doc2.expandedStates) { + return doc2.contents; + } + break; + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LINE_SUFFIX: + if (!doc2.contents) { + return ""; + } + break; + case DOC_TYPE_IF_BREAK: + if (!doc2.flatContents && !doc2.breakContents) { + return ""; + } + break; + case DOC_TYPE_ARRAY: { + const parts = []; + for (const part of doc2) { + if (!part) { + continue; + } + const [currentPart, ...restParts] = Array.isArray(part) ? part : [part]; + if (typeof currentPart === "string" && typeof at_default( + /* isOptionalObject */ + false, + parts, + -1 + ) === "string") { + parts[parts.length - 1] += currentPart; + } else { + parts.push(currentPart); + } + parts.push(...restParts); + } + if (parts.length === 0) { + return ""; + } + if (parts.length === 1) { + return parts[0]; + } + return parts; + } + case DOC_TYPE_STRING: + case DOC_TYPE_CURSOR: + case DOC_TYPE_TRIM: + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + case DOC_TYPE_LINE: + case DOC_TYPE_LABEL: + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc2); + } + return doc2; +} +function cleanDoc(doc2) { + return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc)); +} +function inheritLabel(doc2, fn) { + return doc2.type === DOC_TYPE_LABEL ? { ...doc2, contents: fn(doc2.contents) } : fn(doc2); +} + +// src/document/utils/assert-doc.js +var noop = () => { +}; +var assertDoc = true ? noop : function(doc2) { + traverse_doc_default(doc2, (doc3) => { + if (checked.has(doc3)) { + return false; + } + if (typeof doc3 !== "string") { + checked.add(doc3); + } + }); +}; + +// src/document/builders.js +function indent(contents) { + assertDoc(contents); + return { type: DOC_TYPE_INDENT, contents }; +} +function align(widthOrString, contents) { + assertDoc(contents); + return { type: DOC_TYPE_ALIGN, contents, n: widthOrString }; +} +function lineSuffix(contents) { + assertDoc(contents); + return { type: DOC_TYPE_LINE_SUFFIX, contents }; +} +var breakParent = { type: DOC_TYPE_BREAK_PARENT }; +var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true }; +var line2 = { type: DOC_TYPE_LINE }; +var hardline = [hardlineWithoutBreakParent, breakParent]; +var cursor = { type: DOC_TYPE_CURSOR }; +function addAlignmentToDoc(doc2, size, tabWidth) { + assertDoc(doc2); + let aligned = doc2; + if (size > 0) { + for (let i = 0; i < Math.floor(size / tabWidth); ++i) { + aligned = indent(aligned); + } + aligned = align(size % tabWidth, aligned); + aligned = align(Number.NEGATIVE_INFINITY, aligned); + } + return aligned; +} + +// src/document/debug.js +function flattenDoc(doc2) { + var _a; + if (!doc2) { + return ""; + } + if (Array.isArray(doc2)) { + const res = []; + for (const part of doc2) { + if (Array.isArray(part)) { + res.push(...flattenDoc(part)); + } else { + const flattened = flattenDoc(part); + if (flattened !== "") { + res.push(flattened); + } + } + } + return res; + } + if (doc2.type === DOC_TYPE_IF_BREAK) { + return { + ...doc2, + breakContents: flattenDoc(doc2.breakContents), + flatContents: flattenDoc(doc2.flatContents) + }; + } + if (doc2.type === DOC_TYPE_GROUP) { + return { + ...doc2, + contents: flattenDoc(doc2.contents), + expandedStates: (_a = doc2.expandedStates) == null ? void 0 : _a.map(flattenDoc) + }; + } + if (doc2.type === DOC_TYPE_FILL) { + return { type: "fill", parts: doc2.parts.map(flattenDoc) }; + } + if (doc2.contents) { + return { ...doc2, contents: flattenDoc(doc2.contents) }; + } + return doc2; +} +function printDocToDebug(doc2) { + const printedSymbols = /* @__PURE__ */ Object.create(null); + const usedKeysForSymbols = /* @__PURE__ */ new Set(); + return printDoc(flattenDoc(doc2)); + function printDoc(doc3, index, parentParts) { + var _a, _b; + if (typeof doc3 === "string") { + return JSON.stringify(doc3); + } + if (Array.isArray(doc3)) { + const printed = doc3.map(printDoc).filter(Boolean); + return printed.length === 1 ? printed[0] : `[${printed.join(", ")}]`; + } + if (doc3.type === DOC_TYPE_LINE) { + const withBreakParent = ((_a = parentParts == null ? void 0 : parentParts[index + 1]) == null ? void 0 : _a.type) === DOC_TYPE_BREAK_PARENT; + if (doc3.literal) { + return withBreakParent ? "literalline" : "literallineWithoutBreakParent"; + } + if (doc3.hard) { + return withBreakParent ? "hardline" : "hardlineWithoutBreakParent"; + } + if (doc3.soft) { + return "softline"; + } + return "line"; + } + if (doc3.type === DOC_TYPE_BREAK_PARENT) { + const afterHardline = ((_b = parentParts == null ? void 0 : parentParts[index - 1]) == null ? void 0 : _b.type) === DOC_TYPE_LINE && parentParts[index - 1].hard; + return afterHardline ? void 0 : "breakParent"; + } + if (doc3.type === DOC_TYPE_TRIM) { + return "trim"; + } + if (doc3.type === DOC_TYPE_INDENT) { + return "indent(" + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_ALIGN) { + return doc3.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc3.contents) + ")" : doc3.n < 0 ? "dedent(" + printDoc(doc3.contents) + ")" : doc3.n.type === "root" ? "markAsRoot(" + printDoc(doc3.contents) + ")" : "align(" + JSON.stringify(doc3.n) + ", " + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_IF_BREAK) { + return "ifBreak(" + printDoc(doc3.breakContents) + (doc3.flatContents ? ", " + printDoc(doc3.flatContents) : "") + (doc3.groupId ? (!doc3.flatContents ? ', ""' : "") + `, { groupId: ${printGroupId(doc3.groupId)} }` : "") + ")"; + } + if (doc3.type === DOC_TYPE_INDENT_IF_BREAK) { + const optionsParts = []; + if (doc3.negate) { + optionsParts.push("negate: true"); + } + if (doc3.groupId) { + optionsParts.push(`groupId: ${printGroupId(doc3.groupId)}`); + } + const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : ""; + return `indentIfBreak(${printDoc(doc3.contents)}${options8})`; + } + if (doc3.type === DOC_TYPE_GROUP) { + const optionsParts = []; + if (doc3.break && doc3.break !== "propagated") { + optionsParts.push("shouldBreak: true"); + } + if (doc3.id) { + optionsParts.push(`id: ${printGroupId(doc3.id)}`); + } + const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : ""; + if (doc3.expandedStates) { + return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${options8})`; + } + return `group(${printDoc(doc3.contents)}${options8})`; + } + if (doc3.type === DOC_TYPE_FILL) { + return `fill([${doc3.parts.map((part) => printDoc(part)).join(", ")}])`; + } + if (doc3.type === DOC_TYPE_LINE_SUFFIX) { + return "lineSuffix(" + printDoc(doc3.contents) + ")"; + } + if (doc3.type === DOC_TYPE_LINE_SUFFIX_BOUNDARY) { + return "lineSuffixBoundary"; + } + if (doc3.type === DOC_TYPE_LABEL) { + return `label(${JSON.stringify(doc3.label)}, ${printDoc(doc3.contents)})`; + } + if (doc3.type === DOC_TYPE_CURSOR) { + return "cursor"; + } + throw new Error("Unknown doc type " + doc3.type); + } + function printGroupId(id) { + if (typeof id !== "symbol") { + return JSON.stringify(String(id)); + } + if (id in printedSymbols) { + return printedSymbols[id]; + } + const prefix = id.description || "symbol"; + for (let counter = 0; ; counter++) { + const key2 = prefix + (counter > 0 ? ` #${counter}` : ""); + if (!usedKeysForSymbols.has(key2)) { + usedKeysForSymbols.add(key2); + return printedSymbols[id] = `Symbol.for(${JSON.stringify(key2)})`; + } + } + } +} + +// node_modules/emoji-regex/index.mjs +var emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; +}; + +// node_modules/get-east-asian-width/lookup.js +function isFullWidth(x) { + return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510; +} +function isWide(x) { + return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141; +} + +// node_modules/get-east-asian-width/index.js +var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint)); + +// src/utils/get-string-width.js +var notAsciiRegex = /[^\x20-\x7F]/u; +function getStringWidth(text) { + if (!text) { + return 0; + } + if (!notAsciiRegex.test(text)) { + return text.length; + } + text = text.replace(emoji_regex_default(), " "); + let width = 0; + for (const character of text) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 768 && codePoint <= 879) { + continue; + } + width += _isNarrowWidth(codePoint) ? 1 : 2; + } + return width; +} +var get_string_width_default = getStringWidth; + +// src/document/printer.js +var MODE_BREAK = Symbol("MODE_BREAK"); +var MODE_FLAT = Symbol("MODE_FLAT"); +var CURSOR_PLACEHOLDER = Symbol("cursor"); +var DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH"); +function rootIndent() { + return { value: "", length: 0, queue: [] }; +} +function makeIndent(ind, options8) { + return generateInd(ind, { type: "indent" }, options8); +} +function makeAlign(indent2, widthOrDoc, options8) { + if (widthOrDoc === Number.NEGATIVE_INFINITY) { + return indent2.root || rootIndent(); + } + if (widthOrDoc < 0) { + return generateInd(indent2, { type: "dedent" }, options8); + } + if (!widthOrDoc) { + return indent2; + } + if (widthOrDoc.type === "root") { + return { ...indent2, root: indent2 }; + } + const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign"; + return generateInd(indent2, { type: alignType, n: widthOrDoc }, options8); +} +function generateInd(ind, newPart, options8) { + const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart]; + let value = ""; + let length = 0; + let lastTabs = 0; + let lastSpaces = 0; + for (const part of queue) { + switch (part.type) { + case "indent": + flush(); + if (options8.useTabs) { + addTabs(1); + } else { + addSpaces(options8.tabWidth); + } + break; + case "stringAlign": + flush(); + value += part.n; + length += part.n.length; + break; + case "numberAlign": + lastTabs += 1; + lastSpaces += part.n; + break; + default: + throw new Error(`Unexpected type '${part.type}'`); + } + } + flushSpaces(); + return { ...ind, value, length, queue }; + function addTabs(count) { + value += " ".repeat(count); + length += options8.tabWidth * count; + } + function addSpaces(count) { + value += " ".repeat(count); + length += count; + } + function flush() { + if (options8.useTabs) { + flushTabs(); + } else { + flushSpaces(); + } + } + function flushTabs() { + if (lastTabs > 0) { + addTabs(lastTabs); + } + resetLast(); + } + function flushSpaces() { + if (lastSpaces > 0) { + addSpaces(lastSpaces); + } + resetLast(); + } + function resetLast() { + lastTabs = 0; + lastSpaces = 0; + } +} +function trim(out) { + let trimCount = 0; + let cursorCount = 0; + let outIndex = out.length; + outer: while (outIndex--) { + const last = out[outIndex]; + if (last === CURSOR_PLACEHOLDER) { + cursorCount++; + continue; + } + if (false) { + throw new Error(`Unexpected value in trim: '${typeof last}'`); + } + for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) { + const char = last[charIndex]; + if (char === " " || char === " ") { + trimCount++; + } else { + out[outIndex] = last.slice(0, charIndex + 1); + break outer; + } + } + } + if (trimCount > 0 || cursorCount > 0) { + out.length = outIndex + 1; + while (cursorCount-- > 0) { + out.push(CURSOR_PLACEHOLDER); + } + } + return trimCount; +} +function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) { + if (width === Number.POSITIVE_INFINITY) { + return true; + } + let restIdx = restCommands.length; + const cmds = [next]; + const out = []; + while (width >= 0) { + if (cmds.length === 0) { + if (restIdx === 0) { + return true; + } + cmds.push(restCommands[--restIdx]); + continue; + } + const { mode, doc: doc2 } = cmds.pop(); + const docType = get_doc_type_default(doc2); + switch (docType) { + case DOC_TYPE_STRING: + out.push(doc2); + width -= get_string_width_default(doc2); + break; + case DOC_TYPE_ARRAY: + case DOC_TYPE_FILL: { + const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts; + const end = doc2[DOC_FILL_PRINTED_LENGTH] ?? 0; + for (let i = parts.length - 1; i >= end; i--) { + cmds.push({ mode, doc: parts[i] }); + } + break; + } + case DOC_TYPE_INDENT: + case DOC_TYPE_ALIGN: + case DOC_TYPE_INDENT_IF_BREAK: + case DOC_TYPE_LABEL: + cmds.push({ mode, doc: doc2.contents }); + break; + case DOC_TYPE_TRIM: + width += trim(out); + break; + case DOC_TYPE_GROUP: { + if (mustBeFlat && doc2.break) { + return false; + } + const groupMode = doc2.break ? MODE_BREAK : mode; + const contents = doc2.expandedStates && groupMode === MODE_BREAK ? at_default( + /* isOptionalObject */ + false, + doc2.expandedStates, + -1 + ) : doc2.contents; + cmds.push({ mode: groupMode, doc: contents }); + break; + } + case DOC_TYPE_IF_BREAK: { + const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] || MODE_FLAT : mode; + const contents = groupMode === MODE_BREAK ? doc2.breakContents : doc2.flatContents; + if (contents) { + cmds.push({ mode, doc: contents }); + } + break; + } + case DOC_TYPE_LINE: + if (mode === MODE_BREAK || doc2.hard) { + return true; + } + if (!doc2.soft) { + out.push(" "); + width--; + } + break; + case DOC_TYPE_LINE_SUFFIX: + hasLineSuffix = true; + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (hasLineSuffix) { + return false; + } + break; + } + } + return false; +} +function printDocToString(doc2, options8) { + const groupModeMap = {}; + const width = options8.printWidth; + const newLine = convertEndOfLineToChars(options8.endOfLine); + let pos2 = 0; + const cmds = [{ ind: rootIndent(), mode: MODE_BREAK, doc: doc2 }]; + const out = []; + let shouldRemeasure = false; + const lineSuffix2 = []; + let printedCursorCount = 0; + propagateBreaks(doc2); + while (cmds.length > 0) { + const { ind, mode, doc: doc3 } = cmds.pop(); + switch (get_doc_type_default(doc3)) { + case DOC_TYPE_STRING: { + const formatted = newLine !== "\n" ? string_replace_all_default( + /* isOptionalObject */ + false, + doc3, + "\n", + newLine + ) : doc3; + out.push(formatted); + if (cmds.length > 0) { + pos2 += get_string_width_default(formatted); + } + break; + } + case DOC_TYPE_ARRAY: + for (let i = doc3.length - 1; i >= 0; i--) { + cmds.push({ ind, mode, doc: doc3[i] }); + } + break; + case DOC_TYPE_CURSOR: + if (printedCursorCount >= 2) { + throw new Error("There are too many 'cursor' in doc."); + } + out.push(CURSOR_PLACEHOLDER); + printedCursorCount++; + break; + case DOC_TYPE_INDENT: + cmds.push({ ind: makeIndent(ind, options8), mode, doc: doc3.contents }); + break; + case DOC_TYPE_ALIGN: + cmds.push({ + ind: makeAlign(ind, doc3.n, options8), + mode, + doc: doc3.contents + }); + break; + case DOC_TYPE_TRIM: + pos2 -= trim(out); + break; + case DOC_TYPE_GROUP: + switch (mode) { + case MODE_FLAT: + if (!shouldRemeasure) { + cmds.push({ + ind, + mode: doc3.break ? MODE_BREAK : MODE_FLAT, + doc: doc3.contents + }); + break; + } + // fallthrough + case MODE_BREAK: { + shouldRemeasure = false; + const next = { ind, mode: MODE_FLAT, doc: doc3.contents }; + const rem = width - pos2; + const hasLineSuffix = lineSuffix2.length > 0; + if (!doc3.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(next); + } else { + if (doc3.expandedStates) { + const mostExpanded = at_default( + /* isOptionalObject */ + false, + doc3.expandedStates, + -1 + ); + if (doc3.break) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + for (let i = 1; i < doc3.expandedStates.length + 1; i++) { + if (i >= doc3.expandedStates.length) { + cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded }); + break; + } else { + const state = doc3.expandedStates[i]; + const cmd = { ind, mode: MODE_FLAT, doc: state }; + if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) { + cmds.push(cmd); + break; + } + } + } + } + } else { + cmds.push({ ind, mode: MODE_BREAK, doc: doc3.contents }); + } + } + break; + } + } + if (doc3.id) { + groupModeMap[doc3.id] = at_default( + /* isOptionalObject */ + false, + cmds, + -1 + ).mode; + } + break; + // Fills each line with as much code as possible before moving to a new + // line with the same indentation. + // + // Expects doc.parts to be an array of alternating content and + // whitespace. The whitespace contains the linebreaks. + // + // For example: + // ["I", line, "love", line, "monkeys"] + // or + // [{ type: group, ... }, softline, { type: group, ... }] + // + // It uses this parts structure to handle three main layout cases: + // * The first two content items fit on the same line without + // breaking + // -> output the first content item and the whitespace "flat". + // * Only the first content item fits on the line without breaking + // -> output the first content item "flat" and the whitespace with + // "break". + // * Neither content item fits on the line without breaking + // -> output the first content item and the whitespace with "break". + case DOC_TYPE_FILL: { + const rem = width - pos2; + const offset = doc3[DOC_FILL_PRINTED_LENGTH] ?? 0; + const { parts } = doc3; + const length = parts.length - offset; + if (length === 0) { + break; + } + const content = parts[offset + 0]; + const whitespace = parts[offset + 1]; + const contentFlatCmd = { ind, mode: MODE_FLAT, doc: content }; + const contentBreakCmd = { ind, mode: MODE_BREAK, doc: content }; + const contentFits = fits( + contentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (length === 1) { + if (contentFits) { + cmds.push(contentFlatCmd); + } else { + cmds.push(contentBreakCmd); + } + break; + } + const whitespaceFlatCmd = { ind, mode: MODE_FLAT, doc: whitespace }; + const whitespaceBreakCmd = { ind, mode: MODE_BREAK, doc: whitespace }; + if (length === 2) { + if (contentFits) { + cmds.push(whitespaceFlatCmd, contentFlatCmd); + } else { + cmds.push(whitespaceBreakCmd, contentBreakCmd); + } + break; + } + const secondContent = parts[offset + 2]; + const remainingCmd = { + ind, + mode, + doc: { ...doc3, [DOC_FILL_PRINTED_LENGTH]: offset + 2 } + }; + const firstAndSecondContentFlatCmd = { + ind, + mode: MODE_FLAT, + doc: [content, whitespace, secondContent] + }; + const firstAndSecondContentFits = fits( + firstAndSecondContentFlatCmd, + [], + rem, + lineSuffix2.length > 0, + groupModeMap, + true + ); + if (firstAndSecondContentFits) { + cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd); + } else if (contentFits) { + cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd); + } else { + cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd); + } + break; + } + case DOC_TYPE_IF_BREAK: + case DOC_TYPE_INDENT_IF_BREAK: { + const groupMode = doc3.groupId ? groupModeMap[doc3.groupId] : mode; + if (groupMode === MODE_BREAK) { + const breakContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.breakContents : doc3.negate ? doc3.contents : indent(doc3.contents); + if (breakContents) { + cmds.push({ ind, mode, doc: breakContents }); + } + } + if (groupMode === MODE_FLAT) { + const flatContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.flatContents : doc3.negate ? indent(doc3.contents) : doc3.contents; + if (flatContents) { + cmds.push({ ind, mode, doc: flatContents }); + } + } + break; + } + case DOC_TYPE_LINE_SUFFIX: + lineSuffix2.push({ ind, mode, doc: doc3.contents }); + break; + case DOC_TYPE_LINE_SUFFIX_BOUNDARY: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: hardlineWithoutBreakParent }); + } + break; + case DOC_TYPE_LINE: + switch (mode) { + case MODE_FLAT: + if (!doc3.hard) { + if (!doc3.soft) { + out.push(" "); + pos2 += 1; + } + break; + } else { + shouldRemeasure = true; + } + // fallthrough + case MODE_BREAK: + if (lineSuffix2.length > 0) { + cmds.push({ ind, mode, doc: doc3 }, ...lineSuffix2.reverse()); + lineSuffix2.length = 0; + break; + } + if (doc3.literal) { + if (ind.root) { + out.push(newLine, ind.root.value); + pos2 = ind.root.length; + } else { + out.push(newLine); + pos2 = 0; + } + } else { + pos2 -= trim(out); + out.push(newLine + ind.value); + pos2 = ind.length; + } + break; + } + break; + case DOC_TYPE_LABEL: + cmds.push({ ind, mode, doc: doc3.contents }); + break; + case DOC_TYPE_BREAK_PARENT: + break; + default: + throw new invalid_doc_error_default(doc3); + } + if (cmds.length === 0 && lineSuffix2.length > 0) { + cmds.push(...lineSuffix2.reverse()); + lineSuffix2.length = 0; + } + } + const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER); + if (cursorPlaceholderIndex !== -1) { + const otherCursorPlaceholderIndex = out.indexOf( + CURSOR_PLACEHOLDER, + cursorPlaceholderIndex + 1 + ); + if (otherCursorPlaceholderIndex === -1) { + return { + formatted: out.filter((char) => char !== CURSOR_PLACEHOLDER).join("") + }; + } + const beforeCursor = out.slice(0, cursorPlaceholderIndex).join(""); + const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join(""); + const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join(""); + return { + formatted: beforeCursor + aroundCursor + afterCursor, + cursorNodeStart: beforeCursor.length, + cursorNodeText: aroundCursor + }; + } + return { formatted: out.join("") }; +} + +// src/utils/get-alignment-size.js +function getAlignmentSize(text, tabWidth, startIndex = 0) { + let size = 0; + for (let i = startIndex; i < text.length; ++i) { + if (text[i] === " ") { + size = size + tabWidth - size % tabWidth; + } else { + size++; + } + } + return size; +} +var get_alignment_size_default = getAlignmentSize; + +// src/common/ast-path.js +var _AstPath_instances, getNodeStackIndex_fn, getAncestors_fn; +var AstPath = class { + constructor(value) { + __privateAdd(this, _AstPath_instances); + this.stack = [value]; + } + /** @type {string | null} */ + get key() { + const { stack: stack2, siblings } = this; + return at_default( + /* isOptionalObject */ + false, + stack2, + siblings === null ? -2 : -4 + ) ?? null; + } + /** @type {number | null} */ + get index() { + return this.siblings === null ? null : at_default( + /* isOptionalObject */ + false, + this.stack, + -2 + ); + } + /** @type {object} */ + get node() { + return at_default( + /* isOptionalObject */ + false, + this.stack, + -1 + ); + } + /** @type {object | null} */ + get parent() { + return this.getNode(1); + } + /** @type {object | null} */ + get grandparent() { + return this.getNode(2); + } + /** @type {boolean} */ + get isInArray() { + return this.siblings !== null; + } + /** @type {object[] | null} */ + get siblings() { + const { stack: stack2 } = this; + const maybeArray = at_default( + /* isOptionalObject */ + false, + stack2, + -3 + ); + return Array.isArray(maybeArray) ? maybeArray : null; + } + /** @type {object | null} */ + get next() { + const { siblings } = this; + return siblings === null ? null : siblings[this.index + 1]; + } + /** @type {object | null} */ + get previous() { + const { siblings } = this; + return siblings === null ? null : siblings[this.index - 1]; + } + /** @type {boolean} */ + get isFirst() { + return this.index === 0; + } + /** @type {boolean} */ + get isLast() { + const { siblings, index } = this; + return siblings !== null && index === siblings.length - 1; + } + /** @type {boolean} */ + get isRoot() { + return this.stack.length === 1; + } + /** @type {object} */ + get root() { + return this.stack[0]; + } + /** @type {object[]} */ + get ancestors() { + return [...__privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)]; + } + // The name of the current property is always the penultimate element of + // this.stack, and always a string/number/symbol. + getName() { + const { stack: stack2 } = this; + const { length } = stack2; + if (length > 1) { + return at_default( + /* isOptionalObject */ + false, + stack2, + -2 + ); + } + return null; + } + // The value of the current property is always the final element of + // this.stack. + getValue() { + return at_default( + /* isOptionalObject */ + false, + this.stack, + -1 + ); + } + getNode(count = 0) { + const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count); + return stackIndex === -1 ? null : this.stack[stackIndex]; + } + getParentNode(count = 0) { + return this.getNode(count + 1); + } + // Temporarily push properties named by string arguments given after the + // callback function onto this.stack, then call the callback with a + // reference to this (modified) AstPath object. Note that the stack will + // be restored to its original state after the callback is finished, so it + // is probably a mistake to retain a reference to the path. + call(callback, ...names) { + const { stack: stack2 } = this; + const { length } = stack2; + let value = at_default( + /* isOptionalObject */ + false, + stack2, + -1 + ); + for (const name of names) { + value = value[name]; + stack2.push(name, value); + } + try { + return callback(this); + } finally { + stack2.length = length; + } + } + /** + * @template {(path: AstPath) => any} T + * @param {T} callback + * @param {number} [count=0] + * @returns {ReturnType} + */ + callParent(callback, count = 0) { + const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count + 1); + const parentValues = this.stack.splice(stackIndex + 1); + try { + return callback(this); + } finally { + this.stack.push(...parentValues); + } + } + // Similar to AstPath.prototype.call, except that the value obtained by + // accessing this.getValue()[name1][name2]... should be array. The + // callback will be called with a reference to this path object for each + // element of the array. + each(callback, ...names) { + const { stack: stack2 } = this; + const { length } = stack2; + let value = at_default( + /* isOptionalObject */ + false, + stack2, + -1 + ); + for (const name of names) { + value = value[name]; + stack2.push(name, value); + } + try { + for (let i = 0; i < value.length; ++i) { + stack2.push(i, value[i]); + callback(this, i, value); + stack2.length -= 2; + } + } finally { + stack2.length = length; + } + } + // Similar to AstPath.prototype.each, except that the results of the + // callback function invocations are stored in an array and returned at + // the end of the iteration. + map(callback, ...names) { + const result = []; + this.each( + (path14, index, value) => { + result[index] = callback(path14, index, value); + }, + ...names + ); + return result; + } + /** + * @param {...( + * | ((node: any, name: string | null, number: number | null) => boolean) + * | undefined + * )} predicates + */ + match(...predicates) { + let stackPointer = this.stack.length - 1; + let name = null; + let node = this.stack[stackPointer--]; + for (const predicate of predicates) { + if (node === void 0) { + return false; + } + let number = null; + if (typeof name === "number") { + number = name; + name = this.stack[stackPointer--]; + node = this.stack[stackPointer--]; + } + if (predicate && !predicate(node, name, number)) { + return false; + } + name = this.stack[stackPointer--]; + node = this.stack[stackPointer--]; + } + return true; + } + /** + * Traverses the ancestors of the current node heading toward the tree root + * until it finds a node that matches the provided predicate function. Will + * return the first matching ancestor. If no such node exists, returns undefined. + * @param {(node: any) => boolean} predicate + * @internal Unstable API. Don't use in plugins for now. + */ + findAncestor(predicate) { + for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) { + if (predicate(node)) { + return node; + } + } + } + /** + * Traverses the ancestors of the current node heading toward the tree root + * until it finds a node that matches the provided predicate function. + * returns true if matched node found. + * @param {(node: any) => boolean} predicate + * @returns {boolean} + * @internal Unstable API. Don't use in plugins for now. + */ + hasAncestor(predicate) { + for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) { + if (predicate(node)) { + return true; + } + } + return false; + } +}; +_AstPath_instances = new WeakSet(); +getNodeStackIndex_fn = function(count) { + const { stack: stack2 } = this; + for (let i = stack2.length - 1; i >= 0; i -= 2) { + if (!Array.isArray(stack2[i]) && --count < 0) { + return i; + } + } + return -1; +}; +getAncestors_fn = function* () { + const { stack: stack2 } = this; + for (let index = stack2.length - 3; index >= 0; index -= 2) { + const value = stack2[index]; + if (!Array.isArray(value)) { + yield value; + } + } +}; +var ast_path_default = AstPath; + +// src/main/comments/attach.js +import assert4 from "assert"; + +// src/utils/is-object.js +function isObject(object) { + return object !== null && typeof object === "object"; +} +var is_object_default = isObject; + +// src/utils/ast-utils.js +function* getChildren(node, options8) { + const { getVisitorKeys, filter: filter2 = () => true } = options8; + const isMatchedNode = (node2) => is_object_default(node2) && filter2(node2); + for (const key2 of getVisitorKeys(node)) { + const value = node[key2]; + if (Array.isArray(value)) { + for (const child of value) { + if (isMatchedNode(child)) { + yield child; + } + } + } else if (isMatchedNode(value)) { + yield value; + } + } +} +function* getDescendants(node, options8) { + const queue = [node]; + for (let index = 0; index < queue.length; index++) { + const node2 = queue[index]; + for (const child of getChildren(node2, options8)) { + yield child; + queue.push(child); + } + } +} +function isLeaf(node, options8) { + return getChildren(node, options8).next().done; +} + +// src/utils/skip.js +function skip(characters) { + return (text, startIndex, options8) => { + const backwards = Boolean(options8 == null ? void 0 : options8.backwards); + if (startIndex === false) { + return false; + } + const { length } = text; + let cursor2 = startIndex; + while (cursor2 >= 0 && cursor2 < length) { + const character = text.charAt(cursor2); + if (characters instanceof RegExp) { + if (!characters.test(character)) { + return cursor2; + } + } else if (!characters.includes(character)) { + return cursor2; + } + backwards ? cursor2-- : cursor2++; + } + if (cursor2 === -1 || cursor2 === length) { + return cursor2; + } + return false; + }; +} +var skipWhitespace = skip(/\s/u); +var skipSpaces = skip(" "); +var skipToLineEnd = skip(",; "); +var skipEverythingButNewLine = skip(/[^\n\r]/u); + +// src/utils/skip-newline.js +function skipNewline(text, startIndex, options8) { + const backwards = Boolean(options8 == null ? void 0 : options8.backwards); + if (startIndex === false) { + return false; + } + const character = text.charAt(startIndex); + if (backwards) { + if (text.charAt(startIndex - 1) === "\r" && character === "\n") { + return startIndex - 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex - 1; + } + } else { + if (character === "\r" && text.charAt(startIndex + 1) === "\n") { + return startIndex + 2; + } + if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") { + return startIndex + 1; + } + } + return startIndex; +} +var skip_newline_default = skipNewline; + +// src/utils/has-newline.js +function hasNewline(text, startIndex, options8 = {}) { + const idx = skipSpaces( + text, + options8.backwards ? startIndex - 1 : startIndex, + options8 + ); + const idx2 = skip_newline_default(text, idx, options8); + return idx !== idx2; +} +var has_newline_default = hasNewline; + +// src/utils/is-non-empty-array.js +function isNonEmptyArray(object) { + return Array.isArray(object) && object.length > 0; +} +var is_non_empty_array_default = isNonEmptyArray; + +// src/main/create-get-visitor-keys-function.js +var nonTraversableKeys = /* @__PURE__ */ new Set([ + "tokens", + "comments", + "parent", + "enclosingNode", + "precedingNode", + "followingNode" +]); +var defaultGetVisitorKeys = (node) => Object.keys(node).filter((key2) => !nonTraversableKeys.has(key2)); +function createGetVisitorKeysFunction(printerGetVisitorKeys) { + return printerGetVisitorKeys ? (node) => printerGetVisitorKeys(node, nonTraversableKeys) : defaultGetVisitorKeys; +} +var create_get_visitor_keys_function_default = createGetVisitorKeysFunction; + +// src/main/comments/utils.js +function describeNodeForDebugging(node) { + const nodeType = node.type || node.kind || "(unknown type)"; + let nodeName = String( + node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || "" + ); + if (nodeName.length > 20) { + nodeName = nodeName.slice(0, 19) + "\u2026"; + } + return nodeType + (nodeName ? " " + nodeName : ""); +} +function addCommentHelper(node, comment) { + const comments = node.comments ?? (node.comments = []); + comments.push(comment); + comment.printed = false; + comment.nodeDescription = describeNodeForDebugging(node); +} +function addLeadingComment(node, comment) { + comment.leading = true; + comment.trailing = false; + addCommentHelper(node, comment); +} +function addDanglingComment(node, comment, marker) { + comment.leading = false; + comment.trailing = false; + if (marker) { + comment.marker = marker; + } + addCommentHelper(node, comment); +} +function addTrailingComment(node, comment) { + comment.leading = false; + comment.trailing = true; + addCommentHelper(node, comment); +} + +// src/main/comments/attach.js +var childNodesCache = /* @__PURE__ */ new WeakMap(); +function getSortedChildNodes(node, options8) { + if (childNodesCache.has(node)) { + return childNodesCache.get(node); + } + const { + printer: { + getCommentChildNodes, + canAttachComment, + getVisitorKeys: printerGetVisitorKeys + }, + locStart, + locEnd + } = options8; + if (!canAttachComment) { + return []; + } + const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node, options8)) ?? [ + ...getChildren(node, { + getVisitorKeys: create_get_visitor_keys_function_default(printerGetVisitorKeys) + }) + ]).flatMap( + (node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2, options8) + ); + childNodes.sort( + (nodeA, nodeB) => locStart(nodeA) - locStart(nodeB) || locEnd(nodeA) - locEnd(nodeB) + ); + childNodesCache.set(node, childNodes); + return childNodes; +} +function decorateComment(node, comment, options8, enclosingNode) { + const { locStart, locEnd } = options8; + const commentStart = locStart(comment); + const commentEnd = locEnd(comment); + const childNodes = getSortedChildNodes(node, options8); + let precedingNode; + let followingNode; + let left = 0; + let right = childNodes.length; + while (left < right) { + const middle = left + right >> 1; + const child = childNodes[middle]; + const start = locStart(child); + const end = locEnd(child); + if (start <= commentStart && commentEnd <= end) { + return decorateComment(child, comment, options8, child); + } + if (end <= commentStart) { + precedingNode = child; + left = middle + 1; + continue; + } + if (commentEnd <= start) { + followingNode = child; + right = middle; + continue; + } + throw new Error("Comment location overlaps with node location"); + } + if ((enclosingNode == null ? void 0 : enclosingNode.type) === "TemplateLiteral") { + const { quasis } = enclosingNode; + const commentIndex = findExpressionIndexForComment( + quasis, + comment, + options8 + ); + if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options8) !== commentIndex) { + precedingNode = null; + } + if (followingNode && findExpressionIndexForComment(quasis, followingNode, options8) !== commentIndex) { + followingNode = null; + } + } + return { enclosingNode, precedingNode, followingNode }; +} +var returnFalse = () => false; +function attachComments(ast, options8) { + const { comments } = ast; + delete ast.comments; + if (!is_non_empty_array_default(comments) || !options8.printer.canAttachComment) { + return; + } + const tiesToBreak = []; + const { + printer: { + experimentalFeatures: { + // TODO: Make this as default behavior + avoidAstMutation = false + } = {}, + handleComments = {} + }, + originalText: text + } = options8; + const { + ownLine: handleOwnLineComment = returnFalse, + endOfLine: handleEndOfLineComment = returnFalse, + remaining: handleRemainingComment = returnFalse + } = handleComments; + const decoratedComments = comments.map((comment, index) => ({ + ...decorateComment(ast, comment, options8), + comment, + text, + options: options8, + ast, + isLastComment: comments.length - 1 === index + })); + for (const [index, context] of decoratedComments.entries()) { + const { + comment, + precedingNode, + enclosingNode, + followingNode, + text: text2, + options: options9, + ast: ast2, + isLastComment + } = context; + let args; + if (avoidAstMutation) { + args = [context]; + } else { + comment.enclosingNode = enclosingNode; + comment.precedingNode = precedingNode; + comment.followingNode = followingNode; + args = [comment, text2, options9, ast2, isLastComment]; + } + if (isOwnLineComment(text2, options9, decoratedComments, index)) { + comment.placement = "ownLine"; + if (handleOwnLineComment(...args)) { + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } else if (isEndOfLineComment(text2, options9, decoratedComments, index)) { + comment.placement = "endOfLine"; + if (handleEndOfLineComment(...args)) { + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } else { + comment.placement = "remaining"; + if (handleRemainingComment(...args)) { + } else if (precedingNode && followingNode) { + const tieCount = tiesToBreak.length; + if (tieCount > 0) { + const lastTie = tiesToBreak[tieCount - 1]; + if (lastTie.followingNode !== followingNode) { + breakTies(tiesToBreak, options9); + } + } + tiesToBreak.push(context); + } else if (precedingNode) { + addTrailingComment(precedingNode, comment); + } else if (followingNode) { + addLeadingComment(followingNode, comment); + } else if (enclosingNode) { + addDanglingComment(enclosingNode, comment); + } else { + addDanglingComment(ast2, comment); + } + } + } + breakTies(tiesToBreak, options8); + if (!avoidAstMutation) { + for (const comment of comments) { + delete comment.precedingNode; + delete comment.enclosingNode; + delete comment.followingNode; + } + } +} +var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text); +function isOwnLineComment(text, options8, decoratedComments, commentIndex) { + const { comment, precedingNode } = decoratedComments[commentIndex]; + const { locStart, locEnd } = options8; + let start = locStart(comment); + if (precedingNode) { + for (let index = commentIndex - 1; index >= 0; index--) { + const { comment: comment2, precedingNode: currentCommentPrecedingNode } = decoratedComments[index]; + if (currentCommentPrecedingNode !== precedingNode || !isAllEmptyAndNoLineBreak(text.slice(locEnd(comment2), start))) { + break; + } + start = locStart(comment2); + } + } + return has_newline_default(text, start, { backwards: true }); +} +function isEndOfLineComment(text, options8, decoratedComments, commentIndex) { + const { comment, followingNode } = decoratedComments[commentIndex]; + const { locStart, locEnd } = options8; + let end = locEnd(comment); + if (followingNode) { + for (let index = commentIndex + 1; index < decoratedComments.length; index++) { + const { comment: comment2, followingNode: currentCommentFollowingNode } = decoratedComments[index]; + if (currentCommentFollowingNode !== followingNode || !isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment2)))) { + break; + } + end = locEnd(comment2); + } + } + return has_newline_default(text, end); +} +function breakTies(tiesToBreak, options8) { + var _a, _b; + const tieCount = tiesToBreak.length; + if (tieCount === 0) { + return; + } + const { precedingNode, followingNode } = tiesToBreak[0]; + let gapEndPos = options8.locStart(followingNode); + let indexOfFirstLeadingComment; + for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) { + const { + comment, + precedingNode: currentCommentPrecedingNode, + followingNode: currentCommentFollowingNode + } = tiesToBreak[indexOfFirstLeadingComment - 1]; + assert4.strictEqual(currentCommentPrecedingNode, precedingNode); + assert4.strictEqual(currentCommentFollowingNode, followingNode); + const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos); + if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/u.test(gap)) { + gapEndPos = options8.locStart(comment); + } else { + break; + } + } + for (const [i, { comment }] of tiesToBreak.entries()) { + if (i < indexOfFirstLeadingComment) { + addTrailingComment(precedingNode, comment); + } else { + addLeadingComment(followingNode, comment); + } + } + for (const node of [precedingNode, followingNode]) { + if (node.comments && node.comments.length > 1) { + node.comments.sort((a, b) => options8.locStart(a) - options8.locStart(b)); + } + } + tiesToBreak.length = 0; +} +function findExpressionIndexForComment(quasis, comment, options8) { + const startPos = options8.locStart(comment) - 1; + for (let i = 1; i < quasis.length; ++i) { + if (startPos < options8.locStart(quasis[i])) { + return i - 1; + } + } + return 0; +} + +// src/utils/is-previous-line-empty.js +function isPreviousLineEmpty(text, startIndex) { + let idx = startIndex - 1; + idx = skipSpaces(text, idx, { backwards: true }); + idx = skip_newline_default(text, idx, { backwards: true }); + idx = skipSpaces(text, idx, { backwards: true }); + const idx2 = skip_newline_default(text, idx, { backwards: true }); + return idx !== idx2; +} +var is_previous_line_empty_default = isPreviousLineEmpty; + +// src/main/comments/print.js +function printComment(path14, options8) { + const comment = path14.node; + comment.printed = true; + return options8.printer.printComment(path14, options8); +} +function printLeadingComment(path14, options8) { + var _a; + const comment = path14.node; + const parts = [printComment(path14, options8)]; + const { printer, originalText, locStart, locEnd } = options8; + const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment); + if (isBlock) { + const lineBreak = has_newline_default(originalText, locEnd(comment)) ? has_newline_default(originalText, locStart(comment), { + backwards: true + }) ? hardline : line2 : " "; + parts.push(lineBreak); + } else { + parts.push(hardline); + } + const index = skip_newline_default( + originalText, + skipSpaces(originalText, locEnd(comment)) + ); + if (index !== false && has_newline_default(originalText, index)) { + parts.push(hardline); + } + return parts; +} +function printTrailingComment(path14, options8, previousComment) { + var _a; + const comment = path14.node; + const printed = printComment(path14, options8); + const { printer, originalText, locStart } = options8; + const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment); + if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) { + const isLineBeforeEmpty = is_previous_line_empty_default( + originalText, + locStart(comment) + ); + return { + doc: lineSuffix([hardline, isLineBeforeEmpty ? hardline : "", printed]), + isBlock, + hasLineSuffix: true + }; + } + if (!isBlock || (previousComment == null ? void 0 : previousComment.hasLineSuffix)) { + return { + doc: [lineSuffix([" ", printed]), breakParent], + isBlock, + hasLineSuffix: true + }; + } + return { doc: [" ", printed], isBlock, hasLineSuffix: false }; +} +function printCommentsSeparately(path14, options8) { + const value = path14.node; + if (!value) { + return {}; + } + const ignored = options8[Symbol.for("printedComments")]; + const comments = (value.comments || []).filter( + (comment) => !ignored.has(comment) + ); + if (comments.length === 0) { + return { leading: "", trailing: "" }; + } + const leadingParts = []; + const trailingParts = []; + let printedTrailingComment; + path14.each(() => { + const comment = path14.node; + if (ignored == null ? void 0 : ignored.has(comment)) { + return; + } + const { leading, trailing } = comment; + if (leading) { + leadingParts.push(printLeadingComment(path14, options8)); + } else if (trailing) { + printedTrailingComment = printTrailingComment( + path14, + options8, + printedTrailingComment + ); + trailingParts.push(printedTrailingComment.doc); + } + }, "comments"); + return { leading: leadingParts, trailing: trailingParts }; +} +function printComments(path14, doc2, options8) { + const { leading, trailing } = printCommentsSeparately(path14, options8); + if (!leading && !trailing) { + return doc2; + } + return inheritLabel(doc2, (doc3) => [leading, doc3, trailing]); +} +function ensureAllCommentsPrinted(options8) { + const { + [Symbol.for("comments")]: comments, + [Symbol.for("printedComments")]: printedComments + } = options8; + for (const comment of comments) { + if (!comment.printed && !printedComments.has(comment)) { + throw new Error( + 'Comment "' + comment.value.trim() + '" was not printed. Please report this error!' + ); + } + delete comment.printed; + } +} + +// src/main/create-print-pre-check-function.js +function createPrintPreCheckFunction(options8) { + if (true) { + return () => { + }; + } + const getVisitorKeys = create_get_visitor_keys_function_default( + options8.printer.getVisitorKeys + ); + return function(path14) { + if (path14.isRoot) { + return; + } + const { key: key2, parent } = path14; + const visitorKeys = getVisitorKeys(parent); + if (visitorKeys.includes(key2)) { + return; + } + throw Object.assign(new Error("Calling `print()` on non-node object."), { + parentNode: parent, + allowedProperties: visitorKeys, + printingProperty: key2, + printingValue: path14.node, + pathStack: path14.stack.length > 5 ? ["...", ...path14.stack.slice(-5)] : [...path14.stack] + }); + }; +} +var create_print_pre_check_function_default = createPrintPreCheckFunction; + +// src/main/core-options.evaluate.js +var core_options_evaluate_default = { + "checkIgnorePragma": { + "category": "Special", + "type": "boolean", + "default": false, + "description": "Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.", + "cliCategory": "Other" + }, + "cursorOffset": { + "category": "Special", + "type": "int", + "default": -1, + "range": { + "start": -1, + "end": Infinity, + "step": 1 + }, + "description": "Print (to stderr) where a cursor at the given position would move to after formatting.", + "cliCategory": "Editor" + }, + "endOfLine": { + "category": "Global", + "type": "choice", + "default": "lf", + "description": "Which end of line characters to apply.", + "choices": [ + { + "value": "lf", + "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" + }, + { + "value": "crlf", + "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows" + }, + { + "value": "cr", + "description": "Carriage Return character only (\\r), used very rarely" + }, + { + "value": "auto", + "description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)" + } + ] + }, + "filepath": { + "category": "Special", + "type": "path", + "description": "Specify the input filepath. This will be used to do parser inference.", + "cliName": "stdin-filepath", + "cliCategory": "Other", + "cliDescription": "Path to the file to pretend that stdin comes from." + }, + "insertPragma": { + "category": "Special", + "type": "boolean", + "default": false, + "description": "Insert @format pragma into file's first docblock comment.", + "cliCategory": "Other" + }, + "parser": { + "category": "Global", + "type": "choice", + "default": void 0, + "description": "Which parser to use.", + "exception": (value) => typeof value === "string" || typeof value === "function", + "choices": [ + { + "value": "flow", + "description": "Flow" + }, + { + "value": "babel", + "description": "JavaScript" + }, + { + "value": "babel-flow", + "description": "Flow" + }, + { + "value": "babel-ts", + "description": "TypeScript" + }, + { + "value": "typescript", + "description": "TypeScript" + }, + { + "value": "acorn", + "description": "JavaScript" + }, + { + "value": "espree", + "description": "JavaScript" + }, + { + "value": "meriyah", + "description": "JavaScript" + }, + { + "value": "css", + "description": "CSS" + }, + { + "value": "less", + "description": "Less" + }, + { + "value": "scss", + "description": "SCSS" + }, + { + "value": "json", + "description": "JSON" + }, + { + "value": "json5", + "description": "JSON5" + }, + { + "value": "jsonc", + "description": "JSON with Comments" + }, + { + "value": "json-stringify", + "description": "JSON.stringify" + }, + { + "value": "graphql", + "description": "GraphQL" + }, + { + "value": "markdown", + "description": "Markdown" + }, + { + "value": "mdx", + "description": "MDX" + }, + { + "value": "vue", + "description": "Vue" + }, + { + "value": "yaml", + "description": "YAML" + }, + { + "value": "glimmer", + "description": "Ember / Handlebars" + }, + { + "value": "html", + "description": "HTML" + }, + { + "value": "angular", + "description": "Angular" + }, + { + "value": "lwc", + "description": "Lightning Web Components" + }, + { + "value": "mjml", + "description": "MJML" + } + ] + }, + "plugins": { + "type": "path", + "array": true, + "default": [ + { + "value": [] + } + ], + "category": "Global", + "description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.", + "exception": (value) => typeof value === "string" || typeof value === "object", + "cliName": "plugin", + "cliCategory": "Config" + }, + "printWidth": { + "category": "Global", + "type": "int", + "default": 80, + "description": "The line length where Prettier will try wrap.", + "range": { + "start": 0, + "end": Infinity, + "step": 1 + } + }, + "rangeEnd": { + "category": "Special", + "type": "int", + "default": Infinity, + "range": { + "start": 0, + "end": Infinity, + "step": 1 + }, + "description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.", + "cliCategory": "Editor" + }, + "rangeStart": { + "category": "Special", + "type": "int", + "default": 0, + "range": { + "start": 0, + "end": Infinity, + "step": 1 + }, + "description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.", + "cliCategory": "Editor" + }, + "requirePragma": { + "category": "Special", + "type": "boolean", + "default": false, + "description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.", + "cliCategory": "Other" + }, + "tabWidth": { + "type": "int", + "category": "Global", + "default": 2, + "description": "Number of spaces per indentation level.", + "range": { + "start": 0, + "end": Infinity, + "step": 1 + } + }, + "useTabs": { + "category": "Global", + "type": "boolean", + "default": false, + "description": "Indent with tabs instead of spaces." + }, + "embeddedLanguageFormatting": { + "category": "Global", + "type": "choice", + "default": "auto", + "description": "Control how Prettier formats quoted code embedded in the file.", + "choices": [ + { + "value": "auto", + "description": "Format embedded code if Prettier can automatically identify it." + }, + { + "value": "off", + "description": "Never automatically format embedded code." + } + ] + } +}; + +// src/main/support.js +function getSupportInfo({ plugins = [], showDeprecated = false } = {}) { + const languages2 = plugins.flatMap((plugin) => plugin.languages ?? []); + const options8 = []; + for (const option of normalizeOptionSettings( + Object.assign({}, ...plugins.map(({ options: options9 }) => options9), core_options_evaluate_default) + )) { + if (!showDeprecated && option.deprecated) { + continue; + } + if (Array.isArray(option.choices)) { + if (!showDeprecated) { + option.choices = option.choices.filter((choice) => !choice.deprecated); + } + if (option.name === "parser") { + option.choices = [ + ...option.choices, + ...collectParsersFromLanguages(option.choices, languages2, plugins) + ]; + } + } + option.pluginDefaults = Object.fromEntries( + plugins.filter((plugin) => { + var _a; + return ((_a = plugin.defaultOptions) == null ? void 0 : _a[option.name]) !== void 0; + }).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]]) + ); + options8.push(option); + } + return { languages: languages2, options: options8 }; +} +function* collectParsersFromLanguages(parserChoices, languages2, plugins) { + const existingParsers = new Set(parserChoices.map((choice) => choice.value)); + for (const language of languages2) { + if (language.parsers) { + for (const parserName of language.parsers) { + if (!existingParsers.has(parserName)) { + existingParsers.add(parserName); + const plugin = plugins.find( + (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName) + ); + let description = language.name; + if (plugin == null ? void 0 : plugin.name) { + description += ` (plugin: ${plugin.name})`; + } + yield { value: parserName, description }; + } + } + } + } +} +function normalizeOptionSettings(settings) { + const options8 = []; + for (const [name, originalOption] of Object.entries(settings)) { + const option = { name, ...originalOption }; + if (Array.isArray(option.default)) { + option.default = at_default( + /* isOptionalObject */ + false, + option.default, + -1 + ).value; + } + options8.push(option); + } + return options8; +} + +// scripts/build/shims/array-to-reversed.js +var arrayToReversed = (isOptionalObject, array2) => { + if (isOptionalObject && (array2 === void 0 || array2 === null)) { + return; + } + if (array2.toReversed || !Array.isArray(array2)) { + return array2.toReversed(); + } + return [...array2].reverse(); +}; +var array_to_reversed_default = arrayToReversed; + +// src/utils/get-interpreter.js +var import_n_readlines = __toESM(require_readlines(), 1); +function getInterpreter(file) { + try { + const liner = new import_n_readlines.default(file); + const firstLineBuffer = liner.next(); + if (firstLineBuffer === false) { + return; + } + liner.close(); + const firstLine = firstLineBuffer.toString("utf8"); + const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/u); + if (m1) { + return m1[1]; + } + const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/u); + if (m2) { + return m2[1]; + } + } catch { + } +} +var get_interpreter_default = getInterpreter; + +// src/utils/universal-to-path.js +import { fileURLToPath as fileURLToPath5 } from "url"; +var universal_to_path_default = false ? fromFileUrl3 : fileURLToPath5; + +// src/utils/infer-parser.js +var getFileBasename = (file) => String(file).split(/[/\\]/u).pop(); +function getLanguageByFileName(languages2, file) { + if (!file) { + return; + } + const basename = getFileBasename(file).toLowerCase(); + return languages2.find( + ({ filenames }) => filenames == null ? void 0 : filenames.some((name) => name.toLowerCase() === basename) + ) ?? languages2.find( + ({ extensions }) => extensions == null ? void 0 : extensions.some((extension) => basename.endsWith(extension)) + ); +} +function getLanguageByLanguageName(languages2, languageName) { + if (!languageName) { + return; + } + return languages2.find(({ name }) => name.toLowerCase() === languageName) ?? languages2.find(({ aliases }) => aliases == null ? void 0 : aliases.includes(languageName)) ?? languages2.find(({ extensions }) => extensions == null ? void 0 : extensions.includes(`.${languageName}`)); +} +function getLanguageByInterpreter(languages2, file) { + if (!file || getFileBasename(file).includes(".")) { + return; + } + const languagesWithInterpreters = languages2.filter( + ({ interpreters }) => is_non_empty_array_default(interpreters) + ); + if (languagesWithInterpreters.length === 0) { + return; + } + const interpreter = get_interpreter_default(file); + if (!interpreter) { + return; + } + return languagesWithInterpreters.find( + ({ interpreters }) => interpreters.includes(interpreter) + ); +} +function getLanguageByIsSupported(languages2, file) { + if (!file) { + return; + } + if (String(file).startsWith("file:")) { + try { + file = universal_to_path_default(file); + } catch { + return; + } + } + if (typeof file !== "string") { + return; + } + return languages2.find(({ isSupported }) => isSupported == null ? void 0 : isSupported({ filepath: file })); +} +function inferParser(options8, fileInfo) { + const languages2 = array_to_reversed_default( + /* isOptionalObject */ + false, + options8.plugins + ).flatMap( + (plugin) => ( + // @ts-expect-error -- Safe + plugin.languages ?? [] + ) + ); + const language = getLanguageByLanguageName(languages2, fileInfo.language) ?? getLanguageByFileName(languages2, fileInfo.physicalFile) ?? getLanguageByFileName(languages2, fileInfo.file) ?? getLanguageByIsSupported(languages2, fileInfo.physicalFile) ?? getLanguageByIsSupported(languages2, fileInfo.file) ?? getLanguageByInterpreter(languages2, fileInfo.physicalFile); + return language == null ? void 0 : language.parsers[0]; +} +var infer_parser_default = inferParser; + +// src/main/normalize-options.js +var hasDeprecationWarned; +function normalizeOptions(options8, optionInfos, { + logger = false, + isCLI = false, + passThrough = false, + FlagSchema, + descriptor +} = {}) { + if (isCLI) { + if (!FlagSchema) { + throw new Error("'FlagSchema' option is required."); + } + if (!descriptor) { + throw new Error("'descriptor' option is required."); + } + } else { + descriptor = apiDescriptor; + } + const unknown = !passThrough ? (key2, value, options9) => { + const { _, ...schemas2 } = options9.schemas; + return levenUnknownHandler(key2, value, { + ...options9, + schemas: schemas2 + }); + } : Array.isArray(passThrough) ? (key2, value) => !passThrough.includes(key2) ? void 0 : { [key2]: value } : (key2, value) => ({ [key2]: value }); + const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }); + const normalizer = new Normalizer(schemas, { + logger, + unknown, + descriptor + }); + const shouldSuppressDuplicateDeprecationWarnings = logger !== false; + if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) { + normalizer._hasDeprecationWarned = hasDeprecationWarned; + } + const normalized = normalizer.normalize(options8); + if (shouldSuppressDuplicateDeprecationWarnings) { + hasDeprecationWarned = normalizer._hasDeprecationWarned; + } + return normalized; +} +function optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }) { + const schemas = []; + if (isCLI) { + schemas.push(AnySchema.create({ name: "_" })); + } + for (const optionInfo of optionInfos) { + schemas.push( + optionInfoToSchema(optionInfo, { + isCLI, + optionInfos, + FlagSchema + }) + ); + if (optionInfo.alias && isCLI) { + schemas.push( + AliasSchema.create({ + // @ts-expect-error + name: optionInfo.alias, + sourceName: optionInfo.name + }) + ); + } + } + return schemas; +} +function optionInfoToSchema(optionInfo, { isCLI, optionInfos, FlagSchema }) { + const { name } = optionInfo; + const parameters = { name }; + let SchemaConstructor; + const handlers = {}; + switch (optionInfo.type) { + case "int": + SchemaConstructor = IntegerSchema; + if (isCLI) { + parameters.preprocess = Number; + } + break; + case "string": + SchemaConstructor = StringSchema; + break; + case "choice": + SchemaConstructor = ChoiceSchema; + parameters.choices = optionInfo.choices.map( + (choiceInfo) => (choiceInfo == null ? void 0 : choiceInfo.redirect) ? { + ...choiceInfo, + redirect: { + to: { key: optionInfo.name, value: choiceInfo.redirect } + } + } : choiceInfo + ); + break; + case "boolean": + SchemaConstructor = BooleanSchema; + break; + case "flag": + SchemaConstructor = FlagSchema; + parameters.flags = optionInfos.flatMap( + (optionInfo2) => [ + optionInfo2.alias, + optionInfo2.description && optionInfo2.name, + optionInfo2.oppositeDescription && `no-${optionInfo2.name}` + ].filter(Boolean) + ); + break; + case "path": + SchemaConstructor = StringSchema; + break; + default: + throw new Error(`Unexpected type ${optionInfo.type}`); + } + if (optionInfo.exception) { + parameters.validate = (value, schema, utils) => optionInfo.exception(value) || schema.validate(value, utils); + } else { + parameters.validate = (value, schema, utils) => value === void 0 || schema.validate(value, utils); + } + if (optionInfo.redirect) { + handlers.redirect = (value) => !value ? void 0 : { + to: typeof optionInfo.redirect === "string" ? optionInfo.redirect : { + key: optionInfo.redirect.option, + value: optionInfo.redirect.value + } + }; + } + if (optionInfo.deprecated) { + handlers.deprecated = true; + } + if (isCLI && !optionInfo.array) { + const originalPreprocess = parameters.preprocess || ((x) => x); + parameters.preprocess = (value, schema, utils) => schema.preprocess( + originalPreprocess(Array.isArray(value) ? at_default( + /* isOptionalObject */ + false, + value, + -1 + ) : value), + utils + ); + } + return optionInfo.array ? ArraySchema.create({ + ...isCLI ? { preprocess: (v) => Array.isArray(v) ? v : [v] } : {}, + ...handlers, + // @ts-expect-error + valueSchema: SchemaConstructor.create(parameters) + }) : SchemaConstructor.create({ ...parameters, ...handlers }); +} +var normalize_options_default = normalizeOptions; + +// scripts/build/shims/array-find-last.js +var arrayFindLast = (isOptionalObject, array2, callback) => { + if (isOptionalObject && (array2 === void 0 || array2 === null)) { + return; + } + if (array2.findLast) { + return array2.findLast(callback); + } + for (let index = array2.length - 1; index >= 0; index--) { + const element = array2[index]; + if (callback(element, index, array2)) { + return element; + } + } +}; +var array_find_last_default = arrayFindLast; + +// src/main/parser-and-printer.js +function getParserPluginByParserName(plugins, parserName) { + if (!parserName) { + throw new Error("parserName is required."); + } + const plugin = array_find_last_default( + /* isOptionalObject */ + false, + plugins, + (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName) + ); + if (plugin) { + return plugin; + } + let message = `Couldn't resolve parser "${parserName}".`; + if (false) { + message += " Plugins must be explicitly added to the standalone bundle."; + } + throw new ConfigError(message); +} +function getPrinterPluginByAstFormat(plugins, astFormat) { + if (!astFormat) { + throw new Error("astFormat is required."); + } + const plugin = array_find_last_default( + /* isOptionalObject */ + false, + plugins, + (plugin2) => plugin2.printers && Object.prototype.hasOwnProperty.call(plugin2.printers, astFormat) + ); + if (plugin) { + return plugin; + } + let message = `Couldn't find plugin for AST format "${astFormat}".`; + if (false) { + message += " Plugins must be explicitly added to the standalone bundle."; + } + throw new ConfigError(message); +} +function resolveParser({ plugins, parser }) { + const plugin = getParserPluginByParserName(plugins, parser); + return initParser(plugin, parser); +} +function initParser(plugin, parserName) { + const parserOrParserInitFunction = plugin.parsers[parserName]; + return typeof parserOrParserInitFunction === "function" ? parserOrParserInitFunction() : parserOrParserInitFunction; +} +function initPrinter(plugin, astFormat) { + const printerOrPrinterInitFunction = plugin.printers[astFormat]; + return typeof printerOrPrinterInitFunction === "function" ? printerOrPrinterInitFunction() : printerOrPrinterInitFunction; +} + +// src/main/normalize-format-options.js +var formatOptionsHiddenDefaults = { + astFormat: "estree", + printer: {}, + originalText: void 0, + locStart: null, + locEnd: null +}; +async function normalizeFormatOptions(options8, opts = {}) { + var _a; + const rawOptions = { ...options8 }; + if (!rawOptions.parser) { + if (!rawOptions.filepath) { + throw new UndefinedParserError( + "No parser and no file path given, couldn't infer a parser." + ); + } else { + rawOptions.parser = infer_parser_default(rawOptions, { + physicalFile: rawOptions.filepath + }); + if (!rawOptions.parser) { + throw new UndefinedParserError( + `No parser could be inferred for file "${rawOptions.filepath}".` + ); + } + } + } + const supportOptions = getSupportInfo({ + plugins: options8.plugins, + showDeprecated: true + }).options; + const defaults = { + ...formatOptionsHiddenDefaults, + ...Object.fromEntries( + supportOptions.filter((optionInfo) => optionInfo.default !== void 0).map((option) => [option.name, option.default]) + ) + }; + const parserPlugin = getParserPluginByParserName( + rawOptions.plugins, + rawOptions.parser + ); + const parser = await initParser(parserPlugin, rawOptions.parser); + rawOptions.astFormat = parser.astFormat; + rawOptions.locEnd = parser.locEnd; + rawOptions.locStart = parser.locStart; + const printerPlugin = ((_a = parserPlugin.printers) == null ? void 0 : _a[parser.astFormat]) ? parserPlugin : getPrinterPluginByAstFormat(rawOptions.plugins, parser.astFormat); + const printer = await initPrinter(printerPlugin, parser.astFormat); + rawOptions.printer = printer; + const pluginDefaults = printerPlugin.defaultOptions ? Object.fromEntries( + Object.entries(printerPlugin.defaultOptions).filter( + ([, value]) => value !== void 0 + ) + ) : {}; + const mixedDefaults = { ...defaults, ...pluginDefaults }; + for (const [k, value] of Object.entries(mixedDefaults)) { + if (rawOptions[k] === null || rawOptions[k] === void 0) { + rawOptions[k] = value; + } + } + if (rawOptions.parser === "json") { + rawOptions.trailingComma = "none"; + } + return normalize_options_default(rawOptions, supportOptions, { + passThrough: Object.keys(formatOptionsHiddenDefaults), + ...opts + }); +} +var normalize_format_options_default = normalizeFormatOptions; + +// src/main/parse.js +var import_code_frame2 = __toESM(require_lib2(), 1); +async function parse5(originalText, options8) { + const parser = await resolveParser(options8); + const text = parser.preprocess ? parser.preprocess(originalText, options8) : originalText; + options8.originalText = text; + let ast; + try { + ast = await parser.parse( + text, + options8, + // TODO: remove the third argument in v4 + // The duplicated argument is passed as intended, see #10156 + options8 + ); + } catch (error) { + handleParseError(error, originalText); + } + return { text, ast }; +} +function handleParseError(error, text) { + const { loc } = error; + if (loc) { + const codeFrame = (0, import_code_frame2.codeFrameColumns)(text, loc, { highlightCode: true }); + error.message += "\n" + codeFrame; + error.codeFrame = codeFrame; + throw error; + } + throw error; +} +var parse_default = parse5; + +// src/main/multiparser.js +async function printEmbeddedLanguages(path14, genericPrint, options8, printAstToDoc2, embeds) { + const { + embeddedLanguageFormatting, + printer: { + embed, + hasPrettierIgnore = () => false, + getVisitorKeys: printerGetVisitorKeys + } + } = options8; + if (!embed || embeddedLanguageFormatting !== "auto") { + return; + } + if (embed.length > 2) { + throw new Error( + "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed" + ); + } + const getVisitorKeys = create_get_visitor_keys_function_default( + embed.getVisitorKeys ?? printerGetVisitorKeys + ); + const embedCallResults = []; + recurse(); + const originalPathStack = path14.stack; + for (const { print, node, pathStack } of embedCallResults) { + try { + path14.stack = pathStack; + const doc2 = await print(textToDocForEmbed, genericPrint, path14, options8); + if (doc2) { + embeds.set(node, doc2); + } + } catch (error) { + if (process.env.PRETTIER_DEBUG) { + throw error; + } + } + } + path14.stack = originalPathStack; + function textToDocForEmbed(text, partialNextOptions) { + return textToDoc(text, partialNextOptions, options8, printAstToDoc2); + } + function recurse() { + const { node } = path14; + if (node === null || typeof node !== "object" || hasPrettierIgnore(path14)) { + return; + } + for (const key2 of getVisitorKeys(node)) { + if (Array.isArray(node[key2])) { + path14.each(recurse, key2); + } else { + path14.call(recurse, key2); + } + } + const result = embed(path14, options8); + if (!result) { + return; + } + if (typeof result === "function") { + embedCallResults.push({ + print: result, + node, + pathStack: [...path14.stack] + }); + return; + } + if (false) { + throw new Error( + "`embed` should return an async function instead of Promise." + ); + } + embeds.set(node, result); + } +} +async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2) { + const options8 = await normalize_format_options_default( + { + ...parentOptions, + ...partialNextOptions, + parentParser: parentOptions.parser, + originalText: text, + // Improve this if we calculate the relative index + cursorOffset: void 0, + rangeStart: void 0, + rangeEnd: void 0 + }, + { passThrough: true } + ); + const { ast } = await parse_default(text, options8); + const doc2 = await printAstToDoc2(ast, options8); + return stripTrailingHardline(doc2); +} + +// src/main/print-ignored.js +function printIgnored(path14, options8) { + const { + originalText, + [Symbol.for("comments")]: comments, + locStart, + locEnd, + [Symbol.for("printedComments")]: printedComments + } = options8; + const { node } = path14; + const start = locStart(node); + const end = locEnd(node); + for (const comment of comments) { + if (locStart(comment) >= start && locEnd(comment) <= end) { + printedComments.add(comment); + } + } + return originalText.slice(start, end); +} +var print_ignored_default = printIgnored; + +// src/main/ast-to-doc.js +async function printAstToDoc(ast, options8) { + ({ ast } = await prepareToPrint(ast, options8)); + const cache3 = /* @__PURE__ */ new Map(); + const path14 = new ast_path_default(ast); + const ensurePrintingNode = create_print_pre_check_function_default(options8); + const embeds = /* @__PURE__ */ new Map(); + await printEmbeddedLanguages(path14, mainPrint, options8, printAstToDoc, embeds); + const doc2 = await callPluginPrintFunction( + path14, + options8, + mainPrint, + void 0, + embeds + ); + ensureAllCommentsPrinted(options8); + if (options8.cursorOffset >= 0) { + if (options8.nodeAfterCursor && !options8.nodeBeforeCursor) { + return [cursor, doc2]; + } + if (options8.nodeBeforeCursor && !options8.nodeAfterCursor) { + return [doc2, cursor]; + } + } + return doc2; + function mainPrint(selector, args) { + if (selector === void 0 || selector === path14) { + return mainPrintInternal(args); + } + if (Array.isArray(selector)) { + return path14.call(() => mainPrintInternal(args), ...selector); + } + return path14.call(() => mainPrintInternal(args), selector); + } + function mainPrintInternal(args) { + ensurePrintingNode(path14); + const value = path14.node; + if (value === void 0 || value === null) { + return ""; + } + const shouldCache = value && typeof value === "object" && args === void 0; + if (shouldCache && cache3.has(value)) { + return cache3.get(value); + } + const doc3 = callPluginPrintFunction(path14, options8, mainPrint, args, embeds); + if (shouldCache) { + cache3.set(value, doc3); + } + return doc3; + } +} +function callPluginPrintFunction(path14, options8, printPath, args, embeds) { + var _a; + const { node } = path14; + const { printer } = options8; + let doc2; + if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path14)) { + doc2 = print_ignored_default(path14, options8); + } else if (embeds.has(node)) { + doc2 = embeds.get(node); + } else { + doc2 = printer.print(path14, options8, printPath, args); + } + switch (node) { + case options8.cursorNode: + doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]); + break; + case options8.nodeBeforeCursor: + doc2 = inheritLabel(doc2, (doc3) => [doc3, cursor]); + break; + case options8.nodeAfterCursor: + doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3]); + break; + } + if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path14, options8))) { + doc2 = printComments(path14, doc2, options8); + } + return doc2; +} +async function prepareToPrint(ast, options8) { + const comments = ast.comments ?? []; + options8[Symbol.for("comments")] = comments; + options8[Symbol.for("printedComments")] = /* @__PURE__ */ new Set(); + attachComments(ast, options8); + const { + printer: { preprocess } + } = options8; + ast = preprocess ? await preprocess(ast, options8) : ast; + return { ast, comments }; +} + +// src/main/get-cursor-node.js +function getCursorLocation(ast, options8) { + const { cursorOffset, locStart, locEnd } = options8; + const getVisitorKeys = create_get_visitor_keys_function_default( + options8.printer.getVisitorKeys + ); + const nodeContainsCursor = (node) => locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset; + let cursorNode = ast; + const nodesContainingCursor = [ast]; + for (const node of getDescendants(ast, { + getVisitorKeys, + filter: nodeContainsCursor + })) { + nodesContainingCursor.push(node); + cursorNode = node; + } + if (isLeaf(cursorNode, { getVisitorKeys })) { + return { cursorNode }; + } + let nodeBeforeCursor; + let nodeAfterCursor; + let nodeBeforeCursorEndIndex = -1; + let nodeAfterCursorStartIndex = Number.POSITIVE_INFINITY; + while (nodesContainingCursor.length > 0 && (nodeBeforeCursor === void 0 || nodeAfterCursor === void 0)) { + cursorNode = nodesContainingCursor.pop(); + const foundBeforeNode = nodeBeforeCursor !== void 0; + const foundAfterNode = nodeAfterCursor !== void 0; + for (const node of getChildren(cursorNode, { getVisitorKeys })) { + if (!foundBeforeNode) { + const nodeEnd = locEnd(node); + if (nodeEnd <= cursorOffset && nodeEnd > nodeBeforeCursorEndIndex) { + nodeBeforeCursor = node; + nodeBeforeCursorEndIndex = nodeEnd; + } + } + if (!foundAfterNode) { + const nodeStart = locStart(node); + if (nodeStart >= cursorOffset && nodeStart < nodeAfterCursorStartIndex) { + nodeAfterCursor = node; + nodeAfterCursorStartIndex = nodeStart; + } + } + } + } + return { + nodeBeforeCursor, + nodeAfterCursor + }; +} +var get_cursor_node_default = getCursorLocation; + +// src/main/massage-ast.js +function massageAst(ast, options8) { + const { + printer: { + massageAstNode: cleanFunction, + getVisitorKeys: printerGetVisitorKeys + } + } = options8; + if (!cleanFunction) { + return ast; + } + const getVisitorKeys = create_get_visitor_keys_function_default(printerGetVisitorKeys); + const ignoredProperties = cleanFunction.ignoredProperties ?? /* @__PURE__ */ new Set(); + return recurse(ast); + function recurse(original, parent) { + if (!(original !== null && typeof original === "object")) { + return original; + } + if (Array.isArray(original)) { + return original.map((child) => recurse(child, parent)).filter(Boolean); + } + const cloned = {}; + const childrenKeys = new Set(getVisitorKeys(original)); + for (const key2 in original) { + if (!Object.prototype.hasOwnProperty.call(original, key2) || ignoredProperties.has(key2)) { + continue; + } + if (childrenKeys.has(key2)) { + cloned[key2] = recurse(original[key2], original); + } else { + cloned[key2] = original[key2]; + } + } + const result = cleanFunction(original, cloned, parent); + if (result === null) { + return; + } + return result ?? cloned; + } +} +var massage_ast_default = massageAst; + +// scripts/build/shims/array-find-last-index.js +var arrayFindLastIndex = (isOptionalObject, array2, callback) => { + if (isOptionalObject && (array2 === void 0 || array2 === null)) { + return; + } + if (array2.findLastIndex) { + return array2.findLastIndex(callback); + } + for (let index = array2.length - 1; index >= 0; index--) { + const element = array2[index]; + if (callback(element, index, array2)) { + return index; + } + } + return -1; +}; +var array_find_last_index_default = arrayFindLastIndex; + +// src/main/range-util.js +import assert5 from "assert"; +var isJsonParser = ({ parser }) => parser === "json" || parser === "json5" || parser === "jsonc" || parser === "json-stringify"; +function findCommonAncestor(startNodeAndParents, endNodeAndParents) { + const startNodeAndAncestors = [ + startNodeAndParents.node, + ...startNodeAndParents.parentNodes + ]; + const endNodeAndAncestors = /* @__PURE__ */ new Set([ + endNodeAndParents.node, + ...endNodeAndParents.parentNodes + ]); + return startNodeAndAncestors.find( + (node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node) + ); +} +function dropRootParents(parents) { + const index = array_find_last_index_default( + /* isOptionalObject */ + false, + parents, + (node) => node.type !== "Program" && node.type !== "File" + ); + if (index === -1) { + return parents; + } + return parents.slice(0, index + 1); +} +function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart, locEnd }) { + let resultStartNode = startNodeAndParents.node; + let resultEndNode = endNodeAndParents.node; + if (resultStartNode === resultEndNode) { + return { + startNode: resultStartNode, + endNode: resultEndNode + }; + } + const startNodeStart = locStart(startNodeAndParents.node); + for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) { + if (locStart(endParent) >= startNodeStart) { + resultEndNode = endParent; + } else { + break; + } + } + const endNodeEnd = locEnd(endNodeAndParents.node); + for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) { + if (locEnd(startParent) <= endNodeEnd) { + resultStartNode = startParent; + } else { + break; + } + if (resultStartNode === resultEndNode) { + break; + } + } + return { + startNode: resultStartNode, + endNode: resultEndNode + }; +} +function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type) { + const { locStart, locEnd } = options8; + const start = locStart(node); + const end = locEnd(node); + if (offset > end || offset < start || type === "rangeEnd" && offset === start || type === "rangeStart" && offset === end) { + return; + } + for (const childNode of getSortedChildNodes(node, options8)) { + const childResult = findNodeAtOffset( + childNode, + offset, + options8, + predicate, + [node, ...parentNodes], + type + ); + if (childResult) { + return childResult; + } + } + if (!predicate || predicate(node, parentNodes[0])) { + return { + node, + parentNodes + }; + } +} +function isJsSourceElement(type, parentType) { + return parentType !== "DeclareExportDeclaration" && type !== "TypeParameterDeclaration" && (type === "Directive" || type === "TypeAlias" || type === "TSExportAssignment" || type.startsWith("Declare") || type.startsWith("TSDeclare") || type.endsWith("Statement") || type.endsWith("Declaration")); +} +var jsonSourceElements = /* @__PURE__ */ new Set([ + "JsonRoot", + "ObjectExpression", + "ArrayExpression", + "StringLiteral", + "NumericLiteral", + "BooleanLiteral", + "NullLiteral", + "UnaryExpression", + "TemplateLiteral" +]); +var graphqlSourceElements = /* @__PURE__ */ new Set([ + "OperationDefinition", + "FragmentDefinition", + "VariableDefinition", + "TypeExtensionDefinition", + "ObjectTypeDefinition", + "FieldDefinition", + "DirectiveDefinition", + "EnumTypeDefinition", + "EnumValueDefinition", + "InputValueDefinition", + "InputObjectTypeDefinition", + "SchemaDefinition", + "OperationTypeDefinition", + "InterfaceTypeDefinition", + "UnionTypeDefinition", + "ScalarTypeDefinition" +]); +function isSourceElement(opts, node, parentNode) { + if (!node) { + return false; + } + switch (opts.parser) { + case "flow": + case "hermes": + case "babel": + case "babel-flow": + case "babel-ts": + case "typescript": + case "acorn": + case "espree": + case "meriyah": + case "oxc": + case "oxc-ts": + case "__babel_estree": + return isJsSourceElement(node.type, parentNode == null ? void 0 : parentNode.type); + case "json": + case "json5": + case "jsonc": + case "json-stringify": + return jsonSourceElements.has(node.type); + case "graphql": + return graphqlSourceElements.has(node.kind); + case "vue": + return node.tag !== "root"; + } + return false; +} +function calculateRange(text, opts, ast) { + let { rangeStart: start, rangeEnd: end, locStart, locEnd } = opts; + assert5.ok(end > start); + const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/u); + const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1; + if (!isAllWhitespace) { + start += firstNonWhitespaceCharacterIndex; + for (; end > start; --end) { + if (/\S/u.test(text[end - 1])) { + break; + } + } + } + const startNodeAndParents = findNodeAtOffset( + ast, + start, + opts, + (node, parentNode) => isSourceElement(opts, node, parentNode), + [], + "rangeStart" + ); + const endNodeAndParents = ( + // No need find Node at `end`, it will be the same as `startNodeAndParents` + isAllWhitespace ? startNodeAndParents : findNodeAtOffset( + ast, + end, + opts, + (node) => isSourceElement(opts, node), + [], + "rangeEnd" + ) + ); + if (!startNodeAndParents || !endNodeAndParents) { + return { + rangeStart: 0, + rangeEnd: 0 + }; + } + let startNode; + let endNode; + if (isJsonParser(opts)) { + const commonAncestor = findCommonAncestor( + startNodeAndParents, + endNodeAndParents + ); + startNode = commonAncestor; + endNode = commonAncestor; + } else { + ({ startNode, endNode } = findSiblingAncestors( + startNodeAndParents, + endNodeAndParents, + opts + )); + } + return { + rangeStart: Math.min(locStart(startNode), locStart(endNode)), + rangeEnd: Math.max(locEnd(startNode), locEnd(endNode)) + }; +} + +// src/main/core.js +var BOM = "\uFEFF"; +var CURSOR = Symbol("cursor"); +async function coreFormat(originalText, opts, addAlignmentSize = 0) { + if (!originalText || originalText.trim().length === 0) { + return { formatted: "", cursorOffset: -1, comments: [] }; + } + const { ast, text } = await parse_default(originalText, opts); + if (opts.cursorOffset >= 0) { + opts = { + ...opts, + ...get_cursor_node_default(ast, opts) + }; + } + let doc2 = await printAstToDoc(ast, opts, addAlignmentSize); + if (addAlignmentSize > 0) { + doc2 = addAlignmentToDoc([hardline, doc2], addAlignmentSize, opts.tabWidth); + } + const result = printDocToString(doc2, opts); + if (addAlignmentSize > 0) { + const trimmed = result.formatted.trim(); + if (result.cursorNodeStart !== void 0) { + result.cursorNodeStart -= result.formatted.indexOf(trimmed); + if (result.cursorNodeStart < 0) { + result.cursorNodeStart = 0; + result.cursorNodeText = result.cursorNodeText.trimStart(); + } + if (result.cursorNodeStart + result.cursorNodeText.length > trimmed.length) { + result.cursorNodeText = result.cursorNodeText.trimEnd(); + } + } + result.formatted = trimmed + convertEndOfLineToChars(opts.endOfLine); + } + const comments = opts[Symbol.for("comments")]; + if (opts.cursorOffset >= 0) { + let oldCursorRegionStart; + let oldCursorRegionText; + let newCursorRegionStart; + let newCursorRegionText; + if ((opts.cursorNode || opts.nodeBeforeCursor || opts.nodeAfterCursor) && result.cursorNodeText) { + newCursorRegionStart = result.cursorNodeStart; + newCursorRegionText = result.cursorNodeText; + if (opts.cursorNode) { + oldCursorRegionStart = opts.locStart(opts.cursorNode); + oldCursorRegionText = text.slice( + oldCursorRegionStart, + opts.locEnd(opts.cursorNode) + ); + } else { + if (!opts.nodeBeforeCursor && !opts.nodeAfterCursor) { + throw new Error( + "Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor" + ); + } + oldCursorRegionStart = opts.nodeBeforeCursor ? opts.locEnd(opts.nodeBeforeCursor) : 0; + const oldCursorRegionEnd = opts.nodeAfterCursor ? opts.locStart(opts.nodeAfterCursor) : text.length; + oldCursorRegionText = text.slice( + oldCursorRegionStart, + oldCursorRegionEnd + ); + } + } else { + oldCursorRegionStart = 0; + oldCursorRegionText = text; + newCursorRegionStart = 0; + newCursorRegionText = result.formatted; + } + const cursorOffsetRelativeToOldCursorRegionStart = opts.cursorOffset - oldCursorRegionStart; + if (oldCursorRegionText === newCursorRegionText) { + return { + formatted: result.formatted, + cursorOffset: newCursorRegionStart + cursorOffsetRelativeToOldCursorRegionStart, + comments + }; + } + const oldCursorNodeCharArray = oldCursorRegionText.split(""); + oldCursorNodeCharArray.splice( + cursorOffsetRelativeToOldCursorRegionStart, + 0, + CURSOR + ); + const newCursorNodeCharArray = newCursorRegionText.split(""); + const cursorNodeDiff = diffArrays( + oldCursorNodeCharArray, + newCursorNodeCharArray + ); + let cursorOffset = newCursorRegionStart; + for (const entry of cursorNodeDiff) { + if (entry.removed) { + if (entry.value.includes(CURSOR)) { + break; + } + } else { + cursorOffset += entry.count; + } + } + return { formatted: result.formatted, cursorOffset, comments }; + } + return { formatted: result.formatted, cursorOffset: -1, comments }; +} +async function formatRange(originalText, opts) { + const { ast, text } = await parse_default(originalText, opts); + const { rangeStart, rangeEnd } = calculateRange(text, opts, ast); + const rangeString = text.slice(rangeStart, rangeEnd); + const rangeStart2 = Math.min( + rangeStart, + text.lastIndexOf("\n", rangeStart) + 1 + ); + const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/u)[0]; + const alignmentSize = get_alignment_size_default(indentString, opts.tabWidth); + const rangeResult = await coreFormat( + rangeString, + { + ...opts, + rangeStart: 0, + rangeEnd: Number.POSITIVE_INFINITY, + // Track the cursor offset only if it's within our range + cursorOffset: opts.cursorOffset > rangeStart && opts.cursorOffset <= rangeEnd ? opts.cursorOffset - rangeStart : -1, + // Always use `lf` to format, we'll replace it later + endOfLine: "lf" + }, + alignmentSize + ); + const rangeTrimmed = rangeResult.formatted.trimEnd(); + let { cursorOffset } = opts; + if (cursorOffset > rangeEnd) { + cursorOffset += rangeTrimmed.length - rangeString.length; + } else if (rangeResult.cursorOffset >= 0) { + cursorOffset = rangeResult.cursorOffset + rangeStart; + } + let formatted = text.slice(0, rangeStart) + rangeTrimmed + text.slice(rangeEnd); + if (opts.endOfLine !== "lf") { + const eol = convertEndOfLineToChars(opts.endOfLine); + if (cursorOffset >= 0 && eol === "\r\n") { + cursorOffset += countEndOfLineChars( + formatted.slice(0, cursorOffset), + "\n" + ); + } + formatted = string_replace_all_default( + /* isOptionalObject */ + false, + formatted, + "\n", + eol + ); + } + return { formatted, cursorOffset, comments: rangeResult.comments }; +} +function ensureIndexInText(text, index, defaultValue) { + if (typeof index !== "number" || Number.isNaN(index) || index < 0 || index > text.length) { + return defaultValue; + } + return index; +} +function normalizeIndexes(text, options8) { + let { cursorOffset, rangeStart, rangeEnd } = options8; + cursorOffset = ensureIndexInText(text, cursorOffset, -1); + rangeStart = ensureIndexInText(text, rangeStart, 0); + rangeEnd = ensureIndexInText(text, rangeEnd, text.length); + return { ...options8, cursorOffset, rangeStart, rangeEnd }; +} +function normalizeInputAndOptions(text, options8) { + let { cursorOffset, rangeStart, rangeEnd, endOfLine } = normalizeIndexes( + text, + options8 + ); + const hasBOM = text.charAt(0) === BOM; + if (hasBOM) { + text = text.slice(1); + cursorOffset--; + rangeStart--; + rangeEnd--; + } + if (endOfLine === "auto") { + endOfLine = guessEndOfLine(text); + } + if (text.includes("\r")) { + const countCrlfBefore = (index) => countEndOfLineChars(text.slice(0, Math.max(index, 0)), "\r\n"); + cursorOffset -= countCrlfBefore(cursorOffset); + rangeStart -= countCrlfBefore(rangeStart); + rangeEnd -= countCrlfBefore(rangeEnd); + text = normalizeEndOfLine(text); + } + return { + hasBOM, + text, + options: normalizeIndexes(text, { + ...options8, + cursorOffset, + rangeStart, + rangeEnd, + endOfLine + }) + }; +} +async function hasPragma(text, options8) { + const selectedParser = await resolveParser(options8); + return !selectedParser.hasPragma || selectedParser.hasPragma(text); +} +async function hasIgnorePragma(text, options8) { + var _a; + const selectedParser = await resolveParser(options8); + return (_a = selectedParser.hasIgnorePragma) == null ? void 0 : _a.call(selectedParser, text); +} +async function formatWithCursor(originalText, originalOptions) { + let { hasBOM, text, options: options8 } = normalizeInputAndOptions( + originalText, + await normalize_format_options_default(originalOptions) + ); + if (options8.rangeStart >= options8.rangeEnd && text !== "" || options8.requirePragma && !await hasPragma(text, options8) || options8.checkIgnorePragma && await hasIgnorePragma(text, options8)) { + return { + formatted: originalText, + cursorOffset: originalOptions.cursorOffset, + comments: [] + }; + } + let result; + if (options8.rangeStart > 0 || options8.rangeEnd < text.length) { + result = await formatRange(text, options8); + } else { + if (!options8.requirePragma && options8.insertPragma && options8.printer.insertPragma && !await hasPragma(text, options8)) { + text = options8.printer.insertPragma(text); + } + result = await coreFormat(text, options8); + } + if (hasBOM) { + result.formatted = BOM + result.formatted; + if (result.cursorOffset >= 0) { + result.cursorOffset++; + } + } + return result; +} +async function parse6(originalText, originalOptions, devOptions) { + const { text, options: options8 } = normalizeInputAndOptions( + originalText, + await normalize_format_options_default(originalOptions) + ); + const parsed = await parse_default(text, options8); + if (devOptions) { + if (devOptions.preprocessForPrint) { + parsed.ast = await prepareToPrint(parsed.ast, options8); + } + if (devOptions.massage) { + parsed.ast = massage_ast_default(parsed.ast, options8); + } + } + return parsed; +} +async function formatAst(ast, options8) { + options8 = await normalize_format_options_default(options8); + const doc2 = await printAstToDoc(ast, options8); + return printDocToString(doc2, options8); +} +async function formatDoc(doc2, options8) { + const text = printDocToDebug(doc2); + const { formatted } = await formatWithCursor(text, { + ...options8, + parser: "__js_expression" + }); + return formatted; +} +async function printToDoc(originalText, options8) { + options8 = await normalize_format_options_default(options8); + const { ast } = await parse_default(originalText, options8); + if (options8.cursorOffset >= 0) { + options8 = { + ...options8, + ...get_cursor_node_default(ast, options8) + }; + } + return printAstToDoc(ast, options8); +} +async function printDocToString2(doc2, options8) { + return printDocToString( + doc2, + await normalize_format_options_default(options8) + ); +} + +// src/main/option-categories.js +var option_categories_exports = {}; +__export(option_categories_exports, { + CATEGORY_CONFIG: () => CATEGORY_CONFIG, + CATEGORY_EDITOR: () => CATEGORY_EDITOR, + CATEGORY_FORMAT: () => CATEGORY_FORMAT, + CATEGORY_GLOBAL: () => CATEGORY_GLOBAL, + CATEGORY_OTHER: () => CATEGORY_OTHER, + CATEGORY_OUTPUT: () => CATEGORY_OUTPUT, + CATEGORY_SPECIAL: () => CATEGORY_SPECIAL +}); +var CATEGORY_CONFIG = "Config"; +var CATEGORY_EDITOR = "Editor"; +var CATEGORY_FORMAT = "Format"; +var CATEGORY_OTHER = "Other"; +var CATEGORY_OUTPUT = "Output"; +var CATEGORY_GLOBAL = "Global"; +var CATEGORY_SPECIAL = "Special"; + +// src/plugins/builtin-plugins-proxy.js +var builtin_plugins_proxy_exports = {}; +__export(builtin_plugins_proxy_exports, { + languages: () => languages, + options: () => options7, + parsers: () => parsers, + printers: () => printers +}); + +// src/language-css/languages.evaluate.js +var languages_evaluate_default = [ + { + "name": "CSS", + "type": "markup", + "extensions": [ + ".css", + ".wxss" + ], + "tmScope": "source.css", + "aceMode": "css", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "parsers": [ + "css" + ], + "vscodeLanguageIds": [ + "css" + ], + "linguistLanguageId": 50 + }, + { + "name": "PostCSS", + "type": "markup", + "extensions": [ + ".pcss", + ".postcss" + ], + "tmScope": "source.postcss", + "aceMode": "text", + "group": "CSS", + "parsers": [ + "css" + ], + "vscodeLanguageIds": [ + "postcss" + ], + "linguistLanguageId": 262764437 + }, + { + "name": "Less", + "type": "markup", + "extensions": [ + ".less" + ], + "tmScope": "source.css.less", + "aceMode": "less", + "aliases": [ + "less-css" + ], + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "parsers": [ + "less" + ], + "vscodeLanguageIds": [ + "less" + ], + "linguistLanguageId": 198 + }, + { + "name": "SCSS", + "type": "markup", + "extensions": [ + ".scss" + ], + "tmScope": "source.css.scss", + "aceMode": "scss", + "codemirrorMode": "css", + "codemirrorMimeType": "text/x-scss", + "parsers": [ + "scss" + ], + "vscodeLanguageIds": [ + "scss" + ], + "linguistLanguageId": 329 + } +]; + +// src/common/common-options.evaluate.js +var common_options_evaluate_default = { + "bracketSpacing": { + "category": "Common", + "type": "boolean", + "default": true, + "description": "Print spaces between brackets.", + "oppositeDescription": "Do not print spaces between brackets." + }, + "objectWrap": { + "category": "Common", + "type": "choice", + "default": "preserve", + "description": "How to wrap object literals.", + "choices": [ + { + "value": "preserve", + "description": "Keep as multi-line, if there is a newline between the opening brace and first property." + }, + { + "value": "collapse", + "description": "Fit to a single line when possible." + } + ] + }, + "singleQuote": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Use single quotes instead of double quotes." + }, + "proseWrap": { + "category": "Common", + "type": "choice", + "default": "preserve", + "description": "How to wrap prose.", + "choices": [ + { + "value": "always", + "description": "Wrap prose if it exceeds the print width." + }, + { + "value": "never", + "description": "Do not wrap prose." + }, + { + "value": "preserve", + "description": "Wrap prose as-is." + } + ] + }, + "bracketSameLine": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Put > of opening tags on the last line instead of on a new line." + }, + "singleAttributePerLine": { + "category": "Common", + "type": "boolean", + "default": false, + "description": "Enforce single attribute per line in HTML, Vue and JSX." + } +}; + +// src/language-css/options.js +var options = { + singleQuote: common_options_evaluate_default.singleQuote +}; +var options_default = options; + +// src/language-graphql/languages.evaluate.js +var languages_evaluate_default2 = [ + { + "name": "GraphQL", + "type": "data", + "extensions": [ + ".graphql", + ".gql", + ".graphqls" + ], + "tmScope": "source.graphql", + "aceMode": "text", + "parsers": [ + "graphql" + ], + "vscodeLanguageIds": [ + "graphql" + ], + "linguistLanguageId": 139 + } +]; + +// src/language-graphql/options.js +var options2 = { + bracketSpacing: common_options_evaluate_default.bracketSpacing +}; +var options_default2 = options2; + +// src/language-handlebars/languages.evaluate.js +var languages_evaluate_default3 = [ + { + "name": "Handlebars", + "type": "markup", + "extensions": [ + ".handlebars", + ".hbs" + ], + "tmScope": "text.html.handlebars", + "aceMode": "handlebars", + "aliases": [ + "hbs", + "htmlbars" + ], + "parsers": [ + "glimmer" + ], + "vscodeLanguageIds": [ + "handlebars" + ], + "linguistLanguageId": 155 + } +]; + +// src/language-html/languages.evaluate.js +var languages_evaluate_default4 = [ + { + "name": "Angular", + "type": "markup", + "extensions": [ + ".component.html" + ], + "tmScope": "text.html.basic", + "aceMode": "html", + "aliases": [ + "xhtml" + ], + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "parsers": [ + "angular" + ], + "vscodeLanguageIds": [ + "html" + ], + "filenames": [], + "linguistLanguageId": 146 + }, + { + "name": "HTML", + "type": "markup", + "extensions": [ + ".html", + ".hta", + ".htm", + ".html.hl", + ".inc", + ".xht", + ".xhtml" + ], + "tmScope": "text.html.basic", + "aceMode": "html", + "aliases": [ + "xhtml" + ], + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "parsers": [ + "html" + ], + "vscodeLanguageIds": [ + "html" + ], + "linguistLanguageId": 146 + }, + { + "name": "Lightning Web Components", + "type": "markup", + "extensions": [], + "tmScope": "text.html.basic", + "aceMode": "html", + "aliases": [ + "xhtml" + ], + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "parsers": [ + "lwc" + ], + "vscodeLanguageIds": [ + "html" + ], + "filenames": [], + "linguistLanguageId": 146 + }, + { + "name": "MJML", + "type": "markup", + "extensions": [ + ".mjml" + ], + "tmScope": "text.mjml.basic", + "aceMode": "html", + "aliases": [ + "MJML", + "mjml" + ], + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "parsers": [ + "mjml" + ], + "filenames": [], + "vscodeLanguageIds": [ + "mjml" + ], + "linguistLanguageId": 146 + }, + { + "name": "Vue", + "type": "markup", + "extensions": [ + ".vue" + ], + "tmScope": "source.vue", + "aceMode": "html", + "parsers": [ + "vue" + ], + "vscodeLanguageIds": [ + "vue" + ], + "linguistLanguageId": 391 + } +]; + +// src/language-html/options.js +var CATEGORY_HTML = "HTML"; +var options3 = { + bracketSameLine: common_options_evaluate_default.bracketSameLine, + htmlWhitespaceSensitivity: { + category: CATEGORY_HTML, + type: "choice", + default: "css", + description: "How to handle whitespaces in HTML.", + choices: [ + { + value: "css", + description: "Respect the default value of CSS display property." + }, + { + value: "strict", + description: "Whitespaces are considered sensitive." + }, + { + value: "ignore", + description: "Whitespaces are considered insensitive." + } + ] + }, + singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine, + vueIndentScriptAndStyle: { + category: CATEGORY_HTML, + type: "boolean", + default: false, + description: "Indent script and style tags in Vue files." + } +}; +var options_default3 = options3; + +// src/language-js/languages.evaluate.js +var languages_evaluate_default5 = [ + { + "name": "JavaScript", + "type": "programming", + "extensions": [ + ".js", + "._js", + ".bones", + ".cjs", + ".es", + ".es6", + ".gs", + ".jake", + ".javascript", + ".jsb", + ".jscad", + ".jsfl", + ".jslib", + ".jsm", + ".jspre", + ".jss", + ".mjs", + ".njs", + ".pac", + ".sjs", + ".ssjs", + ".xsjs", + ".xsjslib", + ".start.frag", + ".end.frag", + ".wxs" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "aliases": [ + "js", + "node" + ], + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell", + "zx" + ], + "filenames": [ + "Jakefile", + "start.frag", + "end.frag" + ], + "parsers": [ + "babel", + "acorn", + "espree", + "meriyah", + "babel-flow", + "babel-ts", + "flow", + "typescript" + ], + "vscodeLanguageIds": [ + "javascript", + "mongo" + ], + "linguistLanguageId": 183 + }, + { + "name": "Flow", + "type": "programming", + "extensions": [ + ".js.flow" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "aliases": [], + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell" + ], + "filenames": [], + "parsers": [ + "flow", + "babel-flow" + ], + "vscodeLanguageIds": [ + "javascript" + ], + "linguistLanguageId": 183 + }, + { + "name": "JSX", + "type": "programming", + "extensions": [ + ".jsx" + ], + "tmScope": "source.js.jsx", + "aceMode": "javascript", + "aliases": void 0, + "codemirrorMode": "jsx", + "codemirrorMimeType": "text/jsx", + "interpreters": void 0, + "filenames": void 0, + "parsers": [ + "babel", + "babel-flow", + "babel-ts", + "flow", + "typescript", + "espree", + "meriyah" + ], + "vscodeLanguageIds": [ + "javascriptreact" + ], + "group": "JavaScript", + "linguistLanguageId": 183 + }, + { + "name": "TypeScript", + "type": "programming", + "extensions": [ + ".ts", + ".cts", + ".mts" + ], + "tmScope": "source.ts", + "aceMode": "typescript", + "aliases": [ + "ts" + ], + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/typescript", + "interpreters": [ + "bun", + "deno", + "ts-node", + "tsx" + ], + "parsers": [ + "typescript", + "babel-ts" + ], + "vscodeLanguageIds": [ + "typescript" + ], + "linguistLanguageId": 378 + }, + { + "name": "TSX", + "type": "programming", + "extensions": [ + ".tsx" + ], + "tmScope": "source.tsx", + "aceMode": "javascript", + "codemirrorMode": "jsx", + "codemirrorMimeType": "text/jsx", + "group": "TypeScript", + "parsers": [ + "typescript", + "babel-ts" + ], + "vscodeLanguageIds": [ + "typescriptreact" + ], + "linguistLanguageId": 94901924 + } +]; + +// src/language-js/options.js +var CATEGORY_JAVASCRIPT = "JavaScript"; +var options4 = { + arrowParens: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "always", + description: "Include parentheses around a sole arrow function parameter.", + choices: [ + { + value: "always", + description: "Always include parens. Example: `(x) => x`" + }, + { + value: "avoid", + description: "Omit parens when possible. Example: `x => x`" + } + ] + }, + bracketSameLine: common_options_evaluate_default.bracketSameLine, + objectWrap: common_options_evaluate_default.objectWrap, + bracketSpacing: common_options_evaluate_default.bracketSpacing, + jsxBracketSameLine: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + description: "Put > on the last line instead of at a new line.", + deprecated: "2.4.0" + }, + semi: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: true, + description: "Print semicolons.", + oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." + }, + experimentalOperatorPosition: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "end", + description: "Where to print operators when binary expressions wrap lines.", + choices: [ + { + value: "start", + description: "Print operators at the start of new lines." + }, + { + value: "end", + description: "Print operators at the end of previous lines." + } + ] + }, + experimentalTernaries: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Use curious ternaries, with the question mark after the condition.", + oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent." + }, + singleQuote: common_options_evaluate_default.singleQuote, + jsxSingleQuote: { + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Use single quotes in JSX." + }, + quoteProps: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "as-needed", + description: "Change when properties in objects are quoted.", + choices: [ + { + value: "as-needed", + description: "Only add quotes around object properties where required." + }, + { + value: "consistent", + description: "If at least one property in an object requires quotes, quote all properties." + }, + { + value: "preserve", + description: "Respect the input use of quotes in object properties." + } + ] + }, + trailingComma: { + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "all", + description: "Print trailing commas wherever possible when multi-line.", + choices: [ + { + value: "all", + description: "Trailing commas wherever possible (including function arguments)." + }, + { + value: "es5", + description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" + }, + { value: "none", description: "No trailing commas." } + ] + }, + singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine +}; +var options_default4 = options4; + +// src/language-json/languages.evaluate.js +var languages_evaluate_default6 = [ + { + "name": "JSON.stringify", + "type": "data", + "extensions": [ + ".importmap" + ], + "tmScope": "source.json", + "aceMode": "json", + "aliases": [ + "geojson", + "jsonl", + "sarif", + "topojson" + ], + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "filenames": [ + "package.json", + "package-lock.json", + "composer.json" + ], + "parsers": [ + "json-stringify" + ], + "vscodeLanguageIds": [ + "json" + ], + "linguistLanguageId": 174 + }, + { + "name": "JSON", + "type": "data", + "extensions": [ + ".json", + ".4DForm", + ".4DProject", + ".avsc", + ".geojson", + ".gltf", + ".har", + ".ice", + ".JSON-tmLanguage", + ".json.example", + ".mcmeta", + ".sarif", + ".tact", + ".tfstate", + ".tfstate.backup", + ".topojson", + ".webapp", + ".webmanifest", + ".yy", + ".yyp" + ], + "tmScope": "source.json", + "aceMode": "json", + "aliases": [ + "geojson", + "jsonl", + "sarif", + "topojson" + ], + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "filenames": [ + ".all-contributorsrc", + ".arcconfig", + ".auto-changelog", + ".c8rc", + ".htmlhintrc", + ".imgbotconfig", + ".nycrc", + ".tern-config", + ".tern-project", + ".watchmanconfig", + ".babelrc", + ".jscsrc", + ".jshintrc", + ".jslintrc", + ".swcrc" + ], + "parsers": [ + "json" + ], + "vscodeLanguageIds": [ + "json" + ], + "linguistLanguageId": 174 + }, + { + "name": "JSON with Comments", + "type": "data", + "extensions": [ + ".jsonc", + ".code-snippets", + ".code-workspace", + ".sublime-build", + ".sublime-color-scheme", + ".sublime-commands", + ".sublime-completions", + ".sublime-keymap", + ".sublime-macro", + ".sublime-menu", + ".sublime-mousemap", + ".sublime-project", + ".sublime-settings", + ".sublime-theme", + ".sublime-workspace", + ".sublime_metrics", + ".sublime_session" + ], + "tmScope": "source.json.comments", + "aceMode": "javascript", + "aliases": [ + "jsonc" + ], + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "group": "JSON", + "filenames": [], + "parsers": [ + "jsonc" + ], + "vscodeLanguageIds": [ + "jsonc" + ], + "linguistLanguageId": 423 + }, + { + "name": "JSON5", + "type": "data", + "extensions": [ + ".json5" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "parsers": [ + "json5" + ], + "vscodeLanguageIds": [ + "json5" + ], + "linguistLanguageId": 175 + } +]; + +// src/language-markdown/languages.evaluate.js +var languages_evaluate_default7 = [ + { + "name": "Markdown", + "type": "prose", + "extensions": [ + ".md", + ".livemd", + ".markdown", + ".mdown", + ".mdwn", + ".mkd", + ".mkdn", + ".mkdown", + ".ronn", + ".scd", + ".workbook" + ], + "tmScope": "text.md", + "aceMode": "markdown", + "aliases": [ + "md", + "pandoc" + ], + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "filenames": [ + "contents.lr", + "README" + ], + "wrap": true, + "parsers": [ + "markdown" + ], + "vscodeLanguageIds": [ + "markdown" + ], + "linguistLanguageId": 222 + }, + { + "name": "MDX", + "type": "prose", + "extensions": [ + ".mdx" + ], + "tmScope": "text.md", + "aceMode": "markdown", + "aliases": [ + "md", + "pandoc" + ], + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "filenames": [], + "wrap": true, + "parsers": [ + "mdx" + ], + "vscodeLanguageIds": [ + "mdx" + ], + "linguistLanguageId": 222 + } +]; + +// src/language-markdown/options.js +var options5 = { + proseWrap: common_options_evaluate_default.proseWrap, + singleQuote: common_options_evaluate_default.singleQuote +}; +var options_default5 = options5; + +// src/language-yaml/languages.evaluate.js +var languages_evaluate_default8 = [ + { + "name": "YAML", + "type": "data", + "extensions": [ + ".yml", + ".mir", + ".reek", + ".rviz", + ".sublime-syntax", + ".syntax", + ".yaml", + ".yaml-tmlanguage", + ".yaml.sed", + ".yml.mysql" + ], + "tmScope": "source.yaml", + "aceMode": "yaml", + "aliases": [ + "yml" + ], + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "filenames": [ + ".clang-format", + ".clang-tidy", + ".clangd", + ".gemrc", + "CITATION.cff", + "glide.lock", + "pixi.lock", + ".prettierrc", + ".stylelintrc", + ".lintstagedrc" + ], + "parsers": [ + "yaml" + ], + "vscodeLanguageIds": [ + "yaml", + "ansible", + "dockercompose", + "github-actions-workflow", + "home-assistant" + ], + "linguistLanguageId": 407 + } +]; + +// src/language-yaml/options.js +var options6 = { + bracketSpacing: common_options_evaluate_default.bracketSpacing, + singleQuote: common_options_evaluate_default.singleQuote, + proseWrap: common_options_evaluate_default.proseWrap +}; +var options_default6 = options6; + +// src/plugins/builtin-plugins-proxy.js +function createParsersAndPrinters(modules) { + const parsers2 = /* @__PURE__ */ Object.create(null); + const printers2 = /* @__PURE__ */ Object.create(null); + for (const { + importPlugin: importPlugin2, + parsers: parserNames = [], + printers: printerNames = [] + } of modules) { + const loadPlugin2 = async () => { + const plugin = await importPlugin2(); + Object.assign(parsers2, plugin.parsers); + Object.assign(printers2, plugin.printers); + return plugin; + }; + for (const parserName of parserNames) { + parsers2[parserName] = async () => (await loadPlugin2()).parsers[parserName]; + } + for (const printerName of printerNames) { + printers2[printerName] = async () => (await loadPlugin2()).printers[printerName]; + } + } + return { parsers: parsers2, printers: printers2 }; +} +var options7 = { + ...options_default, + ...options_default2, + ...options_default3, + ...options_default4, + ...options_default5, + ...options_default6 +}; +var languages = [ + ...languages_evaluate_default, + ...languages_evaluate_default2, + ...languages_evaluate_default3, + ...languages_evaluate_default4, + ...languages_evaluate_default5, + ...languages_evaluate_default6, + ...languages_evaluate_default7, + ...languages_evaluate_default8 +]; +var { parsers, printers } = createParsersAndPrinters([ + { + importPlugin: () => import("./plugins/acorn.mjs"), + parsers: ["acorn", "espree"] + }, + { + importPlugin: () => import("./plugins/angular.mjs"), + parsers: [ + "__ng_action", + "__ng_binding", + "__ng_interpolation", + "__ng_directive" + ] + }, + { + importPlugin: () => import("./plugins/babel.mjs"), + parsers: [ + "babel", + "babel-flow", + "babel-ts", + "__js_expression", + "__ts_expression", + "__vue_expression", + "__vue_ts_expression", + "__vue_event_binding", + "__vue_ts_event_binding", + "__babel_estree", + "json", + "json5", + "jsonc", + "json-stringify" + ] + }, + { + importPlugin: () => import("./plugins/estree.mjs"), + printers: ["estree", "estree-json"] + }, + { + importPlugin: () => import("./plugins/flow.mjs"), + parsers: ["flow"] + }, + { + importPlugin: () => import("./plugins/glimmer.mjs"), + parsers: ["glimmer"], + printers: ["glimmer"] + }, + { + importPlugin: () => import("./plugins/graphql.mjs"), + parsers: ["graphql"], + printers: ["graphql"] + }, + { + importPlugin: () => import("./plugins/html.mjs"), + parsers: ["html", "angular", "vue", "lwc", "mjml"], + printers: ["html"] + }, + { + importPlugin: () => import("./plugins/markdown.mjs"), + parsers: ["markdown", "mdx", "remark"], + printers: ["mdast"] + }, + { + importPlugin: () => import("./plugins/meriyah.mjs"), + parsers: ["meriyah"] + }, + { + importPlugin: () => import("./plugins/postcss.mjs"), + parsers: ["css", "less", "scss"], + printers: ["postcss"] + }, + { + importPlugin: () => import("./plugins/typescript.mjs"), + parsers: ["typescript"] + }, + { + importPlugin: () => import("./plugins/yaml.mjs"), + parsers: ["yaml"], + printers: ["yaml"] + } +]); + +// src/main/plugins/load-builtin-plugins.js +function loadBuiltinPlugins() { + return [builtin_plugins_proxy_exports]; +} +var load_builtin_plugins_default = loadBuiltinPlugins; + +// src/main/plugins/load-plugin.js +import path12 from "path"; +import { pathToFileURL as pathToFileURL5 } from "url"; + +// src/utils/import-from-directory.js +import path11 from "path"; +function importFromDirectory(specifier, directory) { + return import_from_file_default(specifier, path11.join(directory, "noop.js")); +} +var import_from_directory_default = importFromDirectory; + +// src/main/plugins/load-plugin.js +async function importPlugin(name, cwd) { + if (isUrl(name)) { + return import(name); + } + if (path12.isAbsolute(name)) { + return import(pathToFileURL5(name).href); + } + try { + return await import(pathToFileURL5(path12.resolve(name)).href); + } catch { + return import_from_directory_default(name, cwd); + } +} +async function loadPluginWithoutCache(plugin, cwd) { + const module = await importPlugin(plugin, cwd); + return { name: plugin, ...module.default ?? module }; +} +var cache2 = /* @__PURE__ */ new Map(); +function loadPlugin(plugin) { + if (typeof plugin !== "string" && !(plugin instanceof URL)) { + return plugin; + } + const cwd = process.cwd(); + const cacheKey = JSON.stringify({ name: plugin, cwd }); + if (!cache2.has(cacheKey)) { + cache2.set(cacheKey, loadPluginWithoutCache(plugin, cwd)); + } + return cache2.get(cacheKey); +} +function clearCache2() { + cache2.clear(); +} + +// src/main/plugins/load-plugins.js +function loadPlugins(plugins = []) { + return Promise.all(plugins.map((plugin) => loadPlugin(plugin))); +} +var load_plugins_default = loadPlugins; + +// src/utils/ignore.js +var import_ignore = __toESM(require_ignore(), 1); +import path13 from "path"; +import url2 from "url"; +var slash = path13.sep === "\\" ? (filePath) => string_replace_all_default( + /* isOptionalObject */ + false, + filePath, + "\\", + "/" +) : (filePath) => filePath; +function getRelativePath(file, ignoreFile) { + const ignoreFilePath = toPath(ignoreFile); + const filePath = isUrl(file) ? url2.fileURLToPath(file) : path13.resolve(file); + return path13.relative( + // If there's an ignore-path set, the filename must be relative to the + // ignore path, not the current working directory. + ignoreFilePath ? path13.dirname(ignoreFilePath) : process.cwd(), + filePath + ); +} +async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) { + let content = ""; + if (ignoreFile) { + content += await read_file_default(ignoreFile) ?? ""; + } + if (!withNodeModules) { + content += "\nnode_modules"; + } + if (!content) { + return; + } + const ignore = (0, import_ignore.default)({ allowRelativePaths: true }).add(content); + return (file) => ignore.checkIgnore(slash(getRelativePath(file, ignoreFile))).ignored; +} +async function createIsIgnoredFunction(ignoreFiles, withNodeModules) { + if (ignoreFiles.length === 0 && !withNodeModules) { + ignoreFiles = [void 0]; + } + const isIgnoredFunctions = (await Promise.all( + ignoreFiles.map( + (ignoreFile) => createSingleIsIgnoredFunction(ignoreFile, withNodeModules) + ) + )).filter(Boolean); + return (file) => isIgnoredFunctions.some((isIgnored2) => isIgnored2(file)); +} +async function isIgnored(file, options8) { + const { ignorePath: ignoreFiles, withNodeModules } = options8; + const isIgnored2 = await createIsIgnoredFunction(ignoreFiles, withNodeModules); + return isIgnored2(file); +} + +// src/utils/object-omit.js +function omit(object, keys) { + keys = new Set(keys); + return Object.fromEntries( + Object.entries(object).filter(([key2]) => !keys.has(key2)) + ); +} +var object_omit_default = omit; + +// src/common/get-file-info.js +async function getFileInfo(file, options8 = {}) { + if (typeof file !== "string" && !(file instanceof URL)) { + throw new TypeError( + `expect \`file\` to be a string or URL, got \`${typeof file}\`` + ); + } + let { ignorePath, withNodeModules } = options8; + if (!Array.isArray(ignorePath)) { + ignorePath = [ignorePath]; + } + const ignored = await isIgnored(file, { ignorePath, withNodeModules }); + let inferredParser; + if (!ignored) { + inferredParser = options8.parser ?? await getParser(file, options8); + } + return { + ignored, + inferredParser: inferredParser ?? null + }; +} +async function getParser(file, options8) { + let config; + if (options8.resolveConfig !== false) { + config = await resolveConfig(file, { + // No need read `.editorconfig` + editorconfig: false + }); + } + if (config == null ? void 0 : config.parser) { + return config.parser; + } + let plugins = options8.plugins ?? (config == null ? void 0 : config.plugins) ?? []; + plugins = (await Promise.all([load_builtin_plugins_default(), load_plugins_default(plugins)])).flat(); + return infer_parser_default({ plugins }, { physicalFile: file }); +} +var get_file_info_default = getFileInfo; + +// src/index.js +import * as doc from "./doc.mjs"; + +// src/main/version.evaluate.js +var version_evaluate_default = "3.6.1"; + +// src/utils/public.js +var public_exports = {}; +__export(public_exports, { + addDanglingComment: () => addDanglingComment, + addLeadingComment: () => addLeadingComment, + addTrailingComment: () => addTrailingComment, + getAlignmentSize: () => get_alignment_size_default, + getIndentSize: () => get_indent_size_default, + getMaxContinuousCount: () => get_max_continuous_count_default, + getNextNonSpaceNonCommentCharacter: () => get_next_non_space_non_comment_character_default, + getNextNonSpaceNonCommentCharacterIndex: () => getNextNonSpaceNonCommentCharacterIndex2, + getPreferredQuote: () => get_preferred_quote_default, + getStringWidth: () => get_string_width_default, + hasNewline: () => has_newline_default, + hasNewlineInRange: () => has_newline_in_range_default, + hasSpaces: () => has_spaces_default, + isNextLineEmpty: () => isNextLineEmpty2, + isNextLineEmptyAfterIndex: () => is_next_line_empty_default, + isPreviousLineEmpty: () => isPreviousLineEmpty2, + makeString: () => make_string_default, + skip: () => skip, + skipEverythingButNewLine: () => skipEverythingButNewLine, + skipInlineComment: () => skip_inline_comment_default, + skipNewline: () => skip_newline_default, + skipSpaces: () => skipSpaces, + skipToLineEnd: () => skipToLineEnd, + skipTrailingComment: () => skip_trailing_comment_default, + skipWhitespace: () => skipWhitespace +}); + +// src/utils/skip-inline-comment.js +function skipInlineComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "*") { + for (let i = startIndex + 2; i < text.length; ++i) { + if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") { + return i + 2; + } + } + } + return startIndex; +} +var skip_inline_comment_default = skipInlineComment; + +// src/utils/skip-trailing-comment.js +function skipTrailingComment(text, startIndex) { + if (startIndex === false) { + return false; + } + if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "/") { + return skipEverythingButNewLine(text, startIndex); + } + return startIndex; +} +var skip_trailing_comment_default = skipTrailingComment; + +// src/utils/get-next-non-space-non-comment-character-index.js +function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) { + let oldIdx = null; + let nextIdx = startIndex; + while (nextIdx !== oldIdx) { + oldIdx = nextIdx; + nextIdx = skipSpaces(text, nextIdx); + nextIdx = skip_inline_comment_default(text, nextIdx); + nextIdx = skip_trailing_comment_default(text, nextIdx); + nextIdx = skip_newline_default(text, nextIdx); + } + return nextIdx; +} +var get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex; + +// src/utils/is-next-line-empty.js +function isNextLineEmpty(text, startIndex) { + let oldIdx = null; + let idx = startIndex; + while (idx !== oldIdx) { + oldIdx = idx; + idx = skipToLineEnd(text, idx); + idx = skip_inline_comment_default(text, idx); + idx = skipSpaces(text, idx); + } + idx = skip_trailing_comment_default(text, idx); + idx = skip_newline_default(text, idx); + return idx !== false && has_newline_default(text, idx); +} +var is_next_line_empty_default = isNextLineEmpty; + +// src/utils/get-indent-size.js +function getIndentSize(value, tabWidth) { + const lastNewlineIndex = value.lastIndexOf("\n"); + if (lastNewlineIndex === -1) { + return 0; + } + return get_alignment_size_default( + // All the leading whitespaces + value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0], + tabWidth + ); +} +var get_indent_size_default = getIndentSize; + +// node_modules/escape-string-regexp/index.js +function escapeStringRegexp(string) { + if (typeof string !== "string") { + throw new TypeError("Expected a string"); + } + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// src/utils/get-max-continuous-count.js +function getMaxContinuousCount(text, searchString) { + const results = text.match( + new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu") + ); + if (results === null) { + return 0; + } + return results.reduce( + (maxCount, result) => Math.max(maxCount, result.length / searchString.length), + 0 + ); +} +var get_max_continuous_count_default = getMaxContinuousCount; + +// src/utils/get-next-non-space-non-comment-character.js +function getNextNonSpaceNonCommentCharacter(text, startIndex) { + const index = get_next_non_space_non_comment_character_index_default(text, startIndex); + return index === false ? "" : text.charAt(index); +} +var get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter; + +// src/utils/get-preferred-quote.js +var SINGLE_QUOTE = "'"; +var DOUBLE_QUOTE = '"'; +function getPreferredQuote(text, preferredQuoteOrPreferSingleQuote) { + const preferred = preferredQuoteOrPreferSingleQuote === true || preferredQuoteOrPreferSingleQuote === SINGLE_QUOTE ? SINGLE_QUOTE : DOUBLE_QUOTE; + const alternate = preferred === SINGLE_QUOTE ? DOUBLE_QUOTE : SINGLE_QUOTE; + let preferredQuoteCount = 0; + let alternateQuoteCount = 0; + for (const character of text) { + if (character === preferred) { + preferredQuoteCount++; + } else if (character === alternate) { + alternateQuoteCount++; + } + } + return preferredQuoteCount > alternateQuoteCount ? alternate : preferred; +} +var get_preferred_quote_default = getPreferredQuote; + +// src/utils/has-newline-in-range.js +function hasNewlineInRange(text, startIndex, endIndex) { + for (let i = startIndex; i < endIndex; ++i) { + if (text.charAt(i) === "\n") { + return true; + } + } + return false; +} +var has_newline_in_range_default = hasNewlineInRange; + +// src/utils/has-spaces.js +function hasSpaces(text, startIndex, options8 = {}) { + const idx = skipSpaces( + text, + options8.backwards ? startIndex - 1 : startIndex, + options8 + ); + return idx !== startIndex; +} +var has_spaces_default = hasSpaces; + +// src/utils/make-string.js +function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) { + const otherQuote = enclosingQuote === '"' ? "'" : '"'; + const regex = /\\(.)|(["'])/gsu; + const raw = string_replace_all_default( + /* isOptionalObject */ + false, + rawText, + regex, + (match, escaped, quote) => { + if (escaped === otherQuote) { + return escaped; + } + if (quote === enclosingQuote) { + return "\\" + quote; + } + if (quote) { + return quote; + } + return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped; + } + ); + return enclosingQuote + raw + enclosingQuote; +} +var make_string_default = makeString; + +// src/utils/public.js +function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) { + return get_next_non_space_non_comment_character_index_default( + text, + locEnd(node) + ); +} +function getNextNonSpaceNonCommentCharacterIndex2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? get_next_non_space_non_comment_character_index_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyGetNextNonSpaceNonCommentCharacterIndex(...arguments) + ); +} +function legacyIsPreviousLineEmpty(text, node, locStart) { + return is_previous_line_empty_default(text, locStart(node)); +} +function isPreviousLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_previous_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsPreviousLineEmpty(...arguments) + ); +} +function legacyIsNextLineEmpty(text, node, locEnd) { + return is_next_line_empty_default(text, locEnd(node)); +} +function isNextLineEmpty2(text, startIndex) { + return arguments.length === 2 || typeof startIndex === "number" ? is_next_line_empty_default(text, startIndex) : ( + // @ts-expect-error -- expected + // eslint-disable-next-line prefer-rest-params + legacyIsNextLineEmpty(...arguments) + ); +} + +// src/index.js +function withPlugins(fn, optionsArgumentIndex = 1) { + return async (...args) => { + const options8 = args[optionsArgumentIndex] ?? {}; + const { plugins = [] } = options8; + args[optionsArgumentIndex] = { + ...options8, + plugins: (await Promise.all([ + load_builtin_plugins_default(), + // TODO: standalone version allow `plugins` to be `prettierPlugins` which is an object, should allow that too + load_plugins_default(plugins) + ])).flat() + }; + return fn(...args); + }; +} +var formatWithCursor2 = withPlugins(formatWithCursor); +async function format2(text, options8) { + const { formatted } = await formatWithCursor2(text, { + ...options8, + cursorOffset: -1 + }); + return formatted; +} +async function check(text, options8) { + return await format2(text, options8) === text; +} +async function clearCache3() { + clearCache(); + clearCache2(); +} +var getSupportInfo2 = withPlugins(getSupportInfo, 0); +var inferParser2 = withPlugins( + (file, options8) => infer_parser_default(options8, { physicalFile: file }) +); +var sharedWithCli = { + errors: errors_exports, + optionCategories: option_categories_exports, + createIsIgnoredFunction, + formatOptionsHiddenDefaults, + normalizeOptions: normalize_options_default, + getSupportInfoWithoutPlugins: getSupportInfo, + normalizeOptionSettings, + inferParser: (file, options8) => Promise.resolve((options8 == null ? void 0 : options8.parser) ?? inferParser2(file, options8)), + vnopts: { + ChoiceSchema, + apiDescriptor + }, + fastGlob: import_fast_glob.default, + createTwoFilesPatch, + picocolors: import_picocolors4.default, + leven, + utils: { + omit: object_omit_default, + createMockable: create_mockable_default + } +}; +var debugApis = { + parse: withPlugins(parse6), + formatAST: withPlugins(formatAst), + formatDoc: withPlugins(formatDoc), + printToDoc: withPlugins(printToDoc), + printDocToString: withPlugins(printDocToString2), + // Exposed for tests + mockable +}; + +// with-default-export:src/index.js +var src_default = index_exports; +export { + debugApis as __debug, + sharedWithCli as __internal, + check, + clearCache3 as clearConfigCache, + src_default as default, + doc, + format2 as format, + formatWithCursor2 as formatWithCursor, + get_file_info_default as getFileInfo, + getSupportInfo2 as getSupportInfo, + resolveConfig, + resolveConfigFile, + public_exports as util, + version_evaluate_default as version +}; diff --git a/.pnpm-store/v10/files/03/5550b26ba77f2e901ae31a482367e5b8536d57239f27a65e6f11601737cd7b4a876d5ce8d10dbc1398049423b1834586a6c9a32d06671bf509378278c232e5 b/.pnpm-store/v10/files/03/5550b26ba77f2e901ae31a482367e5b8536d57239f27a65e6f11601737cd7b4a876d5ce8d10dbc1398049423b1834586a6c9a32d06671bf509378278c232e5 new file mode 100644 index 0000000..3d03caa --- /dev/null +++ b/.pnpm-store/v10/files/03/5550b26ba77f2e901ae31a482367e5b8536d57239f27a65e6f11601737cd7b4a876d5ce8d10dbc1398049423b1834586a6c9a32d06671bf509378278c232e5 @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; diff --git a/.pnpm-store/v10/files/03/74b342390025eea9cc8523869eaf4e72adc0eb458abb8766c18d98b6981da74002e5fda593dca5b661ab8b84320f5949d4955e91f720a039bf71dc1745afe5 b/.pnpm-store/v10/files/03/74b342390025eea9cc8523869eaf4e72adc0eb458abb8766c18d98b6981da74002e5fda593dca5b661ab8b84320f5949d4955e91f720a039bf71dc1745afe5 new file mode 100644 index 0000000..503eb1e --- /dev/null +++ b/.pnpm-store/v10/files/03/74b342390025eea9cc8523869eaf4e72adc0eb458abb8766c18d98b6981da74002e5fda593dca5b661ab8b84320f5949d4955e91f720a039bf71dc1745afe5 @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/.pnpm-store/v10/files/03/a97cdc4f6f1682d7484f7d9895ec2b3089eb81bfaf91c4bb5f747ead24f45bda07a723023b9baa00419c095db16d0445351defb4e288593c0d507bffe98639 b/.pnpm-store/v10/files/03/a97cdc4f6f1682d7484f7d9895ec2b3089eb81bfaf91c4bb5f747ead24f45bda07a723023b9baa00419c095db16d0445351defb4e288593c0d507bffe98639 new file mode 100644 index 0000000..8e402ea --- /dev/null +++ b/.pnpm-store/v10/files/03/a97cdc4f6f1682d7484f7d9895ec2b3089eb81bfaf91c4bb5f747ead24f45bda07a723023b9baa00419c095db16d0445351defb4e288593c0d507bffe98639 @@ -0,0 +1,294 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept header. + * @private + */ + +function parseAccept(accept) { + var accepts = splitMediaTypes(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var mediaType = parseMediaType(accepts[i].trim(), i); + + if (mediaType) { + accepts[j++] = mediaType; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a media type from the Accept header. + * @private + */ + +function parseMediaType(str, i) { + var match = simpleMediaTypeRegExp.exec(str); + if (!match) return null; + + var params = Object.create(null); + var q = 1; + var subtype = match[2]; + var type = match[1]; + + if (match[3]) { + var kvps = splitParameters(match[3]).map(splitKeyValuePair); + + for (var j = 0; j < kvps.length; j++) { + var pair = kvps[j]; + var key = pair[0].toLowerCase(); + var val = pair[1]; + + // get the value, unwrapping quotes + var value = val && val[0] === '"' && val[val.length - 1] === '"' + ? val.slice(1, -1) + : val; + + if (key === 'q') { + q = parseFloat(value); + break; + } + + // store parameter + params[key] = value; + } + } + + return { + type: type, + subtype: subtype, + params: params, + q: q, + i: i + }; +} + +/** + * Get the priority of a media type. + * @private + */ + +function getMediaTypePriority(type, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(type, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the media type. + * @private + */ + +function specify(type, spec, index) { + var p = parseMediaType(type); + var s = 0; + + if (!p) { + return null; + } + + if(spec.type.toLowerCase() == p.type.toLowerCase()) { + s |= 4 + } else if(spec.type != '*') { + return null; + } + + if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { + s |= 2 + } else if(spec.subtype != '*') { + return null; + } + + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function (k) { + return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); + })) { + s |= 1 + } else { + return null + } + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s, + } +} + +/** + * Get the preferred media types from an Accept header. + * @public + */ + +function preferredMediaTypes(accept, provided) { + // RFC 2616 sec 14.2: no header = */* + var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); + + if (!provided) { + // sorted list of all types + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); + } + + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + + // sorted list of accepted types + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} + +/** + * Count the number of quotes in a string. + * @private + */ + +function quoteCount(string) { + var count = 0; + var index = 0; + + while ((index = string.indexOf('"', index)) !== -1) { + count++; + index++; + } + + return count; +} + +/** + * Split a key value pair. + * @private + */ + +function splitKeyValuePair(str) { + var index = str.indexOf('='); + var key; + var val; + + if (index === -1) { + key = str; + } else { + key = str.slice(0, index); + val = str.slice(index + 1); + } + + return [key, val]; +} + +/** + * Split an Accept header into media types. + * @private + */ + +function splitMediaTypes(accept) { + var accepts = accept.split(','); + + for (var i = 1, j = 0; i < accepts.length; i++) { + if (quoteCount(accepts[j]) % 2 == 0) { + accepts[++j] = accepts[i]; + } else { + accepts[j] += ',' + accepts[i]; + } + } + + // trim accepts + accepts.length = j + 1; + + return accepts; +} + +/** + * Split a string of parameters. + * @private + */ + +function splitParameters(str) { + var parameters = str.split(';'); + + for (var i = 1, j = 0; i < parameters.length; i++) { + if (quoteCount(parameters[j]) % 2 == 0) { + parameters[++j] = parameters[i]; + } else { + parameters[j] += ';' + parameters[i]; + } + } + + // trim parameters + parameters.length = j + 1; + + for (var i = 0; i < parameters.length; i++) { + parameters[i] = parameters[i].trim(); + } + + return parameters; +} diff --git a/.pnpm-store/v10/files/03/c97f75dcd1aef0717bec9915f7c92d5eebe14258db60189bf79362f1ad9ff053c0309a572007db17384bfee4b8b0f2c17989bdb04ac106bf18314b8feff8c3 b/.pnpm-store/v10/files/03/c97f75dcd1aef0717bec9915f7c92d5eebe14258db60189bf79362f1ad9ff053c0309a572007db17384bfee4b8b0f2c17989bdb04ac106bf18314b8feff8c3 new file mode 100644 index 0000000..4710c33 --- /dev/null +++ b/.pnpm-store/v10/files/03/c97f75dcd1aef0717bec9915f7c92d5eebe14258db60189bf79362f1ad9ff053c0309a572007db17384bfee4b8b0f2c17989bdb04ac106bf18314b8feff8c3 @@ -0,0 +1,40 @@ +{ + "name": "binary-extensions", + "version": "2.3.0", + "description": "List of binary file extensions", + "license": "MIT", + "repository": "sindresorhus/binary-extensions", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "sideEffects": false, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "binary-extensions.json", + "binary-extensions.json.d.ts" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "json", + "list", + "array" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/.pnpm-store/v10/files/03/ff2bc61fb7ea5e5692c37340fe72d956f8865128c6593567b9f609e3b641e7c9db2e0c03310d4f42fc5d448c22644869c592b4420e4600cd572d8893343a51 b/.pnpm-store/v10/files/03/ff2bc61fb7ea5e5692c37340fe72d956f8865128c6593567b9f609e3b641e7c9db2e0c03310d4f42fc5d448c22644869c592b4420e4600cd572d8893343a51 new file mode 100644 index 0000000..11691d7 --- /dev/null +++ b/.pnpm-store/v10/files/03/ff2bc61fb7ea5e5692c37340fe72d956f8865128c6593567b9f609e3b641e7c9db2e0c03310d4f42fc5d448c22644869c592b4420e4600cd572d8893343a51 @@ -0,0 +1,287 @@ +const minimatch = require('minimatch'); +const path = require('path'); +const fs = require('fs'); +const debug = require('debug')('nodemon:match'); +const utils = require('../utils'); + +module.exports = match; +module.exports.rulesToMonitor = rulesToMonitor; + +function rulesToMonitor(watch, ignore, config) { + var monitor = []; + + if (!Array.isArray(ignore)) { + if (ignore) { + ignore = [ignore]; + } else { + ignore = []; + } + } + + if (!Array.isArray(watch)) { + if (watch) { + watch = [watch]; + } else { + watch = []; + } + } + + if (watch && watch.length) { + monitor = utils.clone(watch); + } + + if (ignore) { + [].push.apply( + monitor, + (ignore || []).map(function (rule) { + return '!' + rule; + }) + ); + } + + var cwd = process.cwd(); + + // next check if the monitored paths are actual directories + // or just patterns - and expand the rule to include *.* + monitor = monitor.map(function (rule) { + var not = rule.slice(0, 1) === '!'; + + if (not) { + rule = rule.slice(1); + } + + if (rule === '.' || rule === '.*') { + rule = '*.*'; + } + + var dir = path.resolve(cwd, rule); + + try { + var stat = fs.statSync(dir); + if (stat.isDirectory()) { + rule = dir; + if (rule.slice(-1) !== '/') { + rule += '/'; + } + rule += '**/*'; + + // `!not` ... sorry. + if (!not) { + config.dirs.push(dir); + } + } else { + // ensures we end up in the check that tries to get a base directory + // and then adds it to the watch list + throw new Error(); + } + } catch (e) { + var base = tryBaseDir(dir); + if (!not && base) { + if (config.dirs.indexOf(base) === -1) { + config.dirs.push(base); + } + } + } + + if (rule.slice(-1) === '/') { + // just slap on a * anyway + rule += '*'; + } + + // if the url ends with * but not **/* and not *.* + // then convert to **/* - somehow it was missed :-\ + if ( + rule.slice(-4) !== '**/*' && + rule.slice(-1) === '*' && + rule.indexOf('*.') === -1 + ) { + if (rule.slice(-2) !== '**') { + rule += '*/*'; + } + } + + return (not ? '!' : '') + rule; + }); + + return monitor; +} + +function tryBaseDir(dir) { + var stat; + if (/[?*\{\[]+/.test(dir)) { + // if this is pattern, then try to find the base + try { + var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo')); + stat = fs.statSync(base); + if (stat.isDirectory()) { + return base; + } + } catch (error) { + // console.log(error); + } + } else { + try { + stat = fs.statSync(dir); + // if this path is actually a single file that exists, then just monitor + // that, *specifically*. + if (stat.isFile() || stat.isDirectory()) { + return dir; + } + } catch (e) {} + } + + return false; +} + +function match(files, monitor, ext) { + // sort the rules by highest specificity (based on number of slashes) + // ignore rules (!) get sorted highest as they take precedent + const cwd = process.cwd(); + var rules = monitor + .sort(function (a, b) { + var r = b.split(path.sep).length - a.split(path.sep).length; + var aIsIgnore = a.slice(0, 1) === '!'; + var bIsIgnore = b.slice(0, 1) === '!'; + + if (aIsIgnore || bIsIgnore) { + if (aIsIgnore) { + return -1; + } + + return 1; + } + + if (r === 0) { + return b.length - a.length; + } + return r; + }) + .map(function (s) { + var prefix = s.slice(0, 1); + + if (prefix === '!') { + if (s.indexOf('!' + cwd) === 0) { + return s; + } + + // if it starts with a period, then let's get the relative path + if (s.indexOf('!.') === 0) { + return '!' + path.resolve(cwd, s.substring(1)); + } + + return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); + } + + // if it starts with a period, then let's get the relative path + if (s.indexOf('.') === 0) { + return path.resolve(cwd, s); + } + + if (s.indexOf(cwd) === 0) { + return s; + } + + return '**' + (prefix !== path.sep ? path.sep : '') + s; + }); + + debug('rules', rules); + + var good = []; + var whitelist = []; // files that we won't check against the extension + var ignored = 0; + var watched = 0; + var usedRules = []; + var minimatchOpts = { + dot: true, + }; + + // enable case-insensitivity on Windows + if (utils.isWindows) { + minimatchOpts.nocase = true; + } + + files.forEach(function (file) { + file = path.resolve(cwd, file); + + var matched = false; + for (var i = 0; i < rules.length; i++) { + if (rules[i].slice(0, 1) === '!') { + if (!minimatch(file, rules[i], minimatchOpts)) { + debug('ignored', file, 'rule:', rules[i]); + ignored++; + matched = true; + break; + } + } else { + debug('matched', file, 'rule:', rules[i]); + if (minimatch(file, rules[i], minimatchOpts)) { + watched++; + + // don't repeat the output if a rule is matched + if (usedRules.indexOf(rules[i]) === -1) { + usedRules.push(rules[i]); + utils.log.detail('matched rule: ' + rules[i]); + } + + // if the rule doesn't match the WATCH EVERYTHING + // but *does* match a rule that ends with *.*, then + // white list it - in that we don't run it through + // the extension check too. + if ( + rules[i] !== '**' + path.sep + '*.*' && + rules[i].slice(-3) === '*.*' + ) { + whitelist.push(file); + } else if (path.basename(file) === path.basename(rules[i])) { + // if the file matches the actual rule, then it's put on whitelist + whitelist.push(file); + } else { + good.push(file); + } + matched = true; + } else { + // utils.log.detail('no match: ' + rules[i], file); + } + } + } + if (!matched) { + ignored++; + } + }); + + // finally check the good files against the extensions that we're monitoring + if (ext) { + if (ext.indexOf(',') === -1) { + ext = '**/*.' + ext; + } else { + ext = '**/*.{' + ext + '}'; + } + + good = good.filter(function (file) { + // only compare the filename to the extension test + return minimatch(path.basename(file), ext, minimatchOpts); + }); + debug('good (filtered by ext)', good); + } else { + // else assume *.* + debug('good', good); + } + + if (whitelist.length) debug('whitelist', whitelist); + + var result = good.concat(whitelist); + + if (utils.isWindows) { + // fix for windows testing - I *think* this is okay to do + result = result.map(function (file) { + return file.slice(0, 1).toLowerCase() + file.slice(1); + }); + } + + return { + result: result, + ignored: ignored, + watched: watched, + total: files.length, + }; +} diff --git a/.pnpm-store/v10/files/05/03293c045d0d939898b13c2af235a2a548978ff8f9aed0537065dab93699425bb3b7c98a673a7a411c3d95465792d6597047760cdb2472ea93837bf4fc6f48 b/.pnpm-store/v10/files/05/03293c045d0d939898b13c2af235a2a548978ff8f9aed0537065dab93699425bb3b7c98a673a7a411c3d95465792d6597047760cdb2472ea93837bf4fc6f48 new file mode 100644 index 0000000..2efba0f --- /dev/null +++ b/.pnpm-store/v10/files/05/03293c045d0d939898b13c2af235a2a548978ff8f9aed0537065dab93699425bb3b7c98a673a7a411c3d95465792d6597047760cdb2472ea93837bf4fc6f48 @@ -0,0 +1,319 @@ +'use strict' + +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + if (release.startsWith('pre')) { + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + // Avoid an invalid semver results + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]) + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`) + } + } + } + + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + case 'release': + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`) + } + this.prerelease.length = 0 + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/.pnpm-store/v10/files/05/31fe3c659c3543f27ce71dca19cc8eb24e4522a14f65463007db510e5a4050f291421135dcf4df3f8e77e634a22d110a923218fcf892caa7e4c87dd7527eb6 b/.pnpm-store/v10/files/05/31fe3c659c3543f27ce71dca19cc8eb24e4522a14f65463007db510e5a4050f291421135dcf4df3f8e77e634a22d110a923218fcf892caa7e4c87dd7527eb6 new file mode 100644 index 0000000..f993425 --- /dev/null +++ b/.pnpm-store/v10/files/05/31fe3c659c3543f27ce71dca19cc8eb24e4522a14f65463007db510e5a4050f291421135dcf4df3f8e77e634a22d110a923218fcf892caa7e4c87dd7527eb6 @@ -0,0 +1,177 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('body-parser:urlencoded') +var isFinished = require('on-finished').isFinished +var read = require('../read') +var typeis = require('type-is') +var qs = require('qs') +var { getCharset, normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = urlencoded + +/** + * Create a middleware to parse urlencoded bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function urlencoded (options) { + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/x-www-form-urlencoded') + + var defaultCharset = options?.defaultCharset || 'utf-8' + if (defaultCharset !== 'utf-8' && defaultCharset !== 'iso-8859-1') { + throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1') + } + + // create the appropriate query parser + var queryparse = createQueryParser(options) + + function parse (body, encoding) { + return body.length + ? queryparse(body, encoding) + : {} + } + + return function urlencodedParser (req, res, next) { + if (isFinished(req)) { + debug('body already parsed') + next() + return + } + + if (!('body' in req)) { + req.body = undefined + } + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset + var charset = getCharset(req) || defaultCharset + if (charset !== 'utf-8' && charset !== 'iso-8859-1') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate, + limit, + verify + }) + } +} + +/** + * Get the extended query parser. + * + * @param {object} options + */ + +function createQueryParser (options) { + var extended = Boolean(options?.extended) + var parameterLimit = options?.parameterLimit !== undefined + ? options?.parameterLimit + : 1000 + var charsetSentinel = options?.charsetSentinel + var interpretNumericEntities = options?.interpretNumericEntities + var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0 + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function queryparse (body, encoding) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + var arrayLimit = extended ? Math.max(100, paramCount) : 0 + + debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') + try { + return qs.parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + charsetSentinel: charsetSentinel, + interpretNumericEntities: interpretNumericEntities, + charset: encoding, + parameterLimit: parameterLimit, + strictDepth: true + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } + } +} + +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @api private + */ + +function parameterCount (body, limit) { + var len = body.split('&').length + + return len > limit ? undefined : len - 1 +} diff --git a/.pnpm-store/v10/files/05/351a85db9148dcf600385bda6feaa1eeeeff27e9eaf4175914b4c4ccdd1bf23eb9e3dd42e751ee6479127e55ea59a599bf674d3df0167f1cc8797681eb7842 b/.pnpm-store/v10/files/05/351a85db9148dcf600385bda6feaa1eeeeff27e9eaf4175914b4c4ccdd1bf23eb9e3dd42e751ee6479127e55ea59a599bf674d3df0167f1cc8797681eb7842 new file mode 100644 index 0000000..f759b8a --- /dev/null +++ b/.pnpm-store/v10/files/05/351a85db9148dcf600385bda6feaa1eeeeff27e9eaf4175914b4c4ccdd1bf23eb9e3dd42e751ee6479127e55ea59a599bf674d3df0167f1cc8797681eb7842 @@ -0,0 +1,40 @@ +# hasown [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A robust, ES3 compatible, "has own property" predicate. + +## Example + +```js +const assert = require('assert'); +const hasOwn = require('hasown'); + +assert.equal(hasOwn({}, 'toString'), false); +assert.equal(hasOwn([], 'length'), true); +assert.equal(hasOwn({ a: 42 }, 'a'), true); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/hasown +[npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg +[deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg +[deps-url]: https://david-dm.org/inspect-js/hasOwn +[dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/hasown.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/hasown.svg +[downloads-url]: https://npm-stat.com/charts.html?package=hasown +[codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn +[actions-url]: https://github.com/inspect-js/hasOwn/actions diff --git a/.pnpm-store/v10/files/05/6650aec5ad3b846255bb81ac6d6a45cfa80eaa9cdb80251829f00e420bc53f8bb8b9bf79a3dbcef7bf16306849855f0fb3c64e928a3043d7d137b497dee356 b/.pnpm-store/v10/files/05/6650aec5ad3b846255bb81ac6d6a45cfa80eaa9cdb80251829f00e420bc53f8bb8b9bf79a3dbcef7bf16306849855f0fb3c64e928a3043d7d137b497dee356 new file mode 100644 index 0000000..1d21a8a --- /dev/null +++ b/.pnpm-store/v10/files/05/6650aec5ad3b846255bb81ac6d6a45cfa80eaa9cdb80251829f00e420bc53f8bb8b9bf79a3dbcef7bf16306849855f0fb3c64e928a3043d7d137b497dee356 @@ -0,0 +1,10 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": "off", + "sort-keys": "off", + }, +} diff --git a/.pnpm-store/v10/files/05/aa601e6f7e3062dc30442f372f23502dc5ef4fdde9cce05462e78d1fe8e095916f175bb65484d56e5f5e66a4e1ba24d4e93f46cad3ada63c7584db00e885c7 b/.pnpm-store/v10/files/05/aa601e6f7e3062dc30442f372f23502dc5ef4fdde9cce05462e78d1fe8e095916f175bb65484d56e5f5e66a4e1ba24d4e93f46cad3ada63c7584db00e885c7 new file mode 100644 index 0000000..e7f763b --- /dev/null +++ b/.pnpm-store/v10/files/05/aa601e6f7e3062dc30442f372f23502dc5ef4fdde9cce05462e78d1fe8e095916f175bb65484d56e5f5e66a4e1ba24d4e93f46cad3ada63c7584db00e885c7 @@ -0,0 +1,49 @@ +{ + "name": "body-parser", + "description": "Node.js body parsing middleware", + "version": "2.2.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "expressjs/body-parser", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "devDependencies": { + "eslint": "8.34.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "^11.1.0", + "nyc": "^17.1.0", + "supertest": "^7.0.0" + }, + "files": [ + "lib/", + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/.pnpm-store/v10/files/05/ae987351fe430def14d7cbfbbb982204c354fef88d96a6d786b2448a4b9bca6e3254c51944e873d71ca0efa8f619a2b028fadf225f5143e56313470b13f3ac b/.pnpm-store/v10/files/05/ae987351fe430def14d7cbfbbb982204c354fef88d96a6d786b2448a4b9bca6e3254c51944e873d71ca0efa8f619a2b028fadf225f5143e56313470b13f3ac new file mode 100644 index 0000000..e228065 --- /dev/null +++ b/.pnpm-store/v10/files/05/ae987351fe430def14d7cbfbbb982204c354fef88d96a6d786b2448a4b9bca6e3254c51944e873d71ca0efa8f619a2b028fadf225f5143e56313470b13f3ac @@ -0,0 +1,5 @@ +declare function gOPD(obj: O, prop: K): PropertyDescriptor | undefined; + +declare const fn: typeof gOPD | undefined | null; + +export = fn; \ No newline at end of file diff --git a/.pnpm-store/v10/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f b/.pnpm-store/v10/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f new file mode 100644 index 0000000..77487dc --- /dev/null +++ b/.pnpm-store/v10/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f @@ -0,0 +1,54 @@ +'use strict' + +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/.pnpm-store/v10/files/05/cd7bb449754ae4a8304756b0f9c56c73ea088c7cd9a7a3af76eb1d5fc3428942a079185c9ded18589ae6bfba2fae671d5f197456c83d02061895f6f4f2bd47 b/.pnpm-store/v10/files/05/cd7bb449754ae4a8304756b0f9c56c73ea088c7cd9a7a3af76eb1d5fc3428942a079185c9ded18589ae6bfba2fae671d5f197456c83d02061895f6f4f2bd47 new file mode 100644 index 0000000..541516b --- /dev/null +++ b/.pnpm-store/v10/files/05/cd7bb449754ae4a8304756b0f9c56c73ea088c7cd9a7a3af76eb1d5fc3428942a079185c9ded18589ae6bfba2fae671d5f197456c83d02061895f6f4f2bd47 @@ -0,0 +1,64 @@ +type RemoveFromTuple< + Tuple extends readonly unknown[], + RemoveCount extends number, + Index extends 1[] = [] +> = Index["length"] extends RemoveCount + ? Tuple + : Tuple extends [infer First, ...infer Rest] + ? RemoveFromTuple + : Tuple; + +type ConcatTuples< + Prefix extends readonly unknown[], + Suffix extends readonly unknown[] +> = [...Prefix, ...Suffix]; + +type ExtractFunctionParams = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R + ? { thisArg: TThis; params: P; returnType: R } + : never; + +type BindFunction< + T extends (this: any, ...args: any[]) => any, + TThis, + TBoundArgs extends readonly unknown[], + ReceiverBound extends boolean +> = ExtractFunctionParams extends { + thisArg: infer OrigThis; + params: infer P extends readonly unknown[]; + returnType: infer R; +} + ? ReceiverBound extends true + ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest] + ? [TThis, ...Rest] // Replace `this` with `thisArg` + : R + : >>( + thisArg: U, + ...args: RemainingArgs + ) => R extends [OrigThis, ...infer Rest] + ? [U, ...ConcatTuples] // Preserve bound args in return type + : R + : never; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[], + const TThis extends Extracted["thisArg"] +>( + args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[] +>( + args: [fn: T, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind( + args: [fn: Exclude, ...rest: TArgs] +): never; + +// export as namespace callBind; +export = callBind; diff --git a/.pnpm-store/v10/files/05/ebe90b56f4e19b2904f92516f73679b8959fe8419a693644c9268bba16ad14648ad871f4f7fe1b5a258fdb727fccee888a6a0f0d73581713a0d666481bbc05 b/.pnpm-store/v10/files/05/ebe90b56f4e19b2904f92516f73679b8959fe8419a693644c9268bba16ad14648ad871f4f7fe1b5a258fdb727fccee888a6a0f0d73581713a0d666481bbc05 new file mode 100644 index 0000000..f1b8805 --- /dev/null +++ b/.pnpm-store/v10/files/05/ebe90b56f4e19b2904f92516f73679b8959fe8419a693644c9268bba16ad14648ad871f4f7fe1b5a258fdb727fccee888a6a0f0d73581713a0d666481bbc05 @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-errors +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/.pnpm-store/v10/files/06/0bc19e10d8b9cd959869866b4ac5e0739edd72ca1e61a230a5f3c735feda6fb75ae7a8ea13349013082bedbcd40e30219ca09ccfaad43571059a765bcaee8c b/.pnpm-store/v10/files/06/0bc19e10d8b9cd959869866b4ac5e0739edd72ca1e61a230a5f3c735feda6fb75ae7a8ea13349013082bedbcd40e30219ca09ccfaad43571059a765bcaee8c new file mode 100644 index 0000000..c78c435 --- /dev/null +++ b/.pnpm-store/v10/files/06/0bc19e10d8b9cd959869866b4ac5e0739edd72ca1e61a230a5f3c735feda6fb75ae7a8ea13349013082bedbcd40e30219ca09ccfaad43571059a765bcaee8c @@ -0,0 +1,93 @@ +/** + * Manages the internal config of nodemon, checking for the state of support + * with fs.watch, how nodemon can watch files (using find or fs methods). + * + * This is *not* the user's config. + */ +var debug = require('debug')('nodemon'); +var load = require('./load'); +var rules = require('../rules'); +var utils = require('../utils'); +var pinVersion = require('../version').pin; +var command = require('./command'); +var rulesToMonitor = require('../monitor/match').rulesToMonitor; +var bus = utils.bus; + +function reset() { + rules.reset(); + + config.dirs = []; + config.options = { ignore: [], watch: [], monitor: [] }; + config.lastStarted = 0; + config.loaded = []; +} + +var config = { + run: false, + system: { + cwd: process.cwd(), + }, + required: false, + dirs: [], + timeout: 1000, + options: {}, +}; + +/** + * Take user defined settings, then detect the local machine capability, then + * look for local and global nodemon.json files and merge together the final + * settings with the config for nodemon. + * + * @param {Object} settings user defined settings for nodemon (typically on + * the cli) + * @param {Function} ready callback fired once the config is loaded + */ +config.load = function (settings, ready) { + reset(); + var config = this; + load(settings, config.options, config, function (options) { + config.options = options; + + if (options.watch.length === 0) { + // this is to catch when the watch is left blank + options.watch.push('*.*'); + } + + if (options['watch_interval']) { // jshint ignore:line + options.watchInterval = options['watch_interval']; // jshint ignore:line + } + + config.watchInterval = options.watchInterval || null; + if (options.signal) { + config.signal = options.signal; + } + + var cmd = command(config.options); + config.command = { + raw: cmd, + string: utils.stringify(cmd.executable, cmd.args), + }; + + // now run automatic checks on system adding to the config object + options.monitor = rulesToMonitor(options.watch, options.ignore, config); + + var cwd = process.cwd(); + debug('config: dirs', config.dirs); + if (config.dirs.length === 0) { + config.dirs.unshift(cwd); + } + + bus.emit('config:update', config); + pinVersion().then(function () { + ready(config); + }).catch(e => { + // this doesn't help testing, but does give exposure on syntax errors + console.error(e.stack); + setTimeout(() => { throw e; }, 0); + }); + }); +}; + +config.reset = reset; + +module.exports = config; diff --git a/.pnpm-store/v10/files/06/168d57a372ad11f29a4197232990076760dbf77f0ff0fd8292190154b5e523eb7a2de328463c6cef5d9a68e0d2d5c85520c26f82cda502231260ea71a1f1b0 b/.pnpm-store/v10/files/06/168d57a372ad11f29a4197232990076760dbf77f0ff0fd8292190154b5e523eb7a2de328463c6cef5d9a68e0d2d5c85520c26f82cda502231260ea71a1f1b0 new file mode 100644 index 0000000..1434ade --- /dev/null +++ b/.pnpm-store/v10/files/06/168d57a372ad11f29a4197232990076760dbf77f0ff0fd8292190154b5e523eb7a2de328463c6cef5d9a68e0d2d5c85520c26f82cda502231260ea71a1f1b0 @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.pnpm-store/v10/files/06/b972e9b976bab5c87356fdabe7f2054d947a11c464415cdfb7e2e8a2456ca9534c4f1e5fcb9f016bd60a7798c71846b0431cd14def36e148548f95a6f65325 b/.pnpm-store/v10/files/06/b972e9b976bab5c87356fdabe7f2054d947a11c464415cdfb7e2e8a2456ca9534c4f1e5fcb9f016bd60a7798c71846b0431cd14def36e148548f95a6f65325 new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.pnpm-store/v10/files/06/b972e9b976bab5c87356fdabe7f2054d947a11c464415cdfb7e2e8a2456ca9534c4f1e5fcb9f016bd60a7798c71846b0431cd14def36e148548f95a6f65325 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.pnpm-store/v10/files/06/c7ffa1455c697026afd5a6b8d3808dad284287a69a3337213518d1486eff555b5f3e7b2c24ce15f3406565c81b995666aa1703d0df7ff52d7dcbbf32f65425 b/.pnpm-store/v10/files/06/c7ffa1455c697026afd5a6b8d3808dad284287a69a3337213518d1486eff555b5f3e7b2c24ce15f3406565c81b995666aa1703d0df7ff52d7dcbbf32f65425 new file mode 100644 index 0000000..2f6dab4 --- /dev/null +++ b/.pnpm-store/v10/files/06/c7ffa1455c697026afd5a6b8d3808dad284287a69a3337213518d1486eff555b5f3e7b2c24ce15f3406565c81b995666aa1703d0df7ff52d7dcbbf32f65425 @@ -0,0 +1,15 @@ +'use strict'; + +var bind = require('function-bind'); +var $TypeError = require('es-errors/type'); + +var $call = require('./functionCall'); +var $actualApply = require('./actualApply'); + +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +module.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== 'function') { + throw new $TypeError('a function is required'); + } + return $actualApply(bind, $call, args); +}; diff --git a/.pnpm-store/v10/files/07/444f23dc06b679535a0d86bdf2fd015979a20b9e4a847d873648e2041b80f62409b602f8da47c672f10baa11369cadc96daffa91b1e5b8a5f6eb01f46aa92c b/.pnpm-store/v10/files/07/444f23dc06b679535a0d86bdf2fd015979a20b9e4a847d873648e2041b80f62409b602f8da47c672f10baa11369cadc96daffa91b1e5b8a5f6eb01f46aa92c new file mode 100644 index 0000000..dc1074f --- /dev/null +++ b/.pnpm-store/v10/files/07/444f23dc06b679535a0d86bdf2fd015979a20b9e4a847d873648e2041b80f62409b602f8da47c672f10baa11369cadc96daffa91b1e5b8a5f6eb01f46aa92c @@ -0,0 +1,198 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, +}; + +//------------------------------------------------------------------------------ + +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; + +//------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require('string_decoder').StringDecoder; + +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); +} + +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } + + return this.decoder.write(buf); +} + +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} + + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} + +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} + +InternalEncoder.prototype.end = function() { +} + + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} + +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + + return Buffer.from(str, "base64"); +} + +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} + + +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8(options, codec) { +} + +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} + +InternalEncoderCesu8.prototype.end = function() { +} + +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} + +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} + +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} diff --git a/.pnpm-store/v10/files/07/519b85d985702822dcd5e0b6a113727bc53f95a33e98b0c5ae6ee140b1d19170b05855bc626ab0e2500c30351e560d404e1529e77568bf80ba59bbd4530c21 b/.pnpm-store/v10/files/07/519b85d985702822dcd5e0b6a113727bc53f95a33e98b0c5ae6ee140b1d19170b05855bc626ab0e2500c30351e560d404e1529e77568bf80ba59bbd4530c21 new file mode 100644 index 0000000..68d86ba --- /dev/null +++ b/.pnpm-store/v10/files/07/519b85d985702822dcd5e0b6a113727bc53f95a33e98b0c5ae6ee140b1d19170b05855bc626ab0e2500c30351e560d404e1529e77568bf80ba59bbd4530c21 @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + + +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object. (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + + +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + + +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + + +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + + +## FAQ + + +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + + +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/.pnpm-store/v10/files/07/84409b9f2eaa9177ea4ca5934f2a09c9c1d219674706e8754a9ffb97a554c063e9ebda4a5e56c842501e26c458331f7d3a83d4be583515cf90366997cb1f61 b/.pnpm-store/v10/files/07/84409b9f2eaa9177ea4ca5934f2a09c9c1d219674706e8754a9ffb97a554c063e9ebda4a5e56c842501e26c458331f7d3a83d4be583515cf90366997cb1f61 new file mode 100644 index 0000000..6fb7f2d --- /dev/null +++ b/.pnpm-store/v10/files/07/84409b9f2eaa9177ea4ca5934f2a09c9c1d219674706e8754a9ffb97a554c063e9ebda4a5e56c842501e26c458331f7d3a83d4be583515cf90366997cb1f61 @@ -0,0 +1,212 @@ +# negotiator + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +An HTTP content negotiator for Node.js + +## Installation + +```sh +$ npm install negotiator +``` + +## API + +```js +var Negotiator = require('negotiator') +``` + +### Accept Negotiation + +```js +availableMediaTypes = ['text/html', 'text/plain', 'application/json'] + +// The negotiator constructor receives a request object +negotiator = new Negotiator(request) + +// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' + +negotiator.mediaTypes() +// -> ['text/html', 'image/jpeg', 'application/*'] + +negotiator.mediaTypes(availableMediaTypes) +// -> ['text/html', 'application/json'] + +negotiator.mediaType(availableMediaTypes) +// -> 'text/html' +``` + +You can check a working example at `examples/accept.js`. + +#### Methods + +##### mediaType() + +Returns the most preferred media type from the client. + +##### mediaType(availableMediaType) + +Returns the most preferred media type from a list of available media types. + +##### mediaTypes() + +Returns an array of preferred media types ordered by the client preference. + +##### mediaTypes(availableMediaTypes) + +Returns an array of preferred media types ordered by priority from a list of +available media types. + +### Accept-Language Negotiation + +```js +negotiator = new Negotiator(request) + +availableLanguages = ['en', 'es', 'fr'] + +// Let's say Accept-Language header is 'en;q=0.8, es, pt' + +negotiator.languages() +// -> ['es', 'pt', 'en'] + +negotiator.languages(availableLanguages) +// -> ['es', 'en'] + +language = negotiator.language(availableLanguages) +// -> 'es' +``` + +You can check a working example at `examples/language.js`. + +#### Methods + +##### language() + +Returns the most preferred language from the client. + +##### language(availableLanguages) + +Returns the most preferred language from a list of available languages. + +##### languages() + +Returns an array of preferred languages ordered by the client preference. + +##### languages(availableLanguages) + +Returns an array of preferred languages ordered by priority from a list of +available languages. + +### Accept-Charset Negotiation + +```js +availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' + +negotiator.charsets() +// -> ['utf-8', 'iso-8859-1', 'utf-7'] + +negotiator.charsets(availableCharsets) +// -> ['utf-8', 'iso-8859-1'] + +negotiator.charset(availableCharsets) +// -> 'utf-8' +``` + +You can check a working example at `examples/charset.js`. + +#### Methods + +##### charset() + +Returns the most preferred charset from the client. + +##### charset(availableCharsets) + +Returns the most preferred charset from a list of available charsets. + +##### charsets() + +Returns an array of preferred charsets ordered by the client preference. + +##### charsets(availableCharsets) + +Returns an array of preferred charsets ordered by priority from a list of +available charsets. + +### Accept-Encoding Negotiation + +```js +availableEncodings = ['identity', 'gzip'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' + +negotiator.encodings() +// -> ['gzip', 'identity', 'compress'] + +negotiator.encodings(availableEncodings) +// -> ['gzip', 'identity'] + +negotiator.encoding(availableEncodings) +// -> 'gzip' +``` + +You can check a working example at `examples/encoding.js`. + +#### Methods + +##### encoding() + +Returns the most preferred encoding from the client. + +##### encoding(availableEncodings) + +Returns the most preferred encoding from a list of available encodings. + +##### encoding(availableEncodings, { preferred }) + +Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +##### encodings() + +Returns an array of preferred encodings ordered by the client preference. + +##### encodings(availableEncodings) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings. + +##### encodings(availableEncodings, { preferred }) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +## See Also + +The [accepts](https://npmjs.org/package/accepts#readme) module builds on +this module and provides an alternative interface, mime type validation, +and more. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/negotiator.svg +[npm-url]: https://npmjs.org/package/negotiator +[node-version-image]: https://img.shields.io/node/v/negotiator.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master +[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg +[downloads-url]: https://npmjs.org/package/negotiator +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml diff --git a/.pnpm-store/v10/files/07/e8b7cfabbfdf4d013a1c6f51ff7bf1f7cd6f7e88a41f87b156bc6da038536e273c7fe3f2f6b2f8a92803a4c6de16423f41ca3dda01978d0d37bc4bf448dded b/.pnpm-store/v10/files/07/e8b7cfabbfdf4d013a1c6f51ff7bf1f7cd6f7e88a41f87b156bc6da038536e273c7fe3f2f6b2f8a92803a4c6de16423f41ca3dda01978d0d37bc4bf448dded new file mode 100644 index 0000000..b92d46b --- /dev/null +++ b/.pnpm-store/v10/files/07/e8b7cfabbfdf4d013a1c6f51ff7bf1f7cd6f7e88a41f87b156bc6da038536e273c7fe3f2f6b2f8a92803a4c6de16423f41ca3dda01978d0d37bc4bf448dded @@ -0,0 +1,3 @@ +declare const MAX_ARRAY_LENGTH: 4294967295; + +export = MAX_ARRAY_LENGTH; \ No newline at end of file diff --git a/.pnpm-store/v10/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 b/.pnpm-store/v10/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 new file mode 100644 index 0000000..b8fe1db --- /dev/null +++ b/.pnpm-store/v10/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/.pnpm-store/v10/files/08/a003c4d1eb83895c2971a79fee09ee5d2a37cd0aa48fab23da6c254eb4f0df02122b93693ef723cde0608ce501342f9ff8c1158bce99afbaa25209665c9001 b/.pnpm-store/v10/files/08/a003c4d1eb83895c2971a79fee09ee5d2a37cd0aa48fab23da6c254eb4f0df02122b93693ef723cde0608ce501342f9ff8c1158bce99afbaa25209665c9001 new file mode 100644 index 0000000..94a44a8 --- /dev/null +++ b/.pnpm-store/v10/files/08/a003c4d1eb83895c2971a79fee09ee5d2a37cd0aa48fab23da6c254eb4f0df02122b93693ef723cde0608ce501342f9ff8c1158bce99afbaa25209665c9001 @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/gopd +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.pnpm-store/v10/files/08/ddb34cdcca7aa8c7a0e0bfb820e70712d9552d3aa5e8adf6d252ff5b34736011e89d158d87ad27784eb60b5d798d3364d5342ae6fdfe3359cc71b7dab746a1 b/.pnpm-store/v10/files/08/ddb34cdcca7aa8c7a0e0bfb820e70712d9552d3aa5e8adf6d252ff5b34736011e89d158d87ad27784eb60b5d798d3364d5342ae6fdfe3359cc71b7dab746a1 new file mode 100644 index 0000000..a0f9698 --- /dev/null +++ b/.pnpm-store/v10/files/08/ddb34cdcca7aa8c7a0e0bfb820e70712d9552d3aa5e8adf6d252ff5b34736011e89d158d87ad27784eb60b5d798d3364d5342ae6fdfe3359cc71b7dab746a1 @@ -0,0 +1,216 @@ +# Path-to-RegExp + +> Turn a path string such as `/user/:name` into a regular expression. + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +## Installation + +``` +npm install path-to-regexp --save +``` + +## Usage + +```js +const { + match, + pathToRegexp, + compile, + parse, + stringify, +} = require("path-to-regexp"); +``` + +### Parameters + +Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`). + +```js +const fn = match("/:foo/:bar"); + +fn("/test/route"); +//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } } +``` + +### Wildcard + +Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`). + +```js +const fn = match("/*splat"); + +fn("/bar/baz"); +//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } } +``` + +### Optional + +Braces can be used to define parts of the path that are optional. + +```js +const fn = match("/users{/:id}/delete"); + +fn("/users/delete"); +//=> { path: '/users/delete', params: {} } + +fn("/users/123/delete"); +//=> { path: '/users/123/delete', params: { id: '123' } } +``` + +## Match + +The `match` function returns a function for matching strings against a path: + +- **path** String or array of strings. +- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options) + - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`) + +```js +const fn = match("/foo/:bar"); +``` + +**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). + +## PathToRegexp + +The `pathToRegexp` function returns a regular expression for matching strings against paths. It + +- **path** String or array of strings. +- **options** _(optional)_ (See [parse](#parse) for more options) + - **sensitive** Regexp will be case sensitive. (default: `false`) + - **end** Validate the match reaches the end of the string. (default: `true`) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **trailing** Allows optional trailing delimiter to match. (default: `true`) + +```js +const { regexp, keys } = pathToRegexp("/foo/:bar"); +``` + +## Compile ("Reverse" Path-To-RegExp) + +The `compile` function will return a function for transforming parameters into a valid path: + +- **path** A string. +- **options** (See [parse](#parse) for more options) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) + +```js +const toPath = compile("/user/:id"); + +toPath({ id: "name" }); //=> "/user/name" +toPath({ id: "café" }); //=> "/user/caf%C3%A9" + +const toPathRepeated = compile("/*segment"); + +toPathRepeated({ segment: ["foo"] }); //=> "/foo" +toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" + +// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted. +const toPathRaw = compile("/user/:id", { encode: false }); + +toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" +``` + +## Stringify + +Transform `TokenData` (a sequence of tokens) back into a Path-to-RegExp string. + +- **data** A `TokenData` instance + +```js +const data = new TokenData([ + { type: "text", value: "/" }, + { type: "param", name: "foo" }, +]); + +const path = stringify(data); //=> "/:foo" +``` + +## Developers + +- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around. +- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`. + +### Parse + +The `parse` function accepts a string and returns `TokenData`, the set of tokens and other metadata parsed from the input string. `TokenData` is can used with `match` and `compile`. + +- **path** A string. +- **options** _(optional)_ + - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl)) + +### Tokens + +`TokenData` is a sequence of tokens, currently of types `text`, `parameter`, `wildcard`, or `group`. + +### Custom path + +In some applications, you may not be able to use the `path-to-regexp` syntax, but still want to use this library for `match` and `compile`. For example: + +```js +import { TokenData, match } from "path-to-regexp"; + +const tokens = [ + { type: "text", value: "/" }, + { type: "parameter", name: "foo" }, +]; +const path = new TokenData(tokens); +const fn = match(path); + +fn("/test"); //=> { path: '/test', index: 0, params: { foo: 'test' } } +``` + +## Errors + +An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before. + +### Unexpected `?` or `+` + +In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these: + +- For optional (`?`), use an empty segment in a group such as `/:file{.:ext}`. +- For repeating (`+`), only wildcard matching is supported, such as `/*path`. +- For optional repeating (`*`), use a group and a wildcard parameter such as `/files{/*path}`. + +### Unexpected `(`, `)`, `[`, `]`, etc. + +Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To use these characters literally, escape them with a backslash, e.g. `"\\("`. + +### Missing parameter name + +Parameter names must be provided after `:` or `*`, and they must be a valid JavaScript identifier. If you want an parameter name that isn't a JavaScript identifier, such as starting with a number, you can wrap the name in quotes like `:"my-name"`. + +### Unterminated quote + +Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. + +### Express <= 4.x + +Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways: + +- The wildcard `*` must have a name, matching the behavior of parameters `:`. +- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`. +- Regexp characters are not supported. +- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`). +- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`. + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/path-to-regexp +[npm-url]: https://npmjs.org/package/path-to-regexp +[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp +[downloads-url]: https://npmjs.org/package/path-to-regexp +[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master +[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp +[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp +[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat +[license-url]: LICENSE.md diff --git a/.pnpm-store/v10/files/08/dedf219f0012b61667352b0d131ad45ad4fd19b3fbebd764ec9ca330b8124f2dd7e3e52e648904721d85b1f513d64aaf972d90fbbb52a9a4433154f2cb8ff8 b/.pnpm-store/v10/files/08/dedf219f0012b61667352b0d131ad45ad4fd19b3fbebd764ec9ca330b8124f2dd7e3e52e648904721d85b1f513d64aaf972d90fbbb52a9a4433154f2cb8ff8 new file mode 100644 index 0000000..9d16393 --- /dev/null +++ b/.pnpm-store/v10/files/08/dedf219f0012b61667352b0d131ad45ad4fd19b3fbebd764ec9ca330b8124f2dd7e3e52e648904721d85b1f513d64aaf972d90fbbb52a9a4433154f2cb8ff8 @@ -0,0 +1,36 @@ +var za=Object.defineProperty;var Us=e=>{throw TypeError(e)};var xr=(e,t)=>{for(var r in t)za(e,r,{get:t[r],enumerable:!0})};var Xs=(e,t,r)=>t.has(e)||Us("Cannot "+r);var mt=(e,t,r)=>(Xs(e,t,"read from private field"),r?r.call(e):t.get(e)),Ys=(e,t,r)=>t.has(e)?Us("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Hs=(e,t,r,n)=>(Xs(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Rs={};xr(Rs,{languages:()=>Tm,options:()=>Ha,printers:()=>dm});var Vs=[{name:"JavaScript",type:"programming",extensions:[".js","._js",".bones",".cjs",".es",".es6",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".start.frag",".end.frag",".wxs"],tmScope:"source.js",aceMode:"javascript",aliases:["js","node"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],filenames:["Jakefile","start.frag","end.frag"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"],linguistLanguageId:183},{name:"Flow",type:"programming",extensions:[".js.flow"],tmScope:"source.js",aceMode:"javascript",aliases:[],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],filenames:[],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"],linguistLanguageId:183},{name:"JSX",type:"programming",extensions:[".jsx"],tmScope:"source.js.jsx",aceMode:"javascript",aliases:void 0,codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",interpreters:void 0,filenames:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript",linguistLanguageId:183},{name:"TypeScript",type:"programming",extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",aliases:["ts"],codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",interpreters:["bun","deno","ts-node","tsx"],parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"],linguistLanguageId:378},{name:"TSX",type:"programming",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",group:"TypeScript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"],linguistLanguageId:94901924}];var vs={};xr(vs,{canAttachComment:()=>kp,embed:()=>oi,experimentalFeatures:()=>fm,getCommentChildNodes:()=>Ip,getVisitorKeys:()=>br,handleComments:()=>ts,insertPragma:()=>di,isBlockComment:()=>te,isGap:()=>Lp,massageAstNode:()=>Bu,print:()=>Ga,printComment:()=>ju,willPrintOwnComments:()=>rs});var Za=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},X=Za;var eo=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},v=eo;function to(e){return e!==null&&typeof e=="object"}var $s=to;function*ro(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,s=u=>$s(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*no(e,t){let r=[e];for(let n=0;n/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function zs(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Zs(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var eu=e=>!(zs(e)||Zs(e));var so=/[^\x20-\x7F]/u;function uo(e){if(!e)return 0;if(!so.test(e))return e.length;e=e.replace(Qs()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=eu(n)?1:2)}return t}var st=uo;function hr(e){return(t,r,n)=>{let s=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t,i=r;for(;i>=0&&i0}var O=lo;var nu=new Proxy(()=>{},{get:()=>nu}),jt=nu;var gr="'",su='"';function mo(e,t){let r=t===!0||t===gr?gr:su,n=r===gr?su:gr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var Sr=mo;function yo(e,t,r){let n=t==='"'?"'":'"',u=X(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var uu=yo;function fo(e,t){jt.ok(/^(?["']).*\k$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Sr(r,t.singleQuote);return e.charAt(0)===n?e:uu(r,n,!1)}var ut=fo;var iu=e=>Number.isInteger(e)&&e>=0;function j(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(j(r),t):t}function P(e){var r;return((r=e.range)==null?void 0:r[1])??e.end}function Bt(e,t){let r=j(e);return iu(r)&&r===j(t)}function Do(e,t){let r=P(e);return iu(r)&&r===P(t)}function au(e,t){return Bt(e,t)&&Do(e,t)}var rr=null;function nr(e){if(rr!==null&&typeof rr.property){let t=rr;return rr=nr.prototype=null,t}return rr=nr.prototype=e??Object.create(null),new nr}var Eo=10;for(let e=0;e<=Eo;e++)nr();function On(e){return nr(e)}function Fo(e,t="type"){On(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var Br=Fo;var ou={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]};var Co=Br(ou),br=Co;function Ao(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=Ao;function To(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}var ae=To;var xo=R(["Block","CommentBlock","MultiLine"]),te=xo;var ho=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Pr=ho;var go=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),At=go;function So(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Bo(e,t){return t.some(r=>So(e,r))}var pu=Bo;function bo({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var kr=bo;function ur(e,t){return t(e)||Ks(e,{getVisitorKeys:br,predicate:t})}function Jt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||w(e)||G(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||xe(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function mu(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Lr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var yu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),U=R(["ArrayExpression"]),ue=R(["ObjectExpression"]);function fu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function ye(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Du(e){return e.type==="BooleanLiteral"||e.type==="Literal"&&typeof e.value=="boolean"}function Rn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&ye(e.argument)}function K(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Jn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var wr=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Po=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Re=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Rt=R(["FunctionExpression","ArrowFunctionExpression"]);function ko(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function _n(e){return w(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var Y=R(["JSXElement","JSXFragment"]);function bt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Or(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function Eu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!Bt(e,e.typeAnnotation)}var Fe=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function dt(e){return G(e)||e.type==="BindExpression"&&!!e.object}var Io=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function Nt(e){return kr(e)||Pr(e)||Io(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function Lo(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var wo=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function Oo(e){return pu(e,wo)}function Pt(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=le(e);if(r.length===1){if(_n(e)&&Pt(t))return Rt(r[0]);if(Lo(e.callee))return _n(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||K(r[0]))&&Oo(e.callee))return r[2]&&!ye(r[2])?!1:(r.length===2?Rt(r[1]):ko(r[1])&&Q(r[1]).length<=1)||_n(r[1]);return!1}var Fu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),w=Fu(R(["CallExpression","OptionalCallExpression"])),G=Fu(R(["MemberExpression","OptionalMemberExpression"]));function Nn(e,t=5){return Cu(e,t)<=t}function Cu(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=Cu(s,t-r)),r>t)return r}return r}var _o=.25;function ir(e,t){let{printWidth:r}=t;if(d(e))return!1;let n=r*_o;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||Rn(e)&&!d(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:K(e)?ut(ae(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(` +`):e.type==="UnaryExpression"?ir(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:wr(e)}function de(e,t){return Y(t)?kt(t):d(t,h.Leading,r=>ee(e,P(r)))}function cu(e){return e.quasis.some(t=>t.value.raw.includes(` +`))}function _r(e,t){return(e.type==="TemplateLiteral"&&cu(e)||e.type==="TaggedTemplateExpression"&&cu(e.quasi))&&!ee(t,j(e),{backwards:!0})}function Mr(e){if(!d(e))return!1;let t=v(!1,Ve(e,h.Dangling),-1);return t&&!te(t)}function Au(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Rt(r)){if(t+=1,t>1)return!0}else if(w(r)){for(let n of le(r))if(Rt(n))return!0}return!1}function vr(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&w(t)&&w(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var Mo=new Set(["!","-","+","~"]);function we(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return we(e.expression,t);let r=n=>we(n,t-1);if(Jn(e))return st(e.pattern??e.regex.pattern)<=5;if(wr(e)||Po(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(` +`))&&e.expressions.every(r);if(ue(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(U(e))return e.elements.every(n=>n===null||r(n));if(yt(e)){if(e.type==="ImportExpression"||we(e.callee,t)){let n=le(e);return n.length<=t&&n.every(r)}return!1}return G(e)?we(e.object,t)&&we(e.property,t):e.type==="UnaryExpression"&&Mo.has(e.operator)||e.type==="UpdateExpression"?we(e.argument,t):!1}function du(e){return e}function ce(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function pe(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return pe(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return pe(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:pe(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:pe(e.callee,t);case"ConditionalExpression":return pe(e.test,t);case"UpdateExpression":return!e.prefix&&pe(e.argument,t);case"BindExpression":return e.object&&pe(e.object,t);case"SequenceExpression":return pe(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return pe(e.expression,t);default:return t(e)}}var lu={"==":!0,"!=":!0,"===":!0,"!==":!0},Ir={"*":!0,"/":!0,"%":!0},jn={">>":!0,">>>":!0,"<<":!0};function ar(e,t){return!(sr(t)!==sr(e)||e==="**"||lu[e]&&lu[t]||t==="%"&&Ir[e]||e==="%"&&Ir[t]||t!==e&&Ir[t]&&Ir[e]||jn[e]&&jn[t])}var vo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function sr(e){return vo.get(e)}function Tu(e){return!!jn[e]||e==="|"||e==="^"||e==="&"}function xu(e){var r;if(e.rest)return!0;let t=Q(e);return((r=v(!1,t,-1))==null?void 0:r.type)==="RestElement"}var Mn=new WeakMap;function Q(e){if(Mn.has(e))return Mn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),Mn.set(e,t),t}function hu(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var vn=new WeakMap;function le(e){if(vn.has(e))return vn.get(e);if(e.type==="ChainExpression")return le(e.expression);let t=e.arguments;return(e.type==="ImportExpression"||e.type==="TSImportType")&&(t=[e.type==="ImportExpression"?e.source:e.argument],e.options&&t.push(e.options)),vn.set(e,t),t}function Gt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>Gt(e,t),"expression");r.type==="ImportExpression"||r.type==="TSImportType"?(e.call(n=>t(n,0),r.type==="ImportExpression"?"source":"argument"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Gn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"||e.type==="TSImportType"){if(t===0||t===(e.options?-2:-1))return[...r,e.type==="ImportExpression"?"source":"argument"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function or(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function kt(e){return(e==null?void 0:e.prettierIgnore)||d(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},gu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!te(r)||e&h.Line&&!At(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!or(r)||t&&!t(r))};function d(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=gu(t,r);return n?e.comments.some(n):!0}function Ve(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[];let n=gu(t,r);return n?e.comments.filter(n):e.comments}var me=(e,{originalText:t})=>vt(t,P(e));function yt(e){return w(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function Te(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!bt(e))}var xe=R(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),Oe=R(["TSUnionType","UnionTypeAnnotation"]),qt=R(["TSIntersectionType","IntersectionTypeAnnotation"]),Je=R(["TSConditionalType","ConditionalTypeAnnotation"]);var jo=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Wt=e=>{for(let t of e.quasis)delete t.value};function Su(e,t){var n;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:s}=e;K(s)||ye(s)?t.key=String(s.value):s.type==="Identifier"&&(t.key=s.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(s=>s.type==="JSXAttribute"&&s.name.name==="jsx"))for(let{type:s,expression:u}of t.children)s==="JSXExpressionContainer"&&u.type==="TemplateLiteral"&&Wt(u);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&Wt(t.value.expression),e.type==="JSXAttribute"&&((n=e.value)==null?void 0:n.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=X(!1,e.value.value,/["']|"|'/gu,'"'));let r=e.expression||e.callee;if(e.type==="Decorator"&&r.type==="CallExpression"&&r.callee.name==="Component"&&r.arguments.length===1){let s=e.expression.arguments[0].properties;for(let[u,i]of t.expression.arguments[0].properties.entries())switch(s[u].key.name){case"styles":U(i.value)&&Wt(i.value.elements[0]);break;case"template":i.value.type==="TemplateLiteral"&&Wt(i.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&Wt(t.quasi),e.type==="TemplateLiteral"&&Wt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression")}Su.ignoredProperties=jo;var Bu=Su;var Ne="string",ge="array",it="cursor",$e="indent",Ke="align",Qe="trim",fe="group",_e="fill",he="if-break",ze="indent-if-break",Ze="line-suffix",Ge="line-suffix-boundary",oe="line",Se="label",Me="break-parent",jr=new Set([it,$e,Ke,Qe,fe,_e,he,ze,Ze,Ge,oe,Se,Me]);function Ro(e){if(typeof e=="string")return Ne;if(Array.isArray(e))return ge;if(!e)return;let{type:t}=e;if(jr.has(t))return t}var Be=Ro;var Jo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function No(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(Be(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Jo([...jr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${n}.`}var qn=class extends Error{name="InvalidDocError";constructor(t){super(No(t)),this.doc=t}},Tt=qn;var bu={};function Go(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===bu){r(s.pop());continue}r&&s.push(u,bu);let i=Be(u);if(!i)throw new Tt(u);if((t==null?void 0:t(u))!==!1)switch(i){case ge:case _e:{let a=i===ge?u:u.parts;for(let o=a.length,p=o-1;p>=0;--p)s.push(a[p]);break}case he:s.push(u.flatContents,u.breakContents);break;case fe:if(n&&u.expandedStates)for(let a=u.expandedStates.length,o=a-1;o>=0;--o)s.push(u.expandedStates[o]);else s.push(u.contents);break;case Ke:case $e:case ze:case Se:case Ze:s.push(u.contents);break;case Ne:case it:case Qe:case Ge:case oe:case Me:break;default:throw new Tt(u)}}}var pr=Go;function ft(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(Be(u)){case ge:return t(u.map(n));case _e:return t({...u,parts:u.parts.map(n)});case he:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case fe:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case Ke:case $e:case ze:case Se:case Ze:return t({...u,contents:n(u.contents)});case Ne:case it:case Qe:case Ge:case oe:case Me:return t(u);default:throw new Tt(u)}}}function ku(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return pr(e,u),n}function qo(e){if(e.type===fe&&e.break||e.type===oe&&e.hard||e.type===Me)return!0}function re(e){return ku(e,qo,!1)}function Pu(e){if(e.length>0){let t=v(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Iu(e){let t=new Set,r=[];function n(u){if(u.type===Me&&Pu(r),u.type===fe){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===fe&&r.pop().break&&Pu(r)}pr(e,n,s,!0)}function Wo(e){return e.type===oe&&!e.hard?e.soft?"":" ":e.type===he?e.flatContents:e}function cr(e){return ft(e,Wo)}function Uo(e){switch(Be(e)){case _e:if(e.parts.every(t=>t===""))return"";break;case fe:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===fe&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case Ke:case $e:case ze:case Ze:if(!e.contents)return"";break;case he:if(!e.flatContents&&!e.breakContents)return"";break;case ge:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof v(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case Ne:case it:case Qe:case Ge:case oe:case Se:case Me:break;default:throw new Tt(e)}return e}function Ut(e){return ft(e,t=>Uo(t))}function ve(e,t=Rr){return ft(e,r=>typeof r=="string"?b(t,r.split(` +`)):r)}function Xo(e){if(e.type===oe)return!0}function Lu(e){return ku(e,Xo,!1)}function lr(e,t){return e.type===Se?{...e,contents:t(e.contents)}:t(e)}function wu(e){let t=!0;return pr(e,r=>{switch(Be(r)){case Ne:if(r==="")break;case Qe:case Ge:case oe:case Me:return t=!1,!1}}),t}var Wn=()=>{},et=Wn,Un=Wn,Ou=Wn;function D(e){return et(e),{type:$e,contents:e}}function be(e,t){return et(t),{type:Ke,contents:t,n:e}}function l(e,t={}){return et(e),Un(t.expandedStates,!0),{type:fe,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function _u(e){return be(Number.NEGATIVE_INFINITY,e)}function Jr(e){return be(-1,e)}function tt(e,t){return l(e[0],{...t,expandedStates:e})}function Nr(e){return Ou(e),{type:_e,parts:e}}function S(e,t="",r={}){return et(e),t!==""&&et(t),{type:he,breakContents:e,flatContents:t,groupId:r.groupId}}function xt(e,t){return et(e),{type:ze,contents:e,groupId:t.groupId,negate:t.negate}}function Xn(e){return et(e),{type:Ze,contents:e}}var je={type:Ge},Ce={type:Me};var Yn={type:oe,hard:!0},Yo={type:oe,hard:!0,literal:!0},x={type:oe},E={type:oe,soft:!0},F=[Yn,Ce],Rr=[Yo,Ce],mr={type:it};function b(e,t){et(e),Un(t);let r=[];for(let n=0;n0){for(let s=0;s1&&t.every(r=>r.trimStart()[0]==="*")}var Hn=new WeakMap;function Vo(e){return Hn.has(e)||Hn.set(e,Ho(e)),Hn.get(e)}var vu=Vo;function ju(e,t){let r=e.node;if(At(r))return t.originalText.slice(j(r),P(r)).trimEnd();if(vu(r))return $o(r);if(te(r))return["/*",ve(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function $o(e){let t=e.value.split(` +`);return["/*",b(F,t.map((r,n)=>n===0?r.trimEnd():" "+(nrp,ownLine:()=>tp,remaining:()=>np});function Ko(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Vn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Ko(e)}function De(e,t){t.leading=!0,t.trailing=!1,Vn(e,t)}function Pe(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Vn(e,t)}function z(e,t){t.leading=!1,t.trailing=!0,Vn(e,t)}function Qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=Ye(e,n),n=_t(e,n),n=Mt(e,n),n=He(e,n);return n}var ot=Qo;function zo(e,t){let r=ot(e,t);return r===!1?"":e.charAt(r)}var ke=zo;function Zo(e,t,r){for(let n=t;nAt(e)||!ie(t,j(e),P(e));function tp(e){return[Yu,Nu,Wu,fp,up,Qn,zn,Ju,Gu,Cp,Ep,es,Xu,Ap,qu,Uu,Zn,ip,Bp,Hu].some(t=>t(e))}function rp(e){return[sp,Wu,Nu,Xu,Qn,zn,Ju,Gu,Uu,Dp,Fp,es,xp,Zn,gp,Sp,bp,Hu].some(t=>t(e))}function np(e){return[Yu,Qn,zn,ap,yp,qu,es,mp,lp,Zn,hp].some(t=>t(e))}function It(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?De(r,t):Pe(e,t)}function Kn(e,t){e.type==="BlockStatement"?It(e,t):De(e,t)}function sp({comment:e,followingNode:t}){return t&&Gr(e)?(De(t,e),!0):!1}function Qn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(ke(s,P(e))===")")return z(t,e),!0;if(t===r.consequent&&n===r.alternate){let i=ot(s,P(r.consequent));if(j(e)"?(Pe(t,e),!0):!1}function yp({comment:e,enclosingNode:t,text:r}){return ke(r,P(e))!==")"?!1:t&&(Vu(t)&&Q(t).length===0||yt(t)&&le(t).length===0)?(Pe(t,e),!0):((t==null?void 0:t.type)==="MethodDefinition"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&Q(t.value).length===0?(Pe(t.value,e),!0):!1}function fp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="ComponentTypeParameter"&&((r==null?void 0:r.type)==="DeclareComponent"||(r==null?void 0:r.type)==="ComponentTypeAnnotation")&&(n==null?void 0:n.type)!=="ComponentTypeParameter"?(z(t,e),!0):((t==null?void 0:t.type)==="ComponentParameter"||(t==null?void 0:t.type)==="RestElement")&&(r==null?void 0:r.type)==="ComponentDeclaration"&&ke(s,P(e))===")"?(z(t,e),!0):!1}function Wu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(t==null?void 0:t.type)==="FunctionTypeParam"&&(r==null?void 0:r.type)==="FunctionTypeAnnotation"&&(n==null?void 0:n.type)!=="FunctionTypeParam"?(z(t,e),!0):((t==null?void 0:t.type)==="Identifier"||(t==null?void 0:t.type)==="AssignmentPattern"||(t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern"||(t==null?void 0:t.type)==="RestElement"||(t==null?void 0:t.type)==="TSParameterProperty")&&Vu(r)&&ke(s,P(e))===")"?(z(t,e),!0):!te(e)&&((r==null?void 0:r.type)==="FunctionDeclaration"||(r==null?void 0:r.type)==="FunctionExpression"||(r==null?void 0:r.type)==="ObjectMethod")&&(n==null?void 0:n.type)==="BlockStatement"&&r.body===n&&ot(s,P(e))===j(n)?(It(n,e),!0):!1}function Uu({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="LabeledStatement"?(De(t,e),!0):!1}function Zn({comment:e,enclosingNode:t}){return((t==null?void 0:t.type)==="ContinueStatement"||(t==null?void 0:t.type)==="BreakStatement")&&!t.label?(z(t,e),!0):!1}function Dp({comment:e,precedingNode:t,enclosingNode:r}){return w(r)&&t&&r.callee===t&&r.arguments.length>0?(De(r.arguments[0],e),!0):!1}function Ep({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return Oe(r)?(or(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(z(t,e),!0):!1):(Oe(n)&&or(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function Fp({comment:e,enclosingNode:t}){return Te(t)?(De(t,e),!0):!1}function es({comment:e,enclosingNode:t,ast:r,isLastComment:n}){var s;return((s=r==null?void 0:r.body)==null?void 0:s.length)===0?(n?Pe(r,e):De(r,e),!0):(t==null?void 0:t.type)==="Program"&&t.body.length===0&&!O(t.directives)?(n?Pe(t,e):De(t,e),!0):!1}function Cp({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="ForInStatement"||(t==null?void 0:t.type)==="ForOfStatement"?(De(t,e),!0):!1}function Xu({comment:e,precedingNode:t,enclosingNode:r,text:n}){if((r==null?void 0:r.type)==="ImportSpecifier"||(r==null?void 0:r.type)==="ExportSpecifier")return De(r,e),!0;let s=(t==null?void 0:t.type)==="ImportSpecifier"&&(r==null?void 0:r.type)==="ImportDeclaration",u=(t==null?void 0:t.type)==="ExportSpecifier"&&(r==null?void 0:r.type)==="ExportNamedDeclaration";return(s||u)&&ee(n,P(e))?(z(t,e),!0):!1}function Ap({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="AssignmentPattern"?(De(t,e),!0):!1}var dp=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),Tp=new Set(["ObjectExpression","ArrayExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function xp({comment:e,enclosingNode:t,followingNode:r}){return dp.has(t==null?void 0:t.type)&&r&&(Tp.has(r.type)||te(e))?(De(r,e),!0):!1}function hp({comment:e,enclosingNode:t,followingNode:r,text:n}){return!r&&((t==null?void 0:t.type)==="TSMethodSignature"||(t==null?void 0:t.type)==="TSDeclareFunction"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&ke(n,P(e))===";"?(z(t,e),!0):!1}function Yu({comment:e,enclosingNode:t,followingNode:r}){if(or(e)&&(t==null?void 0:t.type)==="TSMappedType"&&r===t.key)return t.prettierIgnore=!0,e.unignore=!0,!0}function Hu({comment:e,precedingNode:t,enclosingNode:r}){if((r==null?void 0:r.type)==="TSMappedType"&&!t)return Pe(r,e),!0}function gp({comment:e,enclosingNode:t,followingNode:r}){return!t||t.type!=="SwitchCase"||t.test||!r||r!==t.consequent[0]?!1:(r.type==="BlockStatement"&&At(e)?It(r,e):Pe(t,e),!0)}function Sp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return Oe(t)&&((r.type==="TSArrayType"||r.type==="ArrayTypeAnnotation")&&!n||qt(r))?(z(v(!1,t.types,-1),e),!0):!1}function Bp({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if(((t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern")&&(n==null?void 0:n.type)==="TSTypeAnnotation")return r?z(r,e):Pe(t,e),!0}function bp({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return!n&&(r==null?void 0:r.type)==="UnaryExpression"&&((t==null?void 0:t.type)==="LogicalExpression"||(t==null?void 0:t.type)==="BinaryExpression")&&ie(s,j(r.argument),j(t.right))&&Ru(e,s)&&!ie(s,j(t.right),j(e))?(z(t.right,e),!0):!1}var Vu=R(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]);var Pp=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function kp(e){return!Pp.has(e.type)}function Ip(e,t){var r;if((t.parser==="typescript"||t.parser==="flow"||t.parser==="hermes"||t.parser==="acorn"||t.parser==="oxc"||t.parser==="oxc-ts"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree")&&e.type==="MethodDefinition"&&((r=e.value)==null?void 0:r.type)==="FunctionExpression"&&Q(e.value).length===0&&!e.value.returnType&&!O(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function rs(e){let{node:t,parent:r}=e;return(Y(t)||r&&(r.type==="JSXSpreadAttribute"||r.type==="JSXSpreadChild"||Oe(r)||(r.type==="ClassDeclaration"||r.type==="ClassExpression")&&r.superClass===t))&&(!kt(t)||Oe(r))}function Lp(e,{parser:t}){if(t==="flow"||t==="hermes"||t==="babel-flow")return e=X(!1,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function $u(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var Ie=Symbol("MODE_BREAK"),pt=Symbol("MODE_FLAT"),Xt=Symbol("cursor"),ns=Symbol("DOC_FILL_PRINTED_LENGTH");function Ku(){return{value:"",length:0,queue:[]}}function wp(e,t){return ss(e,{type:"indent"},t)}function Op(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Ku():t<0?ss(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:ss(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function ss(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let c of n)switch(c.type){case"indent":m(),r.useTabs?o(1):p(r.tabWidth);break;case"stringAlign":m(),s+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,a+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return y(),{...e,value:s,length:u,queue:n};function o(c){s+=" ".repeat(c),u+=r.tabWidth*c}function p(c){s+=" ".repeat(c),u+=c}function m(){r.useTabs?f():y()}function f(){i>0&&o(i),C()}function y(){a>0&&p(a),C()}function C(){i=0,a=0}}function us(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===Xt){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Xt);return t}function qr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],o=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:p,doc:m}=a.pop(),f=Be(m);switch(f){case Ne:o.push(m),r-=st(m);break;case ge:case _e:{let y=f===ge?m:m.parts,C=m[ns]??0;for(let c=y.length-1;c>=C;c--)a.push({mode:p,doc:y[c]});break}case $e:case Ke:case ze:case Se:a.push({mode:p,doc:m.contents});break;case Qe:r+=us(o);break;case fe:{if(u&&m.break)return!1;let y=m.break?Ie:p,C=m.expandedStates&&y===Ie?v(!1,m.expandedStates,-1):m.contents;a.push({mode:y,doc:C});break}case he:{let C=(m.groupId?s[m.groupId]||pt:p)===Ie?m.breakContents:m.flatContents;C&&a.push({mode:p,doc:C});break}case oe:if(p===Ie||m.hard)return!0;m.soft||(o.push(" "),r--);break;case Ze:n=!0;break;case Ge:if(n)return!1;break}}return!1}function is(e,t){let r={},n=t.printWidth,s=$u(t.endOfLine),u=0,i=[{ind:Ku(),mode:Ie,doc:e}],a=[],o=!1,p=[],m=0;for(Iu(e);i.length>0;){let{ind:y,mode:C,doc:c}=i.pop();switch(Be(c)){case Ne:{let A=s!==` +`?X(!1,c,` +`,s):c;a.push(A),i.length>0&&(u+=st(A));break}case ge:for(let A=c.length-1;A>=0;A--)i.push({ind:y,mode:C,doc:c[A]});break;case it:if(m>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Xt),m++;break;case $e:i.push({ind:wp(y,t),mode:C,doc:c.contents});break;case Ke:i.push({ind:Op(y,c.n,t),mode:C,doc:c.contents});break;case Qe:u-=us(a);break;case fe:switch(C){case pt:if(!o){i.push({ind:y,mode:c.break?Ie:pt,doc:c.contents});break}case Ie:{o=!1;let A={ind:y,mode:pt,doc:c.contents},T=n-u,B=p.length>0;if(!c.break&&qr(A,i,T,B,r))i.push(A);else if(c.expandedStates){let g=v(!1,c.expandedStates,-1);if(c.break){i.push({ind:y,mode:Ie,doc:g});break}else for(let _=1;_=c.expandedStates.length){i.push({ind:y,mode:Ie,doc:g});break}else{let M=c.expandedStates[_],J={ind:y,mode:pt,doc:M};if(qr(J,i,T,B,r)){i.push(J);break}}}else i.push({ind:y,mode:Ie,doc:c.contents});break}}c.id&&(r[c.id]=v(!1,i,-1).mode);break;case _e:{let A=n-u,T=c[ns]??0,{parts:B}=c,g=B.length-T;if(g===0)break;let _=B[T+0],M=B[T+1],J={ind:y,mode:pt,doc:_},I={ind:y,mode:Ie,doc:_},q=qr(J,[],A,p.length>0,r,!0);if(g===1){q?i.push(J):i.push(I);break}let k={ind:y,mode:pt,doc:M},W={ind:y,mode:Ie,doc:M};if(g===2){q?i.push(k,J):i.push(W,I);break}let ne=B[T+2],Z={ind:y,mode:C,doc:{...c,[ns]:T+2}};qr({ind:y,mode:pt,doc:[_,M,ne]},[],A,p.length>0,r,!0)?i.push(Z,k,J):q?i.push(Z,W,J):i.push(Z,W,I);break}case he:case ze:{let A=c.groupId?r[c.groupId]:C;if(A===Ie){let T=c.type===he?c.breakContents:c.negate?c.contents:D(c.contents);T&&i.push({ind:y,mode:C,doc:T})}if(A===pt){let T=c.type===he?c.flatContents:c.negate?D(c.contents):c.contents;T&&i.push({ind:y,mode:C,doc:T})}break}case Ze:p.push({ind:y,mode:C,doc:c.contents});break;case Ge:p.length>0&&i.push({ind:y,mode:C,doc:Yn});break;case oe:switch(C){case pt:if(c.hard)o=!0;else{c.soft||(a.push(" "),u+=1);break}case Ie:if(p.length>0){i.push({ind:y,mode:C,doc:c},...p.reverse()),p.length=0;break}c.literal?y.root?(a.push(s,y.root.value),u=y.root.length):(a.push(s),u=0):(u-=us(a),a.push(s+y.value),u=y.length);break}break;case Se:i.push({ind:y,mode:C,doc:c.contents});break;case Me:break;default:throw new Tt(c)}i.length===0&&p.length>0&&(i.push(...p.reverse()),p.length=0)}let f=a.indexOf(Xt);if(f!==-1){let y=a.indexOf(Xt,f+1);if(y===-1)return{formatted:a.filter(T=>T!==Xt).join("")};let C=a.slice(0,f).join(""),c=a.slice(f+1,y).join(""),A=a.slice(y+1).join("");return{formatted:C+c+A,cursorNodeStart:C.length,cursorNodeText:c}}return{formatted:a.join("")}}function _p(e,t,r=0){let n=0;for(let s=r;s{if(i.push(r()),m.tail)return;let{tabWidth:f}=t,y=m.value.raw,C=y.includes(` +`)?zu(y,f):o;o=C;let c=a[p],A=n[u][p],T=ie(t.originalText,P(m),j(n.quasis[p+1]));if(!T){let g=is(c,{...t,printWidth:Number.POSITIVE_INFINITY}).formatted;g.includes(` +`)?T=!0:c=g}T&&(d(A)||A.type==="Identifier"||G(A)||A.type==="ConditionalExpression"||A.type==="SequenceExpression"||xe(A)||Fe(A))&&(c=[D([E,c]),E]);let B=C===0&&y.endsWith(` +`)?be(Number.NEGATIVE_INFINITY,c):Mu(c,C,f);i.push(l(["${",B,je,"}"]))},"quasis"),i.push("`"),i}function Zu(e,t,r){let n=r("quasi"),{node:s}=e,u="",i=Ve(s.quasi,h.Leading)[0];return i&&(ie(t.originalText,P(s.typeArguments??s.typeParameters??s.tag),j(i))?u=E:u=" "),at(n.label&&{tagged:!0,...n.label},[r("tag"),r(s.typeArguments?"typeArguments":"typeParameters"),u,je,n])}function vp(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(y=>"${"+is(y,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),o=[{hasLineBreak:!1,cells:[]}];for(let y=1;yy.cells.length)),m=Array.from({length:p}).fill(0),f=[{cells:s},...o.filter(y=>y.cells.length>0)];for(let{cells:y}of f.filter(C=>!C.hasLineBreak))for(let[C,c]of y.entries())m[C]=Math.max(m[C],st(c));return i.push(je,"`",D([F,b(F,f.map(y=>b(" | ",y.cells.map((C,c)=>y.hasLineBreak?C:C+" ".repeat(m[c]-st(C))))))]),F,"`"),i}}function jp(e,t){let{node:r}=e,n=t();return d(r)&&(n=l([D([E,n]),E])),["${",n,je,"}"]}function Yt(e,t){return e.map(r=>jp(r,t),"expressions")}function Ur(e,t){return ft(e,r=>typeof r=="string"?t?X(!1,r,/(\\*)`/gu,"$1$1\\`"):as(r):r)}function as(e){return X(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function Rp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&r.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&r.test(t.tag.object.object.name))}var ps=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function ei(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Te(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>U(n)&&s==="elements",r,...ps)||e.match(t,r,...ps)}function ti(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Te(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...ps)}function os(e,t){return d(e,h.Block|h.Leading,({value:r})=>r===` ${t} `)}function Xr({node:e,parent:t},r){return os(e,r)||Jp(t)&&os(t,r)||t.type==="ExpressionStatement"&&os(t,r)}function Jp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Np(e,t,r){let{node:n}=r,s=n.quasis.map(m=>m.value.raw),u=0,i=s.reduce((m,f,y)=>y===0?f:m+"@prettier-placeholder-"+u+++"-id"+f,""),a=await e(i,{parser:"scss"}),o=Yt(r,t),p=Gp(a,o);if(!p)throw new Error("Couldn't insert all the expressions");return["`",D([F,p]),E,"`"]}function Gp(e,t){if(!O(t))return e;let r=0,n=ft(Ut(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/u).map((u,i)=>i%2===0?ve(u):(r++,t[u])));return t.length===r?n:null}function qp({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Yr(e){return e.type==="Identifier"&&e.name==="styled"}function ri(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function Wp({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Yr(t.object)||ri(t);case"CallExpression":return Yr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Yr(t.callee.object.object)||ri(t.callee.object))||t.callee.object.type==="CallExpression"&&Yr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function Up({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Xp(e){if(qp(e)||Wp(e)||Up(e)||ei(e))return Np}var ni=Xp;async function Yp(e,t,r){let{node:n}=r,s=n.quasis.length,u=Yt(r,t),i=[];for(let a=0;a2&&y[0].trim()===""&&y[1].trim()==="",T=C>2&&y[C-1].trim()===""&&y[C-2].trim()==="",B=y.every(_=>/^\s*(?:#[^\n\r]*)?$/u.test(_));if(!m&&/#[^\n\r]*$/u.test(y[C-1]))return null;let g=null;B?g=Hp(y):g=await e(f,{parser:"graphql"}),g?(g=Ur(g,!1),!p&&A&&i.push(""),i.push(g),!m&&T&&i.push("")):!p&&!m&&A&&i.push(""),c&&i.push(c)}return["`",D([F,b(F,i)]),F,"`"]}function Hp(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([F,u]):t.push(u),r=!0);return t.length===0?null:b(F,t)}function Vp({node:e,parent:t}){return Xr({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function $p(e){if(Vp(e))return Yp}var si=$p;var cs=0;async function ui(e,t,r,n,s){let{node:u}=n,i=cs;cs=cs+1>>>0;let a=B=>`PRETTIER_HTML_PLACEHOLDER_${B}_${i}_IN_JS`,o=u.quasis.map((B,g,_)=>g===_.length-1?B.value.cooked:B.value.cooked+a(g)).join(""),p=Yt(n,r),m=new RegExp(a(String.raw`(\d+)`),"gu"),f=0,y=await t(o,{parser:e,__onHtmlRoot(B){f=B.children.length}}),C=ft(y,B=>{if(typeof B!="string")return B;let g=[],_=B.split(m);for(let M=0;M<_.length;M++){let J=_[M];if(M%2===0){J&&(J=as(J),s.__embeddedInHtml&&(J=X(!1,J,/<\/(?=script\b)/giu,String.raw`<\/`)),g.push(J));continue}let I=Number(J);g.push(p[I])}return g}),c=/^\s/u.test(o)?" ":"",A=/\s$/u.test(o)?" ":"",T=s.htmlWhitespaceSensitivity==="ignore"?F:c&&A?x:null;return T?l(["`",D([T,l(C)]),T,"`"]):at({hug:!1},l(["`",c,f>1?D(l(C)):l(C),A,"`"]))}function Kp(e){return Xr(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Qp=ui.bind(void 0,"html"),zp=ui.bind(void 0,"angular");function Zp(e){if(Kp(e))return Qp;if(ti(e))return zp}var ii=Zp;async function ec(e,t,r){let{node:n}=r,s=X(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(o,p)=>"\\".repeat(p.length/2)+"`"),u=tc(s),i=u!=="";i&&(s=X(!1,s,new RegExp(`^${u}`,"gmu"),""));let a=Ur(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?D([E,a]):[Rr,_u(a)],E,"`"]}function tc(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function rc(e){if(nc(e))return ec}function nc({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var ai=rc;function sc(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||uc(t))return;let r;for(let n of[ni,si,ii,ai])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&at({embed:!0,...u.label},u)}}function uc({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var oi=sc;var ic=/\*\/$/,ac=/^\/\*\*?/,mi=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,oc=/(^|\s+)\/\/([^\n\r]*)/g,pi=/^(\r?\n)+/,pc=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ci=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,cc=/(\r?\n|^) *\* ?/g,yi=[];function fi(e){let t=e.match(mi);return t?t[0].trimStart():""}function Di(e){let t=e.match(mi),r=t==null?void 0:t[0];return r==null?e:e.slice(r.length)}function Ei(e){let t=` +`;e=X(!1,e.replace(ac,"").replace(ic,""),cc,"$1");let r="";for(;r!==e;)r=e,e=X(!1,e,pc,`${t}$1 $2${t}`);e=e.replace(pi,"").trimEnd();let n=Object.create(null),s=X(!1,e,ci,"").replace(pi,"").trimEnd(),u;for(;u=ci.exec(e);){let i=X(!1,u[2],oc,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let a=n[u[1]];n[u[1]]=[...yi,...Array.isArray(a)?a:[a],i]}else n[u[1]]=i}return{comments:s,pragmas:n}}function Fi({comments:e="",pragmas:t={}}){let r=` +`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(p=>li(p,t[p])).map(p=>`${s} ${p}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let p=t[i[0]];return`${n} ${li(i[0],p)[0]}${u}`}}let o=e.split(r).map(p=>`${s} ${p}`).join(r)+r;return n+r+(e?o:"")+(e&&i.length>0?s+r:"")+a+u}function li(e,t){return[...yi,...Array.isArray(t)?t:[t]].map(r=>`@${e} ${r}`.trim())}var Ci="format";function lc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var Ai=lc;function mc(e){let t=Ai(e);t&&(e=e.slice(t.length+1));let r=fi(e),{pragmas:n,comments:s}=Ei(r);return{shebang:t,text:e,pragmas:n,comments:s}}function di(e){let{shebang:t,text:r,pragmas:n,comments:s}=mc(e),u=Di(r),i=Fi({pragmas:{[Ci]:"",...n},comments:s.trimStart()});return(t?`${t} +`:"")+i+(u.startsWith(` +`)?` +`:` + +`)+u}function yc(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,o=s(a),p=u(a);for(let m of n)s(m)>=o&&u(m)<=p&&i.add(m);return r.slice(o,p)}var Ti=yc;function ls(e,t){var u,i,a,o,p,m,f,y,C;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&Fc(r)&&yr(e))return!0;if(fc(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(A=>A.type==="ForOfStatement"))==null?void 0:i.left;if(c&&pe(c,A=>A===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(T=>T.type==="ExpressionStatement"||T.type==="ForStatement"||T.type==="ForInStatement"),A=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(A&&pe(A,T=>T===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let c=e.findAncestor(A=>!xe(A));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(A=>A.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&pe(c,A=>A===r))return!0}if(r.type==="ObjectExpression"){let c=(o=e.findAncestor(A=>A.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&pe(c,A=>A===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&O(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return xi(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"&&!Ac(r))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression")&&Ec(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(n==="init"&&e.match(void 0,void 0,(c,A)=>A==="declarations"&&c.type==="VariableDeclaration",(c,A)=>A==="left"&&c.type==="ForInStatement"))return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&Dc(e))return!0;if(r.operator==="|>"&&((p=r.extra)!=null&&p.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!xe(r);case"ConditionalExpression":return xe(r)||fu(r);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return n==="callee";case"ClassExpression":case"ClassDeclaration":return n==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"AssignmentExpression":case"AssignmentPattern":return n==="left"&&(r.type==="TSTypeAssertion"||xe(r));case"LogicalExpression":if(r.type==="LogicalExpression")return s.operator!==r.operator;case"BinaryExpression":{let{operator:c,type:A}=r;if(!c&&A!=="TSTypeAssertion")return!0;let T=sr(c),B=s.operator,g=sr(B);return g>T||n==="right"&&g===T||g===T&&!ar(B,c)?!0:g");default:return!1}case"TSFunctionType":if(e.match(c=>c.type==="TSFunctionType",(c,A)=>A==="typeAnnotation"&&c.type==="TSTypeAnnotation",(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(n==="extendsType"&&Je(r)&&s.type===r.type||n==="checkType"&&Je(s))return!0;if(n==="extendsType"&&s.type==="TSConditionalType"){let{typeAnnotation:c}=r.returnType||r.typeAnnotation;if(c.type==="TSTypePredicate"&&c.typeAnnotation&&(c=c.typeAnnotation.typeAnnotation),c.type==="TSInferType"&&c.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((Oe(s)||qt(s))&&s.types.length>1&&(!r.types||r.types.length>1))return!0;case"TSInferType":if(r.type==="TSInferType"){if(s.type==="TSRestType")return!1;if(n==="types"&&(s.type==="TSUnionType"||s.type==="TSIntersectionType")&&r.typeParameter.type==="TSTypeParameter"&&r.typeParameter.constraint)return!0}case"TSTypeOperator":return s.type==="TSArrayType"||s.type==="TSOptionalType"||s.type==="TSRestType"||n==="objectType"&&s.type==="TSIndexedAccessType"||s.type==="TSTypeOperator"||s.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return n==="objectType"&&s.type==="TSIndexedAccessType"||n==="elementType"&&s.type==="TSArrayType";case"TypeOperator":return s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||s.type==="TypeOperator";case"TypeofTypeAnnotation":return n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||n==="elementType"&&s.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return s.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return s.type==="TypeOperator"||s.type==="ArrayTypeAnnotation"||s.type==="NullableTypeAnnotation"||s.type==="IntersectionTypeAnnotation"||s.type==="UnionTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return s.type==="ArrayTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(r.type==="ComponentTypeAnnotation"&&(r.rendersType===null||r.rendersType===void 0))return!1;if(e.match(void 0,(A,T)=>T==="typeAnnotation"&&A.type==="TypeAnnotation",(A,T)=>T==="returnType"&&A.type==="ArrowFunctionExpression")||e.match(void 0,(A,T)=>T==="typeAnnotation"&&A.type==="TypePredicate",(A,T)=>T==="typeAnnotation"&&A.type==="TypeAnnotation",(A,T)=>T==="returnType"&&A.type==="ArrowFunctionExpression"))return!0;let c=s.type==="NullableTypeAnnotation"?e.grandparent:s;return c.type==="UnionTypeAnnotation"||c.type==="IntersectionTypeAnnotation"||c.type==="ArrayTypeAnnotation"||n==="objectType"&&(c.type==="IndexedAccessType"||c.type==="OptionalIndexedAccessType")||n==="checkType"&&s.type==="ConditionalTypeAnnotation"||n==="extendsType"&&s.type==="ConditionalTypeAnnotation"&&((m=r.returnType)==null?void 0:m.type)==="InferTypeAnnotation"&&((f=r.returnType)==null?void 0:f.typeParameter.bound)||c.type==="NullableTypeAnnotation"||s.type==="FunctionTypeParam"&&s.name===null&&Q(r).some(A=>{var T;return((T=A.typeAnnotation)==null?void 0:T.type)==="NullableTypeAnnotation"})}case"OptionalIndexedAccessType":return n==="objectType"&&s.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof r.value=="string"&&s.type==="ExpressionStatement"&&typeof s.directive!="string"){let c=e.grandparent;return c.type==="Program"||c.type==="BlockStatement"}return n==="object"&&G(s)&&ye(r);case"AssignmentExpression":return!((n==="init"||n==="update")&&s.type==="ForStatement"||n==="expression"&&r.left.type!=="ObjectPattern"&&s.type==="ExpressionStatement"||n==="key"&&s.type==="TSPropertySignature"||s.type==="AssignmentExpression"||n==="expressions"&&s.type==="SequenceExpression"&&e.match(void 0,void 0,(c,A)=>(A==="init"||A==="update")&&c.type==="ForStatement")||n==="value"&&s.type==="Property"&&e.match(void 0,void 0,(c,A)=>A==="properties"&&c.type==="ObjectPattern")||s.type==="NGChainedExpression"||n==="node"&&s.type==="JsExpressionRoot");case"ConditionalExpression":switch(s.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"ConditionalExpression":return t.experimentalTernaries?!1:n==="test";case"MemberExpression":case"OptionalMemberExpression":return n==="object";default:return!1}case"FunctionExpression":switch(s.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(s.type){case"BinaryExpression":return s.operator!=="|>"||((y=r.extra)==null?void 0:y.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return n==="test";default:return!1}case"ClassExpression":switch(s.type){case"NewExpression":return n==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(Cc(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")){let c=r;for(;c;)switch(c.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":c=c.object;break;case"TaggedTemplateExpression":c=c.tag;break;case"TSNonNullExpression":c=c.expression;break;default:return!1}}return!1;case"BindExpression":return n==="callee"&&(s.type==="BindExpression"||s.type==="NewExpression")||n==="object"&&G(s);case"NGPipeExpression":return!(s.type==="NGRoot"||s.type==="NGMicrosyntaxExpression"||s.type==="ObjectProperty"&&!((C=r.extra)!=null&&C.parenthesized)||U(s)||n==="arguments"&&w(s)||n==="right"&&s.type==="NGPipeExpression"||n==="property"&&s.type==="MemberExpression"||s.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return n==="callee"||n==="left"&&s.type==="BinaryExpression"&&s.operator==="<"||!U(s)&&s.type!=="ArrowFunctionExpression"&&s.type!=="AssignmentExpression"&&s.type!=="AssignmentPattern"&&s.type!=="BinaryExpression"&&s.type!=="NewExpression"&&s.type!=="ConditionalExpression"&&s.type!=="ExpressionStatement"&&s.type!=="JsExpressionRoot"&&s.type!=="JSXAttribute"&&s.type!=="JSXElement"&&s.type!=="JSXExpressionContainer"&&s.type!=="JSXFragment"&&s.type!=="LogicalExpression"&&!w(s)&&!Te(s)&&s.type!=="ReturnStatement"&&s.type!=="ThrowStatement"&&s.type!=="TypeCastExpression"&&s.type!=="VariableDeclarator"&&s.type!=="YieldExpression";case"TSInstantiationExpression":return n==="object"&&G(s)}return!1}var fc=R(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function Dc(e){let t=0,{node:r}=e;for(;r;){let n=e.getParentNode(t++);if((n==null?void 0:n.type)==="ForStatement"&&n.init===r)return!0;r=n}return!1}function Ec(e){return ur(e,t=>t.type==="ObjectTypeAnnotation"&&ur(t,r=>r.type==="FunctionTypeAnnotation"))}function Fc(e){return ue(e)}function yr(e){let{parent:t,key:r}=e;switch(t.type){case"NGPipeExpression":if(r==="arguments"&&e.isLast)return e.callParent(yr);break;case"ObjectProperty":if(r==="value")return e.callParent(()=>e.key==="properties"&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if(r==="right")return e.callParent(yr);break;case"ConditionalExpression":if(r==="alternate")return e.callParent(yr);break;case"UnaryExpression":if(t.prefix)return e.callParent(yr);break}return!1}function xi(e,t){let{node:r,parent:n}=e;return r.type==="FunctionExpression"||r.type==="ClassExpression"?n.type==="ExportDefaultDeclaration"||!ls(e,t):!Jt(r)||n.type!=="ExportDefaultDeclaration"&&ls(e,t)?!1:e.call(()=>xi(e,t),...Lr(r))}function Cc(e){return!!(e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&(t.type==="CallExpression"||t.type==="NewExpression"))||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression")||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression")&&(e.match(void 0,void 0,(t,r)=>r==="callee"&&(t.type==="CallExpression"&&!t.optional||t.type==="NewExpression")||r==="object"&&t.type==="MemberExpression"&&!t.optional)||e.match(void 0,void 0,(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,r)=>r==="expression"&&t.type==="TSNonNullExpression",(t,r)=>r==="expression"&&t.type==="ChainExpression",(t,r)=>r==="object"&&t.type==="MemberExpression"||r==="callee"&&t.type==="CallExpression"))}function ms(e){return e.type==="Identifier"?!0:G(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&ms(e.object):!1}function Ac(e){return e.type==="ChainExpression"&&(e=e.expression),ms(e)||w(e)&&!e.optional&&ms(e.callee)}var Le=ls;function dc(e,t){let r=t-1;r=Ye(e,r,{backwards:!0}),r=He(e,r,{backwards:!0}),r=Ye(e,r,{backwards:!0});let n=He(e,r,{backwards:!0});return r!==n}var hi=dc;var Tc=()=>!0;function ys(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function xc(e,t){var m;let r=e.node,n=[ys(e,t)],{printer:s,originalText:u,locStart:i,locEnd:a}=t;if((m=s.isBlockComment)==null?void 0:m.call(s,r)){let f=ee(u,a(r))?ee(u,i(r),{backwards:!0})?F:x:" ";n.push(f)}else n.push(F);let p=He(u,Ye(u,a(r)));return p!==!1&&ee(u,p)&&n.push(F),n}function hc(e,t,r){var p;let n=e.node,s=ys(e,t),{printer:u,originalText:i,locStart:a}=t,o=(p=u.isBlockComment)==null?void 0:p.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||ee(i,a(n),{backwards:!0})){let m=hi(i,a(n));return{doc:Xn([F,m?F:"",s]),isBlock:o,hasLineSuffix:!0}}return!o||r!=null&&r.hasLineSuffix?{doc:[Xn([" ",s]),Ce],isBlock:o,hasLineSuffix:!0}:{doc:[" ",s],isBlock:o,hasLineSuffix:!1}}function N(e,t,r={}){let{node:n}=e;if(!O(n==null?void 0:n.comments))return"";let{indent:s=!1,marker:u,filter:i=Tc}=r,a=[];if(e.each(({node:p})=>{p.leading||p.trailing||p.marker!==u||!i(p)||a.push(ys(e,t))},"comments"),a.length===0)return"";let o=b(F,a);return s?D([F,o]):o}function fs(e,t){let r=e.node;if(!r)return{};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(o=>!n.has(o)).length===0)return{leading:"",trailing:""};let u=[],i=[],a;return e.each(()=>{let o=e.node;if(n!=null&&n.has(o))return;let{leading:p,trailing:m}=o;p?u.push(xc(e,t)):m&&(a=hc(e,t,a),i.push(a.doc))},"comments"),{leading:u,trailing:i}}function Ee(e,t,r){let{leading:n,trailing:s}=fs(e,r);return!n&&!s?t:lr(t,u=>[n,u,s])}var Ds=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},qe=Ds;function Es(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var We,Fs=class{constructor(t){Ys(this,We);Hs(this,We,new Set(t))}getLeadingWhitespaceCount(t){let r=mt(this,We),n=0;for(let s=0;s=0&&r.has(t.charAt(s));s--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return mt(this,We).has(t.charAt(0))}hasTrailingWhitespace(t){return mt(this,We).has(v(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${Es([...mt(this,We)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return t.split(s)}hasWhitespaceCharacter(t){let r=mt(this,We);return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=mt(this,We);return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=mt(this,We);return Array.prototype.every.call(t,n=>r.has(n))}};We=new WeakMap;var gi=Fs;var Hr=new gi(` +\r `),Cs=e=>e===""||e===x||e===F||e===E;function gc(e,t,r){var _,M,J,I,q;let{node:n}=e;if(n.type==="JSXElement"&&Jc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(k=>Nc(k)?{type:"JSXText",value:" ",raw:" "}:k);let i=n.children.some(Y),a=n.children.filter(k=>k.type==="JSXExpressionContainer").length>1,o=n.type==="JSXElement"&&n.openingElement.attributes.length>1,p=re(s)||i||o||a,m=e.parent.rootMarker==="mdx",f=t.singleQuote?"{' '}":'{" "}',y=m?x:S([f,E]," "),C=((M=(_=n.openingElement)==null?void 0:_.name)==null?void 0:M.name)==="fbt",c=Sc(e,t,r,y,C),A=n.children.some(k=>fr(k));for(let k=c.length-2;k>=0;k--){let W=c[k]===""&&c[k+1]==="",ne=c[k]===F&&c[k+1]===""&&c[k+2]===F,Z=(c[k]===E||c[k]===F)&&c[k+1]===""&&c[k+2]===y,lt=c[k]===y&&c[k+1]===""&&(c[k+2]===E||c[k+2]===F),L=c[k]===y&&c[k+1]===""&&c[k+2]===y,se=c[k]===E&&c[k+1]===""&&c[k+2]===F||c[k]===F&&c[k+1]===""&&c[k+2]===E;ne&&A||W||Z||L||se?c.splice(k,2):lt&&c.splice(k+1,2)}for(;c.length>0&&Cs(v(!1,c,-1));)c.pop();for(;c.length>1&&Cs(c[0])&&Cs(c[1]);)c.shift(),c.shift();let T=[""];for(let[k,W]of c.entries()){if(W===y){if(k===1&&wu(c[k-1])){if(c.length===2){T.push([T.pop(),f]);continue}T.push([f,F],"");continue}else if(k===c.length-1){T.push([T.pop(),f]);continue}else if(c[k-1]===""&&c[k-2]===F){T.push([T.pop(),f]);continue}}k%2===0?T.push([T.pop(),W]):T.push(W,""),re(W)&&(p=!0)}let B=A?Nr(T):l(T,{shouldBreak:!0});if(((J=t.cursorNode)==null?void 0:J.type)==="JSXText"&&n.children.includes(t.cursorNode)?B=[mr,B,mr]:((I=t.nodeBeforeCursor)==null?void 0:I.type)==="JSXText"&&n.children.includes(t.nodeBeforeCursor)?B=[mr,B]:((q=t.nodeAfterCursor)==null?void 0:q.type)==="JSXText"&&n.children.includes(t.nodeAfterCursor)&&(B=[B,mr]),m)return B;let g=l([s,D([F,B]),F,u]);return p?g:tt([l([s,...c,u]),g])}function Sc(e,t,r,n,s){let u="",i=[u];function a(p){u=p,i.push([i.pop(),p])}function o(p){p!==""&&(u=p,i.push(p,""))}return e.each(({node:p,next:m})=>{if(p.type==="JSXText"){let f=ae(p);if(fr(p)){let y=Hr.split(f,!0);y[0]===""&&(y.shift(),/\n/u.test(y[0])?o(Bi(s,y[1],p,m)):o(n),y.shift());let C;if(v(!1,y,-1)===""&&(y.pop(),C=y.pop()),y.length===0)return;for(let[c,A]of y.entries())c%2===1?o(x):a(A);C!==void 0?/\n/u.test(C)?o(Bi(s,u,p,m)):o(n):o(Si(s,u,p,m))}else/\n/u.test(f)?f.match(/\n/gu).length>1&&o(F):o(n)}else{let f=r();if(a(f),m&&fr(m)){let C=Hr.trim(ae(m)),[c]=Hr.split(C);o(Si(s,c,p,m))}else o(F)}},"children"),i}function Si(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?E:F:E}function Bi(e,t,r,n){return e?F:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?F:E:F}var Bc=new Set(["ArrayExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function bc(e,t,r){let{parent:n}=e;if(Bc.has(n.type))return t;let s=Pc(e),u=Le(e,r);return l([u?"":S("("),D([E,t]),E,u?"":S(")")],{shouldBreak:s})}function Pc(e){return e.match(void 0,t=>t.type==="ArrowFunctionExpression",w)&&(e.match(void 0,void 0,void 0,t=>t.type==="JSXExpressionContainer")||e.match(void 0,void 0,void 0,t=>t.type==="ChainExpression",t=>t.type==="JSXExpressionContainer"))}function kc(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(K(n.value)){let i=ae(n.value),a=X(!1,X(!1,i.slice(1,-1),"'","'"),""",'"'),o=Sr(a,t.jsxSingleQuote);a=o==='"'?X(!1,a,'"',"""):X(!1,a,"'","'"),u=e.call(()=>Ee(e,ve(o+a+o),t),"value")}else u=r("value");s.push("=",u)}return s}function Ic(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!d(u)&&(U(u)||ue(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||w(u)||u.type==="ChainExpression"&&w(u.expression)||u.type==="FunctionExpression"||u.type==="TemplateLiteral"||u.type==="TaggedTemplateExpression"||u.type==="DoExpression"||Y(i)&&(u.type==="ConditionalExpression"||Fe(u)));return s(n.expression,e.parent)?l(["{",r("expression"),je,"}"]):l(["{",D([E,r("expression")]),E,je,"}"])}function Lc(e,t,r){var a,o;let{node:n}=e,s=d(n.name)||d(n.typeParameters)||d(n.typeArguments);if(n.selfClosing&&n.attributes.length===0&&!s)return["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," />"];if(((a=n.attributes)==null?void 0:a.length)===1&&K(n.attributes[0].value)&&!n.attributes[0].value.value.includes(` +`)&&!s&&!d(n.attributes[0]))return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(o=n.attributes)==null?void 0:o.some(p=>K(p.value)&&p.value.value.includes(` +`)),i=t.singleAttributePerLine&&n.attributes.length>1?F:x;return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),D(e.map(()=>[i,r()],"attributes")),...wc(n,t,s)],{shouldBreak:u})}function wc(e,t,r){return e.selfClosing?[x,"/>"]:Oc(e,t,r)?[">"]:[E,">"]}function Oc(e,t,r){let n=e.attributes.length>0&&d(v(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function _c(e,t,r){let{node:n}=e,s=[];s.push(""),s}function Mc(e,t){let{node:r}=e,n=d(r),s=d(r,h.Line),u=r.type==="JSXOpeningFragment";return[u?"<":""]}function vc(e,t,r){let n=Ee(e,gc(e,t,r),t);return bc(e,n,t)}function jc(e,t){let{node:r}=e,n=d(r,h.Line);return[N(e,t,{indent:n}),n?F:""]}function Rc(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!d(s)||!rs(e)?u:[D([E,Ee(e,u,t)]),E]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function bi(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return kc(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return b(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return b(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return Rc(e,t,r);case"JSXExpressionContainer":return Ic(e,t,r);case"JSXFragment":case"JSXElement":return vc(e,t,r);case"JSXOpeningElement":return Lc(e,t,r);case"JSXClosingElement":return _c(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return Mc(e,t);case"JSXEmptyExpression":return jc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new qe(n,"JSX")}}function Jc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!fr(t)}function fr(e){return e.type==="JSXText"&&(Hr.hasNonWhitespaceCharacter(ae(e))||!/\n/u.test(ae(e)))}function Nc(e){return e.type==="JSXExpressionContainer"&&K(e.expression)&&e.expression.value===" "&&!d(e.expression)}function Pi(e){let{node:t,parent:r}=e;if(!Y(t)||!Y(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!fr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&kt(u.expression)}function Gc(e){return kt(e.node)||Pi(e)}var Vr=Gc;var qc=0;function $r(e,t,r){var M;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),o=n.operator==="|>"&&((M=e.root.extra)==null?void 0:M.__isUsingHackPipeline),p=As(e,t,r,!1,a);if(a)return p;if(o)return l(p);if(w(s)&&s.callee===n||s.type==="UnaryExpression"||G(s)&&!s.computed)return l([D([E,...p]),E]);let m=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!w(u)||s.type==="TemplateLiteral",f=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Te(s),y=Fe(n.left)&&ar(n.operator,n.left.operator);if(m||Ht(n)&&!y||!Ht(n)&&f)return l(p);if(p.length===0)return"";let C=Y(n.right),c=p.findIndex(J=>typeof J!="string"&&!Array.isArray(J)&&J.type===fe),A=p.slice(0,c===-1?1:c+1),T=p.slice(A.length,C?-1:void 0),B=Symbol("logicalChain-"+ ++qc),g=l([...A,D(T)],{id:B});if(!C)return g;let _=v(!1,p,-1);return l([g,xt(_,{groupId:B})])}function As(e,t,r,n,s){var B;let{node:u}=e;if(!Fe(u))return[l(r())];let i=[];ar(u.operator,u.left.operator)?i=e.call(g=>As(g,t,r,!0,s),"left"):i.push(l(r("left")));let a=Ht(u),o=(u.operator==="|>"||u.type==="NGPipeExpression"||Wc(e,t))&&!de(t.originalText,u.right),m=!d(u.right,h.Leading,Gr)&&de(t.originalText,u.right),f=u.type==="NGPipeExpression"?"|":u.operator,y=u.type==="NGPipeExpression"&&u.arguments.length>0?l(D([E,": ",b([x,": "],e.map(()=>be(2,l(r())),"arguments"))])):"",C;if(a)C=[f,de(t.originalText,u.right)?D([x,r("right"),y]):[" ",r("right"),y]];else{let _=f==="|>"&&((B=e.root.extra)==null?void 0:B.__isUsingHackPipeline)?e.call(M=>As(M,t,r,!0,s),"right"):r("right");if(t.experimentalOperatorPosition==="start"){let M="";if(m)switch(Be(_)){case ge:M=_.splice(0,1)[0];break;case Se:M=_.contents.splice(0,1)[0];break}C=[x,M,f," ",_,y]}else C=[o?x:"",f,o?" ":x,_,y]}let{parent:c}=e,A=d(u.left,h.Trailing|h.Line);if((A||!(s&&u.type==="LogicalExpression")&&c.type!==u.type&&u.left.type!==u.type&&u.right.type!==u.type)&&(C=l(C,{shouldBreak:A})),t.experimentalOperatorPosition==="start"?i.push(a||m?" ":"",C):i.push(o?"":" ",C),n&&d(u)){let g=Ut(Ee(e,i,t));return g.type===_e?g.parts:Array.isArray(g)?g:[g]}return i}function Ht(e){return e.type!=="LogicalExpression"?!1:!!(ue(e.right)&&e.right.properties.length>0||U(e.right)&&e.right.elements.length>0||Y(e.right))}var ki=e=>e.type==="BinaryExpression"&&e.operator==="|";function Wc(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&ki(e.node)&&!e.hasAncestor(r=>!ki(r)&&r.type!=="JsExpressionRoot")}function Li(e,t,r){let{node:n}=e;if(n.type.startsWith("NG"))switch(n.type){case"NGRoot":return[r("node"),d(n.node)?" //"+Ve(n.node)[0].value.trimEnd():""];case"NGPipeExpression":return $r(e,t,r);case"NGChainedExpression":return l(b([";",x],e.map(()=>Yc(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":Ii(e)?" ":[";",x],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name)?n.name:JSON.stringify(n.name);case"NGMicrosyntaxExpression":return[r("expression"),n.alias===null?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:s,parent:u}=e,i=Ii(e)||Uc(e)||(s===1&&(n.key.name==="then"||n.key.name==="else"||n.key.name==="as")||s===2&&(n.key.name==="else"&&u.body[s-1].type==="NGMicrosyntaxKeyedExpression"&&u.body[s-1].key.name==="then"||n.key.name==="track"))&&u.body[0].type==="NGMicrosyntaxExpression";return[r("key"),i?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),n.value===null?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new qe(n,"Angular")}}function Ii({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}function Uc(e){let{node:t}=e;return e.parent.body[1].key.name==="of"&&t.type==="NGMicrosyntaxKeyedExpression"&&t.key.name==="track"&&t.key.type==="NGMicrosyntaxKey"}var Xc=R(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Yc({node:e}){return ur(e,Xc)}function ds(e,t,r){let{node:n}=e;return l([b(x,e.map(r,"decorators")),_i(n,t)?F:x])}function wi(e,t,r){return Mi(e.node)?[b(F,e.map(r,"declaration","decorators")),F]:""}function Oi(e,t,r){let{node:n,parent:s}=e,{decorators:u}=n;if(!O(u)||Mi(s)||Vr(e))return"";let i=n.type==="ClassExpression"||n.type==="ClassDeclaration"||_i(n,t);return[e.key==="declaration"&&yu(s)?F:i?Ce:"",b(x,e.map(r,"decorators")),x]}function _i(e,t){return e.decorators.some(r=>ee(t.originalText,P(r)))}function Mi(e){var r;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let t=(r=e.declaration)==null?void 0:r.decorators;return O(t)&&Bt(e,t[0])}var Dt=class extends Error{name="ArgExpansionBailout"};function Hc(e,t,r){let{node:n}=e,s=le(n);if(s.length===0)return["(",N(e,t),")"];let u=s.length-1;if(Kc(s)){let f=["("];return Gt(e,(y,C)=>{f.push(r()),C!==u&&f.push(", ")}),f.push(")"),f}let i=!1,a=[];Gt(e,({node:f},y)=>{let C=r();y===u||(me(f,t)?(i=!0,C=[C,",",F,F]):C=[C,",",x]),a.push(C)});let o=!t.parser.startsWith("__ng_")&&n.type!=="ImportExpression"&&n.type!=="TSImportType"&&ce(t,"all")?",":"";if(n.type==="TSImportType"&&s.length===1&&(s[0].type==="TSLiteralType"&&K(s[0].literal)||K(s[0]))&&!d(s[0]))return l(["(",...a,S(o),")"]);function p(){return l(["(",D([x,...a]),o,x,")"],{shouldBreak:!0})}if(i||e.parent.type!=="Decorator"&&Au(s))return p();if($c(s)){let f=a.slice(1);if(f.some(re))return p();let y;try{y=r(Gn(n,0),{expandFirstArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(y)?[Ce,tt([["(",l(y,{shouldBreak:!0}),", ",...f,")"],p()])]:tt([["(",y,", ",...f,")"],["(",l(y,{shouldBreak:!0}),", ",...f,")"],p()])}if(Vc(s,a,t)){let f=a.slice(0,-1);if(f.some(re))return p();let y;try{y=r(Gn(n,-1),{expandLastArg:!0})}catch(C){if(C instanceof Dt)return p();throw C}return re(y)?[Ce,tt([["(",...f,l(y,{shouldBreak:!0}),")"],p()])]:tt([["(",...f,y,")"],["(",...f,l(y,{shouldBreak:!0}),")"],p()])}let m=["(",D([E,...a]),S(o),E,")"];return vr(e)?m:l(m,{shouldBreak:a.some(re)||i})}function Dr(e,t=!1){return ue(e)&&(e.properties.length>0||d(e))||U(e)&&(e.elements.length>0||d(e))||e.type==="TSTypeAssertion"&&Dr(e.expression)||xe(e)&&Dr(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||Qc(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&Dr(e.body,!0)||ue(e.body)||U(e.body)||!t&&(w(e.body)||e.body.type==="ConditionalExpression")||Y(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function Vc(e,t,r){var u,i;let n=v(!1,e,-1);if(e.length===1){let a=v(!1,t,-1);if((u=a.label)!=null&&u.embed&&((i=a.label)==null?void 0:i.hug)!==!1)return!0}let s=v(!1,e,-2);return!d(n,h.Leading)&&!d(n,h.Trailing)&&Dr(n)&&(!s||s.type!==n.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!U(n))&&!(e.length>1&&Ts(n,r))}function $c(e){if(e.length!==2)return!1;let[t,r]=e;return t.type==="ModuleExpression"&&zc(r)?!0:!d(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&r.type!=="FunctionExpression"&&r.type!=="ArrowFunctionExpression"&&r.type!=="ConditionalExpression"&&ji(r)&&!Dr(r)}function ji(e){if(e.type==="ParenthesizedExpression")return ji(e.expression);if(xe(e)||e.type==="TypeCastExpression"){let{typeAnnotation:t}=e;if(t.type==="TypeAnnotation"&&(t=t.typeAnnotation),t.type==="TSArrayType"&&(t=t.elementType,t.type==="TSArrayType"&&(t=t.elementType)),t.type==="GenericTypeAnnotation"||t.type==="TSTypeReference"){let r=t.typeArguments??t.typeParameters;(r==null?void 0:r.params.length)===1&&(t=r.params[0])}return Nt(t)&&we(e.expression,1)}return yt(e)&&le(e).length>1?!1:Fe(e)?we(e.left,1)&&we(e.right,1):Jn(e)||we(e)}function Kc(e){return e.length===2?vi(e,0):e.length===3?e[0].type==="Identifier"&&vi(e,1):!1}function vi(e,t){let r=e[t],n=e[t+1];return r.type==="ArrowFunctionExpression"&&Q(r).length===0&&r.body.type==="BlockStatement"&&n.type==="ArrayExpression"&&!e.some(s=>d(s))}function Qc(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||d(e,h.Dangling))}function zc(e){if(!(e.type==="ObjectExpression"&&e.properties.length===1))return!1;let[t]=e.properties;return Te(t)?!t.computed&&(t.key.type==="Identifier"&&t.key.name==="type"||K(t.key)&&t.key.value==="type")&&K(t.value)&&t.value.value==="module":!1}var Lt=Hc;var Zc=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),w(e)&&le(e).length>0);function Ri(e,t,r){var p;let n=r("object"),s=xs(e,t,r),{node:u}=e,i=e.findAncestor(m=>!(G(m)||m.type==="TSNonNullExpression")),a=e.findAncestor(m=>!(m.type==="ChainExpression"||m.type==="TSNonNullExpression")),o=i&&(i.type==="NewExpression"||i.type==="BindExpression"||i.type==="AssignmentExpression"&&i.left.type!=="Identifier")||u.computed||u.object.type==="Identifier"&&u.property.type==="Identifier"&&!G(a)||(a.type==="AssignmentExpression"||a.type==="VariableDeclarator")&&(Zc(u.object)||((p=n.label)==null?void 0:p.memberChain));return at(n.label,[n,o?s:l(D([E,s]))])}function xs(e,t,r){let n=r("property"),{node:s}=e,u=V(e);return s.computed?!s.property||ye(s.property)?[u,"[",n,"]"]:l([u,"[",D([E,n]),E,"]"]):[u,".",n]}function Ji(e,t,r){if(e.node.type==="ChainExpression")return e.call(()=>Ji(e,t,r),"expression");let n=(e.parent.type==="ChainExpression"?e.grandparent:e.parent).type==="ExpressionStatement",s=[];function u(L){let{originalText:se}=t,Ae=ot(se,P(L));return se.charAt(Ae)===")"?Ae!==!1&&vt(se,Ae+1):me(L,t)}function i(){let{node:L}=e;if(L.type==="ChainExpression")return e.call(i,"expression");if(w(L)&&(dt(L.callee)||w(L.callee))){let se=u(L);s.unshift({node:L,hasTrailingEmptyLine:se,printed:[Ee(e,[V(e),rt(e,t,r),Lt(e,t,r)],t),se?F:""]}),e.call(i,"callee")}else dt(L)?(s.unshift({node:L,needsParens:Le(e,t),printed:Ee(e,G(L)?xs(e,t,r):Kr(e,t,r),t)}),e.call(i,"object")):L.type==="TSNonNullExpression"?(s.unshift({node:L,printed:Ee(e,"!",t)}),e.call(i,"expression")):s.unshift({node:L,printed:r()})}let{node:a}=e;s.unshift({node:a,printed:[V(e),rt(e,t,r),Lt(e,t,r)]}),a.callee&&e.call(i,"callee");let o=[],p=[s[0]],m=1;for(;m0&&o.push(p);function y(L){return/^[A-Z]|^[$_]+$/u.test(L)}function C(L){return L.length<=t.tabWidth}function c(L){var Ot;let se=(Ot=L[1][0])==null?void 0:Ot.node.computed;if(L[0].length===1){let nt=L[0][0].node;return nt.type==="ThisExpression"||nt.type==="Identifier"&&(y(nt.name)||n&&C(nt.name)||se)}let Ae=v(!1,L[0],-1).node;return G(Ae)&&Ae.property.type==="Identifier"&&(y(Ae.property.name)||se)}let A=o.length>=2&&!d(o[1][0].node)&&c(o);function T(L){let se=L.map(Ae=>Ae.printed);return L.length>0&&v(!1,L,-1).needsParens?["(",...se,")"]:se}function B(L){return L.length===0?"":D([F,b(F,L.map(T))])}let g=o.map(T),_=g,M=A?3:2,J=o.flat(),I=J.slice(1,-1).some(L=>d(L.node,h.Leading))||J.slice(0,-1).some(L=>d(L.node,h.Trailing))||o[M]&&d(o[M][0].node,h.Leading);if(o.length<=M&&!I&&!o.some(L=>v(!1,L,-1).hasTrailingEmptyLine))return vr(e)?_:l(_);let q=v(!1,o[A?1:0],-1).node,k=!w(q)&&u(q),W=[T(o[0]),A?o.slice(1,2).map(T):"",k?F:"",B(o.slice(A?2:1))],ne=s.map(({node:L})=>L).filter(w);function Z(){let L=v(!1,v(!1,o,-1),-1).node,se=v(!1,g,-1);return w(L)&&re(se)&&ne.slice(0,-1).some(Ae=>Ae.arguments.some(Rt))}let lt;return I||ne.length>2&&ne.some(L=>!L.arguments.every(se=>we(se)))||g.slice(0,-1).some(re)||Z()?lt=l(W):lt=[re(_)||k?Ce:"",tt([_,W])],at({memberChain:!0},lt)}var Ni=Ji;function Qr(e,t,r){var m;let{node:n}=e,s=n.type==="NewExpression",u=n.type==="ImportExpression",i=V(e),a=le(n),o=a.length===1&&_r(a[0],t.originalText);if(o||el(e)||Pt(n,e.parent)){let f=[];if(Gt(e,()=>{f.push(r())}),!(o&&((m=f[0].label)!=null&&m.embed)))return[s?"new ":"",Gi(e,r),i,rt(e,t,r),"(",b(", ",f),")"]}if(!u&&!s&&dt(n.callee)&&!e.call(f=>Le(f,t),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return Ni(e,t,r);let p=[s?"new ":"",Gi(e,r),i,rt(e,t,r),Lt(e,t,r)];return u||w(n.callee)?l(p):p}function Gi(e,t){let{node:r}=e;return r.type==="ImportExpression"?`import${r.phase?`.${r.phase}`:""}`:t("callee")}function el(e){let{node:t}=e;if(t.type!=="CallExpression"||t.optional||t.callee.type!=="Identifier")return!1;let r=le(t);return t.callee.name==="require"?r.length===1&&K(r[0])||r.length>1:t.callee.name==="define"&&e.parent.type==="ExpressionStatement"?r.length===1||r.length===2&&r[0].type==="ArrayExpression"||r.length===3&&K(r[0])&&r[1].type==="ArrayExpression":!1}function ht(e,t,r,n,s,u){let i=tl(e,t,r,n,u),a=u?r(u,{assignmentLayout:i}):"";switch(i){case"break-after-operator":return l([l(n),s,l(D([x,a]))]);case"never-break-after-operator":return l([l(n),s," ",a]);case"fluid":{let o=Symbol("assignment");return l([l(n),s,l(D(x),{id:o}),je,xt(a,{groupId:o})])}case"break-lhs":return l([n,s," ",l(a)]);case"chain":return[l(n),s,x,a];case"chain-tail":return[l(n),s,D([x,a])];case"chain-tail-arrow-chain":return[l(n),s,a];case"only-left":return n}}function Wi(e,t,r){let{node:n}=e;return ht(e,t,r,r("left"),[" ",n.operator],"right")}function Ui(e,t,r){return ht(e,t,r,r("id")," =","init")}function tl(e,t,r,n,s){let{node:u}=e,i=u[s];if(!i)return"only-left";let a=!zr(i);if(e.match(zr,Xi,y=>!a||y.type!=="ExpressionStatement"&&y.type!=="VariableDeclaration"))return a?i.type==="ArrowFunctionExpression"&&i.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&zr(i.right)||de(t.originalText,i))return"break-after-operator";if(u.type==="ImportAttribute"||i.type==="CallExpression"&&i.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let m=Lu(n);if(nl(u)||al(u)||hs(u)&&m)return"break-lhs";let f=pl(u,n,t);return e.call(()=>rl(e,t,r,f),s)?"break-after-operator":sl(u)?"break-lhs":!m&&(f||i.type==="TemplateLiteral"||i.type==="TaggedTemplateExpression"||Du(i)||ye(i)||i.type==="ClassExpression")?"never-break-after-operator":"fluid"}function rl(e,t,r,n){let s=e.node;if(Fe(s)&&!Ht(s))return!0;switch(s.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!ml(s))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:p}=s;return Fe(p)&&!Ht(p)}let{consequent:a,alternate:o}=s;return a.type==="ConditionalExpression"||o.type==="ConditionalExpression"}case"ClassExpression":return O(s.decorators)}if(n)return!1;let u=s,i=[];for(;;)if(u.type==="UnaryExpression"||u.type==="AwaitExpression"||u.type==="YieldExpression"&&u.argument!==null)u=u.argument,i.push("argument");else if(u.type==="TSNonNullExpression")u=u.expression,i.push("expression");else break;return!!(K(u)||e.call(()=>Yi(e,t,r),...i))}function nl(e){if(Xi(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(r=>{var n;return Te(r)&&(!r.shorthand||((n=r.value)==null?void 0:n.type)==="AssignmentPattern")})}return!1}function zr(e){return e.type==="AssignmentExpression"}function Xi(e){return zr(e)||e.type==="VariableDeclarator"}function sl(e){let t=il(e);if(O(t)){let r=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(n=>n[r]||n.default))return!0}return!1}var ul=R(["TSTypeAliasDeclaration","TypeAlias"]);function il(e){var t;if(ul(e))return(t=e.typeParameters)==null?void 0:t.params}function al(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=qi(t.typeAnnotation);return O(r)&&r.length>1&&r.some(n=>O(qi(n))||n.type==="TSConditionalType")}function hs(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var ol=R(["TSTypeReference","GenericTypeAnnotation"]);function qi(e){var t;if(ol(e))return(t=e.typeArguments??e.typeParameters)==null?void 0:t.params}function Yi(e,t,r,n=!1){var i;let{node:s}=e,u=()=>Yi(e,t,r,!0);if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return e.call(u,"expression");if(w(s)){if((i=Qr(e,t,r).label)!=null&&i.memberChain)return!1;let o=le(s);return!(o.length===0||o.length===1&&ir(o[0],t))||cl(s,r)?!1:e.call(u,"callee")}return G(s)?e.call(u,"object"):n&&(s.type==="Identifier"||s.type==="ThisExpression")}function pl(e,t,r){return Te(e)?(t=Ut(t),typeof t=="string"&&st(t)1)return!0;if(r.length===1){let s=r[0];if(Oe(s)||qt(s)||s.type==="TSTypeLiteral"||s.type==="ObjectTypeAnnotation")return!0}let n=e.typeParameters?"typeParameters":"typeArguments";if(re(t(n)))return!0}return!1}function ll(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function ml(e){function t(r){switch(r.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!r.typeParameters;case"TSTypeReference":return!!(r.typeArguments??r.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}function Ue(e,t,r,n,s){let u=e.node,i=Q(u),a=s?rt(e,t,r):"";if(i.length===0)return[a,"(",N(e,t,{filter:c=>ke(t.originalText,P(c))===")"}),")"];let{parent:o}=e,p=Pt(o),m=gs(u),f=[];if(hu(e,(c,A)=>{let T=A===i.length-1;T&&u.rest&&f.push("..."),f.push(r()),!T&&(f.push(","),p||m?f.push(" "):me(i[A],t)?f.push(F,F):f.push(x))}),n&&!fl(e)){if(re(a)||re(f))throw new Dt;return l([cr(a),"(",cr(f),")"])}let y=i.every(c=>!O(c.decorators));return m&&y?[a,"(",...f,")"]:p?[a,"(",...f,")"]:(Or(o)||Eu(o)||o.type==="TypeAlias"||o.type==="UnionTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="FunctionTypeAnnotation"&&o.returnType===u)&&i.length===1&&i[0].name===null&&u.this!==i[0]&&i[0].typeAnnotation&&u.typeParameters===null&&Nt(i[0].typeAnnotation)&&!u.rest?t.arrowParens==="always"||u.type==="HookTypeAnnotation"?["(",...f,")"]:f:[a,"(",D([E,...f]),S(!xu(u)&&ce(t,"all")?",":""),E,")"]}function gs(e){if(!e)return!1;let t=Q(e);if(t.length!==1)return!1;let[r]=t;return!d(r)&&(r.type==="ObjectPattern"||r.type==="ArrayPattern"||r.type==="Identifier"&&r.typeAnnotation&&(r.typeAnnotation.type==="TypeAnnotation"||r.typeAnnotation.type==="TSTypeAnnotation")&&Re(r.typeAnnotation.typeAnnotation)||r.type==="FunctionTypeParam"&&Re(r.typeAnnotation)&&r!==e.rest||r.type==="AssignmentPattern"&&(r.left.type==="ObjectPattern"||r.left.type==="ArrayPattern")&&(r.right.type==="Identifier"||ue(r.right)&&r.right.properties.length===0||U(r.right)&&r.right.elements.length===0))}function yl(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function ct(e,t){var s;let r=yl(e);if(!r)return!1;let n=(s=e.typeParameters)==null?void 0:s.params;if(n){if(n.length>1)return!1;if(n.length===1){let u=n[0];if(u.constraint||u.default)return!1}}return Q(e).length===1&&(Re(r)||re(t))}function fl(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,r)=>{if(t.type==="CallExpression"&&r==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let n=t.callee.callee;return n.type==="Identifier"||n.type==="MemberExpression"&&!n.computed&&n.object.type==="Identifier"&&n.property.type==="Identifier"}return!1},(t,r)=>t.type==="VariableDeclarator"&&r==="init"||t.type==="ExportDefaultDeclaration"&&r==="declaration"||t.type==="TSExportAssignment"&&r==="expression"||t.type==="AssignmentExpression"&&r==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function Hi(e){let t=Q(e);return t.length>1&&t.some(r=>r.type==="TSParameterProperty")}var Dl=R(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),El=R(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function Fl(e){let{types:t}=e;if(t.some(n=>d(n)))return!1;let r=t.find(n=>El(n));return r?t.every(n=>n===r||Dl(n)):!1}function Ss(e){return Nt(e)||Re(e)?!0:Oe(e)?Fl(e):!1}function Vi(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[$(e),"opaque type ",r("id"),r("typeParameters")];return s.supertype&&u.push(": ",r("supertype")),s.impltype&&u.push(" = ",r("impltype")),u.push(n),u}function Zr(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[$(e)];u.push("type ",r("id"),r("typeParameters"));let i=s.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[ht(e,t,r,u," =",i),n]}function en(e,t,r){let n=!1;return l(e.map(({isFirst:s,previous:u,node:i,index:a})=>{let o=r();if(s)return o;let p=Re(i),m=Re(u);return m&&p?[" & ",n?D(o):o]:!m&&!p||de(t.originalText,i)?t.experimentalOperatorPosition==="start"?D([x,"& ",o]):D([" &",x,o]):(a>1&&(n=!0),[" & ",a>1?D(o):o])},"types"))}function tn(e,t,r){let{node:n}=e,{parent:s}=e,u=s.type!=="TypeParameterInstantiation"&&(!Je(s)||!t.experimentalTernaries)&&s.type!=="TSTypeParameterInstantiation"&&s.type!=="GenericTypeAnnotation"&&s.type!=="TSTypeReference"&&s.type!=="TSTypeAssertion"&&s.type!=="TupleTypeAnnotation"&&s.type!=="TSTupleType"&&!(s.type==="FunctionTypeParam"&&!s.name&&e.grandparent.this!==s)&&!((s.type==="TypeAlias"||s.type==="VariableDeclarator"||s.type==="TSTypeAliasDeclaration")&&de(t.originalText,n)),i=Ss(n),a=e.map(m=>{let f=r();return i||(f=be(2,f)),Ee(m,f,t)},"types");if(i)return b(" | ",a);let o=u&&!de(t.originalText,n),p=[S([o?x:"","| "]),b([x,"| "],a)];return Le(e,t)?l([D(p),E]):(s.type==="TupleTypeAnnotation"||s.type==="TSTupleType")&&s[s.type==="TupleTypeAnnotation"&&s.types?"types":"elementTypes"].length>1?l([D([S(["(",E]),p]),E,S(")")]):l(u?D(p):p)}function Cl(e){var n;let{node:t,parent:r}=e;return t.type==="FunctionTypeAnnotation"&&(Or(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&&Bt(r,t)||r.type==="ObjectTypeCallProperty"||((n=e.getParentNode(2))==null?void 0:n.type)==="DeclareFunction"))}function rn(e,t,r){let{node:n}=e,s=[Vt(e)];(n.type==="TSConstructorType"||n.type==="TSConstructSignatureDeclaration")&&s.push("new ");let u=Ue(e,t,r,!1,!0),i=[];return n.type==="FunctionTypeAnnotation"?i.push(Cl(e)?" => ":": ",r("returnType")):i.push(H(e,r,n.returnType?"returnType":"typeAnnotation")),ct(n,i)&&(u=l(u)),s.push(u,i),l(s)}function nn(e,t,r){return[r("objectType"),V(e),"[",r("indexType"),"]"]}function sn(e,t,r){return["infer ",r("typeParameter")]}function Bs(e,t,r){let{node:n}=e;return[n.postfix?"":r,H(e,t),n.postfix?r:""]}function un(e,t,r){let{node:n}=e;return["...",...n.type==="TupleTypeSpreadElement"&&n.label?[r("label"),": "]:[],r("typeAnnotation")]}function an(e,t,r){let{node:n}=e;return[n.variance?r("variance"):"",r("label"),n.optional?"?":"",": ",r("elementType")]}var Al=new WeakSet;function H(e,t,r="typeAnnotation"){let{node:{[r]:n}}=e;if(!n)return"";let s=!1;if(n.type==="TSTypeAnnotation"||n.type==="TypeAnnotation"){let u=e.call($i,r);(u==="=>"||u===":"&&d(n,h.Leading))&&(s=!0),Al.add(n)}return s?[" ",t(r)]:t(r)}var $i=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>(r==="returnType"||r==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>r==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareHook")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function on(e,t,r){let n=$i(e);return n?[n," ",r("typeAnnotation")]:r("typeAnnotation")}function pn(e){return[e("elementType"),"[]"]}function cn({node:e},t){let r=e.type==="TSTypeQuery"?"exprName":"argument",n=e.type==="TypeofTypeAnnotation"||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(r),t(n)]}function ln(e,t){let{node:r}=e;return[r.type==="TSTypePredicate"&&r.asserts?"asserts ":r.type==="TypePredicate"&&r.kind?`${r.kind} `:"",t("parameterName"),r.typeAnnotation?[" is ",H(e,t)]:""]}function V(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":w(t)||G(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function mn(e){return e.node.definite||e.match(void 0,(t,r)=>r==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var dl=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function $(e){let{node:t}=e;return t.declare||dl.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var Tl=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function Vt({node:e}){return e.abstract||Tl.has(e.type)?"abstract ":""}function rt(e,t,r){let n=e.node;return n.typeArguments?r("typeArguments"):n.typeParameters?r("typeParameters"):""}function Kr(e,t,r){return["::",r("callee")]}function Et(e,t,r){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||r?[" ",t]:D([x,t])}function yn(e,t){return["...",t("argument"),H(e,t)]}function $t(e){return e.accessibility?e.accessibility+" ":""}function xl(e,t,r,n){let{node:s}=e,u=s.inexact?"...":"";return d(s,h.Dangling)?l([r,u,N(e,t,{indent:!0}),E,n]):[r,u,n]}function Kt(e,t,r){let{node:n}=e,s=[],u="[",i="]",a=n.type==="TupleTypeAnnotation"&&n.types?"types":n.type==="TSTupleType"||n.type==="TupleTypeAnnotation"?"elementTypes":"elements",o=n[a];if(o.length===0)s.push(xl(e,t,u,i));else{let p=v(!1,o,-1),m=(p==null?void 0:p.type)!=="RestElement"&&!n.inexact,f=p===null,y=Symbol("array"),C=!t.__inJestEach&&o.length>1&&o.every((T,B,g)=>{let _=T==null?void 0:T.type;if(!U(T)&&!ue(T))return!1;let M=g[B+1];if(M&&_!==M.type)return!1;let J=U(T)?"elements":"properties";return T[J]&&T[J].length>1}),c=Ts(n,t),A=m?f?",":ce(t)?c?S(",","",{groupId:y}):S(","):"":"";s.push(l([u,D([E,c?gl(e,t,r,A):[hl(e,t,r,a,n.inexact),A],N(e,t)]),E,i],{shouldBreak:C,id:y}))}return s.push(V(e),H(e,r)),s}function Ts(e,t){return U(e)&&e.elements.length>1&&e.elements.every(r=>r&&(ye(r)||Rn(r)&&!d(r.argument))&&!d(r,h.Trailing|h.Line,n=>!ee(t.originalText,j(n),{backwards:!0})))}function Ki({node:e},{originalText:t}){let r=s=>_t(t,Mt(t,s)),n=s=>t[s]===","?s:n(r(s+1));return vt(t,n(P(e)))}function hl(e,t,r,n,s){let u=[];return e.each(({node:i,isLast:a})=>{u.push(i?l(r()):""),(!a||s)&&u.push([",",x,i&&Ki(e,t)?E:""])},n),s&&u.push("..."),u}function gl(e,t,r,n){let s=[];return e.each(({isLast:u,next:i})=>{s.push([r(),u?n:","]),u||s.push(Ki(e,t)?[F,F]:d(i,h.Leading|h.Line)?F:x)},"elements"),Nr(s)}var Sl=/^[\$A-Z_a-z\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,Bl=e=>Sl.test(e),Qi=Bl;function bl(e){return e.length===1?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var Ft=bl;var fn=new WeakMap;function Zi(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function zi(e,t){return t.parser==="json"||t.parser==="jsonc"||!K(e.key)||ut(ae(e.key),t).slice(1,-1)!==e.key.value?!1:!!(Qi(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||(t.parser==="typescript"||t.parser==="oxc-ts")&&e.type==="PropertyDefinition")||Zi(e.key.value)&&String(Number(e.key.value))===e.key.value&&e.type!=="ImportAttribute"&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="oxc"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function Pl(e,t){let{key:r}=e.node;return(r.type==="Identifier"||ye(r)&&Zi(Ft(ae(r)))&&String(r.value)===Ft(ae(r))&&!(t.parser==="typescript"||t.parser==="babel-ts"||t.parser==="oxc-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&fn.get(e.parent))}function Ct(e,t,r){let{node:n}=e;if(n.computed)return["[",r("key"),"]"];let{parent:s}=e,{key:u}=n;if(t.quoteProps==="consistent"&&!fn.has(s)){let i=e.siblings.some(a=>!a.computed&&K(a.key)&&!zi(a,t));fn.set(s,i)}if(Pl(e,t)){let i=ut(JSON.stringify(u.type==="Identifier"?u.name:u.value.toString()),t);return e.call(a=>Ee(a,i,t),"key")}return zi(n,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!fn.get(s))?e.call(i=>Ee(i,/^\d/u.test(u.value)?Ft(u.value):u.value,t),"key"):r("key")}function Dn(e,t,r){let{node:n}=e;return n.shorthand?r("value"):ht(e,t,r,Ct(e,t,r),":","value")}var kl=({node:e,key:t,parent:r})=>t==="value"&&e.type==="FunctionExpression"&&(r.type==="ObjectMethod"||r.type==="ClassMethod"||r.type==="ClassPrivateMethod"||r.type==="MethodDefinition"||r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"||r.type==="Property"&&bt(r));function En(e,t,r,n){if(kl(e))return Fn(e,t,r);let{node:s}=e,u=!1;if((s.type==="FunctionDeclaration"||s.type==="FunctionExpression")&&(n!=null&&n.expandLastArg)){let{parent:m}=e;w(m)&&(le(m).length>1||Q(s).every(f=>f.type==="Identifier"&&!f.typeAnnotation))&&(u=!0)}let i=[$(e),s.async?"async ":"",`function${s.generator?"*":""} `,s.id?r("id"):""],a=Ue(e,t,r,u),o=Qt(e,r),p=ct(s,o);return i.push(rt(e,t,r),l([p?l(a):a,o]),s.body?" ":"",r("body")),t.semi&&(s.declare||!s.body)&&i.push(";"),i}function Er(e,t,r){let{node:n}=e,{kind:s}=n,u=n.value||n,i=[];return!s||s==="init"||s==="method"||s==="constructor"?u.async&&i.push("async "):(jt.ok(s==="get"||s==="set"),i.push(s," ")),u.generator&&i.push("*"),i.push(Ct(e,t,r),n.optional?"?":"",n===u?Fn(e,t,r):r("value")),i}function Fn(e,t,r){let{node:n}=e,s=Ue(e,t,r),u=Qt(e,r),i=Hi(n),a=ct(n,u),o=[rt(e,t,r),l([i?l(s,{shouldBreak:!0}):a?l(s):s,u])];return n.body?o.push(" ",r("body")):o.push(t.semi?";":""),o}function Il(e){let t=Q(e);return t.length===1&&!e.typeParameters&&!d(e,h.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!d(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Cn(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:r}=e;return Il(r)}return!1}function Qt(e,t){let{node:r}=e,s=[H(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function ea(e,t,r){let{node:n}=e,s=t.semi?";":"",u=[];if(n.argument){let o=r("argument");Ll(t,n.argument)?o=["(",D([F,o]),F,")"]:(Fe(n.argument)||t.experimentalTernaries&&n.argument.type==="ConditionalExpression"&&(n.argument.consequent.type==="ConditionalExpression"||n.argument.alternate.type==="ConditionalExpression"))&&(o=l([S("("),D([E,o]),E,S(")")])),u.push(" ",o)}let i=d(n,h.Dangling),a=s&&i&&d(n,h.Last|h.Line);return a&&u.push(s),i&&u.push(" ",N(e,t)),a||u.push(s),u}function ta(e,t,r){return["return",ea(e,t,r)]}function ra(e,t,r){return["throw",ea(e,t,r)]}function Ll(e,t){if(de(e.originalText,t)||d(t,h.Leading,r=>ie(e.originalText,j(r),P(r)))&&!Y(t))return!0;if(Jt(t)){let r=t,n;for(;n=mu(r);)if(r=n,de(e.originalText,r))return!0}return!1}var bs=new WeakMap;function na(e){return bs.has(e)||bs.set(e,e.type==="ConditionalExpression"&&!pe(e,t=>t.type==="ObjectExpression")),bs.get(e)}var wl=e=>e.type==="SequenceExpression";function sa(e,t,r,n={}){let s=[],u,i=[],a=!1,o=!n.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",p;(function B(){let{node:g}=e,_=Ol(e,t,r,n);if(s.length===0)s.push(_);else{let{leading:M,trailing:J}=fs(e,t);s.push([M,_]),i.unshift(J)}o&&(a||(a=g.returnType&&Q(g).length>0||g.typeParameters||Q(g).some(M=>M.type!=="Identifier"))),!o||g.body.type!=="ArrowFunctionExpression"?(u=r("body",n),p=g.body):e.call(B,"body")})();let m=!de(t.originalText,p)&&(wl(p)||_l(p,u,t)||!a&&na(p)),f=e.key==="callee"&&yt(e.parent),y=Symbol("arrow-chain"),C=Ml(e,n,{signatureDocs:s,shouldBreak:a}),c=!1,A=!1,T=!1;return o&&(f||n.assignmentLayout)&&(A=!0,T=!d(e.node,h.Leading&h.Line),c=n.assignmentLayout==="chain-tail-arrow-chain"||f&&!m),u=vl(e,t,n,{bodyDoc:u,bodyComments:i,functionBody:p,shouldPutBodyOnSameLine:m}),l([l(A?D([T?E:"",C]):C,{shouldBreak:c,id:y})," =>",o?xt(u,{groupId:y}):l(u),o&&f?S(E,"",{groupId:y}):""])}function Ol(e,t,r,n){let{node:s}=e,u=[];if(s.async&&u.push("async "),Cn(e,t))u.push(r(["params",0]));else{let a=n.expandLastArg||n.expandFirstArg,o=Qt(e,r);if(a){if(re(o))throw new Dt;o=l(cr(o))}u.push(l([Ue(e,t,r,a,!0),o]))}let i=N(e,t,{filter(a){let o=ot(t.originalText,P(a));return o!==!1&&t.originalText.slice(o,o+2)==="=>"}});return i&&u.push(" ",i),u}function _l(e,t,r){var n,s;return U(e)||ue(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||Y(e)||((n=t.label)==null?void 0:n.hug)!==!1&&(((s=t.label)==null?void 0:s.embed)||_r(e,r.originalText))}function Ml(e,t,{signatureDocs:r,shouldBreak:n}){if(r.length===1)return r[0];let{parent:s,key:u}=e;return u!=="callee"&&yt(s)||Fe(s)?l([r[0]," =>",D([x,b([" =>",x],r.slice(1))])],{shouldBreak:n}):u==="callee"&&yt(s)||t.assignmentLayout?l(b([" =>",x],r),{shouldBreak:n}):l(D(b([" =>",x],r)),{shouldBreak:n})}function vl(e,t,r,{bodyDoc:n,bodyComments:s,functionBody:u,shouldPutBodyOnSameLine:i}){let{node:a,parent:o}=e,p=r.expandLastArg&&ce(t,"all")?S(","):"",m=(r.expandLastArg||o.type==="JSXExpressionContainer")&&!d(a)?E:"";return i&&na(u)?[" ",l([S("","("),D([E,n]),S("",")"),p,m]),s]:i?[" ",n,s]:[D([x,n,s]),p,m]}var jl=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let s=t[n];if(r(s,n,t))return s}}},ua=jl;function Fr(e,t,r,n){let{node:s}=e,u=[],i=ua(!1,s[n],a=>a.type!=="EmptyStatement");return e.each(({node:a})=>{a.type!=="EmptyStatement"&&(u.push(r()),a!==i&&(u.push(F),me(a,t)&&u.push(F)))},n),u}function An(e,t,r){let n=Rl(e,t,r),{node:s,parent:u}=e;if(s.type==="Program"&&(u==null?void 0:u.type)!=="ModuleExpression")return n?[n,F]:"";let i=[];if(s.type==="StaticBlock"&&i.push("static "),i.push("{"),n)i.push(D([F,n]),F);else{let a=e.grandparent;u.type==="ArrowFunctionExpression"||u.type==="FunctionExpression"||u.type==="FunctionDeclaration"||u.type==="ComponentDeclaration"||u.type==="HookDeclaration"||u.type==="ObjectMethod"||u.type==="ClassMethod"||u.type==="ClassPrivateMethod"||u.type==="ForStatement"||u.type==="WhileStatement"||u.type==="DoWhileStatement"||u.type==="DoExpression"||u.type==="ModuleExpression"||u.type==="CatchClause"&&!a.finalizer||u.type==="TSModuleDeclaration"||s.type==="StaticBlock"||i.push(F)}return i.push("}"),i}function Rl(e,t,r){let{node:n}=e,s=O(n.directives),u=n.body.some(o=>o.type!=="EmptyStatement"),i=d(n,h.Dangling);if(!s&&!u&&!i)return"";let a=[];return s&&(a.push(Fr(e,t,r,"directives")),(u||i)&&(a.push(F),me(v(!1,n.directives,-1),t)&&a.push(F))),u&&a.push(Fr(e,t,r,"body")),i&&a.push(N(e,t)),a}function Jl(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}}var dn=Jl;var Cr=dn("typeParameters");function Nl(e,t,r){let{node:n}=e;return Q(n).length===1&&n.type.startsWith("TS")&&!n[r][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/u.test(t.filepath))}function wt(e,t,r,n){let{node:s}=e;if(!s[n])return"";if(!Array.isArray(s[n]))return r(n);let u=Pt(e.grandparent),i=e.match(p=>!(p[n].length===1&&Re(p[n][0])),void 0,(p,m)=>m==="typeAnnotation",p=>p.type==="Identifier",hs);if(s[n].length===0||!i&&(u||s[n].length===1&&(s[n][0].type==="NullableTypeAnnotation"||Ss(s[n][0]))))return["<",b(", ",e.map(r,n)),Gl(e,t),">"];let o=s.type==="TSTypeParameterInstantiation"?"":Nl(e,t,n)?",":ce(t)?S(","):"";return l(["<",D([E,b([",",x],e.map(r,n))]),o,E,">"],{id:Cr(s)})}function Gl(e,t){let{node:r}=e;if(!d(r,h.Dangling))return"";let n=!d(r,h.Line),s=N(e,t,{indent:!n});return n?s:[s,F]}function Tn(e,t,r){let{node:n}=e,s=[n.const?"const ":""],u=n.type==="TSTypeParameter"?r("name"):n.name;if(n.variance&&s.push(r("variance")),n.in&&s.push("in "),n.out&&s.push("out "),s.push(u),n.bound&&(n.usesExtendsBound&&s.push(" extends "),s.push(H(e,r,"bound"))),n.constraint){let i=Symbol("constraint");s.push(" extends",l(D(x),{id:i}),je,xt(r("constraint"),{groupId:i}))}return n.default&&s.push(" = ",r("default")),l(s)}var ia=R(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function xn(e,t,r){let{node:n}=e,s=[$(e),Vt(e),"class"],u=d(n.id,h.Trailing)||d(n.typeParameters,h.Trailing)||d(n.superClass)||O(n.extends)||O(n.mixins)||O(n.implements),i=[],a=[];if(n.id&&i.push(" ",r("id")),i.push(r("typeParameters")),n.superClass){let m=[Wl(e,t,r),r(n.superTypeArguments?"superTypeArguments":"superTypeParameters")],f=e.call(y=>["extends ",Ee(y,m,t)],"superClass");u?a.push(x,l(f)):a.push(" ",f)}else a.push(Ps(e,t,r,"extends"));a.push(Ps(e,t,r,"mixins"),Ps(e,t,r,"implements"));let o;if(u){let m;pa(n)?m=[...i,D(a)]:m=D([...i,a]),o=aa(n),s.push(l(m,{id:o}))}else s.push(...i,...a);let p=n.body;return u&&O(p.body)?s.push(S(F," ",{groupId:o})):s.push(" "),s.push(r("body")),s}var aa=dn("heritageGroup");function oa(e){return S(F,"",{groupId:aa(e)})}function ql(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}function pa(e){return e.typeParameters&&!d(e.typeParameters,h.Trailing|h.Line)&&!ql(e)}function Ps(e,t,r,n){let{node:s}=e;if(!O(s[n]))return"";let u=N(e,t,{marker:n});return[pa(s)?S(" ",x,{groupId:Cr(s.typeParameters)}):x,u,u&&F,n,l(D([x,b([",",x],e.map(r,n))]))]}function Wl(e,t,r){let n=r("superClass"),{parent:s}=e;return s.type==="AssignmentExpression"?l(S(["(",D([E,n]),E,")"],n)):n}function hn(e,t,r){let{node:n}=e,s=[];return O(n.decorators)&&s.push(ds(e,t,r)),s.push($t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),s.push(Er(e,t,r)),s}function gn(e,t,r){let{node:n}=e,s=[],u=t.semi?";":"";O(n.decorators)&&s.push(ds(e,t,r)),s.push($(e),$t(n)),n.static&&s.push("static "),s.push(Vt(e)),n.override&&s.push("override "),n.readonly&&s.push("readonly "),n.variance&&s.push(r("variance")),(n.type==="ClassAccessorProperty"||n.type==="AccessorProperty"||n.type==="TSAbstractAccessorProperty")&&s.push("accessor "),s.push(Ct(e,t,r),V(e),mn(e),H(e,r));let i=n.type==="TSAbstractPropertyDefinition"||n.type==="TSAbstractAccessorProperty";return[ht(e,t,r,s," =",i?void 0:"value"),u]}function ca(e,t,r){let{node:n}=e,s=[];return e.each(({node:u,next:i,isLast:a})=>{s.push(r()),!t.semi&&ia(u)&&Ul(u,i)&&s.push(";"),a||(s.push(F),me(u,t)&&s.push(F))},"body"),d(n,h.Dangling)&&s.push(N(e,t)),["{",s.length>0?[D([F,s]),F]:"","}"]}function Ul(e,t){var s;let{type:r,name:n}=e.key;if(!e.computed&&r==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let u=(s=t.key)==null?void 0:s.name;if(u==="in"||u==="instanceof")return!0}if(ia(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let i=t.value?t.value.generator:t.generator;return!!(t.computed||i)}case"TSIndexSignature":return!0}return!1}var Xl=R(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function ks(e){return Xl(e)?ks(e.expression):e}var la=R(["FunctionExpression","ArrowFunctionExpression"]);function ma(e){return e.type==="MemberExpression"||e.type==="OptionalMemberExpression"||e.type==="Identifier"&&e.name!=="undefined"}function ya(e,t){if(t.semi||Is(e,t)||Ls(e,t))return!1;let{node:r,key:n,parent:s}=e;return!!(r.type==="ExpressionStatement"&&(n==="body"&&(s.type==="Program"||s.type==="BlockStatement"||s.type==="StaticBlock"||s.type==="TSModuleBlock")||n==="consequent"&&s.type==="SwitchCase")&&e.call(()=>fa(e,t),"expression"))}function fa(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Cn(e,t))return!0;break;case"UnaryExpression":{let{prefix:n,operator:s}=r;if(n&&(s==="+"||s==="-"))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(Y(r))return!0}return Le(e,t)?!0:Jt(r)?e.call(()=>fa(e,t),...Lr(r)):!1}function Is({node:e,parent:t},r){return(r.parentParser==="markdown"||r.parentParser==="mdx")&&e.type==="ExpressionStatement"&&Y(e.expression)&&t.type==="Program"&&t.body.length===1}function Ls({node:e,parent:t},r){return(r.parser==="__vue_event_binding"||r.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function Da(e,t,r){let n=[r("expression")];if(Ls(e,t)){let s=ks(e.node.expression);(la(s)||ma(s))&&n.push(";")}else Is(e,t)||t.semi&&n.push(";");return n}function Ea(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let n=e.map(r,"program","body",0,"params");if(n.length===1)return n[0];let s=b([",",x],n);return t.__isVueForBindingLeft?["(",D([E,l(s)]),E,")"]:s}if(t.__isEmbeddedTypescriptGenericParameters){let n=e.map(r,"program","body",0,"typeParameters","params");return b([",",x],n)}}function Aa(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return Fa(r);case"BigIntLiteral":return Sn(r.extra.raw);case"NumericLiteral":return Ft(r.extra.raw);case"StringLiteral":return ve(ut(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DirectiveLiteral":return Ca(r.extra.raw,t);case"Literal":{if(r.regex)return Fa(r.regex);if(r.bigint)return Sn(r.raw);let{value:n}=r;return typeof n=="number"?Ft(r.raw):typeof n=="string"?Yl(e)?Ca(r.raw,t):ve(ut(r.raw,t)):String(n)}}}function Yl(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&typeof t.directive=="string"}function Sn(e){return e.toLowerCase()}function Fa({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function Ca(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let n=t.singleQuote?"'":'"';return n+r+n}function Hl(e,t,r){let n=e.originalText.slice(t,r);for(let s of e[Symbol.for("comments")]){let u=j(s);if(u>r)break;let i=P(s);if(ie.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function Bn(e,t,r){let{node:n}=e,s=[wi(e,t,r),$(e),"export",Ta(n)?" default":""],{declaration:u,exported:i}=n;return d(n,h.Dangling)&&(s.push(" ",N(e,t)),Mr(n)&&s.push(F)),u?s.push(" ",r("declaration")):(s.push(Kl(n)),n.type==="ExportAllDeclaration"||n.type==="DeclareExportAllDeclaration"?(s.push(" *"),i&&s.push(" as ",r("exported"))):s.push(ha(e,t,r)),s.push(xa(e,t,r),Sa(e,t,r))),s.push($l(n,t)),s}var Vl=R(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function $l(e,t){return t.semi&&(!e.declaration||Ta(e)&&!Vl(e.declaration))?";":""}function ws(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function Os(e,t){return ws(e.importKind,t)}function Kl(e){return ws(e.exportKind)}function xa(e,t,r){let{node:n}=e;if(!n.source)return"";let s=[];return ga(n,t)&&s.push(" from"),s.push(" ",r("source")),s}function ha(e,t,r){let{node:n}=e;if(!ga(n,t))return"";let s=[" "];if(O(n.specifiers)){let u=[],i=[];e.each(()=>{let a=e.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")u.push(r());else if(a==="ExportSpecifier"||a==="ImportSpecifier")i.push(r());else throw new qe(n,"specifier")},"specifiers"),s.push(b(", ",u)),i.length>0&&(u.length>0&&s.push(", "),i.length>1||u.length>0||n.specifiers.some(o=>d(o))?s.push(l(["{",D([t.bracketSpacing?x:E,b([",",x],i)]),S(ce(t)?",":""),t.bracketSpacing?x:E,"}"])):s.push(["{",t.bracketSpacing?" ":"",...i,t.bracketSpacing?" ":"","}"]))}else s.push("{}");return s}function ga(e,t){return e.type!=="ImportDeclaration"||O(e.specifiers)||e.importKind==="type"?!0:Ar(t,j(e),j(e.source)).trimEnd().endsWith("from")}function Ql(e,t){var n,s;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let r=Ar(t,P(e.source),(s=e.attributes)!=null&&s[0]?j(e.attributes[0]):P(e)).trimStart();return r.startsWith("assert")?"assert":r.startsWith("with")||O(e.attributes)?"with":void 0}function Sa(e,t,r){let{node:n}=e;if(!n.source)return"";let s=Ql(n,t);if(!s)return"";let u=[` ${s} {`];return O(n.attributes)&&(t.bracketSpacing&&u.push(" "),u.push(b(", ",e.map(r,"attributes"))),t.bracketSpacing&&u.push(" ")),u.push("}"),u}function Ba(e,t,r){let{node:n}=e,{type:s}=n,u=s.startsWith("Import"),i=u?"imported":"local",a=u?"local":"exported",o=n[i],p=n[a],m="",f="";return s==="ExportNamespaceSpecifier"||s==="ImportNamespaceSpecifier"?m="*":o&&(m=r(i)),p&&!zl(n)&&(f=r(a)),[ws(s==="ImportSpecifier"?n.importKind:n.exportKind,!1),m,m&&f?" as ":"",f]}function zl(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;if(t.type!==r.type||!au(t,r))return!1;if(K(t))return t.value===r.value&&ae(t)===ae(r);switch(t.type){case"Identifier":return t.name===r.name;default:return!1}}function gt(e,t,r){var J;let n=t.semi?";":"",{node:s}=e,u=s.type==="ObjectTypeAnnotation",i=s.type==="TSEnumBody"||s.type==="EnumBooleanBody"||s.type==="EnumNumberBody"||s.type==="EnumBigIntBody"||s.type==="EnumStringBody"||s.type==="EnumSymbolBody",a=[s.type==="TSTypeLiteral"||i?"members":s.type==="TSInterfaceBody"?"body":"properties"];u&&a.push("indexers","callProperties","internalSlots");let o=a.flatMap(I=>e.map(({node:q})=>({node:q,printed:r(),loc:j(q)}),I));a.length>1&&o.sort((I,q)=>I.loc-q.loc);let{parent:p,key:m}=e,f=u&&m==="body"&&(p.type==="InterfaceDeclaration"||p.type==="DeclareInterface"||p.type==="DeclareClass"),y=s.type==="TSInterfaceBody"||i||f||s.type==="ObjectPattern"&&p.type!=="FunctionDeclaration"&&p.type!=="FunctionExpression"&&p.type!=="ArrowFunctionExpression"&&p.type!=="ObjectMethod"&&p.type!=="ClassMethod"&&p.type!=="ClassPrivateMethod"&&p.type!=="AssignmentPattern"&&p.type!=="CatchClause"&&s.properties.some(I=>I.value&&(I.value.type==="ObjectPattern"||I.value.type==="ArrayPattern"))||s.type!=="ObjectPattern"&&t.objectWrap==="preserve"&&o.length>0&&ie(t.originalText,j(s),o[0].loc),C=f?";":s.type==="TSInterfaceBody"||s.type==="TSTypeLiteral"?S(n,";"):",",c=s.exact?"{|":"{",A=s.exact?"|}":"}",T=[],B=o.map(I=>{let q=[...T,l(I.printed)];return T=[C,x],(I.node.type==="TSPropertySignature"||I.node.type==="TSMethodSignature"||I.node.type==="TSConstructSignatureDeclaration"||I.node.type==="TSCallSignatureDeclaration")&&d(I.node,h.PrettierIgnore)&&T.shift(),me(I.node,t)&&T.push(F),q});if(s.inexact||s.hasUnknownMembers){let I;if(d(s,h.Dangling)){let q=d(s,h.Line);I=[N(e,t),q||ee(t.originalText,P(v(!1,Ve(s),-1)))?F:x,"..."]}else I=["..."];B.push([...T,...I])}let g=(J=v(!1,o,-1))==null?void 0:J.node,_=!(s.inexact||s.hasUnknownMembers||g&&(g.type==="RestElement"||(g.type==="TSPropertySignature"||g.type==="TSCallSignatureDeclaration"||g.type==="TSMethodSignature"||g.type==="TSConstructSignatureDeclaration"||g.type==="TSIndexSignature")&&d(g,h.PrettierIgnore))||e.match(void 0,(I,q)=>I.type==="TSImportType"&&q==="options")),M;if(B.length===0){if(!d(s,h.Dangling))return[c,A,H(e,r)];M=l([c,N(e,t,{indent:!0}),E,A,V(e),H(e,r)])}else M=[f&&O(s.properties)?oa(p):"",c,D([t.bracketSpacing?x:E,...B]),S(_&&(C!==","||ce(t))?C:""),t.bracketSpacing?x:E,A,V(e),H(e,r)];return e.match(I=>I.type==="ObjectPattern"&&!O(I.decorators),_s)||Re(s)&&(e.match(void 0,(I,q)=>q==="typeAnnotation",(I,q)=>q==="typeAnnotation",_s)||e.match(void 0,(I,q)=>I.type==="FunctionTypeParam"&&q==="typeAnnotation",_s))||!y&&e.match(I=>I.type==="ObjectPattern",I=>I.type==="AssignmentExpression"||I.type==="VariableDeclarator")?M:l(M,{shouldBreak:y})}function _s(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&gs(e)}function Zl(e){let t=[e];for(let r=0;ry[W]===n),c=y.type===n.type&&!C,A,T,B=0;do T=A||n,A=e.getParentNode(B),B++;while(A&&A.type===n.type&&a.every(W=>A[W]!==T));let g=A||y,_=T;if(s&&(Y(n[a[0]])||Y(o)||Y(p)||Zl(_))){f=!0,c=!0;let W=Z=>[S("("),D([E,Z]),E,S(")")],ne=Z=>Z.type==="NullLiteral"||Z.type==="Literal"&&Z.value===null||Z.type==="Identifier"&&Z.name==="undefined";m.push(" ? ",ne(o)?r(u):W(r(u))," : ",p.type===n.type||ne(p)?r(i):W(r(i)))}else{let W=Z=>t.useTabs?D(r(Z)):be(2,r(Z)),ne=[x,"? ",o.type===n.type?S("","("):"",W(u),o.type===n.type?S("",")"):"",x,": ",W(i)];m.push(y.type!==n.type||y[i]===n||C?ne:t.useTabs?Jr(D(ne)):be(Math.max(0,t.tabWidth-2),ne))}let M=[u,i,...a].some(W=>d(n[W],ne=>te(ne)&&ie(t.originalText,j(ne),P(ne)))),J=W=>y===g?l(W,{shouldBreak:M}):M?[W,Ce]:W,I=!f&&(G(y)||y.type==="NGPipeExpression"&&y.left===n)&&!y.computed,q=rm(e),k=J([em(e,t,r),c?m:D(m),s&&I&&!q?E:""]);return C||q?l([D([E,k]),E]):k}function nm(e,t){return(G(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function sm(e,t,r,n){return[...e.map(u=>Ve(u)),Ve(t),Ve(r)].flat().some(u=>te(u)&&ie(n.originalText,j(u),P(u)))}var um=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function im(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||w(u)&&u.callee===n||G(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||xe(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[um.get(r.type)]===n}var Ms=e=>[S("("),D([E,e]),E,S(")")];function zt(e,t,r,n){if(!t.experimentalTernaries)return ba(e,t,r);let{node:s}=e,u=s.type==="ConditionalExpression",i=Je(s),a=u?"consequent":"trueType",o=u?"alternate":"falseType",p=u?["test"]:["checkType","extendsType"],m=s[a],f=s[o],y=p.map(Xe=>s[Xe]),{parent:C}=e,c=C.type===s.type,A=c&&p.some(Xe=>C[Xe]===s),T=c&&C[o]===s,B=m.type===s.type,g=f.type===s.type,_=g||T,M=t.tabWidth>2||t.useTabs,J,I,q=0;do I=J||s,J=e.getParentNode(q),q++;while(J&&J.type===s.type&&p.every(Xe=>J[Xe]!==I));let k=J||C,W=n&&n.assignmentLayout&&n.assignmentLayout!=="break-after-operator"&&(C.type==="AssignmentExpression"||C.type==="VariableDeclarator"||C.type==="ClassProperty"||C.type==="PropertyDefinition"||C.type==="ClassPrivateProperty"||C.type==="ObjectProperty"||C.type==="Property"),ne=(C.type==="ReturnStatement"||C.type==="ThrowStatement")&&!(B||g),Z=u&&k.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",lt=im(e),L=nm(s,C),se=i&&Le(e,t),Ae=M?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",Ot=sm(y,m,f,t)||B||g,nt=!_&&!c&&!i&&(Z?m.type==="NullLiteral"||m.type==="Literal"&&m.value===null:ir(m,t)&&Nn(s.test,3)),Js=_||T||i&&!c||c&&u&&Nn(s.test,1)||nt,Ns=[];!B&&d(m,h.Dangling)&&e.call(Xe=>{Ns.push(N(Xe,t),F)},"consequent");let er=[];d(s.test,h.Dangling)&&e.call(Xe=>{er.push(N(Xe,t))},"test"),!g&&d(f,h.Dangling)&&e.call(Xe=>{er.push(N(Xe,t))},"alternate"),d(s,h.Dangling)&&er.push(N(e,t));let Gs=Symbol("test"),Va=Symbol("consequent"),dr=Symbol("test-and-consequent"),$a=u?[Ms(r("test")),s.test.type==="ConditionalExpression"?Ce:""]:[r("checkType")," ","extends"," ",Je(s.extendsType)||s.extendsType.type==="TSMappedType"?r("extendsType"):l(Ms(r("extendsType")))],qs=l([$a," ?"],{id:Gs}),Ka=r(a),Tr=D([B||Z&&(Y(m)||c||_)?F:x,Ns,Ka]),Qa=Js?l([qs,_?Tr:S(Tr,l(Tr,{id:Va}),{groupId:Gs})],{id:dr}):[qs,Tr],wn=r(o),Ws=nt?S(wn,Jr(Ms(wn)),{groupId:dr}):wn,tr=[Qa,er.length>0?[D([F,er]),F]:g?F:nt?S(x," ",{groupId:dr}):x,":",g?" ":M?Js?S(Ae,S(_||nt?" ":Ae," "),{groupId:dr}):S(Ae," "):" ",g?Ws:l([D(Ws),Z&&!nt?E:""]),L&&!lt?E:"",Ot?Ce:""];return W&&!Ot?l(D([E,l(tr)])):W||ne?l(D(tr)):lt||i&&A?l([D([E,tr]),se?E:""]):C===k?l(tr):tr}function Pa(e,t,r,n){let{node:s}=e;if(wr(s))return Aa(e,t);let u=t.semi?";":"",i=[];switch(s.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[N(e,t),r("node"),F];case"File":return Ea(e,t,r)??r("program");case"EmptyStatement":return"";case"ExpressionStatement":return Da(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return!d(s.expression)&&(ue(s.expression)||U(s.expression))?["(",r("expression"),")"]:l(["(",D([E,r("expression")]),E,")"]);case"AssignmentExpression":return Wi(e,t,r);case"VariableDeclarator":return Ui(e,t,r);case"BinaryExpression":case"LogicalExpression":return $r(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Ri(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return s.object&&i.push(r("object")),i.push(l(D([E,Kr(e,t,r)]))),i;case"Identifier":return[s.name,V(e),mn(e),H(e,r)];case"V8IntrinsicIdentifier":return["%",s.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return yn(e,r);case"FunctionDeclaration":case"FunctionExpression":return En(e,t,r,n);case"ArrowFunctionExpression":return sa(e,t,r,n);case"YieldExpression":return i.push("yield"),s.delegate&&i.push("*"),s.argument&&i.push(" ",r("argument")),i;case"AwaitExpression":if(i.push("await"),s.argument){i.push(" ",r("argument"));let{parent:a}=e;if(w(a)&&a.callee===s||G(a)&&a.object===s){i=[D([E,...i]),E];let o=e.findAncestor(p=>p.type==="AwaitExpression"||p.type==="BlockStatement");if((o==null?void 0:o.type)!=="AwaitExpression"||!pe(o.argument,p=>p===s))return l(i)}}return i;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Bn(e,t,r);case"ImportDeclaration":return da(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Ba(e,t,r);case"ImportAttribute":return Dn(e,t,r);case"Program":case"BlockStatement":case"StaticBlock":return An(e,t,r);case"ClassBody":return ca(e,t,r);case"ThrowStatement":return ra(e,t,r);case"ReturnStatement":return ta(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Qr(e,t,r);case"ObjectExpression":case"ObjectPattern":return gt(e,t,r);case"Property":return bt(s)?Er(e,t,r):Dn(e,t,r);case"ObjectProperty":return Dn(e,t,r);case"ObjectMethod":return Er(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":return Kt(e,t,r);case"SequenceExpression":{let{parent:a}=e;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let p=[];return e.each(({isFirst:m})=>{m?p.push(r()):p.push(",",D([x,r()]))},"expressions"),l(p)}let o=b([",",x],e.map(r,"expressions"));return(a.type==="ReturnStatement"||a.type==="ThrowStatement")&&e.key==="argument"||a.type==="ArrowFunctionExpression"&&e.key==="body"?l(S([D([E,o]),E],o)):l(o)}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),u];case"UnaryExpression":return i.push(s.operator),/[a-z]$/u.test(s.operator)&&i.push(" "),d(s.argument)?i.push(l(["(",D([E,r("argument")]),E,")"])):i.push(r("argument")),i;case"UpdateExpression":return[s.prefix?s.operator:"",r("argument"),s.prefix?"":s.operator];case"ConditionalExpression":return zt(e,t,r,n);case"VariableDeclaration":{let a=e.map(r,"declarations"),o=e.parent,p=o.type==="ForStatement"||o.type==="ForInStatement"||o.type==="ForOfStatement",m=s.declarations.some(y=>y.init),f;return a.length===1&&!d(s.declarations[0])?f=a[0]:a.length>0&&(f=D(a[0])),i=[$(e),s.kind,f?[" ",f]:"",D(a.slice(1).map(y=>[",",m&&!p?F:x,y]))],p&&o.body!==s||i.push(u),l(i)}case"WithStatement":return l(["with (",r("object"),")",Et(s.body,r("body"))]);case"IfStatement":{let a=Et(s.consequent,r("consequent")),o=l(["if (",l([D([E,r("test")]),E]),")",a]);if(i.push(o),s.alternate){let p=d(s.consequent,h.Trailing|h.Line)||Mr(s),m=s.consequent.type==="BlockStatement"&&!p;i.push(m?" ":F),d(s,h.Dangling)&&i.push(N(e,t),p?F:" "),i.push("else",l(Et(s.alternate,r("alternate"),s.alternate.type==="IfStatement")))}return i}case"ForStatement":{let a=Et(s.body,r("body")),o=N(e,t),p=o?[o,E]:"";return!s.init&&!s.test&&!s.update?[p,l(["for (;;)",a])]:[p,l(["for (",l([D([E,r("init"),";",x,r("test"),";",x,r("update")]),E]),")",a])]}case"WhileStatement":return l(["while (",l([D([E,r("test")]),E]),")",Et(s.body,r("body"))]);case"ForInStatement":return l(["for (",r("left")," in ",r("right"),")",Et(s.body,r("body"))]);case"ForOfStatement":return l(["for",s.await?" await":""," (",r("left")," of ",r("right"),")",Et(s.body,r("body"))]);case"DoWhileStatement":{let a=Et(s.body,r("body"));return i=[l(["do",a])],s.body.type==="BlockStatement"?i.push(" "):i.push(F),i.push("while (",l([D([E,r("test")]),E]),")",u),i}case"DoExpression":return[s.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return i.push(s.type==="BreakStatement"?"break":"continue"),s.label&&i.push(" ",r("label")),i.push(u),i;case"LabeledStatement":return s.body.type==="EmptyStatement"?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),s.handler?[" ",r("handler")]:"",s.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(s.param){let a=d(s.param,p=>!te(p)||p.leading&&ee(t.originalText,P(p))||p.trailing&&ee(t.originalText,j(p),{backwards:!0})),o=r("param");return["catch ",a?["(",D([E,o]),E,") "]:["(",o,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[l(["switch (",D([E,r("discriminant")]),E,")"])," {",s.cases.length>0?D([F,b(F,e.map(({node:a,isLast:o})=>[r(),!o&&me(a,t)?F:""],"cases"))]):"",F,"}"];case"SwitchCase":{s.test?i.push("case ",r("test"),":"):i.push("default:"),d(s,h.Dangling)&&i.push(" ",N(e,t));let a=s.consequent.filter(o=>o.type!=="EmptyStatement");if(a.length>0){let o=Fr(e,t,r,"consequent");i.push(a.length===1&&a[0].type==="BlockStatement"?[" ",o]:D([F,o]))}return i}case"DebuggerStatement":return["debugger",u];case"ClassDeclaration":case"ClassExpression":return xn(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return hn(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return gn(e,t,r);case"TemplateElement":return ve(s.value.raw);case"TemplateLiteral":return Wr(e,t,r);case"TaggedTemplateExpression":return Zu(e,t,r);case"PrivateIdentifier":return["#",s.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",r("body")];case"InterpreterDirective":default:throw new qe(s,"ESTree")}}function bn(e,t,r){let{parent:n,node:s,key:u}=e,i=[r("expression")];switch(s.type){case"AsConstExpression":i.push(" as const");break;case"AsExpression":case"TSAsExpression":i.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":i.push(" satisfies ",r("typeAnnotation"));break}return u==="callee"&&w(n)||u==="object"&&G(n)?l([D([E,...i]),E]):i}function ka(e,t,r){let{node:n}=e,s=[$(e),"component"];n.id&&s.push(" ",r("id")),s.push(r("typeParameters"));let u=am(e,t,r);return n.rendersType?s.push(l([u," ",r("rendersType")])):s.push(l([u])),n.body&&s.push(" ",r("body")),t.semi&&n.type==="DeclareComponent"&&s.push(";"),s}function am(e,t,r){let{node:n}=e,s=n.params;if(n.rest&&(s=[...s,n.rest]),s.length===0)return["(",N(e,t,{filter:i=>ke(t.originalText,P(i))===")"}),")"];let u=[];return pm(e,(i,a)=>{let o=a===s.length-1;o&&n.rest&&u.push("..."),u.push(r()),!o&&(u.push(","),me(s[a],t)?u.push(F,F):u.push(x))}),["(",D([E,...u]),S(ce(t,"all")&&!om(n,s)?",":""),E,")"]}function om(e,t){var r;return e.rest||((r=v(!1,t,-1))==null?void 0:r.type)==="RestElement"}function pm(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);e.each(s,"params"),r.rest&&e.call(s,"rest")}function Ia(e,t,r){let{node:n}=e;return n.shorthand?r("local"):[r("name")," as ",r("local")]}function La(e,t,r){let{node:n}=e,s=[];return n.name&&s.push(r("name"),n.optional?"?: ":": "),s.push(r("typeAnnotation")),s}function Pn(e,t,r){return gt(e,t,r)}function kn(e,t){let{node:r}=e,n=t("id");r.computed&&(n=["[",n,"]"]);let s="";return r.initializer&&(s=t("initializer")),r.init&&(s=t("init")),s?[n," = ",s]:n}function In(e,t){let{node:r}=e;return[$(e),r.const?"const ":"","enum ",t("id")," ",t("body")]}function Oa(e,t,r){let{node:n}=e,s=["hook"];n.id&&s.push(" ",r("id"));let u=Ue(e,t,r,!1,!0),i=Qt(e,r),a=ct(n,i);return s.push(l([a?l(u):u,i]),n.body?" ":"",r("body")),s}function _a(e,t,r){let{node:n}=e,s=[$(e),"hook"];return n.id&&s.push(" ",r("id")),t.semi&&s.push(";"),s}function wa(e){var r;let{node:t}=e;return t.type==="HookTypeAnnotation"&&((r=e.getParentNode(2))==null?void 0:r.type)==="DeclareHook"}function Ma(e,t,r){let{node:n}=e,s=[];s.push(wa(e)?"":"hook ");let u=Ue(e,t,r,!1,!0),i=[];return i.push(wa(e)?": ":" => ",r("returnType")),ct(n,i)&&(u=l(u)),s.push(u,i),l(s)}function Ln(e,t,r){let{node:n}=e,s=[$(e),"interface"],u=[],i=[];n.type!=="InterfaceTypeAnnotation"&&u.push(" ",r("id"),r("typeParameters"));let a=n.typeParameters&&!d(n.typeParameters,h.Trailing|h.Line);return O(n.extends)&&i.push(a?S(" ",x,{groupId:Cr(n.typeParameters)}):x,"extends ",(n.extends.length===1?du:D)(b([",",x],e.map(r,"extends")))),d(n.id,h.Trailing)||O(n.extends)?a?s.push(l([...u,D(i)])):s.push(l(D([...u,...i]))):s.push(...u,...i),s.push(" ",r("body")),l(s)}function cm(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function ja(e,t,r){let{node:n}=e;return l([n.variance?r("variance"):"","[",D([r("keyTparam")," in ",r("sourceType")]),"]",cm(n.optional),": ",r("propType")])}function va(e,t){return e==="+"||e==="-"?e+t:t}function Ra(e,t,r){let{node:n}=e,s=!1;if(t.objectWrap==="preserve"){let u=j(n),i=Ar(t,u+1,j(n.key)),a=u+1+i.search(/\S/u);ie(t.originalText,u,a)&&(s=!0)}return l(["{",D([t.bracketSpacing?x:E,d(n,h.Dangling)?l([N(e,t),F]):"",l([n.readonly?[va(n.readonly,"readonly")," "]:"","[",r("key")," in ",r("constraint"),n.nameType?[" as ",r("nameType")]:"","]",n.optional?va(n.optional,"?"):"",n.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?S(";"):""]),t.bracketSpacing?x:E,"}"],{shouldBreak:s})}function Ja(e,t,r){let{node:n}=e;if(Pr(n))return n.type.slice(0,-14).toLowerCase();let s=t.semi?";":"";switch(n.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return ka(e,t,r);case"ComponentParameter":return Ia(e,t,r);case"ComponentTypeParameter":return La(e,t,r);case"HookDeclaration":return Oa(e,t,r);case"DeclareHook":return _a(e,t,r);case"HookTypeAnnotation":return Ma(e,t,r);case"DeclareClass":return xn(e,t,r);case"DeclareFunction":return[$(e),"function ",r("id"),r("predicate"),s];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",H(e,r),s];case"DeclareNamespace":return["declare namespace ",r("id")," ",r("body")];case"DeclareVariable":return[$(e),n.kind??"var"," ",r("id"),s];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Bn(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return Vi(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Zr(e,t,r);case"IntersectionTypeAnnotation":return en(e,t,r);case"UnionTypeAnnotation":return tn(e,t,r);case"ConditionalTypeAnnotation":return zt(e,t,r);case"InferTypeAnnotation":return sn(e,t,r);case"FunctionTypeAnnotation":return rn(e,t,r);case"TupleTypeAnnotation":return Kt(e,t,r);case"TupleTypeLabeledElement":return an(e,t,r);case"TupleTypeSpreadElement":return un(e,t,r);case"GenericTypeAnnotation":return[r("id"),wt(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return nn(e,t,r);case"TypeAnnotation":return on(e,t,r);case"TypeParameter":return Tn(e,t,r);case"TypeofTypeAnnotation":return cn(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return pn(r);case"DeclareEnum":case"EnumDeclaration":return In(e,r);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return[n.type==="EnumSymbolBody"||n.explicitType?`of ${n.type.slice(4,-4).toLowerCase()} `:"",Pn(e,t,r)];case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return kn(e,r);case"FunctionTypeParam":{let u=n.name?r("name"):e.parent.this===n?"this":"";return[u,V(e),u?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return Ln(e,t,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:u}=n;return jt.ok(u==="plus"||u==="minus"),u==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[n.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return ja(e,t,r);case"ObjectTypeIndexer":return[n.static?"static ":"",n.variance?r("variance"):"","[",r("id"),n.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let u="";return n.proto?u="proto ":n.static&&(u="static "),[u,n.kind!=="init"?n.kind+" ":"",n.variance?r("variance"):"",Ct(e,t,r),V(e),bt(n)?"":": ",r("value")]}case"ObjectTypeAnnotation":return gt(e,t,r);case"ObjectTypeInternalSlot":return[n.static?"static ":"","[[",r("id"),"]]",V(e),n.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return yn(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(n.value);case"StringLiteralTypeAnnotation":return ve(ut(ae(n),t));case"NumberLiteralTypeAnnotation":return Ft(ae(n));case"BigIntLiteralTypeAnnotation":return Sn(ae(n));case"TypeCastExpression":return["(",r("expression"),H(e,r),")"];case"TypePredicate":return ln(e,r);case"TypeOperator":return[n.operator," ",r("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return wt(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...n.type==="DeclaredPredicate"?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return bn(e,t,r)}}function Na(e,t,r){var i;let{node:n}=e;if(!n.type.startsWith("TS"))return;if(kr(n))return n.type.slice(2,-7).toLowerCase();let s=t.semi?";":"",u=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(U(n.expression)||ue(n.expression)),o=l(["<",D([E,r("typeAnnotation")]),E,">"]),p=[S("("),D([E,r("expression")]),E,S(")")];return a?tt([[o,r("expression")],[o,l(p,{shouldBreak:!0})],[o,r("expression")]]):l([o,r("expression")])}case"TSDeclareFunction":return En(e,t,r);case"TSExportAssignment":return["export = ",r("expression"),s];case"TSModuleBlock":return An(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return gt(e,t,r);case"TSTypeAliasDeclaration":return Zr(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return hn(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return gn(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r(n.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return Wr(e,t,r);case"TSNamedTupleMember":return an(e,t,r);case"TSRestType":return un(e,t,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return Ln(e,t,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return wt(e,t,r,"params");case"TSTypeParameter":return Tn(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":return bn(e,t,r);case"TSArrayType":return pn(r);case"TSPropertySignature":return[n.readonly?"readonly ":"",Ct(e,t,r),V(e),H(e,r)];case"TSParameterProperty":return[$t(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return cn(e,r);case"TSIndexSignature":{let a=n.parameters.length>1?S(ce(t)?",":""):"",o=l([D([E,b([", ",E],e.map(r,"parameters"))]),a,E]),p=e.parent.type==="ClassBody"&&e.key==="body";return[p&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?o:"","]",H(e,r),p?s:""]}case"TSTypePredicate":return ln(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return["import",Lt(e,t,r),n.qualifier?[".",r("qualifier")]:"",wt(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return nn(e,t,r);case"TSTypeOperator":return[n.operator," ",r("typeAnnotation")];case"TSMappedType":return Ra(e,t,r);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";u.push($t(n),a,n.computed?"[":"",r("key"),n.computed?"]":"",V(e));let o=Ue(e,t,r,!1,!0),p=n.returnType?"returnType":"typeAnnotation",m=n[p],f=m?H(e,r,p):"",y=ct(n,f);return u.push(y?l(o):o),m&&u.push(l(f)),l(u)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return In(e,r);case"TSEnumBody":return Pn(e,t,r);case"TSEnumMember":return kn(e,r);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",Os(n,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=e,o=a.type==="TSModuleDeclaration",p=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";return o?u.push("."):(u.push($(e)),n.kind!=="global"&&u.push(n.kind," ")),u.push(r("id")),p?u.push(r("body")):n.body?u.push(" ",l(r("body"))):u.push(s),u}case"TSConditionalType":return zt(e,t,r);case"TSInferType":return sn(e,t,r);case"TSIntersectionType":return en(e,t,r);case"TSUnionType":return tn(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return rn(e,t,r);case"TSTupleType":return Kt(e,t,r);case"TSTypeReference":return[r("typeName"),wt(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return on(e,t,r);case"TSEmptyBodyFunctionExpression":return Fn(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return Bs(e,r,"?");case"TSJSDocNonNullableType":return Bs(e,r,"!");case"TSParenthesizedType":default:throw new qe(n,"TypeScript")}}function lm(e,t,r,n){if(Vr(e))return Ti(e,t);for(let s of[Li,bi,Ja,Na,Pa]){let u=s(e,t,r,n);if(u!==void 0)return u}}var mm=R(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function ym(e,t,r,n){var f;e.isRoot&&((f=t.__onHtmlBindingRoot)==null||f.call(t,e.node,t));let s=lm(e,t,r,n);if(!s)return"";let{node:u}=e;if(mm(u))return s;let i=O(u.decorators),a=Oi(e,t,r),o=u.type==="ClassExpression";if(i&&!o)return lr(s,y=>l([a,y]));let p=Le(e,t),m=ya(e,t);return!a&&!p&&!m?s:lr(s,y=>[m?";":"",p?"(":"",p&&o&&i?[D([x,a,y]),x]:[a,y],p?")":""])}var Ga=ym;var fm={avoidAstMutation:!0};var qa=[{name:"JSON.stringify",type:"data",extensions:[".importmap"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON",type:"data",extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".json.example",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],tmScope:"source.json",aceMode:"json",aliases:["geojson","jsonl","sarif","topojson"],codemirrorMode:"javascript",codemirrorMimeType:"application/json",filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"],linguistLanguageId:174},{name:"JSON with Comments",type:"data",extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],tmScope:"source.json.comments",aceMode:"javascript",aliases:["jsonc"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",group:"JSON",filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"],linguistLanguageId:423},{name:"JSON5",type:"data",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"],linguistLanguageId:175}];var js={};xr(js,{getVisitorKeys:()=>Ua,massageAstNode:()=>Ya,print:()=>Fm});var Dm={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},Wa=Dm;var Em=Br(Wa),Ua=Em;function Fm(e,t,r){let{node:n}=e;switch(n.type){case"JsonRoot":return[r("node"),F];case"ArrayExpression":{if(n.elements.length===0)return"[]";let s=e.map(()=>e.node===null?"null":r(),"elements");return["[",D([F,b([",",F],s)]),F,"]"]}case"ObjectExpression":return n.properties.length===0?"{}":["{",D([F,b([",",F],e.map(r,"properties"))]),F,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return[n.operator==="+"?"":n.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return n.value?"true":"false";case"StringLiteral":return JSON.stringify(n.value);case"NumericLiteral":return Xa(e)?JSON.stringify(String(n.value)):JSON.stringify(n.value);case"Identifier":return Xa(e)?JSON.stringify(n.name):n.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(n.value.cooked);default:throw new qe(n,"JSON")}}function Xa(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var Cm=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Ya(e,t){let{type:r}=e;if(r==="ObjectProperty"){let{key:n}=e;n.type==="Identifier"?t.key={type:"StringLiteral",value:n.name}:n.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(n.value)});return}if(r==="UnaryExpression"&&e.operator==="+")return t.argument;if(r==="ArrayExpression"){for(let[n,s]of e.elements.entries())s===null&&t.elements.splice(n,0,{type:"NullLiteral"});return}if(r==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Ya.ignoredProperties=Cm;var Zt={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var St="JavaScript",Am={arrowParens:{category:St,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Zt.bracketSameLine,objectWrap:Zt.objectWrap,bracketSpacing:Zt.bracketSpacing,jsxBracketSameLine:{category:St,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:St,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:St,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:St,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Zt.singleQuote,jsxSingleQuote:{category:St,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:St,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:St,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Zt.singleAttributePerLine},Ha=Am;var dm={estree:vs,"estree-json":js},Tm=[...Vs,...qa];var Nx=Rs;export{Nx as default,Tm as languages,Ha as options,dm as printers}; diff --git a/.pnpm-store/v10/files/09/439c8bb9bb981343a858b2fdb37a5fc2b2391e173cbadf9e188716a84727da2837af2bf169fea9509d5acb35cdaa1b73f2a31452b89dbc65f99a307a449d2c b/.pnpm-store/v10/files/09/439c8bb9bb981343a858b2fdb37a5fc2b2391e173cbadf9e188716a84727da2837af2bf169fea9509d5acb35cdaa1b73f2a31452b89dbc65f99a307a449d2c new file mode 100644 index 0000000..de3ca62 --- /dev/null +++ b/.pnpm-store/v10/files/09/439c8bb9bb981343a858b2fdb37a5fc2b2391e173cbadf9e188716a84727da2837af2bf169fea9509d5acb35cdaa1b73f2a31452b89dbc65f99a307a449d2c @@ -0,0 +1,76 @@ +var inspect = require('../'); +var test = require('tape'); +var arrow = require('make-arrow-function')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +test('function', function (t) { + t.plan(1); + var obj = [1, 2, function f(n) { return n; }, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); + +test('function name', function (t) { + t.plan(1); + var f = (function () { + return function () {}; + }()); + f.toString = function toStr() { return 'function xxx () {}'; }; + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); +}); + +test('anon function', function (t) { + var f = (function () { + return function () {}; + }()); + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); + + t.end(); +}); + +test('arrow function', { skip: !arrow }, function (t) { + t.equal(inspect(arrow), '[Function (anonymous)]'); + + t.end(); +}); + +test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { + function f() {} + Object.defineProperty(f, 'name', { value: false }); + t.equal(f.name, false); + t.equal( + inspect(f), + '[Function: f]', + 'named function with falsy `.name` does not hide its original name' + ); + + function g() {} + Object.defineProperty(g, 'name', { value: true }); + t.equal(g.name, true); + t.equal( + inspect(g), + '[Function: true]', + 'named function with truthy `.name` hides its original name' + ); + + var anon = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon, 'name', { value: null }); + t.equal(anon.name, null); + t.equal( + inspect(anon), + '[Function (anonymous)]', + 'anon function with falsy `.name` does not hide its anonymity' + ); + + var anon2 = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon2, 'name', { value: 1 }); + t.equal(anon2.name, 1); + t.equal( + inspect(anon2), + '[Function: 1]', + 'anon function with truthy `.name` hides its anonymity' + ); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/09/aeaced7d997d323a7c60777da584c881987096a307d8cb5dcc3499c289d21b58f73b3a1d6da8f230e7baa64ebf8c9f26de64c38ac0874b5187397128ceab69 b/.pnpm-store/v10/files/09/aeaced7d997d323a7c60777da584c881987096a307d8cb5dcc3499c289d21b58f73b3a1d6da8f230e7baa64ebf8c9f26de64c38ac0874b5187397128ceab69 new file mode 100644 index 0000000..63222d7 --- /dev/null +++ b/.pnpm-store/v10/files/09/aeaced7d997d323a7c60777da584c881987096a307d8cb5dcc3499c289d21b58f73b3a1d6da8f230e7baa64ebf8c9f26de64c38ac0874b5187397128ceab69 @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/.pnpm-store/v10/files/09/b1f2590d7426e9d5142b05d903f7e3108ed9731280732e7cf12ded2a5b5b984b4498688f34f5185ae4df511884224b8f6787b7e09d241bf50155a713cbde9f b/.pnpm-store/v10/files/09/b1f2590d7426e9d5142b05d903f7e3108ed9731280732e7cf12ded2a5b5b984b4498688f34f5185ae4df511884224b8f6787b7e09d241bf50155a713cbde9f new file mode 100644 index 0000000..a49ee5a --- /dev/null +++ b/.pnpm-store/v10/files/09/b1f2590d7426e9d5142b05d903f7e3108ed9731280732e7cf12ded2a5b5b984b4498688f34f5185ae4df511884224b8f6787b7e09d241bf50155a713cbde9f @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/.pnpm-store/v10/files/0a/78d67dc9aeb097add6c771ea3207a960c35eed434060c7a005bd19bb5798b7bbed1ae5cc5f6f2f4f7fc1afe99d33d3826d7660c674dbc4c45a88ed4ad24740 b/.pnpm-store/v10/files/0a/78d67dc9aeb097add6c771ea3207a960c35eed434060c7a005bd19bb5798b7bbed1ae5cc5f6f2f4f7fc1afe99d33d3826d7660c674dbc4c45a88ed4ad24740 new file mode 100644 index 0000000..d2b7723 --- /dev/null +++ b/.pnpm-store/v10/files/0a/78d67dc9aeb097add6c771ea3207a960c35eed434060c7a005bd19bb5798b7bbed1ae5cc5f6f2f4f7fc1afe99d33d3826d7660c674dbc4c45a88ed4ad24740 @@ -0,0 +1,10 @@ +'use strict'; + +var bind = require('function-bind'); +var $apply = require('./functionApply'); +var actualApply = require('./actualApply'); + +/** @type {import('./applyBind')} */ +module.exports = function applyBind() { + return actualApply(bind, $apply, arguments); +}; diff --git a/.pnpm-store/v10/files/0a/99a6ad3b94ad3f211fbad2106b8b573df8390ffd9587875ddfa9add9c5a5bdb17269bb0dabea44aed11bf1186b44888dd6657917045619a6ad5805fe77e2ae b/.pnpm-store/v10/files/0a/99a6ad3b94ad3f211fbad2106b8b573df8390ffd9587875ddfa9add9c5a5bdb17269bb0dabea44aed11bf1186b44888dd6657917045619a6ad5805fe77e2ae new file mode 100644 index 0000000..2484942 --- /dev/null +++ b/.pnpm-store/v10/files/0a/99a6ad3b94ad3f211fbad2106b8b573df8390ffd9587875ddfa9add9c5a5bdb17269bb0dabea44aed11bf1186b44888dd6657917045619a6ad5805fe77e2ae @@ -0,0 +1,30 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12 + +### Commits + +- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1) + +## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08 + +### Commits + +- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8) +- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75) +- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940) + +## v1.0.0 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04) +- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f) +- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603) +- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930) diff --git a/.pnpm-store/v10/files/0a/fad6ee7587feafbbebbcd4410f78c1b888c0d22b3068b250761cad6192e99ddc28e78e328c2b05da3a23b5ac384dc3a76d75703d63325363757ee7a018208d b/.pnpm-store/v10/files/0a/fad6ee7587feafbbebbcd4410f78c1b888c0d22b3068b250761cad6192e99ddc28e78e328c2b05da3a23b5ac384dc3a76d75703d63325363757ee7a018208d new file mode 100644 index 0000000..657701c --- /dev/null +++ b/.pnpm-store/v10/files/0a/fad6ee7587feafbbebbcd4410f78c1b888c0d22b3068b250761cad6192e99ddc28e78e328c2b05da3a23b5ac384dc3a76d75703d63325363757ee7a018208d @@ -0,0 +1,180 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +var bomHandling = require("./bom-handling"), + iconv = module.exports; + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; + +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; + +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} + +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var trail = decoder.end(); + + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } +} + +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var codecDef = iconv.encodings[enc]; + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} + +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); + + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + + return encoder; +} + +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(stream_module); + + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; + + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } + + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = require("stream"); +} catch (e) {} + +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); + +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; +} + +if ("Ā" != "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} diff --git a/.pnpm-store/v10/files/0b/345045fddea4442547461aafb70e277f649eac4c360d0dfbdad4d102668eb7cc178912a224952a57181844a5c53ea832a2473b114d581aee53f616a572e613 b/.pnpm-store/v10/files/0b/345045fddea4442547461aafb70e277f649eac4c360d0dfbdad4d102668eb7cc178912a224952a57181844a5c53ea832a2473b114d581aee53f616a572e613 new file mode 100644 index 0000000..582357f --- /dev/null +++ b/.pnpm-store/v10/files/0b/345045fddea4442547461aafb70e277f649eac4c360d0dfbdad4d102668eb7cc178912a224952a57181844a5c53ea832a2473b114d581aee53f616a572e613 @@ -0,0 +1,74 @@ +{ + "name": "fill-range", + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "version": "7.1.1", + "homepage": "https://github.com/jonschlinkert/fill-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Edo Rivai (edo.rivai.nl)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Paul Miller (paulmillr.com)", + "Rouven Weßling (www.rouvenwessling.de)", + "(https://github.com/wtgtybhertgeghgtwtg)" + ], + "repository": "jonschlinkert/fill-range", + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1", + "nyc": "^15.1.0" + }, + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/.pnpm-store/v10/files/0b/3e98519061c69723ee2d907fd34233da495e18ce240b8f1227f21e48e33e23788b18db652fda13e9215e7a071ba09ada063f852199d21e5cb9d9084c03205f b/.pnpm-store/v10/files/0b/3e98519061c69723ee2d907fd34233da495e18ce240b8f1227f21e48e33e23788b18db652fda13e9215e7a071ba09ada063f852199d21e5cb9d9084c03205f new file mode 100644 index 0000000..d19311f --- /dev/null +++ b/.pnpm-store/v10/files/0b/3e98519061c69723ee2d907fd34233da495e18ce240b8f1227f21e48e33e23788b18db652fda13e9215e7a071ba09ada063f852199d21e5cb9d9084c03205f @@ -0,0 +1,122 @@ +'use strict'; + +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; +}; + +/** + * Find a node of the given type + */ + +exports.find = (node, type) => node.nodes.find(node => node.type === type); + +/** + * Find a node of the given type + */ + +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; + +/** + * Escape the given node with '\\' before node.value + */ + +exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; + +/** + * Returns true if the given brace node should be enclosed in literal braces + */ + +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a brace node is invalid. + */ + +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a node is an open or close node + */ + +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; + +/** + * Reduce an array of text nodes. + */ + +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); + +/** + * Flatten an array + */ + +exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; +}; diff --git a/.pnpm-store/v10/files/0b/e4e9e09799b6acfd1b3e5a02265c2bb49d0e0770370befb80da5c79aefaad18c18e333e8bae445290fae75c5c94f1c09f7277b43364d9a6af3efed311e8826 b/.pnpm-store/v10/files/0b/e4e9e09799b6acfd1b3e5a02265c2bb49d0e0770370befb80da5c79aefaad18c18e333e8bae445290fae75c5c94f1c09f7277b43364d9a6af3efed311e8826 new file mode 100644 index 0000000..6996282 --- /dev/null +++ b/.pnpm-store/v10/files/0b/e4e9e09799b6acfd1b3e5a02265c2bb49d0e0770370befb80da5c79aefaad18c18e333e8bae445290fae75c5c94f1c09f7277b43364d9a6af3efed311e8826 @@ -0,0 +1,82 @@ + +/** + * Store + */ + +var evt = {}; + +/** + * Expose + */ + +module.exports = { + + /** + * On + * + * @param {String} key + * @param {Function} fn + * @api public + */ + + on: function(key, fn) { + evt[key] || (evt[key] = []); + evt[key].push(fn); + }, + + /** + * Off + * + * @param {String} key + * @param {Function} fn + * @api public + */ + + off: function(key, fn) { + var val = evt[key]; + + if(!val) return; + + var i = val.indexOf(fn); + + if(-1 == i) return; + + val.splice(i, 1); + }, + + /** + * One + * + * @param {String} key + * @param {Mixed} val + * @api public + */ + + one: function(key, val) { + var ref = evt[key]; + + if(!ref || !ref.length) return; + + ref[0](val); + }, + + /** + * Emit + * + * @param {String} key + * @param {Mixed} val + * @api public + */ + + emit: function(key, val) { + if(!evt[key]) return; + + evt[key].forEach(emit); + + function emit(fn) { + fn(val); + } + } + +}; + diff --git a/.pnpm-store/v10/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 b/.pnpm-store/v10/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 new file mode 100644 index 0000000..5be2519 --- /dev/null +++ b/.pnpm-store/v10/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 @@ -0,0 +1,10 @@ +'use strict' + +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/.pnpm-store/v10/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e b/.pnpm-store/v10/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e new file mode 100644 index 0000000..262732e --- /dev/null +++ b/.pnpm-store/v10/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e @@ -0,0 +1,49 @@ +'use strict' + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/.pnpm-store/v10/files/0c/621af2ed51ba7c02cff5104993b53283fef6b1f6eb0ccd573d95d664cdb25a1d0444bb8cd27609cdd6de3796152cf13b738b00f0c2988fa7f3ae8089d7e29b b/.pnpm-store/v10/files/0c/621af2ed51ba7c02cff5104993b53283fef6b1f6eb0ccd573d95d664cdb25a1d0444bb8cd27609cdd6de3796152cf13b738b00f0c2988fa7f3ae8089d7e29b new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/.pnpm-store/v10/files/0c/621af2ed51ba7c02cff5104993b53283fef6b1f6eb0ccd573d95d664cdb25a1d0444bb8cd27609cdd6de3796152cf13b738b00f0c2988fa7f3ae8089d7e29b @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.pnpm-store/v10/files/0c/fef7e9352fc517cee64d1d2866f76a66536555483ecf7eaf3d158e800de787fddb35d18955e6e8d5a39ca2a91347664f61237f5957f359959ddb895bb72283 b/.pnpm-store/v10/files/0c/fef7e9352fc517cee64d1d2866f76a66536555483ecf7eaf3d158e800de787fddb35d18955e6e8d5a39ca2a91347664f61237f5957f359959ddb895bb72283 new file mode 100644 index 0000000..62d6d23 --- /dev/null +++ b/.pnpm-store/v10/files/0c/fef7e9352fc517cee64d1d2866f76a66536555483ecf7eaf3d158e800de787fddb35d18955e6e8d5a39ca2a91347664f61237f5957f359959ddb895bb72283 @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/.pnpm-store/v10/files/0d/2f3209729887fa598db6edb720f227ae8dfb4fdbb89df8051ede69a038e47925eea69d7f3136550019cc6e713fdb2d6bdcd1be8293181247ae8ede1d70fe70 b/.pnpm-store/v10/files/0d/2f3209729887fa598db6edb720f227ae8dfb4fdbb89df8051ede69a038e47925eea69d7f3136550019cc6e713fdb2d6bdcd1be8293181247ae8ede1d70fe70 new file mode 100644 index 0000000..f108ecd --- /dev/null +++ b/.pnpm-store/v10/files/0d/2f3209729887fa598db6edb720f227ae8dfb4fdbb89df8051ede69a038e47925eea69d7f3136550019cc6e713fdb2d6bdcd1be8293181247ae8ede1d70fe70 @@ -0,0 +1,2 @@ +declare function setPrototypeOf(o: any, proto: object | null): any; +export = setPrototypeOf; diff --git a/.pnpm-store/v10/files/0d/8931c729640bce6fda66b91bd6356433669f6b6caaf7b26ef81d372226accfc2e1796e9cd4d85573c5460978093f16c669c3ba45e4d95545c2763b6aa01a99 b/.pnpm-store/v10/files/0d/8931c729640bce6fda66b91bd6356433669f6b6caaf7b26ef81d372226accfc2e1796e9cd4d85573c5460978093f16c669c3ba45e4d95545c2763b6aa01a99 new file mode 100644 index 0000000..8752893 --- /dev/null +++ b/.pnpm-store/v10/files/0d/8931c729640bce6fda66b91bd6356433669f6b6caaf7b26ef81d372226accfc2e1796e9cd4d85573c5460978093f16c669c3ba45e4d95545c2763b6aa01a99 @@ -0,0 +1,973 @@ +'use strict'; + +const { EventEmitter } = require('events'); +const fs = require('fs'); +const sysPath = require('path'); +const { promisify } = require('util'); +const readdirp = require('readdirp'); +const anymatch = require('anymatch').default; +const globParent = require('glob-parent'); +const isGlob = require('is-glob'); +const braces = require('braces'); +const normalizePath = require('normalize-path'); + +const NodeFsHandler = require('./lib/nodefs-handler'); +const FsEventsHandler = require('./lib/fsevents-handler'); +const { + EV_ALL, + EV_READY, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, + EV_UNLINK_DIR, + EV_RAW, + EV_ERROR, + + STR_CLOSE, + STR_END, + + BACK_SLASH_RE, + DOUBLE_SLASH_RE, + SLASH_OR_BACK_SLASH_RE, + DOT_RE, + REPLACER_RE, + + SLASH, + SLASH_SLASH, + BRACE_START, + BANG, + ONE_DOT, + TWO_DOTS, + GLOBSTAR, + SLASH_GLOBSTAR, + ANYMATCH_OPTS, + STRING_TYPE, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, + + isWindows, + isMacos, + isIBMi +} = require('./lib/constants'); + +const stat = promisify(fs.stat); +const readdir = promisify(fs.readdir); + +/** + * @typedef {String} Path + * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName + * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType + */ + +/** + * + * @typedef {Object} WatchHelpers + * @property {Boolean} followSymlinks + * @property {'stat'|'lstat'} statMethod + * @property {Path} path + * @property {Path} watchPath + * @property {Function} entryPath + * @property {Boolean} hasGlob + * @property {Object} globFilter + * @property {Function} filterPath + * @property {Function} filterDir + */ + +const arrify = (value = []) => Array.isArray(value) ? value : [value]; +const flatten = (list, result = []) => { + list.forEach(item => { + if (Array.isArray(item)) { + flatten(item, result); + } else { + result.push(item); + } + }); + return result; +}; + +const unifyPaths = (paths_) => { + /** + * @type {Array} + */ + const paths = flatten(arrify(paths_)); + if (!paths.every(p => typeof p === STRING_TYPE)) { + throw new TypeError(`Non-string provided as watch path: ${paths}`); + } + return paths.map(normalizePathToUnix); +}; + +// If SLASH_SLASH occurs at the beginning of path, it is not replaced +// because "//StoragePC/DrivePool/Movies" is a valid network path +const toUnix = (string) => { + let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } + while (str.match(DOUBLE_SLASH_RE)) { + str = str.replace(DOUBLE_SLASH_RE, SLASH); + } + if (prepend) { + str = SLASH + str; + } + return str; +}; + +// Our version of upath.normalize +// TODO: this is not equal to path-normalize module - investigate why +const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); + +const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); +}; + +const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; + } + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); + } + return sysPath.join(cwd, path); +}; + +const undef = (opts, key) => opts[key] === undefined; + +/** + * Directory entry. + * @property {Path} path + * @property {Set} items + */ +class DirEntry { + /** + * @param {Path} dir + * @param {Function} removeWatcher + */ + constructor(dir, removeWatcher) { + this.path = dir; + this._removeWatcher = removeWatcher; + /** @type {Set} */ + this.items = new Set(); + } + + add(item) { + const {items} = this; + if (!items) return; + if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); + } + + async remove(item) { + const {items} = this; + if (!items) return; + items.delete(item); + if (items.size > 0) return; + + const dir = this.path; + try { + await readdir(dir); + } catch (err) { + if (this._removeWatcher) { + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); + } + } + } + + has(item) { + const {items} = this; + if (!items) return; + return items.has(item); + } + + /** + * @returns {Array} + */ + getChildren() { + const {items} = this; + if (!items) return; + return [...items.values()]; + } + + dispose() { + this.items.clear(); + delete this.path; + delete this._removeWatcher; + delete this.items; + Object.freeze(this); + } +} + +const STAT_METHOD_F = 'stat'; +const STAT_METHOD_L = 'lstat'; +class WatchHelper { + constructor(path, watchPath, follow, fsw) { + this.fsw = fsw; + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); + this.watchPath = watchPath; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; + /** @type {object|boolean} */ + if (path === EMPTY_STR) this.hasGlob = false; + this.globSymlink = this.hasGlob && follow ? undefined : false; + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); + this.dirParts.forEach((parts) => { + if (parts.length > 1) parts.pop(); + }); + this.followSymlinks = follow; + this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; + } + + checkGlobSymlink(entry) { + // only need to resolve once + // first entry should always have entry.parentDir === EMPTY_STR + if (this.globSymlink === undefined) { + this.globSymlink = entry.fullParentDir === this.fullWatchPath ? + false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; + } + + if (this.globSymlink) { + return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); + } + + return entry.fullPath; + } + + entryPath(entry) { + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) + ); + } + + filterPath(entry) { + const {stats} = entry; + if (stats && stats.isSymbolicLink()) return this.filterDir(entry); + const resolvedPath = this.entryPath(entry); + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? + this.globFilter(resolvedPath) : true; + return matchesGlob && + this.fsw._isntIgnored(resolvedPath, stats) && + this.fsw._hasReadPermissions(stats); + } + + getDirParts(path) { + if (!this.hasGlob) return []; + const parts = []; + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); + }); + return parts; + } + + filterDir(entry) { + if (this.hasGlob) { + const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); + let globstar = false; + this.unmatchedGlob = !this.dirParts.some((parts) => { + return parts.every((part, i) => { + if (part === GLOBSTAR) globstar = true; + return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + }); + }); + } + return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); + } +} + +/** + * Watches files & directories for changes. Emitted events: + * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` + * + * new FSWatcher() + * .add(directories) + * .on('add', path => log('File', path, 'was added')) + */ +class FSWatcher extends EventEmitter { +// Not indenting methods for history sake; for now. +constructor(_opts) { + super(); + + const opts = {}; + if (_opts) Object.assign(opts, _opts); // for frozen objects + + /** @type {Map} */ + this._watched = new Map(); + /** @type {Map} */ + this._closers = new Map(); + /** @type {Set} */ + this._ignoredPaths = new Set(); + + /** @type {Map} */ + this._throttled = new Map(); + + /** @type {Map} */ + this._symlinkPaths = new Map(); + + this._streams = new Set(); + this.closed = false; + + // Set up default options. + if (undef(opts, 'persistent')) opts.persistent = true; + if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; + if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; + if (undef(opts, 'interval')) opts.interval = 100; + if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; + if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; + opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; + + // Enable fsevents on OS X when polling isn't explicitly enabled. + if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; + + // If we can't use fsevents, ensure the options reflect it's disabled. + const canUseFsEvents = FsEventsHandler.canUse(); + if (!canUseFsEvents) opts.useFsEvents = false; + + // Use polling on Mac if not using fsevents. + // Other platforms use non-polling fs_watch. + if (undef(opts, 'usePolling') && !opts.useFsEvents) { + opts.usePolling = isMacos; + } + + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + + // Global override (useful for end-developers that need to force polling for all + // instances of chokidar, regardless of usage/dependency depth) + const envPoll = process.env.CHOKIDAR_USEPOLLING; + if (envPoll !== undefined) { + const envLower = envPoll.toLowerCase(); + + if (envLower === 'false' || envLower === '0') { + opts.usePolling = false; + } else if (envLower === 'true' || envLower === '1') { + opts.usePolling = true; + } else { + opts.usePolling = !!envLower; + } + } + const envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = Number.parseInt(envInterval, 10); + } + + // Editor atomic write normalization enabled by default with fs.watch + if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; + if (opts.atomic) this._pendingUnlinks = new Map(); + + if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; + + if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; + if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; + const awf = opts.awaitWriteFinish; + if (awf) { + if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; + if (!awf.pollInterval) awf.pollInterval = 100; + this._pendingWrites = new Map(); + } + if (opts.ignored) opts.ignored = arrify(opts.ignored); + + let readyCalls = 0; + this._emitReady = () => { + readyCalls++; + if (readyCalls >= this._readyCount) { + this._emitReady = EMPTY_FN; + this._readyEmitted = true; + // use process.nextTick to allow time for listener to be bound + process.nextTick(() => this.emit(EV_READY)); + } + }; + this._emitRaw = (...args) => this.emit(EV_RAW, ...args); + this._readyEmitted = false; + this.options = opts; + + // Initialize with proper watcher. + if (opts.useFsEvents) { + this._fsEventsHandler = new FsEventsHandler(this); + } else { + this._nodeFsHandler = new NodeFsHandler(this); + } + + // You’re frozen when your heart’s not open. + Object.freeze(opts); +} + +// Public methods + +/** + * Adds paths to be watched on an existing FSWatcher instance + * @param {Path|Array} paths_ + * @param {String=} _origAdd private; for handling non-existent paths to be watched + * @param {Boolean=} _internal private; indicates a non-user add + * @returns {FSWatcher} for chaining + */ +add(paths_, _origAdd, _internal) { + const {cwd, disableGlobbing} = this.options; + this.closed = false; + let paths = unifyPaths(paths_); + if (cwd) { + paths = paths.map((path) => { + const absPath = getAbsolutePath(path, cwd); + + // Check `path` instead of `absPath` because the cwd portion can't be a glob + if (disableGlobbing || !isGlob(path)) { + return absPath; + } + return normalizePath(absPath); + }); + } + + // set aside negated glob strings + paths = paths.filter((path) => { + if (path.startsWith(BANG)) { + this._ignoredPaths.add(path.slice(1)); + return false; + } + + // if a path is being added that was previously ignored, stop ignoring it + this._ignoredPaths.delete(path); + this._ignoredPaths.delete(path + SLASH_GLOBSTAR); + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + + return true; + }); + + if (this.options.useFsEvents && this._fsEventsHandler) { + if (!this._readyCount) this._readyCount = paths.length; + if (this.options.persistent) this._readyCount += paths.length; + paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); + } else { + if (!this._readyCount) this._readyCount = 0; + this._readyCount += paths.length; + Promise.all( + paths.map(async path => { + const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); + if (res) this._emitReady(); + return res; + }) + ).then(results => { + if (this.closed) return; + results.filter(item => item).forEach(item => { + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); + }); + }); + } + + return this; +} + +/** + * Close watchers or start ignoring events from specified paths. + * @param {Path|Array} paths_ - string or array of strings, file/directory paths and/or globs + * @returns {FSWatcher} for chaining +*/ +unwatch(paths_) { + if (this.closed) return this; + const paths = unifyPaths(paths_); + const {cwd} = this.options; + + paths.forEach((path) => { + // convert to absolute path unless relative path already matches + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); + } + + this._closePath(path); + + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); + } + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + }); + + return this; +} + +/** + * Close watchers and remove all listeners from watched paths. + * @returns {Promise}. +*/ +close() { + if (this.closed) return this._closePromise; + this.closed = true; + + // Memory management. + this.removeAllListeners(); + const closers = []; + this._closers.forEach(closerList => closerList.forEach(closer => { + const promise = closer(); + if (promise instanceof Promise) closers.push(promise); + })); + this._streams.forEach(stream => stream.destroy()); + this._userIgnored = undefined; + this._readyCount = 0; + this._readyEmitted = false; + this._watched.forEach(dirent => dirent.dispose()); + ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { + this[`_${key}`].clear(); + }); + + this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); + return this._closePromise; +} + +/** + * Expose list of watched paths + * @returns {Object} for chaining +*/ +getWatched() { + const watchList = {}; + this._watched.forEach((entry, dir) => { + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; + watchList[key || ONE_DOT] = entry.getChildren().sort(); + }); + return watchList; +} + +emitWithAll(event, args) { + this.emit(...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); +} + +// Common helpers +// -------------- + +/** + * Normalize and emit events. + * Calling _emit DOES NOT MEAN emit() would be called! + * @param {EventName} event Type of event + * @param {Path} path File or directory path + * @param {*=} val1 arguments to be passed with event + * @param {*=} val2 + * @param {*=} val3 + * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +async _emit(event, path, val1, val2, val3) { + if (this.closed) return; + + const opts = this.options; + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); + /** @type Array */ + const args = [event, path]; + if (val3 !== undefined) args.push(val1, val2, val3); + else if (val2 !== undefined) args.push(val1, val2); + else if (val1 !== undefined) args.push(val1); + + const awf = opts.awaitWriteFinish; + let pw; + if (awf && (pw = this._pendingWrites.get(path))) { + pw.lastChange = new Date(); + return this; + } + + if (opts.atomic) { + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); + setTimeout(() => { + this._pendingUnlinks.forEach((entry, path) => { + this.emit(...entry); + this.emit(EV_ALL, ...entry); + this._pendingUnlinks.delete(path); + }); + }, typeof opts.atomic === 'number' ? opts.atomic : 100); + return this; + } + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); + } + } + + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { + const awfEmit = (err, stats) => { + if (err) { + event = args[0] = EV_ERROR; + args[1] = err; + this.emitWithAll(event, args); + } else if (stats) { + // if stats doesn't exist the file must have been deleted + if (args.length > 2) { + args[2] = stats; + } else { + args.push(stats); + } + this.emitWithAll(event, args); + } + }; + + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); + return this; + } + + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); + if (isThrottled) return this; + } + + if (opts.alwaysStat && val1 === undefined && + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) + ) { + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; + let stats; + try { + stats = await stat(fullPath); + } catch (err) {} + // Suppress event when fs_stat fails, to avoid sending undefined 'stat' + if (!stats || this.closed) return; + args.push(stats); + } + this.emitWithAll(event, args); + + return this; +} + +/** + * Common handler for errors + * @param {Error} error + * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +_handleError(error) { + const code = error && error.code; + if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && + (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) + ) { + this.emit(EV_ERROR, error); + } + return error || this.closed; +} + +/** + * Helper utility for throttling + * @param {ThrottleType} actionType type being throttled + * @param {Path} path being acted upon + * @param {Number} timeout duration of time to suppress duplicate actions + * @returns {Object|false} tracking object or false if action should be suppressed + */ +_throttle(actionType, path, timeout) { + if (!this._throttled.has(actionType)) { + this._throttled.set(actionType, new Map()); + } + + /** @type {Map} */ + const action = this._throttled.get(actionType); + /** @type {Object} */ + const actionPath = action.get(path); + + if (actionPath) { + actionPath.count++; + return false; + } + + let timeoutObject; + const clear = () => { + const item = action.get(path); + const count = item ? item.count : 0; + action.delete(path); + clearTimeout(timeoutObject); + if (item) clearTimeout(item.timeoutObject); + return count; + }; + timeoutObject = setTimeout(clear, timeout); + const thr = {timeoutObject, clear, count: 0}; + action.set(path, thr); + return thr; +} + +_incrReadyCount() { + return this._readyCount++; +} + +/** + * Awaits write operation to finish. + * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. + * @param {Path} path being acted upon + * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished + * @param {EventName} event + * @param {Function} awfEmit Callback to be called when ready for event to be emitted. + */ +_awaitWriteFinish(path, threshold, event, awfEmit) { + let timeoutHandler; + + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); + } + + const now = new Date(); + + const awaitWriteFinish = (prevStat) => { + fs.stat(fullPath, (err, curStat) => { + if (err || !this._pendingWrites.has(path)) { + if (err && err.code !== 'ENOENT') awfEmit(err); + return; + } + + const now = Number(new Date()); + + if (prevStat && curStat.size !== prevStat.size) { + this._pendingWrites.get(path).lastChange = now; + } + const pw = this._pendingWrites.get(path); + const df = now - pw.lastChange; + + if (df >= threshold) { + this._pendingWrites.delete(path); + awfEmit(undefined, curStat); + } else { + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval, + curStat + ); + } + }); + }; + + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { + lastChange: now, + cancelWait: () => { + this._pendingWrites.delete(path); + clearTimeout(timeoutHandler); + return event; + } + }); + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval + ); + } +} + +_getGlobIgnored() { + return [...this._ignoredPaths.values()]; +} + +/** + * Determines whether user has asked to ignore this path. + * @param {Path} path filepath or dir + * @param {fs.Stats=} stats result of fs.stat + * @returns {Boolean} + */ +_isIgnored(path, stats) { + if (this.options.atomic && DOT_RE.test(path)) return true; + if (!this._userIgnored) { + const {cwd} = this.options; + const ign = this.options.ignored; + + const ignored = ign && ign.map(normalizeIgnored(cwd)); + const paths = arrify(ignored) + .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) + .map((path) => path + SLASH_GLOBSTAR); + const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); + this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + } + + return this._userIgnored([path, stats]); +} + +_isntIgnored(path, stat) { + return !this._isIgnored(path, stat); +} + +/** + * Provides a set of common helpers and properties relating to symlink and glob handling. + * @param {Path} path file, directory, or glob pattern being watched + * @param {Number=} depth at any depth > 0, this isn't a glob + * @returns {WatchHelper} object containing helpers for this path + */ +_getWatchHelpers(path, depth) { + const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); + const follow = this.options.followSymlinks; + + return new WatchHelper(path, watchPath, follow, this); +} + +// Directory helpers +// ----------------- + +/** + * Provides directory tracking objects + * @param {String} directory path of the directory + * @returns {DirEntry} the directory's tracking object + */ +_getWatchedDir(directory) { + if (!this._boundRemove) this._boundRemove = this._remove.bind(this); + const dir = sysPath.resolve(directory); + if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); + return this._watched.get(dir); +} + +// File helpers +// ------------ + +/** + * Check for read permissions. + * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 + * @param {fs.Stats} stats - object, result of fs_stat + * @returns {Boolean} indicates whether the file can be read +*/ +_hasReadPermissions(stats) { + if (this.options.ignorePermissionErrors) return true; + + // stats.mode may be bigint + const md = stats && Number.parseInt(stats.mode, 10); + const st = md & 0o777; + const it = Number.parseInt(st.toString(8)[0], 10); + return Boolean(4 & it); +} + +/** + * Handles emitting unlink events for + * files and directories, and via recursion, for + * files and directories within directories that are unlinked + * @param {String} directory within which the following item is located + * @param {String} item base path of item/directory + * @returns {void} +*/ +_remove(directory, item, isDirectory) { + // if what is being deleted is a directory, get that directory's paths + // for recursive deleting and cleaning of watched object + // if it is not a directory, nestedDirectoryChildren will be empty array + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); + isDirectory = isDirectory != null + ? isDirectory + : this._watched.has(path) || this._watched.has(fullPath); + + // prevent duplicate handling in case of arriving here nearly simultaneously + // via multiple paths (such as _handleFile and _handleDir) + if (!this._throttle('remove', path, 100)) return; + + // if the only watched file is removed, watch for its return + if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { + this.add(directory, item, true); + } + + // This will create a new entry in the watched object in either case + // so we got to do the directory check beforehand + const wp = this._getWatchedDir(path); + const nestedDirectoryChildren = wp.getChildren(); + + // Recursively remove children directories / files. + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); + + // Check if item was on the watched list and remove it + const parent = this._getWatchedDir(directory); + const wasTracked = parent.has(item); + parent.remove(item); + + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + + // If we wait for this file to be fully written, cancel the wait. + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); + if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { + const event = this._pendingWrites.get(relPath).cancelWait(); + if (event === EV_ADD) return; + } + + // The Entry will either be a directory that just got removed + // or a bogus entry to a file, in either case we have to remove it + this._watched.delete(path); + this._watched.delete(fullPath); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); + + // Avoid conflicts if we later create another file with the same name + if (!this.options.useFsEvents) { + this._closePath(path); + } +} + +/** + * Closes all watchers for a path + * @param {Path} path + */ +_closePath(path) { + this._closeFile(path) + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); +} + +/** + * Closes only file-specific watchers + * @param {Path} path + */ +_closeFile(path) { + const closers = this._closers.get(path); + if (!closers) return; + closers.forEach(closer => closer()); + this._closers.delete(path); +} + +/** + * + * @param {Path} path + * @param {Function} closer + */ +_addPathCloser(path, closer) { + if (!closer) return; + let list = this._closers.get(path); + if (!list) { + list = []; + this._closers.set(path, list); + } + list.push(closer); +} + +_readdirp(root, opts) { + if (this.closed) return; + const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; + let stream = readdirp(root, options); + this._streams.add(stream); + stream.once(STR_CLOSE, () => { + stream = undefined; + }); + stream.once(STR_END, () => { + if (stream) { + this._streams.delete(stream); + stream = undefined; + } + }); + return stream; +} + +} + +// Export FSWatcher class +exports.FSWatcher = FSWatcher; + +/** + * Instantiates watcher with paths to be tracked. + * @param {String|Array} paths file/directory paths and/or globs + * @param {Object=} options chokidar opts + * @returns an instance of FSWatcher for chaining. + */ +const watch = (paths, options) => { + const watcher = new FSWatcher(options); + watcher.add(paths); + return watcher; +}; + +exports.watch = watch; diff --git a/.pnpm-store/v10/files/0d/ca06c6da99bfe70de22a5a51e79260cdb76ab91dae10e4416d1f28c0af7434b5c56bb952b6abe3ba389a654b69a1baa33fdcbf6c14d2b0a11af6c5fa20a9b3 b/.pnpm-store/v10/files/0d/ca06c6da99bfe70de22a5a51e79260cdb76ab91dae10e4416d1f28c0af7434b5c56bb952b6abe3ba389a654b69a1baa33fdcbf6c14d2b0a11af6c5fa20a9b3 new file mode 100644 index 0000000..8bcf872 --- /dev/null +++ b/.pnpm-store/v10/files/0d/ca06c6da99bfe70de22a5a51e79260cdb76ab91dae10e4416d1f28c0af7434b5c56bb952b6abe3ba389a654b69a1baa33fdcbf6c14d2b0a11af6c5fa20a9b3 @@ -0,0 +1,32 @@ +'use strict'; + +const utils = require('./utils'); + +module.exports = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + diff --git a/.pnpm-store/v10/files/0d/e153904efb2b726ec5dfb7175a435aac48adc6538d6247db3a50826c4b677165dc22181a48cac4cdbe86f4133f614e4ccc8a7564a479a743207c22dbf75b98 b/.pnpm-store/v10/files/0d/e153904efb2b726ec5dfb7175a435aac48adc6538d6247db3a50826c4b677165dc22181a48cac4cdbe86f4133f614e4ccc8a7564a479a743207c22dbf75b98 new file mode 100644 index 0000000..15986cd --- /dev/null +++ b/.pnpm-store/v10/files/0d/e153904efb2b726ec5dfb7175a435aac48adc6538d6247db3a50826c4b677165dc22181a48cac4cdbe86f4133f614e4ccc8a7564a479a743207c22dbf75b98 @@ -0,0 +1,261 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); +var hasSymbols = require('has-symbols/shams')(); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); +var semver = require('semver'); + +test('values', function (t) { + t.plan(1); + var obj = [{}, [], { 'a-b': 5 }]; + t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); +}); + +test('arrays with properties', function (t) { + t.plan(1); + var arr = [3]; + arr.foo = 'bar'; + var obj = [1, 2, arr]; + obj.baz = 'quux'; + obj.index = -1; + t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); +}); + +test('has', function (t) { + t.plan(1); + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); +}); + +test('indexOf seen', function (t) { + t.plan(1); + var xs = [1, 2, 3, {}]; + xs.push(xs); + + var seen = []; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[ 1, 2, 3, {}, [Circular] ]' + ); +}); + +test('seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('seen seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [5, xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + var sym = Symbol('foo'); + t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); + if (typeof sym === 'symbol') { + // Symbol shams are incapable of differentiating boxed from unboxed symbols + t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); + } + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'Symbol'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', + 'object lying about being a Symbol inspects as an object' + ); + }); + + t.end(); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; + t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); + t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); + + t.end(); +}); + +test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { + var map = new WeakMap(); + map.set({ a: 1 }, ['b']); + var expectedString = 'WeakMap { ? }'; + t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); + t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; + t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); + t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); + + t.end(); +}); + +test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { + var map = new WeakSet(); + map.add({ a: 1 }); + var expectedString = 'WeakSet { ? }'; + t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); + t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); + + t.end(); +}); + +test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { + var ref = new WeakRef({ a: 1 }); + var expectedString = 'WeakRef { ? }'; + t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); + + t.end(); +}); + +test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { + var registry = new FinalizationRegistry(function () {}); + var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; + t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); + + t.end(); +}); + +test('Strings', function (t) { + var str = 'abc'; + + t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); + t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); + t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); + t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); + t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); + t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); + + t.end(); +}); + +test('Numbers', function (t) { + var num = 42; + + t.equal(inspect(num), String(num), 'primitive number shows as such'); + t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); + + t.end(); +}); + +test('Booleans', function (t) { + t.equal(inspect(true), String(true), 'primitive true shows as such'); + t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); + + t.equal(inspect(false), String(false), 'primitive false shows as such'); + t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); + + t.end(); +}); + +test('Date', function (t) { + var now = new Date(); + t.equal(inspect(now), String(now), 'Date shows properly'); + t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); + + t.end(); +}); + +test('RegExps', function (t) { + t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); + t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); + + var match = 'abc abc'.match(/[ab]+/); + delete match.groups; // for node < 10 + t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); + + t.end(); +}); + +test('Proxies', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { + var target = { proxy: true }; + var fake = new Proxy(target, { has: function () { return false; } }); + + // needed to work around a weird difference in node v6.0 - v6.4 where non-present properties are not logged + var isNode60 = semver.satisfies(process.version, '6.0 - 6.4'); + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(fake), + '{ ' + (isNode60 ? '' : 'proxy: true, ') + '[Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Proxy for + ' + tag + ' shows as the target, which has no slots' + ); + }); + + t.end(); +}); + +test('fakers', { skip: !hasToStringTag }, function (t) { + var target = { proxy: false }; + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(target), + '{ proxy: false, [Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Object pretending to be ' + tag + ' does not trick us' + ); + }); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/0d/f3548f864b8acb69fd82e97240628febe40555a448414e771bb8ad61b916e6807be40a9284a54aacdf875905c418b5de55dacd18a42226f3ddce137ecda580 b/.pnpm-store/v10/files/0d/f3548f864b8acb69fd82e97240628febe40555a448414e771bb8ad61b916e6807be40a9284a54aacdf875905c418b5de55dacd18a42226f3ddce137ecda580 new file mode 100644 index 0000000..eeabd1c --- /dev/null +++ b/.pnpm-store/v10/files/0d/f3548f864b8acb69fd82e97240628febe40555a448414e771bb8ad61b916e6807be40a9284a54aacdf875905c418b5de55dacd18a42226f3ddce137ecda580 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.pnpm-store/v10/files/0e/263e6bce6c5d5fc7cb222ef47be4a98846824d5d7cc396edfa261772381b569cec1cd49366666bff593d4ba78655e99b96bab31c3e24fe9522001c625ae463 b/.pnpm-store/v10/files/0e/263e6bce6c5d5fc7cb222ef47be4a98846824d5d7cc396edfa261772381b569cec1cd49366666bff593d4ba78655e99b96bab31c3e24fe9522001c625ae463 new file mode 100644 index 0000000..dce69be --- /dev/null +++ b/.pnpm-store/v10/files/0e/263e6bce6c5d5fc7cb222ef47be4a98846824d5d7cc396edfa261772381b569cec1cd49366666bff593d4ba78655e99b96bab31c3e24fe9522001c625ae463 @@ -0,0 +1,60 @@ +'use strict'; + +const fill = require('fill-range'); +const utils = require('./utils'); + +const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); +}; + +module.exports = compile; diff --git a/.pnpm-store/v10/files/0e/c5e6ea8529c1d06eeaaf2e2e17cde0ede55c18d1ee7f08dc9e1bda5b3ee3fd9e8f0685c5731099df863505caf95b70758a91edcc5a63199ef153d6ae04d51a b/.pnpm-store/v10/files/0e/c5e6ea8529c1d06eeaaf2e2e17cde0ede55c18d1ee7f08dc9e1bda5b3ee3fd9e8f0685c5731099df863505caf95b70758a91edcc5a63199ef153d6ae04d51a new file mode 100644 index 0000000..eee8b11 --- /dev/null +++ b/.pnpm-store/v10/files/0e/c5e6ea8529c1d06eeaaf2e2e17cde0ede55c18d1ee7f08dc9e1bda5b3ee3fd9e8f0685c5731099df863505caf95b70758a91edcc5a63199ef153d6ae04d51a @@ -0,0 +1,210 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var getBody = require('raw-body') +var iconv = require('iconv-lite') +var onFinished = require('on-finished') +var zlib = require('node:zlib') + +/** + * Module exports. + */ + +module.exports = read + +/** + * Read a request into a buffer and parse. + * + * @param {object} req + * @param {object} res + * @param {function} next + * @param {function} parse + * @param {function} debug + * @param {object} options + * @private + */ + +function read (req, res, next, parse, debug, options) { + var length + var opts = options + var stream + + // read options + var encoding = opts.encoding !== null + ? opts.encoding + : null + var verify = opts.verify + + try { + // get the content stream + stream = contentstream(req, debug, opts.inflate) + length = stream.length + stream.length = undefined + } catch (err) { + return next(err) + } + + // set raw-body options + opts.length = length + opts.encoding = verify + ? null + : encoding + + // assert charset is supported + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + })) + } + + // read body + debug('read body') + getBody(stream, opts, function (error, body) { + if (error) { + var _error + + if (error.type === 'encoding.unsupported') { + // echo back charset + _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + }) + } else { + // set status code on error + _error = createError(400, error) + } + + // unpipe from stream and destroy + if (stream !== req) { + req.unpipe() + stream.destroy() + } + + // read off entire request + dump(req, function onfinished () { + next(createError(400, _error)) + }) + return + } + + // verify + if (verify) { + try { + debug('verify body') + verify(req, res, body, encoding) + } catch (err) { + next(createError(403, err, { + body: body, + type: err.type || 'entity.verify.failed' + })) + return + } + } + + // parse + var str = body + try { + debug('parse body') + str = typeof body !== 'string' && encoding !== null + ? iconv.decode(body, encoding) + : body + req.body = parse(str, encoding) + } catch (err) { + next(createError(400, err, { + body: str, + type: err.type || 'entity.parse.failed' + })) + return + } + + next() + }) +} + +/** + * Get the content stream of the request. + * + * @param {object} req + * @param {function} debug + * @param {boolean} [inflate=true] + * @return {object} + * @api private + */ + +function contentstream (req, debug, inflate) { + var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() + var length = req.headers['content-length'] + + debug('content-encoding "%s"', encoding) + + if (inflate === false && encoding !== 'identity') { + throw createError(415, 'content encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + if (encoding === 'identity') { + req.length = length + return req + } + + var stream = createDecompressionStream(encoding, debug) + req.pipe(stream) + return stream +} + +/** + * Create a decompression stream for the given encoding. + * @param {string} encoding + * @param {function} debug + * @return {object} + * @api private + */ +function createDecompressionStream (encoding, debug) { + switch (encoding) { + case 'deflate': + debug('inflate body') + return zlib.createInflate() + case 'gzip': + debug('gunzip body') + return zlib.createGunzip() + case 'br': + debug('brotli decompress body') + return zlib.createBrotliDecompress() + default: + throw createError(415, 'unsupported content encoding "' + encoding + '"', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Dump the contents of a request. + * + * @param {object} req + * @param {function} callback + * @api private + */ + +function dump (req, callback) { + if (onFinished.isFinished(req)) { + callback(null) + } else { + onFinished(req, callback) + req.resume() + } +} diff --git a/.pnpm-store/v10/files/0f/194bbd951193ba2b3e40794e8035d424ac49db484b7021657947bb9ec9756e8ca6ecc191dc840902c8c59f58ab32f75c48649208e945fe2a6c1fe44cf64181 b/.pnpm-store/v10/files/0f/194bbd951193ba2b3e40794e8035d424ac49db484b7021657947bb9ec9756e8ca6ecc191dc840902c8c59f58ab32f75c48649208e945fe2a6c1fe44cf64181 new file mode 100644 index 0000000..3b31137 --- /dev/null +++ b/.pnpm-store/v10/files/0f/194bbd951193ba2b3e40794e8035d424ac49db484b7021657947bb9ec9756e8ca6ecc191dc840902c8c59f58ab32f75c48649208e945fe2a6c1fe44cf64181 @@ -0,0 +1,29 @@ +cat: /proc/4087/stat: No such file or directory +cat: /proc/4088/stat: No such file or directory +1 (init) S 0 1 1 0 -1 4210944 9227 55994 29 319 7 5 68 16 20 0 1 0 1286281 33660928 855 18446744073709551615 1 1 0 0 0 0 0 4096 536962595 0 0 0 17 4 0 0 3 0 0 0 0 0 0 0 0 0 0 +1032 (ntpd) S 1 1032 1032 0 -1 4211008 178 0 1 0 0 0 0 0 20 0 1 0 1287033 25743360 1058 18446744073709551615 1 1 0 0 0 0 0 4096 27207 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +126 (irqbalance) S 1 126 126 0 -1 1077952832 1217 0 0 0 1 6 0 0 20 0 1 0 1286749 20189184 647 18446744073709551615 1 1 0 0 0 0 0 0 3 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +181 (mysqld) S 1 181 181 0 -1 4210944 6399 0 46 0 8 6 0 0 20 0 22 0 1286761 748453888 14476 18446744073709551615 1 1 0 0 0 0 552967 4096 26345 0 0 0 17 4 0 0 10 0 0 0 0 0 0 0 0 0 0 +194 (memcached) S 1 187 187 0 -1 4210944 252 0 4 0 0 0 0 0 20 0 6 0 1286766 333221888 648 18446744073709551615 1 1 0 0 0 0 0 4096 2 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +243 (dbus-daemon) S 1 243 243 0 -1 4211008 67 0 0 0 0 0 0 0 20 0 1 0 1286779 40087552 598 18446744073709551615 1 1 0 0 0 0 0 0 16385 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +254 (rsyslogd) S 1 254 254 0 -1 4211008 107 0 0 0 2 2 0 0 20 0 3 0 1286782 186601472 696 18446744073709551615 1 1 0 0 0 0 0 16781830 1133601 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +265 (systemd-logind) S 1 265 265 0 -1 4210944 276 0 2 0 0 0 0 0 20 0 1 0 1286786 35880960 720 18446744073709551615 1 1 0 0 0 0 0 0 0 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +333 (postgres) S 1 303 303 0 -1 4210688 3169 3466 15 18 0 1 1 1 20 0 1 0 1286817 156073984 5002 18446744073709551615 1 1 0 0 0 0 0 19935232 84487 0 0 0 17 5 0 0 1 0 0 0 0 0 0 0 0 0 0 +359 (postgres) S 333 359 359 0 -1 4210752 90 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16805888 2567 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +360 (postgres) S 333 360 360 0 -1 4210752 119 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16791554 16901 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +361 (postgres) S 333 361 361 0 -1 4210752 87 0 0 0 0 0 0 0 20 0 1 0 1286822 156073984 827 18446744073709551615 1 1 0 0 0 0 0 16791552 16903 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +362 (postgres) S 333 362 362 0 -1 4210752 292 0 3 0 0 0 0 0 20 0 1 0 1286822 156930048 1373 18446744073709551615 1 1 0 0 0 0 0 19927040 27271 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +363 (postgres) S 333 363 363 0 -1 4210752 82 0 0 0 0 0 0 0 20 0 1 0 1286822 115924992 887 18446744073709551615 1 1 0 0 0 0 0 16808450 5 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +4050 (npm) S 50 50 50 34817 50 4210688 5109 0 0 0 36 3 0 0 20 0 10 0 1292968 738025472 10051 18446744073709551615 4194304 33165900 140723623956256 0 0 0 0 4096 134300162 0 0 0 17 4 0 0 0 0 0 35263056 35370992 48369664 140723623964237 140723623964294 140723623964294 140723623968712 0 +4060 (sh) S 4050 50 50 34817 50 4210688 121 0 0 0 0 0 0 0 20 0 1 0 1293007 4579328 174 18446744073709551615 94347643936768 94347644049516 140735136055088 0 0 0 0 0 65538 1 0 0 17 5 0 0 0 0 0 94347646148008 94347646153216 94347660038144 140735136063095 140735136063129 140735136063129 140735136071664 0 +4061 (node) S 4060 50 50 34817 50 4210688 6501 0 0 0 42 2 0 0 20 0 6 0 1293008 705769472 10211 18446744073709551615 4194304 33165900 140730532686288 0 0 0 0 4096 2072111671 0 0 0 17 5 0 0 0 0 0 35263056 35370992 45867008 140730532695579 140730532695657 140730532695657 140730532704200 0 +4067 (node) S 4061 50 50 34817 50 4210688 6746 221 0 0 38 3 0 0 20 0 10 0 1293051 738910208 10527 18446744073709551615 4194304 33165900 140724824971632 0 0 0 0 4096 2072111671 0 0 0 17 4 0 0 0 0 0 35263056 35370992 68595712 140724824980995 140724824981063 140724824981063 140724824989640 0 +4079 (sh) S 4067 50 50 34817 50 4210688 118 0 0 0 0 0 0 0 20 0 1 0 1293092 4579328 194 18446744073709551615 94573702131712 94573702244460 140724712357120 0 0 0 0 0 65538 1 0 0 17 4 0 0 0 0 0 94573704342952 94573704348160 94573718511616 140724712361487 140724712361583 140724712361583 140724712370160 0 +4080 (node) S 4079 50 50 34817 50 4210688 2428 0 0 0 8 1 0 0 20 0 6 0 1293093 693059584 7251 18446744073709551615 4194304 33165900 140726023392816 0 0 0 0 4096 134234626 0 0 0 17 5 0 0 0 0 0 35263056 35370992 55226368 140726023396847 140726023396935 140726023396935 140726023405512 0 +4086 (sh) S 4067 50 50 34817 50 4210688 131 244 0 0 0 0 0 0 20 0 1 0 1293143 4579328 200 18446744073709551615 94347550273536 94347550386284 140737219399136 0 0 0 0 0 65538 1 0 0 17 5 0 0 0 0 0 94347552484776 94347552489984 94347554299904 140737219403308 140737219403375 140737219403375 140737219411952 0 +4089 (xargs) S 4086 50 50 34817 50 4210688 333 1924 0 0 0 0 0 0 20 0 1 0 1293143 17600512 477 18446744073709551615 4194304 4232732 140721633759248 0 0 0 0 0 0 1 0 0 17 5 0 0 0 0 0 6331920 6332980 32182272 140721633762891 140721633762920 140721633762920 140721633771497 0 +50 (bash) S 0 50 50 34817 50 4210944 43914 1032463 9 705 44 21 4213 818 20 0 1 0 1286336 42266624 3599 18446744073709551615 4194304 5173404 140732749083280 0 0 0 65536 4 1132560123 1 0 0 17 4 0 0 410 0 0 7273968 7310504 21196800 140732749086490 140732749086517 140732749086517 140732749086702 0 +79 (acpid) S 1 79 79 0 -1 4210752 46 0 0 0 0 0 0 0 20 0 1 0 1286717 4493312 407 18446744073709551615 1 1 0 0 0 0 0 4096 16391 0 0 0 17 5 0 0 0 0 0 0 0 0 0 0 0 0 0 +83 (sshd) S 1 83 83 0 -1 4210944 354 0 27 0 0 0 0 0 20 0 1 0 1286718 62873600 1290 18446744073709551615 1 1 0 0 0 0 0 4096 81925 0 0 0 17 4 0 0 30 0 0 0 0 0 0 0 0 0 0 +94 (cron) S 1 94 94 0 -1 1077952576 103 449 0 1 0 0 0 0 20 0 1 0 1286743 24240128 559 18446744073709551615 1 1 0 0 0 0 0 0 65537 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 +95 (atd) S 1 95 95 0 -1 1077952576 28 0 0 0 0 0 0 0 20 0 1 0 1286743 19615744 41 18446744073709551615 1 1 0 0 0 0 0 0 81923 0 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/.pnpm-store/v10/files/0f/87155c87c1f1d3244c5f73a3874bdae422ba945073e03918205297a29318175fa75b28c3e605731576d8f998236441e5151043b12270bac05ce29fa136ecad b/.pnpm-store/v10/files/0f/87155c87c1f1d3244c5f73a3874bdae422ba945073e03918205297a29318175fa75b28c3e605731576d8f998236441e5151043b12270bac05ce29fa136ecad new file mode 100644 index 0000000..a01248b --- /dev/null +++ b/.pnpm-store/v10/files/0f/87155c87c1f1d3244c5f73a3874bdae422ba945073e03918205297a29318175fa75b28c3e605731576d8f998236441e5151043b12270bac05ce29fa136ecad @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelWeakMap = require('../'); + +test('getSideChannelMap', { skip: typeof WeakMap !== 'function' && typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelWeakMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no WeakMaps and/or Maps', { skip: typeof WeakMap === 'function' || typeof Map === 'function' }, function (t) { + t.equal(getSideChannelWeakMap, false, 'is false'); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/0f/b5cc0c607a68867596a6f2aefb5516c6e3fee8928a6699f372a4b51abf8b05e79389cace12581e38dfb9b394a04ecb557493abca0461b80abe195a3d311690 b/.pnpm-store/v10/files/0f/b5cc0c607a68867596a6f2aefb5516c6e3fee8928a6699f372a4b51abf8b05e79389cace12581e38dfb9b394a04ecb557493abca0461b80abe195a3d311690 new file mode 100644 index 0000000..38d3365 --- /dev/null +++ b/.pnpm-store/v10/files/0f/b5cc0c607a68867596a6f2aefb5516c6e3fee8928a6699f372a4b51abf8b05e79389cace12581e38dfb9b394a04ecb557493abca0461b80abe195a3d311690 @@ -0,0 +1,41 @@ +{ + "name": "serve-static", + "description": "Serve static files", + "version": "2.2.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "expressjs/serve-static", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "^6.3.4" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/.pnpm-store/v10/files/11/a8f648a496d10402e67b8a126266f241dfe7b91e91e322be8d94ea72fb75ec932db037cd8fee768d24981bfb02d178fa958742d5f70d5ddbe6f4a2e64b213e b/.pnpm-store/v10/files/11/a8f648a496d10402e67b8a126266f241dfe7b91e91e322be8d94ea72fb75ec932db037cd8fee768d24981bfb02d178fa958742d5f70d5ddbe6f4a2e64b213e new file mode 100644 index 0000000..89d8fce --- /dev/null +++ b/.pnpm-store/v10/files/11/a8f648a496d10402e67b8a126266f241dfe7b91e91e322be8d94ea72fb75ec932db037cd8fee768d24981bfb02d178fa958742d5f70d5ddbe6f4a2e64b213e @@ -0,0 +1,271 @@ +var test = require('tape'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('bad indent options', function (t) { + forEach([ + undefined, + true, + false, + -1, + 1.2, + Infinity, + -Infinity, + NaN + ], function (indent) { + t['throws']( + function () { inspect('', { indent: indent }); }, + TypeError, + inspect(indent) + ' is invalid' + ); + }); + + t.end(); +}); + +test('simple object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: 2 }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('two deep object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: { c: 3, d: 4 } }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('simple array with all single line elements', function (t) { + t.plan(2); + + var obj = [1, 2, 3, 'asdf\nsdf']; + + var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; + + t.equal(inspect(obj, { indent: 2 }), expected, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); +}); + +test('array with complex elements', function (t) { + t.plan(2); + + var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; + + var expectedSpaces = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('values', function (t) { + t.plan(2); + var obj = [{}, [], { 'a-b': 5 }]; + + var expectedSpaces = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + + var expectedStringSpaces = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabsDoubleQuotes = [ + 'Map (2) {', + ' { a: 1 } => [ "b" ],', + ' 3 => NaN', + '}' + ].join('\n'); + + t.equal( + inspect(map, { indent: 2 }), + expectedStringSpaces, + 'Map keys are not indented (two)' + ); + t.equal( + inspect(map, { indent: '\t' }), + expectedStringTabs, + 'Map keys are not indented (tabs)' + ); + t.equal( + inspect(map, { indent: '\t', quoteStyle: 'double' }), + expectedStringTabsDoubleQuotes, + 'Map keys are not indented (tabs + double quotes)' + ); + + t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); + t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + var expectedNestedSpaces = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); + t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedStringSpaces = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); + t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); + + t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); + t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + var expectedNestedSpaces = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); + t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/11/bceb0755cdcb419386e73188d48bf5fb5f9875e56d02ab203d7e378e00f3847d751acc52da555429ad8fc929b8443c89411fcef82d4d7c5da8d9469b07f91b b/.pnpm-store/v10/files/11/bceb0755cdcb419386e73188d48bf5fb5f9875e56d02ab203d7e378e00f3847d751acc52da555429ad8fc929b8443c89411fcef82d4d7c5da8d9469b07f91b new file mode 100644 index 0000000..218fd57 --- /dev/null +++ b/.pnpm-store/v10/files/11/bceb0755cdcb419386e73188d48bf5fb5f9875e56d02ab203d7e378e00f3847d751acc52da555429ad8fc929b8443c89411fcef82d4d7c5da8d9469b07f91b @@ -0,0 +1,416 @@ +# router + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple middleware-style router + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install router +``` + +## API + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var Router = require('router') + +var router = Router() +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) + +var server = http.createServer(function (req, res) { + router(req, res, finalhandler(req, res)) +}) + +server.listen(3000) +``` + +This module is currently an extracted version from the Express project, +but with the main change being it can be used with a plain `http.createServer` +object or other web frameworks by removing Express-specific API calls. + +## Router(options) + +Options + +- `strict` - When `false` trailing slashes are optional (default: `false`) +- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) +- `mergeParams` - When `true` any `req.params` passed to the router will be + merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) + +Returns a function with the signature `router(req, res, callback)` where +`callback([err])` must be provided to handle errors and fall-through from +not handling requests. + +### router.use([path], ...middleware) + +Use the given [middleware function](#middleware) for all http methods on the +given `path`, defaulting to the root path. + +`router` does not automatically see `use` as a handler. As such, it will not +consider it one for handling `OPTIONS` requests. + +* Note: If a `path` is specified, that `path` is stripped from the start of + `req.url`. + + + +```js +router.use(function (req, res, next) { + // do your things + + // continue to the next middleware + // the request will stall if this is not called + next() + + // note: you should NOT call `next` if you have begun writing to the response +}) +``` + +[Middleware](#middleware) can themselves use `next('router')` at any time to +exit the current router instance completely, invoking the top-level callback. + +### router\[method](path, ...[middleware], handler) + +The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide +the routing functionality in `router`. + +Method middleware and handlers follow usual [middleware](#middleware) behavior, +except they will only be called when the method and path match the request. + + + +```js +// handle a `GET` request +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) +``` + +[Middleware](#middleware) given before the handler have one additional trick, +they may invoke `next('route')`. Calling `next('route')` bypasses the remaining +middleware and the handler mounted for this route, passing the request to the +next route suitable for handling this request. + +Route handlers and middleware can themselves use `next('router')` at any time +to exit the current router instance completely, invoking the top-level callback. + +### router.param(name, param_middleware) + +Maps the specified path parameter `name` to a specialized param-capturing middleware. + +This function positions the middleware in the same stack as `.use`. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Parameter mapping is used to provide pre-conditions to routes +which use normalized placeholders. For example a _:user_id_ parameter +could automatically load a user's information from the database without +any additional code: + + + +```js +router.param('user_id', function (req, res, next, id) { + User.find(id, function (err, user) { + if (err) { + return next(err) + } else if (!user) { + return next(new Error('failed to load user')) + } + req.user = user + + // continue processing the request + next() + }) +}) +``` + +### router.route(path) + +Creates an instance of a single `Route` for the given `path`. +(See `Router.Route` below) + +Routes can be used to handle http `methods` with their own, optional middleware. + +Using `router.route(path)` is a recommended approach to avoiding duplicate +route naming and thus typo errors. + + + +```js +var api = router.route('/api/') +``` + +## Router.Route(path) + +Represents a single route as an instance that can be used to handle http +`methods` with it's own, optional middleware. + +### route\[method](handler) + +These are functions which you can directly call on a route to register a new +`handler` for the `method` on the route. + + + +```js +// handle a `GET` request +var status = router.route('/status') + +status.get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('All Systems Green!') +}) +``` + +### route.all(handler) + +Adds a handler for all HTTP methods to this route. + +The handler can behave like middleware and call `next` to continue processing +rather than responding. + + + +```js +router.route('/') + .all(function (req, res, next) { + next() + }) + .all(checkSomething) + .get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') + }) +``` + +## Middleware + +Middleware (and method handlers) are functions that follow specific function +parameters and have defined behavior when used with `router`. The most common +format is with three parameters - "req", "res" and "next". + +- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance. +- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance. +- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Middleware and method handlers can also be defined with four arguments. When +the function has four parameters defined, the first argument is an error and +subsequent arguments remain, becoming - "err", "req", "res", "next". These +functions are "error handling middleware", and can be used for handling +errors that occurred in previous handlers (E.g. from calling `next(err)`). +This is most used when you want to define arbitrary rendering of errors. + + + +```js +router.get('/error_route', function (req, res, next) { + return next(new Error('Bad Request')) +}) + +router.use(function (err, req, res, next) { + res.end(err.message) //= > "Bad Request" +}) +``` + +Error handling middleware will **only** be invoked when an error was given. As +long as the error is in the pipeline, normal middleware and handlers will be +bypassed - only error handling middleware will be invoked with an error. + +## Examples + +```js +// import our modules +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') +var compression = require('compression') +var bodyParser = require('body-parser') + +// store our message to display +var message = 'Hello World!' + +// initialize the router & server and add a final callback. +var router = Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// use some middleware and compress all outgoing responses +router.use(compression()) + +// handle `GET` requests to `/message` +router.get('/message', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') +}) + +// create and mount a new router for our API +var api = Router() +router.use('/api/', api) + +// add a body parsing middleware to our API +api.use(bodyParser.json()) + +// handle `PATCH` requests to `/api/set-message` +api.patch('/set-message', function (req, res) { + if (req.body.value) { + message = req.body.value + + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') + } else { + res.statusCode = 400 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Invalid API Syntax\n') + } +}) + +// make our http server listen to connections +server.listen(8080) +``` + +You can get the message by running this command in your terminal, + or navigating to `127.0.0.1:8080` in a web browser. +```bash +curl http://127.0.0.1:8080 +``` + +You can set the message by sending it a `PATCH` request via this command: +```bash +curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' +``` + +### Example using mergeParams + +```js +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') + +// this example is about the mergeParams option +var opts = { mergeParams: true } + +// make a router with out special options +var router = Router(opts) +var server = http.createServer(function onRequest (req, res) { + // set something to be passed into the router + req.params = { type: 'kitten' } + + router(req, res, finalhandler(req, res)) +}) + +router.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // with respond with the the params that were passed in + res.end(req.params.type + '\n') +}) + +// make another router with our options +var handler = Router(opts) + +// mount our new router to a route that accepts a param +router.use('/:path', handler) + +handler.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // will respond with the param of the router's parent route + res.end(req.params.path + '\n') +}) + +// make our http server listen to connections +server.listen(8080) +``` + +Now you can get the type, or what path you are requesting: +```bash +curl http://127.0.0.1:8080 +> kitten +curl http://127.0.0.1:8080/such_path +> such_path +``` + +### Example of advanced `.route()` usage + +This example shows how to implement routes where there is a custom +handler to execute when the path matched, but no methods matched. +Without any special handling, this would be treated as just a +generic non-match by `router` (which typically results in a 404), +but with a custom handler, a `405 Method Not Allowed` can be sent. + +```js +var http = require('http') +var finalhandler = require('finalhandler') +var Router = require('router') + +// create the router and server +var router = new Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// register a route and add all methods +router.route('/pet/:id') + .get(function (req, res) { + // this is GET /pet/:id + res.setHeader('Content-Type', 'application/json') + res.end(JSON.stringify({ name: 'tobi' })) + }) + .delete(function (req, res) { + // this is DELETE /pet/:id + res.end() + }) + .all(function (req, res) { + // this is called for all other methods not + // defined above for /pet/:id + res.statusCode = 405 + res.end() + }) + +// make our http server listen to connections +server.listen(8080) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci +[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/router.svg +[npm-url]: https://npmjs.org/package/router +[node-version-image]: https://img.shields.io/node/v/router.svg +[node-version-url]: http://nodejs.org/download/ +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master +[downloads-image]: https://img.shields.io/npm/dm/router.svg +[downloads-url]: https://npmjs.org/package/router diff --git a/.pnpm-store/v10/files/12/0cff7383d78bbf7746f11101e973ed0af9d0ded6537823f4acbfa659d29c1bd09d55ec434bdc7661f26cb5278bacc76a55d95248753431f4099f98f9532f94 b/.pnpm-store/v10/files/12/0cff7383d78bbf7746f11101e973ed0af9d0ded6537823f4acbfa659d29c1bd09d55ec434bdc7661f26cb5278bacc76a55d95248753431f4099f98f9532f94 new file mode 100644 index 0000000..d452b04 --- /dev/null +++ b/.pnpm-store/v10/files/12/0cff7383d78bbf7746f11101e973ed0af9d0ded6537823f4acbfa659d29c1bd09d55ec434bdc7661f26cb5278bacc76a55d95248753431f4099f98f9532f94 @@ -0,0 +1,34 @@ +{ + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ] +} diff --git a/.pnpm-store/v10/files/12/a2a3bf2abafa5e3f669278ee332c87e4a164cfe54ef6019ca8b5f3d41f38f10224d52f471d0256aad6600dec9fb3a1edf3c84f38cc9f1cfd4eb9a2af8a0066 b/.pnpm-store/v10/files/12/a2a3bf2abafa5e3f669278ee332c87e4a164cfe54ef6019ca8b5f3d41f38f10224d52f471d0256aad6600dec9fb3a1edf3c84f38cc9f1cfd4eb9a2af8a0066 new file mode 100644 index 0000000..48f05d0 --- /dev/null +++ b/.pnpm-store/v10/files/12/a2a3bf2abafa5e3f669278ee332c87e4a164cfe54ef6019ca8b5f3d41f38f10224d52f471d0256aad6600dec9fb3a1edf3c84f38cc9f1cfd4eb9a2af8a0066 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.pnpm-store/v10/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 b/.pnpm-store/v10/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 new file mode 100644 index 0000000..7c52bdf --- /dev/null +++ b/.pnpm-store/v10/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/.pnpm-store/v10/files/13/2bcee4ea7aba788c26c4e09c3260567cbd139321338d4c93ee4cc93b1e87238a0afbad7fae063f8022e8e227e0fed3a5f2924bbf6e861aae7274fda3152574 b/.pnpm-store/v10/files/13/2bcee4ea7aba788c26c4e09c3260567cbd139321338d4c93ee4cc93b1e87238a0afbad7fae063f8022e8e227e0fed3a5f2924bbf6e861aae7274fda3152574 new file mode 100644 index 0000000..04cf87e --- /dev/null +++ b/.pnpm-store/v10/files/13/2bcee4ea7aba788c26c4e09c3260567cbd139321338d4c93ee4cc93b1e87238a0afbad7fae063f8022e8e227e0fed3a5f2924bbf6e861aae7274fda3152574 @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-symbols +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.pnpm-store/v10/files/13/bc7ededd4f7b27cb28a47895e9ff239e55dce77dc1cddbe3bb603462d44f564fd1c4a536f626b3d69cd1bab15920f65cf7ab0683fcfc7f33872b1242f2e208 b/.pnpm-store/v10/files/13/bc7ededd4f7b27cb28a47895e9ff239e55dce77dc1cddbe3bb603462d44f564fd1c4a536f626b3d69cd1bab15920f65cf7ab0683fcfc7f33872b1242f2e208 new file mode 100644 index 0000000..8973cde --- /dev/null +++ b/.pnpm-store/v10/files/13/bc7ededd4f7b27cb28a47895e9ff239e55dce77dc1cddbe3bb603462d44f564fd1c4a536f626b3d69cd1bab15920f65cf7ab0683fcfc7f33872b1242f2e208 @@ -0,0 +1,162 @@ +# on-finished + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + + + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error if request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + + + +```js +var data = '' + +req.setEncoding('utf8') +req.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var fs = require('fs') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest (req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function () { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci +[ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[node-image]: https://badgen.net/npm/node/on-finished +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/on-finished +[npm-url]: https://npmjs.org/package/on-finished +[npm-version-image]: https://badgen.net/npm/v/on-finished diff --git a/.pnpm-store/v10/files/14/19d8bcdf9aaea312ba5f9eb7cd12aa3ceab4994a5217c9b06ae50b6a54dc9be444bf851dc1105df2c7981785c433a41a36eff5c67ea3df240ac758a473fc27 b/.pnpm-store/v10/files/14/19d8bcdf9aaea312ba5f9eb7cd12aa3ceab4994a5217c9b06ae50b6a54dc9be444bf851dc1105df2c7981785c433a41a36eff5c67ea3df240ac758a473fc27 new file mode 100644 index 0000000..43bee3b --- /dev/null +++ b/.pnpm-store/v10/files/14/19d8bcdf9aaea312ba5f9eb7cd12aa3ceab4994a5217c9b06ae50b6a54dc9be444bf851dc1105df2c7981785c433a41a36eff5c67ea3df240ac758a473fc27 @@ -0,0 +1,3 @@ +declare function isObject(x: unknown): x is object; + +export = isObject; diff --git a/.pnpm-store/v10/files/14/266b3992794e959e6ced09aef48912f87a8f59dd6070cecc923d5ca86b9eb4821f2fe5eb5078c01db832ee9ff58f6ca70ae687a9e1d1de6144cafe44a0f6ca b/.pnpm-store/v10/files/14/266b3992794e959e6ced09aef48912f87a8f59dd6070cecc923d5ca86b9eb4821f2fe5eb5078c01db832ee9ff58f6ca70ae687a9e1d1de6144cafe44a0f6ca new file mode 100644 index 0000000..4583671 --- /dev/null +++ b/.pnpm-store/v10/files/14/266b3992794e959e6ced09aef48912f87a8f59dd6070cecc923d5ca86b9eb4821f2fe5eb5078c01db832ee9ff58f6ca70ae687a9e1d1de6144cafe44a0f6ca @@ -0,0 +1,29 @@ +1.0.5 / 2023-01-29 +================== + + * perf: skip value escaping when unnecessary + +1.0.4 / 2017-09-11 +================== + + * perf: skip parameter parsing when no parameters + +1.0.3 / 2017-09-10 +================== + + * perf: remove argument reassignment + +1.0.2 / 2016-05-09 +================== + + * perf: enable strict mode + +1.0.1 / 2015-02-13 +================== + + * Improve missing `Content-Type` header error message + +1.0.0 / 2015-02-01 +================== + + * Initial implementation, derived from `media-typer@0.3.0` diff --git a/.pnpm-store/v10/files/14/2ead045f1605cee369b3ad7165489bb7bdb2e6ab893357a092354b0cb3e5c5efe603bc5009ea754bb92e38950f663034196433258cc63f66727ef34860f6b6 b/.pnpm-store/v10/files/14/2ead045f1605cee369b3ad7165489bb7bdb2e6ab893357a092354b0cb3e5c5efe603bc5009ea754bb92e38950f663034196433258cc63f66727ef34860f6b6 new file mode 100644 index 0000000..16bfdfe --- /dev/null +++ b/.pnpm-store/v10/files/14/2ead045f1605cee369b3ad7165489bb7bdb2e6ab893357a092354b0cb3e5c5efe603bc5009ea754bb92e38950f663034196433258cc63f66727ef34860f6b6 @@ -0,0 +1,5 @@ +declare function setDunderProto

(target: {}, proto: P): P; + +declare const x: false | typeof setDunderProto; + +export = x; \ No newline at end of file diff --git a/.pnpm-store/v10/files/14/ae532129d737c16b54dffadec052728af1631e481d80c7045da3cbc5bf088338ecc80b9932c31fde53469d0091669415780cdaeaa998290785f9a57215a1f0 b/.pnpm-store/v10/files/14/ae532129d737c16b54dffadec052728af1631e481d80c7045da3cbc5bf088338ecc80b9932c31fde53469d0091669415780cdaeaa998290785f9a57215a1f0 new file mode 100644 index 0000000..cc7e103 --- /dev/null +++ b/.pnpm-store/v10/files/14/ae532129d737c16b54dffadec052728af1631e481d80c7045da3cbc5bf088338ecc80b9932c31fde53469d0091669415780cdaeaa998290785f9a57215a1f0 @@ -0,0 +1,61 @@ +# side-channel [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. + +## Getting started + +```sh +npm install --save side-channel +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannel = require('side-channel'); + +const channel = getSideChannel(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel.svg +[deps-url]: https://david-dm.org/ljharb/side-channel +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel +[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel +[actions-url]: https://github.com/ljharb/side-channel/actions diff --git a/.pnpm-store/v10/files/14/c325673e4ac4c71ce90b33b32c4d50458800342544950d736573763667fe33d4ced07bdc2db9e419fe6cf764cca3d7fc6a3972c7be04330c81c4f507faaa5d b/.pnpm-store/v10/files/14/c325673e4ac4c71ce90b33b32c4d50458800342544950d736573763667fe33d4ced07bdc2db9e419fe6cf764cca3d7fc6a3972c7be04330c81c4f507faaa5d new file mode 100644 index 0000000..7c57d32 --- /dev/null +++ b/.pnpm-store/v10/files/14/c325673e4ac4c71ce90b33b32c4d50458800342544950d736573763667fe33d4ced07bdc2db9e419fe6cf764cca3d7fc6a3972c7be04330c81c4f507faaa5d @@ -0,0 +1,225 @@ +var debug = require('debug')('nodemon'); +var fs = require('fs'); +var path = require('path'); +var exists = fs.exists || path.exists; +var utils = require('../utils'); +var rules = require('../rules'); +var parse = require('../rules/parse'); +var exec = require('./exec'); +var defaults = require('./defaults'); + +module.exports = load; +module.exports.mutateExecOptions = mutateExecOptions; + +var existsSync = fs.existsSync || path.existsSync; + +function findAppScript() { + // nodemon has been run alone, so try to read the package file + // or try to read the index.js file + + var pkg = + existsSync(path.join(process.cwd(), 'package.json')) && + require(path.join(process.cwd(), 'package.json')); + if ((!pkg || pkg.main == undefined) && existsSync('./index.js')) { + return 'index.js'; + } +} + +/** + * Load the nodemon config, first reading the global root/nodemon.json, then + * the local nodemon.json to the exec and then overwriting using any user + * specified settings (i.e. from the cli) + * + * @param {Object} settings user defined settings + * @param {Object} options global options + * @param {Object} config the config object to be updated + * @param {Function} callback that receives complete config + */ +function load(settings, options, config, callback) { + config.loaded = []; + // first load the root nodemon.json + loadFile(options, config, utils.home, function (options) { + // then load the user's local configuration file + if (settings.configFile) { + options.configFile = path.resolve(settings.configFile); + } + loadFile(options, config, process.cwd(), function (options) { + // Then merge over with the user settings (parsed from the cli). + // Note that merge protects and favours existing values over new values, + // and thus command line arguments get priority + options = utils.merge(settings, options); + + // legacy support + if (!Array.isArray(options.ignore)) { + options.ignore = [options.ignore]; + } + + if (!options.ignoreRoot) { + options.ignoreRoot = defaults.ignoreRoot; + } + + // blend the user ignore and the default ignore together + if (options.ignoreRoot && options.ignore) { + if (!Array.isArray(options.ignoreRoot)) { + options.ignoreRoot = [options.ignoreRoot]; + } + options.ignore = options.ignoreRoot.concat(options.ignore); + } else { + options.ignore = defaults.ignore.concat(options.ignore); + } + + // add in any missing defaults + options = utils.merge(options, defaults); + + if (!options.script && !options.exec) { + var found = findAppScript(); + if (found) { + if (!options.args) { + options.args = []; + } + // if the script is found as a result of not being on the command + // line, then we move any of the pre double-dash args in execArgs + const n = + options.scriptPosition === null + ? options.args.length + : options.scriptPosition; + + options.execArgs = (options.execArgs || []).concat( + options.args.splice(0, n) + ); + options.scriptPosition = null; + + options.script = found; + } + } + + mutateExecOptions(options); + + if (options.quiet) { + utils.quiet(); + } + + if (options.verbose) { + utils.debug = true; + } + + // simplify the ready callback to be called after the rules are normalised + // from strings to regexp through the rules lib. Note that this gets + // created *after* options is overwritten twice in the lines above. + var ready = function (options) { + normaliseRules(options, callback); + }; + + ready(options); + }); + }); +} + +function normaliseRules(options, ready) { + // convert ignore and watch options to rules/regexp + rules.watch.add(options.watch); + rules.ignore.add(options.ignore); + + // normalise the watch and ignore arrays + options.watch = options.watch === false ? false : rules.rules.watch; + options.ignore = rules.rules.ignore; + + ready(options); +} + +/** + * Looks for a config in the current working directory, and a config in the + * user's home directory, merging the two together, giving priority to local + * config. This can then be overwritten later by command line arguments + * + * @param {Function} ready callback to pass loaded settings to + */ +function loadFile(options, config, dir, ready) { + if (!ready) { + ready = function () {}; + } + + var callback = function (settings) { + // prefer the local nodemon.json and fill in missing items using + // the global options + ready(utils.merge(settings, options)); + }; + + if (!dir) { + return callback({}); + } + + var filename = options.configFile || path.join(dir, 'nodemon.json'); + + if (config.loaded.indexOf(filename) !== -1) { + // don't bother re-parsing the same config file + return callback({}); + } + + fs.readFile(filename, 'utf8', function (err, data) { + if (err) { + if (err.code === 'ENOENT') { + if (!options.configFile && dir !== utils.home) { + // if no specified local config file and local nodemon.json + // doesn't exist, try the package.json + return loadPackageJSON(config, callback); + } + } + return callback({}); + } + + var settings = {}; + + try { + settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, '')); + if (!filename.endsWith('package.json') || settings.nodemonConfig) { + config.loaded.push(filename); + } + } catch (e) { + utils.log.fail('Failed to parse config ' + filename); + console.error(e); + process.exit(1); + } + + // options values will overwrite settings + callback(settings); + }); +} + +function loadPackageJSON(config, ready) { + if (!ready) { + ready = () => {}; + } + + const dir = process.cwd(); + const filename = path.join(dir, 'package.json'); + const packageLoadOptions = { configFile: filename }; + return loadFile(packageLoadOptions, config, dir, (settings) => { + ready(settings.nodemonConfig || {}); + }); +} + +function mutateExecOptions(options) { + // work out the execOptions based on the final config we have + options.execOptions = exec( + { + script: options.script, + exec: options.exec, + args: options.args, + scriptPosition: options.scriptPosition, + nodeArgs: options.nodeArgs, + execArgs: options.execArgs, + ext: options.ext, + env: options.env, + }, + options.execMap + ); + + // clean up values that we don't need at the top level + delete options.scriptPosition; + delete options.script; + delete options.args; + delete options.ext; + + return options; +} diff --git a/.pnpm-store/v10/files/15/bfa9fad522ddc043383704cac725c8cc2b4565708b891e9e03d889237cd528ee4d347e54a983c801550856c2d1ac1269dcc127edfa6d63bf3d2aa0a19eb358 b/.pnpm-store/v10/files/15/bfa9fad522ddc043383704cac725c8cc2b4565708b891e9e03d889237cd528ee4d347e54a983c801550856c2d1ac1269dcc127edfa6d63bf3d2aa0a19eb358 new file mode 100644 index 0000000..dc95d34 --- /dev/null +++ b/.pnpm-store/v10/files/15/bfa9fad522ddc043383704cac725c8cc2b4565708b891e9e03d889237cd528ee4d347e54a983c801550856c2d1ac1269dcc127edfa6d63bf3d2aa0a19eb358 @@ -0,0 +1,34 @@ +var ignoreRoot = require('ignore-by-default').directories(); + +// default options for config.options +const defaults = { + restartable: 'rs', + colours: true, + execMap: { + py: 'python', + rb: 'ruby', + ts: 'ts-node', + // more can be added here such as ls: lsc - but please ensure it's cross + // compatible with linux, mac and windows, or make the default.js + // dynamically append the `.cmd` for node based utilities + }, + ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`), + watch: ['*.*'], + stdin: true, + runOnChangeOnly: false, + verbose: false, + signal: 'SIGUSR2', + // 'stdout' refers to the default behaviour of a required nodemon's child, + // but also includes stderr. If this is false, data is still dispatched via + // nodemon.on('stdout/stderr') + stdout: true, + watchOptions: {}, +}; + +const nodeOptions = process.env.NODE_OPTIONS || ''; // ? + +if (/--(loader|import)\b/.test(nodeOptions)) { + delete defaults.execMap.ts; +} + +module.exports = defaults; diff --git a/.pnpm-store/v10/files/16/231114d138146d13e1c3d5b035284d8b06742e3aae6337b00b23fb2843a5008d577ca3c6516db24398656017f331050948d5e7d07b85d24983f1540289a69a b/.pnpm-store/v10/files/16/231114d138146d13e1c3d5b035284d8b06742e3aae6337b00b23fb2843a5008d577ca3c6516db24398656017f331050948d5e7d07b85d24983f1540289a69a new file mode 100644 index 0000000..18473e4 --- /dev/null +++ b/.pnpm-store/v10/files/16/231114d138146d13e1c3d5b035284d8b06742e3aae6337b00b23fb2843a5008d577ca3c6516db24398656017f331050948d5e7d07b85d24983f1540289a69a @@ -0,0 +1,421 @@ +3.0.1 / 2025-03-26 +=================== + +* deps: mime-db@1.54.0 + +3.0.0 / 2024-08-31 +=================== + +* Drop support for node <18 +* deps: mime-db@1.53.0 +* resolve extension conflicts with mime-score (#119) + * asc -> application/pgp-signature is now application/pgp-keys + * mpp -> application/vnd.ms-project is now application/dash-patch+xml + * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert + * bdoc -> application/x-bdoc is now application/bdoc + * wmz -> application/x-msmetafile is now application/x-ms-wmz + * xsl -> application/xslt+xml is now application/xml + * wav -> audio/wave is now audio/wav + * rtf -> text/rtf is now application/rtf + * xml -> text/xml is now application/xml + * mp4 -> video/mp4 is now application/mp4 + * mpg4 -> video/mp4 is now application/mp4 + + +2.1.35 / 2022-03-12 +=================== + + * deps: mime-db@1.52.0 + - Add extensions from IANA for more `image/*` types + - Add extension `.asc` to `application/pgp-keys` + - Add extensions to various XML types + - Add new upstream MIME types + +2.1.34 / 2021-11-08 +=================== + + * deps: mime-db@1.51.0 + - Add new upstream MIME types + +2.1.33 / 2021-10-01 +=================== + + * deps: mime-db@1.50.0 + - Add deprecated iWorks mime types and extensions + - Add new upstream MIME types + +2.1.32 / 2021-07-27 +=================== + + * deps: mime-db@1.49.0 + - Add extension `.trig` to `application/trig` + - Add new upstream MIME types + +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + +2.1.30 / 2021-04-02 +=================== + + * deps: mime-db@1.47.0 + - Add extension `.amr` to `audio/amr` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +2.1.29 / 2021-02-17 +=================== + + * deps: mime-db@1.46.0 + - Add extension `.amr` to `audio/amr` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.opus` to `audio/ogg` + - Add new upstream MIME types + +2.1.28 / 2021-01-01 +=================== + + * deps: mime-db@1.45.0 + - Add `application/ubjson` with extension `.ubj` + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + +2.1.19 / 2018-07-17 +=================== + + * deps: mime-db@~1.35.0 + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.owl` to `application/rdf+xml` + - Add new upstream MIME types + - Add UTF-8 as default charset for `text/turtle` + +2.1.18 / 2018-02-16 +=================== + + * deps: mime-db@~1.33.0 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add new upstream MIME types + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +2.1.17 / 2017-09-01 +=================== + + * deps: mime-db@~1.30.0 + - Add `application/vnd.ms-outlook` + - Add `application/x-arj` + - Add extension `.mjs` to `application/javascript` + - Add glTF types and extensions + - Add new upstream MIME types + - Add `text/x-org` + - Add VirtualBox MIME types + - Fix `source` records for `video/*` types that are IANA + - Update `font/opentype` to registered `font/otf` + +2.1.16 / 2017-07-24 +=================== + + * deps: mime-db@~1.29.0 + - Add `application/fido.trusted-apps+json` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add new upstream MIME types + - Update extensions `.md` and `.markdown` to be `text/markdown` + +2.1.15 / 2017-03-23 +=================== + + * deps: mime-db@~1.27.0 + - Add new mime types + - Add `image/apng` + +2.1.14 / 2017-01-14 +=================== + + * deps: mime-db@~1.26.0 + - Add new mime types + +2.1.13 / 2016-11-18 +=================== + + * deps: mime-db@~1.25.0 + - Add new mime types + +2.1.12 / 2016-09-18 +=================== + + * deps: mime-db@~1.24.0 + - Add new mime types + - Add `audio/mp3` + +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + +2.1.10 / 2016-02-15 +=================== + + * deps: mime-db@~1.22.0 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/.pnpm-store/v10/files/16/6bbfe6e785986de41d7dfddb2c2b1741619e3a1e50498d0a83bbaa704e4e8e66df3199928052c3031f7fc2578873aad234ca7dc7d5dc440c84e294655590b8 b/.pnpm-store/v10/files/16/6bbfe6e785986de41d7dfddb2c2b1741619e3a1e50498d0a83bbaa704e4e8e66df3199928052c3031f7fc2578873aad234ca7dc7d5dc440c84e294655590b8 new file mode 100644 index 0000000..d4b35ca --- /dev/null +++ b/.pnpm-store/v10/files/16/6bbfe6e785986de41d7dfddb2c2b1741619e3a1e50498d0a83bbaa704e4e8e66df3199928052c3031f7fc2578873aad234ca7dc7d5dc440c84e294655590b8 @@ -0,0 +1,62 @@ +{ + "name": "path-to-regexp", + "version": "8.2.0", + "description": "Express style path to RegExp utility", + "keywords": [ + "express", + "regexp", + "route", + "routing" + ], + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/path-to-regexp.git" + }, + "license": "MIT", + "exports": "./dist/index.js", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "lint": "ts-scripts lint", + "prepare": "ts-scripts install && npm run build", + "size": "size-limit", + "specs": "ts-scripts specs", + "test": "ts-scripts test && npm run size" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@size-limit/preset-small-lib": "^11.1.2", + "@types/node": "^22.7.2", + "@types/semver": "^7.3.1", + "@vitest/coverage-v8": "^2.1.1", + "recheck": "^4.4.5", + "size-limit": "^11.1.2", + "typescript": "^5.5.3" + }, + "engines": { + "node": ">=16" + }, + "publishConfig": { + "access": "public" + }, + "size-limit": [ + { + "path": "dist/index.js", + "limit": "2.2 kB" + } + ], + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/.pnpm-store/v10/files/16/e7ba92439751a33c76a9dda0e1e979f89948e76b81e7a7dd096093ce93674dad3c176b98db7edd09148df40c3abbb8dd49ba35f76876d95539eec51b007bec b/.pnpm-store/v10/files/16/e7ba92439751a33c76a9dda0e1e979f89948e76b81e7a7dd096093ce93674dad3c176b98db7edd09148df40c3abbb8dd49ba35f76876d95539eec51b007bec new file mode 100644 index 0000000..bf15e48 --- /dev/null +++ b/.pnpm-store/v10/files/16/e7ba92439751a33c76a9dda0e1e979f89948e76b81e7a7dd096093ce93674dad3c176b98db7edd09148df40c3abbb8dd49ba35f76876d95539eec51b007bec @@ -0,0 +1,293 @@ +/*! + * finalhandler + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') + +/** + * Module variables. + * @private + */ + +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replaceAll('\n', '
') + .replaceAll(' ', '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '

' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && res.headersSent) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + setImmediate(onerror, err, req, res) + } + + // cannot actually respond + if (res.headersSent) { + debug('cannot %d after headers sent', status) + if (req.socket) { + req.socket.destroy() + } + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + return { ...err.headers } +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + + if (req.httpVersionMajor < 2) { + res.statusMessage = statuses.message[status] + } + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + for (const [key, value] of Object.entries(headers ?? {})) { + res.setHeader(key, value) + } + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + req.unpipe() + + // flush the request + onFinished(req, write) + req.resume() +} diff --git a/.pnpm-store/v10/files/17/5596609c91767a101d6b1051de91563695b92245b5c4bd0a2ba4cc24ef28f0480ea2275878e566fc08d203d182545f7cc7ebfb08966cba6babed5112eddbbd b/.pnpm-store/v10/files/17/5596609c91767a101d6b1051de91563695b92245b5c4bd0a2ba4cc24ef28f0480ea2275878e566fc08d203d182545f7cc7ebfb08966cba6babed5112eddbbd new file mode 100644 index 0000000..248de7a --- /dev/null +++ b/.pnpm-store/v10/files/17/5596609c91767a101d6b1051de91563695b92245b5c4bd0a2ba4cc24ef28f0480ea2275878e566fc08d203d182545f7cc7ebfb08966cba6babed5112eddbbd @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2018 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.pnpm-store/v10/files/17/aaa7c6a6284be1ad03992540de37205b972e9acf263a7a787ea66c26cf24e7035f13042bdbbaa8aff8cf27a1f05a1606f1816b19248eefd8e73af7f7563c1d b/.pnpm-store/v10/files/17/aaa7c6a6284be1ad03992540de37205b972e9acf263a7a787ea66c26cf24e7035f13042bdbbaa8aff8cf27a1f05a1606f1816b19248eefd8e73af7f7563c1d new file mode 100644 index 0000000..2b9baa9 --- /dev/null +++ b/.pnpm-store/v10/files/17/aaa7c6a6284be1ad03992540de37205b972e9acf263a7a787ea66c26cf24e7035f13042bdbbaa8aff8cf27a1f05a1606f1816b19248eefd8e73af7f7563c1d @@ -0,0 +1,15 @@ +var Ti=Object.create;var _e=Object.defineProperty;var bi=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var Si=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty;var Ci=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),Ue=(a,t)=>{for(var e in t)_e(a,e,{get:t[e],enumerable:!0})},wi=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ai(t))!Ei.call(a,i)&&i!==e&&_e(a,i,{get:()=>t[i],enumerable:!(s=bi(t,i))||s.enumerable});return a};var ls=(a,t,e)=>(e=a!=null?Ti(Si(a)):{},wi(t||!a||!a.__esModule?_e(e,"default",{value:a,enumerable:!0}):e,a));var Tt=Ci(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});function Ii(a,t){if(a==null)return{};var e={};for(var s in a)if({}.hasOwnProperty.call(a,s)){if(t.indexOf(s)!==-1)continue;e[s]=a[s]}return e}var B=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},se=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function D(a,t){let{line:e,column:s,index:i}=a;return new B(e,s+t,i+t)}var hs="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Ni={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:hs},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:hs}},cs={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Se=a=>a.type==="UpdateExpression"?cs.UpdateExpression[`${a.prefix}`]:cs[a.type],ki={AccessorIsGenerator:({kind:a})=>`A ${a}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:a})=>`Missing initializer in ${a} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:a})=>`\`${a}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:a,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { '${a}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:a})=>`'${a==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:a})=>`Unsyntactic ${a==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:a})=>`A string literal cannot be used as an imported binding. +- Did you mean \`import { "${a}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:a})=>`Expected number in radix ${a}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:a})=>`Escape sequence in keyword ${a}.`,InvalidIdentifier:({identifierName:a})=>`Invalid identifier ${a}.`,InvalidLhs:({ancestor:a})=>`Invalid left-hand side in ${Se(a)}.`,InvalidLhsBinding:({ancestor:a})=>`Binding invalid left-hand side in ${Se(a)}.`,InvalidLhsOptionalChaining:({ancestor:a})=>`Invalid optional chaining in the left-hand side of ${Se(a)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:a})=>`Unexpected character '${a}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:a})=>`Private name #${a} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:a})=>`Label '${a}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:a})=>`This experimental syntax requires enabling the parser plugin: ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:a})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${a.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:a})=>`Duplicate key "${a}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:a})=>`An export name cannot include a lone surrogate, found '\\u${a.toString(16)}'.`,ModuleExportUndefined:({localName:a})=>`Export '${a}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:a})=>`Private names are only allowed in property accesses (\`obj.#${a}\`) or in \`in\` expressions (\`#${a} in obj\`).`,PrivateNameRedeclaration:({identifierName:a})=>`Duplicate private name #${a}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:a})=>`Unexpected keyword '${a}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:a})=>`Unexpected reserved word '${a}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:a,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${a?`, expected "${a}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:a,onlyValidPropertyName:t})=>`The only valid meta property for ${a} is ${a}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:a})=>`Identifier '${a}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},vi={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:a})=>`Assigning to '${a}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:a})=>`Binding '${a}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Li={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:a})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(a)}\`.`},Di=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Mi=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:a})=>`Invalid topic token ${a}. In order to use ${a} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${a}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:a})=>`Hack-style pipe body cannot be an unparenthesized ${Se({type:a})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),Oi=["message"];function ps(a,t,e){Object.defineProperty(a,t,{enumerable:!1,configurable:!0,value:e})}function Fi({toMessage:a,code:t,reasonCode:e,syntaxPlugin:s}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let r={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};r[e]&&(e=r[e])}return function r(n,o){let l=new SyntaxError;return l.code=t,l.reasonCode=e,l.loc=n,l.pos=n.index,l.syntaxPlugin=s,i&&(l.missingPlugin=o.missingPlugin),ps(l,"clone",function(c={}){var u;let{line:f,column:d,index:y}=(u=c.loc)!=null?u:n;return r(new B(f,d,y),Object.assign({},o,c.details))}),ps(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let h=`${a(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function F(a,t){if(Array.isArray(a))return s=>F(s,a[0]);let e={};for(let s of Object.keys(a)){let i=a[s],r=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=r,o=Ii(r,Oi),l=typeof n=="string"?()=>n:n;e[s]=Fi(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:l},t?{syntaxPlugin:t}:{},o))}return e}var p=Object.assign({},F(Ni),F(ki),F(vi),F(Li),F`pipelineOperator`(Mi));function Bi(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Ri(a){let t=Bi();if(a==null)return t;if(a.annexB!=null&&a.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))a[e]!=null&&(t[e]=a[e]);if(t.startLine===1)a.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:a.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((a.startColumn==null||a.startIndex==null)&&a.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}var{defineProperty:_i}=Object,us=(a,t)=>{a&&_i(a,t,{enumerable:!1,value:a[t]})};function he(a){return us(a.loc.start,"index"),us(a.loc.end,"index"),a}var Ui=a=>class extends a{parse(){let e=he(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(he)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let r=this.estreeParseLiteral(i);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,s){let i=this.startNodeAtNode(e);return i.expression=e,this.finishNodeAt(i,"ChainExpression",s)}directiveToStmt(e){let s=e.value;delete e.value,this.castNodeTo(s,"Literal"),s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=this.castNodeTo(e,"ExpressionStatement");return i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:s,end:i,loc:r,range:n,raw:o,value:l}=e,h=Object.create(e.constructor.prototype);return h.type="Literal",h.start=s,h.end=i,h.loc=r,h.range=n,h.raw=o,h.value=l,h}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,r,n){super.parseBlockBody(e,s,i,r,n);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,r,n,o,l=!1){let h=this.startNode();h.kind=e.kind,h=super.parseMethod(h,s,i,r,n,o,l),delete h.kind;let{typeParameters:c}=e;c&&(delete e.typeParameters,h.typeParameters=c,this.resetStartLocationFromNode(h,c));let u=this.castNodeTo(h,"FunctionExpression");return e.value=u,o==="ClassPrivateMethod"&&(e.computed=!1),o==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(s,"PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(s,"PropertyDefinition"),s.computed=!1),s}parseClassAccessorProperty(e){let s=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractAccessorProperty")):this.castNodeTo(s,"AccessorProperty")),s}parseObjectProperty(e,s,i,r){let n=super.parseObjectProperty(e,s,i,r);return n&&(n.kind="init",this.castNodeTo(n,"Property")),n}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:r}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(p.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(p.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var r,n;this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=(r=i.arguments[1])!=null?r:null,i.attributes=(n=i.arguments[1])!=null?n:null,delete i.arguments,delete i.callee}else i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1;return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(r,"ExportAllDeclaration"),r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=r;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===r.start&&this.resetStartLocation(r,i)}break}return r}stopParseSubscript(e,s){let i=super.stopParseSubscript(e,s);return s.optionalChainMember?this.estreeParseChainExpression(i,e.loc.end):i}parseMember(e,s,i,r,n){let o=super.parseMember(e,s,i,r,n);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,s){let i=super.castNodeTo(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(e){let s=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(s),s}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,s,i){return he(super.finishNodeAt(e,s,i))}finishNode(e,s){let i=super.finishNode(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(e,s){super.resetStartLocation(e,s),he(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),he(e)}},X=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},w={brace:new X("{"),j_oTag:new X("...",!0)};w.template=new X("`",!0);var b=!0,m=!0,je=!0,ce=!0,V=!0,ji=!0,we=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},pt=new Map;function E(a,t={}){t.keyword=a;let e=P(a,t);return pt.set(a,e),e}function L(a,t){return P(a,{beforeExpr:b,binop:t})}var de=-1,_=[],ut=[],ft=[],dt=[],mt=[],yt=[];function P(a,t={}){var e,s,i,r;return++de,ut.push(a),ft.push((e=t.binop)!=null?e:-1),dt.push((s=t.beforeExpr)!=null?s:!1),mt.push((i=t.startsExpr)!=null?i:!1),yt.push((r=t.prefix)!=null?r:!1),_.push(new we(a,t)),de}function T(a,t={}){var e,s,i,r;return++de,pt.set(a,de),ut.push(a),ft.push((e=t.binop)!=null?e:-1),dt.push((s=t.beforeExpr)!=null?s:!1),mt.push((i=t.startsExpr)!=null?i:!1),yt.push((r=t.prefix)!=null?r:!1),_.push(new we("name",t)),de}var $i={bracketL:P("[",{beforeExpr:b,startsExpr:m}),bracketHashL:P("#[",{beforeExpr:b,startsExpr:m}),bracketBarL:P("[|",{beforeExpr:b,startsExpr:m}),bracketR:P("]"),bracketBarR:P("|]"),braceL:P("{",{beforeExpr:b,startsExpr:m}),braceBarL:P("{|",{beforeExpr:b,startsExpr:m}),braceHashL:P("#{",{beforeExpr:b,startsExpr:m}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:b,startsExpr:m}),parenR:P(")"),comma:P(",",{beforeExpr:b}),semi:P(";",{beforeExpr:b}),colon:P(":",{beforeExpr:b}),doubleColon:P("::",{beforeExpr:b}),dot:P("."),question:P("?",{beforeExpr:b}),questionDot:P("?."),arrow:P("=>",{beforeExpr:b}),template:P("template"),ellipsis:P("...",{beforeExpr:b}),backQuote:P("`",{startsExpr:m}),dollarBraceL:P("${",{beforeExpr:b,startsExpr:m}),templateTail:P("...`",{startsExpr:m}),templateNonTail:P("...${",{beforeExpr:b,startsExpr:m}),at:P("@"),hash:P("#",{startsExpr:m}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:b,isAssign:ce}),assign:P("_=",{beforeExpr:b,isAssign:ce}),slashAssign:P("_=",{beforeExpr:b,isAssign:ce}),xorAssign:P("_=",{beforeExpr:b,isAssign:ce}),moduloAssign:P("_=",{beforeExpr:b,isAssign:ce}),incDec:P("++/--",{prefix:V,postfix:ji,startsExpr:m}),bang:P("!",{beforeExpr:b,prefix:V,startsExpr:m}),tilde:P("~",{beforeExpr:b,prefix:V,startsExpr:m}),doubleCaret:P("^^",{startsExpr:m}),doubleAt:P("@@",{startsExpr:m}),pipeline:L("|>",0),nullishCoalescing:L("??",1),logicalOR:L("||",1),logicalAND:L("&&",2),bitwiseOR:L("|",3),bitwiseXOR:L("^",4),bitwiseAND:L("&",5),equality:L("==/!=/===/!==",6),lt:L("/<=/>=",7),gt:L("/<=/>=",7),relational:L("/<=/>=",7),bitShift:L("<>/>>>",8),bitShiftL:L("<>/>>>",8),bitShiftR:L("<>/>>>",8),plusMin:P("+/-",{beforeExpr:b,binop:9,prefix:V,startsExpr:m}),modulo:P("%",{binop:10,startsExpr:m}),star:P("*",{binop:10}),slash:L("/",10),exponent:P("**",{beforeExpr:b,binop:11,rightAssociative:!0}),_in:E("in",{beforeExpr:b,binop:7}),_instanceof:E("instanceof",{beforeExpr:b,binop:7}),_break:E("break"),_case:E("case",{beforeExpr:b}),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",{beforeExpr:b}),_else:E("else",{beforeExpr:b}),_finally:E("finally"),_function:E("function",{startsExpr:m}),_if:E("if"),_return:E("return",{beforeExpr:b}),_switch:E("switch"),_throw:E("throw",{beforeExpr:b,prefix:V,startsExpr:m}),_try:E("try"),_var:E("var"),_const:E("const"),_with:E("with"),_new:E("new",{beforeExpr:b,startsExpr:m}),_this:E("this",{startsExpr:m}),_super:E("super",{startsExpr:m}),_class:E("class",{startsExpr:m}),_extends:E("extends",{beforeExpr:b}),_export:E("export"),_import:E("import",{startsExpr:m}),_null:E("null",{startsExpr:m}),_true:E("true",{startsExpr:m}),_false:E("false",{startsExpr:m}),_typeof:E("typeof",{beforeExpr:b,prefix:V,startsExpr:m}),_void:E("void",{beforeExpr:b,prefix:V,startsExpr:m}),_delete:E("delete",{beforeExpr:b,prefix:V,startsExpr:m}),_do:E("do",{isLoop:je,beforeExpr:b}),_for:E("for",{isLoop:je}),_while:E("while",{isLoop:je}),_as:T("as",{startsExpr:m}),_assert:T("assert",{startsExpr:m}),_async:T("async",{startsExpr:m}),_await:T("await",{startsExpr:m}),_defer:T("defer",{startsExpr:m}),_from:T("from",{startsExpr:m}),_get:T("get",{startsExpr:m}),_let:T("let",{startsExpr:m}),_meta:T("meta",{startsExpr:m}),_of:T("of",{startsExpr:m}),_sent:T("sent",{startsExpr:m}),_set:T("set",{startsExpr:m}),_source:T("source",{startsExpr:m}),_static:T("static",{startsExpr:m}),_using:T("using",{startsExpr:m}),_yield:T("yield",{startsExpr:m}),_asserts:T("asserts",{startsExpr:m}),_checks:T("checks",{startsExpr:m}),_exports:T("exports",{startsExpr:m}),_global:T("global",{startsExpr:m}),_implements:T("implements",{startsExpr:m}),_intrinsic:T("intrinsic",{startsExpr:m}),_infer:T("infer",{startsExpr:m}),_is:T("is",{startsExpr:m}),_mixins:T("mixins",{startsExpr:m}),_proto:T("proto",{startsExpr:m}),_require:T("require",{startsExpr:m}),_satisfies:T("satisfies",{startsExpr:m}),_keyof:T("keyof",{startsExpr:m}),_readonly:T("readonly",{startsExpr:m}),_unique:T("unique",{startsExpr:m}),_abstract:T("abstract",{startsExpr:m}),_declare:T("declare",{startsExpr:m}),_enum:T("enum",{startsExpr:m}),_module:T("module",{startsExpr:m}),_namespace:T("namespace",{startsExpr:m}),_interface:T("interface",{startsExpr:m}),_type:T("type",{startsExpr:m}),_opaque:T("opaque",{startsExpr:m}),name:P("name",{startsExpr:m}),placeholder:P("%%",{startsExpr:!0}),string:P("string",{startsExpr:m}),num:P("num",{startsExpr:m}),bigint:P("bigint",{startsExpr:m}),decimal:P("decimal",{startsExpr:m}),regexp:P("regexp",{startsExpr:m}),privateName:P("#name",{startsExpr:m}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:!0}),jsxTagStart:P("jsxTagStart",{startsExpr:!0}),jsxTagEnd:P("jsxTagEnd")};function C(a){return a>=93&&a<=133}function Vi(a){return a<=92}function M(a){return a>=58&&a<=133}function Es(a){return a>=58&&a<=137}function qi(a){return dt[a]}function ue(a){return mt[a]}function zi(a){return a>=29&&a<=33}function fs(a){return a>=129&&a<=131}function Hi(a){return a>=90&&a<=92}function xt(a){return a>=58&&a<=92}function Ki(a){return a>=39&&a<=59}function Wi(a){return a===34}function Ji(a){return yt[a]}function Xi(a){return a>=121&&a<=123}function Gi(a){return a>=124&&a<=130}function H(a){return ut[a]}function Ee(a){return ft[a]}function Yi(a){return a===57}function Ie(a){return a>=24&&a<=25}function R(a){return _[a]}_[8].updateContext=a=>{a.pop()},_[5].updateContext=_[7].updateContext=_[23].updateContext=a=>{a.push(w.brace)},_[22].updateContext=a=>{a[a.length-1]===w.template?a.pop():a.push(w.template)},_[143].updateContext=a=>{a.push(w.j_expr,w.j_oTag)};var Pt="\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-\u088E\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\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",Cs="\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-\u1ACE\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",Qi=new RegExp("["+Pt+"]"),Zi=new RegExp("["+Pt+Cs+"]");Pt=Cs=null;var ws=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],er=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function He(a,t){let e=65536;for(let s=0,i=t.length;sa)return!1;if(e+=t[s+1],e>=a)return!0}return!1}function U(a){return a<65?a===36:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&Qi.test(String.fromCharCode(a)):He(a,ws)}function Z(a){return a<48?a===36:a<58?!0:a<65?!1:a<=90?!0:a<97?a===95:a<=122?!0:a<=65535?a>=170&&Zi.test(String.fromCharCode(a)):He(a,ws)||He(a,er)}var gt={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},tr=new Set(gt.keyword),sr=new Set(gt.strict),ir=new Set(gt.strictBind);function Is(a,t){return t&&a==="await"||a==="enum"}function Ns(a,t){return Is(a,t)||sr.has(a)}function ks(a){return ir.has(a)}function vs(a,t){return Ns(a,t)||ks(a)}function rr(a){return tr.has(a)}function ar(a,t,e){return a===64&&t===64&&U(e)}var nr=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function or(a){return nr.has(a)}var me=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},ye=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&707)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new me(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let r=i.names.get(t)||0;e&16?r=r|4:(i.firstLexicalName||(i.firstLexicalName=t),r=r|2),i.names.set(t,r),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(i=this.scopeStack[r],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&643));--r);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e);return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&643)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&707&&!(e&4))return e}}},Ke=class extends me{constructor(...t){super(...t),this.declareFunctions=new Set}},We=class extends ye{createScope(t){return new Ke(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},lr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),g=F`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:a})=>`Cannot overwrite reserved type ${a}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:a,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${a} = true,\` or \`${a} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:a,enumName:t})=>`Enum member names need to be unique, but the name \`${a}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:a})=>`Enum \`${a}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:a,enumName:t})=>`Enum type \`${a}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:a})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${a}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:a,memberName:t,explicitType:e})=>`Enum \`${a}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:a,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${a}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:a,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${a}\`.`,EnumInvalidMemberName:({enumName:a,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${a}\`.`,EnumNumberMemberNotInitialized:({enumName:a,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${a}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:a})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${a}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:a})=>`Unexpected reserved type ${a}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:a,suggestion:t})=>`\`declare export ${a}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function hr(a){return a.type==="DeclareExportAllDeclaration"||a.type==="DeclareExportDeclaration"&&(!a.declaration||a.declaration.type!=="TypeAlias"&&a.declaration.type!=="InterfaceDeclaration")}function ds(a){return a.importKind==="type"||a.importKind==="typeof"}var cr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function pr(a,t){let e=[],s=[];for(let i=0;iclass extends a{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return We}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=ur.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),r=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,g.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),i.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,n=!1;return i.forEach(o=>{hr(o)?(r==="CommonJS"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(g.DuplicateDeclareModuleExports,o),r==="ES"&&this.raise(g.AmbiguousDeclareModuleKind,o),r="CommonJS",n=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:cr[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return this.castNodeTo(s,"DeclareTypeAlias"),s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return this.castNodeTo(s,"DeclareOpaqueType"),s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(g.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){lr.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),r=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=r,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(g.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let r=this.flowParseTypeParameter(i);s.params.push(r),r.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==w.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===w.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:r,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let h,c,u=!1;for(s&&this.match(6)?(this.expect(6),h=9,c=!0):(this.expect(5),h=8,c=!1),l.exact=c;!this.match(h);){let d=!1,y=null,A=null,N=this.startNode();if(r&&this.isContextual(118)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),y=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let I=this.lookahead();I.type!==14&&I.type!==17&&(this.next(),d=!0)}let S=this.flowParseVariance();if(this.eat(0))y!=null&&this.unexpected(y),this.eat(0)?(S&&this.unexpected(S.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(N,d))):l.indexers.push(this.flowParseObjectTypeIndexer(N,d,S));else if(this.match(10)||this.match(47))y!=null&&this.unexpected(y),S&&this.unexpected(S.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(N,d));else{let I="init";if(this.isContextual(99)||this.isContextual(104)){let $=this.lookahead();Es($.type)&&(I=this.state.value,this.next())}let W=this.flowParseObjectTypeProperty(N,d,y,S,I,i,n??!c);W===null?(u=!0,A=this.state.lastTokStartLoc):l.properties.push(W)}this.flowObjectTypeSemicolon(),A&&!this.match(8)&&!this.match(9)&&this.raise(g.UnexpectedExplicitInexactInObject,A)}this.expect(h),i&&(l.inexact=u);let f=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,i,r,n,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(g.InexactInsideExact,this.state.lastTokStartLoc):this.raise(g.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(g.InexactVariance,r),null):(o||this.raise(g.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),r&&this.raise(g.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=n;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e??(e=this.state.startLoc);let i=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let r=this.startNodeAt(e);r.qualification=i,r.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(r,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(M(i.type)){let r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||C(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(C(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||fs(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||fs(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(i),e}this.expect(17);let r=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:l,failed:h}=this.tryParseConditionalConsequent(),[c,u]=this.getArrowLikeExpressions(l);if(h||u.length>0){let f=[...n];if(u.length>0){this.state=r,this.state.noArrowAt=f;for(let d=0;d1&&this.raise(g.AmbiguousConditionalArrow,r.startLoc),h&&c.length===1&&(this.state=r,f.push(c[0].start),this.state.noArrowAt=f,{consequent:l,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],r=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"&&n.body.type!=="BlockStatement"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):r.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return s?(r.forEach(n=>this.finishArrowValidation(n)),[r,[]]):pr(r,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=i,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(g.DeclareClassElement,r):s.value&&this.raise(g.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):ar(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let r=0;r1||!s)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,r,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,r,n,o),s.params&&n){let l=s.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&n&&s.value.params){let l=s.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(g.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(g.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,r,n,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,s,i,r,n,o,l);return h&&((c.value||c).typeParameters=h),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(g.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startsuper.parseMaybeAssign(e,s),r),!n.error)return n.node;let{context:h}=this.state,c=h[h.length-1];(c===w.j_oTag||c===w.j_expr)&&h.pop()}if((i=n)!=null&&i.error||this.match(47)){var o,l;r=r||this.state.clone();let h,c=this.tryParse(f=>{var d;h=this.flowParseTypeParameterDeclaration();let y=this.forwardNoArrowParamsConversionAt(h,()=>{let N=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(N,h),N});(d=y.extra)!=null&&d.parenthesized&&f();let A=this.maybeUnwrapTypeCastExpression(y);return A.type!=="ArrowFunctionExpression"&&f(),A.typeParameters=h,this.resetStartLocationFromNode(A,h),y},r),u=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(g.UnexpectedTypeParameterBeforeAsyncArrowFunction,h),c.node;u=c.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(u)return this.state=c.failState,u;throw(l=n)!=null&&l.thrown?n.error:c.thrown?c.error:this.raise(g.UnexpectedTokenAfterTypeParameter,h)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,r=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let n=0;n0&&this.raise(g.ThisParamMustBeFirst,e.params[n]);super.checkParams(e,s,i,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let r=this.state.clone(),n=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(s)||l(),r);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),r);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,i)return r.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(g.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(g.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return i===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(g.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?g.EnumInvalidMemberInitializerSymbolType:g.EnumInvalidMemberInitializerPrimaryType:g.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(g.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(g.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:r}=s;r!==null&&r!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:l,init:h}=this.flowEnumMemberRaw(),c=l.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(g.EnumInvalidMemberName,l,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),i.has(c)&&this.raise(g.EnumDuplicateMemberName,l,{memberName:c,enumName:e}),i.add(c);let u={enumName:e,explicitType:s,memberName:c};switch(o.id=l,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"boolean"),o.init=h.value,r.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"number"),o.init=h.value,r.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,u,"string"),o.init=h.value,r.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,u);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,u);break;default:r.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return s}else{for(let r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!C(this.state.type))throw this.raise(g.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(g.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,r=s.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=l,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,u=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!c&&!u&&!f&&!d)return h();if(!c&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!f&&c>=d){for(let y of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(y.loc.start,{enumName:i,memberName:y.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!f&&u>=d){for(let y of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(y.loc.start,{enumName:i,memberName:y.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(g.EnumInconsistentMemberValues,r,{enumName:i}),h()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},dr=/\r\n|[\r\n\u2028\u2029]/,be=new RegExp(dr.source,"g");function ee(a){switch(a){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function ms(a,t,e){for(let s=t;s`Expected corresponding JSX closing tag for <${a}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:a,HTMLEntity:t})=>`Unexpected token \`${a}\`. Did you mean \`${t}\` or \`{'${a}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function q(a){return a?a.type==="JSXOpeningFragment"||a.type==="JSXClosingFragment":!1}function Q(a){if(a.type==="JSXIdentifier")return a.name;if(a.type==="JSXNamespacedName")return a.namespace.name+":"+a.name.name;if(a.type==="JSXMemberExpression")return Q(a.object)+"."+Q(a.property);throw new Error("Node had unexpected type: "+a.type)}var yr=a=>class extends a{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(J.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:ee(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?` +`:`\r +`):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):ee(r)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos1){for(let i=0;i0){if(s&256){let r=!!(s&512),n=(i&4)>0;return r!==n}return!0}return s&128&&(i&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(e);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(t)}},Ge=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function Ce(a,t){return(a?2:0)|(t?1:0)}var Ye=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let i=this.plugins.get(e);for(let r of Object.keys(s))if((i==null?void 0:i[r])!==s[r])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function Ls(a,t){a.trailingComments===void 0?a.trailingComments=t:a.trailingComments.unshift(...t)}function xr(a,t){a.leadingComments===void 0?a.leadingComments=t:a.leadingComments.unshift(...t)}function xe(a,t){a.innerComments===void 0?a.innerComments=t:a.innerComments.unshift(...t)}function z(a,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?xe(a,e.comments):Ls(s,e.comments)}var Qe=class extends Ye{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,r=e[i];r.start===t.end&&(r.leadingNode=t,i--);let{start:n}=t;for(;i>=0;i--){let o=e[i],l=o.end;if(l>n)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{l===n&&(o.trailingNode=t);break}}}finalizeComment(t){var e;let{comments:s}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Ls(t.leadingNode,s),t.trailingNode!==null&&xr(t.trailingNode,s);else{let{containingNode:i,start:r}=t;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":z(i,i.properties,t);break;case"CallExpression":case"OptionalCallExpression":z(i,i.arguments,t);break;case"ImportExpression":z(i,[i.source,(e=i.options)!=null?e:null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":z(i,i.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":z(i,i.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":z(i,i.specifiers,t);break;case"TSEnumDeclaration":z(i,i.members,t);break;case"TSEnumBody":z(i,i.members,t);break;default:xe(i,s)}else xe(i,s)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let i=e[s-1];i.leadingNode===t&&(i.leadingNode=null)}takeSurroundingComments(t,e,s){let{commentStack:i}=this.state,r=i.length;if(r===0)return;let n=r-1;for(;n>=0;n--){let o=i[n],l=o.end;if(o.start===s)o.leadingNode=t;else if(l===e)o.trailingNode=t;else if(l0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:s,startLine:i,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=s,this.curLine=i,this.lineStart=-r,this.startLoc=this.endLoc=new B(i,r,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new B(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new a;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},Pr=function(t){return t>=48&&t<=57},ys={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ae={bin:a=>a===48||a===49,oct:a=>a>=48&&a<=55,dec:a=>a>=48&&a<=57,hex:a=>a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102};function xs(a,t,e,s,i,r){let n=e,o=s,l=i,h="",c=null,u=e,{length:f}=t;for(;;){if(e>=f){r.unterminated(n,o,l),h+=t.slice(u,e);break}let d=t.charCodeAt(e);if(gr(a,d,t,e)){h+=t.slice(u,e);break}if(d===92){h+=t.slice(u,e);let y=Tr(t,e,s,i,a==="template",r);y.ch===null&&!c?c={pos:e,lineStart:s,curLine:i}:h+=y.ch,{pos:e,lineStart:s,curLine:i}=y,u=e}else d===8232||d===8233?(++e,++i,s=e):d===10||d===13?a==="template"?(h+=t.slice(u,e)+` +`,++e,d===13&&t.charCodeAt(e)===10&&++e,++i,u=s=e):r.unterminated(n,o,l):++e}return{pos:e,str:h,firstInvalidLoc:c,lineStart:s,curLine:i,containsInvalid:!!c}}function gr(a,t,e,s){return a==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(a==="double"?34:39)}function Tr(a,t,e,s,i,r){let n=!i;t++;let o=h=>({pos:t,ch:h,lineStart:e,curLine:s}),l=a.charCodeAt(t++);switch(l){case 110:return o(` +`);case 114:return o("\r");case 120:{let h;return{code:h,pos:t}=et(a,t,e,s,2,!1,n,r),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:t}=Ms(a,t,e,s,n,r),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:a.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);r.strictNumericEscape(t-1,e,s);default:if(l>=48&&l<=55){let h=t-1,u=/^[0-7]+/.exec(a.slice(h,t+2))[0],f=parseInt(u,8);f>255&&(u=u.slice(0,-1),f=parseInt(u,8)),t+=u.length-1;let d=a.charCodeAt(t);if(u!=="0"||d===56||d===57){if(i)return o(null);r.strictNumericEscape(h,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(l))}}function et(a,t,e,s,i,r,n,o){let l=t,h;return{n:h,pos:t}=Ds(a,t,e,s,16,i,r,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(l,e,s):t=l-1),{code:h,pos:t}}function Ds(a,t,e,s,i,r,n,o,l,h){let c=t,u=i===16?ys.hex:ys.decBinOct,f=i===16?Ae.hex:i===10?Ae.dec:i===8?Ae.oct:Ae.bin,d=!1,y=0;for(let A=0,N=r??1/0;A=97?I=S-97+10:S>=65?I=S-65+10:Pr(S)?I=S-48:I=1/0,I>=i){if(I<=9&&h)return{n:null,pos:t};if(I<=9&&l.invalidDigit(t,e,s,i))I=0;else if(n)I=0,d=!0;else break}++t,y=y*i+I}return t===c||r!=null&&t-c!==r||d?{n:null,pos:t}:{n:y,pos:t}}function Ms(a,t,e,s,i,r){let n=a.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=et(a,t,e,s,a.indexOf("}",t)-t,!0,i,r),++t,o!==null&&o>1114111)if(i)r.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=et(a,t,e,s,4,!1,i,r));return{code:o,pos:t}}function pe(a,t,e){return new B(e,a-t,a)}var br=new Set([103,109,115,105,121,117,100,118]),O=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new se(t.startLoc,t.endLoc)}},tt=class extends Qe{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,r,n)=>this.optionFlags&2048?(this.raise(p.InvalidDigit,pe(s,i,r),{radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,r)=>{this.recordStrictModeErrors(p.StrictNumericEscape,pe(s,i,r))},unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedString,pe(s-1,i,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(s,i,r)=>{throw this.raise(p.UnterminatedTemplate,pe(s,i,r))}}),this.state=new Ze,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new O(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return $e.lastIndex=t,$e.test(this.input)?$e.lastIndex:t}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(t){return this.input.charCodeAt(this.nextTokenStartSince(t))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Ve.lastIndex=t,Ve.test(this.input)?Ve.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+t.length,be.lastIndex=s+2;be.test(this.input)&&be.lastIndex<=i;)++this.state.curLine,this.state.lineStart=be.lastIndex;if(this.isLookahead)return;let r={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+t.length),loc:new se(e,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(r),r}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),e==null||e.push(r))}else break e}else break e}}if((e==null?void 0:e.length)>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?p.RecordExpressionHashIncorrectStartSyntaxType:p.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else U(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!ee(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(U(t)){this.readWord(t);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,i,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(p.UnterminatedRegExp,D(t,1));let h=this.input.charCodeAt(r);if(ee(h))throw this.raise(p.UnterminatedRegExp,D(t,1));if(s)s=!1;else{if(h===91)i=!0;else if(h===93&&i)i=!1;else if(h===47&&!i)break;s=h===92}}let n=this.input.slice(e,r);++r;let o="",l=()=>D(t,r+2-e);for(;r=2&&this.input.charCodeAt(e)===48;if(l){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,s),!this.state.strict){let y=d.indexOf("_");y>0&&this.raise(p.ZeroDigitNumericSeparator,D(s,y))}o=l&&!/[89]/.test(d)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,h=this.input.charCodeAt(this.state.pos)),(h===69||h===101)&&!o&&(h=this.input.charCodeAt(++this.state.pos),(h===43||h===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(p.InvalidOrMissingExponent,s),i=!0,n=!0,h=this.input.charCodeAt(this.state.pos)),h===110&&((i||l)&&this.raise(p.InvalidBigIntLiteral,s),++this.state.pos,r=!0),h===109){this.expectPlugin("decimal",this.state.curPosition()),(n||l)&&this.raise(p.InvalidDecimal,s),++this.state.pos;var c=!0}if(U(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(136,u);return}if(c){this.finishToken(137,u);return}let f=o?parseInt(u,8):parseFloat(u);this.finishToken(135,f)}readCodePoint(t){let{code:e,pos:s}=Ms(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:i,lineStart:r}=xs(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:i,curLine:r,lineStart:n}=xs("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new B(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){let l=n[o];if(l.loc.index===r)return n[o]=t(i,s);if(l.loc.indexthis.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,pe(e,s,i))}}},st=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},it=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new st)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(p.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:r,undefinedPrivateNames:n}=this.current(),o=i.has(t);if(e&3){let l=o&&r.get(t);if(l){let h=l&4,c=e&4,u=l&3,f=e&3;o=u===f||h!==c,o||r.delete(t)}else o||r.set(t,e)}o&&this.parser.raise(p.PrivateNameRedeclaration,s,{identifierName:t}),i.add(t),n.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(p.InvalidPrivateFieldResolution,e,{identifierName:t})}},ie=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ne=class extends ie{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},rt=class{constructor(t){this.parser=void 0,this.stack=[new ie],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:i}=this,r=i.length-1,n=i[r];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=i[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,i=s[s.length-1],r=e.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(t,r);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,r);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(p.AwaitBindingIdentifier,t),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,i);let r=t.length-2,n=t[r];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=t[--r]})}};function Ar(){return new ie(3)}function Sr(){return new Ne(1)}function Er(){return new Ne(2)}function Os(){return new ie}var at=class extends tt{addExtra(t,e,s,i=!0){if(!t)return;let{extra:r}=t;r==null&&(r={},t.extra=r),i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let i=this.input.charCodeAt(s);return!(Z(i)||(i&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ms(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return ms(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let i=t((r=null)=>{throw s.node=r,s});if(this.state.errors.length>e.errors.length){let r=this.state;return this.state=e,this.state.tokensLength=r.tokensLength,{node:i,error:r.errors[e.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let r=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:r};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:r,optionalParametersLoc:n}=t,o=!!s||!!i||!!n||!!r;if(!e)return o;s!=null&&this.raise(p.InvalidCoverInitializedName,s),i!=null&&this.raise(p.DuplicateProto,i),r!=null&&this.raise(p.UnexpectedPrivateField,r),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Es(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=t;let r=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new Ge;let l=this.classScope;this.classScope=new it(this);let h=this.expressionScope;return this.expressionScope=new rt(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=r,this.prodParam=o,this.classScope=l,this.expressionScope=h}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.optionFlags&32&&(t|=1),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},te=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},re=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new se(s),(t==null?void 0:t.optionFlags)&128&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},nt=re.prototype;nt.__clone=function(){let a=new re(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;ea.type==="ParenthesizedExpression"?Fs(a.expression):a,lt=class extends ot{toAssignable(t,e=!1){var s,i;let r;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(r=Fs(t),e?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let o=0,l=t.properties.length,h=l-1;oi.type!=="ObjectMethod"&&(r===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let i=s&1,r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),i&&this.match(12))r.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];if(s&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseBindingElement(s,o))}}return r}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseBindingElement(t,e){let s=this.parseMaybeDefault();return(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s),e.length&&(s.decorators=e,this.resetStartLocationFromNode(s,e[0])),this.parseMaybeDefault(s.loc.start,s)}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){if(t??(t=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(29))return e;let s=this.startNodeAt(t);return s.left=e,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,i=!1,r=!1,n=!1){var o;let l=t.type;if(this.isObjectMethod(t))return;let h=this.isOptionalMemberExpression(t);if(h||l==="MemberExpression"){h&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(l==="Identifier"){this.checkIdentifier(t,s,r);let{name:A}=t;i&&(i.has(A)?this.raise(p.ParamDupe,t):i.add(A));return}let c=this.isValidLVal(l,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(c===!0)return;if(c===!1){let A=s===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(A,t,{ancestor:e});return}let u,f;typeof c=="string"?(u=c,f=l==="ParenthesizedExpression"):[u,f]=c;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,y=t[u];if(Array.isArray(y))for(let A of y)A&&this.checkLVal(A,d,s,i,r,f);else y&&this.checkLVal(y,d,s,i,r,f)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?vs(t.name,this.inModule):ks(t.name))&&(e===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}};function Cr(a){if(a==null)throw new Error(`Unexpected ${a} value.`);return a}function Ps(a){if(!a)throw new Error("Assert fail")}var x=F`typescript`({AbstractMethodHasImplementation:({methodName:a})=>`Method '${a}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:a})=>`Property '${a}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:a})=>`'declare' is not allowed in ${a}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:a})=>`Accessibility modifier already seen: '${a}'.`,DuplicateModifier:({modifier:a})=>`Duplicate modifier: '${a}'.`,EmptyHeritageClauseType:({token:a})=>`'${a}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:a})=>`'${a[0]}' modifier cannot be used with '${a[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:a})=>`Index signatures cannot have an accessibility modifier ('${a}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:a})=>`'${a}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:a=>`'${a}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:a})=>`'${a}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:a})=>`'${a}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:a})=>`'${a}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:a=>`'${a}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:a})=>`'${a[0]}' modifier must precede '${a[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:a})=>`Private elements cannot have an accessibility modifier ('${a}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:a})=>`Single type parameter ${a} should have a trailing comma. Example usage: <${a},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:a})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${a}.`});function wr(a){switch(a){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function gs(a){return a==="private"||a==="public"||a==="protected"}function Ir(a){return a==="in"||a==="out"}var Nr=a=>class extends a{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:x.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter})}getScopeHandler(){return Xe}tsIsIdentifier(){return C(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s,i){if(!C(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(i&&this.match(106)||s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:r=x.InvalidModifierOnTypeMember},n){let o=(h,c,u,f)=>{c===u&&n[f]&&this.raise(x.InvalidModifiersOrder,h,{orderedModifiers:[u,f]})},l=(h,c,u,f)=>{(n[u]&&c===f||n[f]&&c===u)&&this.raise(x.IncompatibleModifiers,h,{modifiers:[u,f]})};for(;;){let{startLoc:h}=this.state,c=this.tsParseModifier(e.concat(s??[]),i,n.static);if(!c)break;gs(c)?n.accessibility?this.raise(x.DuplicateAccessibilityModifier,h,{modifier:c}):(o(h,c,c,"override"),o(h,c,c,"static"),o(h,c,c,"readonly"),n.accessibility=c):Ir(c)?(n[c]&&this.raise(x.DuplicateModifier,h,{modifier:c}),n[c]=!0,o(h,c,"in","out")):(hasOwnProperty.call(n,c)?this.raise(x.DuplicateModifier,h,{modifier:c}):(o(h,c,"static","readonly"),o(h,c,"static","override"),o(h,c,"override","readonly"),o(h,c,"abstract","override"),l(h,c,"declare","override"),l(h,c,"static","abstract")),n[c]=!0),s!=null&&s.includes(c)&&this.raise(r,h,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return Cr(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,r){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=s();if(l==null)return;if(n.push(l),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return r&&(r.value=o),n}tsParseBracketedList(e,s,i,r,n){r||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(x.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let s=this.startNode();return this.isContextual(76)?(s.method=!1,s.key=this.parseIdentifier(!0),s.computed=!1,s.shorthand=!1):this.unexpected(null,76),this.expect(14),s.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(s)],this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),s=[];for(this.expect(5);!this.match(8);){let i=this.state.type;C(i)||i===134?s.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=s,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(x.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,r="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(x.UnsupportedSignatureParameterKind,s,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),C(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){s&&this.raise(x.ReadonlyForMethodSignature,e);let i=e;i.kind&&this.match(47)&&this.raise(x.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let r="parameters",n="typeAnnotation";if(i.kind==="get")i[r].length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(i[r][0])&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[r].length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let o=i[r][0];this.isThisParam(o)&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(x.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(x.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(x.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=e;s&&(i.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(i.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(i=>{let{type:r}=i;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&i.optional)&&this.raise(x.OptionalTypeBeforeRequired,i),s||(s=r==="TSNamedTupleMember"&&i.optional||r==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,r,n,o,l,c=M(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),l=this.tsParseType();else if(c===63){o=!0;let u=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(i),u),this.expect(17),this.expect(14),l=this.tsParseType()):(r=!1,l=f,this.expect(17))}else l=this.tsParseType(),o=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAt(i),u.optional=o,u.label=n,u.elementType=l,this.eat(17)&&(u.optional=!0,this.raise(x.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAt(i),u.optional=o,this.raise(x.InvalidTupleMemberLabel,l),u.label=l,u.elementType=this.tsParseType()),l=this.finishNode(u,"TSNamedTupleMember")}else if(o){let u=this.startNodeAt(i);u.typeAnnotation=l,l=this.finishNode(u,"TSOptionalType")}if(s){let u=this.startNodeAt(e);u.typeAnnotation=l,l=this.finishNode(u,"TSRestType")}return l}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(C(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":wr(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(x.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return Xi(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let r=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(r.types=o,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(C(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let i=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(i.parameterName=l,i.asserts=!0,i.typeAnnotation=null,l=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(l,i),l.asserts=!0),s.typeAnnotation=l,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return r?(i.parameterName=this.parseIdentifier(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!C(this.state.type)&&!this.match(78)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Ps(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{{let r=this.startNode();return r.expression=this.tsParseEntityName(3),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")}});return i.length||this.raise(x.EmptyHeritageClauseType,s,{token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),C(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(x.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==w.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(512),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(512),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(x.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type;return this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.hasPlugin("explicitResourceManagement")&&this.isUsing())return this.raise(x.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.hasPlugin("explicitResourceManagement")&&this.isAwaitUsing())return this.raise(x.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(C(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,i){switch(s.name){case"declare":{let r=this.tsTryParseDeclare(e);return r&&(r.declare=!0),r}case"global":if(this.match(5)){this.scope.enter(512),this.prodParam.enter(0);let r=e;return r.kind="global",e.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,i)}}tsParseDeclaration(e,s,i,r){switch(s){case"abstract":if(this.tsCheckLineTerminator(i)&&(this.match(80)||C(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case"module":if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(C(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(i)&&C(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(i)&&C(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(x.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===w.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Gi(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,s){let i=s.length?s[0].loc.start:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);let n=r.accessibility,o=r.override,l=r.readonly;!(e&4)&&(n||l||o)&&this.raise(x.UnexpectedParameterModifier,i);let h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);let c=this.parseMaybeDefault(h.loc.start,h);if(n||l||o){let u=this.startNodeAt(i);return s.length&&(u.decorators=s),n&&(u.accessibility=n),l&&(u.readonly=l),o&&(u.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(x.UnsupportedParameterPropertyKind,u),u.parameter=c,this.finishNode(u,"TSParameterProperty")}return s.length&&(h.decorators=s),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(x.PatternIsOptional,s)}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(x.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,r,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(x.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i,r){let n=super.parseArrayLike(e,s,i,r);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return r.stop=!0,e;r.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(Ie(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,r);return f.typeParameters=h,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=h,r.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,r.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&ue(c)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(s);return u.expression=e,u.typeParameters=h,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(x.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(l.expression=super.stopParseSubscript(e,r))),l}return super.parseSubscript(e,s,i,r)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let r;if(Ee(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,r){this.state.isAmbientContext||super.checkReservedWord(e,s,i,r)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(x.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,r){super.applyImportPhase(e,s,i,r),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(C(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(x.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let i=e;this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,r,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:r}=this.state,n=super.parseVarStatement(e,s,i||r);if(!r)return n;for(let{id:o,init:l}of n.declarations)l&&(s==="var"||s==="let"||o.typeAnnotation?this.raise(x.InitializerNotAllowedInAmbientContext,l):vr(l,this.hasPlugin("estree"))||this.raise(x.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>gs(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:x.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(x.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,i,r){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(x.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(x.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(x.IndexSignatureHasDeclare,s),s.override&&this.raise(x.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(x.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(x.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,i,r)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(x.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(x.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,i){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,i):void 0)||super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let r=this.lookaheadCharCode();if(r===44||r===61||r===58||r===41)return this.setOptionalParametersError(i),e}return super.parseConditional(e,s,i)}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(x.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let n=C(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&n.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,i,r){if((!s||i)&&this.isContextual(113))return;super.parseClassId(e,s,i,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(x.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(x.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(x.PrivateElementHasAbstract,e),e.accessibility&&this.raise(x.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(x.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,r,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&n&&this.raise(x.ConstructorHasTypeParameters,l);let{declare:h=!1,kind:c}=s;h&&(c==="get"||c==="set")&&this.raise(x.DeclareAccessor,s,{kind:c}),l&&(s.typeParameters=l),super.pushClassMethod(e,s,i,r,n,o)}pushClassPrivateMethod(e,s,i,r){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,i,r)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,r,n,o,l){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,i,r,n,o,l)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,r,n,o,l;let h,c,u;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(h=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!c.error)return c.node;let{context:y}=this.state,A=y[y.length-1];(A===w.j_oTag||A===w.j_expr)&&y.pop()}if(!((i=c)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let f,d=this.tryParse(y=>{var A,N;f=this.tsParseTypeParameters(this.tsParseConstModifier);let S=super.parseMaybeAssign(e,s);return(S.type!=="ArrowFunctionExpression"||(A=S.extra)!=null&&A.parenthesized)&&y(),((N=f)==null?void 0:N.params.length)!==0&&this.resetStartLocationFromNode(S,f),S.typeParameters=f,S},h);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!c&&(Ps(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!u.error))return u.node;if((r=c)!=null&&r.node)return this.state=c.failState,c.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;throw((o=c)==null?void 0:o.error)||d.error||((l=u)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(i=>{let r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(x.UnexpectedTypeCastInParameter,e):this.raise(x.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,i){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,i)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e,s);return r.typeParameters=i,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(e,s,i){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(x.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,i,r,n,o,l){let h=super.parseMethod(e,s,i,r,n,o,l);if((h.abstract||h.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?h.value:h).body){let{key:f}=h;this.raise(x.AbstractMethodHasImplementation,h,{methodName:f.type==="Identifier"&&!h.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,i,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,r))}parseImportSpecifier(e,s,i,r,n){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,r,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,i){let r=s?"imported":"local",n=s?"local":"exported",o=e[r],l,h=!1,c=!0,u=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let y=this.parseIdentifier();M(this.state.type)?(h=!0,o=d,l=s?this.parseIdentifier():this.parseModuleExportName(),c=!1):(l=y,c=!1)}else M(this.state.type)?(c=!1,l=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=d)}else M(this.state.type)&&(h=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&i&&this.raise(s?x.TypeModifierIsUsedInTypeImports:x.TypeModifierIsUsedInTypeExports,u),e[r]=o,e[n]=l;let f=s?"importKind":"exportKind";e[f]=h?"type":"value",c&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=this.cloneIdentifier(e[r])),s&&this.checkIdentifier(e[n],h?4098:4096)}fillOptionalPropertiesForTSESLint(e){var s,i,r,n,o,l,h,c,u,f,d,y,A,N,S,I,W,$,Ot,Ft,Bt,Rt,_t,Ut,jt,$t,Vt,qt,zt,Ht,Kt,Wt,Jt,Xt,Gt,Yt,Qt,Zt,es,ts,ss,is,rs,as,ns,os;switch(e.type){case"ExpressionStatement":(s=e.directive)!=null||(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(i=e.decorators)!=null||(e.decorators=[]),(r=e.optional)!=null||(e.optional=!1),(n=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);return;case"TSParameterProperty":(o=e.accessibility)!=null||(e.accessibility=void 0),(l=e.decorators)!=null||(e.decorators=[]),(h=e.override)!=null||(e.override=!1),(c=e.readonly)!=null||(e.readonly=!1),(u=e.static)!=null||(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(f=e.declare)!=null||(e.declare=!1),(d=e.returnType)!=null||(e.returnType=void 0),(y=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"Property":(A=e.optional)!=null||(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(N=e.optional)!=null||(e.optional=!1);case"TSIndexSignature":(S=e.accessibility)!=null||(e.accessibility=void 0),(I=e.readonly)!=null||(e.readonly=!1),(W=e.static)!=null||(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":($=e.declare)!=null||(e.declare=!1),(Ot=e.definite)!=null||(e.definite=!1),(Ft=e.readonly)!=null||(e.readonly=!1),(Bt=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(Rt=e.accessibility)!=null||(e.accessibility=void 0),(_t=e.decorators)!=null||(e.decorators=[]),(Ut=e.override)!=null||(e.override=!1),(jt=e.optional)!=null||(e.optional=!1);return;case"ClassExpression":($t=e.id)!=null||(e.id=null);case"ClassDeclaration":(Vt=e.abstract)!=null||(e.abstract=!1),(qt=e.declare)!=null||(e.declare=!1),(zt=e.decorators)!=null||(e.decorators=[]),(Ht=e.implements)!=null||(e.implements=[]),(Kt=e.superTypeArguments)!=null||(e.superTypeArguments=void 0),(Wt=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(Jt=e.declare)!=null||(e.declare=!1);return;case"VariableDeclarator":(Xt=e.definite)!=null||(e.definite=!1);return;case"TSEnumDeclaration":(Gt=e.const)!=null||(e.const=!1),(Yt=e.declare)!=null||(e.declare=!1);return;case"TSEnumMember":(Qt=e.computed)!=null||(e.computed=!1);return;case"TSImportType":(Zt=e.qualifier)!=null||(e.qualifier=null),(es=e.options)!=null||(e.options=null);return;case"TSInterfaceDeclaration":(ts=e.declare)!=null||(e.declare=!1),(ss=e.extends)!=null||(e.extends=[]);return;case"TSModuleDeclaration":(is=e.declare)!=null||(e.declare=!1),(rs=e.global)!=null||(e.global=e.kind==="global");return;case"TSTypeParameter":(as=e.const)!=null||(e.const=!1),(ns=e.in)!=null||(e.in=!1),(os=e.out)!=null||(e.out=!1);return}}};function kr(a){if(a.type!=="MemberExpression")return!1;let{computed:t,property:e}=a;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Rs(a.object)}function vr(a,t){var e;let{type:s}=a;if((e=a.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=a;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(Bs(a,t)||Lr(a,t)||s==="TemplateLiteral"&&a.expressions.length===0||kr(a))}function Bs(a,t){return t?a.type==="Literal"&&(typeof a.value=="number"||"bigint"in a):a.type==="NumericLiteral"||a.type==="BigIntLiteral"}function Lr(a,t){if(a.type==="UnaryExpression"){let{operator:e,argument:s}=a;if(e==="-"&&Bs(s,t))return!0}return!1}function Rs(a){return a.type==="Identifier"?!0:a.type!=="MemberExpression"||a.computed?!1:Rs(a.object)}var Ts=F`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Dr=a=>class extends a{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=e;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,i,r){e!==void 0&&super.checkReservedWord(e,s,i,r)}cloneIdentifier(e){let s=super.cloneIdentifier(e);return s.type==="Placeholder"&&(s.expectedNode=e.expectedNode),s}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i){return e==="Placeholder"||super.isValidLVal(e,s,i)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===133)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let n=e;return n.label=this.finishPlaceholder(s,"Identifier"),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,"LabeledStatement")}this.semicolon();let r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let r=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,r);throw this.raise(Ts.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,r)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);let r=e;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let n=this.startNode();return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(H(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Ts.UnexpectedSpace,this.state.lastTokEndLoc)}},Mr=a=>class extends a{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),C(this.state.type)){let i=this.parseIdentifierName(),r=this.createIdentifier(s,i);if(this.castNodeTo(r,"V8IntrinsicIdentifier"),this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},bs=["minimal","fsharp","hack","smart"],As=["^^","@@","^","%","#"];function Or(a){if(a.has("decorators")){if(a.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=a.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let i=a.get("decorators").allowCallParenthesized;if(i!=null&&typeof i!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(a.has("flow")&&a.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(a.has("placeholders")&&a.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(a.has("pipelineOperator")){var t;let s=a.get("pipelineOperator").proposal;if(!bs.includes(s)){let i=bs.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}if(s==="hack"){if(a.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(a.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=a.get("pipelineOperator").topicToken;if(!As.includes(i)){let r=As.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}{var e;if(i==="#"&&((e=a.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}}else if(s==="smart"&&((t=a.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",a.get("recordAndTuple")])}\`.`)}if(a.has("moduleAttributes")){if(a.has("deprecatedImportAssert")||a.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(a.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(a.has("importAssertions")&&a.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!a.has("deprecatedImportAssert")&&a.has("importAttributes")&&a.get("importAttributes").deprecatedAssertSyntax&&a.set("deprecatedImportAssert",{}),a.has("recordAndTuple")){let s=a.get("recordAndTuple").syntaxType;if(s!=null){let i=["hash","bar"];if(!i.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+i.map(r=>`'${r}'`).join(", "))}}if(a.has("asyncDoExpressions")&&!a.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(a.has("optionalChainingAssign")&&a.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var _s={estree:Ui,jsx:yr,flow:fr,typescript:Nr,v8intrinsic:Mr,placeholders:Dr},Fr=Object.keys(_s),ht=class extends lt{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return s;let r=t.key;return(r.type==="Identifier"?r.name:r.value)==="__proto__"?e?(this.raise(p.RecordNoProto,r),!0):(s&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=r.loc.start):this.raise(p.DuplicateProto,r)),!0):s}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(p.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(140))throw this.raise(p.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&256&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let l=this.parseYield(s);return e&&(l=e.call(this,l,s)),l}let r;t?r=!1:(t=new te,r=!0);let{type:n}=this.state;(n===10||C(n))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(t);if(e&&(o=e.call(this,o,s)),zi(this.state.type)){let l=this.startNodeAt(s),h=this.state.value;if(l.operator=h,this.match(29)){this.toAssignable(o,!0),l.left=o;let c=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=c&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=c&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else l.left=o;return this.next(),l.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(l,"AssignmentExpression")),l}else r&&this.checkExpressionErrors(t,!0);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?ue(l):ue(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.YieldNotInGeneratorFunction,s),this.parseYield(s)}return o}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let r=this.getPrivateNameSV(t);(s>=Ee(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(p.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t.loc.start)}let i=this.state.type;if(Ki(i)&&(this.prodParam.hasIn||!this.match(58))){let r=Ee(i);if(r>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=i===41||i===42,l=i===40;if(l&&(r=Ee(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(p.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);n.right=this.parseExprOpRightExpr(i,r);let h=this.finishNode(n,o||l?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(l&&(c===41||c===42)||o&&c===40)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(p.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,Yi(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Di.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(p.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(s);return e||this.checkExponentialAfterUnary(l),l}let r=this.match(34),n=this.startNode();if(Ji(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&l){let h=n.argument;h.type==="Identifier"?this.raise(p.StrictDelete,n):this.hasPropertyAsPrivateName(h)&&this.raise(p.DeletePrivateField,n)}if(!r)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,r,t);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?ue(l):ue(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),t}let i=this.state.startLoc,r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;Wi(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(n,"UpdateExpression"))}return r}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:r}=this.state;if(!s&&r===15)return this.parseBind(t,e,s,i);if(Ie(r))return this.parseTaggedTemplateExpression(t,e,i);let n=!1;if(r===18){if(s&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,i);i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,i,o,n):this.stopParseSubscript(t,i)}}stopParseSubscript(t,e){return e.stop=!0,t}parseMember(t,e,s,i,r){let n=this.startNodeAt(e);return n.object=t,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(p.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=r,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,i){let r=this.startNodeAt(e);return r.object=t,this.next(),r.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let r=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:l,optionalChainMember:h}=s;l&&(this.expressionScope.enter(Er()),n=new te),h&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",o,n);let c=this.finishCallExpression(o,h);return l&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(l&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=r,c}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(p.OptionalChainingNoTemplate,e),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,i){let r=[],n=!0,o=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,i,e))}return this.state.inFSharpPipelineDirectBody=o,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&xe(t,e.innerComments),e.callee.trailingComments&&xe(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(e):this.match(10)?this.optionFlags&512?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 0:return this.parseArrayLike(3,!0,!1,t);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let r=e.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(p.UnsupportedBind,r)}case 139:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);this.unexpected();break}case 47:{let r=this.input.codePointAt(this.nextTokenStart());U(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:{if(i===137)return this.parseDecimalLiteral(this.state.value);if(i===2||i===1)return this.parseArrayLike(this.state.type===2?4:3,!1,!0);if(i===6||i===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0)}if(C(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let r=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(C(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=D(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(p.PipeTopicUnconfiguredToken,e,{token:H(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:H(s)}]);case"smart":return s===27;default:throw this.raise(p.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Ce(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16)?this.raise(p.SuperNotAllowed,t):!this.scope.allowSuper&&!(this.optionFlags&16)&&this.raise(p.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(p.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(D(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(p.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(105)||this.isContextual(97)){let e=this.isContextual(105);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(p.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Sr());let i=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],l=new te,h=!0,c,u;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let y=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),y)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=r;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),c&&this.unexpected(c),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&1024))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!(this.optionFlags&4)&&this.raise(p.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(p.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:r}=this.state,n=e+1,o=this.startNodeAt(D(s,1));r===null&&(t||this.raise(p.InvalidEscapeSequenceTemplate,D(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),h=l?-1:-2,c=i+h;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,` +`),cooked:r===null?null:r.slice(1,h)},o.tail=l,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,D(this.state.lastTokEndLoc,h)),u}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),i=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(t));return e.expressions=r,e.quasis=i,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(l);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(i),n=this.checkProto(c,s,n,i)),s&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(p.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),l.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=r;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(l,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,r=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let l=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!l&&this.maybeAsyncOrAccessorProp(s)){let{key:h}=s,c=h.name;c==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(s)),(c==="get"||c==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(h),s.kind=c,this.match(55)&&(o=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,r,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(p.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,i,r){if(r){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key));else if(this.match(29)){let r=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=r):this.raise(p.InvalidCoverInitializedName,r),t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,e,s,i,r,n,o){let l=this.parseObjectMethod(t,s,i,r,n)||this.parseObjectProperty(t,e,r,o);return l||this.unexpected(),l}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,r;if(M(s))r=this.parseIdentifier(!0);else switch(s){case 135:r=this.parseNumericLiteral(i);break;case 134:r=this.parseStringLiteral(i);break;case 136:r=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(p.UnexpectedPrivateField,n),r=this.parsePrivateName();break}default:if(s===137){r=this.parseDecimalLiteral(i);break}this.unexpected()}t.key=r,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,r,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(r?32:0)),this.prodParam.enter(Ce(s,t.generator)),this.parseFunctionParams(t,i);let l=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,i,n),this.state.inFSharpPipelineDirectBody=r,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(6);let r=Ce(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let i=e&&!this.match(5);if(this.expressionScope.enter(Os()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let r=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(t.params);o&&l&&this.raise(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let h=!r&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!l,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,h)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!or(t))return;if(s&&rr(t)){this.raise(p.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?i?vs:Ns:Is)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(p.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Ie(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(t){let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(p.YieldInParameter,e);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return e.delegate=s,e.argument=i,this.finishNode(e,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(t.source);else if(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(t.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(p.ImportCallArity,t)}}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(p.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(p.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},qe={kind:1},Br={kind:2},Rr=/[\uD800-\uDFFF]/u,ze=/in(?:stanceof)?/y;function _r(a,t,e){for(let s=0;s0)for(let[r,n]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,n,{localName:r});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return e===140?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",D(this.state.startLoc,-1)),i}stmtToDirective(t){let e=this.castNodeTo(t,"Directive"),s=this.castNodeTo(t.expression,"DirectiveLiteral"),i=s.value,r=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),n=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),e.value=s,delete t.expression,e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}isAwaitUsing(){if(!this.isContextual(96))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}chStartsBindingIdentifier(t,e){if(U(t)){if(ze.lastIndex=e,ze.test(this.input)){let s=this.codePointAtPos(ze.lastIndex);if(!Z(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}allowsForUsing(){let{type:t,containsEsc:e,end:s}=this.lookahead();if(t===102&&!e){let i=this.lookaheadCharCodeSince(s);if(i!==61&&i!==58&&i!==59)return!1}return C(t)&&!this.hasFollowingLineBreak()?(this.expectPlugin("explicitResourceManagement"),!0):!1}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,i=this.startNode(),r=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!r&&n);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing())return this.allowsUsing()?r?this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,i):this.raise(p.UnexpectedLexicalDeclaration,i):this.raise(p.UnexpectedUsingDeclaration,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),this.allowsUsing()?r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),u=this.codePointAtPos(c);if(u!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,c)&&u!==123))break}case 75:r||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let c;return s===83?c=this.parseImport(i):c=this.parseExport(i,e),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return r||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!r&&n)}let l=this.state.value,h=this.parseExpression();return C(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,l,h,t):this.parseExpressionStatement(i,h,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var i;(i=e.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(p.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(p.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let r=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(p.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(qe);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let l=this.isAwaitUsing(),h=l||this.isContextual(107)&&this.allowsForUsing(),c=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||c){let u=this.startNode(),f;l?(f="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(u,!0,f);let d=this.finishNode(u,"VariableDeclaration"),y=this.match(58);return y&&h&&this.raise(p.ForInUsing,d),(y||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let i=this.isContextual(95),r=new te,n=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(p.ForOfLet,n),e===null&&i&&n.type==="Identifier"&&this.raise(p.ForOfAsync,n)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(n,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:l}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(r,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!(this.optionFlags&2)&&this.raise(p.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(Br),this.scope.enter(256);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let r=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(i&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(qe),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,i){for(let n of this.state.labels)n.name===e&&this.raise(p.LabelRedeclaration,s,{labelName:e});let r=Hi(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=r;else break}return this.state.labels.push({name:e,kind:r,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,r){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,i,r)}parseBlockOrModuleBlockBody(t,e,s,i,r){let n=this.state.strict,o=!1,l=!1;for(;!this.match(i);){let h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(h)){let c=this.stmtToDirective(h);e.push(c),!o&&c.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}t.push(h)}r==null||r.call(this,o),n||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(p.ForInOfLoopInitializer,e,{type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let r=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),r=i&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(r));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Ce(n,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||C(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Ar()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(r,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(p.DecoratorConstructor,n)}}),this.state.strict=e,this.next(),i.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let r=e,n=e,o=e,l=e,h=e,c=r,u=r;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let S=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(c),S){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsGenerator,r.key),this.pushClassMethod(t,r,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&C(this.state.type),d=this.parseClassElementName(e),y=f?d.name:null,A=this.isPrivateName(d),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(c.kind="method",A){this.pushClassPrivateMethod(t,n,!1,!1);return}let S=this.isNonstaticConstructor(r),I=!1;S&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,d),S&&this.hasPlugin("typescript")&&e.override&&this.raise(p.OverrideOnConstructor,d),s.hadConstructor=!0,I=s.hadSuperClass),this.pushClassMethod(t,r,!1,!1,S,I)}else if(this.isClassProperty())A?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o);else if(y==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let S=this.eat(55);u.optional&&this.unexpected(N),c.kind="method";let I=this.match(139);this.parseClassElementName(c),this.parsePostMemberNameModifiers(u),I?this.pushClassPrivateMethod(t,n,S,!0):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAsync,r.key),this.pushClassMethod(t,r,S,!0,!1,!1))}else if((y==="get"||y==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),c.kind=y;let S=this.match(139);this.parseClassElementName(r),S?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(p.ConstructorIsAccessor,r.key),this.pushClassMethod(t,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(y==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let S=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(t,h,S)}else this.isLineTerminator()?A?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(p.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key);let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(t,e,s,i,r,n){t.body.push(this.parseMethod(e,s,i,r,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let r=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(r);let n=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,n)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(Os()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=8331){if(C(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),r=!i||this.eat(12),n=r&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),l=r&&(!o||this.eat(12)),h=i||n;if(n&&!o){if(i&&this.unexpected(),e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(t);i&&r&&!n&&!c&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let u;if(h||c){if(u=!1,e)throw this.raise(p.UnsupportedDecoratorExport,t);this.parseExportFrom(t,h)}else u=this.maybeParseExportDeclaration(t);if(h||c||u){var f;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,y=this.parseExportDefaultExpression();if(d.declaration=y,y.type==="ClassDeclaration")this.maybeTakeDecorators(e,y,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.hasPlugin("explicitResourceManagement")&&(this.isUsing()||this.isAwaitUsing()))throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(C(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:i}=this.lookahead();if(C(i)&&i!==98||i===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||C(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;if(t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")))return this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(p.DecoratorBeforeExport,this.state.startLoc),!0;if(this.hasPlugin("explicitResourceManagement")){if(this.isUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0;if(this.isAwaitUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0}return t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){var r;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(p.ExportDefaultFromAsIdentifier,o)}}else if((r=t.specifiers)!=null&&r.length)for(let o of t.specifiers){let{exported:l}=o,h=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,h),!i&&o.local){let{local:c}=o;c.type!=="Identifier"?this.raise(p.ExportBindingIsString,o,{localName:c.value,exportName:h}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(t,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),r=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,r,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=Rr.exec(t.value);return e&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(p.ImportReflectionNotBinding,e[0].loc.start),((i=t.assertions)==null?void 0:i.length)>0&&this.raise(p.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let r;if(i.type==="ExportSpecifier"?r=i.local:i.type==="ImportSpecifier"&&(r=i.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(p.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.startNode(),i=this.parseIdentifierName(!0),{type:r}=this.state;return(M(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.applyImportPhase(t,e,i,s.loc.start),null):(this.applyImportPhase(t,e,null),this.createIdentifier(s,i))}isPrecedingIdImportPhase(t){let{type:e}=this.state;return C(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=i&&this.maybeParseStarImportSpecifier(t);return i&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),e.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(p.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(p.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(e=this.parseModuleAttributes(),this.addExtra(t,"deprecatedWithLegacySyntax",!0)):e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(p.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(M(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),r=this.isContextual(130);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",r,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,i,r){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(p.ImportBindingIsString,t,{importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=this.cloneIdentifier(n))}return this.finishImportSpecifier(t,"ImportSpecifier",r)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},ke=class extends ct{constructor(t,e,s){t=Ri(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex;let i=0;t.allowAwaitOutsideFunction&&(i|=1),t.allowReturnOutsideFunction&&(i|=2),t.allowImportExportEverywhere&&(i|=8),t.allowSuperOutsideMethod&&(i|=16),t.allowUndeclaredExports&&(i|=64),t.allowNewTargetOutsideFunction&&(i|=4),t.allowYieldOutsideFunction&&(i|=32),t.ranges&&(i|=128),t.tokens&&(i|=256),t.createImportExpressions&&(i|=512),t.createParenthesizedExpressions&&(i|=1024),t.errorRecovery&&(i|=2048),t.attachComment&&(i|=4096),t.annexB&&(i|=8192),this.optionFlags=i}getScopeHandler(){return ye}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function Ur(a,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=fe(t,a),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",fe(t,a).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",fe(t,a).parse()}catch{}throw s}}else return fe(t,a).parse()}function jr(a,t){let e=fe(t,a);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function $r(a){let t={};for(let e of Object.keys(a))t[e]=R(a[e]);return t}var Vr=$r($i);function fe(a,t){let e=ke,s=new Map;if(a!=null&&a.plugins){for(let i of a.plugins){let r,n;typeof i=="string"?r=i:[r,n]=i,s.has(r)||s.set(r,n||{})}Or(s),e=qr(s)}return new e(a,t,s)}var Ss=new Map;function qr(a){let t=[];for(let i of Fr)a.has(i)&&t.push(i);let e=t.join("|"),s=Ss.get(e);if(!s){s=ke;for(let i of t)s=_s[i](s);Ss.set(e,s)}return s}Pe.parse=Ur;Pe.parseExpression=jr;Pe.tokTypes=Vr});var Mt={};Ue(Mt,{parsers:()=>ja});var vt={};Ue(vt,{__babel_estree:()=>Ma,__js_expression:()=>La,__ts_expression:()=>Da,__vue_event_binding:()=>ka,__vue_expression:()=>La,__vue_ts_event_binding:()=>va,__vue_ts_expression:()=>Da,babel:()=>ka,"babel-flow":()=>Pi,"babel-ts":()=>va});var Fe=ls(Tt(),1);function ve(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n{if(!(a&&t==null)){if(t.findLast)return t.findLast(e);for(let s=t.length-1;s>=0;s--){let i=t[s];if(e(i,s,t))return i}}},Ks=Gr;var Yr=(a,t,e)=>{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Ws=Yr;var Qr=new Proxy(()=>{},{get:()=>Qr});function v(a){var s,i,r;let t=((s=a.range)==null?void 0:s[0])??a.start,e=(r=((i=a.declaration)==null?void 0:i.decorators)??a.decorators)==null?void 0:r[0];return e?Math.min(v(e),t):t}function k(a){var e;return((e=a.range)==null?void 0:e[1])??a.end}function Zr(a){let t=new Set(a);return e=>t.has(e==null?void 0:e.type)}var ae=Zr;function ea(a,t,e){let s=a.originalText.slice(t,e);for(let i of a[Symbol.for("comments")]){let r=v(i);if(r>e)break;let n=k(i);if(n1&&t.every(e=>e.trimStart()[0]==="*")}var St=new WeakMap;function aa(a){return St.has(a)||St.set(a,ra(a)),St.get(a)}var Et=aa;function na(a){if(a.length<2)return;let t;for(let e=a.length-1;e>=0;e--){let s=a[e];if(t&&k(s)===v(t)&&Et(s)&&Et(t)&&(a.splice(e+1,1),s.value+="*//*"+t.value,s.range=[v(s),k(t)]),!bt(s)&&!G(s))throw new TypeError(`Unknown comment type: "${s.type}".`);t=s}}var Gs=na;var ge=null;function Te(a){if(ge!==null&&typeof ge.property){let t=ge;return ge=Te.prototype=null,t}return ge=Te.prototype=a??Object.create(null),new Te}var oa=10;for(let a=0;a<=oa;a++)Te();function Ct(a){return Te(a)}function la(a,t="type"){Ct(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ys=la;var Qs={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]};var ha=Ys(Qs),Zs=ha;function wt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s{switch(l.type){case"ParenthesizedExpression":{let{expression:h}=l,c=v(l);if(h.type==="TypeCastExpression")return h.range=[c,k(l)],h;let u=!1;if(!r){if(!n){n=[];for(let d of i)Xs(d)&&n.push(k(d))}let f=Ks(!1,n,d=>d<=c);u=f&&s.slice(f,c).trim().length===0}if(!u)return h.extra={...h.extra,parenthesized:!0},h;break}case"LogicalExpression":if(si(l))return It(l);break;case"TemplateLiteral":if(l.expressions.length!==l.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if(e==="flow"||e==="hermes"||e==="espree"||e==="typescript"||r){let h=v(l)+1,c=k(l)-(l.tail?1:2);l.range=[h,c]}break;case"VariableDeclaration":{let h=Ws(!1,l.declarations,-1);h!=null&&h.init&&s[k(h)]!==";"&&(l.range=[v(l),k(h)]);break}case"TSParenthesizedType":return l.typeAnnotation;case"TSTypeParameter":ti(l);break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(l.types.length===1)return l.types[0];break;case"TSMappedType":if(!l.constraint&&!l.key){let{name:h,constraint:c}=ti(l.typeParameter);l.constraint=c,l.key=h,delete l.typeParameter}break;case"TSEnumDeclaration":if(!l.body){let h=k(l.id),{members:c}=l,u=Js({originalText:s,[Symbol.for("comments")]:i},h,c[0]?v(c[0]):k(l)),f=h+u.indexOf("{");l.body={type:"TSEnumBody",members:c,range:[f,k(l)]},delete l.members}break;case"ImportExpression":e==="hermes"&&l.attributes&&!l.options&&(l.options=l.attributes);break}});let o=a.type==="File"?a.program:a;return o.interpreter&&(i.unshift(o.interpreter),delete o.interpreter),r&&a.hashbang&&(i.unshift(a.hashbang),delete a.hashbang),a.type==="Program"&&(a.range=[0,s.length]),a}function ti(a){if(a.type==="TSTypeParameter"&&typeof a.name=="string"){let t=v(a);a.name={type:"Identifier",name:a.name,range:[t,t+a.name.length]}}return a}function si(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function It(a){return si(a)?It({type:"LogicalExpression",operator:a.operator,left:It({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[v(a.left),k(a.right.left)]}),right:a.right.right,range:[v(a),k(a)]}):a}var ii=ca;function pa(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var De=pa;var ri="Unexpected parseExpression() input: ";function ua(a){let{message:t,loc:e,reasonCode:s}=a;if(!e)return a;let{line:i,column:r}=e,n=a;(s==="MissingPlugin"||s==="MissingOneOfPlugins")&&(t="Unexpected token.",n=void 0);let o=` (${i}:${r})`;return t.endsWith(o)&&(t=t.slice(0,-o.length)),t.startsWith(ri)&&(t=t.slice(ri.length)),De(t,{loc:{start:{line:i,column:r+1}},cause:n})}var Me=ua;var fa=(a,t,e,s)=>{if(!(a&&t==null))return t.replaceAll?t.replaceAll(e,s):e.global?t.replace(e,s):t.split(e).join(s)},ne=fa;var da=/\*\/$/,ma=/^\/\*\*?/,ya=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,xa=/(^|\s+)\/\/([^\n\r]*)/g,ai=/^(\r?\n)+/,Pa=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ni=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ga=/(\r?\n|^) *\* ?/g,Ta=[];function oi(a){let t=a.match(ya);return t?t[0].trimStart():""}function li(a){let t=` +`;a=ne(!1,a.replace(ma,"").replace(da,""),ga,"$1");let e="";for(;e!==a;)e=a,a=ne(!1,a,Pa,`${t}$1 $2${t}`);a=a.replace(ai,"").trimEnd();let s=Object.create(null),i=ne(!1,a,ni,"").replace(ai,"").trimEnd(),r;for(;r=ni.exec(a);){let n=ne(!1,r[2],xa,"");if(typeof s[r[1]]=="string"||Array.isArray(s[r[1]])){let o=s[r[1]];s[r[1]]=[...Ta,...Array.isArray(o)?o:[o],n]}else s[r[1]]=n}return{comments:i,pragmas:s}}var hi=["noformat","noprettier"],ci=["format","prettier"];function pi(a){let t=Le(a);t&&(a=a.slice(t.length+1));let e=oi(a),{pragmas:s,comments:i}=li(e);return{shebang:t,text:a,pragmas:s,comments:i}}function ui(a){let{pragmas:t}=pi(a);return ci.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function fi(a){let{pragmas:t}=pi(a);return hi.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function ba(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:ui,hasIgnorePragma:fi,locStart:v,locEnd:k,...a}}var Y=ba;var Nt="module",kt="script";function di(a){if(typeof a=="string"){if(a=a.toLowerCase(),/\.(?:mjs|mts)$/iu.test(a))return Nt;if(/\.(?:cjs|cts)$/iu.test(a))return kt}}function Aa(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var Oe=Aa;var oe=a=>Y(Ia(a)),Sa={sourceType:Nt,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!1,ranges:!1},mi="v8intrinsic",yi=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],j=(a,t=Sa)=>({...t,plugins:[...t.plugins,...a]}),Ea=/@(?:no)?flow\b/u;function Ca(a,t){if(t!=null&&t.endsWith(".js.flow"))return!0;let e=Le(a);e&&(a=a.slice(e.length));let s=zs(a,0);return s!==!1&&(a=a.slice(0,s)),Ea.test(a)}function wa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!Na.has(r.reasonCode));if(i)throw i;return s}function Ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{let{filepath:i}=s;if(typeof i!="string"&&(i=void 0),(s.parser==="babel"||s.parser==="__babel_estree")&&Ca(e,i))return s.parser="babel-flow",Pi.parse(e,s);let r=t,n=s.__babelSourceType??di(i);n===kt&&(r=r.map(c=>({...c,sourceType:n})));let o=/%[A-Z]/u.test(e);e.includes("|>")?r=(o?[...yi,mi]:yi).flatMap(u=>r.map(f=>j([u],f))):o&&(r=r.map(c=>j([mi],c)));let l=a?Fe.parseExpression:Fe.parse,h;try{h=Hs(r.map(c=>()=>wa(l,e,c)))}catch({errors:[c]}){throw Me(c)}return a&&(h=Oe(h,{text:e,rootMarker:s.rootMarker})),ii(h,{text:e})}}var Na=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert","DeclarationMissingInitializer"]),xi=[j(["jsx"])],ka=oe({optionsCombinations:xi}),va=oe({optionsCombinations:[j(["jsx","typescript"]),j(["typescript"])]}),La=oe({isExpression:!0,optionsCombinations:[j(["jsx"])]}),Da=oe({isExpression:!0,optionsCombinations:[j(["typescript"])]}),Pi=oe({optionsCombinations:[j(["jsx",["flow",{all:!0}],"flowComments"])]}),Ma=oe({optionsCombinations:xi.map(a=>j(["estree"],a))});var Dt={};Ue(Dt,{json:()=>Ba,"json-stringify":()=>Ua,json5:()=>Ra,jsonc:()=>_a});var Be=ls(Tt(),1);function Oa(a){return Array.isArray(a)&&a.length>0}var Lt=Oa;var gi={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Fa(a){let t=(0,Be.parse)(a,gi),{program:e}=t;if(e.body.length===0&&e.directives.length===0&&!e.interpreter)return t}function Re(a,t={}){let{allowComments:e=!0,allowEmpty:s=!1}=t,i;try{i=(0,Be.parseExpression)(a,gi)}catch(r){if(s&&r.code==="BABEL_PARSER_SYNTAX_ERROR"&&r.reasonCode==="ParseExpressionEmptyInput")try{i=Fa(a)}catch{}if(!i)throw Me(r)}if(!e&&Lt(i.comments))throw K(i.comments[0],"Comment");return i=Oe(i,{type:"JsonRoot",text:a}),i.node.type==="File"?delete i.node:le(i.node),i}function K(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return De(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function le(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&le(t);return;case"ObjectExpression":for(let t of a.properties)le(t);return;case"ObjectProperty":if(a.computed)throw K(a.key,"Computed key");if(a.shorthand)throw K(a.key,"Shorthand property");a.key.type!=="Identifier"&&le(a.key),le(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw K(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw K(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw K(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Lt(a.expressions))throw K(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)le(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw K(a,`'${a.type}'`)}}var Ba=Y({parse:a=>Re(a),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Ra=Y(a=>Re(a)),_a=Y(a=>Re(a,{allowEmpty:!0})),Ua=Y({parse:a=>Re(a,{allowComments:!1}),astFormat:"estree-json"});var ja={...vt,...Dt};var Vo=Mt;export{Vo as default,ja as parsers}; diff --git a/.pnpm-store/v10/files/17/e0a145d68188710cf962eeca91859bdd741ba55a433702a9fb142bdffd84931f6a62b41ad87517c06cfeec06ef6f044f72c9bf69979b663ac27e06742d0513 b/.pnpm-store/v10/files/17/e0a145d68188710cf962eeca91859bdd741ba55a433702a9fb142bdffd84931f6a62b41ad87517c06cfeec06ef6f044f72c9bf69979b663ac27e06742d0513 new file mode 100644 index 0000000..2c49aef --- /dev/null +++ b/.pnpm-store/v10/files/17/e0a145d68188710cf962eeca91859bdd741ba55a433702a9fb142bdffd84931f6a62b41ad87517c06cfeec06ef6f044f72c9bf69979b663ac27e06742d0513 @@ -0,0 +1,249 @@ +'use strict' + +const Range = require('../classes/range.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/.pnpm-store/v10/files/18/0379ac8d63f25d27612bf185aab6736162bc46a219a7f4247c174b525a088abea07af47f46a1a588774b6b975d72f16e48a16e423e93208591dfa394282b2d b/.pnpm-store/v10/files/18/0379ac8d63f25d27612bf185aab6736162bc46a219a7f4247c174b525a088abea07af47f46a1a588774b6b975d72f16e48a16e423e93208591dfa394282b2d new file mode 100644 index 0000000..7ed2777 --- /dev/null +++ b/.pnpm-store/v10/files/18/0379ac8d63f25d27612bf185aab6736162bc46a219a7f4247c174b525a088abea07af47f46a1a588774b6b975d72f16e48a16e423e93208591dfa394282b2d @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/.pnpm-store/v10/files/18/6998247794e2cd9fc5e365386d48f07ba6eb779f0f32f1f6eb599555b8170e4bbb8fe7d22bf4367744314d77118f1a1b6ba05981c696b829f7eeebf8503a5e b/.pnpm-store/v10/files/18/6998247794e2cd9fc5e365386d48f07ba6eb779f0f32f1f6eb599555b8170e4bbb8fe7d22bf4367744314d77118f1a1b6ba05981c696b829f7eeebf8503a5e new file mode 100644 index 0000000..ce1dd98 --- /dev/null +++ b/.pnpm-store/v10/files/18/6998247794e2cd9fc5e365386d48f07ba6eb779f0f32f1f6eb599555b8170e4bbb8fe7d22bf4367744314d77118f1a1b6ba05981c696b829f7eeebf8503a5e @@ -0,0 +1,186 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.3.0](https://github.com/ljharb/get-intrinsic/compare/v1.2.7...v1.3.0) - 2025-02-22 + +### Commits + +- [Dev Deps] update `es-abstract`, `es-value-fixtures`, `for-each`, `object-inspect` [`9b61553`](https://github.com/ljharb/get-intrinsic/commit/9b61553c587f1c1edbd435597e88c7d387da97dd) +- [Deps] update `call-bind-apply-helpers`, `es-object-atoms`, `get-proto` [`a341fee`](https://github.com/ljharb/get-intrinsic/commit/a341fee0f39a403b0f0069e82c97642d5eb11043) +- [New] add `Float16Array` [`de22116`](https://github.com/ljharb/get-intrinsic/commit/de22116b492fb989a0341bceb6e573abfaed73dc) + +## [v1.2.7](https://github.com/ljharb/get-intrinsic/compare/v1.2.6...v1.2.7) - 2025-01-02 + +### Commits + +- [Refactor] use `get-proto` directly [`00ab955`](https://github.com/ljharb/get-intrinsic/commit/00ab95546a0980c8ad42a84253daaa8d2adcedf9) +- [Deps] update `math-intrinsics` [`c716cdd`](https://github.com/ljharb/get-intrinsic/commit/c716cdd6bbe36b438057025561b8bb5a879ac8a0) +- [Dev Deps] update `call-bound`, `es-abstract` [`dc648a6`](https://github.com/ljharb/get-intrinsic/commit/dc648a67eb359037dff8d8619bfa71d86debccb1) + +## [v1.2.6](https://github.com/ljharb/get-intrinsic/compare/v1.2.5...v1.2.6) - 2024-12-11 + +### Commits + +- [Refactor] use `math-intrinsics` [`841be86`](https://github.com/ljharb/get-intrinsic/commit/841be8641a9254c4c75483b30c8871b5d5065926) +- [Refactor] use `es-object-atoms` [`42057df`](https://github.com/ljharb/get-intrinsic/commit/42057dfa16f66f64787e66482af381cc6f31d2c1) +- [Deps] update `call-bind-apply-helpers` [`45afa24`](https://github.com/ljharb/get-intrinsic/commit/45afa24a9ee4d6d3c172db1f555b16cb27843ef4) +- [Dev Deps] update `call-bound` [`9cba9c6`](https://github.com/ljharb/get-intrinsic/commit/9cba9c6e70212bc163b7a5529cb25df46071646f) + +## [v1.2.5](https://github.com/ljharb/get-intrinsic/compare/v1.2.4...v1.2.5) - 2024-12-06 + +### Commits + +- [actions] split out node 10-20, and 20+ [`6e2b9dd`](https://github.com/ljharb/get-intrinsic/commit/6e2b9dd23902665681ebe453256ccfe21d7966f0) +- [Refactor] use `dunder-proto` and `call-bind-apply-helpers` instead of `has-proto` [`c095d17`](https://github.com/ljharb/get-intrinsic/commit/c095d179ad0f4fbfff20c8a3e0cb4fe668018998) +- [Refactor] use `gopd` [`9841d5b`](https://github.com/ljharb/get-intrinsic/commit/9841d5b35f7ab4fd2d193f0c741a50a077920e90) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-abstract`, `es-value-fixtures`, `gopd`, `mock-property`, `object-inspect`, `tape` [`2d07e01`](https://github.com/ljharb/get-intrinsic/commit/2d07e01310cee2cbaedfead6903df128b1f5d425) +- [Deps] update `gopd`, `has-proto`, `has-symbols`, `hasown` [`974d8bf`](https://github.com/ljharb/get-intrinsic/commit/974d8bf5baad7939eef35c25cc1dd88c10a30fa6) +- [Dev Deps] update `call-bind`, `es-abstract`, `tape` [`df9dde1`](https://github.com/ljharb/get-intrinsic/commit/df9dde178186631ab8a3165ede056549918ce4bc) +- [Refactor] cache `es-define-property` as well [`43ef543`](https://github.com/ljharb/get-intrinsic/commit/43ef543cb02194401420e3a914a4ca9168691926) +- [Deps] update `has-proto`, `has-symbols`, `hasown` [`ad4949d`](https://github.com/ljharb/get-intrinsic/commit/ad4949d5467316505aad89bf75f9417ed782f7af) +- [Tests] use `call-bound` directly [`ad5c406`](https://github.com/ljharb/get-intrinsic/commit/ad5c4069774bfe90e520a35eead5fe5ca9d69e80) +- [Deps] update `has-proto`, `hasown` [`45414ca`](https://github.com/ljharb/get-intrinsic/commit/45414caa312333a2798953682c68f85c550627dd) +- [Tests] replace `aud` with `npm audit` [`18d3509`](https://github.com/ljharb/get-intrinsic/commit/18d3509f79460e7924da70409ee81e5053087523) +- [Deps] update `es-define-property` [`aadaa3b`](https://github.com/ljharb/get-intrinsic/commit/aadaa3b2188d77ad9bff394ce5d4249c49eb21f5) +- [Dev Deps] add missing peer dep [`c296a16`](https://github.com/ljharb/get-intrinsic/commit/c296a16246d0c9a5981944f4cc5cf61fbda0cf6a) + +## [v1.2.4](https://github.com/ljharb/get-intrinsic/compare/v1.2.3...v1.2.4) - 2024-02-05 + +### Commits + +- [Refactor] use all 7 <+ ES6 Errors from `es-errors` [`bcac811`](https://github.com/ljharb/get-intrinsic/commit/bcac811abdc1c982e12abf848a410d6aae148d14) + +## [v1.2.3](https://github.com/ljharb/get-intrinsic/compare/v1.2.2...v1.2.3) - 2024-02-03 + +### Commits + +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`f11db9c`](https://github.com/ljharb/get-intrinsic/commit/f11db9c4fb97d87bbd53d3c73ac6b3db3613ad3b) +- [Dev Deps] update `aud`, `es-abstract`, `mock-property`, `npmignore` [`b7ac7d1`](https://github.com/ljharb/get-intrinsic/commit/b7ac7d1616fefb03877b1aed0c8f8d61aad32b6c) +- [meta] simplify `exports` [`faa0cc6`](https://github.com/ljharb/get-intrinsic/commit/faa0cc618e2830ffb51a8202490b0c215d965cbc) +- [meta] add missing `engines.node` [`774dd0b`](https://github.com/ljharb/get-intrinsic/commit/774dd0b3e8f741c3f05a6322d124d6087f146af1) +- [Dev Deps] update `tape` [`5828e8e`](https://github.com/ljharb/get-intrinsic/commit/5828e8e4a04e69312e87a36c0ea39428a7a4c3d8) +- [Robustness] use null objects for lookups [`eb9a11f`](https://github.com/ljharb/get-intrinsic/commit/eb9a11fa9eb3e13b193fcc05a7fb814341b1a7b7) +- [meta] add `sideEffects` flag [`89bcc7a`](https://github.com/ljharb/get-intrinsic/commit/89bcc7a42e19bf07b7c21e3094d5ab177109e6d2) + +## [v1.2.2](https://github.com/ljharb/get-intrinsic/compare/v1.2.1...v1.2.2) - 2023-10-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `call-bind`, `es-abstract`, `mock-property`, `object-inspect`, `tape` [`f51bcf2`](https://github.com/ljharb/get-intrinsic/commit/f51bcf26412d58d17ce17c91c9afd0ad271f0762) +- [Refactor] use `hasown` instead of `has` [`18d14b7`](https://github.com/ljharb/get-intrinsic/commit/18d14b799bea6b5765e1cec91890830cbcdb0587) +- [Deps] update `function-bind` [`6e109c8`](https://github.com/ljharb/get-intrinsic/commit/6e109c81e03804cc5e7824fb64353cdc3d8ee2c7) + +## [v1.2.1](https://github.com/ljharb/get-intrinsic/compare/v1.2.0...v1.2.1) - 2023-05-13 + +### Commits + +- [Fix] avoid a crash in envs without `__proto__` [`7bad8d0`](https://github.com/ljharb/get-intrinsic/commit/7bad8d061bf8721733b58b73a2565af2b6756b64) +- [Dev Deps] update `es-abstract` [`c60e6b7`](https://github.com/ljharb/get-intrinsic/commit/c60e6b7b4cf9660c7f27ed970970fd55fac48dc5) + +## [v1.2.0](https://github.com/ljharb/get-intrinsic/compare/v1.1.3...v1.2.0) - 2023-01-19 + +### Commits + +- [actions] update checkout action [`ca6b12f`](https://github.com/ljharb/get-intrinsic/commit/ca6b12f31eaacea4ea3b055e744cd61623385ffb) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `tape` [`41a3727`](https://github.com/ljharb/get-intrinsic/commit/41a3727d0026fa04273ae216a5f8e12eefd72da8) +- [Fix] ensure `Error.prototype` is undeniable [`c511e97`](https://github.com/ljharb/get-intrinsic/commit/c511e97ae99c764c4524b540dee7a70757af8da3) +- [Dev Deps] update `aud`, `es-abstract`, `tape` [`1bef8a8`](https://github.com/ljharb/get-intrinsic/commit/1bef8a8fd439ebb80863199b6189199e0851ac67) +- [Dev Deps] update `aud`, `es-abstract` [`0d41f16`](https://github.com/ljharb/get-intrinsic/commit/0d41f16bcd500bc28b7bfc98043ebf61ea081c26) +- [New] add `BigInt64Array` and `BigUint64Array` [`a6cca25`](https://github.com/ljharb/get-intrinsic/commit/a6cca25f29635889b7e9bd669baf9e04be90e48c) +- [Tests] use `gopd` [`ecf7722`](https://github.com/ljharb/get-intrinsic/commit/ecf7722240d15cfd16edda06acf63359c10fb9bd) + +## [v1.1.3](https://github.com/ljharb/get-intrinsic/compare/v1.1.2...v1.1.3) - 2022-09-12 + +### Commits + +- [Dev Deps] update `es-abstract`, `es-value-fixtures`, `tape` [`07ff291`](https://github.com/ljharb/get-intrinsic/commit/07ff291816406ebe5a12d7f16965bde0942dd688) +- [Fix] properly check for % signs [`50ac176`](https://github.com/ljharb/get-intrinsic/commit/50ac1760fe99c227e64eabde76e9c0e44cd881b5) + +## [v1.1.2](https://github.com/ljharb/get-intrinsic/compare/v1.1.1...v1.1.2) - 2022-06-08 + +### Fixed + +- [Fix] properly validate against extra % signs [`#16`](https://github.com/ljharb/get-intrinsic/issues/16) + +### Commits + +- [actions] reuse common workflows [`0972547`](https://github.com/ljharb/get-intrinsic/commit/0972547efd0abc863fe4c445a6ca7eb4f8c6901d) +- [meta] use `npmignore` to autogenerate an npmignore file [`5ba0b51`](https://github.com/ljharb/get-intrinsic/commit/5ba0b51d8d8d4f1c31d426d74abc0770fd106bad) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c364492`](https://github.com/ljharb/get-intrinsic/commit/c364492af4af51333e6f81c0bf21fd3d602c3661) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es-abstract`, `object-inspect`, `tape` [`dc04dad`](https://github.com/ljharb/get-intrinsic/commit/dc04dad86f6e5608775a2640cb0db5927ae29ed9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `safe-publish-latest`, `tape` [`1c14059`](https://github.com/ljharb/get-intrinsic/commit/1c1405984e86dd2dc9366c15d8a0294a96a146a5) +- [Tests] use `mock-property` [`b396ef0`](https://github.com/ljharb/get-intrinsic/commit/b396ef05bb73b1d699811abd64b0d9b97997fdda) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`c2c758d`](https://github.com/ljharb/get-intrinsic/commit/c2c758d3b90af4fef0a76910d8d3c292ec8d1d3e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`29e3c09`](https://github.com/ljharb/get-intrinsic/commit/29e3c091c2bf3e17099969847e8729d0e46896de) +- [actions] update codecov uploader [`8cbc141`](https://github.com/ljharb/get-intrinsic/commit/8cbc1418940d7a8941f3a7985cbc4ac095c5e13d) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`10b6f5c`](https://github.com/ljharb/get-intrinsic/commit/10b6f5c02593fb3680c581d696ac124e30652932) +- [readme] add github actions/codecov badges [`4e25400`](https://github.com/ljharb/get-intrinsic/commit/4e25400d9f51ae9eb059cbe22d9144e70ea214e8) +- [Tests] use `for-each` instead of `foreach` [`c05b957`](https://github.com/ljharb/get-intrinsic/commit/c05b957ad9a7bc7721af7cc9e9be1edbfe057496) +- [Dev Deps] update `es-abstract` [`29b05ae`](https://github.com/ljharb/get-intrinsic/commit/29b05aec3e7330e9ad0b8e0f685a9112c20cdd97) +- [meta] use `prepublishOnly` script for npm 7+ [`95c285d`](https://github.com/ljharb/get-intrinsic/commit/95c285da810516057d3bbfa871176031af38f05d) +- [Deps] update `has-symbols` [`593cb4f`](https://github.com/ljharb/get-intrinsic/commit/593cb4fb38e7922e40e42c183f45274b636424cd) +- [readme] fix repo URLs [`1c8305b`](https://github.com/ljharb/get-intrinsic/commit/1c8305b5365827c9b6fc785434aac0e1328ff2f5) +- [Deps] update `has-symbols` [`c7138b6`](https://github.com/ljharb/get-intrinsic/commit/c7138b6c6d73132d859471fb8c13304e1e7c8b20) +- [Dev Deps] remove unused `has-bigints` [`bd63aff`](https://github.com/ljharb/get-intrinsic/commit/bd63aff6ad8f3a986c557fcda2914187bdaab359) + +## [v1.1.1](https://github.com/ljharb/get-intrinsic/compare/v1.1.0...v1.1.1) - 2021-02-03 + +### Fixed + +- [meta] export `./package.json` [`#9`](https://github.com/ljharb/get-intrinsic/issues/9) + +### Commits + +- [readme] flesh out the readme; use `evalmd` [`d12f12c`](https://github.com/ljharb/get-intrinsic/commit/d12f12c15345a0a0772cc65a7c64369529abd614) +- [eslint] set up proper globals config [`5a8c098`](https://github.com/ljharb/get-intrinsic/commit/5a8c0984e3319d1ac0e64b102f8ec18b64e79f36) +- [Dev Deps] update `eslint` [`7b9a5c0`](https://github.com/ljharb/get-intrinsic/commit/7b9a5c0d31a90ca1a1234181c74988fb046701cd) + +## [v1.1.0](https://github.com/ljharb/get-intrinsic/compare/v1.0.2...v1.1.0) - 2021-01-25 + +### Fixed + +- [Refactor] delay `Function` eval until syntax-derived values are requested [`#3`](https://github.com/ljharb/get-intrinsic/issues/3) + +### Commits + +- [Tests] migrate tests to Github Actions [`2ab762b`](https://github.com/ljharb/get-intrinsic/commit/2ab762b48164aea8af37a40ba105bbc8246ab8c4) +- [meta] do not publish github action workflow files [`5e7108e`](https://github.com/ljharb/get-intrinsic/commit/5e7108e4768b244d48d9567ba4f8a6cab9c65b8e) +- [Tests] add some coverage [`01ac7a8`](https://github.com/ljharb/get-intrinsic/commit/01ac7a87ac29738567e8524cd8c9e026b1fa8cb3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `call-bind`, `es-abstract`, `tape`; add `call-bind` [`911b672`](https://github.com/ljharb/get-intrinsic/commit/911b672fbffae433a96924c6ce013585e425f4b7) +- [Refactor] rearrange evalled constructors a bit [`7e7e4bf`](https://github.com/ljharb/get-intrinsic/commit/7e7e4bf583f3799c8ac1c6c5e10d2cb553957347) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`0199968`](https://github.com/ljharb/get-intrinsic/commit/01999687a263ffce0a3cb011dfbcb761754aedbc) + +## [v1.0.2](https://github.com/ljharb/get-intrinsic/compare/v1.0.1...v1.0.2) - 2020-12-17 + +### Commits + +- [Fix] Throw for non‑existent intrinsics [`68f873b`](https://github.com/ljharb/get-intrinsic/commit/68f873b013c732a05ad6f5fc54f697e55515461b) +- [Fix] Throw for non‑existent segments in the intrinsic path [`8325dee`](https://github.com/ljharb/get-intrinsic/commit/8325deee43128f3654d3399aa9591741ebe17b21) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-bigints`, `object-inspect` [`0c227a7`](https://github.com/ljharb/get-intrinsic/commit/0c227a7d8b629166f25715fd242553892e458525) +- [meta] do not lint coverage output [`70d2419`](https://github.com/ljharb/get-intrinsic/commit/70d24199b620043cd9110fc5f426d214ebe21dc9) + +## [v1.0.1](https://github.com/ljharb/get-intrinsic/compare/v1.0.0...v1.0.1) - 2020-10-30 + +### Commits + +- [Tests] gather coverage data on every job [`d1d280d`](https://github.com/ljharb/get-intrinsic/commit/d1d280dec714e3f0519cc877dbcb193057d9cac6) +- [Fix] add missing dependencies [`5031771`](https://github.com/ljharb/get-intrinsic/commit/5031771bb1095b38be88ce7c41d5de88718e432e) +- [Tests] use `es-value-fixtures` [`af48765`](https://github.com/ljharb/get-intrinsic/commit/af48765a23c5323fb0b6b38dbf00eb5099c7bebc) + +## v1.0.0 - 2020-10-29 + +### Commits + +- Implementation [`bbce57c`](https://github.com/ljharb/get-intrinsic/commit/bbce57c6f33d05b2d8d3efa273ceeb3ee01127bb) +- Tests [`17b4f0d`](https://github.com/ljharb/get-intrinsic/commit/17b4f0d56dea6b4059b56fc30ef3ee4d9500ebc2) +- Initial commit [`3153294`](https://github.com/ljharb/get-intrinsic/commit/31532948de363b0a27dd9fd4649e7b7028ec4b44) +- npm init [`fb326c4`](https://github.com/ljharb/get-intrinsic/commit/fb326c4d2817c8419ec31de1295f06bb268a7902) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`48862fb`](https://github.com/ljharb/get-intrinsic/commit/48862fb2508c8f6a57968e6d08b7c883afc9d550) +- [meta] add `auto-changelog` [`5f28ad0`](https://github.com/ljharb/get-intrinsic/commit/5f28ad019e060a353d8028f9f2591a9cc93074a1) +- [meta] add "funding"; create `FUNDING.yml` [`c2bbdde`](https://github.com/ljharb/get-intrinsic/commit/c2bbddeba73a875be61484ee4680b129a6d4e0a1) +- [Tests] add `npm run lint` [`0a84b98`](https://github.com/ljharb/get-intrinsic/commit/0a84b98b22b7cf7a748666f705b0003a493c35fd) +- Only apps should have lockfiles [`9586c75`](https://github.com/ljharb/get-intrinsic/commit/9586c75866c1ee678e4d5d4dbbdef6997e511b05) diff --git a/.pnpm-store/v10/files/18/97d9d40451f3fecd12d9b55752d0a74bf23656c8ab03712c083e6c4b273bf158c1d1f328294e5da01bea0bf016bb5346ee975ac843595392c02c5bd1f220b8 b/.pnpm-store/v10/files/18/97d9d40451f3fecd12d9b55752d0a74bf23656c8ab03712c083e6c4b273bf158c1d1f328294e5da01bea0bf016bb5346ee975ac843595392c02c5bd1f220b8 new file mode 100644 index 0000000..46f3b12 --- /dev/null +++ b/.pnpm-store/v10/files/18/97d9d40451f3fecd12d9b55752d0a74bf23656c8ab03712c083e6c4b273bf158c1d1f328294e5da01bea0bf016bb5346ee975ac843595392c02c5bd1f220b8 @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/.pnpm-store/v10/files/18/e628341d627eb1e31b3a91fb08c8f4c17c5cdea39fdbac849f78cec9950afc4cf5747dc24f7083d08f91eefe698b9f45d20c2f52cd8299569f1494105ea8d7 b/.pnpm-store/v10/files/18/e628341d627eb1e31b3a91fb08c8f4c17c5cdea39fdbac849f78cec9950afc4cf5747dc24f7083d08f91eefe698b9f45d20c2f52cd8299569f1494105ea8d7 new file mode 100644 index 0000000..677893c --- /dev/null +++ b/.pnpm-store/v10/files/18/e628341d627eb1e31b3a91fb08c8f4c17c5cdea39fdbac849f78cec9950afc4cf5747dc24f7083d08f91eefe698b9f45d20c2f52cd8299569f1494105ea8d7 @@ -0,0 +1,70 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + + +## Install + +``` +$ npm install has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean for whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `string[]`
+Default: `process.argv` + +CLI arguments. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/.pnpm-store/v10/files/19/0a6f69117a2332e4c02ea406c556961d5e35543665ac3c17779ec27c43a45eb605bf0698c4d317977ebd3312dc02960816ce39958c35ed581a63cbedd0df5d b/.pnpm-store/v10/files/19/0a6f69117a2332e4c02ea406c556961d5e35543665ac3c17779ec27c43a45eb605bf0698c4d317977ebd3312dc02960816ce39958c35ed581a63cbedd0df5d new file mode 100644 index 0000000..a2fc9f0 --- /dev/null +++ b/.pnpm-store/v10/files/19/0a6f69117a2332e4c02ea406c556961d5e35543665ac3c17779ec27c43a45eb605bf0698c4d317977ebd3312dc02960816ce39958c35ed581a63cbedd0df5d @@ -0,0 +1,61 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../'); + +/** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */ + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + var x = callBound('Object.prototype.toString'); + var y = callBound('%Object.prototype.toString%'); + + // prototype function + t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + // @ts-expect-error + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + // @ts-expect-error + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/19/3d658e2fbe74b8b8a0e4b98567672e9bf0253875f8eaca1800b0c7212300dd8bc5b2ebb0685e375a5e0f4eb23833ed8c47113678efb7083760725e97d35483 b/.pnpm-store/v10/files/19/3d658e2fbe74b8b8a0e4b98567672e9bf0253875f8eaca1800b0c7212300dd8bc5b2ebb0685e375a5e0f4eb23833ed8c47113678efb7083760725e97d35483 new file mode 100644 index 0000000..856ee36 --- /dev/null +++ b/.pnpm-store/v10/files/19/3d658e2fbe74b8b8a0e4b98567672e9bf0253875f8eaca1800b0c7212300dd8bc5b2ebb0685e375a5e0f4eb23833ed8c47113678efb7083760725e97d35483 @@ -0,0 +1,62 @@ +# side-channel-weakmap [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-weakmap +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-weakmap'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-weakmap +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-weakmap.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-weakmap +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-weakmap#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-weakmap.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-weakmap.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-weakmap.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-weakmap +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-weakmap/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-weakmap/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-weakmap +[actions-url]: https://github.com/ljharb/side-channel-weakmap/actions diff --git a/.pnpm-store/v10/files/19/c1d9ded637054d2b58dadcdc0e8d226803fa4c3914fdbfab100ffc093b30b22326e6048f11a33b32d7bf6c8e1f6e3b6ce71cd4c91b4323d127768e3d22a748 b/.pnpm-store/v10/files/19/c1d9ded637054d2b58dadcdc0e8d226803fa4c3914fdbfab100ffc093b30b22326e6048f11a33b32d7bf6c8e1f6e3b6ce71cd4c91b4323d127768e3d22a748 new file mode 100644 index 0000000..cf739b2 --- /dev/null +++ b/.pnpm-store/v10/files/19/c1d9ded637054d2b58dadcdc0e8d226803fa4c3914fdbfab100ffc093b30b22326e6048f11a33b32d7bf6c8e1f6e3b6ce71cd4c91b4323d127768e3d22a748 @@ -0,0 +1,287 @@ +'use strict'; + +const fs = require('fs'); +const { Readable } = require('stream'); +const sysPath = require('path'); +const { promisify } = require('util'); +const picomatch = require('picomatch'); + +const readdir = promisify(fs.readdir); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp.promise = readdirpPromise; +readdirp.ReaddirpStream = ReaddirpStream; +readdirp.default = readdirp; + +module.exports = readdirp; diff --git a/.pnpm-store/v10/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 b/.pnpm-store/v10/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 new file mode 100644 index 0000000..0db67ed --- /dev/null +++ b/.pnpm-store/v10/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/.pnpm-store/v10/files/1a/923573b2d41ee7ab42bf6cd21bd17d04b8f0dfe2eba7419000b2768bb5693c8ed5a32171a9f4e382981368c582c8409cd32a4e1067a4d4d47635c127a042c0 b/.pnpm-store/v10/files/1a/923573b2d41ee7ab42bf6cd21bd17d04b8f0dfe2eba7419000b2768bb5693c8ed5a32171a9f4e382981368c582c8409cd32a4e1067a4d4d47635c127a042c0 new file mode 100644 index 0000000..4fa61ca --- /dev/null +++ b/.pnpm-store/v10/files/1a/923573b2d41ee7ab42bf6cd21bd17d04b8f0dfe2eba7419000b2768bb5693c8ed5a32171a9f4e382981368c582c8409cd32a4e1067a4d4d47635c127a042c0 @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/.pnpm-store/v10/files/1a/f1532db7bb8c3f5f6d23ce3cd0b055c5052d4bd47fd50badc8c595ac6e8c99823a4e958c074a49ade7b71152fcab2339c6e2bb020d076bdac4680bcc48a7c4 b/.pnpm-store/v10/files/1a/f1532db7bb8c3f5f6d23ce3cd0b055c5052d4bd47fd50badc8c595ac6e8c99823a4e958c074a49ade7b71152fcab2339c6e2bb020d076bdac4680bcc48a7c4 new file mode 100644 index 0000000..a44e43e --- /dev/null +++ b/.pnpm-store/v10/files/1a/f1532db7bb8c3f5f6d23ce3cd0b055c5052d4bd47fd50badc8c595ac6e8c99823a4e958c074a49ade7b71152fcab2339c6e2bb020d076bdac4680bcc48a7c4 @@ -0,0 +1,53 @@ +# call-bound [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`. + +## Getting started + +```sh +npm install --save call-bound +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBound = require('call-bound'); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; +delete Array.prototype.slice; + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bound +[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg +[deps-svg]: https://david-dm.org/ljharb/call-bound.svg +[deps-url]: https://david-dm.org/ljharb/call-bound +[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bound.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bound +[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound +[actions-url]: https://github.com/ljharb/call-bound/actions diff --git a/.pnpm-store/v10/files/1b/6dad654c0d6a644f7057548b0c4bb236085217f16ec60e19b0de2cb44d38d97b81eaf0166aa95defba280151468bb0c15f5b9535ebbc90bb4798d371bc5622 b/.pnpm-store/v10/files/1b/6dad654c0d6a644f7057548b0c4bb236085217f16ec60e19b0de2cb44d38d97b81eaf0166aa95defba280151468bb0c15f5b9535ebbc90bb4798d371bc5622 new file mode 100644 index 0000000..c3ca766 --- /dev/null +++ b/.pnpm-store/v10/files/1b/6dad654c0d6a644f7057548b0c4bb236085217f16ec60e19b0de2cb44d38d97b81eaf0166aa95defba280151468bb0c15f5b9535ebbc90bb4798d371bc5622 @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/.pnpm-store/v10/files/1b/adebd72c50d79cdfddf0b65772a864c4dff5bf05436be62f13b04107c0c1379d8ff2046b6cad36fe879dea15985cb77a6d12b0be57be50122b6d780eb67af0 b/.pnpm-store/v10/files/1b/adebd72c50d79cdfddf0b65772a864c4dff5bf05436be62f13b04107c0c1379d8ff2046b6cad36fe879dea15985cb77a6d12b0be57be50122b6d780eb67af0 new file mode 100644 index 0000000..9b13ad8 --- /dev/null +++ b/.pnpm-store/v10/files/1b/adebd72c50d79cdfddf0b65772a864c4dff5bf05436be62f13b04107c0c1379d8ff2046b6cad36fe879dea15985cb77a6d12b0be57be50122b6d780eb67af0 @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/.pnpm-store/v10/files/1b/b08e6d3ca11ffb452a7c2391d287cbf1a7907a530dc02f97d3374bde09678599f6da5bc614ec340f082996b3f7b0869b80ca787cce5d83b960db36b43da112 b/.pnpm-store/v10/files/1b/b08e6d3ca11ffb452a7c2391d287cbf1a7907a530dc02f97d3374bde09678599f6da5bc614ec340f082996b3f7b0869b80ca787cce5d83b960db36b43da112 new file mode 100644 index 0000000..11f1fd7 --- /dev/null +++ b/.pnpm-store/v10/files/1b/b08e6d3ca11ffb452a7c2391d287cbf1a7907a530dc02f97d3374bde09678599f6da5bc614ec340f082996b3f7b0869b80ca787cce5d83b960db36b43da112 @@ -0,0 +1,89 @@ +'use strict'; + +var utils = require('../utils'); + +// internal +var reEscComments = /\\#/g; +// note that '^^' is used in place of escaped comments +var reUnescapeComments = /\^\^/g; +var reComments = /#.*$/; +var reEscapeChars = /[.|\-[\]()\\]/g; +var reAsterisk = /\*/g; + +module.exports = add; + +/** + * Converts file patterns or regular expressions to nodemon + * compatible RegExp matching rules. Note: the `rules` argument + * object is modified to include the new rule and new RegExp + * + * ### Example: + * + * var rules = { watch: [], ignore: [] }; + * add(rules, 'watch', '*.js'); + * add(rules, 'ignore', '/public/'); + * add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp + * add(rules, 'watch', /\d*\.js/); + * + * @param {Object} rules containing `watch` and `ignore`. Also updated during + * execution + * @param {String} which must be either "watch" or "ignore" + * @param {String|RegExp} rule the actual rule. + */ +function add(rules, which, rule) { + if (!{ ignore: 1, watch: 1}[which]) { + throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' + + 'first argument'); + } + + if (Array.isArray(rule)) { + rule.forEach(function (rule) { + add(rules, which, rule); + }); + return; + } + + // support the rule being a RegExp, but reformat it to + // the custom : format that we're working with. + if (rule instanceof RegExp) { + // rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1'); + utils.log.error('RegExp format no longer supported, but globs are.'); + return; + } + + // remove comments and trim lines + // this mess of replace methods is escaping "\#" to allow for emacs temp files + + // first up strip comments and remove blank head or tails + rule = (rule || '').replace(reEscComments, '^^') + .replace(reComments, '') + .replace(reUnescapeComments, '#').trim(); + + var regexp = false; + + if (typeof rule === 'string' && rule.substring(0, 1) === ':') { + rule = rule.substring(1); + utils.log.error('RegExp no longer supported: ' + rule); + regexp = true; + } else if (rule.length === 0) { + // blank line (or it was a comment) + return; + } + + if (regexp) { + // rules[which].push(rule); + } else { + // rule = rule.replace(reEscapeChars, '\\$&') + // .replace(reAsterisk, '.*'); + + rules[which].push(rule); + // compile a regexp of all the rules for this ignore or watch + var re = rules[which].map(function (rule) { + return rule.replace(reEscapeChars, '\\$&') + .replace(reAsterisk, '.*'); + }).join('|'); + + // used for the directory matching + rules[which].re = new RegExp(re); + } +} diff --git a/.pnpm-store/v10/files/1c/41547dd5dff618835bbf2bd0f1fa8e1f4ee207fb424cb85c78cd506ae7bba8c868d72945eea4b1571f328002ff0eac7a5291e55191afde62af0f39269c30b4 b/.pnpm-store/v10/files/1c/41547dd5dff618835bbf2bd0f1fa8e1f4ee207fb424cb85c78cd506ae7bba8c868d72945eea4b1571f328002ff0eac7a5291e55191afde62af0f39269c30b4 new file mode 100644 index 0000000..9fcd4c6 --- /dev/null +++ b/.pnpm-store/v10/files/1c/41547dd5dff618835bbf2bd0f1fa8e1f4ee207fb424cb85c78cd506ae7bba8c868d72945eea4b1571f328002ff0eac7a5291e55191afde62af0f39269c30b4 @@ -0,0 +1,491 @@ +# body-parser + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js body parsing middleware. + +Parse incoming request bodies in a middleware before your handlers, available +under the `req.body` property. + +**Note** As `req.body`'s shape is based on user-controlled input, all +properties and values in this object are untrusted and should be validated +before trusting. For example, `req.body.foo.toString()` may fail in multiple +ways, for example the `foo` property may not be there or may not be a string, +and `toString` may not be a function and instead a string or other user input. + +[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). + +_This does not handle multipart bodies_, due to their complex and typically +large nature. For multipart bodies, you may be interested in the following +modules: + + * [busboy](https://www.npmjs.org/package/busboy#readme) and + [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.org/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.org/package/formidable#readme) + * [multer](https://www.npmjs.org/package/multer#readme) + +This module provides the following parsers: + + * [JSON body parser](#bodyparserjsonoptions) + * [Raw body parser](#bodyparserrawoptions) + * [Text body parser](#bodyparsertextoptions) + * [URL-encoded form body parser](#bodyparserurlencodedoptions) + +Other body parsers you might be interested in: + +- [body](https://www.npmjs.org/package/body#readme) +- [co-body](https://www.npmjs.org/package/co-body#readme) + +## Installation + +```sh +$ npm install body-parser +``` + +## API + +```js +const bodyParser = require('body-parser') +``` + +The `bodyParser` object exposes various factories to create middlewares. All +middlewares will populate the `req.body` property with the parsed body when +the `Content-Type` request header matches the `type` option. + +The various errors returned by this module are described in the +[errors section](#errors). + +### bodyParser.json([options]) + +Returns middleware that only parses `json` and only looks at requests where +the `Content-Type` header matches the `type` option. This parser accepts any +Unicode encoding of the body and supports automatic inflation of `gzip`, +`br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). + +#### Options + +The `json` function takes an optional `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### reviver + +The `reviver` option is passed directly to `JSON.parse` as the second +argument. You can find more information on this argument +[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). + +##### strict + +When set to `true`, will only accept arrays and objects; when `false` will +accept anything `JSON.parse` accepts. Defaults to `true`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not a +function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `json`), a mime type (like `application/json`), or +a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a truthy +value. Defaults to `application/json`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.raw([options]) + +Returns middleware that parses all bodies as a `Buffer` and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a `Buffer` object +of the body. + +#### Options + +The `raw` function takes an optional `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. +If not a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this +can be an extension name (like `bin`), a mime type (like +`application/octet-stream`), or a mime type with a wildcard (like `*/*` or +`application/*`). If a function, the `type` option is called as `fn(req)` +and the request is parsed if it returns a truthy value. Defaults to +`application/octet-stream`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.text([options]) + +Returns middleware that parses all bodies as a string and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` string containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a string of the +body. + +#### Options + +The `text` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the text content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `txt`), a mime type (like `text/plain`), or a mime +type with a wildcard (like `*/*` or `text/*`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a +truthy value. Defaults to `text/plain`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.urlencoded([options]) + +Returns middleware that only parses `urlencoded` bodies and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser accepts only UTF-8 encoding of the body and supports automatic +inflation of `gzip`, `br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This object will contain +key-value pairs, where the value can be a string or array (when `extended` is +`false`), or any type (when `extended` is `true`). + +#### Options + +The `urlencoded` function takes an optional `options` object that may contain +any of the following keys: + +##### extended + +The "extended" syntax allows for rich objects and arrays to be encoded into the +URL-encoded format, allowing for a JSON-like experience with URL-encoded. For +more information, please [see the qs +library](https://www.npmjs.org/package/qs#readme). + +Defaults to `false`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### parameterLimit + +The `parameterLimit` option controls the maximum number of parameters that +are allowed in the URL-encoded data. If a request contains more parameters +than this value, a 413 will be returned to the client. Defaults to `1000`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `urlencoded`), a mime type (like +`application/x-www-form-urlencoded`), or a mime type with a wildcard (like +`*/x-www-form-urlencoded`). If a function, the `type` option is called as +`fn(req)` and the request is parsed if it returns a truthy value. Defaults +to `application/x-www-form-urlencoded`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +##### defaultCharset + +The default charset to parse as, if not specified in content-type. Must be +either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. + +##### charsetSentinel + +Whether to let the value of the `utf8` parameter take precedence as the charset +selector. It requires the form to contain a parameter named `utf8` with a value +of `✓`. Defaults to `false`. + +##### interpretNumericEntities + +Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 +form. Defaults to `false`. + + +#### depth + +The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. + +## Errors + +The middlewares provided by this module create errors using the +[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors +will typically have a `status`/`statusCode` property that contains the suggested +HTTP response code, an `expose` property to determine if the `message` property +should be displayed to the client, a `type` property to determine the type of +error without matching against the `message`, and a `body` property containing +the read body, if available. + +The following are the common errors created, though any error can come through +for various reasons. + +### content encoding unsupported + +This error will occur when the request had a `Content-Encoding` header that +contained an encoding but the "inflation" option was set to `false`. The +`status` property is set to `415`, the `type` property is set to +`'encoding.unsupported'`, and the `charset` property will be set to the +encoding that is unsupported. + +### entity parse failed + +This error will occur when the request contained an entity that could not be +parsed by the middleware. The `status` property is set to `400`, the `type` +property is set to `'entity.parse.failed'`, and the `body` property is set to +the entity value that failed parsing. + +### entity verify failed + +This error will occur when the request contained an entity that could not be +failed verification by the defined `verify` option. The `status` property is +set to `403`, the `type` property is set to `'entity.verify.failed'`, and the +`body` property is set to the entity value that failed verification. + +### request aborted + +This error will occur when the request is aborted by the client before reading +the body has finished. The `received` property will be set to the number of +bytes received before the request was aborted and the `expected` property is +set to the number of expected bytes. The `status` property is set to `400` +and `type` property is set to `'request.aborted'`. + +### request entity too large + +This error will occur when the request body's size is larger than the "limit" +option. The `limit` property will be set to the byte limit and the `length` +property will be set to the request body's length. The `status` property is +set to `413` and the `type` property is set to `'entity.too.large'`. + +### request size did not match content length + +This error will occur when the request's length did not match the length from +the `Content-Length` header. This typically occurs when the request is malformed, +typically when the `Content-Length` header was calculated based on characters +instead of bytes. The `status` property is set to `400` and the `type` property +is set to `'request.size.invalid'`. + +### stream encoding should not be set + +This error will occur when something called the `req.setEncoding` method prior +to this middleware. This module operates directly on bytes only and you cannot +call `req.setEncoding` when using this module. The `status` property is set to +`500` and the `type` property is set to `'stream.encoding.set'`. + +### stream is not readable + +This error will occur when the request is no longer readable when this middleware +attempts to read it. This typically means something other than a middleware from +this module read the request body already and the middleware was also configured to +read the same request. The `status` property is set to `500` and the `type` +property is set to `'stream.not.readable'`. + +### too many parameters + +This error will occur when the content of the request exceeds the configured +`parameterLimit` for the `urlencoded` parser. The `status` property is set to +`413` and the `type` property is set to `'parameters.too.many'`. + +### unsupported charset "BOGUS" + +This error will occur when the request had a charset parameter in the +`Content-Type` header, but the `iconv-lite` module does not support it OR the +parser does not support it. The charset is contained in the message as well +as in the `charset` property. The `status` property is set to `415`, the +`type` property is set to `'charset.unsupported'`, and the `charset` property +is set to the charset that is unsupported. + +### unsupported content encoding "bogus" + +This error will occur when the request had a `Content-Encoding` header that +contained an unsupported encoding. The encoding is contained in the message +as well as in the `encoding` property. The `status` property is set to `415`, +the `type` property is set to `'encoding.unsupported'`, and the `encoding` +property is set to the encoding that is unsupported. + +### The input exceeded the depth + +This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. + +## Examples + +### Express/Connect top-level generic + +This example demonstrates adding a generic JSON and URL-encoded parser as a +top-level middleware, which will parse the bodies of all incoming requests. +This is the simplest setup. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse application/x-www-form-urlencoded +app.use(bodyParser.urlencoded()) + +// parse application/json +app.use(bodyParser.json()) + +app.use(function (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.write('you posted:\n') + res.end(String(JSON.stringify(req.body, null, 2))) +}) +``` + +### Express route-specific + +This example demonstrates adding body parsers specifically to the routes that +need them. In general, this is the most recommended way to use body-parser with +Express. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// create application/json parser +const jsonParser = bodyParser.json() + +// create application/x-www-form-urlencoded parser +const urlencodedParser = bodyParser.urlencoded() + +// POST /login gets urlencoded bodies +app.post('/login', urlencodedParser, function (req, res) { + if (!req.body || !req.body.username) res.sendStatus(400) + res.send('welcome, ' + req.body.username) +}) + +// POST /api/users gets JSON bodies +app.post('/api/users', jsonParser, function (req, res) { + if (!req.body) res.sendStatus(400) + // create user in req.body +}) +``` + +### Change accepted type for parsers + +All the parsers accept a `type` option which allows you to change the +`Content-Type` that the middleware will parse. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse various different custom JSON types as JSON +app.use(bodyParser.json({ type: 'application/*+json' })) + +// parse some custom thing into a Buffer +app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) + +// parse an HTML body into a string +app.use(bodyParser.text({ type: 'text/html' })) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci +[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master +[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master +[node-version-image]: https://badgen.net/npm/node/body-parser +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/body-parser +[npm-url]: https://npmjs.org/package/body-parser +[npm-version-image]: https://badgen.net/npm/v/body-parser +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser \ No newline at end of file diff --git a/.pnpm-store/v10/files/1c/acd9111b9eb27a0fd326dd19d61bdf767e443ee1dd09d983af81199ecda0d7cf047fbd18b900c7d773972b1278d5d3c19fa753591333c04c27ddac71af6422 b/.pnpm-store/v10/files/1c/acd9111b9eb27a0fd326dd19d61bdf767e443ee1dd09d983af81199ecda0d7cf047fbd18b900c7d773972b1278d5d3c19fa753591333c04c27ddac71af6422 new file mode 100644 index 0000000..cab251c --- /dev/null +++ b/.pnpm-store/v10/files/1c/acd9111b9eb27a0fd326dd19d61bdf767e443ee1dd09d983af81199ecda0d7cf047fbd18b900c7d773972b1278d5d3c19fa753591333c04c27ddac71af6422 @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.pnpm-store/v10/files/1d/0a9ee6df0971fb3509621a6e4d79d17740875eb38009f46d1ff538d460a73fba5c6be0aa517042746b03acfc3824d478bcc8beeba64d28a00da4db14a03d61 b/.pnpm-store/v10/files/1d/0a9ee6df0971fb3509621a6e4d79d17740875eb38009f46d1ff538d460a73fba5c6be0aa517042746b03acfc3824d478bcc8beeba64d28a00da4db14a03d61 new file mode 100644 index 0000000..e4bdc1e --- /dev/null +++ b/.pnpm-store/v10/files/1d/0a9ee6df0971fb3509621a6e4d79d17740875eb38009f46d1ff538d460a73fba5c6be0aa517042746b03acfc3824d478bcc8beeba64d28a00da4db14a03d61 @@ -0,0 +1,43 @@ +{ + "name": "negotiator", + "description": "HTTP content negotiation", + "version": "1.0.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Federico Romero ", + "Isaac Z. Schlueter (http://blog.izs.me/)" + ], + "license": "MIT", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "repository": "jshttp/negotiator", + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "index.js", + "README.md" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/.pnpm-store/v10/files/1d/69cd612baaf0633c33383768f30b322bb384af901c7d64c8813f4b497ec414354ee075789a54f68dd7c3ff581c44e1e39afd247e14ed7dcec3c5c33f01a589 b/.pnpm-store/v10/files/1d/69cd612baaf0633c33383768f30b322bb384af901c7d64c8813f4b497ec414354ee075789a54f68dd7c3ff581c44e1e39afd247e14ed7dcec3c5c33f01a589 new file mode 100644 index 0000000..da23e63 --- /dev/null +++ b/.pnpm-store/v10/files/1d/69cd612baaf0633c33383768f30b322bb384af901c7d64c8813f4b497ec414354ee075789a54f68dd7c3ff581c44e1e39afd247e14ed7dcec3c5c33f01a589 @@ -0,0 +1,26 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); + +test('quoteStyle option', function (t) { + t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); + + t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"'); + t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"'); + + t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"'); + t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"'); + + t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"'); + t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"'); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/1e/094b22a6fefec5df527ad45f90242ee1273d48575e2836fe75da96a5f3e398eb544c2dfa89f0b79249c973c0ae5709bbec2232f545bdd46280297e665cbf17 b/.pnpm-store/v10/files/1e/094b22a6fefec5df527ad45f90242ee1273d48575e2836fe75da96a5f3e398eb544c2dfa89f0b79249c973c0ae5709bbec2232f545bdd46280297e665cbf17 new file mode 100644 index 0000000..b0526e2 --- /dev/null +++ b/.pnpm-store/v10/files/1e/094b22a6fefec5df527ad45f90242ee1273d48575e2836fe75da96a5f3e398eb544c2dfa89f0b79249c973c0ae5709bbec2232f545bdd46280297e665cbf17 @@ -0,0 +1,708 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/.pnpm-store/v10/files/1e/231f122dd8e06f162c046d2b3e429f92544ee6d117371716f5142092e01ca92a515fae0ff62dd28f84215e2cceb3cb8e44f759074f27644be92d6e0bf971d1 b/.pnpm-store/v10/files/1e/231f122dd8e06f162c046d2b3e429f92544ee6d117371716f5142092e01ca92a515fae0ff62dd28f84215e2cceb3cb8e44f759074f27644be92d6e0bf971d1 new file mode 100644 index 0000000..e6c51be --- /dev/null +++ b/.pnpm-store/v10/files/1e/231f122dd8e06f162c046d2b3e429f92544ee6d117371716f5142092e01ca92a515fae0ff62dd28f84215e2cceb3cb8e44f759074f27644be92d6e0bf971d1 @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./Reflect.getPrototypeOf')} */ +module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; diff --git a/.pnpm-store/v10/files/1e/5b08112c6fa47371fc25e7d629ac1b3b3808f591dab4b3dd2eab0cf3a6dc0d40fcfb37be80397d3d7ad240d00d9332c3ce646651b25d3a5087f8935ae155fb b/.pnpm-store/v10/files/1e/5b08112c6fa47371fc25e7d629ac1b3b3808f591dab4b3dd2eab0cf3a6dc0d40fcfb37be80397d3d7ad240d00d9332c3ce646651b25d3a5087f8935ae155fb new file mode 100644 index 0000000..9cf48f5 --- /dev/null +++ b/.pnpm-store/v10/files/1e/5b08112c6fa47371fc25e7d629ac1b3b3808f591dab4b3dd2eab0cf3a6dc0d40fcfb37be80397d3d7ad240d00d9332c3ce646651b25d3a5087f8935ae155fb @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18 + +### Commits + +- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130) +- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d) +- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec) + +## v1.0.0 - 2024-12-11 + +### Commits + +- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe) +- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c) +- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5) +- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2) +- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd) diff --git a/.pnpm-store/v10/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f b/.pnpm-store/v10/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f new file mode 100644 index 0000000..5d3d200 --- /dev/null +++ b/.pnpm-store/v10/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f @@ -0,0 +1,5 @@ +'use strict' + +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/.pnpm-store/v10/files/1f/4631349732151413a8b58502096b46011cb5d2dfe799b54cb034944922438652bb50bfe61220914ba49faeb903c9dcf610eed66083d4b87dc90cbaa7d3867a b/.pnpm-store/v10/files/1f/4631349732151413a8b58502096b46011cb5d2dfe799b54cb034944922438652bb50bfe61220914ba49faeb903c9dcf610eed66083d4b87dc90cbaa7d3867a new file mode 100644 index 0000000..e111100 --- /dev/null +++ b/.pnpm-store/v10/files/1f/4631349732151413a8b58502096b46011cb5d2dfe799b54cb034944922438652bb50bfe61220914ba49faeb903c9dcf610eed66083d4b87dc90cbaa7d3867a @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); +var $Map = GetIntrinsic('%Map%', true); + +/** @type {(thisArg: Map, key: K) => V} */ +var $mapGet = callBound('Map.prototype.get', true); +/** @type {(thisArg: Map, key: K, value: V) => void} */ +var $mapSet = callBound('Map.prototype.set', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapHas = callBound('Map.prototype.has', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapDelete = callBound('Map.prototype.delete', true); +/** @type {(thisArg: Map) => number} */ +var $mapSize = callBound('Map.prototype.size', true); + +/** @type {import('.')} */ +module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {Map | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { // eslint-disable-line consistent-return + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + // @ts-expect-error TS can't handle narrowing a variable inside a closure + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + + // @ts-expect-error TODO: figure out why TS is erroring here + return channel; +}; diff --git a/.pnpm-store/v10/files/20/4328c949617dcc798259adf088726dd6d5fa9c4603fa5696a81112e5d62c893d9be01939b446d109043e70f5d5cb4988e2fde93cc184b444c043ef7683959c b/.pnpm-store/v10/files/20/4328c949617dcc798259adf088726dd6d5fa9c4603fa5696a81112e5d62c893d9be01939b446d109043e70f5d5cb4988e2fde93cc184b444c043ef7683959c new file mode 100644 index 0000000..ce1bc2a --- /dev/null +++ b/.pnpm-store/v10/files/20/4328c949617dcc798259adf088726dd6d5fa9c4603fa5696a81112e5d62c893d9be01939b446d109043e70f5d5cb4988e2fde93cc184b444c043ef7683959c @@ -0,0 +1,15 @@ +declare namespace getSideChannelWeakMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + } +} + +declare function getSideChannelWeakMap(): getSideChannelWeakMap.Channel; + +declare const x: false | typeof getSideChannelWeakMap; + +export = x; diff --git a/.pnpm-store/v10/files/20/703cb9a02ff3d57b5c5d22ca56e86d59eff0ad59711b6c5010da69dfd0d1a7332534c740335f7079d07792151cd03e92d360dbdcbc29fc165165a200c46f5f b/.pnpm-store/v10/files/20/703cb9a02ff3d57b5c5d22ca56e86d59eff0ad59711b6c5010da69dfd0d1a7332534c740335f7079d07792151cd03e92d360dbdcbc29fc165165a200c46f5f new file mode 100644 index 0000000..b504611 --- /dev/null +++ b/.pnpm-store/v10/files/20/703cb9a02ff3d57b5c5d22ca56e86d59eff0ad59711b6c5010da69dfd0d1a7332534c740335f7079d07792151cd03e92d360dbdcbc29fc165165a200c46f5f @@ -0,0 +1,85 @@ +declare namespace getRawBody { + export type Encoding = string | true; + + export interface Options { + /** + * The expected length of the stream. + */ + length?: number | string | null; + /** + * The byte limit of the body. This is the number of bytes or any string + * format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`. + */ + limit?: number | string | null; + /** + * The encoding to use to decode the body into a string. By default, a + * `Buffer` instance will be returned when no encoding is specified. Most + * likely, you want `utf-8`, so setting encoding to `true` will decode as + * `utf-8`. You can use any type of encoding supported by `iconv-lite`. + */ + encoding?: Encoding | null; + } + + export interface RawBodyError extends Error { + /** + * The limit in bytes. + */ + limit?: number; + /** + * The expected length of the stream. + */ + length?: number; + expected?: number; + /** + * The received bytes. + */ + received?: number; + /** + * The encoding. + */ + encoding?: string; + /** + * The corresponding status code for the error. + */ + status: number; + statusCode: number; + /** + * The error type. + */ + type: string; + } +} + +/** + * Gets the entire buffer of a stream either as a `Buffer` or a string. + * Validates the stream's length against an expected length and maximum + * limit. Ideal for parsing request bodies. + */ +declare function getRawBody( + stream: NodeJS.ReadableStream, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, + callback: (err: getRawBody.RawBodyError, body: string) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: getRawBody.Options, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding +): Promise; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options?: getRawBody.Options +): Promise; + +export = getRawBody; diff --git a/.pnpm-store/v10/files/22/03964acd4d091abe4539705942b10cc6c682f0feaa2bcfaeb1451b4d538ac4eed8517eb8aa5002968e32fdf353c9df9b6cedcb3ed63a4219da1f56c67e3b05 b/.pnpm-store/v10/files/22/03964acd4d091abe4539705942b10cc6c682f0feaa2bcfaeb1451b4d538ac4eed8517eb8aa5002968e32fdf353c9df9b6cedcb3ed63a4219da1f56c67e3b05 new file mode 100644 index 0000000..141cb57 --- /dev/null +++ b/.pnpm-store/v10/files/22/03964acd4d091abe4539705942b10cc6c682f0feaa2bcfaeb1451b4d538ac4eed8517eb8aa5002968e32fdf353c9df9b6cedcb3ed63a4219da1f56c67e3b05 @@ -0,0 +1,292 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(/\s+/g, ',') + .split(',') + .filter(Boolean); + + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; // No match + } + } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/.pnpm-store/v10/files/22/1531de721d423807f8d2662863ebd3f2609e9fd185840d43c95b04002cbee79279b5a93b2a239f432190761e8b620c2a088254bc45db5f5334010fe11ea99d b/.pnpm-store/v10/files/22/1531de721d423807f8d2662863ebd3f2609e9fd185840d43c95b04002cbee79279b5a93b2a239f432190761e8b620c2a088254bc45db5f5334010fe11ea99d new file mode 100644 index 0000000..e11deba --- /dev/null +++ b/.pnpm-store/v10/files/22/1531de721d423807f8d2662863ebd3f2609e9fd185840d43c95b04002cbee79279b5a93b2a239f432190761e8b620c2a088254bc45db5f5334010fe11ea99d @@ -0,0 +1,44 @@ +import os from 'os'; +import path from 'path'; +import fs from 'fs'; + +const homeDirectory = os.homedir(); +const configDir = + process.env.XDG_CONFIG_HOME || + path.join(homeDirectory, '.config', 'simple-update-notifier'); + +const getConfigFile = (packageName: string) => { + return path.join( + configDir, + `${packageName.replace('@', '').replace('/', '__')}.json` + ); +}; + +export const createConfigDir = () => { + if (!fs.existsSync(configDir)) { + fs.mkdirSync(configDir, { recursive: true }); + } +}; + +export const getLastUpdate = (packageName: string) => { + const configFile = getConfigFile(packageName); + + try { + if (!fs.existsSync(configFile)) { + return undefined; + } + const file = JSON.parse(fs.readFileSync(configFile, 'utf8')); + return file.lastUpdateCheck as number; + } catch { + return undefined; + } +}; + +export const saveLastUpdate = (packageName: string) => { + const configFile = getConfigFile(packageName); + + fs.writeFileSync( + configFile, + JSON.stringify({ lastUpdateCheck: new Date().getTime() }) + ); +}; diff --git a/.pnpm-store/v10/files/22/369cc02af1d2a345a70a415de9e690f3f14ad6567f216924bf05dcf01dbbde7c6b3a08cf87d5edf1ca3b5a793d504e532f3a7c828964e97024334135b57369 b/.pnpm-store/v10/files/22/369cc02af1d2a345a70a415de9e690f3f14ad6567f216924bf05dcf01dbbde7c6b3a08cf87d5edf1ca3b5a793d504e532f3a7c828964e97024334135b57369 new file mode 100644 index 0000000..0314929 --- /dev/null +++ b/.pnpm-store/v10/files/22/369cc02af1d2a345a70a415de9e690f3f14ad6567f216924bf05dcf01dbbde7c6b3a08cf87d5edf1ca3b5a793d504e532f3a7c828964e97024334135b57369 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Jordan Harband and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.pnpm-store/v10/files/22/3ee1a0a0dee9593e85fd914dfcf4ba9450b5ca0f0bae2980f532128074a68bc53ab722911f3e6084730d391cc707ab72d5eb70adb0b6b236643c68d83c75f0 b/.pnpm-store/v10/files/22/3ee1a0a0dee9593e85fd914dfcf4ba9450b5ca0f0bae2980f532128074a68bc53ab722911f3e6084730d391cc707ab72d5eb70adb0b6b236643c68d83c75f0 new file mode 100644 index 0000000..f2891bd --- /dev/null +++ b/.pnpm-store/v10/files/22/3ee1a0a0dee9593e85fd914dfcf4ba9450b5ca0f0bae2980f532128074a68bc53ab722911f3e6084730d391cc707ab72d5eb70adb0b6b236643c68d83c75f0 @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-map +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.pnpm-store/v10/files/22/5048fde7057c55ac4dfb5daf8a5c42890a2580443993a1656db80720311b83501242164654146d71d028f3bba8ab2716296fd7a6dec1fc49f1b371a8d613e5 b/.pnpm-store/v10/files/22/5048fde7057c55ac4dfb5daf8a5c42890a2580443993a1656db80720311b83501242164654146d71d028f3bba8ab2716296fd7a6dec1fc49f1b371a8d613e5 new file mode 100644 index 0000000..82af4df --- /dev/null +++ b/.pnpm-store/v10/files/22/5048fde7057c55ac4dfb5daf8a5c42890a2580443993a1656db80720311b83501242164654146d71d028f3bba8ab2716296fd7a6dec1fc49f1b371a8d613e5 @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/.pnpm-store/v10/files/23/a4e3405e61759f6cf2e392cb71be40f8792b9a304f64d2379f6e7de7c4d3ae1fd413369fdd4b3b73df43cb61063a31d6dd4a27b026cce276df7ae4badf2dfe b/.pnpm-store/v10/files/23/a4e3405e61759f6cf2e392cb71be40f8792b9a304f64d2379f6e7de7c4d3ae1fd413369fdd4b3b73df43cb61063a31d6dd4a27b026cce276df7ae4badf2dfe new file mode 100644 index 0000000..078ce71 --- /dev/null +++ b/.pnpm-store/v10/files/23/a4e3405e61759f6cf2e392cb71be40f8792b9a304f64d2379f6e7de7c4d3ae1fd413369fdd4b3b73df43cb61063a31d6dd4a27b026cce276df7ae4badf2dfe @@ -0,0 +1,206 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('body-parser:json') +var isFinished = require('on-finished').isFinished +var read = require('../read') +var typeis = require('type-is') +var { getCharset, normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = json + +/** + * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return + */ + +var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex + +var JSON_SYNTAX_CHAR = '#' +var JSON_SYNTAX_REGEXP = /#+/g + +/** + * Create a middleware to parse JSON bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function json (options) { + var { inflate, limit, verify, shouldParse } = normalizeOptions(options, 'application/json') + + var reviver = options?.reviver + var strict = options?.strict !== false + + function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + if (strict) { + var first = firstchar(body) + + if (first !== '{' && first !== '[') { + debug('strict violation') + throw createStrictSyntaxError(body, first) + } + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } + + return function jsonParser (req, res, next) { + if (isFinished(req)) { + debug('body already parsed') + next() + return + } + + if (!('body' in req)) { + req.body = undefined + } + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset per RFC 7159 sec 8.1 + var charset = getCharset(req) || 'utf-8' + if (charset.slice(0, 4) !== 'utf-') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate, + limit, + verify + }) + } +} + +/** + * Create strict violation syntax error matching native error. + * + * @param {string} str + * @param {string} char + * @return {Error} + * @private + */ + +function createStrictSyntaxError (str, char) { + var index = str.indexOf(char) + var partial = '' + + if (index !== -1) { + partial = str.substring(0, index) + JSON_SYNTAX_CHAR + + for (var i = index + 1; i < str.length; i++) { + partial += JSON_SYNTAX_CHAR + } + } + + try { + JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { + return str.substring(index, index + placeholder.length) + }), + stack: e.stack + }) + } +} + +/** + * Get the first non-whitespace character in a string. + * + * @param {string} str + * @return {function} + * @private + */ + +function firstchar (str) { + var match = FIRST_CHAR_REGEXP.exec(str) + + return match + ? match[1] + : undefined +} + +/** + * Normalize a SyntaxError for JSON.parse. + * + * @param {SyntaxError} error + * @param {object} obj + * @return {SyntaxError} + */ + +function normalizeJsonSyntaxError (error, obj) { + var keys = Object.getOwnPropertyNames(error) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key !== 'stack' && key !== 'message') { + delete error[key] + } + } + + // replace stack before message for Node.js 0.10 and below + error.stack = obj.stack.replace(error.message, obj.message) + error.message = obj.message + + return error +} diff --git a/.pnpm-store/v10/files/23/c0c88df401180b8e6032b15af94144b8b9c8ea9b84032202a12c5a02b9aaba605cdc48f74b9d9d7a71bd407098072d1d140c29ee3bb653f71f640c4a100be5 b/.pnpm-store/v10/files/23/c0c88df401180b8e6032b15af94144b8b9c8ea9b84032202a12c5a02b9aaba605cdc48f74b9d9d7a71bd407098072d1d140c29ee3bb653f71f640c4a100be5 new file mode 100644 index 0000000..e0a2925 --- /dev/null +++ b/.pnpm-store/v10/files/23/c0c88df401180b8e6032b15af94144b8b9c8ea9b84032202a12c5a02b9aaba605cdc48f74b9d9d7a71bd407098072d1d140c29ee3bb653f71f640c4a100be5 @@ -0,0 +1,14 @@ +'use strict'; + +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +module.exports = $defineProperty; diff --git a/.pnpm-store/v10/files/24/1cc339c25ea867228ff824889d6cd7ad75328466522ac757c188ece50ebe80adff20d5d6d0296516dd7fba0839b1cb587812e0509f15aede0e45bed610d84a b/.pnpm-store/v10/files/24/1cc339c25ea867228ff824889d6cd7ad75328466522ac757c188ece50ebe80adff20d5d6d0296516dd7fba0839b1cb587812e0509f15aede0e45bed610d84a new file mode 100644 index 0000000..0ff6100 --- /dev/null +++ b/.pnpm-store/v10/files/24/1cc339c25ea867228ff824889d6cd7ad75328466522ac757c188ece50ebe80adff20d5d6d0296516dd7fba0839b1cb587812e0509f15aede0e45bed610d84a @@ -0,0 +1,559 @@ +const dangerouslyDisableDefaultSrc = Symbol("dangerouslyDisableDefaultSrc") +const SHOULD_BE_QUOTED = new Set(["none", "self", "strict-dynamic", "report-sample", "inline-speculation-rules", "unsafe-inline", "unsafe-eval", "unsafe-hashes", "wasm-unsafe-eval"]) +const getDefaultDirectives = () => ({ + "default-src": ["'self'"], + "base-uri": ["'self'"], + "font-src": ["'self'", "https:", "data:"], + "form-action": ["'self'"], + "frame-ancestors": ["'self'"], + "img-src": ["'self'", "data:"], + "object-src": ["'none'"], + "script-src": ["'self'"], + "script-src-attr": ["'none'"], + "style-src": ["'self'", "https:", "'unsafe-inline'"], + "upgrade-insecure-requests": [] +}) +const dashify = str => str.replace(/[A-Z]/g, capitalLetter => "-" + capitalLetter.toLowerCase()) +const assertDirectiveValueIsValid = (directiveName, directiveValue) => { + if (/;|,/.test(directiveValue)) { + throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`) + } +} +const assertDirectiveValueEntryIsValid = (directiveName, directiveValueEntry) => { + if (SHOULD_BE_QUOTED.has(directiveValueEntry) || directiveValueEntry.startsWith("nonce-") || directiveValueEntry.startsWith("sha256-") || directiveValueEntry.startsWith("sha384-") || directiveValueEntry.startsWith("sha512-")) { + throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}. ${JSON.stringify(directiveValueEntry)} should be quoted`) + } +} +function normalizeDirectives(options) { + const defaultDirectives = getDefaultDirectives() + const {useDefaults = true, directives: rawDirectives = defaultDirectives} = options + const result = new Map() + const directiveNamesSeen = new Set() + const directivesExplicitlyDisabled = new Set() + for (const rawDirectiveName in rawDirectives) { + if (!Object.hasOwn(rawDirectives, rawDirectiveName)) { + continue + } + if (rawDirectiveName.length === 0 || /[^a-zA-Z0-9-]/.test(rawDirectiveName)) { + throw new Error(`Content-Security-Policy received an invalid directive name ${JSON.stringify(rawDirectiveName)}`) + } + const directiveName = dashify(rawDirectiveName) + if (directiveNamesSeen.has(directiveName)) { + throw new Error(`Content-Security-Policy received a duplicate directive ${JSON.stringify(directiveName)}`) + } + directiveNamesSeen.add(directiveName) + const rawDirectiveValue = rawDirectives[rawDirectiveName] + let directiveValue + if (rawDirectiveValue === null) { + if (directiveName === "default-src") { + throw new Error("Content-Security-Policy needs a default-src but it was set to `null`. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.") + } + directivesExplicitlyDisabled.add(directiveName) + continue + } else if (typeof rawDirectiveValue === "string") { + directiveValue = [rawDirectiveValue] + } else if (!rawDirectiveValue) { + throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`) + } else if (rawDirectiveValue === dangerouslyDisableDefaultSrc) { + if (directiveName === "default-src") { + directivesExplicitlyDisabled.add("default-src") + continue + } else { + throw new Error(`Content-Security-Policy: tried to disable ${JSON.stringify(directiveName)} as if it were default-src; simply omit the key`) + } + } else { + directiveValue = rawDirectiveValue + } + for (const element of directiveValue) { + if (typeof element !== "string") continue + assertDirectiveValueIsValid(directiveName, element) + assertDirectiveValueEntryIsValid(directiveName, element) + } + result.set(directiveName, directiveValue) + } + if (useDefaults) { + Object.entries(defaultDirectives).forEach(([defaultDirectiveName, defaultDirectiveValue]) => { + if (!result.has(defaultDirectiveName) && !directivesExplicitlyDisabled.has(defaultDirectiveName)) { + result.set(defaultDirectiveName, defaultDirectiveValue) + } + }) + } + if (!result.size) { + throw new Error("Content-Security-Policy has no directives. Either set some or disable the header") + } + if (!result.has("default-src") && !directivesExplicitlyDisabled.has("default-src")) { + throw new Error("Content-Security-Policy needs a default-src but none was provided. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.") + } + return result +} +function getHeaderValue(req, res, normalizedDirectives) { + const result = [] + for (const [directiveName, rawDirectiveValue] of normalizedDirectives) { + let directiveValue = "" + for (const element of rawDirectiveValue) { + if (typeof element === "function") { + const newElement = element(req, res) + assertDirectiveValueEntryIsValid(directiveName, newElement) + directiveValue += " " + newElement + } else { + directiveValue += " " + element + } + } + if (directiveValue) { + assertDirectiveValueIsValid(directiveName, directiveValue) + result.push(`${directiveName}${directiveValue}`) + } else { + result.push(directiveName) + } + } + return result.join(";") +} +const contentSecurityPolicy = function contentSecurityPolicy(options = {}) { + const headerName = options.reportOnly ? "Content-Security-Policy-Report-Only" : "Content-Security-Policy" + const normalizedDirectives = normalizeDirectives(options) + return function contentSecurityPolicyMiddleware(req, res, next) { + const result = getHeaderValue(req, res, normalizedDirectives) + if (result instanceof Error) { + next(result) + } else { + res.setHeader(headerName, result) + next() + } + } +} +contentSecurityPolicy.getDefaultDirectives = getDefaultDirectives +contentSecurityPolicy.dangerouslyDisableDefaultSrc = dangerouslyDisableDefaultSrc + +const ALLOWED_POLICIES$2 = new Set(["require-corp", "credentialless", "unsafe-none"]) +function getHeaderValueFromOptions$6({policy = "require-corp"}) { + if (ALLOWED_POLICIES$2.has(policy)) { + return policy + } else { + throw new Error(`Cross-Origin-Embedder-Policy does not support the ${JSON.stringify(policy)} policy`) + } +} +function crossOriginEmbedderPolicy(options = {}) { + const headerValue = getHeaderValueFromOptions$6(options) + return function crossOriginEmbedderPolicyMiddleware(_req, res, next) { + res.setHeader("Cross-Origin-Embedder-Policy", headerValue) + next() + } +} + +const ALLOWED_POLICIES$1 = new Set(["same-origin", "same-origin-allow-popups", "unsafe-none"]) +function getHeaderValueFromOptions$5({policy = "same-origin"}) { + if (ALLOWED_POLICIES$1.has(policy)) { + return policy + } else { + throw new Error(`Cross-Origin-Opener-Policy does not support the ${JSON.stringify(policy)} policy`) + } +} +function crossOriginOpenerPolicy(options = {}) { + const headerValue = getHeaderValueFromOptions$5(options) + return function crossOriginOpenerPolicyMiddleware(_req, res, next) { + res.setHeader("Cross-Origin-Opener-Policy", headerValue) + next() + } +} + +const ALLOWED_POLICIES = new Set(["same-origin", "same-site", "cross-origin"]) +function getHeaderValueFromOptions$4({policy = "same-origin"}) { + if (ALLOWED_POLICIES.has(policy)) { + return policy + } else { + throw new Error(`Cross-Origin-Resource-Policy does not support the ${JSON.stringify(policy)} policy`) + } +} +function crossOriginResourcePolicy(options = {}) { + const headerValue = getHeaderValueFromOptions$4(options) + return function crossOriginResourcePolicyMiddleware(_req, res, next) { + res.setHeader("Cross-Origin-Resource-Policy", headerValue) + next() + } +} + +function originAgentCluster() { + return function originAgentClusterMiddleware(_req, res, next) { + res.setHeader("Origin-Agent-Cluster", "?1") + next() + } +} + +const ALLOWED_TOKENS = new Set(["no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url", ""]) +function getHeaderValueFromOptions$3({policy = ["no-referrer"]}) { + const tokens = typeof policy === "string" ? [policy] : policy + if (tokens.length === 0) { + throw new Error("Referrer-Policy received no policy tokens") + } + const tokensSeen = new Set() + tokens.forEach(token => { + if (!ALLOWED_TOKENS.has(token)) { + throw new Error(`Referrer-Policy received an unexpected policy token ${JSON.stringify(token)}`) + } else if (tokensSeen.has(token)) { + throw new Error(`Referrer-Policy received a duplicate policy token ${JSON.stringify(token)}`) + } + tokensSeen.add(token) + }) + return tokens.join(",") +} +function referrerPolicy(options = {}) { + const headerValue = getHeaderValueFromOptions$3(options) + return function referrerPolicyMiddleware(_req, res, next) { + res.setHeader("Referrer-Policy", headerValue) + next() + } +} + +const DEFAULT_MAX_AGE = 365 * 24 * 60 * 60 +function parseMaxAge(value = DEFAULT_MAX_AGE) { + if (value >= 0 && Number.isFinite(value)) { + return Math.floor(value) + } else { + throw new Error(`Strict-Transport-Security: ${JSON.stringify(value)} is not a valid value for maxAge. Please choose a positive integer.`) + } +} +function getHeaderValueFromOptions$2(options) { + if ("maxage" in options) { + throw new Error("Strict-Transport-Security received an unsupported property, `maxage`. Did you mean to pass `maxAge`?") + } + if ("includeSubdomains" in options) { + throw new Error('Strict-Transport-Security middleware should use `includeSubDomains` instead of `includeSubdomains`. (The correct one has an uppercase "D".)') + } + const directives = [`max-age=${parseMaxAge(options.maxAge)}`] + if (options.includeSubDomains === undefined || options.includeSubDomains) { + directives.push("includeSubDomains") + } + if (options.preload) { + directives.push("preload") + } + return directives.join("; ") +} +function strictTransportSecurity(options = {}) { + const headerValue = getHeaderValueFromOptions$2(options) + return function strictTransportSecurityMiddleware(_req, res, next) { + res.setHeader("Strict-Transport-Security", headerValue) + next() + } +} + +function xContentTypeOptions() { + return function xContentTypeOptionsMiddleware(_req, res, next) { + res.setHeader("X-Content-Type-Options", "nosniff") + next() + } +} + +function xDnsPrefetchControl(options = {}) { + const headerValue = options.allow ? "on" : "off" + return function xDnsPrefetchControlMiddleware(_req, res, next) { + res.setHeader("X-DNS-Prefetch-Control", headerValue) + next() + } +} + +function xDownloadOptions() { + return function xDownloadOptionsMiddleware(_req, res, next) { + res.setHeader("X-Download-Options", "noopen") + next() + } +} + +function getHeaderValueFromOptions$1({action = "sameorigin"}) { + const normalizedAction = typeof action === "string" ? action.toUpperCase() : action + switch (normalizedAction) { + case "SAME-ORIGIN": + return "SAMEORIGIN" + case "DENY": + case "SAMEORIGIN": + return normalizedAction + default: + throw new Error(`X-Frame-Options received an invalid action ${JSON.stringify(action)}`) + } +} +function xFrameOptions(options = {}) { + const headerValue = getHeaderValueFromOptions$1(options) + return function xFrameOptionsMiddleware(_req, res, next) { + res.setHeader("X-Frame-Options", headerValue) + next() + } +} + +const ALLOWED_PERMITTED_POLICIES = new Set(["none", "master-only", "by-content-type", "all"]) +function getHeaderValueFromOptions({permittedPolicies = "none"}) { + if (ALLOWED_PERMITTED_POLICIES.has(permittedPolicies)) { + return permittedPolicies + } else { + throw new Error(`X-Permitted-Cross-Domain-Policies does not support ${JSON.stringify(permittedPolicies)}`) + } +} +function xPermittedCrossDomainPolicies(options = {}) { + const headerValue = getHeaderValueFromOptions(options) + return function xPermittedCrossDomainPoliciesMiddleware(_req, res, next) { + res.setHeader("X-Permitted-Cross-Domain-Policies", headerValue) + next() + } +} + +function xPoweredBy() { + return function xPoweredByMiddleware(_req, res, next) { + res.removeHeader("X-Powered-By") + next() + } +} + +function xXssProtection() { + return function xXssProtectionMiddleware(_req, res, next) { + res.setHeader("X-XSS-Protection", "0") + next() + } +} + +function getMiddlewareFunctionsFromOptions(options) { + const result = [] + switch (options.contentSecurityPolicy) { + case undefined: + case true: + result.push(contentSecurityPolicy()) + break + case false: + break + default: + result.push(contentSecurityPolicy(options.contentSecurityPolicy)) + break + } + switch (options.crossOriginEmbedderPolicy) { + case undefined: + case false: + break + case true: + result.push(crossOriginEmbedderPolicy()) + break + default: + result.push(crossOriginEmbedderPolicy(options.crossOriginEmbedderPolicy)) + break + } + switch (options.crossOriginOpenerPolicy) { + case undefined: + case true: + result.push(crossOriginOpenerPolicy()) + break + case false: + break + default: + result.push(crossOriginOpenerPolicy(options.crossOriginOpenerPolicy)) + break + } + switch (options.crossOriginResourcePolicy) { + case undefined: + case true: + result.push(crossOriginResourcePolicy()) + break + case false: + break + default: + result.push(crossOriginResourcePolicy(options.crossOriginResourcePolicy)) + break + } + switch (options.originAgentCluster) { + case undefined: + case true: + result.push(originAgentCluster()) + break + case false: + break + default: + console.warn("Origin-Agent-Cluster does not take options. Remove the property to silence this warning.") + result.push(originAgentCluster()) + break + } + switch (options.referrerPolicy) { + case undefined: + case true: + result.push(referrerPolicy()) + break + case false: + break + default: + result.push(referrerPolicy(options.referrerPolicy)) + break + } + if ("strictTransportSecurity" in options && "hsts" in options) { + throw new Error("Strict-Transport-Security option was specified twice. Remove `hsts` to silence this warning.") + } + const strictTransportSecurityOption = options.strictTransportSecurity ?? options.hsts + switch (strictTransportSecurityOption) { + case undefined: + case true: + result.push(strictTransportSecurity()) + break + case false: + break + default: + result.push(strictTransportSecurity(strictTransportSecurityOption)) + break + } + if ("xContentTypeOptions" in options && "noSniff" in options) { + throw new Error("X-Content-Type-Options option was specified twice. Remove `noSniff` to silence this warning.") + } + const xContentTypeOptionsOption = options.xContentTypeOptions ?? options.noSniff + switch (xContentTypeOptionsOption) { + case undefined: + case true: + result.push(xContentTypeOptions()) + break + case false: + break + default: + console.warn("X-Content-Type-Options does not take options. Remove the property to silence this warning.") + result.push(xContentTypeOptions()) + break + } + if ("xDnsPrefetchControl" in options && "dnsPrefetchControl" in options) { + throw new Error("X-DNS-Prefetch-Control option was specified twice. Remove `dnsPrefetchControl` to silence this warning.") + } + const xDnsPrefetchControlOption = options.xDnsPrefetchControl ?? options.dnsPrefetchControl + switch (xDnsPrefetchControlOption) { + case undefined: + case true: + result.push(xDnsPrefetchControl()) + break + case false: + break + default: + result.push(xDnsPrefetchControl(xDnsPrefetchControlOption)) + break + } + if ("xDownloadOptions" in options && "ieNoOpen" in options) { + throw new Error("X-Download-Options option was specified twice. Remove `ieNoOpen` to silence this warning.") + } + const xDownloadOptionsOption = options.xDownloadOptions ?? options.ieNoOpen + switch (xDownloadOptionsOption) { + case undefined: + case true: + result.push(xDownloadOptions()) + break + case false: + break + default: + console.warn("X-Download-Options does not take options. Remove the property to silence this warning.") + result.push(xDownloadOptions()) + break + } + if ("xFrameOptions" in options && "frameguard" in options) { + throw new Error("X-Frame-Options option was specified twice. Remove `frameguard` to silence this warning.") + } + const xFrameOptionsOption = options.xFrameOptions ?? options.frameguard + switch (xFrameOptionsOption) { + case undefined: + case true: + result.push(xFrameOptions()) + break + case false: + break + default: + result.push(xFrameOptions(xFrameOptionsOption)) + break + } + if ("xPermittedCrossDomainPolicies" in options && "permittedCrossDomainPolicies" in options) { + throw new Error("X-Permitted-Cross-Domain-Policies option was specified twice. Remove `permittedCrossDomainPolicies` to silence this warning.") + } + const xPermittedCrossDomainPoliciesOption = options.xPermittedCrossDomainPolicies ?? options.permittedCrossDomainPolicies + switch (xPermittedCrossDomainPoliciesOption) { + case undefined: + case true: + result.push(xPermittedCrossDomainPolicies()) + break + case false: + break + default: + result.push(xPermittedCrossDomainPolicies(xPermittedCrossDomainPoliciesOption)) + break + } + if ("xPoweredBy" in options && "hidePoweredBy" in options) { + throw new Error("X-Powered-By option was specified twice. Remove `hidePoweredBy` to silence this warning.") + } + const xPoweredByOption = options.xPoweredBy ?? options.hidePoweredBy + switch (xPoweredByOption) { + case undefined: + case true: + result.push(xPoweredBy()) + break + case false: + break + default: + console.warn("X-Powered-By does not take options. Remove the property to silence this warning.") + result.push(xPoweredBy()) + break + } + if ("xXssProtection" in options && "xssFilter" in options) { + throw new Error("X-XSS-Protection option was specified twice. Remove `xssFilter` to silence this warning.") + } + const xXssProtectionOption = options.xXssProtection ?? options.xssFilter + switch (xXssProtectionOption) { + case undefined: + case true: + result.push(xXssProtection()) + break + case false: + break + default: + console.warn("X-XSS-Protection does not take options. Remove the property to silence this warning.") + result.push(xXssProtection()) + break + } + return result +} +const helmet = Object.assign( + function helmet(options = {}) { + // People should be able to pass an options object with no prototype, + // so we want this optional chaining. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (options.constructor?.name === "IncomingMessage") { + throw new Error("It appears you have done something like `app.use(helmet)`, but it should be `app.use(helmet())`.") + } + const middlewareFunctions = getMiddlewareFunctionsFromOptions(options) + return function helmetMiddleware(req, res, next) { + let middlewareIndex = 0 + ;(function internalNext(err) { + if (err) { + next(err) + return + } + const middlewareFunction = middlewareFunctions[middlewareIndex] + if (middlewareFunction) { + middlewareIndex++ + middlewareFunction(req, res, internalNext) + } else { + next() + } + })() + } + }, + { + contentSecurityPolicy, + crossOriginEmbedderPolicy, + crossOriginOpenerPolicy, + crossOriginResourcePolicy, + originAgentCluster, + referrerPolicy, + strictTransportSecurity, + xContentTypeOptions, + xDnsPrefetchControl, + xDownloadOptions, + xFrameOptions, + xPermittedCrossDomainPolicies, + xPoweredBy, + xXssProtection, + // Legacy aliases + dnsPrefetchControl: xDnsPrefetchControl, + xssFilter: xXssProtection, + permittedCrossDomainPolicies: xPermittedCrossDomainPolicies, + ieNoOpen: xDownloadOptions, + noSniff: xContentTypeOptions, + frameguard: xFrameOptions, + hidePoweredBy: xPoweredBy, + hsts: strictTransportSecurity + } +) + +export {contentSecurityPolicy, crossOriginEmbedderPolicy, crossOriginOpenerPolicy, crossOriginResourcePolicy, helmet as default, xDnsPrefetchControl as dnsPrefetchControl, xFrameOptions as frameguard, xPoweredBy as hidePoweredBy, strictTransportSecurity as hsts, xDownloadOptions as ieNoOpen, xContentTypeOptions as noSniff, originAgentCluster, xPermittedCrossDomainPolicies as permittedCrossDomainPolicies, referrerPolicy, strictTransportSecurity, xContentTypeOptions, xDnsPrefetchControl, xDownloadOptions, xFrameOptions, xPermittedCrossDomainPolicies, xPoweredBy, xXssProtection, xXssProtection as xssFilter} diff --git a/.pnpm-store/v10/files/24/7b5501b800f695198dec2882adff4c0f1ed04a70658af35063a1935a08674bafba3029b2f6537506177aa98bd06582ad568a18a371c292423b83165b513ae8 b/.pnpm-store/v10/files/24/7b5501b800f695198dec2882adff4c0f1ed04a70658af35063a1935a08674bafba3029b2f6537506177aa98bd06582ad568a18a371c292423b83165b513ae8 new file mode 100644 index 0000000..3fbbddb --- /dev/null +++ b/.pnpm-store/v10/files/24/7b5501b800f695198dec2882adff4c0f1ed04a70658af35063a1935a08674bafba3029b2f6537506177aa98bd06582ad568a18a371c292423b83165b513ae8 @@ -0,0 +1,47 @@ +/** + * Module dependencies. + */ + +var crypto = require('crypto'); + +/** + * Sign the given `val` with `secret`. + * + * @param {String} val + * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret + * @return {String} + * @api private + */ + +exports.sign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if (null == secret) throw new TypeError("Secret key must be provided."); + return val + '.' + crypto + .createHmac('sha256', secret) + .update(val) + .digest('base64') + .replace(/\=+$/, ''); +}; + +/** + * Unsign and decode the given `input` with `secret`, + * returning `false` if the signature is invalid. + * + * @param {String} input + * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret + * @return {String|Boolean} + * @api private + */ + +exports.unsign = function(input, secret){ + if ('string' != typeof input) throw new TypeError("Signed cookie string must be provided."); + if (null == secret) throw new TypeError("Secret key must be provided."); + var tentativeValue = input.slice(0, input.lastIndexOf('.')), + expectedInput = exports.sign(tentativeValue, secret), + expectedBuffer = Buffer.from(expectedInput), + inputBuffer = Buffer.from(input); + return ( + expectedBuffer.length === inputBuffer.length && + crypto.timingSafeEqual(expectedBuffer, inputBuffer) + ) ? tentativeValue : false; +}; diff --git a/.pnpm-store/v10/files/24/a31fd461d586670cb385d3f6c41a01d2ad07e7a932d31a7ea79005f4480c0ee1e92dd1201d8c818410433f03a29fffff52de038a844d5a8775f0cf47597f2c b/.pnpm-store/v10/files/24/a31fd461d586670cb385d3f6c41a01d2ad07e7a932d31a7ea79005f4480c0ee1e92dd1201d8c818410433f03a29fffff52de038a844d5a8775f0cf47597f2c new file mode 100644 index 0000000..e3f4961 --- /dev/null +++ b/.pnpm-store/v10/files/24/a31fd461d586670cb385d3f6c41a01d2ad07e7a932d31a7ea79005f4480c0ee1e92dd1201d8c818410433f03a29fffff52de038a844d5a8775f0cf47597f2c @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); diff --git a/.pnpm-store/v10/files/24/a6fa02cc95a630dce3f0027740fe3eab5bf0dd121c57a70db2dd0f8219aaae9f33e09bfab329136f37f0660b3e28e76471dba96bc7b539c89f13b33c84251c b/.pnpm-store/v10/files/24/a6fa02cc95a630dce3f0027740fe3eab5bf0dd121c57a70db2dd0f8219aaae9f33e09bfab329136f37f0660b3e28e76471dba96bc7b539c89f13b33c84251c new file mode 100644 index 0000000..b87286a --- /dev/null +++ b/.pnpm-store/v10/files/24/a6fa02cc95a630dce3f0027740fe3eab5bf0dd121c57a70db2dd0f8219aaae9f33e09bfab329136f37f0660b3e28e76471dba96bc7b539c89f13b33c84251c @@ -0,0 +1 @@ +export = Reflect.apply; \ No newline at end of file diff --git a/.pnpm-store/v10/files/24/b5eced9d52aa24e2fbaf9e02de6aa4c907bd4162a98d575528c77fa26ccb407d3a37a8280b965027b12919d3fda7e464037f46139d30d4b94bb9b7666640e2 b/.pnpm-store/v10/files/24/b5eced9d52aa24e2fbaf9e02de6aa4c907bd4162a98d575528c77fa26ccb407d3a37a8280b965027b12919d3fda7e464037f46139d30d4b94bb9b7666640e2 new file mode 100644 index 0000000..a65c08c --- /dev/null +++ b/.pnpm-store/v10/files/24/b5eced9d52aa24e2fbaf9e02de6aa4c907bd4162a98d575528c77fa26ccb407d3a37a8280b965027b12919d3fda7e464037f46139d30d4b94bb9b7666640e2 @@ -0,0 +1,29 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); + +test('fakes', { skip: !hasToStringTag }, function (t) { + forEach([ + 'Array', + 'Boolean', + 'Date', + 'Error', + 'Number', + 'RegExp', + 'String' + ], function (expected) { + var faker = {}; + faker[Symbol.toStringTag] = expected; + + t.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', + 'faker masquerading as ' + expected + ' is not shown as one' + ); + }); + + t.end(); +}); diff --git a/.pnpm-store/v10/files/24/c62be5e3ab862a4ffcf4408cdcd0af9bb369f1ea56c9d37e4f8129068097e98b8c540e7535fced73e958267e82ba398f3692fdfdb2b9e866151717a991c5b2 b/.pnpm-store/v10/files/24/c62be5e3ab862a4ffcf4408cdcd0af9bb369f1ea56c9d37e4f8129068097e98b8c540e7535fced73e958267e82ba398f3692fdfdb2b9e866151717a991c5b2 new file mode 100644 index 0000000..77fbace --- /dev/null +++ b/.pnpm-store/v10/files/24/c62be5e3ab862a4ffcf4408cdcd0af9bb369f1ea56c9d37e4f8129068097e98b8c540e7535fced73e958267e82ba398f3692fdfdb2b9e866151717a991c5b2 @@ -0,0 +1,288 @@ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +const isNumber = require('is-number'); + +const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + let intersected = filterPatterns(neg, pos, '-?', true, options) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit, options); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange.cache = {}; +toRegexRange.clearCache = () => (toRegexRange.cache = {}); + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; diff --git a/.pnpm-store/v10/files/25/684ad9145e705010321dae3ce36c92ae8ae3c554d490c710595a69563d3de87bd0b08f42bf214446740f25b27114cca2c547f2808627221599b9d043c663ea b/.pnpm-store/v10/files/25/684ad9145e705010321dae3ce36c92ae8ae3c554d490c710595a69563d3de87bd0b08f42bf214446740f25b27114cca2c547f2808627221599b9d043c663ea new file mode 100644 index 0000000..3ef7eaa --- /dev/null +++ b/.pnpm-store/v10/files/25/684ad9145e705010321dae3ce36c92ae8ae3c554d490c710595a69563d3de87bd0b08f42bf214446740f25b27114cca2c547f2808627221599b9d043c663ea @@ -0,0 +1,20 @@ +type AnymatchFn = (testString: string) => boolean; +type AnymatchPattern = string|RegExp|AnymatchFn; +type AnymatchMatcher = AnymatchPattern|AnymatchPattern[] +type AnymatchTester = { + (testString: string|any[], returnIndex: true): number; + (testString: string|any[]): boolean; +} + +type PicomatchOptions = {dot: boolean}; + +declare const anymatch: { + (matchers: AnymatchMatcher): AnymatchTester; + (matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester; + (matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number; + (matchers: AnymatchMatcher, testString: string|any[]): boolean; +} + +export {AnymatchMatcher as Matcher} +export {AnymatchTester as Tester} +export default anymatch diff --git a/.pnpm-store/v10/files/26/0253ad501ac06d749a4583970cce1fcc46dbf29f0615cba8dffb397b94f6d0f6e3dd50954da59fa6ffdd0ea61d5b1b7436da697c912ea7b8394b4496e7d3c9 b/.pnpm-store/v10/files/26/0253ad501ac06d749a4583970cce1fcc46dbf29f0615cba8dffb397b94f6d0f6e3dd50954da59fa6ffdd0ea61d5b1b7436da697c912ea7b8394b4496e7d3c9 new file mode 100644 index 0000000..732b847 --- /dev/null +++ b/.pnpm-store/v10/files/26/0253ad501ac06d749a4583970cce1fcc46dbf29f0615cba8dffb397b94f6d0f6e3dd50954da59fa6ffdd0ea61d5b1b7436da697c912ea7b8394b4496e7d3c9 @@ -0,0 +1,243 @@ +# cors + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +CORS is a node.js package for providing a [Connect](http://www.senchalabs.org/connect/)/[Express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. + +**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** + +* [Installation](#installation) +* [Usage](#usage) + * [Simple Usage](#simple-usage-enable-all-cors-requests) + * [Enable CORS for a Single Route](#enable-cors-for-a-single-route) + * [Configuring CORS](#configuring-cors) + * [Configuring CORS Asynchronously](#configuring-cors-asynchronously) + * [Enabling CORS Pre-Flight](#enabling-cors-pre-flight) +* [Configuration Options](#configuration-options) +* [Demo](#demo) +* [License](#license) +* [Author](#author) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install cors +``` + +## Usage + +### Simple Usage (Enable *All* CORS Requests) + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.use(cors()) + +app.get('/products/:id', function (req, res, next) { + res.json({msg: 'This is CORS-enabled for all origins!'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Enable CORS for a Single Route + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.get('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a Single Route'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Configuring CORS + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var corsOptions = { + origin: 'http://example.com', + optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 +} + +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for only example.com.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Configuring CORS w/ Dynamic Origin + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var whitelist = ['http://example1.com', 'http://example2.com'] +var corsOptions = { + origin: function (origin, callback) { + if (whitelist.indexOf(origin) !== -1) { + callback(null, true) + } else { + callback(new Error('Not allowed by CORS')) + } + } +} + +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +If you do not want to block REST tools or server-to-server requests, +add a `!origin` check in the origin function like so: + +```javascript +var corsOptions = { + origin: function (origin, callback) { + if (whitelist.indexOf(origin) !== -1 || !origin) { + callback(null, true) + } else { + callback(new Error('Not allowed by CORS')) + } + } +} +``` + +### Enabling CORS Pre-Flight + +Certain CORS requests are considered 'complex' and require an initial +`OPTIONS` request (called the "pre-flight request"). An example of a +'complex' CORS request is one that uses an HTTP verb other than +GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable +pre-flighting, you must add a new OPTIONS handler for the route you want +to support: + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.options('/products/:id', cors()) // enable pre-flight request for DELETE request +app.del('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for all origins!'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +You can also enable pre-flight across-the-board like so: + +```javascript +app.options('*', cors()) // include before other routes +``` + +### Configuring CORS Asynchronously + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var whitelist = ['http://example1.com', 'http://example2.com'] +var corsOptionsDelegate = function (req, callback) { + var corsOptions; + if (whitelist.indexOf(req.header('Origin')) !== -1) { + corsOptions = { origin: true } // reflect (enable) the requested origin in the CORS response + } else { + corsOptions = { origin: false } // disable CORS for this request + } + callback(null, corsOptions) // callback expects two parameters: error and options +} + +app.get('/products/:id', cors(corsOptionsDelegate), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +## Configuration Options + +* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values: + - `Boolean` - set `origin` to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS. + - `String` - set `origin` to a specific origin. For example if you set it to `"http://example.com"` only requests from "http://example.com" will be allowed. + - `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com". + - `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com". + - `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (which expects the signature `err [object], allow [bool]`) as the second. +* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`). +* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header. +* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed. +* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted. +* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted. +* `preflightContinue`: Pass the CORS preflight response to the next handler. +* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`. + +The default configuration is the equivalent of: + +```json +{ + "origin": "*", + "methods": "GET,HEAD,PUT,PATCH,POST,DELETE", + "preflightContinue": false, + "optionsSuccessStatus": 204 +} +``` + +For details on the effect of each CORS header, read [this](http://www.html5rocks.com/en/tutorials/cors/) article on HTML5 Rocks. + +## Demo + +A demo that illustrates CORS working (and not working) using jQuery is available here: [http://node-cors-client.herokuapp.com/](http://node-cors-client.herokuapp.com/) + +Code for that demo can be found here: + +* Client: [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client) +* Server: [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server) + +## License + +[MIT License](http://www.opensource.org/licenses/mit-license.php) + +## Author + +[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) + +[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master +[downloads-image]: https://img.shields.io/npm/dm/cors.svg +[downloads-url]: https://npmjs.org/package/cors +[npm-image]: https://img.shields.io/npm/v/cors.svg +[npm-url]: https://npmjs.org/package/cors +[travis-image]: https://img.shields.io/travis/expressjs/cors/master.svg +[travis-url]: https://travis-ci.org/expressjs/cors diff --git a/.pnpm-store/v10/files/26/0a468807d297c2fe85ce8341ae10be64a7833a8249f2932c6a93e6ade07438ca4bd26222326a1b0e3203ba0c80a6a6fb78e90015b667feda8f68538e1011ad b/.pnpm-store/v10/files/26/0a468807d297c2fe85ce8341ae10be64a7833a8249f2932c6a93e6ade07438ca4bd26222326a1b0e3203ba0c80a6a6fb78e90015b667feda8f68538e1011ad new file mode 100644 index 0000000..6d17eab --- /dev/null +++ b/.pnpm-store/v10/files/26/0a468807d297c2fe85ce8341ae10be64a7833a8249f2932c6a93e6ade07438ca4bd26222326a1b0e3203ba0c80a6a6fb78e90015b667feda8f68538e1011ad @@ -0,0 +1,234 @@ +const path = require('path'); +const fs = require('fs'); +const existsSync = fs.existsSync; +const utils = require('../utils'); + +module.exports = exec; +module.exports.expandScript = expandScript; + +/** + * Reads the cwd/package.json file and looks to see if it can load a script + * and possibly an exec first from package.main, then package.start. + * + * @return {Object} exec & script if found + */ +function execFromPackage() { + // doing a try/catch because we can't use the path.exist callback pattern + // or we could, but the code would get messy, so this will do exactly + // what we're after - if the file doesn't exist, it'll throw. + try { + // note: this isn't nodemon's package, it's the user's cwd package + var pkg = require(path.join(process.cwd(), 'package.json')); + if (pkg.main !== undefined) { + // no app found to run - so give them a tip and get the feck out + return { exec: null, script: pkg.main }; + } + + if (pkg.scripts && pkg.scripts.start) { + return { exec: pkg.scripts.start }; + } + } catch (e) {} + + return null; +} + +function replace(map, str) { + var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g'); + return str.replace(re, function (all, m) { + return map[m] || all || ''; + }); +} + +function expandScript(script, ext) { + if (!ext) { + ext = '.js'; + } + if (script.indexOf(ext) !== -1) { + return script; + } + + if (existsSync(path.resolve(script))) { + return script; + } + + if (existsSync(path.resolve(script + ext))) { + return script + ext; + } + + return script; +} + +/** + * Discovers all the options required to run the script + * and if a custom exec has been passed in, then it will + * also try to work out what extensions to monitor and + * whether there's a special way of running that script. + * + * @param {Object} nodemonOptions + * @param {Object} execMap + * @return {Object} new and updated version of nodemonOptions + */ +function exec(nodemonOptions, execMap) { + if (!execMap) { + execMap = {}; + } + + var options = utils.clone(nodemonOptions || {}); + var script; + + // if there's no script passed, try to get it from the first argument + if (!options.script && (options.args || []).length) { + script = expandScript( + options.args[0], + options.ext && '.' + (options.ext || 'js').split(',')[0] + ); + + // if the script was found, shift it off our args + if (script !== options.args[0]) { + options.script = script; + options.args.shift(); + } + } + + // if there's no exec found yet, then try to read it from the local + // package.json this logic used to sit in the cli/parse, but actually the cli + // should be parsed first, then the user options (via nodemon.json) then + // finally default down to pot shots at the directory via package.json + if (!options.exec && !options.script) { + var found = execFromPackage(); + if (found !== null) { + if (found.exec) { + options.exec = found.exec; + } + if (!options.script) { + options.script = found.script; + } + if (Array.isArray(options.args) && options.scriptPosition === null) { + options.scriptPosition = options.args.length; + } + } + } + + // var options = utils.clone(nodemonOptions || {}); + script = path.basename(options.script || ''); + + var scriptExt = path.extname(script).slice(1); + + var extension = options.ext; + if (extension === undefined) { + var isJS = scriptExt === 'js' || scriptExt === 'mjs' || scriptExt === 'cjs'; + extension = isJS || !scriptExt ? 'js,mjs,cjs' : scriptExt; + extension += ',json'; // Always watch JSON files + } + + var execDefined = !!options.exec; + + // allows the user to simplify cli usage: + // https://github.com/remy/nodemon/issues/195 + // but always give preference to the user defined argument + if (!options.exec && execMap[scriptExt] !== undefined) { + options.exec = execMap[scriptExt]; + execDefined = true; + } + + options.execArgs = nodemonOptions.execArgs || []; + + if (Array.isArray(options.exec)) { + options.execArgs = options.exec; + options.exec = options.execArgs.shift(); + } + + if (options.exec === undefined) { + options.exec = 'node'; + } else { + // allow variable substitution for {{filename}} and {{pwd}} + var substitution = replace.bind(null, { + filename: options.script, + pwd: process.cwd(), + }); + + var newExec = substitution(options.exec); + if ( + newExec !== options.exec && + options.exec.indexOf('{{filename}}') !== -1 + ) { + options.script = null; + } + options.exec = newExec; + + var newExecArgs = options.execArgs.map(substitution); + if (newExecArgs.join('') !== options.execArgs.join('')) { + options.execArgs = newExecArgs; + delete options.script; + } + } + + if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) { + options.execArgs = options.execArgs.concat(options.nodeArgs); + } + + // note: indexOf('coffee') handles both .coffee and .litcoffee + if ( + !execDefined && + options.exec === 'node' && + scriptExt.indexOf('coffee') !== -1 + ) { + options.exec = 'coffee'; + + // we need to get execArgs set before the script + // for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an + // execArg, while my-flag is a script arg + var leadingArgs = (options.args || []).splice(0, options.scriptPosition); + options.execArgs = options.execArgs.concat(leadingArgs); + options.scriptPosition = 0; + + if (options.execArgs.length > 0) { + // because this is the coffee executable, we need to combine the exec args + // into a single argument after the nodejs flag + options.execArgs = ['--nodejs', options.execArgs.join(' ')]; + } + } + + if (options.exec === 'coffee') { + // don't override user specified extension tracking + if (options.ext === undefined) { + if (extension) { + extension += ','; + } + extension += 'coffee,litcoffee'; + } + + // because windows can't find 'coffee', it needs the real file 'coffee.cmd' + if (utils.isWindows) { + options.exec += '.cmd'; + } + } + + // allow users to make a mistake on the extension to monitor + // converts .js, pug => js,pug + // BIG NOTE: user can't do this: nodemon -e *.js + // because the terminal will automatically expand the glob against + // the file system :( + extension = (extension.match(/[^,*\s]+/g) || []) + .map((ext) => ext.replace(/^\./, '')) + .join(','); + + options.ext = extension; + + if (options.script) { + options.script = expandScript( + options.script, + extension && '.' + extension.split(',')[0] + ); + } + + options.env = {}; + // make sure it's an object (and since we don't have ) + if ({}.toString.apply(nodemonOptions.env) === '[object Object]') { + options.env = utils.clone(nodemonOptions.env); + } else if (nodemonOptions.env !== undefined) { + throw new Error('nodemon env values must be an object: { PORT: 8000 }'); + } + + return options; +} diff --git a/.pnpm-store/v10/files/26/be5e7e7d4699084e34e960dafac3dbaad3a71b8d28529cd5907fa82be058ba085f57136496c1f96aa30ef3de5ac387981751e806a35446f709396ed769fe35 b/.pnpm-store/v10/files/26/be5e7e7d4699084e34e960dafac3dbaad3a71b8d28529cd5907fa82be058ba085f57136496c1f96aa30ef3de5ac387981751e806a35446f709396ed769fe35 new file mode 100644 index 0000000..a150648 --- /dev/null +++ b/.pnpm-store/v10/files/26/be5e7e7d4699084e34e960dafac3dbaad3a71b8d28529cd5907fa82be058ba085f57136496c1f96aa30ef3de5ac387981751e806a35446f709396ed769fe35 @@ -0,0 +1,109 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } + + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); + + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; diff --git a/.pnpm-store/v10/files/27/22402d6fce40ff917d759f322c4944da71ba9a68d24292d876a36ae62ca2bcaa8677db4fe6ac6b7bf631cd52bbf121b3aa838fbaa9f1a5339ba26c073a2d53 b/.pnpm-store/v10/files/27/22402d6fce40ff917d759f322c4944da71ba9a68d24292d876a36ae62ca2bcaa8677db4fe6ac6b7bf631cd52bbf121b3aa838fbaa9f1a5339ba26c073a2d53 new file mode 100644 index 0000000..e2df7c9 --- /dev/null +++ b/.pnpm-store/v10/files/27/22402d6fce40ff917d759f322c4944da71ba9a68d24292d876a36ae62ca2bcaa8677db4fe6ac6b7bf631cd52bbf121b3aa838fbaa9f1a5339ba26c073a2d53 @@ -0,0 +1,10 @@ +'use strict'; + +/* eslint-env browser */ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/.pnpm-store/v10/files/27/45f386c0d9336c468784965ffeb31efac4d1960f4f67136f51b21f9a5116dc2b41242e82f2f553c9a130dc6da9f2a90a7261abbee924e680c979ed77a9456d b/.pnpm-store/v10/files/27/45f386c0d9336c468784965ffeb31efac4d1960f4f67136f51b21f9a5116dc2b41242e82f2f553c9a130dc6da9f2a90a7261abbee924e680c979ed77a9456d new file mode 100644 index 0000000..8bde4e9 --- /dev/null +++ b/.pnpm-store/v10/files/27/45f386c0d9336c468784965ffeb31efac4d1960f4f67136f51b21f9a5116dc2b41242e82f2f553c9a130dc6da9f2a90a7261abbee924e680c979ed77a9456d @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03 + +### Commits + +- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719) +- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8) + +## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15 + +### Commits + +- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be) +- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e) +- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49) +- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7) + +## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5) +- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14) +- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871) + +## v1.0.1 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d) +- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9) +- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275) +- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb) +- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8) +- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97) diff --git a/.pnpm-store/v10/files/27/493dd888f009f52e6e926d4d9b80f162f50c11534d771f0966d9c9c875fc5738540adf24dbc0a3e81c7fc248bcc88f10815cbd7308e85360c6b1273ce5ec34 b/.pnpm-store/v10/files/27/493dd888f009f52e6e926d4d9b80f162f50c11534d771f0966d9c9c875fc5738540adf24dbc0a3e81c7fc248bcc88f10815cbd7308e85360c6b1273ce5ec34 new file mode 100644 index 0000000..a8b7330 --- /dev/null +++ b/.pnpm-store/v10/files/27/493dd888f009f52e6e926d4d9b80f162f50c11534d771f0966d9c9c875fc5738540adf24dbc0a3e81c7fc248bcc88f10815cbd7308e85360c6b1273ce5ec34 @@ -0,0 +1,169 @@ +# http-errors + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][node-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create HTTP errors for Express, Koa, Connect, etc. with ease. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```console +$ npm install http-errors +``` + +## Example + +```js +var createError = require('http-errors') +var express = require('express') +var app = express() + +app.use(function (req, res, next) { + if (!req.user) return next(createError(401, 'Please login to view this page.')) + next() +}) +``` + +## API + +This is the current API, currently extracted from Koa and subject to change. + +### Error Properties + +- `expose` - can be used to signal if `message` should be sent to the client, + defaulting to `false` when `status` >= 500 +- `headers` - can be an object of header names to values to be sent to the + client, defaulting to `undefined`. When defined, the key names should all + be lower-cased +- `message` - the traditional error message, which should be kept short and all + single line +- `status` - the status code of the error, mirroring `statusCode` for general + compatibility +- `statusCode` - the status code of the error, defaulting to `500` + +### createError([status], [message], [properties]) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = createError(404, 'This video does not exist!') +``` + +- `status: 500` - the status code as a number +- `message` - the message of the error, defaulting to node's text for that status code. +- `properties` - custom properties to attach to the object + +### createError([status], [error], [properties]) + +Extend the given `error` object with `createError.HttpError` +properties. This will not alter the inheritance of the given +`error` object, and the modified `error` object is the +return value. + + + +```js +fs.readFile('foo.txt', function (err, buf) { + if (err) { + if (err.code === 'ENOENT') { + var httpError = createError(404, err, { expose: false }) + } else { + var httpError = createError(500, err) + } + } +}) +``` + +- `status` - the status code as a number +- `error` - the error object to extend +- `properties` - custom properties to attach to the object + +### createError.isHttpError(val) + +Determine if the provided `val` is an `HttpError`. This will return `true` +if the error inherits from the `HttpError` constructor of this module or +matches the "duck type" for an error this module creates. All outputs from +the `createError` factory will return `true` for this function, including +if an non-`HttpError` was passed into the factory. + +### new createError\[code || name\](\[msg]\)) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = new createError.NotFound() +``` + +- `code` - the status code as a number +- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. + +#### List of all constructors + +|Status Code|Constructor Name | +|-----------|-----------------------------| +|400 |BadRequest | +|401 |Unauthorized | +|402 |PaymentRequired | +|403 |Forbidden | +|404 |NotFound | +|405 |MethodNotAllowed | +|406 |NotAcceptable | +|407 |ProxyAuthenticationRequired | +|408 |RequestTimeout | +|409 |Conflict | +|410 |Gone | +|411 |LengthRequired | +|412 |PreconditionFailed | +|413 |PayloadTooLarge | +|414 |URITooLong | +|415 |UnsupportedMediaType | +|416 |RangeNotSatisfiable | +|417 |ExpectationFailed | +|418 |ImATeapot | +|421 |MisdirectedRequest | +|422 |UnprocessableEntity | +|423 |Locked | +|424 |FailedDependency | +|425 |TooEarly | +|426 |UpgradeRequired | +|428 |PreconditionRequired | +|429 |TooManyRequests | +|431 |RequestHeaderFieldsTooLarge | +|451 |UnavailableForLegalReasons | +|500 |InternalServerError | +|501 |NotImplemented | +|502 |BadGateway | +|503 |ServiceUnavailable | +|504 |GatewayTimeout | +|505 |HTTPVersionNotSupported | +|506 |VariantAlsoNegotiates | +|507 |InsufficientStorage | +|508 |LoopDetected | +|509 |BandwidthLimitExceeded | +|510 |NotExtended | +|511 |NetworkAuthenticationRequired| + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci +[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master +[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master +[node-image]: https://badgen.net/npm/node/http-errors +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/http-errors +[npm-url]: https://npmjs.org/package/http-errors +[npm-version-image]: https://badgen.net/npm/v/http-errors +[travis-image]: https://badgen.net/travis/jshttp/http-errors/master +[travis-url]: https://travis-ci.org/jshttp/http-errors diff --git a/.pnpm-store/v10/files/27/680a99e6714b45848a061587d1924eb9d0ea3e1a3330496721d13cbf6c7c677449f6bca07d9aa58d90d55c49b328eae773794a3375ec7dc26b66190083b4a0 b/.pnpm-store/v10/files/27/680a99e6714b45848a061587d1924eb9d0ea3e1a3330496721d13cbf6c7c677449f6bca07d9aa58d90d55c49b328eae773794a3375ec7dc26b66190083b4a0 new file mode 100644 index 0000000..3a6988e --- /dev/null +++ b/.pnpm-store/v10/files/27/680a99e6714b45848a061587d1924eb9d0ea3e1a3330496721d13cbf6c7c677449f6bca07d9aa58d90d55c49b328eae773794a3375ec7dc26b66190083b4a0 @@ -0,0 +1,331 @@ +'use strict'; + +const stringify = require('./stringify'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = require('./constants'); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +module.exports = parse; diff --git a/.pnpm-store/v10/files/27/bb9a2a85140826de56f44dc689eb91d686e48dded801ade63890ccbca8b435e3f135d605113067b3ba796f09adf96b4f2e24010791921ac396837cf76110fa b/.pnpm-store/v10/files/27/bb9a2a85140826de56f44dc689eb91d686e48dded801ade63890ccbca8b435e3f135d605113067b3ba796f09adf96b4f2e24010791921ac396837cf76110fa new file mode 100644 index 0000000..b4ab025 --- /dev/null +++ b/.pnpm-store/v10/files/27/bb9a2a85140826de56f44dc689eb91d686e48dded801ade63890ccbca8b435e3f135d605113067b3ba796f09adf96b4f2e24010791921ac396837cf76110fa @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a file path is a binary file + + +## Install + +``` +$ npm install is-binary-path +``` + + +## Usage + +```js +const isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` + + +## Related + +- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com) diff --git a/.pnpm-store/v10/files/28/eca948136e26e7a7544cae13e660401d088da2806ee2434e8ebe952b1267694ebb0e0a9cb3296ed7779fb4dc9a27b54f5c8a2ae12933408b5c071c0f1d5f96 b/.pnpm-store/v10/files/28/eca948136e26e7a7544cae13e660401d088da2806ee2434e8ebe952b1267694ebb0e0a9cb3296ed7779fb4dc9a27b54f5c8a2ae12933408b5c071c0f1d5f96 new file mode 100644 index 0000000..897cae1 --- /dev/null +++ b/.pnpm-store/v10/files/28/eca948136e26e7a7544cae13e660401d088da2806ee2434e8ebe952b1267694ebb0e0a9cb3296ed7779fb4dc9a27b54f5c8a2ae12933408b5c071c0f1d5f96 @@ -0,0 +1,143 @@ +/*! + * media-typer + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match type in RFC 6838 + * + * type-name = restricted-name + * subtype-name = restricted-name + * restricted-name = restricted-name-first *126restricted-name-chars + * restricted-name-first = ALPHA / DIGIT + * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / + * "$" / "&" / "-" / "^" / "_" + * restricted-name-chars =/ "." ; Characters before first dot always + * ; specify a facet name + * restricted-name-chars =/ "+" ; Characters after last plus always + * ; specify a structured syntax suffix + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + * DIGIT = %x30-39 ; 0-9 + */ +var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ + +/** + * Module exports. + */ + +exports.format = format +exports.parse = parse +exports.test = test + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var subtype = obj.subtype + var suffix = obj.suffix + var type = obj.type + + if (!type || !TYPE_NAME_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + throw new TypeError('invalid subtype') + } + + // format as type/subtype + var string = type + '/' + subtype + + // append +suffix + if (suffix) { + if (!TYPE_NAME_REGEXP.test(suffix)) { + throw new TypeError('invalid suffix') + } + + string += '+' + suffix + } + + return string +} + +/** + * Test media type. + * + * @param {string} string + * @return {object} + * @public + */ + +function test (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + return TYPE_REGEXP.test(string.toLowerCase()) +} + +/** + * Parse media type to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var match = TYPE_REGEXP.exec(string.toLowerCase()) + + if (!match) { + throw new TypeError('invalid media type') + } + + var type = match[1] + var subtype = match[2] + var suffix + + // suffix after last + + var index = subtype.lastIndexOf('+') + if (index !== -1) { + suffix = subtype.substr(index + 1) + subtype = subtype.substr(0, index) + } + + return new MediaType(type, subtype, suffix) +} + +/** + * Class for MediaType object. + * @public + */ + +function MediaType (type, subtype, suffix) { + this.type = type + this.subtype = subtype + this.suffix = suffix +} diff --git a/.pnpm-store/v10/files/29/c6b3ad2cfa7634c075c2b46b6f26359823a68bcbb0e3d70c177f599790f11bccda44a42a8680fc7a5fa9f047f87263590cbc03f5327085aad44d8ad1c6e986 b/.pnpm-store/v10/files/29/c6b3ad2cfa7634c075c2b46b6f26359823a68bcbb0e3d70c177f599790f11bccda44a42a8680fc7a5fa9f047f87263590cbc03f5327085aad44d8ad1c6e986 new file mode 100644 index 0000000..acd5acd --- /dev/null +++ b/.pnpm-store/v10/files/29/c6b3ad2cfa7634c075c2b46b6f26359823a68bcbb0e3d70c177f599790f11bccda44a42a8680fc7a5fa9f047f87263590cbc03f5327085aad44d8ad1c6e986 @@ -0,0 +1,335 @@ +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var __toString = Object.prototype.toString +var __hasOwnProperty = Object.prototype.hasOwnProperty + +/** + * RegExp to match cookie-name in RFC 6265 sec 4.1.1 + * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 + * which has been replaced by the token definition in RFC 7230 appendix B. + * + * cookie-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / + * "*" / "+" / "-" / "." / "^" / "_" / + * "`" / "|" / "~" / DIGIT / ALPHA + */ + +var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + +/** + * RegExp to match cookie-value in RFC 6265 sec 4.1.1 + * + * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + * ; US-ASCII characters excluding CTLs, + * ; whitespace DQUOTE, comma, semicolon, + * ; and backslash + */ + +var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/; + +/** + * RegExp to match domain-value in RFC 6265 sec 4.1.1 + * + * domain-value = + * ; defined in [RFC1034], Section 3.5, as + * ; enhanced by [RFC1123], Section 2.1 + * =