@eslint-react/jsx 0.8.10-beta.0 → 0.8.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";var scopeManager=require("@typescript-eslint/scope-manager"),types=require("@typescript-eslint/types"),utils=require("@typescript-eslint/utils");const isFunction$1=input=>"function"==typeof input,dual=function(arity,body){if("function"==typeof arity)return function(){return arity(arguments)?body.apply(this,arguments):self1=>body(self1,...arguments)};switch(arity){case 0:case 1:throw RangeError(`Invalid arity ${arity}`);case 2:return function(a,b){return arguments.length>=2?body(a,b):function(self1){return body(self1,a)}};case 3:return function(a,b,c){return arguments.length>=3?body(a,b,c):function(self1){return body(self1,a,b)}};case 4:return function(a,b,c,d){return arguments.length>=4?body(a,b,c,d):function(self1){return body(self1,a,b,c)}};case 5:return function(a,b,c,d,e){return arguments.length>=5?body(a,b,c,d,e):function(self1){return body(self1,a,b,c,d)}};default:return function(){if(arguments.length>=arity)return body.apply(this,arguments);let args=arguments;return function(self1){return body(self1,...args)}}}},identity$1=a=>a,constant=value=>()=>value,constTrue=constant(!0),constFalse=constant(!1),constNull=constant(null),constUndefined=constant(void 0),compose=dual(2,(ab,bc)=>a=>bc(ab(a))),absurd=_=>{throw Error("Called `absurd` function which should be uncallable")};function pipe(a,ab,bc,cd,de,ef,fg,gh,hi){switch(arguments.length){case 1:return a;case 2:return ab(a);case 3:return bc(ab(a));case 4:return cd(bc(ab(a)));case 5:return de(cd(bc(ab(a))));case 6:return ef(de(cd(bc(ab(a)))));case 7:return fg(ef(de(cd(bc(ab(a))))));case 8:return gh(fg(ef(de(cd(bc(ab(a)))))));case 9:return hi(gh(fg(ef(de(cd(bc(ab(a))))))));default:{let ret=arguments[0];for(let i=1;i<arguments.length;i++)ret=arguments[i](ret);return ret}}}const hole=identity$1(absurd);var Function$1=Object.freeze({__proto__:null,SK:(_,b)=>b,absurd:absurd,apply:a=>self1=>self1(a),compose:compose,constFalse:constFalse,constNull:constNull,constTrue:constTrue,constUndefined:constUndefined,constVoid:constUndefined,constant:constant,dual:dual,flip:f=>(...b)=>(...a)=>f(...a)(...b),flow:function(ab,bc,cd,de,ef,fg,gh,hi,ij){switch(arguments.length){case 1:return ab;case 2:return function(){return bc(ab.apply(this,arguments))};case 3:return function(){return cd(bc(ab.apply(this,arguments)))};case 4:return function(){return de(cd(bc(ab.apply(this,arguments))))};case 5:return function(){return ef(de(cd(bc(ab.apply(this,arguments)))))};case 6:return function(){return fg(ef(de(cd(bc(ab.apply(this,arguments))))))};case 7:return function(){return gh(fg(ef(de(cd(bc(ab.apply(this,arguments)))))))};case 8:return function(){return hi(gh(fg(ef(de(cd(bc(ab.apply(this,arguments))))))))};case 9:return function(){return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this,arguments)))))))))}}},hole:hole,identity:identity$1,isFunction:isFunction$1,pipe:pipe,tupled:f=>a=>f(...a),unsafeCoerce:identity$1,untupled:f=>(...a)=>f(a)});const moduleVersion="2.0.0-next.56",globalStoreId=Symbol.for(`effect/GlobalValue/globalStoreId/${moduleVersion}`);globalStoreId in globalThis||(globalThis[globalStoreId]=new Map);const globalStore=globalThis[globalStoreId],globalValue=(id,compute)=>(globalStore.has(id)||globalStore.set(id,compute()),globalStore.get(id)),isRecordOrArray=input=>"object"==typeof input&&null!==input,isObject=input=>isRecordOrArray(input)||isFunction$1(input),hasProperty=dual(2,(self1,property)=>isObject(self1)&&property in self1),isTagged=dual(2,(self1,tag)=>hasProperty(self1,"_tag")&&self1._tag===tag),isNullable$1=input=>null==input,GenKindTypeId=Symbol.for("effect/Gen/GenKind");class GenKindImpl{value;constructor(value){this.value=value}get _F(){return identity$1}get _R(){return _=>_}get _O(){return _=>_}get _E(){return _=>_}[GenKindTypeId]=GenKindTypeId;[Symbol.iterator](){return new SingleShotGen(this)}}class SingleShotGen{self;called=!1;constructor(self1){this.self=self1}next(a){return this.called?{value:a,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(a){return{value:a,done:!0}}throw(e){throw e}[Symbol.iterator](){return new SingleShotGen(this.self)}}class PCGRandom{_state;constructor(seedHi,seedLo,incHi,incLo){return isNullable$1(seedLo)&&isNullable$1(seedHi)?(seedLo=4294967295*Math.random()>>>0,seedHi=0):isNullable$1(seedLo)&&(seedLo=seedHi,seedHi=0),isNullable$1(incLo)&&isNullable$1(incHi)?(incLo=this._state?this._state[3]:4150755663,incHi=this._state?this._state[2]:335903614):isNullable$1(incLo)&&(incLo=incHi,incHi=0),this._state=new Int32Array([0,0,incHi>>>0,(1|(incLo||0))>>>0]),this._next(),add64(this._state,this._state[0],this._state[1],seedHi>>>0,seedLo>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(state){this._state[0]=state[0],this._state[1]=state[1],this._state[2]=state[2],this._state[3]=1|state[3]}integer(max){if(!max)return this._next();if(((max>>>=0)&max-1)==0)return this._next()&max-1;let num=0,skew=(-max>>>0)%max>>>0;for(num=this._next();num<skew;num=this._next());return num%max}number(){return((67108863&this._next())*134217728+(134217727&this._next())*1)/9007199254740992}_next(){var out;let c1,c0,lo,hi;let oldHi=this._state[0]>>>0,oldLo=this._state[1]>>>0;out=this._state,c1=(oldLo>>>16)*32557>>>0,c0=(65535&oldLo)*19605>>>0,lo=(65535&oldLo)*32557>>>0,hi=(oldLo>>>16)*19605+((c0>>>16)+(c1>>>16))>>>0,(lo=lo+(c0=c0<<16>>>0)>>>0)>>>0<c0>>>0&&(hi=hi+1>>>0),(lo=lo+(c1=c1<<16>>>0)>>>0)>>>0<c1>>>0&&(hi=hi+1>>>0),hi=(hi=hi+Math.imul(oldLo,1481765933)>>>0)+Math.imul(oldHi,1284865837)>>>0,out[0]=hi,out[1]=lo,add64(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let xsHi=oldHi>>>18,xsLo=(oldLo>>>18|oldHi<<14)>>>0;xsHi=(xsHi^oldHi)>>>0;let xorshifted=((xsLo=(xsLo^oldLo)>>>0)>>>27|xsHi<<5)>>>0,rot=oldHi>>>27;return(xorshifted>>>rot|xorshifted<<((-rot>>>0&31)>>>0))>>>0}}function add64(out,aHi,aLo,bHi,bLo){let hi=aHi+bHi>>>0,lo=aLo+bLo>>>0;lo>>>0<aLo>>>0&&(hi=hi+1|0),out[0]=hi,out[1]=lo}const randomHashCache=globalValue(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),pcgr=globalValue(Symbol.for("effect/Hash/pcgr"),()=>new PCGRandom),symbol$1=Symbol.for("effect/Hash"),hash=self1=>{switch(typeof self1){case"number":return number(self1);case"bigint":return string(self1.toString(10));case"boolean":case"symbol":return string(String(self1));case"string":return string(self1);case"undefined":return string("undefined");case"function":case"object":if(null===self1)return string("null");if(isHash(self1))return self1[symbol$1]();return random(self1);default:throw Error(`BUG: unhandled typeof ${typeof self1} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},random=self1=>(randomHashCache.has(self1)||randomHashCache.set(self1,number(pcgr.integer(Number.MAX_SAFE_INTEGER))),randomHashCache.get(self1)),combine$1=b=>self1=>53*self1^b,optimize=n=>3221225471&n|n>>>1&1073741824,isHash=u=>hasProperty(u,symbol$1),number=n=>{if(n!=n||n===1/0)return 0;let h=0|n;for(h!==n&&(h^=4294967295*n);n>4294967295;)h^=n/=4294967295;return optimize(n)},string=str=>{let h=5381,i=str.length;for(;i;)h=33*h^str.charCodeAt(--i);return optimize(h)},structureKeys=(o,keys)=>{let h=12289;for(let i=0;i<keys.length;i++)h^=pipe(string(keys[i]),combine$1(hash(o[keys[i]])));return optimize(h)},structure=o=>structureKeys(o,Object.keys(o)),array$2=arr=>{let h=6151;for(let i=0;i<arr.length;i++)h=pipe(h,combine$1(hash(arr[i])));return optimize(h)},symbol=Symbol.for("effect/Equal");function equals(){return 1==arguments.length?self1=>compareBoth(self1,arguments[0]):compareBoth(arguments[0],arguments[1])}function compareBoth(self1,that){if(self1===that)return!0;let selfType=typeof self1;return selfType===typeof that&&!!(("object"===selfType||"function"===selfType)&&null!==self1&&null!==that&&isEqual(self1)&&isEqual(that))&&hash(self1)===hash(that)&&self1[symbol](that)}const isEqual=u=>hasProperty(u,symbol),make$7=isEquivalent=>(self1,that)=>self1===that||isEquivalent(self1,that),NodeInspectSymbol=Symbol.for("nodejs.util.inspect.custom"),toJSON=x=>hasProperty(x,"toJSON")&&isFunction$1(x.toJSON)&&0===x.toJSON.length?x.toJSON():Array.isArray(x)?x.map(toJSON):x,toString=x=>JSON.stringify(x,null,2),pipeArguments=(self1,args)=>{switch(args.length){case 1:return args[0](self1);case 2:return args[1](args[0](self1));case 3:return args[2](args[1](args[0](self1)));case 4:return args[3](args[2](args[1](args[0](self1))));case 5:return args[4](args[3](args[2](args[1](args[0](self1)))));case 6:return args[5](args[4](args[3](args[2](args[1](args[0](self1))))));case 7:return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self1)))))));case 8:return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self1))))))));case 9:return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self1)))))))));default:{let ret=self1;for(let i=0,len=args.length;i<len;i++)ret=args[i](ret);return ret}}},EffectTypeId$1=Symbol.for("effect/Effect"),StreamTypeId=Symbol.for("effect/Stream"),SinkTypeId=Symbol.for("effect/Sink"),ChannelTypeId=Symbol.for("effect/Channel"),effectVariance={_R:_=>_,_E:_=>_,_A:_=>_,_V:moduleVersion},EffectPrototype={[EffectTypeId$1]:effectVariance,[StreamTypeId]:effectVariance,[SinkTypeId]:{_R:_=>_,_E:_=>_,_In:_=>_,_L:_=>_,_Z:_=>_},[ChannelTypeId]:{_Env:_=>_,_InErr:_=>_,_InElem:_=>_,_InDone:_=>_,_OutErr:_=>_,_OutElem:_=>_,_OutDone:_=>_},[symbol](that){return this===that},[symbol$1](){return random(this)},pipe(){return pipeArguments(this,arguments)}},StructuralPrototype={[symbol$1](){return structure(this)},[symbol](that){let selfKeys=Object.keys(this),thatKeys=Object.keys(that);if(selfKeys.length!==thatKeys.length)return!1;for(let key of selfKeys)if(!(key in that&&equals(this[key],that[key])))return!1;return!0}},StructuralCommitPrototype={...{...EffectPrototype,_op:"Commit"},...StructuralPrototype},TypeId$8=Symbol.for("effect/Option"),CommonProto$1={...EffectPrototype,[TypeId$8]:{_A:_=>_},[NodeInspectSymbol](){return this.toJSON()},toString(){return toString(this.toJSON())}},SomeProto=Object.assign(Object.create(CommonProto$1),{_tag:"Some",_op:"Some",[symbol](that){return isOption$1(that)&&isSome$1(that)&&equals(that.value,this.value)},[symbol$1](){return combine$1(hash(this._tag))(hash(this.value))},toJSON(){return{_id:"Option",_tag:this._tag,value:toJSON(this.value)}}}),NoneProto=Object.assign(Object.create(CommonProto$1),{_tag:"None",_op:"None",[symbol]:that=>isOption$1(that)&&isNone$1(that),[symbol$1](){return combine$1(hash(this._tag))},toJSON(){return{_id:"Option",_tag:this._tag}}}),isOption$1=input=>hasProperty(input,TypeId$8),isNone$1=fa=>"None"===fa._tag,isSome$1=fa=>"Some"===fa._tag,none$1=Object.create(NoneProto),some$4=value=>{let a=Object.create(SomeProto);return a.value=value,a},TypeId$7=Symbol.for("effect/Either"),CommonProto={...EffectPrototype,[TypeId$7]:{_A:_=>_},[NodeInspectSymbol](){return this.toJSON()},toString(){return toString(this.toJSON())}},RightProto=Object.assign(Object.create(CommonProto),{_tag:"Right",_op:"Right",[symbol](that){return isEither$1(that)&&isRight$1(that)&&equals(that.right,this.right)},[symbol$1](){return combine$1(hash(this._tag))(hash(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:toJSON(this.right)}}}),LeftProto=Object.assign(Object.create(CommonProto),{_tag:"Left",_op:"Left",[symbol](that){return isEither$1(that)&&isLeft$1(that)&&equals(that.left,this.left)},[symbol$1](){return combine$1(hash(this._tag))(hash(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:toJSON(this.left)}}}),isEither$1=input=>hasProperty(input,TypeId$7),isLeft$1=ma=>"Left"===ma._tag,isRight$1=ma=>"Right"===ma._tag,left$1=left=>{let a=Object.create(LeftProto);return a.left=left,a},right$1=right=>{let a=Object.create(RightProto);return a.right=right,a},make$6=compare=>(self1,that)=>self1===that?0:compare(self1,that),TypeId$6=Symbol.for("effect/Option"),none=()=>none$1,match$1=dual(2,(self1,{onNone,onSome})=>isNone$1(self1)?onNone():onSome(self1.value)),getOrElse$1=dual(2,(self1,onNone)=>isNone$1(self1)?onNone():self1.value),orElse$1=dual(2,(self1,that)=>isNone$1(self1)?that():self1),orElseEither=dual(2,(self1,that)=>isNone$1(self1)?map$5(that(),right$1):map$5(self1,left$1)),fromNullable$1=nullableValue=>null==nullableValue?none():some$4(nullableValue),getOrNull$1=getOrElse$1(constNull),getOrUndefined$1=getOrElse$1(constUndefined),getOrThrowWith$1=dual(2,(self1,onNone)=>{if(isSome$1(self1))return self1.value;throw onNone()}),getOrThrow$1=getOrThrowWith$1(()=>Error("getOrThrow called on a None")),map$5=dual(2,(self1,f)=>isNone$1(self1)?none():some$4(f(self1.value))),as=dual(2,(self1,b)=>map$5(self1,()=>b)),asUnit=as(void 0),unit=some$4(void 0),flatMap$3=dual(2,(self1,f)=>isNone$1(self1)?none():f(self1.value)),flatMapNullable=dual(2,(self1,f)=>isNone$1(self1)?none():fromNullable$1(f(self1.value))),flatten$1=flatMap$3(identity$1),zipRight=dual(2,(self1,that)=>flatMap$3(self1,()=>that)),composeK=dual(2,(afb,bfc)=>a=>flatMap$3(afb(a),bfc)),zipLeft=dual(2,(self1,that)=>tap(self1,()=>that)),tap=dual(2,(self1,f)=>flatMap$3(self1,a=>map$5(f(a),()=>a))),product=(self1,that)=>isSome$1(self1)&&isSome$1(that)?some$4([self1.value,that.value]):none(),zipWith$3=dual(3,(self1,that,f)=>map$5(product(self1,that),([a,b])=>f(a,b))),ap$1=dual(2,(self1,that)=>zipWith$3(self1,that,(f,a)=>f(a))),reduceCompact=dual(3,(self1,b,f)=>{let out=b;for(let oa of self1)isSome$1(oa)&&(out=f(out,oa.value));return out}),partitionMap$4=dual(2,(self1,f)=>{if(isNone$1(self1))return[none(),none()];let e=f(self1.value);return isLeft$1(e)?[some$4(e.left),none()]:[none(),some$4(e.right)]}),filterMap$4=dual(2,(self1,f)=>isNone$1(self1)?none():f(self1.value)),filter$3=dual(2,(self1,predicate)=>filterMap$4(self1,b=>predicate(b)?some$4(b):none$1)),containsWith$2=isEquivalent=>dual(2,(self1,a)=>!isNone$1(self1)&&isEquivalent(self1.value,a)),contains$2=containsWith$2((self1,that)=>equals(self1,that)),exists=dual(2,(self1,refinement)=>!isNone$1(self1)&&refinement(self1.value)),bindTo=dual(2,(self1,name)=>map$5(self1,a=>({[name]:a}))),let_=dual(3,(self1,name,f)=>map$5(self1,a=>Object.assign({},a,{[name]:f(a)}))),bind=dual(3,(self1,name,f)=>flatMap$3(self1,a=>map$5(f(a),b=>Object.assign({},a,{[name]:b})))),Do=some$4({}),adapter$1=function(){let x=arguments[0];for(let i=1;i<arguments.length;i++)x=arguments[i](x);return new GenKindImpl(x)};var Option=Object.freeze({__proto__:null,Do:Do,TypeId:TypeId$6,all:input=>{if(Symbol.iterator in input){let out=[];for(let o of input){if(isNone$1(o))return none();out.push(o.value)}return some$4(out)}let out={};for(let key of Object.keys(input)){let o=input[key];if(isNone$1(o))return none();out[key]=o.value}return some$4(out)},ap:ap$1,as:as,asUnit:asUnit,bind:bind,bindTo:bindTo,composeK:composeK,contains:contains$2,containsWith:containsWith$2,exists:exists,filter:filter$3,filterMap:filterMap$4,firstSomeOf:collection=>{let out=none();for(out of collection)if(isSome$1(out))break;return out},flatMap:flatMap$3,flatMapNullable:flatMapNullable,flatten:flatten$1,fromIterable:collection=>{for(let a of collection)return some$4(a);return none()},fromNullable:fromNullable$1,gen:f=>{let iterator=f(adapter$1),state=iterator.next();if(state.done)return some$4(state.value);{let current=state.value.value;if(isNone$1(current))return current;for(;!state.done;)if(!(state=iterator.next(current.value)).done&&isNone$1(current=state.value.value))return current;return some$4(state.value)}},getEquivalence:isEquivalent=>make$7((x,y)=>x===y||(isNone$1(x)?isNone$1(y):!isNone$1(y)&&isEquivalent(x.value,y.value))),getLeft:self1=>isRight$1(self1)?none$1:some$4(self1.left),getOrElse:getOrElse$1,getOrNull:getOrNull$1,getOrThrow:getOrThrow$1,getOrThrowWith:getOrThrowWith$1,getOrUndefined:getOrUndefined$1,getOrder:O=>make$6((self1,that)=>isSome$1(self1)?isSome$1(that)?O(self1.value,that.value):1:-1),getRight:self1=>isLeft$1(self1)?none$1:some$4(self1.right),isNone:isNone$1,isOption:isOption$1,isSome:isSome$1,let:let_,lift2:f=>dual(2,(self1,that)=>zipWith$3(self1,that,f)),liftNullable:f=>(...a)=>fromNullable$1(f(...a)),liftPredicate:predicate=>b=>predicate(b)?some$4(b):none(),liftThrowable:f=>(...a)=>{try{return some$4(f(...a))}catch(e){return none()}},map:map$5,match:match$1,none:none,orElse:orElse$1,orElseEither:orElseEither,partitionMap:partitionMap$4,product:product,productMany:(self1,collection)=>{if(isNone$1(self1))return none();let out=[self1.value];for(let o of collection){if(isNone$1(o))return none();out.push(o.value)}return some$4(out)},reduceCompact:reduceCompact,some:some$4,tap:tap,toArray:self1=>isNone$1(self1)?[]:[self1.value],toRefinement:f=>a=>isSome$1(f(a)),unit:unit,zipLeft:zipLeft,zipRight:zipRight,zipWith:zipWith$3});const fromIterable$3=collection=>Array.isArray(collection)?collection:Array.from(collection),reverse$2=self1=>Array.from(self1).reverse(),reduce$4=dual(3,(self1,b,f)=>fromIterable$3(self1).reduce((b,a,i)=>f(b,a,i),b)),TypeId$4=Symbol.for("effect/Chunk"),emptyArray=[],_equivalence$1=make$7((self1,that)=>self1.length===that.length&&toReadonlyArray(self1).every((value,i)=>equals(value,unsafeGet(that,i)))),ChunkProto={[TypeId$4]:{_A:_=>_},toString(){return toString(this.toJSON())},toJSON(){return{_id:"Chunk",values:toReadonlyArray(this).map(toJSON)}},[NodeInspectSymbol](){return this.toJSON()},[symbol](that){return isChunk(that)&&_equivalence$1(this,that)},[symbol$1](){return array$2(toReadonlyArray(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return emptyArray[Symbol.iterator]();default:return toReadonlyArray(this)[Symbol.iterator]()}},pipe(){return pipeArguments(this,arguments)}},makeChunk=backing=>{let chunk=Object.create(ChunkProto);switch(chunk.backing=backing,backing._tag){case"IEmpty":chunk.length=0,chunk.depth=0,chunk.left=chunk,chunk.right=chunk;break;case"IConcat":chunk.length=backing.left.length+backing.right.length,chunk.depth=1+Math.max(backing.left.depth,backing.right.depth),chunk.left=backing.left,chunk.right=backing.right;break;case"IArray":chunk.length=backing.array.length,chunk.depth=0,chunk.left=_empty$4,chunk.right=_empty$4;break;case"ISingleton":chunk.length=1,chunk.depth=0,chunk.left=_empty$4,chunk.right=_empty$4;break;case"ISlice":chunk.length=backing.length,chunk.depth=backing.chunk.depth+1,chunk.left=_empty$4,chunk.right=_empty$4}return chunk},isChunk=u=>hasProperty(u,TypeId$4),_empty$4=makeChunk({_tag:"IEmpty"}),empty$8=()=>_empty$4,of$1=a=>makeChunk({_tag:"ISingleton",a}),copyToArray=(self1,array,initial)=>{switch(self1.backing._tag){case"IArray":!function(src,srcPos,dest,destPos,len){for(let i=srcPos;i<Math.min(src.length,srcPos+len);i++)dest[destPos+i-srcPos]=src[i]}(self1.backing.array,0,array,initial,self1.length);break;case"IConcat":copyToArray(self1.left,array,initial),copyToArray(self1.right,array,initial+self1.left.length);break;case"ISingleton":array[initial]=self1.backing.a;break;case"ISlice":{let i=0,j=initial;for(;i<self1.length;)array[j]=unsafeGet(self1,i),i+=1,j+=1}}},toReadonlyArray=self1=>{switch(self1.backing._tag){case"IEmpty":return emptyArray;case"IArray":return self1.backing.array;default:{let arr=Array(self1.length);return copyToArray(self1,arr,0),self1.backing={_tag:"IArray",array:arr},self1.left=_empty$4,self1.right=_empty$4,self1.depth=0,arr}}},reverse$1=self1=>{switch(self1.backing._tag){case"IEmpty":case"ISingleton":return self1;case"IArray":return makeChunk({_tag:"IArray",array:reverse$2(self1.backing.array)});case"IConcat":return makeChunk({_tag:"IConcat",left:reverse$1(self1.backing.right),right:reverse$1(self1.backing.left)});case"ISlice":return unsafeFromArray(reverse$2(toReadonlyArray(self1)))}},unsafeFromArray=self1=>makeChunk({_tag:"IArray",array:self1}),unsafeGet=dual(2,(self1,index)=>{switch(self1.backing._tag){case"IEmpty":throw Error("Index out of bounds");case"ISingleton":if(0!==index)throw Error("Index out of bounds");return self1.backing.a;case"IArray":if(index>=self1.length||index<0)throw Error("Index out of bounds");return self1.backing.array[index];case"IConcat":return index<self1.left.length?unsafeGet(self1.left,index):unsafeGet(self1.right,index-self1.left.length);case"ISlice":return unsafeGet(self1.backing.chunk,index+self1.backing.offset)}}),prepend$2=dual(2,(self1,elem)=>appendAllNonEmpty$1(of$1(elem),self1)),drop$1=dual(2,(self1,n)=>{if(n<=0)return self1;if(n>=self1.length)return _empty$4;switch(self1.backing._tag){case"ISlice":return makeChunk({_tag:"ISlice",chunk:self1.backing.chunk,offset:self1.backing.offset+n,length:self1.backing.length-n});case"IConcat":if(n>self1.left.length)return drop$1(self1.right,n-self1.left.length);return makeChunk({_tag:"IConcat",left:drop$1(self1.left,n),right:self1.right});default:return makeChunk({_tag:"ISlice",chunk:self1,offset:n,length:self1.length-n})}}),appendAll$1=dual(2,(self1,that)=>{if("IEmpty"===self1.backing._tag)return that;if("IEmpty"===that.backing._tag)return self1;let diff=that.depth-self1.depth;if(1>=Math.abs(diff))return makeChunk({_tag:"IConcat",left:self1,right:that});if(diff<-1){if(self1.left.depth>=self1.right.depth){let nr=appendAll$1(self1.right,that);return makeChunk({_tag:"IConcat",left:self1.left,right:nr})}{let nrr=appendAll$1(self1.right.right,that);if(nrr.depth===self1.depth-3){let nr=makeChunk({_tag:"IConcat",left:self1.right.left,right:nrr});return makeChunk({_tag:"IConcat",left:self1.left,right:nr})}{let nl=makeChunk({_tag:"IConcat",left:self1.left,right:self1.right.left});return makeChunk({_tag:"IConcat",left:nl,right:nrr})}}}if(that.right.depth>=that.left.depth)return makeChunk({_tag:"IConcat",left:appendAll$1(self1,that.left),right:that.right});{let nll=appendAll$1(self1,that.left.left);if(nll.depth===that.depth-3){let nl=makeChunk({_tag:"IConcat",left:nll,right:that.left.right});return makeChunk({_tag:"IConcat",left:nl,right:that.right})}{let nr=makeChunk({_tag:"IConcat",left:that.left.right,right:that.right});return makeChunk({_tag:"IConcat",left:nll,right:nr})}}}),appendAllNonEmpty$1=dual(2,(self1,that)=>appendAll$1(self1,that)),isEmpty$1=self1=>0===self1.length,isNonEmpty=self1=>self1.length>0,headNonEmpty=self1=>unsafeGet(self1,0),tailNonEmpty=self1=>drop$1(self1,1),TagTypeId=Symbol.for("effect/Context/Tag"),STMTypeId=Symbol.for("effect/STM"),TagProto={...EffectPrototype,_tag:"Tag",_op:"Tag",[STMTypeId]:effectVariance,[TagTypeId]:{_S:_=>_,_I:_=>_},toString(){return toString(this.toJSON())},toJSON(){return{_id:"Tag",identifier:this.identifier,stack:this.stack}},[NodeInspectSymbol](){return this.toJSON()},of:self1=>self1,context(self1){return make$4(this,self1)}},tagRegistry=globalValue("effect/Context/Tag/tagRegistry",()=>new Map),TypeId$3=Symbol.for("effect/Context"),ContextProto={[TypeId$3]:{_S:_=>_},[symbol](that){if(isContext(that)&&this.unsafeMap.size===that.unsafeMap.size){for(let k of this.unsafeMap.keys())if(!that.unsafeMap.has(k)||!equals(this.unsafeMap.get(k),that.unsafeMap.get(k)))return!1;return!0}return!1},[symbol$1](){return number(this.unsafeMap.size)},pipe(){return pipeArguments(this,arguments)},toString(){return toString(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(toJSON)}},[NodeInspectSymbol](){return this.toJSON()}},makeContext=unsafeMap=>{let context=Object.create(ContextProto);return context.unsafeMap=unsafeMap,context},isContext=u=>hasProperty(u,TypeId$3),_empty$3=makeContext(new Map),make$4=(tag,service)=>makeContext(new Map([[tag,service]])),empty$6=()=>_empty$3;function fromBitmap(bitmap,bit){var x;return x=bitmap&bit-1,x-=x>>1&1431655765,x=(x=(858993459&x)+(x>>2&858993459))+(x>>4)&252645135,x+=x>>8,127&(x+=x>>16)}class Stack{value;previous;constructor(value,previous){this.value=value,this.previous=previous}}function arrayUpdate(mutate,at,v,arr){let out=arr;if(!mutate){let len=arr.length;out=Array(len);for(let i=0;i<len;++i)out[i]=arr[i]}return out[at]=v,out}function arraySpliceOut(mutate,at,arr){let newLen=arr.length-1,i=0,g=0,out=arr;if(mutate)i=g=at;else for(out=Array(newLen);i<at;)out[g++]=arr[i++];for(++i;i<=newLen;)out[g++]=arr[i++];return mutate&&(out.length=newLen),out}class EmptyNode{_tag="EmptyNode";modify(edit,_shift,f,hash,key,size){let v=f(none());return isNone$1(v)?new EmptyNode:(++size.value,new LeafNode(edit,hash,key,v))}}function isEmptyNode(a){return isTagged(a,"EmptyNode")}function canEditNode(node,edit){return!isEmptyNode(node)&&edit===node.edit}class LeafNode{edit;hash;key;value;_tag="LeafNode";constructor(edit,hash,key,value){this.edit=edit,this.hash=hash,this.key=key,this.value=value}modify(edit,shift,f,hash,key,size){if(equals(key,this.key)){let v=f(this.value);return v===this.value?this:isNone$1(v)?(--size.value,new EmptyNode):canEditNode(this,edit)?(this.value=v,this):new LeafNode(edit,hash,key,v)}let v=f(none());return isNone$1(v)?this:(++size.value,mergeLeaves(edit,shift,this.hash,this,hash,new LeafNode(edit,hash,key,v)))}}class CollisionNode{edit;hash;children;_tag="CollisionNode";constructor(edit,hash,children){this.edit=edit,this.hash=hash,this.children=children}modify(edit,shift,f,hash,key,size){if(hash===this.hash){let canEdit=canEditNode(this,edit),list=this.updateCollisionList(canEdit,edit,this.hash,this.children,f,key,size);return list===this.children?this:list.length>1?new CollisionNode(edit,this.hash,list):list[0]}let v=f(none());return isNone$1(v)?this:(++size.value,mergeLeaves(edit,shift,this.hash,this,hash,new LeafNode(edit,hash,key,v)))}updateCollisionList(mutate,edit,hash,list,f,key,size){let len=list.length;for(let i=0;i<len;++i){let child=list[i];if("key"in child&&equals(key,child.key)){let value=child.value,newValue=f(value);if(newValue===value)return list;if(isNone$1(newValue))return--size.value,arraySpliceOut(mutate,i,list);return arrayUpdate(mutate,i,new LeafNode(edit,hash,key,newValue),list)}}let newValue=f(none());return isNone$1(newValue)?list:(++size.value,arrayUpdate(mutate,len,new LeafNode(edit,hash,key,newValue),list))}}class IndexedNode{edit;mask;children;_tag="IndexedNode";constructor(edit,mask,children){this.edit=edit,this.mask=mask,this.children=children}modify(edit,shift,f,hash,key,size){let newChildren;let mask=this.mask,children=this.children,frag=hash>>>shift&31,bit=1<<frag,indx=fromBitmap(mask,bit),exists=mask&bit,canEdit=canEditNode(this,edit);if(!exists){let _newChild=new EmptyNode().modify(edit,shift+5,f,hash,key,size);return _newChild?children.length>=16?function(edit,frag,child,bitmap,subNodes){let arr=[],bit=bitmap,count=0;for(let i=0;bit;++i)1&bit&&(arr[i]=subNodes[count++]),bit>>>=1;return arr[frag]=child,new ArrayNode(edit,count+1,arr)}(edit,frag,_newChild,mask,children):new IndexedNode(edit,mask|bit,function(mutate,at,v,arr){let len=arr.length;if(mutate){let i=len;for(;i>=at;)arr[i--]=arr[i];return arr[at]=v,arr}let i=0,g=0,out=Array(len+1);for(;i<at;)out[g++]=arr[i++];for(out[at]=v;i<len;)out[++g]=arr[i++];return out}(canEdit,indx,_newChild,children)):this}let current=children[indx],child=current.modify(edit,shift+5,f,hash,key,size);if(current===child)return this;let bitmap=mask;if(isEmptyNode(child)){var node;if(!(bitmap&=~bit))return new EmptyNode;if(children.length<=2&&(isEmptyNode(node=children[1^indx])||"LeafNode"===node._tag||"CollisionNode"===node._tag))return children[1^indx];newChildren=arraySpliceOut(canEdit,indx,children)}else newChildren=arrayUpdate(canEdit,indx,child,children);return canEdit?(this.mask=bitmap,this.children=newChildren,this):new IndexedNode(edit,bitmap,newChildren)}}class ArrayNode{edit;size;children;_tag="ArrayNode";constructor(edit,size,children){this.edit=edit,this.size=size,this.children=children}modify(edit,shift,f,hash,key,size){let newChildren,count=this.size,children=this.children,frag=hash>>>shift&31,child=children[frag],newChild=(child||new EmptyNode).modify(edit,shift+5,f,hash,key,size);if(child===newChild)return this;let canEdit=canEditNode(this,edit);if(isEmptyNode(child)&&!isEmptyNode(newChild))++count,newChildren=arrayUpdate(canEdit,frag,newChild,children);else if(!isEmptyNode(child)&&isEmptyNode(newChild)){if(--count<=8)return function(edit,count,removed,elements){let children=Array(count-1),g=0,bitmap=0;for(let i=0,len=elements.length;i<len;++i)if(i!==removed){let elem=elements[i];elem&&!isEmptyNode(elem)&&(children[g++]=elem,bitmap|=1<<i)}return new IndexedNode(edit,bitmap,children)}(edit,count,frag,children);newChildren=arrayUpdate(canEdit,frag,new EmptyNode,children)}else newChildren=arrayUpdate(canEdit,frag,newChild,children);return canEdit?(this.size=count,this.children=newChildren,this):new ArrayNode(edit,count,newChildren)}}function mergeLeaves(edit,shift,h1,n1,h2,n2){let stack;let currentShift=shift;for(;;){let res=function(edit,shift,h1,n1,h2,n2){if(h1===h2)return new CollisionNode(edit,h1,[n2,n1]);let subH1=h1>>>shift&31,subH2=h2>>>shift&31;return subH1===subH2?child=>new IndexedNode(edit,1<<subH1|1<<subH2,[child]):new IndexedNode(edit,1<<subH1|1<<subH2,subH1<subH2?[n1,n2]:[n2,n1])}(edit,currentShift,h1,n1,h2,n2);if("function"==typeof res)stack=new Stack(res,stack),currentShift+=5;else{let final=res;for(;null!=stack;)final=stack.value(final),stack=stack.previous;return final}}}const HashMapSymbolKey="effect/HashMap",HashMapTypeId=Symbol.for(HashMapSymbolKey),HashMapProto={[HashMapTypeId]:HashMapTypeId,[Symbol.iterator](){return new HashMapIterator(this,(k,v)=>[k,v])},[symbol$1](){let hash$1=hash(HashMapSymbolKey);for(let item of this)hash$1^=pipe(hash(item[0]),combine$1(hash(item[1])));return hash$1},[symbol](that){if(isHashMap(that)){if(that._size!==this._size)return!1;for(let item of this){let elem=pipe(that,getHash(item[0],hash(item[0])));if(isNone$1(elem)||!equals(item[1],elem.value))return!1}return!0}return!1},toString(){return toString(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(toJSON)}},[NodeInspectSymbol](){return this.toJSON()},pipe(){return pipeArguments(this,arguments)}},makeImpl$1=(editable,edit,root,size)=>{let map=Object.create(HashMapProto);return map._editable=editable,map._edit=edit,map._root=root,map._size=size,map};class HashMapIterator{map;f;v;constructor(map,f){this.map=map,this.f=f,this.v=visitLazy(this.map._root,this.f,void 0)}next(){if(isNone$1(this.v))return{done:!0,value:void 0};let v0=this.v.value;return this.v=applyCont(v0.cont),{done:!1,value:v0.value}}[Symbol.iterator](){return new HashMapIterator(this.map,this.f)}}const applyCont=cont=>cont?visitLazyChildren(cont[0],cont[1],cont[2],cont[3],cont[4]):none(),visitLazy=(node,f,cont)=>{switch(node._tag){case"LeafNode":if(isSome$1(node.value))return some$4({value:f(node.key,node.value.value),cont});return applyCont(cont);case"CollisionNode":case"ArrayNode":case"IndexedNode":{let children=node.children;return visitLazyChildren(children.length,children,0,f,cont)}default:return applyCont(cont)}},visitLazyChildren=(len,children,i,f,cont)=>{for(;i<len;){let child=children[i++];if(child&&!isEmptyNode(child))return visitLazy(child,f,[len,children,i,f,cont])}return applyCont(cont)},_empty$2=makeImpl$1(!1,0,new EmptyNode,0),isHashMap=u=>hasProperty(u,HashMapTypeId),getHash=dual(3,(self1,key,hash)=>{let node=self1._root,shift=0;for(;;)switch(node._tag){case"LeafNode":return equals(key,node.key)?node.value:none();case"CollisionNode":if(hash===node.hash){let children=node.children;for(let i=0,len=children.length;i<len;++i){let child=children[i];if("key"in child&&equals(key,child.key))return child.value}}return none();case"IndexedNode":{let bit=1<<(hash>>>shift&31);if(node.mask&bit){node=node.children[fromBitmap(node.mask,bit)],shift+=5;break}return none()}case"ArrayNode":if(node=node.children[hash>>>shift&31]){shift+=5;break}return none();default:return none()}}),set$1=dual(3,(self1,key,value)=>modifyAt(self1,key,()=>some$4(value))),setTree=dual(3,(self1,newRoot,newSize)=>self1._editable?(self1._root=newRoot,self1._size=newSize,self1):newRoot===self1._root?self1:makeImpl$1(self1._editable,self1._edit,newRoot,newSize)),keys$1=self1=>new HashMapIterator(self1,key=>key),size$3=self1=>self1._size,beginMutation$1=self1=>makeImpl$1(!0,self1._edit+1,self1._root,self1._size),modifyAt=dual(3,(self1,key,f)=>modifyHash(self1,key,hash(key),f)),modifyHash=dual(4,(self1,key,hash,f)=>{let size={value:self1._size},newRoot=self1._root.modify(self1._editable?self1._edit:NaN,0,f,hash,key,size);return pipe(self1,setTree(newRoot,size.value))}),forEach$3=dual(2,(self1,f)=>reduce$2(self1,void 0,(_,value,key)=>f(value,key))),reduce$2=dual(3,(self1,zero,f)=>{let children;let root=self1._root;if("LeafNode"===root._tag)return isSome$1(root.value)?f(zero,root.value.value,root.key):zero;if("EmptyNode"===root._tag)return zero;let toVisit=[root.children];for(;children=toVisit.pop();)for(let i=0,len=children.length;i<len;){let child=children[i++];child&&!isEmptyNode(child)&&("LeafNode"===child._tag?isSome$1(child.value)&&(zero=f(zero,child.value.value,child.key)):toVisit.push(child.children))}return zero}),HashSetSymbolKey="effect/HashSet",HashSetTypeId=Symbol.for(HashSetSymbolKey),HashSetProto={[HashSetTypeId]:HashSetTypeId,[Symbol.iterator](){return keys$1(this._keyMap)},[symbol$1](){return combine$1(hash(this._keyMap))(hash(HashSetSymbolKey))},[symbol](that){return!!isHashSet(that)&&size$3(this._keyMap)===size$3(that._keyMap)&&equals(this._keyMap,that._keyMap)},toString(){return toString(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(toJSON)}},[NodeInspectSymbol](){return this.toJSON()},pipe(){return pipeArguments(this,arguments)}},makeImpl=keyMap=>{let set=Object.create(HashSetProto);return set._keyMap=keyMap,set},isHashSet=u=>hasProperty(u,HashSetTypeId),_empty$1=makeImpl(_empty$2),empty$4=()=>_empty$1,beginMutation=self1=>makeImpl(beginMutation$1(self1._keyMap)),endMutation=self1=>(self1._keyMap._editable=!1,self1),mutate=dual(2,(self1,f)=>{let transient=beginMutation(self1);return f(transient),endMutation(transient)}),add$1=dual(2,(self1,value)=>self1._keyMap._editable?(set$1(value,!0)(self1._keyMap),self1):makeImpl(set$1(value,!0)(self1._keyMap))),union$1=dual(2,(self1,that)=>mutate(empty$4(),set=>{for(let value of(forEach$2(self1,value=>add$1(set,value)),that))add$1(set,value)})),forEach$2=dual(2,(self1,f)=>forEach$3(self1._keyMap,(_,k)=>f(k))),size$1=self1=>size$3(self1._keyMap),TypeId$2=Symbol.for("effect/MutableRef"),MutableRefProto={[TypeId$2]:TypeId$2,toString(){return toString(this.toJSON())},toJSON(){return{_id:"MutableRef",current:toJSON(this.current)}},[NodeInspectSymbol](){return this.toJSON()},pipe(){return pipeArguments(this,arguments)}},compareAndSet=dual(3,(self1,oldValue,newValue)=>!!equals(oldValue,self1.current)&&(self1.current=newValue,!0)),get=self1=>self1.current,getAndSet=dual(2,(self1,value)=>{let ret=self1.current;return self1.current=value,ret}),getAndUpdate=dual(2,(self1,f)=>getAndSet(self1,f(get(self1)))),set=dual(2,(self1,value)=>(self1.current=value,self1)),setAndGet=dual(2,(self1,value)=>(self1.current=value,self1.current)),update=dual(2,(self1,f)=>set(self1,f(get(self1)))),updateAndGet=dual(2,(self1,f)=>setAndGet(self1,f(get(self1))));var MutableRef=Object.freeze({__proto__:null,compareAndSet:compareAndSet,decrement:self1=>update(self1,n=>n-1),decrementAndGet:self1=>updateAndGet(self1,n=>n-1),get:get,getAndDecrement:self1=>getAndUpdate(self1,n=>n-1),getAndIncrement:self1=>getAndUpdate(self1,n=>n+1),getAndSet:getAndSet,getAndUpdate:getAndUpdate,increment:self1=>update(self1,n=>n+1),incrementAndGet:self1=>updateAndGet(self1,n=>n+1),make:value=>{let ref=Object.create(MutableRefProto);return ref.current=value,ref},set:set,setAndGet:setAndGet,toggle:self1=>update(self1,_=>!_),update:update,updateAndGet:updateAndGet});const ArrayProto=Object.assign(Object.create(Array.prototype),{[symbol$1](){return array$2(this)},[symbol](that){return!!Array.isArray(that)&&this.length===that.length&&this.every((v,i)=>equals(v,that[i]))}}),Structural$1=function(){function Structural(args){args&&Object.assign(this,args)}return Structural.prototype=StructuralPrototype,Structural}();({...Structural$1.prototype});const ContextPatchTypeId=Symbol.for("effect/DifferContextPatch");function variance$4(a){return a}const PatchProto={...Structural$1.prototype,[ContextPatchTypeId]:{_Value:variance$4,_Patch:variance$4}},_empty=Object.create(Object.assign(Object.create(PatchProto),{_tag:"Empty"})),empty$1=()=>_empty,AndThenProto=Object.assign(Object.create(PatchProto),{_tag:"AndThen"}),makeAndThen=(first,second)=>{let o=Object.create(AndThenProto);return o.first=first,o.second=second,o},AddServiceProto=Object.assign(Object.create(PatchProto),{_tag:"AddService"}),makeAddService=(tag,service)=>{let o=Object.create(AddServiceProto);return o.tag=tag,o.service=service,o},RemoveServiceProto=Object.assign(Object.create(PatchProto),{_tag:"RemoveService"}),makeRemoveService=tag=>{let o=Object.create(RemoveServiceProto);return o.tag=tag,o},UpdateServiceProto=Object.assign(Object.create(PatchProto),{_tag:"UpdateService"}),makeUpdateService=(tag,update)=>{let o=Object.create(UpdateServiceProto);return o.tag=tag,o.update=update,o},diff=(oldValue,newValue)=>{let missingServices=new Map(oldValue.unsafeMap),patch=empty$1();for(let[tag,newService]of newValue.unsafeMap.entries())if(missingServices.has(tag)){let old=missingServices.get(tag);missingServices.delete(tag),equals(old,newService)||(patch=combine(makeUpdateService(tag,()=>newService))(patch))}else missingServices.delete(tag),patch=combine(makeAddService(tag,newService))(patch);for(let[tag]of missingServices.entries())patch=combine(makeRemoveService(tag))(patch);return patch},combine=dual(2,(self1,that)=>makeAndThen(self1,that)),patch=dual(2,(self1,context)=>{let wasServiceUpdated=!1,patches=of$1(self1),updatedContext=new Map(context.unsafeMap);for(;isNonEmpty(patches);){let head=headNonEmpty(patches),tail=tailNonEmpty(patches);switch(head._tag){case"Empty":patches=tail;break;case"AddService":updatedContext.set(head.tag,head.service),patches=tail;break;case"AndThen":patches=prepend$2(prepend$2(tail,head.second),head.first);break;case"RemoveService":updatedContext.delete(head.tag),patches=tail;break;case"UpdateService":updatedContext.set(head.tag,head.update(updatedContext.get(head.tag))),wasServiceUpdated=!0,patches=tail}}if(!wasServiceUpdated)return makeContext(updatedContext);let map=new Map;for(let[tag]of context.unsafeMap)updatedContext.has(tag)&&(map.set(tag,updatedContext.get(tag)),updatedContext.delete(tag));for(let[tag,s]of updatedContext)map.set(tag,s);return makeContext(map)});({...Structural$1.prototype}),({...Structural$1.prototype}),{...Structural$1.prototype};const DifferProto={[Symbol.for("effect/Differ")]:{_P:identity$1,_V:identity$1}},make$1=params=>{let differ=Object.create(DifferProto);return differ.empty=params.empty,differ.diff=params.diff,differ.combine=params.combine,differ.patch=params.patch,differ},environment=()=>make$1({empty:empty$1(),combine:(first,second)=>combine(second)(first),diff:(oldValue,newValue)=>diff(oldValue,newValue),patch:(patch$1,oldValue)=>patch(oldValue)(patch$1)}),OP_EMPTY="Empty",OP_FAIL="Fail",OP_INTERRUPT="Interrupt",OP_PARALLEL="Parallel",OP_SEQUENTIAL="Sequential",CauseSymbolKey="effect/Cause",CauseTypeId=Symbol.for(CauseSymbolKey),proto={[CauseTypeId]:{_E:_=>_},[symbol$1](){return pipe(hash(CauseSymbolKey),combine$1(hash(flattenCause(this))))},[symbol](that){return isCause(that)&&causeEquals(this,that)},pipe(){return pipeArguments(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:toJSON(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:toJSON(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:toJSON(this.left),right:toJSON(this.right)}}},toString(){return pretty(this)},[NodeInspectSymbol](){return this.toJSON()}},fail$1=error=>{let o=Object.create(proto);return o._tag=OP_FAIL,o.error=error,o},parallel=(left,right)=>{let o=Object.create(proto);return o._tag=OP_PARALLEL,o.left=left,o.right=right,o},sequential=(left,right)=>{let o=Object.create(proto);return o._tag=OP_SEQUENTIAL,o.left=left,o.right=right,o},isCause=u=>hasProperty(u,CauseTypeId),isInterruptedOnly=self1=>reduceWithContext(void 0,IsInterruptedOnlyCauseReducer)(self1),causeEquals=(left,right)=>{let leftStack=of$1(left),rightStack=of$1(right);for(;isNonEmpty(leftStack)&&isNonEmpty(rightStack);){let[leftParallel,leftSequential]=pipe(headNonEmpty(leftStack),reduce([empty$4(),empty$8()],([parallel,sequential],cause)=>{let[par,seq]=evaluateCause(cause);return some$4([pipe(parallel,union$1(par)),pipe(sequential,appendAll$1(seq))])})),[rightParallel,rightSequential]=pipe(headNonEmpty(rightStack),reduce([empty$4(),empty$8()],([parallel,sequential],cause)=>{let[par,seq]=evaluateCause(cause);return some$4([pipe(parallel,union$1(par)),pipe(sequential,appendAll$1(seq))])}));if(!equals(leftParallel,rightParallel))return!1;leftStack=leftSequential,rightStack=rightSequential}return!0},flattenCause=cause=>flattenCauseLoop(of$1(cause),empty$8()),flattenCauseLoop=(causes,flattened)=>{for(;;){let[parallel,sequential]=pipe(causes,reduce$4([empty$4(),empty$8()],([parallel,sequential],cause)=>{let[par,seq]=evaluateCause(cause);return[pipe(parallel,union$1(par)),pipe(sequential,appendAll$1(seq))]})),updated=size$1(parallel)>0?pipe(flattened,prepend$2(parallel)):flattened;if(isEmpty$1(sequential))return reverse$1(updated);causes=sequential,flattened=updated}throw Error("BUG: Cause.flattenCauseLoop - please report an issue at https://github.com/Effect-TS/effect/issues")},evaluateCause=self1=>{let cause=self1,stack=[],_parallel=empty$4(),_sequential=empty$8();for(;void 0!==cause;)switch(cause._tag){case OP_EMPTY:if(0===stack.length)return[_parallel,_sequential];cause=stack.pop();break;case OP_FAIL:if(_parallel=add$1(_parallel,cause.error),0===stack.length)return[_parallel,_sequential];cause=stack.pop();break;case"Die":if(_parallel=add$1(_parallel,cause.defect),0===stack.length)return[_parallel,_sequential];cause=stack.pop();break;case OP_INTERRUPT:if(_parallel=add$1(_parallel,cause.fiberId),0===stack.length)return[_parallel,_sequential];cause=stack.pop();break;case OP_SEQUENTIAL:switch(cause.left._tag){case OP_EMPTY:cause=cause.right;break;case OP_SEQUENTIAL:cause=sequential(cause.left.left,sequential(cause.left.right,cause.right));break;case OP_PARALLEL:cause=parallel(sequential(cause.left.left,cause.right),sequential(cause.left.right,cause.right));break;default:_sequential=prepend$2(_sequential,cause.right),cause=cause.left}break;case OP_PARALLEL:stack.push(cause.right),cause=cause.left}throw Error("BUG: Cause.evaluateCauseLoop - please report an issue at https://github.com/Effect-TS/effect/issues")},IsInterruptedOnlyCauseReducer={emptyCase:constTrue,failCase:constFalse,dieCase:constFalse,interruptCase:constTrue,sequentialCase:(_,left,right)=>left&&right,parallelCase:(_,left,right)=>left&&right},OP_SEQUENTIAL_CASE="SequentialCase",OP_PARALLEL_CASE="ParallelCase",reduce=dual(3,(self1,zero,pf)=>{let accumulator=zero,cause=self1,causes=[];for(;void 0!==cause;){let option=pf(accumulator,cause);switch(accumulator=isSome$1(option)?option.value:accumulator,cause._tag){case OP_SEQUENTIAL:case OP_PARALLEL:causes.push(cause.right),cause=cause.left;break;default:cause=void 0}void 0===cause&&causes.length>0&&(cause=causes.pop())}return accumulator}),reduceWithContext=dual(3,(self1,context,reducer)=>{let input=[self1],output=[];for(;input.length>0;){let cause=input.pop();switch(cause._tag){case OP_EMPTY:output.push(right$1(reducer.emptyCase(context)));break;case OP_FAIL:output.push(right$1(reducer.failCase(context,cause.error)));break;case"Die":output.push(right$1(reducer.dieCase(context,cause.defect)));break;case OP_INTERRUPT:output.push(right$1(reducer.interruptCase(context,cause.fiberId)));break;case OP_SEQUENTIAL:input.push(cause.right),input.push(cause.left),output.push(left$1({_tag:OP_SEQUENTIAL_CASE}));break;case OP_PARALLEL:input.push(cause.right),input.push(cause.left),output.push(left$1({_tag:OP_PARALLEL_CASE}))}}let accumulator=[];for(;output.length>0;){let either=output.pop();switch(either._tag){case"Left":switch(either.left._tag){case OP_SEQUENTIAL_CASE:{let left=accumulator.pop(),right=accumulator.pop(),value=reducer.sequentialCase(context,left,right);accumulator.push(value);break}case OP_PARALLEL_CASE:{let left=accumulator.pop(),right=accumulator.pop(),value=reducer.parallelCase(context,left,right);accumulator.push(value)}}break;case"Right":accumulator.push(either.right)}}if(0===accumulator.length)throw Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return accumulator.pop()}),filterStack=stack=>{let lines=stack.split("\n"),out=[];for(let i=0;i<lines.length&&!(lines[i].includes("EffectPrimitive")||lines[i].includes("Generator.next")||lines[i].includes("FiberRuntime"));i++)out.push(lines[i]);return out.join("\n")},pretty=cause=>isInterruptedOnly(cause)?"All fibers interrupted without errors.":prettyErrors(cause).map(e=>{let message=e.message;if(e.stack&&(message+=`\r
|
|
2
2
|
${filterStack(e.stack)}`),e.span){let current=e.span,i=0;for(;current&&"Span"===current._tag&&i<10;)message+=`\r
|
|
3
|
-
at ${current.name}`,current=getOrUndefined$1(current.parent),i++}return message}).join("\r\n");class PrettyError{message;stack;span;constructor(message,stack,span){this.message=message,this.stack=stack,this.span=span}toJSON(){let out={message:this.message};return this.stack&&(out.stack=this.stack),this.span&&(out.span=this.span),out}}const prettyErrorMessage=u=>"string"==typeof u?`Error: ${u}`:hasProperty(u,"toString")&&isFunction$1(u.toString)&&u.toString!==Object.prototype.toString?u.toString():`Error: ${JSON.stringify(u)}`,spanSymbol$1=Symbol.for("effect/SpanAnnotation"),defaultRenderError=error=>{let span=hasProperty(error,spanSymbol$1)&&error[spanSymbol$1];return error instanceof Error?new PrettyError(prettyErrorMessage(error),error.stack?.split("\n").filter(_=>_.match(/at (.*)/)).join("\n"),span):new PrettyError(prettyErrorMessage(error),void 0,span)},prettyErrors=cause=>reduceWithContext(cause,void 0,{emptyCase:()=>[],dieCase:(_,unknownError)=>[defaultRenderError(unknownError)],failCase:(_,error)=>[defaultRenderError(error)],interruptCase:()=>[],parallelCase:(_,l,r)=>[...l,...r],sequentialCase:(_,l,r)=>[...l,...r]}),spanTag=(identifier=>{if(identifier&&tagRegistry.has(identifier))return tagRegistry.get(identifier);let limit=Error.stackTraceLimit;Error.stackTraceLimit=2;let creationError=Error();Error.stackTraceLimit=limit;let tag=Object.create(TagProto);return Object.defineProperty(tag,"stack",{get:()=>creationError.stack}),identifier&&(tag.identifier=identifier,tagRegistry.set(identifier,tag)),tag})(Symbol.for("effect/ParentSpan")),EffectTypeId=Symbol.for("effect/Effect");class EffectPrimitive{_op;i0=void 0;i1=void 0;i2=void 0;trace=void 0;[EffectTypeId]=effectVariance;constructor(_op){this._op=_op}[symbol](that){return this===that}[symbol$1](){return random(this)}pipe(){return pipeArguments(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,i0:toJSON(this.i0),i1:toJSON(this.i1),i2:toJSON(this.i2)}}toString(){return toString(this.toJSON())}[NodeInspectSymbol](){return this.toJSON()}}class EffectPrimitiveFailure{_op;i0=void 0;i1=void 0;i2=void 0;trace=void 0;[EffectTypeId]=effectVariance;constructor(_op){this._op=_op,this._tag=_op}[symbol](that){return this===that}[symbol$1](){return random(this)}get cause(){return this.i0}pipe(){return pipeArguments(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return toString(this.toJSON())}[NodeInspectSymbol](){return this.toJSON()}}const withFiberRuntime=withRuntime=>{let effect=new EffectPrimitive("WithRuntime");return effect.i0=withRuntime,effect},spanSymbol=Symbol.for("effect/SpanAnnotation"),originalSymbol=Symbol.for("effect/OriginalAnnotation"),capture=(obj,span)=>isSome$1(span)?new Proxy(obj,{has:(target,p)=>p===spanSymbol||p===originalSymbol||p in target,get:(target,p)=>p===spanSymbol?span.value:p===originalSymbol?obj:target[p]}):obj,fail=error=>!isObject(error)||spanSymbol in error?failCause(fail$1(error)):withFiberRuntime(fiber=>failCause(fail$1(capture(error,currentSpanFromFiber(fiber))))),failCause=cause=>{let effect=new EffectPrimitiveFailure("Failure");return effect.i0=cause,effect},FiberRefTypeId=Symbol.for("effect/FiberRef"),fiberRefVariance={_A:_=>_},fiberRefUnsafeMakeContext=initial=>{let differ=environment();return fiberRefUnsafeMakePatch(initial,{differ,fork:differ.empty})},fiberRefUnsafeMakePatch=(initial,options)=>({[FiberRefTypeId]:fiberRefVariance,initial,diff:(oldValue,newValue)=>options.differ.diff(oldValue,newValue),combine:(first,second)=>options.differ.combine(first,second),patch:patch=>oldValue=>options.differ.patch(patch,oldValue),fork:options.fork,join:options.join??((_,n)=>n),pipe(){return pipeArguments(this,arguments)}}),currentContext=globalValue(Symbol.for("effect/FiberRef/currentContext"),()=>fiberRefUnsafeMakeContext(empty$6())),YieldableError=function(){class YieldableError extends globalThis.Error{commit(){return fail(this)}toString(){return this.stack??`${this.name}: ${this.message}`}toJSON(){return{...this}}[NodeInspectSymbol](){return this.toString()}}return Object.assign(YieldableError.prototype,StructuralCommitPrototype),YieldableError}(),currentSpanFromFiber=fiber=>{let span=fiber.getFiberRef(currentContext).unsafeMap.get(spanTag);return void 0!==span&&"Span"===span._tag?some$4(span):none()},struct=as=>Object.assign(Object.create(StructuralPrototype),as),unsafeArray=as=>Object.setPrototypeOf(as,ArrayProto),tagged=tag=>args=>{let value=void 0===args?Object.create(StructuralPrototype):struct(args);return value._tag=tag,value},Class=Structural$1,Error$1=class extends YieldableError{constructor(args){super(),args&&Object.assign(this,args)}};var Data=Object.freeze({__proto__:null,Class:Class,Error:Error$1,Structural:Structural$1,TaggedClass:tag=>class extends Class{_tag=tag},TaggedError:tag=>{class Base extends Error$1{_tag=tag}return Base.prototype.name=tag,Base},array:as=>unsafeArray(as.slice(0)),case:()=>args=>void 0===args?Object.create(StructuralPrototype):struct(args),struct:struct,tagged:tagged,taggedEnum:()=>new Proxy({},{get:(_target,tag,_receiver)=>tagged(tag)}),tuple:(...as)=>unsafeArray(as),unsafeArray:unsafeArray,unsafeStruct:as=>Object.setPrototypeOf(as,StructuralPrototype)});const KEYS={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(const type of Object.keys(KEYS))Object.freeze(KEYS[type]);Object.freeze(KEYS);const KEY_BLACKLIST=new Set(["parent","leadingComments","trailingComments"]);function filterKey(key){return!KEY_BLACKLIST.has(key)&&"_"!==key[0]}function negate0(token){return!this(token)}function negate(f){return negate0.bind(f)}function isPunctuatorTokenWithValue(token,value){return"Punctuator"===token.type&&token.value===value}negate(function(token){return isPunctuatorTokenWithValue(token,"=>")}),negate(function(token){return isPunctuatorTokenWithValue(token,",")}),negate(function(token){return isPunctuatorTokenWithValue(token,";")}),negate(function(token){return isPunctuatorTokenWithValue(token,":")}),negate(function(token){return isPunctuatorTokenWithValue(token,"(")}),negate(function(token){return isPunctuatorTokenWithValue(token,")")}),negate(function(token){return isPunctuatorTokenWithValue(token,"[")}),negate(function(token){return isPunctuatorTokenWithValue(token,"]")}),negate(function(token){return isPunctuatorTokenWithValue(token,"{")}),negate(function(token){return isPunctuatorTokenWithValue(token,"}")}),negate(function(token){return["Block","Line","Shebang"].includes(token.type)});const globalObject="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},builtinNames=Object.freeze(new Set(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),callAllowed=new Set([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(k=>"random"!==k).map(k=>Math[k]).filter(f=>"function"==typeof f),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(f=>"function"==typeof f)),callPassThrough=new Set([Object.freeze,Object.preventExtensions,Object.seal]),getterAllowed=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function getElementValues(nodeList,initialScope){let valueList=[];for(let i=0;i<nodeList.length;++i){let elementNode=nodeList[i];if(null==elementNode)valueList.length=i+1;else if("SpreadElement"===elementNode.type){let argument=getStaticValueR(elementNode.argument,initialScope);if(null==argument)return null;valueList.push(...argument.value)}else{let element=getStaticValueR(elementNode,initialScope);if(null==element)return null;valueList.push(element.value)}}return valueList}const operations=Object.freeze({ArrayExpression(node,initialScope){let elements=getElementValues(node.elements,initialScope);return null!=elements?{value:elements}:null},AssignmentExpression:(node,initialScope)=>"="===node.operator?getStaticValueR(node.right,initialScope):null,BinaryExpression(node,initialScope){if("in"===node.operator||"instanceof"===node.operator)return null;let left=getStaticValueR(node.left,initialScope),right=getStaticValueR(node.right,initialScope);if(null!=left&&null!=right)switch(node.operator){case"==":return{value:left.value==right.value};case"!=":return{value:left.value!=right.value};case"===":return{value:left.value===right.value};case"!==":return{value:left.value!==right.value};case"<":return{value:left.value<right.value};case"<=":return{value:left.value<=right.value};case">":return{value:left.value>right.value};case">=":return{value:left.value>=right.value};case"<<":return{value:left.value<<right.value};case">>":return{value:left.value>>right.value};case">>>":return{value:left.value>>>right.value};case"+":return{value:left.value+right.value};case"-":return{value:left.value-right.value};case"*":return{value:left.value*right.value};case"/":return{value:left.value/right.value};case"%":return{value:left.value%right.value};case"**":return{value:left.value**right.value};case"|":return{value:left.value|right.value};case"^":return{value:left.value^right.value};case"&":return{value:left.value&right.value}}return null},CallExpression(node,initialScope){let calleeNode=node.callee,args=getElementValues(node.arguments,initialScope);if(null!=args){if("MemberExpression"===calleeNode.type){if("PrivateIdentifier"===calleeNode.property.type)return null;let object=getStaticValueR(calleeNode.object,initialScope);if(null!=object){if(null==object.value&&(object.optional||node.optional))return{value:void 0,optional:!0};let property=getStaticPropertyNameValue(calleeNode,initialScope);if(null!=property){let receiver=object.value,methodName=property.value;if(callAllowed.has(receiver[methodName]))return{value:receiver[methodName](...args)};if(callPassThrough.has(receiver[methodName]))return{value:args[0]}}}}else{let callee=getStaticValueR(calleeNode,initialScope);if(null!=callee){if(null==callee.value&&node.optional)return{value:void 0,optional:!0};let func=callee.value;if(callAllowed.has(func))return{value:func(...args)};if(callPassThrough.has(func))return{value:args[0]}}}}return null},ConditionalExpression(node,initialScope){let test=getStaticValueR(node.test,initialScope);return null!=test?test.value?getStaticValueR(node.consequent,initialScope):getStaticValueR(node.alternate,initialScope):null},ExpressionStatement:(node,initialScope)=>getStaticValueR(node.expression,initialScope),Identifier(node,initialScope){if(null!=initialScope){let variable=function(initialScope,nameOrNode){let name="",scope=initialScope;for("string"==typeof nameOrNode?name=nameOrNode:(name=nameOrNode.name,scope=function(initialScope,node){let location=node.range[0],scope=initialScope,found=!1;do for(let childScope of(found=!1,scope.childScopes)){let range=childScope.block.range;if(range[0]<=location&&location<range[1]){scope=childScope,found=!0;break}}while(found);return scope}(scope,nameOrNode));null!=scope;){let variable=scope.set.get(name);if(null!=variable)return variable;scope=scope.upper}return null}(initialScope,node);if(null!=variable&&0===variable.defs.length&&builtinNames.has(variable.name)&&variable.name in globalObject)return{value:globalObject[variable.name]};if(null!=variable&&1===variable.defs.length){let def=variable.defs[0];if(def.parent&&"Variable"===def.type&&("const"===def.parent.kind||function(variable){let refs=variable.references,inits=refs.filter(r=>r.init).length,reads=refs.filter(r=>r.isReadOnly()).length;return 1===inits&&reads+inits===refs.length}(variable))&&"Identifier"===def.node.id.type)return getStaticValueR(def.node.init,initialScope)}}return null},Literal:node=>(null!=node.regex||null!=node.bigint)&&null==node.value?null:{value:node.value},LogicalExpression(node,initialScope){let left=getStaticValueR(node.left,initialScope);if(null!=left){if("||"===node.operator&&!0==!!left.value||"&&"===node.operator&&!1==!!left.value||"??"===node.operator&&null!=left.value)return left;let right=getStaticValueR(node.right,initialScope);if(null!=right)return right}return null},MemberExpression(node,initialScope){if("PrivateIdentifier"===node.property.type)return null;let object=getStaticValueR(node.object,initialScope);if(null!=object){if(null==object.value&&(object.optional||node.optional))return{value:void 0,optional:!0};let property=getStaticPropertyNameValue(node,initialScope);if(null!=property){if(!function(object,name){let d=function(object,name){let x=object;for(;("object"==typeof x||"function"==typeof x)&&null!==x;){let d=Object.getOwnPropertyDescriptor(x,name);if(d)return d;x=Object.getPrototypeOf(x)}return null}(object,name);return null!=d&&null!=d.get}(object.value,property.value))return{value:object.value[property.value]};for(let[classFn,allowed]of getterAllowed)if(object.value instanceof classFn&&allowed.has(property.value))return{value:object.value[property.value]}}}return null},ChainExpression(node,initialScope){let expression=getStaticValueR(node.expression,initialScope);return null!=expression?{value:expression.value}:null},NewExpression(node,initialScope){let callee=getStaticValueR(node.callee,initialScope),args=getElementValues(node.arguments,initialScope);if(null!=callee&&null!=args){let Func=callee.value;if(callAllowed.has(Func))return{value:new Func(...args)}}return null},ObjectExpression(node,initialScope){let object={};for(let propertyNode of node.properties)if("Property"===propertyNode.type){if("init"!==propertyNode.kind)return null;let key=getStaticPropertyNameValue(propertyNode,initialScope),value=getStaticValueR(propertyNode.value,initialScope);if(null==key||null==value)return null;object[key.value]=value.value}else{if("SpreadElement"!==propertyNode.type&&"ExperimentalSpreadProperty"!==propertyNode.type)return null;let argument=getStaticValueR(propertyNode.argument,initialScope);if(null==argument)return null;Object.assign(object,argument.value)}return{value:object}},SequenceExpression:(node,initialScope)=>getStaticValueR(node.expressions[node.expressions.length-1],initialScope),TaggedTemplateExpression(node,initialScope){let tag=getStaticValueR(node.tag,initialScope),expressions=getElementValues(node.quasi.expressions,initialScope);if(null!=tag&&null!=expressions){let func=tag.value,strings=node.quasi.quasis.map(q=>q.value.cooked);if(strings.raw=node.quasi.quasis.map(q=>q.value.raw),func===String.raw)return{value:func(strings,...expressions)}}return null},TemplateLiteral(node,initialScope){let expressions=getElementValues(node.expressions,initialScope);if(null!=expressions){let value=node.quasis[0].value.cooked;for(let i=0;i<expressions.length;++i)value+=expressions[i]+node.quasis[i+1].value.cooked;return{value}}return null},UnaryExpression(node,initialScope){if("delete"===node.operator)return null;if("void"===node.operator)return{value:void 0};let arg=getStaticValueR(node.argument,initialScope);if(null!=arg)switch(node.operator){case"-":return{value:-arg.value};case"+":return{value:+arg.value};case"!":return{value:!arg.value};case"~":return{value:~arg.value};case"typeof":return{value:typeof arg.value}}return null}});function getStaticValueR(node,initialScope){return null!=node&&Object.hasOwnProperty.call(operations,node.type)?operations[node.type](node,initialScope):null}function getStaticPropertyNameValue(node,initialScope){let nameNode="Property"===node.type?node.key:node.property;return node.computed?getStaticValueR(nameNode,initialScope):"Identifier"===nameNode.type?{value:nameNode.name}:"Literal"===nameNode.type?nameNode.bigint?{value:nameNode.bigint}:{value:String(nameNode.value)}:null}const typeConversionBinaryOps=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),typeConversionUnaryOps=Object.freeze(new Set(["-","+","!","~"]));function isNode(x){return null!==x&&"object"==typeof x&&"string"==typeof x.type}Object.freeze(Object.assign(Object.create(null),{$visit(node,options,visitorKeys){let{type}=node;return"function"==typeof this[type]?this[type](node,options,visitorKeys):this.$visitChildren(node,options,visitorKeys)},$visitChildren(node,options,visitorKeys){let{type}=node;for(let key of visitorKeys[type]||Object.keys(node).filter(filterKey)){let value=node[key];if(Array.isArray(value)){for(let element of value)if(isNode(element)&&this.$visit(element,options,visitorKeys))return!0}else if(isNode(value)&&this.$visit(value,options,visitorKeys))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(node,options,visitorKeys){return!!(options.considerImplicitTypeConversion&&typeConversionBinaryOps.has(node.operator))&&("Literal"!==node.left.type||"Literal"!==node.right.type)||this.$visitChildren(node,options,visitorKeys)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(node,options,visitorKeys){return!!options.considerGetters||!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.property.type||this.$visitChildren(node,options,visitorKeys)},MethodDefinition(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},NewExpression:()=>!0,Property(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},PropertyDefinition(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},UnaryExpression(node,options,visitorKeys){return!!("delete"===node.operator||options.considerImplicitTypeConversion&&typeConversionUnaryOps.has(node.operator)&&"Literal"!==node.argument.type)||this.$visitChildren(node,options,visitorKeys)},UpdateExpression:()=>!0,YieldExpression:()=>!0})),Function.call.bind(Object.hasOwnProperty);const isString$1=input=>"string"==typeof input,isNullable=input=>null==input,t$1=Symbol.for("@ts-pattern/matcher"),e$1=Symbol.for("@ts-pattern/isVariadic"),n$1="@ts-pattern/anonymous-select-key",r$1=t=>!!(t&&"object"==typeof t),i$1=e=>e&&!!e[t$1],s$1=(n,o,c)=>{if(i$1(n)){let{matched:r,selections:i}=n[t$1]().match(o);return r&&i&&Object.keys(i).forEach(t=>c(t,i[t])),r}if(r$1(n)){if(!r$1(o))return!1;if(Array.isArray(n)){if(!Array.isArray(o))return!1;let t=[],r=[],a=[];for(let s of n.keys()){let o=n[s];i$1(o)&&o[e$1]?a.push(o):a.length?r.push(o):t.push(o)}if(a.length){if(a.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(o.length<t.length+r.length)return!1;let e=o.slice(0,t.length),n=0===r.length?[]:o.slice(-r.length),i=o.slice(t.length,0===r.length?1/0:-r.length);return t.every((t,n)=>s$1(t,e[n],c))&&r.every((t,e)=>s$1(t,n[e],c))&&(0===a.length||s$1(a[0],i,c))}return n.length===o.length&&n.every((t,e)=>s$1(t,o[e],c))}return Object.keys(n).every(e=>{let r=n[e];return(e in o||i$1(r)&&"optional"===r[t$1]().matcherType)&&s$1(r,o[e],c)})}return Object.is(o,n)},o$1=e=>{var n,s,a;return r$1(e)?i$1(e)?null!=(n=null==(s=(a=e[t$1]()).getSelectionKeys)?void 0:s.call(a))?n:[]:Array.isArray(e)?c$1(e,o$1):c$1(Object.values(e),o$1):[]},c$1=(t,e)=>t.reduce((t,n)=>t.concat(e(n)),[]);function a$1(...t){if(1===t.length){let[e]=t;return t=>s$1(e,t,()=>{})}if(2===t.length){let[e,n]=t;return s$1(e,n,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function u$1(t){return Object.assign(t,{optional:()=>l$1(t),and:e=>m$1(t,e),or:e=>y$1(t,e),select:e=>void 0===e?p$1(t):p$1(e,t)})}function l$1(e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return void 0===t?(o$1(e).forEach(t=>r(t,void 0)),{matched:!0,selections:n}):{matched:s$1(e,t,r),selections:n}},getSelectionKeys:()=>o$1(e),matcherType:"optional"})})}const f$1=(t,e)=>{for(let n of t)if(!e(n))return!1;return!0},g$1=(t,e)=>{for(let[n,r]of t.entries())if(!e(r,n))return!1;return!0};function m$1(...e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return{matched:e.every(e=>s$1(e,t,r)),selections:n}},getSelectionKeys:()=>c$1(e,o$1),matcherType:"and"})})}function y$1(...e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return c$1(e,o$1).forEach(t=>r(t,void 0)),{matched:e.some(e=>s$1(e,t,r)),selections:n}},getSelectionKeys:()=>c$1(e,o$1),matcherType:"or"})})}function d$1(e){return{[t$1]:()=>({match:t=>({matched:!!e(t)})})}}function p$1(...e){let r="string"==typeof e[0]?e[0]:void 0,i=2===e.length?e[1]:"string"==typeof e[0]?void 0:e[0];return u$1({[t$1]:()=>({match:t=>{let e={[null!=r?r:n$1]:t};return{matched:void 0===i||s$1(i,t,(t,n)=>{e[t]=n}),selections:e}},getSelectionKeys:()=>[null!=r?r:n$1].concat(void 0===i?[]:o$1(i))})})}function v$1(t){return"number"==typeof t}function b$1(t){return"string"==typeof t}function w$1(t){return"bigint"==typeof t}const S$1=u$1(d$1(function(t){return!0})),j$1=t=>Object.assign(u$1(t),{startsWith:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.startsWith(e)))),endsWith:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.endsWith(e)))),minLength:e=>j$1(m$1(t,d$1(e1=>b$1(e1)&&e1.length>=e))),maxLength:e=>j$1(m$1(t,d$1(e1=>b$1(e1)&&e1.length<=e))),includes:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.includes(e)))),regex:e=>j$1(m$1(t,d$1(t=>b$1(t)&&!!t.match(e))))}),E$1=j$1(d$1(b$1)),K$1=t=>Object.assign(u$1(t),{between:(e,n)=>K$1(m$1(t,d$1(n1=>v$1(n1)&&e<=n1&&n>=n1))),lt:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1<e))),gt:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1>e))),lte:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1<=e))),gte:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1>=e))),int:()=>K$1(m$1(t,d$1(t=>v$1(t)&&Number.isInteger(t)))),finite:()=>K$1(m$1(t,d$1(t=>v$1(t)&&Number.isFinite(t)))),positive:()=>K$1(m$1(t,d$1(t=>v$1(t)&&t>0))),negative:()=>K$1(m$1(t,d$1(t=>v$1(t)&&t<0)))}),A$1=K$1(d$1(v$1)),x$1=t=>Object.assign(u$1(t),{between:(e,n)=>x$1(m$1(t,d$1(n1=>w$1(n1)&&e<=n1&&n>=n1))),lt:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1<e))),gt:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1>e))),lte:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1<=e))),gte:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1>=e))),positive:()=>x$1(m$1(t,d$1(t=>w$1(t)&&t>0))),negative:()=>x$1(m$1(t,d$1(t=>w$1(t)&&t<0)))}),P$1=x$1(d$1(w$1)),T$1=u$1(d$1(function(t){return"boolean"==typeof t})),k$1=u$1(d$1(function(t){return"symbol"==typeof t})),B$1=u$1(d$1(function(t){return null==t}));var _$1={__proto__:null,matcher:t$1,optional:l$1,array:function(...e){return function h$1(t){return Object.assign(Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[e$1]:!0})}}),{optional:()=>h$1(l$1(t)),select:e=>h$1(void 0===e?p$1(t):p$1(e,t))})}({[t$1]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(0===e.length)return{matched:!0};let n=e[0],r={};if(0===t.length)return o$1(n).forEach(t=>{r[t]=[]}),{matched:!0,selections:r};let i=(t,e)=>{r[t]=(r[t]||[]).concat([e])};return{matched:t.every(t=>s$1(n,t,i)),selections:r}},getSelectionKeys:()=>0===e.length?[]:o$1(e[0])})})},set:function(...e){return u$1({[t$1]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(0===t.size)return{matched:!0,selections:n};if(0===e.length)return{matched:!0};let r=(t,e)=>{n[t]=(n[t]||[]).concat([e])},i=e[0];return{matched:f$1(t,t=>s$1(i,t,r)),selections:n}},getSelectionKeys:()=>0===e.length?[]:o$1(e[0])})})},map:function(...e){return u$1({[t$1]:()=>({match:t=>{var i;if(!(t instanceof Map))return{matched:!1};let n={};if(0===t.size)return{matched:!0,selections:n};let r=(t,e)=>{n[t]=(n[t]||[]).concat([e])};if(0===e.length)return{matched:!0};if(1===e.length)throw Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(i=e[0])?void 0:i.toString()}`);let[o,c]=e;return{matched:g$1(t,(t,e)=>{let n=s$1(o,e,r),i=s$1(c,t,r);return n&&i}),selections:n}},getSelectionKeys:()=>0===e.length?[]:[...o$1(e[0]),...o$1(e[1])]})})},intersection:m$1,union:y$1,not:function(e){return u$1({[t$1]:()=>({match:t=>({matched:!s$1(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:d$1,select:p$1,any:S$1,_:S$1,string:E$1,number:A$1,bigint:P$1,boolean:T$1,symbol:k$1,nullish:B$1,instanceOf:function(t){return u$1(d$1(e=>e instanceof t))},shape:function(t){return u$1(d$1(a$1(t)))}};const NodeType=types.AST_NODE_TYPES,is=utils.ASTUtils.isNodeOfType,isOneOf=utils.ASTUtils.isNodeOfTypes;isOneOf([NodeType.ArrowFunctionExpression,NodeType.FunctionDeclaration,NodeType.FunctionExpression]),isOneOf([NodeType.ArrowFunctionExpression,NodeType.FunctionDeclaration,NodeType.FunctionExpression,NodeType.TSCallSignatureDeclaration,NodeType.TSConstructSignatureDeclaration,NodeType.TSDeclareFunction,NodeType.TSEmptyBodyFunctionExpression,NodeType.TSFunctionType,NodeType.TSMethodSignature]),isOneOf([NodeType.ClassDeclaration,NodeType.ClassExpression]),isOneOf([NodeType.DoWhileStatement,NodeType.ForInStatement,NodeType.ForOfStatement,NodeType.ForStatement,NodeType.WhileStatement]),isOneOf([NodeType.TSArrayType,NodeType.TSTupleType]),isOneOf([NodeType.PropertyDefinition,NodeType.TSIndexSignature,NodeType.TSParameterProperty,NodeType.TSPropertySignature]),is(NodeType.JSXElement),is(NodeType.JSXFragment),isOneOf([NodeType.JSXAttribute,NodeType.JSXSpreadChild,NodeType.JSXClosingElement,NodeType.JSXClosingFragment,NodeType.JSXElement,NodeType.JSXEmptyExpression,NodeType.JSXExpressionContainer,NodeType.JSXFragment,NodeType.JSXIdentifier,NodeType.JSXMemberExpression,NodeType.JSXNamespacedName,NodeType.JSXOpeningElement,NodeType.JSXOpeningFragment,NodeType.JSXSpreadAttribute,NodeType.JSXSpreadChild,NodeType.JSXText]);const isJSXTagNameExpression=isOneOf([NodeType.JSXIdentifier,NodeType.JSXMemberExpression,NodeType.JSXNamespacedName]);isOneOf([NodeType.ArrayPattern,NodeType.AssignmentPattern,NodeType.ObjectPattern,NodeType.RestElement]),isOneOf([NodeType.TSInterfaceDeclaration,NodeType.TSTypeAliasDeclaration]),isOneOf([NodeType.ArrayExpression,NodeType.ArrayPattern,NodeType.ArrowFunctionExpression,NodeType.CallExpression,NodeType.ClassExpression,NodeType.FunctionExpression,NodeType.Identifier,NodeType.JSXElement,NodeType.JSXFragment,NodeType.Literal,NodeType.TemplateLiteral,NodeType.MemberExpression,NodeType.MetaProperty,NodeType.ObjectExpression,NodeType.ObjectPattern,NodeType.SequenceExpression,NodeType.Super,NodeType.TaggedTemplateExpression,NodeType.ThisExpression]),isOneOf([NodeType.ArrayExpression,NodeType.ArrayPattern,NodeType.ArrowFunctionExpression,NodeType.CallExpression,NodeType.ClassExpression,NodeType.FunctionExpression,NodeType.Identifier,NodeType.JSXElement,NodeType.JSXFragment,NodeType.Literal,NodeType.TemplateLiteral,NodeType.MemberExpression,NodeType.MetaProperty,NodeType.ObjectExpression,NodeType.ObjectPattern,NodeType.SequenceExpression,NodeType.Super,NodeType.TaggedTemplateExpression,NodeType.ThisExpression,NodeType.TSAsExpression,NodeType.TSNonNullExpression,NodeType.TSTypeAssertion]),Data.taggedEnum().None(),NodeType.JSXElement,NodeType.ArrayExpression,NodeType.ObjectExpression,NodeType.FunctionExpression,NodeType.ArrowFunctionExpression,NodeType.ClassExpression,NodeType.NewExpression,NodeType.CallExpression;const getStaticValue=function(node,initialScope=null){try{return getStaticValueR(node,initialScope)}catch(_error){return null}};function traverseUp(node,predicate){let{parent}=node;return parent&&parent.type!==NodeType.Program?predicate(parent)?parent:traverseUp(parent,predicate):null}function findVariableByName(name){return variables=>Option.fromNullable(variables.find(variable=>variable.name===name))}function getVariablesUpToGlobal(startScope){let scopeRef=MutableRef.make(startScope),variablesRef=MutableRef.make(MutableRef.get(scopeRef).variables);for(;MutableRef.get(scopeRef).type!==scopeManager.ScopeType.global;)MutableRef.set(scopeRef,MutableRef.get(scopeRef).upper),MutableRef.update(variablesRef,variables=>variables.concat(MutableRef.get(scopeRef).variables));return MutableRef.get(variablesRef).reverse()}function resolveDefinitionInit(def){return"init"in def.node&&!isNullable(def.node.init)?Option.some(def.node.init):Option.none()}function getVariableInit(at){return variable=>Function$1.pipe(Option.some(variable),Option.flatMapNullable(v=>v.defs.at(at)),Option.flatMap(resolveDefinitionInit))}a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.Property,parent:{type:NodeType.ObjectExpression}}}),a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.MethodDefinition,parent:{type:NodeType.ClassBody}}}),a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.Property,parent:{type:NodeType.ClassBody}}});const isString=input=>"string"==typeof input;var DEFAULT_OPTIONS_KEYS={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},slice=Array.prototype.slice;function cloneArray(arrayLike){var length=arrayLike.length;return length?1===length?[arrayLike[0]]:2===length?[arrayLike[0],arrayLike[1]]:3===length?[arrayLike[0],arrayLike[1],arrayLike[2]]:slice.call(arrayLike,0):[]}function isSameValueZero(object1,object2){return object1===object2||object1!=object1&&object2!=object2}function mergeOptions(existingOptions,newOptions){var target={};for(var key in existingOptions)target[key]=existingOptions[key];for(var key in newOptions)target[key]=newOptions[key];return target}var Cache=function(){function Cache(options){this.keys=[],this.values=[],this.options=options;var isMatchingKeyFunction="function"==typeof options.isMatchingKey;isMatchingKeyFunction?this.getKeyIndex=this._getKeyIndexFromMatchingKey:options.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey="function"==typeof options.transformKey,this.shouldCloneArguments=this.canTransformKey||isMatchingKeyFunction,this.shouldUpdateOnAdd="function"==typeof options.onCacheAdd,this.shouldUpdateOnChange="function"==typeof options.onCacheChange,this.shouldUpdateOnHit="function"==typeof options.onCacheHit}return Object.defineProperty(Cache.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(Cache.prototype,"snapshot",{get:function(){return{keys:cloneArray(this.keys),size:this.size,values:cloneArray(this.values)}},enumerable:!1,configurable:!0}),Cache.prototype._getKeyIndexFromMatchingKey=function(keyToMatch){var _a=this.options,isMatchingKey=_a.isMatchingKey,maxSize=_a.maxSize,keys=this.keys,keysLength=keys.length;if(!keysLength)return -1;if(isMatchingKey(keys[0],keyToMatch))return 0;if(maxSize>1){for(var index=1;index<keysLength;index++)if(isMatchingKey(keys[index],keyToMatch))return index}return -1},Cache.prototype._getKeyIndexForMany=function(keyToMatch){var existingKey,argIndex,isEqual=this.options.isEqual,keys=this.keys,keysLength=keys.length;if(!keysLength)return -1;if(1===keysLength)return this._getKeyIndexForSingle(keyToMatch);var keyLength=keyToMatch.length;if(keyLength>1){for(var index=0;index<keysLength;index++)if((existingKey=keys[index]).length===keyLength){for(argIndex=0;argIndex<keyLength&&isEqual(existingKey[argIndex],keyToMatch[argIndex]);argIndex++);if(argIndex===keyLength)return index}}else for(var index=0;index<keysLength;index++)if((existingKey=keys[index]).length===keyLength&&isEqual(existingKey[0],keyToMatch[0]))return index;return -1},Cache.prototype._getKeyIndexForSingle=function(keyToMatch){var keys=this.keys;if(!keys.length)return -1;var existingKey=keys[0],length=existingKey.length;if(keyToMatch.length!==length)return -1;var isEqual=this.options.isEqual;if(length>1){for(var index=0;index<length;index++)if(!isEqual(existingKey[index],keyToMatch[index]))return -1;return 0}return isEqual(existingKey[0],keyToMatch[0])?0:-1},Cache.prototype.orderByLru=function(key,value,startingIndex){for(var keys=this.keys,values=this.values,currentLength=keys.length,index=startingIndex;index--;)keys[index+1]=keys[index],values[index+1]=values[index];keys[0]=key,values[0]=value;var maxSize=this.options.maxSize;currentLength===maxSize&&startingIndex===currentLength?(keys.pop(),values.pop()):startingIndex>=maxSize&&(keys.length=values.length=maxSize)},Cache.prototype.updateAsyncCache=function(memoized){var _this=this,_a=this.options,onCacheChange=_a.onCacheChange,onCacheHit=_a.onCacheHit,firstKey=this.keys[0],firstValue=this.values[0];this.values[0]=firstValue.then(function(value){return _this.shouldUpdateOnHit&&onCacheHit(_this,_this.options,memoized),_this.shouldUpdateOnChange&&onCacheChange(_this,_this.options,memoized),value},function(error){var keyIndex=_this.getKeyIndex(firstKey);throw -1!==keyIndex&&(_this.keys.splice(keyIndex,1),_this.values.splice(keyIndex,1)),error})},Cache}();const RE_JSX_ANNOTATION_REGEX=/@jsx\s+(\S+)/u,RE_JS_IDENTIFIER_REGEX=/^[$A-Z_a-z][\w$]*$/u,getPragmaFromContext=function createMemoizedFunction(fn,options){if(void 0===options&&(options={}),"function"==typeof fn&&fn.isMemoized)return createMemoizedFunction(fn.fn,mergeOptions(fn.options,options));if("function"!=typeof fn)throw TypeError("You must pass a function to `memoize`.");var _a=options.isEqual,isMatchingKey=options.isMatchingKey,_b=options.isPromise,isPromise=void 0!==_b&&_b,_c=options.maxSize,onCacheAdd=options.onCacheAdd,onCacheChange=options.onCacheChange,onCacheHit=options.onCacheHit,transformKey=options.transformKey,normalizedOptions=mergeOptions({isEqual:void 0===_a?isSameValueZero:_a,isMatchingKey:isMatchingKey,isPromise:isPromise,maxSize:void 0===_c?1:_c,onCacheAdd:onCacheAdd,onCacheChange:onCacheChange,onCacheHit:onCacheHit,transformKey:transformKey},function(options){var customOptions={};for(var key in options)DEFAULT_OPTIONS_KEYS[key]||(customOptions[key]=options[key]);return customOptions}(options)),cache=new Cache(normalizedOptions),keys=cache.keys,values=cache.values,canTransformKey=cache.canTransformKey,shouldCloneArguments=cache.shouldCloneArguments,shouldUpdateOnAdd=cache.shouldUpdateOnAdd,shouldUpdateOnChange=cache.shouldUpdateOnChange,shouldUpdateOnHit=cache.shouldUpdateOnHit,memoized=function(){var key=shouldCloneArguments?cloneArray(arguments):arguments;canTransformKey&&(key=transformKey(key));var keyIndex=keys.length?cache.getKeyIndex(key):-1;if(-1!==keyIndex)shouldUpdateOnHit&&onCacheHit(cache,normalizedOptions,memoized),keyIndex&&(cache.orderByLru(keys[keyIndex],values[keyIndex],keyIndex),shouldUpdateOnChange&&onCacheChange(cache,normalizedOptions,memoized));else{var newValue=fn.apply(this,arguments),newKey=shouldCloneArguments?key:cloneArray(arguments);cache.orderByLru(newKey,newValue,keys.length),isPromise&&cache.updateAsyncCache(memoized),shouldUpdateOnAdd&&onCacheAdd(cache,normalizedOptions,memoized),shouldUpdateOnChange&&onCacheChange(cache,normalizedOptions,memoized)}return values[0]};return memoized.cache=cache,memoized.fn=fn,memoized.isMemoized=!0,memoized.options=normalizedOptions,memoized}(context=>{let settings=context.settings,pragmaNode=context.getSourceCode().getAllComments().find(node=>RE_JSX_ANNOTATION_REGEX.test(node.value));return Function$1.pipe(Option.orElse(Option.fromNullable(settings.react?.pragma),()=>Function$1.pipe(Option.fromNullable(pragmaNode),Option.map(({value})=>RE_JSX_ANNOTATION_REGEX.exec(value)),Option.flatMapNullable(matches=>matches?.[1]?.split(".")[0]))),Option.flatMap(Option.liftPredicate(x=>RE_JS_IDENTIFIER_REGEX.test(x))),Option.getOrElse(Function$1.constant("React")))}),t=Symbol.for("@ts-pattern/matcher"),e=Symbol.for("@ts-pattern/isVariadic"),n="@ts-pattern/anonymous-select-key",r=t=>!!(t&&"object"==typeof t),i=e=>e&&!!e[t],s=(n,o,c)=>{if(i(n)){let{matched:r,selections:i}=n[t]().match(o);return r&&i&&Object.keys(i).forEach(t=>c(t,i[t])),r}if(r(n)){if(!r(o))return!1;if(Array.isArray(n)){if(!Array.isArray(o))return!1;let t=[],r=[],a=[];for(let s of n.keys()){let o=n[s];i(o)&&o[e]?a.push(o):a.length?r.push(o):t.push(o)}if(a.length){if(a.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(o.length<t.length+r.length)return!1;let e=o.slice(0,t.length),n=0===r.length?[]:o.slice(-r.length),i=o.slice(t.length,0===r.length?1/0:-r.length);return t.every((t,n)=>s(t,e[n],c))&&r.every((t,e)=>s(t,n[e],c))&&(0===a.length||s(a[0],i,c))}return n.length===o.length&&n.every((t,e)=>s(t,o[e],c))}return Object.keys(n).every(e=>{let r=n[e];return(e in o||i(r)&&"optional"===r[t]().matcherType)&&s(r,o[e],c)})}return Object.is(o,n)},o=e=>{var n,s,a;return r(e)?i(e)?null!=(n=null==(s=(a=e[t]()).getSelectionKeys)?void 0:s.call(a))?n:[]:Array.isArray(e)?c(e,o):c(Object.values(e),o):[]},c=(t,e)=>t.reduce((t,n)=>t.concat(e(n)),[]);function a(...t){if(1===t.length){let[e]=t;return t=>s(e,t,()=>{})}if(2===t.length){let[e,n]=t;return s(e,n,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function u(t1){return Object.assign(t1,{optional:()=>{var e;return e=t1,u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return void 0===t?(o(e).forEach(t=>r(t,void 0)),{matched:!0,selections:n}):{matched:s(e,t,r),selections:n}},getSelectionKeys:()=>o(e),matcherType:"optional"})})},and:e=>m(t1,e),or:e=>(function(...e){return u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return c(e,o).forEach(t=>r(t,void 0)),{matched:e.some(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"or"})})})(t1,e),select:e=>void 0===e?p(t1):p(e,t1)})}function m(...e){return u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return{matched:e.every(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"and"})})}function d(e){return{[t]:()=>({match:t=>({matched:!!e(t)})})}}function p(...e){let r="string"==typeof e[0]?e[0]:void 0,i=2===e.length?e[1]:"string"==typeof e[0]?void 0:e[0];return u({[t]:()=>({match:t=>{let e={[null!=r?r:n]:t};return{matched:void 0===i||s(i,t,(t,n)=>{e[t]=n}),selections:e}},getSelectionKeys:()=>[null!=r?r:n].concat(void 0===i?[]:o(i))})})}function v(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"bigint"==typeof t}u(d(function(t){return!0}));const j=t=>Object.assign(u(t),{startsWith:e=>j(m(t,d(t=>b(t)&&t.startsWith(e)))),endsWith:e=>j(m(t,d(t=>b(t)&&t.endsWith(e)))),minLength:e=>j(m(t,d(e1=>b(e1)&&e1.length>=e))),maxLength:e=>j(m(t,d(e1=>b(e1)&&e1.length<=e))),includes:e=>j(m(t,d(t=>b(t)&&t.includes(e)))),regex:e=>j(m(t,d(t=>b(t)&&!!t.match(e))))}),E=j(d(b)),K=t=>Object.assign(u(t),{between:(e,n)=>K(m(t,d(n1=>v(n1)&&e<=n1&&n>=n1))),lt:e=>K(m(t,d(e1=>v(e1)&&e1<e))),gt:e=>K(m(t,d(e1=>v(e1)&&e1>e))),lte:e=>K(m(t,d(e1=>v(e1)&&e1<=e))),gte:e=>K(m(t,d(e1=>v(e1)&&e1>=e))),int:()=>K(m(t,d(t=>v(t)&&Number.isInteger(t)))),finite:()=>K(m(t,d(t=>v(t)&&Number.isFinite(t)))),positive:()=>K(m(t,d(t=>v(t)&&t>0))),negative:()=>K(m(t,d(t=>v(t)&&t<0)))}),A=K(d(v)),x=t=>Object.assign(u(t),{between:(e,n)=>x(m(t,d(n1=>w(n1)&&e<=n1&&n>=n1))),lt:e=>x(m(t,d(e1=>w(e1)&&e1<e))),gt:e=>x(m(t,d(e1=>w(e1)&&e1>e))),lte:e=>x(m(t,d(e1=>w(e1)&&e1<=e))),gte:e=>x(m(t,d(e1=>w(e1)&&e1>=e))),positive:()=>x(m(t,d(t=>w(t)&&t>0))),negative:()=>x(m(t,d(t=>w(t)&&t<0)))}),T=(x(d(w)),u(d(function(t){return"boolean"==typeof t})));u(d(function(t){return"symbol"==typeof t})),u(d(function(t){return null==t}));var _={string:E,number:A,boolean:T};const W={matched:!1,value:void 0};function N(t){return new $(t,W)}class ${constructor(t,e){this.input=void 0,this.state=void 0,this.input=t,this.state=e}with(...t){let i;if(this.state.matched)return this;let e=t[t.length-1],r=[t[0]];3===t.length&&"function"==typeof t[1]?(r.push(t[0]),i=t[1]):t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,c={},a=(t,e)=>{o=!0,c[t]=e},u=r.some(t=>s(t,this.input,a))&&(!i||i(this.input))?{matched:!0,value:e(o?n in c?c[n]:c:this.input,this.input)}:W;return new $(this.input,u)}when(t,e){if(this.state.matched)return this;let n=!!t(this.input);return new $(this.input,n?{matched:!0,value:e(this.input,this.input)}:W)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){return this.run()}run(){let t;if(this.state.matched)return this.state.value;try{t=JSON.stringify(this.input)}catch(e){t=this.input}throw Error(`Pattern matching error: no pattern matches value ${t}`)}returnType(){return this}}function isInitializedFromPragma(variableName,context,pragma=getPragmaFromContext(context)){let variables=getVariablesUpToGlobal(context.getScope()),maybeVariable=findVariableByName(variableName)(variables),maybeLatestDef=Option.flatMapNullable(maybeVariable,variable=>variable.defs.at(-1));if(Option.isNone(maybeLatestDef))return!1;let{node,parent}=maybeLatestDef.value;if(node.type===NodeType.VariableDeclarator&&node.init){let{init}=node;if(a({type:"MemberExpression",object:{type:"Identifier",name:pragma}},init)||a({type:"Identifier",name:pragma},init))return!0;let maybeRequireExpression=N(init).with({type:NodeType.CallExpression,callee:{type:NodeType.Identifier,name:"require"}},exp=>Option.some(exp)).with({type:NodeType.MemberExpression,object:{type:NodeType.CallExpression,callee:{type:NodeType.Identifier,name:"require"}}},({object})=>Option.some(object)).otherwise(Option.none);if(Option.isNone(maybeRequireExpression))return!1;let[firstArg]=maybeRequireExpression.value.arguments;return firstArg?.type===NodeType.Literal&&firstArg.value===pragma.toLowerCase()}return a({type:"ImportDeclaration",source:{value:pragma.toLowerCase()}},parent)}function isPropertyOfPragma(name,context,pragma=getPragmaFromContext(context)){return a({type:NodeType.MemberExpression,object:{type:NodeType.Identifier,name:pragma},property:{name}})}function isCallFromPragma(name){return(node,context)=>node.type===NodeType.CallExpression&&"callee"in node&&(node.callee.type===NodeType.MemberExpression?isPropertyOfPragma(name,context)(node.callee):"name"in node.callee&&node.callee.name===name&&isInitializedFromPragma(name,context))}const isCreateElementCall=isCallFromPragma("createElement"),isCloneElementCall=isCallFromPragma("cloneElement"),hdlAnimation=["onAnimationStart","onAnimationEnd","onAnimationIteration"],hdlClipboard=["onCopy","onCut","onPaste"],hdlComposition=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],hdlFocus=["onFocus","onBlur"],hdlForm=["onChange","onInput","onSubmit"],hdlImage=["onLoad","onError"],hdlKeyboard=["onKeyDown","onKeyPress","onKeyUp"],hdlMedia=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],hdlMouse=["onClick","onContextMenu","onDblClick","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],hdlSelection=["onSelect"],hdlTouch=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],hdlTransition=["onTransitionEnd"],hdlScroll=["onScroll"],hdlWheel=["onWheel"];[...hdlAnimation,...hdlClipboard,...hdlComposition,...hdlFocus,...hdlForm,...hdlImage,...hdlKeyboard,...hdlMedia,...hdlMouse,...hdlSelection,...hdlTouch,...hdlTransition,...hdlScroll,...hdlWheel];const isLiteral=isOneOf([NodeType.Literal,NodeType.JSXText]);function isWhiteSpace(node){return isString(node.value)&&""===node.value.trim()}function isPaddingSpaces(node){return isLiteral(node)&&isWhiteSpace(node)&&node.raw.includes("\n")}const isFragmentSyntax=is(NodeType.JSXFragment);function isFragmentElement(node,pragma,fragment){let{name}=node.openingElement;return name.type===NodeType.JSXIdentifier&&name.name===fragment||name.type===NodeType.JSXMemberExpression&&name.object.type===NodeType.JSXIdentifier&&name.object.name===pragma&&name.property.name===fragment}const JSXValueCheckHint={None:0n,SkipNullLiteral:1n<<0n,SkipUndefinedLiteral:1n<<1n,SkipBooleanLiteral:1n<<2n,SkipStringLiteral:1n<<3n,SkipNumberLiteral:1n<<4n,SkipCreateElement:1n<<5n,StrictArray:1n<<6n,StrictLogical:1n<<7n,StrictConditional:1n<<8n},defaultJSXValueCheckHint=JSXValueCheckHint.SkipUndefinedLiteral|JSXValueCheckHint.SkipBooleanLiteral;function isJSXValue(node,context,hint=JSXValueCheckHint.None){return!!node&&N(node).with({type:NodeType.JSXElement},Function$1.constTrue).with({type:NodeType.JSXFragment},Function$1.constTrue).with({type:NodeType.JSXMemberExpression},Function$1.constTrue).with({type:NodeType.JSXNamespacedName},Function$1.constTrue).with({type:NodeType.Literal},node=>N(node.value).with(null,()=>!(hint&JSXValueCheckHint.SkipNullLiteral)).with(_.boolean,()=>!(hint&JSXValueCheckHint.SkipBooleanLiteral)).with(_.string,()=>!(hint&JSXValueCheckHint.SkipStringLiteral)).with(_.number,()=>!(hint&JSXValueCheckHint.SkipNumberLiteral)).otherwise(Function$1.constFalse)).with({type:NodeType.TemplateLiteral},()=>!(hint&JSXValueCheckHint.SkipStringLiteral)).with({type:NodeType.ArrayExpression},node=>hint&JSXValueCheckHint.StrictArray?node.elements.every(n=>isJSXValue(n,context,hint)):node.elements.some(n=>isJSXValue(n,context,hint))).with({type:NodeType.ConditionalExpression},node=>{function leftHasJSX(node){return Array.isArray(node.consequent)?hint&JSXValueCheckHint.StrictArray?node.consequent.every(n=>isJSXValue(n,context,hint)):node.consequent.some(n=>isJSXValue(n,context,hint)):isJSXValue(node.consequent,context,hint)}function rightHasJSX(node){return isJSXValue(node.alternate,context,hint)}return hint&JSXValueCheckHint.StrictConditional?leftHasJSX(node)&&rightHasJSX(node):leftHasJSX(node)||rightHasJSX(node)}).with({type:NodeType.LogicalExpression},node=>isJSXValue(node.left,context,hint)||isJSXValue(node.right,context,hint)).with({type:NodeType.SequenceExpression},node=>isJSXValue(node.expressions.at(-1),context,hint)).with({type:NodeType.CallExpression},node=>!(hint&JSXValueCheckHint.SkipCreateElement)&&isCreateElementCall(node,context)).with({type:NodeType.Identifier},node=>{var startScope;let{name}=node;if("undefined"===name)return!(hint&JSXValueCheckHint.SkipUndefinedLiteral);if(isJSXTagNameExpression(node))return!0;let maybeVariable=(startScope=context.getScope(),findVariableByName(name)(getVariablesUpToGlobal(startScope)));return Function$1.pipe(maybeVariable,Option.flatMap(getVariableInit(0)),Option.filter(n=>isJSXValue(n,context,hint)),Option.isSome)}).otherwise(Function$1.constFalse)}function getPropName(node){return N(node.name).when(is(NodeType.JSXIdentifier),n=>n.name).when(is(NodeType.JSXNamespacedName),n=>`${n.namespace.name}:${n.name.name}`).exhaustive()}function findPropInProperties(properties,context,seenProps=[]){let startScope=context.getScope();return propName=>Option.fromNullable(properties.find(prop=>N(prop).when(is(NodeType.Property),prop=>"name"in prop.key&&prop.key.name===propName).when(is(NodeType.SpreadElement),prop=>N(prop.argument).when(is(NodeType.Identifier),argument=>{let{name}=argument,maybeInit=Option.flatMap(findVariableByName(name)(getVariablesUpToGlobal(startScope)),getVariableInit(0));if(Option.isNone(maybeInit))return!1;let init=maybeInit.value;return!(init.type!==NodeType.ObjectExpression||seenProps.includes(name))&&Option.isSome(findPropInProperties(init.properties,context,[...seenProps,name])(propName))}).when(is(NodeType.ObjectExpression),argument=>Option.isSome(findPropInProperties(argument.properties,context,seenProps)(propName))).when(is(NodeType.MemberExpression),()=>{}).when(is(NodeType.CallExpression),()=>{}).otherwise(Function$1.constFalse)).when(is(NodeType.RestElement),()=>!1).otherwise(Function$1.constFalse)))}function findPropInAttributes(attributes,context){let startScope=context.getScope();return propName=>Option.fromNullable(attributes.find(attr=>N(attr).when(is(NodeType.JSXAttribute),attr=>getPropName(attr)===propName).when(is(NodeType.JSXSpreadAttribute),attr=>N(attr.argument).with({type:NodeType.Identifier},argument=>{let{name}=argument,maybeInit=Option.flatMap(findVariableByName(name)(getVariablesUpToGlobal(startScope)),getVariableInit(0));if(Option.isNone(maybeInit))return!1;let init=maybeInit.value;return"properties"in init&&Option.isSome(findPropInProperties(init.properties,context)(propName))}).when(is(NodeType.ObjectExpression),argument=>Option.isSome(findPropInProperties(argument.properties,context)(propName))).when(is(NodeType.MemberExpression),()=>!1).when(is(NodeType.CallExpression),()=>!1).otherwise(Function$1.constFalse)).otherwise(Function$1.constFalse)))}function hasProp(attributes,propName,context){return Option.isSome(findPropInAttributes(attributes,context)(propName))}function traverseUpProp(node,predicate=Function$1.constTrue){return Option.fromNullable(function traverseUpGuard(node,predicate){let{parent}=node;return parent&&parent.type!==NodeType.Program?predicate(parent)?parent:traverseUpGuard(parent,predicate):null}(node,node=>node.type===NodeType.JSXAttribute&&predicate(node)))}exports.JSXValueCheckHint=JSXValueCheckHint,exports.defaultJSXValueCheckHint=defaultJSXValueCheckHint,exports.elementType=function(node){if(node.type===types.AST_NODE_TYPES.JSXOpeningFragment)return"<>";let{name}=node;if(name.type===types.AST_NODE_TYPES.JSXMemberExpression){let{object,property}=name;return function resolveMemberExpressions(object,property){return object.type===types.AST_NODE_TYPES.JSXMemberExpression?`${resolveMemberExpressions(object.object,object.property)}.${property.name}`:object.type===types.AST_NODE_TYPES.JSXNamespacedName?`${object.namespace.name}:${object.name.name}.${property.name}`:`${object.name}.${property.name}`}(object,property)}return name.type===types.AST_NODE_TYPES.JSXNamespacedName?`${name.namespace.name}:${name.name.name}`:name.name},exports.findPropInAttributes=findPropInAttributes,exports.findPropInProperties=findPropInProperties,exports.getFragmentFromContext=function(context){let settings=context.settings,fragment=settings.react?.fragment;return isString(fragment)&&RE_JS_IDENTIFIER_REGEX.test(fragment)?fragment:"Fragment"},exports.getPragmaFromContext=getPragmaFromContext,exports.getProp=function(props,propName,context){return findPropInAttributes(props,context)(propName)},exports.getPropName=getPropName,exports.getPropValue=function(attribute,context){let scope=context.getScope();if(attribute.type===NodeType.JSXAttribute&&"value"in attribute){let{value}=attribute;return null===value?Option.none():value.type===NodeType.Literal?Option.some(getStaticValue(value,scope)):value.type===NodeType.JSXExpressionContainer?Option.some(getStaticValue(value.expression,scope)):Option.none()}let{argument}=attribute;return Option.some(getStaticValue(argument,scope))},exports.hasAnyProp=function(attributes,propNames,context){return propNames.some(propName=>hasProp(attributes,propName,context))},exports.hasChildren=function(node,predicate){return"function"==typeof predicate?node.children.some(predicate):node.children.length>0},exports.hasEveryProp=function(attributes,propNames,context){return propNames.every(propName=>hasProp(attributes,propName,context))},exports.hasProp=hasProp,exports.hdlAnimation=hdlAnimation,exports.hdlClipboard=hdlClipboard,exports.hdlComposition=hdlComposition,exports.hdlFocus=hdlFocus,exports.hdlForm=hdlForm,exports.hdlImage=hdlImage,exports.hdlKeyboard=hdlKeyboard,exports.hdlMedia=hdlMedia,exports.hdlMouse=hdlMouse,exports.hdlScroll=hdlScroll,exports.hdlSelection=hdlSelection,exports.hdlTouch=hdlTouch,exports.hdlTransition=hdlTransition,exports.hdlWheel=hdlWheel,exports.isCallFromPragma=isCallFromPragma,exports.isChildOfJSXElement=function(node){return node.parent?.type===NodeType.JSXElement&&node.parent.children.some(child=>child===node)},exports.isChildrenOfCreateElement=function(node,context){let maybeCallExpression=node.parent;return!!(maybeCallExpression&&isCreateElementCall(maybeCallExpression,context))&&maybeCallExpression.arguments.slice(2).some(child=>child===node)},exports.isCloneElementCall=isCloneElementCall,exports.isCreateElementCall=isCreateElementCall,exports.isFragment=(node,pragma,fragment)=>!!isOneOf([NodeType.JSXElement,NodeType.JSXFragment])(node)&&(isFragmentSyntax(node)||isFragmentElement(node,pragma,fragment)),exports.isFragmentElement=isFragmentElement,exports.isFragmentHasLessThanTwoChildren=function(node){let nonPaddingChildren=node.children.filter(child=>!isPaddingSpaces(child));if(1===nonPaddingChildren.length){var node1;return!((node1=nonPaddingChildren[0]).type===NodeType.JSXExpressionContainer&&node1.expression.type===NodeType.CallExpression)}return 0===nonPaddingChildren.length},exports.isFragmentSyntax=isFragmentSyntax,exports.isFragmentWithOnlyTextAndIsNotChild=function(node){return 1===node.children.length&&isLiteral(node.children[0])&&!(node.parent.type===NodeType.JSXElement||node.parent.type===NodeType.JSXFragment)},exports.isFragmentWithSingleExpression=function(node){let children=node.children.filter(child=>!isPaddingSpaces(child));return 1===children.length&&children[0]?.type===NodeType.JSXExpressionContainer},exports.isFunctionReturningJSXValue=function(node,context,hint=defaultJSXValueCheckHint){return node.body.type!==NodeType.BlockStatement?isJSXValue(node.body,context,hint):(function getNestedReturnStatements(node){let returnStatements=[];return node.type===NodeType.ReturnStatement&&returnStatements.push(node),"body"in node&&null!=node.body&&(Array.isArray(node.body)?node.body.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.body))),"consequent"in node&&(Array.isArray(node.consequent)?node.consequent.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.consequent))),"alternate"in node&&null!==node.alternate&&(Array.isArray(node.alternate)?node.alternate.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.alternate))),"cases"in node&&node.cases.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}),"block"in node&&returnStatements.push(...getNestedReturnStatements(node.block)),"handler"in node&&null!==node.handler&&returnStatements.push(...getNestedReturnStatements(node.handler)),"finalizer"in node&&null!==node.finalizer&&returnStatements.push(...getNestedReturnStatements(node.finalizer)),"expression"in node&&!0!==node.expression&&!1!==node.expression&&returnStatements.push(...getNestedReturnStatements(node.expression)),"test"in node&&null!==node.test&&returnStatements.push(...getNestedReturnStatements(node.test)),returnStatements})(node.body).some(statement=>isJSXValue(statement.argument,context,hint))},exports.isInitializedFromPragma=isInitializedFromPragma,exports.isInsideCreateElementProps=function(node,context){let parentCreateElement=traverseUp(node,n=>isCreateElementCall(n,context));return parentCreateElement?.type===NodeType.CallExpression&&parentCreateElement.arguments.at(1)===traverseUp(node,is(NodeType.ObjectExpression))},exports.isInsidePropValue=function(node){return node?.type===NodeType.Literal&&isString$1(node.value)?node.parent.type===NodeType.JSXAttribute:Option.isSome(traverseUpProp(node,n=>n.value?.type===NodeType.JSXExpressionContainer))},exports.isJSXElementOfBuiltinComponent=function(node){return node.type===NodeType.JSXElement&&node.openingElement.name.type===NodeType.JSXIdentifier&&node.openingElement.name.name.toLowerCase()===node.openingElement.name.name&&/^[a-z]/u.test(node.openingElement.name.name)},exports.isJSXElementOfUserDefinedComponent=function(node){return node.type===NodeType.JSXElement&&node.openingElement.name.type===NodeType.JSXIdentifier&&/^[A-Z]/u.test(node.openingElement.name.name)},exports.isJSXValue=isJSXValue,exports.isLineBreak=function(node){return isLiteral(node)&&isWhiteSpace(node)&&node.loc.start.line!==node.loc.end.line},exports.isLiteral=isLiteral,exports.isPaddingSpaces=isPaddingSpaces,exports.isPropertyOfPragma=isPropertyOfPragma,exports.isWhiteSpace=isWhiteSpace,exports.traverseUpProp=traverseUpProp;
|
|
3
|
+
at ${current.name}`,current=getOrUndefined$1(current.parent),i++}return message}).join("\r\n");class PrettyError{message;stack;span;constructor(message,stack,span){this.message=message,this.stack=stack,this.span=span}toJSON(){let out={message:this.message};return this.stack&&(out.stack=this.stack),this.span&&(out.span=this.span),out}}const prettyErrorMessage=u=>"string"==typeof u?`Error: ${u}`:hasProperty(u,"toString")&&isFunction$1(u.toString)&&u.toString!==Object.prototype.toString?u.toString():`Error: ${JSON.stringify(u)}`,spanSymbol$1=Symbol.for("effect/SpanAnnotation"),defaultRenderError=error=>{let span=hasProperty(error,spanSymbol$1)&&error[spanSymbol$1];return error instanceof Error?new PrettyError(prettyErrorMessage(error),error.stack?.split("\n").filter(_=>_.match(/at (.*)/)).join("\n"),span):new PrettyError(prettyErrorMessage(error),void 0,span)},prettyErrors=cause=>reduceWithContext(cause,void 0,{emptyCase:()=>[],dieCase:(_,unknownError)=>[defaultRenderError(unknownError)],failCase:(_,error)=>[defaultRenderError(error)],interruptCase:()=>[],parallelCase:(_,l,r)=>[...l,...r],sequentialCase:(_,l,r)=>[...l,...r]}),spanTag=(identifier=>{if(identifier&&tagRegistry.has(identifier))return tagRegistry.get(identifier);let limit=Error.stackTraceLimit;Error.stackTraceLimit=2;let creationError=Error();Error.stackTraceLimit=limit;let tag=Object.create(TagProto);return Object.defineProperty(tag,"stack",{get:()=>creationError.stack}),identifier&&(tag.identifier=identifier,tagRegistry.set(identifier,tag)),tag})(Symbol.for("effect/ParentSpan")),EffectTypeId=Symbol.for("effect/Effect");class EffectPrimitive{_op;i0=void 0;i1=void 0;i2=void 0;trace=void 0;[EffectTypeId]=effectVariance;constructor(_op){this._op=_op}[symbol](that){return this===that}[symbol$1](){return random(this)}pipe(){return pipeArguments(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,i0:toJSON(this.i0),i1:toJSON(this.i1),i2:toJSON(this.i2)}}toString(){return toString(this.toJSON())}[NodeInspectSymbol](){return this.toJSON()}}class EffectPrimitiveFailure{_op;i0=void 0;i1=void 0;i2=void 0;trace=void 0;[EffectTypeId]=effectVariance;constructor(_op){this._op=_op,this._tag=_op}[symbol](that){return this===that}[symbol$1](){return random(this)}get cause(){return this.i0}pipe(){return pipeArguments(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return toString(this.toJSON())}[NodeInspectSymbol](){return this.toJSON()}}const withFiberRuntime=withRuntime=>{let effect=new EffectPrimitive("WithRuntime");return effect.i0=withRuntime,effect},spanSymbol=Symbol.for("effect/SpanAnnotation"),originalSymbol=Symbol.for("effect/OriginalAnnotation"),capture=(obj,span)=>isSome$1(span)?new Proxy(obj,{has:(target,p)=>p===spanSymbol||p===originalSymbol||p in target,get:(target,p)=>p===spanSymbol?span.value:p===originalSymbol?obj:target[p]}):obj,fail=error=>!isObject(error)||spanSymbol in error?failCause(fail$1(error)):withFiberRuntime(fiber=>failCause(fail$1(capture(error,currentSpanFromFiber(fiber))))),failCause=cause=>{let effect=new EffectPrimitiveFailure("Failure");return effect.i0=cause,effect},FiberRefTypeId=Symbol.for("effect/FiberRef"),fiberRefVariance={_A:_=>_},fiberRefUnsafeMakeContext=initial=>{let differ=environment();return fiberRefUnsafeMakePatch(initial,{differ,fork:differ.empty})},fiberRefUnsafeMakePatch=(initial,options)=>({[FiberRefTypeId]:fiberRefVariance,initial,diff:(oldValue,newValue)=>options.differ.diff(oldValue,newValue),combine:(first,second)=>options.differ.combine(first,second),patch:patch=>oldValue=>options.differ.patch(patch,oldValue),fork:options.fork,join:options.join??((_,n)=>n),pipe(){return pipeArguments(this,arguments)}}),currentContext=globalValue(Symbol.for("effect/FiberRef/currentContext"),()=>fiberRefUnsafeMakeContext(empty$6())),YieldableError=function(){class YieldableError extends globalThis.Error{commit(){return fail(this)}toString(){return this.stack??`${this.name}: ${this.message}`}toJSON(){return{...this}}[NodeInspectSymbol](){return this.toString()}}return Object.assign(YieldableError.prototype,StructuralCommitPrototype),YieldableError}(),currentSpanFromFiber=fiber=>{let span=fiber.getFiberRef(currentContext).unsafeMap.get(spanTag);return void 0!==span&&"Span"===span._tag?some$4(span):none()},struct=as=>Object.assign(Object.create(StructuralPrototype),as),unsafeArray=as=>Object.setPrototypeOf(as,ArrayProto),tagged=tag=>args=>{let value=void 0===args?Object.create(StructuralPrototype):struct(args);return value._tag=tag,value},Class=Structural$1,Error$1=class extends YieldableError{constructor(args){super(),args&&Object.assign(this,args)}};var Data=Object.freeze({__proto__:null,Class:Class,Error:Error$1,Structural:Structural$1,TaggedClass:tag=>class extends Class{_tag=tag},TaggedError:tag=>{class Base extends Error$1{_tag=tag}return Base.prototype.name=tag,Base},array:as=>unsafeArray(as.slice(0)),case:()=>args=>void 0===args?Object.create(StructuralPrototype):struct(args),struct:struct,tagged:tagged,taggedEnum:()=>new Proxy({},{get:(_target,tag,_receiver)=>tagged(tag)}),tuple:(...as)=>unsafeArray(as),unsafeArray:unsafeArray,unsafeStruct:as=>Object.setPrototypeOf(as,StructuralPrototype)});const KEYS={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(const type of Object.keys(KEYS))Object.freeze(KEYS[type]);Object.freeze(KEYS);const KEY_BLACKLIST=new Set(["parent","leadingComments","trailingComments"]);function filterKey(key){return!KEY_BLACKLIST.has(key)&&"_"!==key[0]}function negate0(token){return!this(token)}function negate(f){return negate0.bind(f)}function isPunctuatorTokenWithValue(token,value){return"Punctuator"===token.type&&token.value===value}negate(function(token){return isPunctuatorTokenWithValue(token,"=>")}),negate(function(token){return isPunctuatorTokenWithValue(token,",")}),negate(function(token){return isPunctuatorTokenWithValue(token,";")}),negate(function(token){return isPunctuatorTokenWithValue(token,":")}),negate(function(token){return isPunctuatorTokenWithValue(token,"(")}),negate(function(token){return isPunctuatorTokenWithValue(token,")")}),negate(function(token){return isPunctuatorTokenWithValue(token,"[")}),negate(function(token){return isPunctuatorTokenWithValue(token,"]")}),negate(function(token){return isPunctuatorTokenWithValue(token,"{")}),negate(function(token){return isPunctuatorTokenWithValue(token,"}")}),negate(function(token){return["Block","Line","Shebang"].includes(token.type)});const globalObject="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},builtinNames=Object.freeze(new Set(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),callAllowed=new Set([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(k=>"random"!==k).map(k=>Math[k]).filter(f=>"function"==typeof f),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(f=>"function"==typeof f)),callPassThrough=new Set([Object.freeze,Object.preventExtensions,Object.seal]),getterAllowed=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function getElementValues(nodeList,initialScope){let valueList=[];for(let i=0;i<nodeList.length;++i){let elementNode=nodeList[i];if(null==elementNode)valueList.length=i+1;else if("SpreadElement"===elementNode.type){let argument=getStaticValueR(elementNode.argument,initialScope);if(null==argument)return null;valueList.push(...argument.value)}else{let element=getStaticValueR(elementNode,initialScope);if(null==element)return null;valueList.push(element.value)}}return valueList}const operations=Object.freeze({ArrayExpression(node,initialScope){let elements=getElementValues(node.elements,initialScope);return null!=elements?{value:elements}:null},AssignmentExpression:(node,initialScope)=>"="===node.operator?getStaticValueR(node.right,initialScope):null,BinaryExpression(node,initialScope){if("in"===node.operator||"instanceof"===node.operator)return null;let left=getStaticValueR(node.left,initialScope),right=getStaticValueR(node.right,initialScope);if(null!=left&&null!=right)switch(node.operator){case"==":return{value:left.value==right.value};case"!=":return{value:left.value!=right.value};case"===":return{value:left.value===right.value};case"!==":return{value:left.value!==right.value};case"<":return{value:left.value<right.value};case"<=":return{value:left.value<=right.value};case">":return{value:left.value>right.value};case">=":return{value:left.value>=right.value};case"<<":return{value:left.value<<right.value};case">>":return{value:left.value>>right.value};case">>>":return{value:left.value>>>right.value};case"+":return{value:left.value+right.value};case"-":return{value:left.value-right.value};case"*":return{value:left.value*right.value};case"/":return{value:left.value/right.value};case"%":return{value:left.value%right.value};case"**":return{value:left.value**right.value};case"|":return{value:left.value|right.value};case"^":return{value:left.value^right.value};case"&":return{value:left.value&right.value}}return null},CallExpression(node,initialScope){let calleeNode=node.callee,args=getElementValues(node.arguments,initialScope);if(null!=args){if("MemberExpression"===calleeNode.type){if("PrivateIdentifier"===calleeNode.property.type)return null;let object=getStaticValueR(calleeNode.object,initialScope);if(null!=object){if(null==object.value&&(object.optional||node.optional))return{value:void 0,optional:!0};let property=getStaticPropertyNameValue(calleeNode,initialScope);if(null!=property){let receiver=object.value,methodName=property.value;if(callAllowed.has(receiver[methodName]))return{value:receiver[methodName](...args)};if(callPassThrough.has(receiver[methodName]))return{value:args[0]}}}}else{let callee=getStaticValueR(calleeNode,initialScope);if(null!=callee){if(null==callee.value&&node.optional)return{value:void 0,optional:!0};let func=callee.value;if(callAllowed.has(func))return{value:func(...args)};if(callPassThrough.has(func))return{value:args[0]}}}}return null},ConditionalExpression(node,initialScope){let test=getStaticValueR(node.test,initialScope);return null!=test?test.value?getStaticValueR(node.consequent,initialScope):getStaticValueR(node.alternate,initialScope):null},ExpressionStatement:(node,initialScope)=>getStaticValueR(node.expression,initialScope),Identifier(node,initialScope){if(null!=initialScope){let variable=function(initialScope,nameOrNode){let name="",scope=initialScope;for("string"==typeof nameOrNode?name=nameOrNode:(name=nameOrNode.name,scope=function(initialScope,node){let location=node.range[0],scope=initialScope,found=!1;do for(let childScope of(found=!1,scope.childScopes)){let range=childScope.block.range;if(range[0]<=location&&location<range[1]){scope=childScope,found=!0;break}}while(found);return scope}(scope,nameOrNode));null!=scope;){let variable=scope.set.get(name);if(null!=variable)return variable;scope=scope.upper}return null}(initialScope,node);if(null!=variable&&0===variable.defs.length&&builtinNames.has(variable.name)&&variable.name in globalObject)return{value:globalObject[variable.name]};if(null!=variable&&1===variable.defs.length){let def=variable.defs[0];if(def.parent&&"Variable"===def.type&&("const"===def.parent.kind||function(variable){let refs=variable.references,inits=refs.filter(r=>r.init).length,reads=refs.filter(r=>r.isReadOnly()).length;return 1===inits&&reads+inits===refs.length}(variable))&&"Identifier"===def.node.id.type)return getStaticValueR(def.node.init,initialScope)}}return null},Literal:node=>(null!=node.regex||null!=node.bigint)&&null==node.value?null:{value:node.value},LogicalExpression(node,initialScope){let left=getStaticValueR(node.left,initialScope);if(null!=left){if("||"===node.operator&&!0==!!left.value||"&&"===node.operator&&!1==!!left.value||"??"===node.operator&&null!=left.value)return left;let right=getStaticValueR(node.right,initialScope);if(null!=right)return right}return null},MemberExpression(node,initialScope){if("PrivateIdentifier"===node.property.type)return null;let object=getStaticValueR(node.object,initialScope);if(null!=object){if(null==object.value&&(object.optional||node.optional))return{value:void 0,optional:!0};let property=getStaticPropertyNameValue(node,initialScope);if(null!=property){if(!function(object,name){let d=function(object,name){let x=object;for(;("object"==typeof x||"function"==typeof x)&&null!==x;){let d=Object.getOwnPropertyDescriptor(x,name);if(d)return d;x=Object.getPrototypeOf(x)}return null}(object,name);return null!=d&&null!=d.get}(object.value,property.value))return{value:object.value[property.value]};for(let[classFn,allowed]of getterAllowed)if(object.value instanceof classFn&&allowed.has(property.value))return{value:object.value[property.value]}}}return null},ChainExpression(node,initialScope){let expression=getStaticValueR(node.expression,initialScope);return null!=expression?{value:expression.value}:null},NewExpression(node,initialScope){let callee=getStaticValueR(node.callee,initialScope),args=getElementValues(node.arguments,initialScope);if(null!=callee&&null!=args){let Func=callee.value;if(callAllowed.has(Func))return{value:new Func(...args)}}return null},ObjectExpression(node,initialScope){let object={};for(let propertyNode of node.properties)if("Property"===propertyNode.type){if("init"!==propertyNode.kind)return null;let key=getStaticPropertyNameValue(propertyNode,initialScope),value=getStaticValueR(propertyNode.value,initialScope);if(null==key||null==value)return null;object[key.value]=value.value}else{if("SpreadElement"!==propertyNode.type&&"ExperimentalSpreadProperty"!==propertyNode.type)return null;let argument=getStaticValueR(propertyNode.argument,initialScope);if(null==argument)return null;Object.assign(object,argument.value)}return{value:object}},SequenceExpression:(node,initialScope)=>getStaticValueR(node.expressions[node.expressions.length-1],initialScope),TaggedTemplateExpression(node,initialScope){let tag=getStaticValueR(node.tag,initialScope),expressions=getElementValues(node.quasi.expressions,initialScope);if(null!=tag&&null!=expressions){let func=tag.value,strings=node.quasi.quasis.map(q=>q.value.cooked);if(strings.raw=node.quasi.quasis.map(q=>q.value.raw),func===String.raw)return{value:func(strings,...expressions)}}return null},TemplateLiteral(node,initialScope){let expressions=getElementValues(node.expressions,initialScope);if(null!=expressions){let value=node.quasis[0].value.cooked;for(let i=0;i<expressions.length;++i)value+=expressions[i]+node.quasis[i+1].value.cooked;return{value}}return null},UnaryExpression(node,initialScope){if("delete"===node.operator)return null;if("void"===node.operator)return{value:void 0};let arg=getStaticValueR(node.argument,initialScope);if(null!=arg)switch(node.operator){case"-":return{value:-arg.value};case"+":return{value:+arg.value};case"!":return{value:!arg.value};case"~":return{value:~arg.value};case"typeof":return{value:typeof arg.value}}return null}});function getStaticValueR(node,initialScope){return null!=node&&Object.hasOwnProperty.call(operations,node.type)?operations[node.type](node,initialScope):null}function getStaticPropertyNameValue(node,initialScope){let nameNode="Property"===node.type?node.key:node.property;return node.computed?getStaticValueR(nameNode,initialScope):"Identifier"===nameNode.type?{value:nameNode.name}:"Literal"===nameNode.type?nameNode.bigint?{value:nameNode.bigint}:{value:String(nameNode.value)}:null}const typeConversionBinaryOps=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),typeConversionUnaryOps=Object.freeze(new Set(["-","+","!","~"]));function isNode(x){return null!==x&&"object"==typeof x&&"string"==typeof x.type}Object.freeze(Object.assign(Object.create(null),{$visit(node,options,visitorKeys){let{type}=node;return"function"==typeof this[type]?this[type](node,options,visitorKeys):this.$visitChildren(node,options,visitorKeys)},$visitChildren(node,options,visitorKeys){let{type}=node;for(let key of visitorKeys[type]||Object.keys(node).filter(filterKey)){let value=node[key];if(Array.isArray(value)){for(let element of value)if(isNode(element)&&this.$visit(element,options,visitorKeys))return!0}else if(isNode(value)&&this.$visit(value,options,visitorKeys))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(node,options,visitorKeys){return!!(options.considerImplicitTypeConversion&&typeConversionBinaryOps.has(node.operator))&&("Literal"!==node.left.type||"Literal"!==node.right.type)||this.$visitChildren(node,options,visitorKeys)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(node,options,visitorKeys){return!!options.considerGetters||!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.property.type||this.$visitChildren(node,options,visitorKeys)},MethodDefinition(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},NewExpression:()=>!0,Property(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},PropertyDefinition(node,options,visitorKeys){return!!options.considerImplicitTypeConversion&&!!node.computed&&"Literal"!==node.key.type||this.$visitChildren(node,options,visitorKeys)},UnaryExpression(node,options,visitorKeys){return!!("delete"===node.operator||options.considerImplicitTypeConversion&&typeConversionUnaryOps.has(node.operator)&&"Literal"!==node.argument.type)||this.$visitChildren(node,options,visitorKeys)},UpdateExpression:()=>!0,YieldExpression:()=>!0})),Function.call.bind(Object.hasOwnProperty);const isString$1=input=>"string"==typeof input,isNullable=input=>null==input,t$1=Symbol.for("@ts-pattern/matcher"),e$1=Symbol.for("@ts-pattern/isVariadic"),n$1="@ts-pattern/anonymous-select-key",r$1=t=>!!(t&&"object"==typeof t),i$1=e=>e&&!!e[t$1],s$1=(n,o,c)=>{if(i$1(n)){let{matched:r,selections:i}=n[t$1]().match(o);return r&&i&&Object.keys(i).forEach(t=>c(t,i[t])),r}if(r$1(n)){if(!r$1(o))return!1;if(Array.isArray(n)){if(!Array.isArray(o))return!1;let t=[],r=[],a=[];for(let s of n.keys()){let o=n[s];i$1(o)&&o[e$1]?a.push(o):a.length?r.push(o):t.push(o)}if(a.length){if(a.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(o.length<t.length+r.length)return!1;let e=o.slice(0,t.length),n=0===r.length?[]:o.slice(-r.length),i=o.slice(t.length,0===r.length?1/0:-r.length);return t.every((t,n)=>s$1(t,e[n],c))&&r.every((t,e)=>s$1(t,n[e],c))&&(0===a.length||s$1(a[0],i,c))}return n.length===o.length&&n.every((t,e)=>s$1(t,o[e],c))}return Object.keys(n).every(e=>{let r=n[e];return(e in o||i$1(r)&&"optional"===r[t$1]().matcherType)&&s$1(r,o[e],c)})}return Object.is(o,n)},o$1=e=>{var n,s,a;return r$1(e)?i$1(e)?null!=(n=null==(s=(a=e[t$1]()).getSelectionKeys)?void 0:s.call(a))?n:[]:Array.isArray(e)?c$1(e,o$1):c$1(Object.values(e),o$1):[]},c$1=(t,e)=>t.reduce((t,n)=>t.concat(e(n)),[]);function a$1(...t){if(1===t.length){let[e]=t;return t=>s$1(e,t,()=>{})}if(2===t.length){let[e,n]=t;return s$1(e,n,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function u$1(t){return Object.assign(t,{optional:()=>l$1(t),and:e=>m$1(t,e),or:e=>y$1(t,e),select:e=>void 0===e?p$1(t):p$1(e,t)})}function l$1(e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return void 0===t?(o$1(e).forEach(t=>r(t,void 0)),{matched:!0,selections:n}):{matched:s$1(e,t,r),selections:n}},getSelectionKeys:()=>o$1(e),matcherType:"optional"})})}const f$1=(t,e)=>{for(let n of t)if(!e(n))return!1;return!0},g$1=(t,e)=>{for(let[n,r]of t.entries())if(!e(r,n))return!1;return!0};function m$1(...e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return{matched:e.every(e=>s$1(e,t,r)),selections:n}},getSelectionKeys:()=>c$1(e,o$1),matcherType:"and"})})}function y$1(...e){return u$1({[t$1]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return c$1(e,o$1).forEach(t=>r(t,void 0)),{matched:e.some(e=>s$1(e,t,r)),selections:n}},getSelectionKeys:()=>c$1(e,o$1),matcherType:"or"})})}function d$1(e){return{[t$1]:()=>({match:t=>({matched:!!e(t)})})}}function p$1(...e){let r="string"==typeof e[0]?e[0]:void 0,i=2===e.length?e[1]:"string"==typeof e[0]?void 0:e[0];return u$1({[t$1]:()=>({match:t=>{let e={[null!=r?r:n$1]:t};return{matched:void 0===i||s$1(i,t,(t,n)=>{e[t]=n}),selections:e}},getSelectionKeys:()=>[null!=r?r:n$1].concat(void 0===i?[]:o$1(i))})})}function v$1(t){return"number"==typeof t}function b$1(t){return"string"==typeof t}function w$1(t){return"bigint"==typeof t}const S$1=u$1(d$1(function(t){return!0})),j$1=t=>Object.assign(u$1(t),{startsWith:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.startsWith(e)))),endsWith:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.endsWith(e)))),minLength:e=>j$1(m$1(t,d$1(e1=>b$1(e1)&&e1.length>=e))),maxLength:e=>j$1(m$1(t,d$1(e1=>b$1(e1)&&e1.length<=e))),includes:e=>j$1(m$1(t,d$1(t=>b$1(t)&&t.includes(e)))),regex:e=>j$1(m$1(t,d$1(t=>b$1(t)&&!!t.match(e))))}),E$1=j$1(d$1(b$1)),K$1=t=>Object.assign(u$1(t),{between:(e,n)=>K$1(m$1(t,d$1(n1=>v$1(n1)&&e<=n1&&n>=n1))),lt:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1<e))),gt:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1>e))),lte:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1<=e))),gte:e=>K$1(m$1(t,d$1(e1=>v$1(e1)&&e1>=e))),int:()=>K$1(m$1(t,d$1(t=>v$1(t)&&Number.isInteger(t)))),finite:()=>K$1(m$1(t,d$1(t=>v$1(t)&&Number.isFinite(t)))),positive:()=>K$1(m$1(t,d$1(t=>v$1(t)&&t>0))),negative:()=>K$1(m$1(t,d$1(t=>v$1(t)&&t<0)))}),A$1=K$1(d$1(v$1)),x$1=t=>Object.assign(u$1(t),{between:(e,n)=>x$1(m$1(t,d$1(n1=>w$1(n1)&&e<=n1&&n>=n1))),lt:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1<e))),gt:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1>e))),lte:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1<=e))),gte:e=>x$1(m$1(t,d$1(e1=>w$1(e1)&&e1>=e))),positive:()=>x$1(m$1(t,d$1(t=>w$1(t)&&t>0))),negative:()=>x$1(m$1(t,d$1(t=>w$1(t)&&t<0)))}),P$1=x$1(d$1(w$1)),T$1=u$1(d$1(function(t){return"boolean"==typeof t})),k$1=u$1(d$1(function(t){return"symbol"==typeof t})),B$1=u$1(d$1(function(t){return null==t}));var _$1={__proto__:null,matcher:t$1,optional:l$1,array:function(...e){return function h$1(t){return Object.assign(Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[e$1]:!0})}}),{optional:()=>h$1(l$1(t)),select:e=>h$1(void 0===e?p$1(t):p$1(e,t))})}({[t$1]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(0===e.length)return{matched:!0};let n=e[0],r={};if(0===t.length)return o$1(n).forEach(t=>{r[t]=[]}),{matched:!0,selections:r};let i=(t,e)=>{r[t]=(r[t]||[]).concat([e])};return{matched:t.every(t=>s$1(n,t,i)),selections:r}},getSelectionKeys:()=>0===e.length?[]:o$1(e[0])})})},set:function(...e){return u$1({[t$1]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(0===t.size)return{matched:!0,selections:n};if(0===e.length)return{matched:!0};let r=(t,e)=>{n[t]=(n[t]||[]).concat([e])},i=e[0];return{matched:f$1(t,t=>s$1(i,t,r)),selections:n}},getSelectionKeys:()=>0===e.length?[]:o$1(e[0])})})},map:function(...e){return u$1({[t$1]:()=>({match:t=>{var i;if(!(t instanceof Map))return{matched:!1};let n={};if(0===t.size)return{matched:!0,selections:n};let r=(t,e)=>{n[t]=(n[t]||[]).concat([e])};if(0===e.length)return{matched:!0};if(1===e.length)throw Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(i=e[0])?void 0:i.toString()}`);let[o,c]=e;return{matched:g$1(t,(t,e)=>{let n=s$1(o,e,r),i=s$1(c,t,r);return n&&i}),selections:n}},getSelectionKeys:()=>0===e.length?[]:[...o$1(e[0]),...o$1(e[1])]})})},intersection:m$1,union:y$1,not:function(e){return u$1({[t$1]:()=>({match:t=>({matched:!s$1(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:d$1,select:p$1,any:S$1,_:S$1,string:E$1,number:A$1,bigint:P$1,boolean:T$1,symbol:k$1,nullish:B$1,instanceOf:function(t){return u$1(d$1(e=>e instanceof t))},shape:function(t){return u$1(d$1(a$1(t)))}};const NodeType=types.AST_NODE_TYPES,is=utils.ASTUtils.isNodeOfType,isOneOf=utils.ASTUtils.isNodeOfTypes;isOneOf([NodeType.ArrowFunctionExpression,NodeType.FunctionDeclaration,NodeType.FunctionExpression]),isOneOf([NodeType.ArrowFunctionExpression,NodeType.FunctionDeclaration,NodeType.FunctionExpression,NodeType.TSCallSignatureDeclaration,NodeType.TSConstructSignatureDeclaration,NodeType.TSDeclareFunction,NodeType.TSEmptyBodyFunctionExpression,NodeType.TSFunctionType,NodeType.TSMethodSignature]),isOneOf([NodeType.ClassDeclaration,NodeType.ClassExpression]),isOneOf([NodeType.DoWhileStatement,NodeType.ForInStatement,NodeType.ForOfStatement,NodeType.ForStatement,NodeType.WhileStatement]),isOneOf([NodeType.TSArrayType,NodeType.TSTupleType]),isOneOf([NodeType.PropertyDefinition,NodeType.TSIndexSignature,NodeType.TSParameterProperty,NodeType.TSPropertySignature]),is(NodeType.JSXElement),is(NodeType.JSXFragment),isOneOf([NodeType.JSXAttribute,NodeType.JSXSpreadChild,NodeType.JSXClosingElement,NodeType.JSXClosingFragment,NodeType.JSXElement,NodeType.JSXEmptyExpression,NodeType.JSXExpressionContainer,NodeType.JSXFragment,NodeType.JSXIdentifier,NodeType.JSXMemberExpression,NodeType.JSXNamespacedName,NodeType.JSXOpeningElement,NodeType.JSXOpeningFragment,NodeType.JSXSpreadAttribute,NodeType.JSXSpreadChild,NodeType.JSXText]);const isJSXTagNameExpression=isOneOf([NodeType.JSXIdentifier,NodeType.JSXMemberExpression,NodeType.JSXNamespacedName]);isOneOf([NodeType.ArrayPattern,NodeType.AssignmentPattern,NodeType.ObjectPattern,NodeType.RestElement]),isOneOf([NodeType.TSInterfaceDeclaration,NodeType.TSTypeAliasDeclaration]),isOneOf([NodeType.ArrayExpression,NodeType.ArrayPattern,NodeType.ArrowFunctionExpression,NodeType.CallExpression,NodeType.ClassExpression,NodeType.FunctionExpression,NodeType.Identifier,NodeType.JSXElement,NodeType.JSXFragment,NodeType.Literal,NodeType.TemplateLiteral,NodeType.MemberExpression,NodeType.MetaProperty,NodeType.ObjectExpression,NodeType.ObjectPattern,NodeType.SequenceExpression,NodeType.Super,NodeType.TaggedTemplateExpression,NodeType.ThisExpression]),isOneOf([NodeType.ArrayExpression,NodeType.ArrayPattern,NodeType.ArrowFunctionExpression,NodeType.CallExpression,NodeType.ClassExpression,NodeType.FunctionExpression,NodeType.Identifier,NodeType.JSXElement,NodeType.JSXFragment,NodeType.Literal,NodeType.TemplateLiteral,NodeType.MemberExpression,NodeType.MetaProperty,NodeType.ObjectExpression,NodeType.ObjectPattern,NodeType.SequenceExpression,NodeType.Super,NodeType.TaggedTemplateExpression,NodeType.ThisExpression,NodeType.TSAsExpression,NodeType.TSNonNullExpression,NodeType.TSTypeAssertion]),Data.taggedEnum().None(),NodeType.JSXElement,NodeType.ArrayExpression,NodeType.ObjectExpression,NodeType.FunctionExpression,NodeType.ArrowFunctionExpression,NodeType.ClassExpression,NodeType.NewExpression,NodeType.CallExpression;const getStaticValue=function(node,initialScope=null){try{return getStaticValueR(node,initialScope)}catch(_error){return null}};function traverseUp(node,predicate){let{parent}=node;return parent&&parent.type!==NodeType.Program?predicate(parent)?parent:traverseUp(parent,predicate):null}function findVariableByName(name){return variables=>Option.fromNullable(variables.find(variable=>variable.name===name))}function getVariablesUpToGlobal(startScope){let scopeRef=MutableRef.make(startScope),variablesRef=MutableRef.make(MutableRef.get(scopeRef).variables);for(;MutableRef.get(scopeRef).type!==scopeManager.ScopeType.global;)MutableRef.set(scopeRef,MutableRef.get(scopeRef).upper),MutableRef.update(variablesRef,variables=>variables.concat(MutableRef.get(scopeRef).variables));return MutableRef.get(variablesRef).reverse()}function resolveDefinitionInit(def){return"init"in def.node&&!isNullable(def.node.init)?Option.some(def.node.init):Option.none()}function getVariableInit(at){return variable=>Function$1.pipe(Option.some(variable),Option.flatMapNullable(v=>v.defs.at(at)),Option.flatMap(resolveDefinitionInit))}a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.Property,parent:{type:NodeType.ObjectExpression}}}),a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.MethodDefinition,parent:{type:NodeType.ClassBody}}}),a$1({type:_$1.union([NodeType.FunctionExpression,NodeType.ArrowFunctionExpression]),parent:{type:NodeType.Property,parent:{type:NodeType.ClassBody}}});const isString=input=>"string"==typeof input;var DEFAULT_OPTIONS_KEYS={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},slice=Array.prototype.slice;function cloneArray(arrayLike){var length=arrayLike.length;return length?1===length?[arrayLike[0]]:2===length?[arrayLike[0],arrayLike[1]]:3===length?[arrayLike[0],arrayLike[1],arrayLike[2]]:slice.call(arrayLike,0):[]}function isSameValueZero(object1,object2){return object1===object2||object1!=object1&&object2!=object2}function mergeOptions(existingOptions,newOptions){var target={};for(var key in existingOptions)target[key]=existingOptions[key];for(var key in newOptions)target[key]=newOptions[key];return target}var Cache=function(){function Cache(options){this.keys=[],this.values=[],this.options=options;var isMatchingKeyFunction="function"==typeof options.isMatchingKey;isMatchingKeyFunction?this.getKeyIndex=this._getKeyIndexFromMatchingKey:options.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey="function"==typeof options.transformKey,this.shouldCloneArguments=this.canTransformKey||isMatchingKeyFunction,this.shouldUpdateOnAdd="function"==typeof options.onCacheAdd,this.shouldUpdateOnChange="function"==typeof options.onCacheChange,this.shouldUpdateOnHit="function"==typeof options.onCacheHit}return Object.defineProperty(Cache.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(Cache.prototype,"snapshot",{get:function(){return{keys:cloneArray(this.keys),size:this.size,values:cloneArray(this.values)}},enumerable:!1,configurable:!0}),Cache.prototype._getKeyIndexFromMatchingKey=function(keyToMatch){var _a=this.options,isMatchingKey=_a.isMatchingKey,maxSize=_a.maxSize,keys=this.keys,keysLength=keys.length;if(!keysLength)return -1;if(isMatchingKey(keys[0],keyToMatch))return 0;if(maxSize>1){for(var index=1;index<keysLength;index++)if(isMatchingKey(keys[index],keyToMatch))return index}return -1},Cache.prototype._getKeyIndexForMany=function(keyToMatch){var existingKey,argIndex,isEqual=this.options.isEqual,keys=this.keys,keysLength=keys.length;if(!keysLength)return -1;if(1===keysLength)return this._getKeyIndexForSingle(keyToMatch);var keyLength=keyToMatch.length;if(keyLength>1){for(var index=0;index<keysLength;index++)if((existingKey=keys[index]).length===keyLength){for(argIndex=0;argIndex<keyLength&&isEqual(existingKey[argIndex],keyToMatch[argIndex]);argIndex++);if(argIndex===keyLength)return index}}else for(var index=0;index<keysLength;index++)if((existingKey=keys[index]).length===keyLength&&isEqual(existingKey[0],keyToMatch[0]))return index;return -1},Cache.prototype._getKeyIndexForSingle=function(keyToMatch){var keys=this.keys;if(!keys.length)return -1;var existingKey=keys[0],length=existingKey.length;if(keyToMatch.length!==length)return -1;var isEqual=this.options.isEqual;if(length>1){for(var index=0;index<length;index++)if(!isEqual(existingKey[index],keyToMatch[index]))return -1;return 0}return isEqual(existingKey[0],keyToMatch[0])?0:-1},Cache.prototype.orderByLru=function(key,value,startingIndex){for(var keys=this.keys,values=this.values,currentLength=keys.length,index=startingIndex;index--;)keys[index+1]=keys[index],values[index+1]=values[index];keys[0]=key,values[0]=value;var maxSize=this.options.maxSize;currentLength===maxSize&&startingIndex===currentLength?(keys.pop(),values.pop()):startingIndex>=maxSize&&(keys.length=values.length=maxSize)},Cache.prototype.updateAsyncCache=function(memoized){var _this=this,_a=this.options,onCacheChange=_a.onCacheChange,onCacheHit=_a.onCacheHit,firstKey=this.keys[0],firstValue=this.values[0];this.values[0]=firstValue.then(function(value){return _this.shouldUpdateOnHit&&onCacheHit(_this,_this.options,memoized),_this.shouldUpdateOnChange&&onCacheChange(_this,_this.options,memoized),value},function(error){var keyIndex=_this.getKeyIndex(firstKey);throw -1!==keyIndex&&(_this.keys.splice(keyIndex,1),_this.values.splice(keyIndex,1)),error})},Cache}();const RE_JSX_ANNOTATION_REGEX=/@jsx\s+(\S+)/u,RE_JS_IDENTIFIER_REGEX=/^[$A-Z_a-z][\w$]*$/u,getPragmaFromContext=function createMemoizedFunction(fn,options){if(void 0===options&&(options={}),"function"==typeof fn&&fn.isMemoized)return createMemoizedFunction(fn.fn,mergeOptions(fn.options,options));if("function"!=typeof fn)throw TypeError("You must pass a function to `memoize`.");var _a=options.isEqual,isMatchingKey=options.isMatchingKey,_b=options.isPromise,isPromise=void 0!==_b&&_b,_c=options.maxSize,onCacheAdd=options.onCacheAdd,onCacheChange=options.onCacheChange,onCacheHit=options.onCacheHit,transformKey=options.transformKey,normalizedOptions=mergeOptions({isEqual:void 0===_a?isSameValueZero:_a,isMatchingKey:isMatchingKey,isPromise:isPromise,maxSize:void 0===_c?1:_c,onCacheAdd:onCacheAdd,onCacheChange:onCacheChange,onCacheHit:onCacheHit,transformKey:transformKey},function(options){var customOptions={};for(var key in options)DEFAULT_OPTIONS_KEYS[key]||(customOptions[key]=options[key]);return customOptions}(options)),cache=new Cache(normalizedOptions),keys=cache.keys,values=cache.values,canTransformKey=cache.canTransformKey,shouldCloneArguments=cache.shouldCloneArguments,shouldUpdateOnAdd=cache.shouldUpdateOnAdd,shouldUpdateOnChange=cache.shouldUpdateOnChange,shouldUpdateOnHit=cache.shouldUpdateOnHit,memoized=function(){var key=shouldCloneArguments?cloneArray(arguments):arguments;canTransformKey&&(key=transformKey(key));var keyIndex=keys.length?cache.getKeyIndex(key):-1;if(-1!==keyIndex)shouldUpdateOnHit&&onCacheHit(cache,normalizedOptions,memoized),keyIndex&&(cache.orderByLru(keys[keyIndex],values[keyIndex],keyIndex),shouldUpdateOnChange&&onCacheChange(cache,normalizedOptions,memoized));else{var newValue=fn.apply(this,arguments),newKey=shouldCloneArguments?key:cloneArray(arguments);cache.orderByLru(newKey,newValue,keys.length),isPromise&&cache.updateAsyncCache(memoized),shouldUpdateOnAdd&&onCacheAdd(cache,normalizedOptions,memoized),shouldUpdateOnChange&&onCacheChange(cache,normalizedOptions,memoized)}return values[0]};return memoized.cache=cache,memoized.fn=fn,memoized.isMemoized=!0,memoized.options=normalizedOptions,memoized}(context=>{let settings=context.settings,pragmaNode=context.getSourceCode().getAllComments().find(node=>RE_JSX_ANNOTATION_REGEX.test(node.value));return Function$1.pipe(Option.orElse(Option.fromNullable(settings.react?.pragma),()=>Function$1.pipe(Option.fromNullable(pragmaNode),Option.map(({value})=>RE_JSX_ANNOTATION_REGEX.exec(value)),Option.flatMapNullable(matches=>matches?.[1]?.split(".")[0]))),Option.flatMap(Option.liftPredicate(x=>RE_JS_IDENTIFIER_REGEX.test(x))),Option.getOrElse(Function$1.constant("React")))}),t=Symbol.for("@ts-pattern/matcher"),e=Symbol.for("@ts-pattern/isVariadic"),n="@ts-pattern/anonymous-select-key",r=t=>!!(t&&"object"==typeof t),i=e=>e&&!!e[t],s=(n,o,c)=>{if(i(n)){let{matched:r,selections:i}=n[t]().match(o);return r&&i&&Object.keys(i).forEach(t=>c(t,i[t])),r}if(r(n)){if(!r(o))return!1;if(Array.isArray(n)){if(!Array.isArray(o))return!1;let t=[],r=[],a=[];for(let s of n.keys()){let o=n[s];i(o)&&o[e]?a.push(o):a.length?r.push(o):t.push(o)}if(a.length){if(a.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(o.length<t.length+r.length)return!1;let e=o.slice(0,t.length),n=0===r.length?[]:o.slice(-r.length),i=o.slice(t.length,0===r.length?1/0:-r.length);return t.every((t,n)=>s(t,e[n],c))&&r.every((t,e)=>s(t,n[e],c))&&(0===a.length||s(a[0],i,c))}return n.length===o.length&&n.every((t,e)=>s(t,o[e],c))}return Object.keys(n).every(e=>{let r=n[e];return(e in o||i(r)&&"optional"===r[t]().matcherType)&&s(r,o[e],c)})}return Object.is(o,n)},o=e=>{var n,s,a;return r(e)?i(e)?null!=(n=null==(s=(a=e[t]()).getSelectionKeys)?void 0:s.call(a))?n:[]:Array.isArray(e)?c(e,o):c(Object.values(e),o):[]},c=(t,e)=>t.reduce((t,n)=>t.concat(e(n)),[]);function a(...t){if(1===t.length){let[e]=t;return t=>s(e,t,()=>{})}if(2===t.length){let[e,n]=t;return s(e,n,()=>{})}throw Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function u(t1){return Object.assign(t1,{optional:()=>{var e;return e=t1,u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return void 0===t?(o(e).forEach(t=>r(t,void 0)),{matched:!0,selections:n}):{matched:s(e,t,r),selections:n}},getSelectionKeys:()=>o(e),matcherType:"optional"})})},and:e=>m(t1,e),or:e=>(function(...e){return u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return c(e,o).forEach(t=>r(t,void 0)),{matched:e.some(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"or"})})})(t1,e),select:e=>void 0===e?p(t1):p(e,t1)})}function m(...e){return u({[t]:()=>({match:t=>{let n={},r=(t,e)=>{n[t]=e};return{matched:e.every(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"and"})})}function d(e){return{[t]:()=>({match:t=>({matched:!!e(t)})})}}function p(...e){let r="string"==typeof e[0]?e[0]:void 0,i=2===e.length?e[1]:"string"==typeof e[0]?void 0:e[0];return u({[t]:()=>({match:t=>{let e={[null!=r?r:n]:t};return{matched:void 0===i||s(i,t,(t,n)=>{e[t]=n}),selections:e}},getSelectionKeys:()=>[null!=r?r:n].concat(void 0===i?[]:o(i))})})}function v(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"bigint"==typeof t}u(d(function(t){return!0}));const j=t=>Object.assign(u(t),{startsWith:e=>j(m(t,d(t=>b(t)&&t.startsWith(e)))),endsWith:e=>j(m(t,d(t=>b(t)&&t.endsWith(e)))),minLength:e=>j(m(t,d(e1=>b(e1)&&e1.length>=e))),maxLength:e=>j(m(t,d(e1=>b(e1)&&e1.length<=e))),includes:e=>j(m(t,d(t=>b(t)&&t.includes(e)))),regex:e=>j(m(t,d(t=>b(t)&&!!t.match(e))))}),E=j(d(b)),K=t=>Object.assign(u(t),{between:(e,n)=>K(m(t,d(n1=>v(n1)&&e<=n1&&n>=n1))),lt:e=>K(m(t,d(e1=>v(e1)&&e1<e))),gt:e=>K(m(t,d(e1=>v(e1)&&e1>e))),lte:e=>K(m(t,d(e1=>v(e1)&&e1<=e))),gte:e=>K(m(t,d(e1=>v(e1)&&e1>=e))),int:()=>K(m(t,d(t=>v(t)&&Number.isInteger(t)))),finite:()=>K(m(t,d(t=>v(t)&&Number.isFinite(t)))),positive:()=>K(m(t,d(t=>v(t)&&t>0))),negative:()=>K(m(t,d(t=>v(t)&&t<0)))}),A=K(d(v)),x=t=>Object.assign(u(t),{between:(e,n)=>x(m(t,d(n1=>w(n1)&&e<=n1&&n>=n1))),lt:e=>x(m(t,d(e1=>w(e1)&&e1<e))),gt:e=>x(m(t,d(e1=>w(e1)&&e1>e))),lte:e=>x(m(t,d(e1=>w(e1)&&e1<=e))),gte:e=>x(m(t,d(e1=>w(e1)&&e1>=e))),positive:()=>x(m(t,d(t=>w(t)&&t>0))),negative:()=>x(m(t,d(t=>w(t)&&t<0)))}),T=(x(d(w)),u(d(function(t){return"boolean"==typeof t})));u(d(function(t){return"symbol"==typeof t})),u(d(function(t){return null==t}));var _={string:E,number:A,boolean:T};const W={matched:!1,value:void 0};function N(t){return new $(t,W)}class ${constructor(t,e){this.input=void 0,this.state=void 0,this.input=t,this.state=e}with(...t){let i;if(this.state.matched)return this;let e=t[t.length-1],r=[t[0]];3===t.length&&"function"==typeof t[1]?(r.push(t[0]),i=t[1]):t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,c={},a=(t,e)=>{o=!0,c[t]=e},u=r.some(t=>s(t,this.input,a))&&(!i||i(this.input))?{matched:!0,value:e(o?n in c?c[n]:c:this.input,this.input)}:W;return new $(this.input,u)}when(t,e){if(this.state.matched)return this;let n=!!t(this.input);return new $(this.input,n?{matched:!0,value:e(this.input,this.input)}:W)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){return this.run()}run(){let t;if(this.state.matched)return this.state.value;try{t=JSON.stringify(this.input)}catch(e){t=this.input}throw Error(`Pattern matching error: no pattern matches value ${t}`)}returnType(){return this}}function isInitializedFromPragma(variableName,context,pragma=getPragmaFromContext(context)){let variables=getVariablesUpToGlobal(context.getScope()),maybeVariable=findVariableByName(variableName)(variables),maybeLatestDef=Option.flatMapNullable(maybeVariable,variable=>variable.defs.at(-1));if(Option.isNone(maybeLatestDef))return!1;let{node,parent}=maybeLatestDef.value;if(node.type===NodeType.VariableDeclarator&&node.init){let{init}=node;if(a({type:"MemberExpression",object:{type:"Identifier",name:pragma}},init)||a({type:"Identifier",name:pragma},init))return!0;let maybeRequireExpression=N(init).with({type:NodeType.CallExpression,callee:{type:NodeType.Identifier,name:"require"}},exp=>Option.some(exp)).with({type:NodeType.MemberExpression,object:{type:NodeType.CallExpression,callee:{type:NodeType.Identifier,name:"require"}}},({object})=>Option.some(object)).otherwise(Option.none);if(Option.isNone(maybeRequireExpression))return!1;let[firstArg]=maybeRequireExpression.value.arguments;return firstArg?.type===NodeType.Literal&&firstArg.value===pragma.toLowerCase()}return a({type:"ImportDeclaration",source:{value:pragma.toLowerCase()}},parent)}function isPropertyOfPragma(name,context,pragma=getPragmaFromContext(context)){return a({type:NodeType.MemberExpression,object:{type:NodeType.Identifier,name:pragma},property:{name}})}function isCallFromPragma(name){return(node,context)=>node.type===NodeType.CallExpression&&"callee"in node&&(node.callee.type===NodeType.MemberExpression?isPropertyOfPragma(name,context)(node.callee):"name"in node.callee&&node.callee.name===name&&isInitializedFromPragma(name,context))}const isCreateElementCall=isCallFromPragma("createElement"),isCloneElementCall=isCallFromPragma("cloneElement"),hdlAnimation=["onAnimationStart","onAnimationEnd","onAnimationIteration"],hdlClipboard=["onCopy","onCut","onPaste"],hdlComposition=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],hdlFocus=["onFocus","onBlur"],hdlForm=["onChange","onInput","onSubmit"],hdlImage=["onLoad","onError"],hdlKeyboard=["onKeyDown","onKeyPress","onKeyUp"],hdlMedia=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],hdlMouse=["onClick","onContextMenu","onDblClick","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],hdlSelection=["onSelect"],hdlTouch=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],hdlTransition=["onTransitionEnd"],hdlScroll=["onScroll"],hdlWheel=["onWheel"];[...hdlAnimation,...hdlClipboard,...hdlComposition,...hdlFocus,...hdlForm,...hdlImage,...hdlKeyboard,...hdlMedia,...hdlMouse,...hdlSelection,...hdlTouch,...hdlTransition,...hdlScroll,...hdlWheel];const isLiteral=isOneOf([NodeType.Literal,NodeType.JSXText]);function isWhiteSpace(node){return isString(node.value)&&""===node.value.trim()}function isPaddingSpaces(node){return isLiteral(node)&&isWhiteSpace(node)&&node.raw.includes("\n")}const isFragmentSyntax=is(NodeType.JSXFragment);function isFragmentElement(node,pragma,fragment){let{name}=node.openingElement;return name.type===NodeType.JSXIdentifier&&name.name===fragment||name.type===NodeType.JSXMemberExpression&&name.object.type===NodeType.JSXIdentifier&&name.object.name===pragma&&name.property.name===fragment}const JSXValueCheckHint={None:0n,SkipNullLiteral:1n<<0n,SkipUndefinedLiteral:1n<<1n,SkipBooleanLiteral:1n<<2n,SkipStringLiteral:1n<<3n,SkipNumberLiteral:1n<<4n,SkipCreateElement:1n<<5n,StrictArray:1n<<6n,StrictLogical:1n<<7n,StrictConditional:1n<<8n},defaultJSXValueCheckHint=JSXValueCheckHint.SkipUndefinedLiteral|JSXValueCheckHint.SkipBooleanLiteral;function isJSXValue(node,context,hint=JSXValueCheckHint.None){return!!node&&N(node).with({type:NodeType.JSXElement},Function$1.constTrue).with({type:NodeType.JSXFragment},Function$1.constTrue).with({type:NodeType.JSXMemberExpression},Function$1.constTrue).with({type:NodeType.JSXNamespacedName},Function$1.constTrue).with({type:NodeType.Literal},node=>N(node.value).with(null,()=>!(hint&JSXValueCheckHint.SkipNullLiteral)).with(_.boolean,()=>!(hint&JSXValueCheckHint.SkipBooleanLiteral)).with(_.string,()=>!(hint&JSXValueCheckHint.SkipStringLiteral)).with(_.number,()=>!(hint&JSXValueCheckHint.SkipNumberLiteral)).otherwise(Function$1.constFalse)).with({type:NodeType.TemplateLiteral},()=>!(hint&JSXValueCheckHint.SkipStringLiteral)).with({type:NodeType.ArrayExpression},node=>hint&JSXValueCheckHint.StrictArray?node.elements.every(n=>isJSXValue(n,context,hint)):node.elements.some(n=>isJSXValue(n,context,hint))).with({type:NodeType.ConditionalExpression},node=>{function leftHasJSX(node){return Array.isArray(node.consequent)?hint&JSXValueCheckHint.StrictArray?node.consequent.every(n=>isJSXValue(n,context,hint)):node.consequent.some(n=>isJSXValue(n,context,hint)):isJSXValue(node.consequent,context,hint)}function rightHasJSX(node){return isJSXValue(node.alternate,context,hint)}return hint&JSXValueCheckHint.StrictConditional?leftHasJSX(node)&&rightHasJSX(node):leftHasJSX(node)||rightHasJSX(node)}).with({type:NodeType.LogicalExpression},node=>isJSXValue(node.left,context,hint)||isJSXValue(node.right,context,hint)).with({type:NodeType.SequenceExpression},node=>isJSXValue(node.expressions.at(-1),context,hint)).with({type:NodeType.CallExpression},node=>!(hint&JSXValueCheckHint.SkipCreateElement)&&isCreateElementCall(node,context)).with({type:NodeType.Identifier},node=>{var startScope;let{name}=node;if("undefined"===name)return!(hint&JSXValueCheckHint.SkipUndefinedLiteral);if(isJSXTagNameExpression(node))return!0;let maybeVariable=(startScope=context.getScope(),findVariableByName(name)(getVariablesUpToGlobal(startScope)));return Function$1.pipe(maybeVariable,Option.flatMap(getVariableInit(0)),Option.exists(n=>isJSXValue(n,context,hint)))}).otherwise(Function$1.constFalse)}function getPropName(node){return N(node.name).when(is(NodeType.JSXIdentifier),n=>n.name).when(is(NodeType.JSXNamespacedName),n=>`${n.namespace.name}:${n.name.name}`).exhaustive()}function findPropInProperties(properties,context,seenProps=[]){let startScope=context.getScope();return propName=>Option.fromNullable(properties.find(prop=>N(prop).when(is(NodeType.Property),prop=>"name"in prop.key&&prop.key.name===propName).when(is(NodeType.SpreadElement),prop=>N(prop.argument).when(is(NodeType.Identifier),argument=>{let{name}=argument,maybeInit=Option.flatMap(findVariableByName(name)(getVariablesUpToGlobal(startScope)),getVariableInit(0));if(Option.isNone(maybeInit))return!1;let init=maybeInit.value;return!(init.type!==NodeType.ObjectExpression||seenProps.includes(name))&&Option.isSome(findPropInProperties(init.properties,context,[...seenProps,name])(propName))}).when(is(NodeType.ObjectExpression),argument=>Option.isSome(findPropInProperties(argument.properties,context,seenProps)(propName))).when(is(NodeType.MemberExpression),()=>{}).when(is(NodeType.CallExpression),()=>{}).otherwise(Function$1.constFalse)).when(is(NodeType.RestElement),()=>!1).otherwise(Function$1.constFalse)))}function findPropInAttributes(attributes,context){let startScope=context.getScope();return propName=>Option.fromNullable(attributes.find(attr=>N(attr).when(is(NodeType.JSXAttribute),attr=>getPropName(attr)===propName).when(is(NodeType.JSXSpreadAttribute),attr=>N(attr.argument).with({type:NodeType.Identifier},argument=>{let{name}=argument,maybeInit=Option.flatMap(findVariableByName(name)(getVariablesUpToGlobal(startScope)),getVariableInit(0));if(Option.isNone(maybeInit))return!1;let init=maybeInit.value;return"properties"in init&&Option.isSome(findPropInProperties(init.properties,context)(propName))}).when(is(NodeType.ObjectExpression),argument=>Option.isSome(findPropInProperties(argument.properties,context)(propName))).when(is(NodeType.MemberExpression),()=>!1).when(is(NodeType.CallExpression),()=>!1).otherwise(Function$1.constFalse)).otherwise(Function$1.constFalse)))}function hasProp(attributes,propName,context){return Option.isSome(findPropInAttributes(attributes,context)(propName))}function traverseUpProp(node,predicate=Function$1.constTrue){return Option.fromNullable(function traverseUpGuard(node,predicate){let{parent}=node;return parent&&parent.type!==NodeType.Program?predicate(parent)?parent:traverseUpGuard(parent,predicate):null}(node,node=>node.type===NodeType.JSXAttribute&&predicate(node)))}exports.JSXValueCheckHint=JSXValueCheckHint,exports.defaultJSXValueCheckHint=defaultJSXValueCheckHint,exports.elementType=function(node){if(node.type===types.AST_NODE_TYPES.JSXOpeningFragment)return"<>";let{name}=node;if(name.type===types.AST_NODE_TYPES.JSXMemberExpression){let{object,property}=name;return function resolveMemberExpressions(object,property){return object.type===types.AST_NODE_TYPES.JSXMemberExpression?`${resolveMemberExpressions(object.object,object.property)}.${property.name}`:object.type===types.AST_NODE_TYPES.JSXNamespacedName?`${object.namespace.name}:${object.name.name}.${property.name}`:`${object.name}.${property.name}`}(object,property)}return name.type===types.AST_NODE_TYPES.JSXNamespacedName?`${name.namespace.name}:${name.name.name}`:name.name},exports.findPropInAttributes=findPropInAttributes,exports.findPropInProperties=findPropInProperties,exports.getFragmentFromContext=function(context){let settings=context.settings,fragment=settings.react?.fragment;return isString(fragment)&&RE_JS_IDENTIFIER_REGEX.test(fragment)?fragment:"Fragment"},exports.getPragmaFromContext=getPragmaFromContext,exports.getProp=function(props,propName,context){return findPropInAttributes(props,context)(propName)},exports.getPropName=getPropName,exports.getPropValue=function(attribute,context){let scope=context.getScope();if(attribute.type===NodeType.JSXAttribute&&"value"in attribute){let{value}=attribute;return null===value?Option.none():value.type===NodeType.Literal?Option.some(getStaticValue(value,scope)):value.type===NodeType.JSXExpressionContainer?Option.some(getStaticValue(value.expression,scope)):Option.none()}let{argument}=attribute;return Option.some(getStaticValue(argument,scope))},exports.hasAnyProp=function(attributes,propNames,context){return propNames.some(propName=>hasProp(attributes,propName,context))},exports.hasChildren=function(node,predicate){return"function"==typeof predicate?node.children.some(predicate):node.children.length>0},exports.hasEveryProp=function(attributes,propNames,context){return propNames.every(propName=>hasProp(attributes,propName,context))},exports.hasProp=hasProp,exports.hdlAnimation=hdlAnimation,exports.hdlClipboard=hdlClipboard,exports.hdlComposition=hdlComposition,exports.hdlFocus=hdlFocus,exports.hdlForm=hdlForm,exports.hdlImage=hdlImage,exports.hdlKeyboard=hdlKeyboard,exports.hdlMedia=hdlMedia,exports.hdlMouse=hdlMouse,exports.hdlScroll=hdlScroll,exports.hdlSelection=hdlSelection,exports.hdlTouch=hdlTouch,exports.hdlTransition=hdlTransition,exports.hdlWheel=hdlWheel,exports.isCallFromPragma=isCallFromPragma,exports.isChildOfJSXElement=function(node){return node.parent?.type===NodeType.JSXElement&&node.parent.children.some(child=>child===node)},exports.isChildrenOfCreateElement=function(node,context){let maybeCallExpression=node.parent;return!!(maybeCallExpression&&isCreateElementCall(maybeCallExpression,context))&&maybeCallExpression.arguments.slice(2).some(child=>child===node)},exports.isCloneElementCall=isCloneElementCall,exports.isCreateElementCall=isCreateElementCall,exports.isFragment=(node,pragma,fragment)=>!!isOneOf([NodeType.JSXElement,NodeType.JSXFragment])(node)&&(isFragmentSyntax(node)||isFragmentElement(node,pragma,fragment)),exports.isFragmentElement=isFragmentElement,exports.isFragmentHasLessThanTwoChildren=function(node){let nonPaddingChildren=node.children.filter(child=>!isPaddingSpaces(child));if(1===nonPaddingChildren.length){var node1;return!((node1=nonPaddingChildren[0]).type===NodeType.JSXExpressionContainer&&node1.expression.type===NodeType.CallExpression)}return 0===nonPaddingChildren.length},exports.isFragmentSyntax=isFragmentSyntax,exports.isFragmentWithOnlyTextAndIsNotChild=function(node){return 1===node.children.length&&isLiteral(node.children[0])&&!(node.parent.type===NodeType.JSXElement||node.parent.type===NodeType.JSXFragment)},exports.isFragmentWithSingleExpression=function(node){let children=node.children.filter(child=>!isPaddingSpaces(child));return 1===children.length&&children[0]?.type===NodeType.JSXExpressionContainer},exports.isFunctionReturningJSXValue=function(node,context,hint=defaultJSXValueCheckHint){return node.body.type!==NodeType.BlockStatement?isJSXValue(node.body,context,hint):(function getNestedReturnStatements(node){let returnStatements=[];return node.type===NodeType.ReturnStatement&&returnStatements.push(node),"body"in node&&null!=node.body&&(Array.isArray(node.body)?node.body.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.body))),"consequent"in node&&(Array.isArray(node.consequent)?node.consequent.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.consequent))),"alternate"in node&&null!==node.alternate&&(Array.isArray(node.alternate)?node.alternate.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}):returnStatements.push(...getNestedReturnStatements(node.alternate))),"cases"in node&&node.cases.forEach(x=>{returnStatements.push(...getNestedReturnStatements(x))}),"block"in node&&returnStatements.push(...getNestedReturnStatements(node.block)),"handler"in node&&null!==node.handler&&returnStatements.push(...getNestedReturnStatements(node.handler)),"finalizer"in node&&null!==node.finalizer&&returnStatements.push(...getNestedReturnStatements(node.finalizer)),"expression"in node&&!0!==node.expression&&!1!==node.expression&&returnStatements.push(...getNestedReturnStatements(node.expression)),"test"in node&&null!==node.test&&returnStatements.push(...getNestedReturnStatements(node.test)),returnStatements})(node.body).some(statement=>isJSXValue(statement.argument,context,hint))},exports.isInitializedFromPragma=isInitializedFromPragma,exports.isInsideCreateElementProps=function(node,context){let parentCreateElement=traverseUp(node,n=>isCreateElementCall(n,context));return parentCreateElement?.type===NodeType.CallExpression&&parentCreateElement.arguments.at(1)===traverseUp(node,is(NodeType.ObjectExpression))},exports.isInsidePropValue=function(node){return node?.type===NodeType.Literal&&isString$1(node.value)?node.parent.type===NodeType.JSXAttribute:Option.isSome(traverseUpProp(node,n=>n.value?.type===NodeType.JSXExpressionContainer))},exports.isJSXElementOfBuiltinComponent=function(node){return node.type===NodeType.JSXElement&&node.openingElement.name.type===NodeType.JSXIdentifier&&node.openingElement.name.name.toLowerCase()===node.openingElement.name.name&&/^[a-z]/u.test(node.openingElement.name.name)},exports.isJSXElementOfUserDefinedComponent=function(node){return node.type===NodeType.JSXElement&&node.openingElement.name.type===NodeType.JSXIdentifier&&/^[A-Z]/u.test(node.openingElement.name.name)},exports.isJSXValue=isJSXValue,exports.isLineBreak=function(node){return isLiteral(node)&&isWhiteSpace(node)&&node.loc.start.line!==node.loc.end.line},exports.isLiteral=isLiteral,exports.isPaddingSpaces=isPaddingSpaces,exports.isPropertyOfPragma=isPropertyOfPragma,exports.isWhiteSpace=isWhiteSpace,exports.traverseUpProp=traverseUpProp;
|