ripplo 0.7.37 → 0.7.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env node
2
+ import{a as xf,b as Ia,c as cx}from"./chunk-SB7H6IAS.js";var Hf=xf((tl,Gf)=>{"use strict";var{hasOwnProperty:Pr}=Object.prototype,gn=el();gn.configure=el;gn.stringify=gn;gn.default=gn;tl.stringify=gn;tl.configure=el;Gf.exports=gn;var zx=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Xt(e){return e.length<5e3&&!zx.test(e)?`"${e}"`:JSON.stringify(e)}function Xa(e,t){if(e.length>200||t)return e.sort(t);for(let n=1;n<e.length;n++){let r=e[n],i=n;for(;i!==0&&e[i-1]>r;)e[i]=e[i-1],i--;e[i]=r}return e}var Gx=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Qa(e){return Gx.call(e)!==void 0&&e.length!==0}function Wf(e,t,n){e.length<n&&(n=e.length);let r=t===","?"":" ",i=`"0":${r}${e[0]}`;for(let o=1;o<n;o++)i+=`${t}"${o}":${r}${e[o]}`;return i}function Hx(e){if(Pr.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Kx(e){let t;if(Pr.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function qx(e,t){let n;if(Pr.call(e,t)&&(n=e[t],typeof n!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return n===void 0?!0:n}function zf(e,t){let n;if(Pr.call(e,t)){if(n=e[t],typeof n!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${t}" argument must be an integer`);if(n<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return n===void 0?1/0:n}function yn(e){return e===1?"1 item":`${e} items`}function Yx(e){let t=new Set;for(let n of e)(typeof n=="string"||typeof n=="number")&&t.add(String(n));return t}function Zx(e){if(Pr.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function el(e){e={...e};let t=Zx(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=Hx(e),r=qx(e,"bigint"),i=Kx(e),o=typeof i=="function"?i:void 0,s=zf(e,"maximumDepth"),a=zf(e,"maximumBreadth");function l(h,f,m,y,S,w){let b=f[h];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(h)),b=y.call(f,h,b),typeof b){case"string":return Xt(b);case"object":{if(b===null)return"null";if(m.indexOf(b)!==-1)return n;let v="",T=",",N=w;if(Array.isArray(b)){if(b.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(b),S!==""&&(w+=S,v+=`
3
+ ${w}`,T=`,
4
+ ${w}`);let de=Math.min(b.length,a),D=0;for(;D<de-1;D++){let bt=l(String(D),b,m,y,S,w);v+=bt!==void 0?bt:"null",v+=T}let Ne=l(String(D),b,m,y,S,w);if(v+=Ne!==void 0?Ne:"null",b.length-1>a){let bt=b.length-a-1;v+=`${T}"... ${yn(bt)} not stringified"`}return S!==""&&(v+=`
5
+ ${N}`),m.pop(),`[${v}]`}let $=Object.keys(b),L=$.length;if(L===0)return"{}";if(s<m.length+1)return'"[Object]"';let O="",Y="";S!==""&&(w+=S,T=`,
6
+ ${w}`,O=" ");let he=Math.min(L,a);i&&!Qa(b)&&($=Xa($,o)),m.push(b);for(let de=0;de<he;de++){let D=$[de],Ne=l(D,b,m,y,S,w);Ne!==void 0&&(v+=`${Y}${Xt(D)}:${O}${Ne}`,Y=T)}if(L>a){let de=L-a;v+=`${Y}"...":${O}"${yn(de)} not stringified"`,Y=T}return S!==""&&Y.length>1&&(v=`
7
+ ${w}${v}
8
+ ${N}`),m.pop(),`{${v}}`}case"number":return isFinite(b)?String(b):t?t(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(b);default:return t?t(b):void 0}}function u(h,f,m,y,S,w){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(h)),typeof f){case"string":return Xt(f);case"object":{if(f===null)return"null";if(m.indexOf(f)!==-1)return n;let b=w,v="",T=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S!==""&&(w+=S,v+=`
9
+ ${w}`,T=`,
10
+ ${w}`);let L=Math.min(f.length,a),O=0;for(;O<L-1;O++){let he=u(String(O),f[O],m,y,S,w);v+=he!==void 0?he:"null",v+=T}let Y=u(String(O),f[O],m,y,S,w);if(v+=Y!==void 0?Y:"null",f.length-1>a){let he=f.length-a-1;v+=`${T}"... ${yn(he)} not stringified"`}return S!==""&&(v+=`
11
+ ${b}`),m.pop(),`[${v}]`}m.push(f);let N="";S!==""&&(w+=S,T=`,
12
+ ${w}`,N=" ");let $="";for(let L of y){let O=u(L,f[L],m,y,S,w);O!==void 0&&(v+=`${$}${Xt(L)}:${N}${O}`,$=T)}return S!==""&&$.length>1&&(v=`
13
+ ${w}${v}
14
+ ${b}`),m.pop(),`{${v}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function c(h,f,m,y,S){switch(typeof f){case"string":return Xt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return c(h,f,m,y,S);if(f===null)return"null"}if(m.indexOf(f)!==-1)return n;let w=S;if(Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f),S+=y;let O=`
15
+ ${S}`,Y=`,
16
+ ${S}`,he=Math.min(f.length,a),de=0;for(;de<he-1;de++){let Ne=c(String(de),f[de],m,y,S);O+=Ne!==void 0?Ne:"null",O+=Y}let D=c(String(de),f[de],m,y,S);if(O+=D!==void 0?D:"null",f.length-1>a){let Ne=f.length-a-1;O+=`${Y}"... ${yn(Ne)} not stringified"`}return O+=`
17
+ ${w}`,m.pop(),`[${O}]`}let b=Object.keys(f),v=b.length;if(v===0)return"{}";if(s<m.length+1)return'"[Object]"';S+=y;let T=`,
18
+ ${S}`,N="",$="",L=Math.min(v,a);Qa(f)&&(N+=Wf(f,T,a),b=b.slice(f.length),L-=f.length,$=T),i&&(b=Xa(b,o)),m.push(f);for(let O=0;O<L;O++){let Y=b[O],he=c(Y,f[Y],m,y,S);he!==void 0&&(N+=`${$}${Xt(Y)}: ${he}`,$=T)}if(v>a){let O=v-a;N+=`${$}"...": "${yn(O)} not stringified"`,$=T}return $!==""&&(N=`
19
+ ${S}${N}
20
+ ${w}`),m.pop(),`{${N}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function d(h,f,m){switch(typeof f){case"string":return Xt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(h),typeof f!="object")return d(h,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return n;let y="",S=f.length!==void 0;if(S&&Array.isArray(f)){if(f.length===0)return"[]";if(s<m.length+1)return'"[Array]"';m.push(f);let N=Math.min(f.length,a),$=0;for(;$<N-1;$++){let O=d(String($),f[$],m);y+=O!==void 0?O:"null",y+=","}let L=d(String($),f[$],m);if(y+=L!==void 0?L:"null",f.length-1>a){let O=f.length-a-1;y+=`,"... ${yn(O)} not stringified"`}return m.pop(),`[${y}]`}let w=Object.keys(f),b=w.length;if(b===0)return"{}";if(s<m.length+1)return'"[Object]"';let v="",T=Math.min(b,a);S&&Qa(f)&&(y+=Wf(f,",",a),w=w.slice(f.length),T-=f.length,v=","),i&&(w=Xa(w,o)),m.push(f);for(let N=0;N<T;N++){let $=w[N],L=d($,f[$],m);L!==void 0&&(y+=`${v}${Xt($)}:${L}`,v=",")}if(b>a){let N=b-a;y+=`${v}"...":"${yn(N)} not stringified"`}return m.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(f);default:return t?t(f):void 0}}function p(h,f,m){if(arguments.length>1){let y="";if(typeof m=="number"?y=" ".repeat(Math.min(m,10)):typeof m=="string"&&(y=m.slice(0,10)),f!=null){if(typeof f=="function")return l("",{"":h},[],f,y,"");if(Array.isArray(f))return u("",h,[],Yx(f),y,"")}if(y.length!==0)return c("",h,[],y,"")}return d("",h,[])}return p}});var Nh=xf((mF,Gl)=>{"use strict";var Oo=process||{},Th=Oo.argv||[],To=Oo.env||{},Sk=!(To.NO_COLOR||Th.includes("--no-color"))&&(!!To.FORCE_COLOR||Th.includes("--color")||Oo.platform==="win32"||(Oo.stdout||{}).isTTY&&To.TERM!=="dumb"||!!To.CI),wk=(e,t,n=e)=>r=>{let i=""+r,o=i.indexOf(t,e.length);return~o?e+xk(i,t,n,o)+t:e+i+t},xk=(e,t,n,r)=>{let i="",o=0;do i+=e.substring(o,r)+n,o=r+t.length,r=e.indexOf(t,o);while(~r);return i+e.substring(o)},Oh=(e=Sk)=>{let t=e?wk:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Gl.exports=Oh();Gl.exports.createColors=Oh});import{z as A}from"zod";var Ma=A.enum(["fast","slow","async"]),Bn=A.object({ref:A.string().min(1)}),It=A.union([A.string(),A.number(),A.boolean()]),Ta=A.object({template:A.array(A.union([A.string(),Bn])).min(1)}),De=A.union([Bn,It,Ta,A.null()]),vf=A.object({kind:A.literal("changed")}),Oa=A.union([De,vf]),Mt=A.union([A.string(),Bn,Ta]),dx=A.object({by:A.literal("role"),name:A.union([Mt,A.undefined()]).optional().transform(e=>e),role:A.string().min(1)}),fx=A.object({by:A.literal("testId"),value:Mt}),px=A.object({by:A.literal("inside"),scope:A.lazy(()=>be),target:A.lazy(()=>be)}),be=A.discriminatedUnion("by",[dx,fx,px]),_i=A.enum(["string","number","boolean"]),Na=A.enum(["strict","eventual"]),hx=A.object({kind:A.literal("string"),maxLength:A.number().int().positive().optional(),minLength:A.number().int().nonnegative().optional(),pattern:A.string().optional()}),mx=A.object({kind:A.literal("number"),max:A.number().int().optional(),min:A.number().int().optional()}),yx=A.object({kind:A.literal("datetime"),maxOffsetDays:A.number().int(),minOffsetDays:A.number().int()}),Rf=A.discriminatedUnion("kind",[hx,mx,yx]),Cf=A.enum(["company.name","date.iso","internet.email","internet.url","person.fullName","lorem.slug","lorem.word"]),$a=A.object({constraints:Rf.optional(),generator:Cf,name:A.string().min(1),type:_i,values:A.array(It).min(1).optional()}),kf=A.object({consistency:Na.default("strict"),optional:A.boolean(),type:_i,valueSpace:A.string().min(1).optional()}),La=A.enum(["backend","client"]),Da=A.object({description:A.string().optional(),identity:A.array(A.string().min(1)).min(1),identityKind:A.enum(["surrogate","natural"]),name:A.string().min(1),props:A.record(A.string().min(1),kf),source:La.default("backend")}),_a=A.object({consistency:Na.default("strict"),default:It,description:A.string().optional(),name:A.string().min(1),source:La.default("backend"),type:_i,valueSpace:A.string().min(1).optional()}),kr=A.enum(["url","title","viewport"]);function Ba(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${Ba(e.scope)} \u25B8 ${Ba(e.target)}`:`${e.role} ${e.name??""}`.trim()}import{z as R}from"zod";var Fa=["unspecified","internal","server","client","producer","consumer"],ja=["unset","ok","error"],Af=R.looseObject({data:R.looseObject({source:R.number().optional()}).optional(),timestamp:R.number(),type:R.number()}),wt=R.string(),gx=R.object({action:R.string(),kind:R.literal("action"),source:R.literal("test"),target:R.string().optional(),timeNanos:wt,value:R.string().optional()}),bx=R.object({kind:R.literal("assertion"),label:R.string(),outcome:R.enum(["passed","failed","error"]),source:R.literal("test"),step:R.string(),timeNanos:wt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),Sx=R.object({event:Af,kind:R.literal("rrweb"),rrwebType:R.string(),source:R.literal("browser"),timeNanos:wt}),wx=R.object({kind:R.literal("network"),method:R.string(),requestBody:R.string().optional(),resourceType:R.string(),responseBody:R.string().optional(),source:R.literal("browser"),spanId:R.string().optional(),status:R.number(),timeNanos:wt,traceId:R.string().optional(),url:R.string()}),xx=R.object({kind:R.literal("console"),level:R.string(),source:R.literal("browser"),text:R.string(),timeNanos:wt}),vx=R.object({kind:R.literal("error"),message:R.string(),source:R.literal("browser"),stack:R.string().optional(),timeNanos:wt}),Rx=R.object({clientVersion:R.string(),kind:R.literal("meta"),source:R.literal("capture"),timeNanos:wt}),Cx=R.object({kind:R.literal("notice"),message:R.string(),source:R.literal("capture"),timeNanos:wt}),kx=R.object({actual:R.string().optional(),expected:R.string().optional(),findingKind:R.string(),kind:R.literal("finding"),mismatchKind:R.string().optional(),pending:R.boolean().optional(),source:R.literal("verifier"),step:R.string(),subject:R.string(),timeNanos:wt,wait:R.enum(["fast","slow","async"]).optional(),waitMs:R.number().optional()}),Ef=R.object({attributes:R.record(R.string(),R.string()),durationMs:R.number(),kind:R.literal("span"),name:R.string(),parentSpanId:R.string().optional(),source:R.literal("server"),spanId:R.string(),spanKind:R.enum(Fa),status:R.object({code:R.enum(ja),message:R.string().optional()}),timeNanos:wt,traceId:R.string()}),Pf=R.discriminatedUnion("kind",[gx,bx,Sx,wx,xx,vx,Rx,Cx,kx,Ef]);function Ax(e){let t=Px(e);if(t==null)return null;let n=Pf.safeParse(t);return n.success?n.data:null}function Ex(e){return Number(BigInt(e)/1000000n)}function Va(e){return Fa[e]??"unspecified"}function Ua(e){return ja[e]??"unset"}function Px(e){try{return JSON.parse(e)}catch{return null}}import{z as x}from"zod";var Ix=x.discriminatedUnion("kind",[x.object({as:x.string().min(1),kind:x.literal("created"),props:x.record(x.string().min(1),De)}),x.object({as:x.string().min(1),kind:x.literal("updated"),props:x.record(x.string().min(1),Oa)}),x.object({kind:x.literal("deleted")})]),Mx=x.object({kind:x.literal("is"),value:De}),Tx=x.discriminatedUnion("kind",[x.object({kind:x.literal("path")}),x.object({key:x.string().min(1),kind:x.literal("query")}),x.object({kind:x.literal("hash")})]),If=x.lazy(()=>x.union([De,Nx])),Ox=x.object({entity:x.string().min(1),where:x.record(x.string().min(1),If)}),Nx=x.object({field:x.string().min(1),kind:x.literal("within"),selection:Ox}),rt=x.union([Ma,x.undefined()]).optional().transform(e=>e),Mf=x.object({assertion:Mx,kind:x.literal("singleton"),singleton:x.string().min(1),wait:rt}),Tf=x.object({entity:x.string().min(1),kind:x.literal("count"),value:x.number().int().nonnegative()}),Bi=x.lazy(()=>x.discriminatedUnion("kind",[Mf,Tf,x.object({kind:x.literal("not"),predicate:Bi}),x.object({kind:x.literal("and"),predicates:x.array(Bi)})])),$x=x.lazy(()=>x.object({condition:x.union([Bi,x.undefined()]).optional().transform(e=>e),consequence:x.array(Fn),name:x.string().min(1)})),Fn=x.lazy(()=>x.discriminatedUnion("kind",[x.object({kind:x.literal("visible"),locator:be,wait:rt}),x.object({kind:x.literal("unobstructed"),locator:be,wait:rt}),x.object({kind:x.literal("disabled"),locator:be,wait:rt}),x.object({kind:x.literal("enabled"),locator:be,wait:rt}),x.object({kind:x.literal("focused"),locator:be,wait:rt}),x.object({kind:x.literal("checked"),locator:be,wait:rt}),x.object({kind:x.literal("value"),locator:be,value:Mt,wait:rt}),x.object({kind:x.literal("text"),locator:be,value:Mt,wait:rt}),Mf,x.object({kind:x.literal("browser"),name:kr,part:x.union([Tx,x.undefined()]).optional().transform(e=>e),value:x.union([Mt,x.null()]),wait:rt}),x.object({assertion:Ix,entity:x.string().min(1),key:x.record(x.string().min(1),If),kind:x.literal("state"),wait:rt}),x.object({kind:x.literal("not"),predicate:Fn}),x.object({kind:x.literal("and"),predicates:x.array(Fn)}),Tf,x.object({branches:x.array($x),kind:x.literal("when")})]));import{z as Fi}from"zod";var Lx=Fi.object({__codec:Fi.string().min(1),data:Fi.unknown(),version:Fi.number().int().positive()}),ji=class extends Error{codec;currentVersion;gotVersion;constructor(t){super(`Unsupported ${t.codec} version ${String(t.gotVersion)} (current ${String(t.currentVersion)}). Upgrade Ripplo or rebuild with a compatible CLI.`),this.name="CodecVersionError",this.codec=t.codec,this.currentVersion=t.currentVersion,this.gotVersion=t.gotVersion}},Vi=class extends Error{constructor(t){super(`Codec mismatch: expected "${t.expected}", got "${t.got}"`),this.name="CodecMismatchError"}};function Wa({name:e,schema:t}){return{currentVersion:1,name:e,decode:n=>Bx({name:e,raw:n,schema:t}),encode:n=>({__codec:e,data:n,version:1})}}function Dx(e,t){return JSON.stringify(e.encode(t))}function _x(e,t){let n=JSON.parse(t);return e.decode(n)}function Bx({name:e,raw:t,schema:n}){let r=Lx.parse(t);if(r.__codec!==e)throw new Vi({expected:e,got:r.__codec});if(r.version!==1)throw new ji({codec:e,currentVersion:1,gotVersion:r.version});return n.parse(r.data)}var Ui="__ripplo__",za="__ripplo_seed__",Ar="__ripplo_ready__";import{z as C}from"zod";var Of=C.discriminatedUnion("kind",[C.object({kind:C.literal("goto"),url:Mt}),C.object({kind:C.literal("fill"),locator:be,value:De}),C.object({kind:C.literal("clear"),locator:be}),C.object({kind:C.literal("click"),locator:be}),C.object({kind:C.literal("dblclick"),locator:be}),C.object({kind:C.literal("select"),locator:be,value:De}),C.object({kind:C.literal("check"),locator:be}),C.object({kind:C.literal("uncheck"),locator:be}),C.object({kind:C.literal("hover"),locator:be}),C.object({files:C.array(C.string().min(1)).min(1),kind:C.literal("upload"),locator:be}),C.object({key:C.string().min(1),kind:C.literal("press"),locator:be.optional()})]),Ga=C.object({action:Of,expect:C.array(Fn).default([])}),Ha=C.object({valueSpace:C.string().min(1)}),Wi=C.object({as:C.string().min(1),entity:C.string().min(1),set:C.record(C.string().min(1),De)}),Ka=C.object({entity:C.string().min(1),where:C.record(C.string().min(1),De)}),zi=C.object({absent:C.array(Ka).default([]),exclusive:C.array(C.string().min(1)).default([]),intent:C.string().min(1),name:C.string().min(1),params:C.record(C.string().min(1),Ha),singletons:C.record(C.string().min(1),De).default({}),slug:C.string().min(1),steps:C.array(Ga).default([]),workflow:C.string().min(1),world:C.array(Wi).default([])}),qa=C.object({absent:C.array(Ka).default([]),exclusive:C.array(C.string().min(1)).default([]),intent:C.string().min(1),maybe:C.array(Wi).default([]),name:C.string().min(1),params:C.record(C.string().min(1),Ha),singletons:C.record(C.string().min(1),De).default({}),sourcePath:C.string().min(1).optional(),steps:C.array(Ga).default([]),stub:C.boolean().default(!1),tests:C.array(zi).default([]),world:C.array(Wi).default([])}),Nf=C.object({sha256:C.string().regex(/^[0-9a-f]{64}$/u),size:C.number().int().nonnegative()}),$f=C.object({entities:C.array(Da),fixtures:C.record(C.string().min(1),Nf).default({}),singletons:C.array(_a).default([]),valueSpaces:C.array($a),workflows:C.array(qa)}),Fx=Wa({name:"ripplo-lockfile",schema:$f});function jx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Gi(e,t,n=""){let r=jx(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+l;throw r?new RangeError(u):new TypeError(u)}return e}function Ya(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Lf(e,t){Gi(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new RangeError('"digestInto() output" expected to be of length >='+n)}function Er(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Hi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function it(e,t){return e<<32-t|e>>>t}var Vx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Ux=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Df(e){if(Gi(e),Vx)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Ux[e[n]];return t}function _f(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Bf(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var Ff=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function jf(e,t,n){return e&t^~e&n}function Vf(e,t,n){return e&t^e&n^t&n}var Ki=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,i){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=Hi(this.buffer)}update(t){Ya(this),Gi(t);let{view:n,buffer:r,blockLen:i}=this,o=t.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let l=Hi(t);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Ya(this),Lf(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:i,isLE:o}=this,{pos:s}=this;n[s++]=128,Er(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;r.setBigUint64(i-8,BigInt(this.length*8),o),this.process(r,0);let a=Hi(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,c[d],o)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());let{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return t.destroyed=s,t.finished=o,t.length=i,t.pos=a,i%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}},Tt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Wx=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Jt=new Uint32Array(64),Za=class extends Ki{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[t,n,r,i,o,s,a,l]}set(t,n,r,i,o,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)Jt[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){let p=Jt[d-15],h=Jt[d-2],f=it(p,7)^it(p,18)^p>>>3,m=it(h,17)^it(h,19)^h>>>10;Jt[d]=m+Jt[d-7]+f+Jt[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let d=0;d<64;d++){let p=it(a,6)^it(a,11)^it(a,25),h=c+p+jf(a,l,u)+Wx[d]+Jt[d]|0,m=(it(r,2)^it(r,13)^it(r,22))+Vf(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){Er(Jt)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Er(this.buffer)}},Ja=class extends Za{A=Tt[0]|0;B=Tt[1]|0;C=Tt[2]|0;D=Tt[3]|0;E=Tt[4]|0;F=Tt[5]|0;G=Tt[6]|0;H=Tt[7]|0;constructor(){super(32)}};var Uf=Bf(()=>new Ja,Ff(1));var nl=Ia(Hf(),1),dD=nl.default.configure,Ir=nl.default;function rl(e){return Df(Uf(_f(Ir(e))))}function F(e){let t=Ir(e);if(t==null)throw new Error("structuralKey: value is not serializable");return t}import{z as Mr}from"zod";var Xx=Mr.object({index:Mr.number().int().nonnegative(),kind:Mr.string(),target:Mr.string(),value:Mr.string()});function Qx(e){let t=ev(e);return{preconditions:e.entities.map(n=>({depends:t.get(n.name)??[],description:n.description??"",name:n.name,returns:n.identity})),singletons:e.singletons.map(n=>({defaultValue:String(n.default),description:n.description??"",name:n.name,type:n.type})),workflows:e.workflows.map(n=>({expectedOutcome:n.intent,name:n.intent,preconditions:iv(ov(n),t),requiresKeys:n.world.map(r=>({namespace:r.as,preconditionName:r.entity})),slug:Yf(n.name),sourcePath:n.sourcePath??null,spec:n}))}}function qf(e,t){return{index:t,kind:e.action.kind,target:sv(e.action),value:av(e.action)}}function Yf(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,"-").split("-").filter(t=>t.length>0).join("-")}function ev(e){let t=e.workflows.reduce((n,r)=>tv(n,r),new Map);return new Map([...t].map(([n,r])=>[n,[...r]]))}function tv(e,t){let n=[...t.world,...t.maybe],r=new Map(n.map(i=>[i.as,i.entity]));return n.reduce((i,o)=>{let s=nv(o,r),a=i.get(o.entity)??new Set;return new Map([...i,[o.entity,new Set([...a,...s])]])},e)}function nv(e,t){return Object.values(e.set).flatMap(n=>rv(n)).map(n=>t.get(n)).filter(n=>n!=null&&n!==e.entity)}function rv(e){return e==null||typeof e!="object"?[]:"ref"in e?[Kf(e.ref)]:e.template.filter(t=>typeof t!="string").map(t=>Kf(t.ref))}function Kf(e){let[t]=e.split(".");return t??e}function iv(e,t){let n=(r,i)=>r.has(i)?r:(t.get(i)??[]).reduce((o,s)=>n(o,s),new Set([...r,i]));return[...e.reduce((r,i)=>n(r,i),new Set)]}function ov(e){return[...new Set(e.world.map(t=>t.entity))]}function sv(e){return e.kind==="goto"?qi(e.url):e.kind==="press"&&e.locator==null?"":Yi(e.locator)}function qi(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:e.template.map(t=>typeof t=="string"?t:`{${t.ref}}`).join("")}function Yi(e){return e.by==="testId"?`testId=${qi(e.value)}`:e.by==="inside"?`${Yi(e.scope)} \u25B8 ${Yi(e.target)}`:`${e.role} ${e.name==null?"":qi(e.name)}`.trim()}function av(e){return e.kind==="fill"||e.kind==="select"?lv(e.value):e.kind==="press"?e.key:""}function lv(e){return e==null?"":typeof e!="object"?String(e):qi(e)}import{z as Ce}from"zod";var Zf=Ce.enum(["Strict","Lax","None"]),Jf=Ce.object({domain:Ce.string().min(1),expires:Ce.number(),httpOnly:Ce.boolean(),name:Ce.string().min(1),path:Ce.string().min(1),sameSite:Zf,secure:Ce.boolean(),value:Ce.string()}),Xf=Ce.object({localStorage:Ce.array(Ce.object({name:Ce.string().min(1),value:Ce.string()})),origin:Ce.string().min(1)}),il=Ce.object({cookies:Ce.array(Jf),headers:Ce.record(Ce.string().min(1),Ce.string()).optional(),origins:Ce.array(Xf)});import{z as K}from"zod";var ol=K.union([It,K.null()]),sl=K.record(K.string().min(1),ol),Qf=K.object({as:K.string().min(1),entity:K.string().min(1),fields:K.record(K.string().min(1),De)}),cv=K.object({entities:K.array(Qf),runId:K.string().min(1),singletons:K.record(K.string().min(1),ol).default({})}),ep=K.object({as:K.string().min(1),row:sl,session:il.optional()}),al=K.object({rows:K.array(ep)}),dv=K.object({entities:K.array(K.string().min(1)),runId:K.string().min(1),singletons:K.array(K.string().min(1)).default([])}),ll=K.object({entities:K.record(K.string().min(1),K.array(sl)),singletons:K.record(K.string().min(1),ol).default({})}),fv=K.object({runId:K.string().min(1)}),ul=K.object({ok:K.literal(!0)});function Zi({actual:e,canon:t,pre:n,predicted:r}){return[...[...new Set([...r.entities.keys(),...e.entities.keys()])].flatMap(s=>yv({actual:e.entities.get(s),canon:t,entity:s,pre:n.entities.get(s),predicted:r.entities.get(s)})),...bv(n.singletons,r.singletons,e.singletons),...pv(n.browser,r.browser,e.browser)]}function pv(e,t,n){return hv(t,n).flatMap(({got:r,key:i,want:o})=>{if(o===void 0||r===void 0||o===r)return[];let s=mv(e,i);return[{mismatch:{key:i,kind:"browser-mismatch",snapshot:o,sut:r},pending:s!==void 0&&s===r}]})}function hv(e,t){let n=[...new Set([...Object.keys(e.query),...Object.keys(t.query)])];return[{got:t.path,key:{kind:"path"},want:e.path},{got:t.hash,key:{kind:"hash"},want:e.hash},{got:t.title,key:{kind:"title"},want:e.title},{got:t.viewport,key:{kind:"viewport"},want:e.viewport},...n.map(r=>({got:t.query[r],key:{key:r,kind:"query"},want:e.query[r]}))]}function mv(e,t){return t.kind==="query"?e.query[t.key]:e[t.kind]}function yv({actual:e,canon:t,entity:n,pre:r,predicted:i}){return[...new Set([...i?.keys()??[],...e?.keys()??[]])].flatMap(s=>gv({actual:e?.get(s),canon:t,entity:n,key:s,predicted:i?.get(s),preHadKey:r?.has(s)??!1,preRow:r?.get(s)}))}function gv({actual:e,canon:t,entity:n,key:r,predicted:i,preHadKey:o,preRow:s}){if(i==null)return[{mismatch:{entity:n,key:r,kind:"unexpected-row"},pending:o}];if(e==null)return[{mismatch:{entity:n,key:r,kind:"missing-row"},pending:!o}];let a=(u,c,d)=>cl(t(n,u,c),t(n,u,d));return[...new Set([...Object.keys(i),...Object.keys(e)])].filter(u=>!a(u,i[u],e[u])).map(u=>({mismatch:{entity:n,field:u,key:r,kind:"wrong-value",snapshot:i[u],sut:e[u]},pending:s==null?e[u]===void 0:a(u,s[u],e[u])}))}function cl(e,t){return tp(e)===tp(t)}function tp(e){return e==null?"\u2205":JSON.stringify(e)}function bv(e,t,n){return[...new Set([...Object.keys(t),...Object.keys(n)])].flatMap(i=>{let o=t[i],s=n[i];return o===void 0||s===void 0||cl(o,s)?[]:[{mismatch:{kind:"singleton-mismatch",singleton:i,snapshot:o,sut:s},pending:e[i]!==void 0&&cl(e[i],s)}]})}function Tr(e){let t=Sv(e.entities),n=wv(e.singletons);return r=>xv(r,t,n)}function Sv(e){return new Map(e.flatMap(t=>Object.entries(t.props).map(([n,r])=>[np(t.name,n),r.consistency])))}function np(e,t){return`${e}.${t}`}function wv(e){return new Map(e.map(t=>[t.name,t.consistency]))}function xv(e,t,n){return e.kind==="singleton-mismatch"?vv(e.singleton,n):e.kind==="browser-mismatch"?"eventual":e.kind==="unexpected-row"||e.kind==="missing-row"?"strict":t.get(np(e.entity,e.field))??"strict"}function vv(e,t){return kr.safeParse(e).success?t.get(e)??"eventual":t.get(e)??"strict"}function Or(e){let t=new Set(e.valueSpaces.filter(n=>n.generator==="date.iso").map(n=>n.name));return(n,r,i)=>{if(!t.has(`${n}.${r}`)||typeof i!="string")return i;let o=Date.parse(i);return Number.isNaN(o)?i:new Date(o).toISOString()}}function dl({onlyFirst:e=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,e?void 0:"g")}var Rv=dl();function fl(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Rv,"")}function pl(e,t,n){return{detail:n.slice(0,500),kind:"engine-http",path:e,status:t}}function jn(e,t){return{code:up(t),kind:"engine-network",message:Nr(t),path:e}}function Ji(e){return{kind:"client-mount-missing",mountKey:e}}function hl(e,t){return{kind:"app-not-ready",readyKey:e,timeoutMs:t}}function ml(e,t){return{kind:"engine-decode",message:Nr(t),path:e}}function yl(e,t){return{entity:e,field:t,kind:"state-identity"}}function ip(e){return{as:e,kind:"setup-missing-row"}}function op(e){return{count:e,kind:"conflicting-sessions"}}function Ot(e){return{kind:"driver-launch",message:Nr(e)}}function gl(e){return{kind:"engine-unreachable",url:e}}function bl(e,t){return{action:e,kind:"action-failed",message:Nr(t)}}function Sl(e){return{kind:"check-failed",message:Nr(e)}}function wl(){return{kind:"aborted"}}var Cv=["app-not-ready","client-mount-missing","driver-launch","engine-decode","engine-http","engine-network","engine-unreachable"],sp=new Set(Cv);function Xi(e){return sp.has(e.kind)}function ap(e){return sp.has(e)}var rp=300;function xt(e){switch(e.kind){case"engine-http":return`engine ${e.path} returned ${String(e.status)}: ${lp(e.detail)}${kv(e.status)}`;case"engine-network":return`engine ${e.path} request failed: ${e.message}`;case"client-mount-missing":return`this test reads client-side state, but the app never mounted the client engine ("${e.mountKey}"). Call mountClientEngine() where your app boots.`;case"app-not-ready":return`the app never called ready() within ${String(e.timeoutMs)}ms of loading the page. Call ready() from @ripplo/testing once your app is interactive \u2014 see setup.`;case"engine-decode":return`engine ${e.path} response did not match schema: ${e.message}`;case"state-identity":return`row of "${e.entity}" is missing identity field "${e.field}"`;case"setup-missing-row":return`setup returned no row for "${e.as}"`;case"conflicting-sessions":return`world established ${String(e.count)} distinct auth sessions in one browser context; sessions are exclusive \u2014 a single context holds one signed-in user`;case"engine-unreachable":return`the engine at ${e.url} did not respond in time \u2014 the dev server may still be recompiling. Re-run once it settles.`;case"driver-launch":return`browser driver failed to launch: ${e.message}`;case"action-failed":return`action "${e.action}" failed: ${e.message}`;case"check-failed":return`check failed: ${e.message}`;case"aborted":return"run aborted"}}function xl(e){throw new Error(xt(e))}function ot(){}function lp(e){let t=e.replaceAll(/\s+/gu," ").trim();return t.length<=rp?t:`${t.slice(0,rp)}\u2026 [truncated]`}function kv(e){return e===404?" \u2014 the engine adapter is not mounted at RIPPLO_ENGINE_URL (or the mount path differs). Verify the adapter is wired into the app server and ENABLE_RIPPLO_TESTING=true; `ripplo doctor` checks the endpoint.":e===403||e===401?" \u2014 the adapter rejected the request: ENABLE_RIPPLO_TESTING is not true in the app's env, or RIPPLO_WEBHOOK_SECRET differs between the app and .ripplo env.":""}function up(e){if(!(typeof e!="object"||e==null))return"code"in e&&typeof e.code=="string"?e.code:"cause"in e?up(e.cause):void 0}function Nr(e){let t=e instanceof Error?e.message:String(e);return lp(fl(t))}function cp(e){return F(e)}var st=class extends Error{name="AbortError";constructor(){super("aborted")}};function $r(e){return e instanceof Error&&e.name==="AbortError"}function Xe(e){if(e.aborted)throw new st}function bn(e,t){return t.aborted?Promise.reject(new st):new Promise((n,r)=>{let i=()=>{clearTimeout(o),r(new st)},o=setTimeout(()=>{t.removeEventListener("abort",i),n()},e);t.addEventListener("abort",i,{once:!0})})}import{z as Av}from"zod";var Rl=Av.string().brand(),Z=Rl.parse("");function vt(e){return Rl.parse(e)}function ze(e,t){return Rl.parse(e.length===0?t:`${e}.${t}`)}function ae(e){return Bn.safeParse(e).success}function Sn(e){let t=e.lastIndexOf(".");return t===-1?void 0:{alias:e.slice(0,t),field:e.slice(t+1)}}function Ge(e){return typeof e=="object"&&e!==null&&"template"in e}function vl(e,t,n){let r=ze(t,e.ref);if(!n.has(r))throw new Error(`unresolved binding ref "${r}"`);return n.get(r)??null}function Cl(e,t,n){return Ev(e).every(r=>n.has(ze(t,r)))}function at(e,t,n){return typeof e=="string"?e:ae(e)?String(vl(e,t,n)):e.template.map(r=>typeof r=="string"?r:String(vl(r,t,n))).join("")}function He(e,t,n){return e===null||typeof e=="number"||typeof e=="boolean"?e:ae(e)?vl(e,t,n):at(e,t,n)}function dp(e,t){return He(e,Z,t)}function Lr(e){return Ir(e)}function Vn(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,He(i,t,n)]))}function Ev(e){return e==null||typeof e!="object"?[]:Ge(e)?e.template.flatMap(t=>typeof t=="string"?[]:[t.ref]):[e.ref]}var Pv="https://ripplo.invalid",wn={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0},Ke={hash:void 0,path:void 0,query:{},title:void 0,viewport:void 0};function pp(e){return e.kind!=="title"&&e.kind!=="viewport"}function Ve(e){return e.kind==="query"?`url query "${e.key}"`:e.kind==="title"||e.kind==="viewport"?e.kind:`url ${e.kind}`}function $t(e,t){return e==="title"?{kind:"title"}:e==="viewport"?{kind:"viewport"}:t===void 0||t.kind==="path"?{kind:"path"}:t.kind==="hash"?{kind:"hash"}:{key:t.key,kind:"query"}}function Nt(e){let t=new URL(e,Pv),n=Object.fromEntries(t.searchParams.entries());return{hash:t.hash.length>0?t.hash.slice(1):void 0,path:t.pathname,query:n,title:void 0,viewport:void 0}}function Dr(e){if(typeof e=="string")return fp(Nt(e));let t=ae(e)?[e]:e.template,n=t.findIndex(u=>typeof u=="string"&&/[?#]/.test(u)),r=t[n];if(n===-1||typeof r!="string")return{...Ke,path:e};let i=[...t.slice(0,n),r.slice(0,r.search(/[?#]/))],o=t.slice(n),s={template:i};if(o.some(u=>typeof u!="string"))return{...Ke,path:s};let a=o.filter(u=>typeof u=="string").join(""),l=Nt(`/p${a.slice(a.search(/[?#]/))}`);return{...fp(l),path:s}}function Qi(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function eo(e,t,n){return t.kind==="query"?{...e,query:{...e.query,[t.key]:n}}:{...e,[t.kind]:n}}function hp(e,t){if(t.kind==="query"){let n=Object.fromEntries(Object.entries(e.query).filter(([r])=>r!==t.key));return{...e,query:n}}return{...e,[t.kind]:void 0}}function Un(e,t){return t.kind==="query"?e.query[t.key]??void 0:e[t.kind]}function xn(e){let n=[[{kind:"path"},e.path],[{kind:"hash"},e.hash],[{kind:"title"},e.title],[{kind:"viewport"},e.viewport]].flatMap(([i,o])=>o===void 0?[]:[{clause:o,key:i}]),r=Object.entries(e.query).map(([i,o])=>({clause:o,key:{key:i,kind:"query"}}));return[...n,...r]}function to(e,t){return mp(e,t)}function Qt(e,t){return mp(e,t)}function mp(e,t){return{hash:t.hash??e.hash,path:t.path??e.path,query:{...e.query,...t.query},title:t.title??e.title,viewport:t.viewport??e.viewport}}function fp(e){return{hash:e.hash,path:e.path,query:e.query,title:e.title,viewport:e.viewport}}var Iv={check:"Check",clear:"Clear",click:"Click",dblclick:"Double-click",fill:"Fill",goto:"Go to",hover:"Hover",press:"Press",select:"Select",uncheck:"Uncheck",upload:"Upload"};function yp(e){let t=Iv[e.kind]??e.kind;return e.kind==="press"&&e.key!=null?`${t}: ${e.key}`:t}function gp(e){return e.kind==="data-rule"?"data rule":bp(e.check)}function bp(e){return e.kind==="not"?`not ${bp(e.inner)}`:e.kind==="browser"?Ve(e.key):`${Sp(e.locator)} ${e.kind}`}function Sp(e){return e.by==="testId"?"element":e.by==="inside"?Sp(e.target):e.role}function wp(e){return e.kind==="goto"?e.url:e.kind==="press"?e.key:e.value==null?void 0:String(e.value)}function xp(e){return e.kind==="data-rule"?void 0:Rp(e.check)}function vp(e){return e.kind==="data-rule"?!1:Cp(e.check)}function Rp(e){if(e.kind==="not")return Rp(e.inner);if(e.kind==="value"||e.kind==="text"||e.kind==="browser")return e.value??void 0}function Cp(e){return e.kind==="not"?Cp(e.inner):e.kind==="browser"&&pp(e.key)}function Ip(e){return e.includes("async")?"async":e.includes("slow")?"slow":"fast"}var Mv=()=>[];async function ro({canon:e,classify:t,initialSnapshot:n,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s,steps:a,stopAfterStep:l},u){return Mp({acc:[],canon:e,classify:t,index:0,observe:r,onAssertion:i,onStep:o,pageRulePendingChecks:s??Mv,signal:u,snapshot:n,steps:a,stopAfterStep:l})}async function Mp({acc:e,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,signal:l,snapshot:u,steps:c,stopAfterStep:d}){Xe(l);let p=c[r];if(p==null)return{finalModel:u,findings:e};let h=Date.now(),f=await p.targetIds(),m=yp(p.step.action);if(!p.requiredState(u)){let y={kind:"impossible-action",step:p.step};return Al(s,{annotations:[kl({action:p.step.action,actionLabel:m,outcome:"failed",rrwebIds:f,startMs:h})],endMs:Date.now(),findings:[y],index:r,post:u,pre:u,source:p.source,startMs:h,url:El(u)}),{finalModel:u,findings:[...e,y]}}return p.perform().match(()=>Tv({acc:e,actionLabel:m,canon:t,classify:n,index:r,observe:i,onAssertion:o,onStep:s,pageRulePendingChecks:a,rrwebIds:f,signal:l,snapshot:u,startMs:h,step:p,steps:c,stopAfterStep:d}),y=>{let S=no(y,p);return Al(s,{annotations:[kl({action:p.step.action,actionLabel:m,outcome:"failed",rrwebIds:f,startMs:h})],endMs:Date.now(),findings:[S],index:r,post:u,pre:u,source:p.source,startMs:h,url:El(u)}),Promise.resolve({finalModel:u,findings:[...e,S]})})}function kl({action:e,actionLabel:t,outcome:n,rrwebIds:r,startMs:i}){return{atMs:i,kind:"action",label:t,outcome:n,rrwebIds:r,url:!1,value:wp(e)}}async function Tv({acc:e,actionLabel:t,canon:n,classify:r,index:i,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,rrwebIds:u,signal:c,snapshot:d,startMs:p,step:h,steps:f,stopAfterStep:m}){let y=h.effect(d),S=await Bv({canon:n,classify:r,observe:o,pre:d,predicted:y,signal:c,step:h}),w=[...h.pendingChecks,...l(d,S.snapshot)],b=await Ov({onAssertion:s,pendingChecks:w,signal:c,step:h}),v=[...b.findings,...S.findings];Al(a,{annotations:[kl({action:h.step.action,actionLabel:t,outcome:v.length>0?"failed":"passed",rrwebIds:u,startMs:p}),...b.annotations],endMs:Date.now(),findings:v,index:i,post:S.snapshot,pre:d,source:h.source,startMs:p,url:El(S.snapshot)});let T=[...e,...v];return v.length>0?{finalModel:S.snapshot,findings:T}:m!=null&&i+1>=m?{finalModel:S.snapshot,findings:T}:Mp({acc:T,canon:n,classify:r,index:i+1,observe:o,onAssertion:s,onStep:a,pageRulePendingChecks:l,signal:c,snapshot:S.snapshot,steps:f,stopAfterStep:m})}async function Ov({onAssertion:e,pendingChecks:t,signal:n,step:r}){let i=[...new Map(t.map(s=>[cp(s.source),s])).values()],o=await Promise.all(i.map(async s=>{let a=await Nv(s,n),l=Date.now(),u=await s.targetIds();return{atMs:l,outcome:a,pendingCheck:s,rrwebIds:u}}));return o.forEach(s=>{$v(e,s.pendingCheck,s.outcome,r)}),{annotations:o.filter(s=>s.pendingCheck.source.kind==="step").map(s=>({atMs:s.atMs,kind:"assertion",label:gp(s.pendingCheck.source),outcome:Tp(s.outcome),rrwebIds:s.rrwebIds,url:vp(s.pendingCheck.source),value:xp(s.pendingCheck.source)})),findings:o.flatMap(s=>Lv(s.pendingCheck,s.outcome,r))}}function Nv(e,t){if(e.check.kind==="decided"){let n=e.check.passed?"passed":"failed";return Promise.resolve({kind:n})}return e.check.wait(Op[e.budget].timeoutMs).match(n=>n?{kind:"passed"}:{kind:"failed"},n=>{if(n.kind==="aborted")throw new st;return{error:n,kind:"error"}})}function $v(e,t,n,r){e?.({outcome:Tp(n),source:t.source,step:r.step,waitBudget:t.budget,waitMs:Lt[t.budget]})}function Tp(e){return e.kind==="passed"?"passed":e.kind==="error"?"error":"failed"}function Lv(e,t,n){return t.kind==="error"?[no(t.error,n)]:t.kind==="failed"?[{budget:e.budget,kind:"pending-check",source:e.source,step:n.step}]:[]}function no(e,t){return{error:e,kind:"driver-error",step:t.step}}function Al(e,t){e?.(t)}function El(e){let t=e.browser.path;return typeof t=="string"?t:null}var Lt={async:12e4,fast:5e3,slow:3e4},Op={async:{backoffMs:[500,1e3,2e3,5e3],timeoutMs:Lt.async},fast:{backoffMs:[100,250,500,1e3],timeoutMs:Lt.fast},slow:{backoffMs:[250,500,1e3,2e3],timeoutMs:Lt.slow}};function Dv(e,t){return e.backoffMs[Math.min(t,e.backoffMs.length-1)]??0}function kp(e){return e().match(t=>({observed:t,ok:!0}),t=>({error:t,ok:!1}))}function _v(e,t,n){return n.reconcile==null?e:n.reconcile(e,t)}function Ap({canon:e,pre:t,predicted:n,step:r},i){let o=r.verifyChanges==null?[]:r.verifyChanges(n,i),s=_v(n,i,r),a=o.map(l=>({mismatch:l,pending:!0}));return{adopted:s,probed:[...a,...Zi({actual:i.snapshot,canon:e,pre:t,predicted:s})]}}function Np(e,t){return{budget:t.sync,kind:"consistency",mismatch:e.mismatch,pending:e.pending,step:t.step}}function Ep(e,t,n){let r=e.probed.filter(i=>!i.pending&&n(i.mismatch)==="strict");return r.length>0?{findings:r.map(i=>Np(i,t)),snapshot:e.adopted}:e.probed.length===0?{findings:[],snapshot:e.adopted}:null}function Pp(e,t,n){return{findings:[...e.probed.map(r=>Np(r,t)),...n],snapshot:e.adopted}}async function Bv({canon:e,classify:t,observe:n,pre:r,predicted:i,signal:o,step:s}){let a=Op[s.sync],l=Date.now()+a.timeoutMs,u=await kp(n);if(!u.ok)return{findings:[no(u.error,s)],snapshot:i};let c=Ap({canon:e,pre:r,predicted:i,step:s},u.observed),d=0;for(;Date.now()<l;){Xe(o);let p=Ep(c,s,t);if(p!=null)return p;await bn(Dv(a,d),o),d+=1;let h=await kp(n);if(!h.ok)return Pp(c,s,[no(h.error,s)]);c=Ap({canon:e,pre:r,predicted:i,step:s},h.observed)}return Ep(c,s,t)??Pp(c,s,[])}function io(e){return e.action.kind==="goto"?!0:$p(e.expect).some(t=>t.kind==="browser"&&t.name==="url"&&t.value!==null)}function $p(e){return e.flatMap(t=>t.kind==="and"?$p(t.predicates):[t])}function Lp(e){return _r(e.expect).some(t=>t.assertion.kind==="deleted")}var Dp=new Set(["created","updated","deleted"]);function _p(e){return _r(e.expect).some(t=>Dp.has(t.assertion.kind))}function Bp(e){return new Set(_r(e.expect).flatMap(t=>Dp.has(t.assertion.kind)?[t.entity]:[]))}function en(e){return typeof e=="object"&&e!==null&&"kind"in e}function vn(e){return Object.fromEntries(Object.entries(e).filter(t=>!en(t[1])))}function Br(e,t,n){return t.reduce((r,i)=>Fv(r,i,n,e),e)}function Fp(e,t){return Object.keys(t).length===0?e:{...e,singletons:{...e.singletons,...t}}}function jp(e,t){return{...e,browser:to(e.browser,t)}}function Vp(e,t){return{...e,browser:t.reduce((n,r)=>hp(n,r),e.browser)}}function _r(e){return e.flatMap(t=>t.kind==="state"?[t]:t.kind==="and"?_r(t.predicates):t.kind==="when"?_r(t.branches.flatMap(n=>n.consequence)):[])}function Fv(e,t,n,r){if(!jv(t,n))return e;if(t.assertion.kind==="created"){let o=Vn(t.assertion.props,Z,n);return Vv(e,t.entity,Lr(o),o)}if(t.assertion.kind==="deleted")return Pl(e,t.entity,Gv(t.key,n,r));let i=Vn(vn(t.assertion.props),Z,n);return Pl(e,t.entity,Hv(t.key,i,n,r))}function jv(e,t){return("props"in e.assertion?[e.key,vn(e.assertion.props)]:[e.key]).every(r=>Object.values(r).every(i=>zp(i)||!ae(i)||t.has(vt(i.ref))))}function Vv(e,t,n,r){let i=new Map([...e.entities.get(t)??[],[n,r]]);return{...e,entities:new Map([...e.entities,[t,i]])}}function Pl(e,t,n){let r=n(e.entities.get(t)??new Map);return{...e,entities:new Map([...e.entities,[t,r]])}}function Rn(e,t,n,r){let i={env:r,key:n,snapshot:e};return[...(e.entities.get(t)??new Map).values()].filter(o=>so(o,i))}function Up(e,t,n,r,i){let o={env:r,key:n,snapshot:e};return Pl(e,t,s=>new Map([...s].map(([a,l])=>[a,so(l,o)?i(l):l])))}function so(e,t){return Object.entries(t.key).every(([n,r])=>Wp(e[n],r,t))}function Wp(e,t,n){return zp(t)?Uv(t,n).has(oo(e)):oo(e)===oo(zv(t,n.env))}function zp(e){return typeof e=="object"&&e!==null&&"kind"in e}function Uv(e,t){let n=t.snapshot.entities.get(e.selection.entity);return n==null?new Set:new Set([...n.values()].filter(r=>Wv(r,e.selection.where,t)).map(r=>oo(r[e.field])))}function Wv(e,t,n){return Object.entries(t).every(([r,i])=>Wp(e[r],i,n))}function oo(e){return e==null?"\u2205":e instanceof Date?e.toISOString():JSON.stringify(e)}function zv(e,t){return He(e,Z,t)}function Gv(e,t,n){let r={env:t,key:e,snapshot:n};return i=>new Map([...i].filter(([,o])=>!so(o,r)))}function Hv(e,t,n,r){let i={env:n,key:e,snapshot:r};return o=>new Map([...o].map(([s,a])=>so(a,i)?[s,{...a,...t}]:[s,a]))}function Il(e){let t=e.predicates.filter(o=>Yp(o)),n=t.filter(o=>o.assertion.kind==="created"),r=qp(t);if(n.length===0&&r.length===0&&e.deferred.length===0&&e.adopt.length===0)return;let i=t.filter(o=>o.assertion.kind==="updated");return(o,s)=>{let a=n.reduce((c,d)=>Qv(c,s,d,e.env),{env:e.env,snapshot:o}),l=r.reduce((c,d)=>Xv(c,s,d,e.env),a.snapshot),u=i.reduce((c,d)=>qv(c,s,d),a.env);return Kv(nR(l,e.deferred,u),s,e.adopt)}}function Kv(e,t,n){if(n.length===0)return e;let r=n.reduce((i,o)=>{let s=t.snapshot.singletons[o];return s===void 0?i:{...i,[o]:s}},e.singletons);return{...e,singletons:r}}function Kp(e,t,n){return new Map([...e,...Object.entries(n).map(([r,i])=>[ze(Z,`${t}.${r}`),i])])}function qv(e,t,n){let r=Rn(t.snapshot,n.entity,n.key,e).at(0);return r==null?e:Kp(e,n.assertion.as,r)}function Ml(e){let t=qp(e.predicates.filter(n=>Yp(n)));if(t.length!==0)return(n,r)=>t.flatMap(i=>Yv(i,n,r,e.env))}function qp(e){return e.filter(t=>t.assertion.kind==="updated"&&Tl(t.assertion.props).length>0)}function Tl(e){return Object.entries(e).filter(([,t])=>en(t)).map(([t])=>t)}function Yp(e){return e.assertion.kind==="created"||e.assertion.kind==="updated"}function Yv(e,t,n,r){let i=Rn(t,e.entity,e.key,r).at(0),o=Rn(n.snapshot,e.entity,e.key,r).at(0);if(i==null||o==null)return[];let s=Lr(Zv(e.key,r));return Tl(e.assertion.props).flatMap(a=>Gp(i[a])===Gp(o[a])?[{entity:e.entity,field:a,key:s,kind:"expected-change",value:o[a]}]:[])}function Zv(e,t){let n=Object.fromEntries(Object.entries(e).filter(r=>!Jv(r[1])));return Vn(n,Z,t)}function Jv(e){return typeof e=="object"&&e!==null&&"kind"in e}function Gp(e){return e==null?"\u2205":JSON.stringify(e)}function Xv(e,t,n,r){let i=Tl(n.assertion.props),o=Rn(t.snapshot,n.entity,n.key,r).at(0);return o==null?e:Up(e,n.entity,n.key,r,s=>({...s,...Object.fromEntries(i.flatMap(a=>{let l=o[a];return l===void 0?[]:[[a,l]]}))}))}function Qv(e,t,n,r){if(n.assertion.kind!=="created")return e;let i=Vn(n.assertion.props,Z,r),o=Lr(i),s=e.snapshot.entities.get(n.entity);if(s==null||!s.has(o))return e;let a=eR(t.snapshot.entities.get(n.entity),s,i);if(a==null)return e;let[l,u]=a,c=new Map(s);return c.delete(o),c.set(l,{...u,...i}),{env:Kp(e.env,n.assertion.as,u),snapshot:{...e.snapshot,entities:new Map(e.snapshot.entities).set(n.entity,c)}}}function eR(e,t,n){if(e==null)return;let r=Object.entries(n),i=[...e].filter(([o])=>!t.has(o)).map(([o,s])=>({entry:[o,s],score:r.filter(([a,l])=>Hp(s[a])===Hp(l)).length}));return tR(i,r.length)}function Hp(e){return e==null?"\u2205":JSON.stringify(e)}function tR(e,t){let n=e.reduce((i,o)=>Math.max(i,o.score),0);if(n===0)return;let r=e.filter(i=>i.score===n);if(!(n<t&&r.length!==1))return r[0]?.entry}function nR(e,t,n){let r=t.reduce((i,o)=>{let s=rR(o.value,n);return s==null||typeof s!="string"?i:eo(i,o.key,s)},e.browser);return{...e,browser:r}}function rR(e,t){try{return at(e,Z,t)}catch{return}}function ao(e,t){if(e.kind==="visible"||e.kind==="unobstructed"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked")return{kind:e.kind,locator:Fr(e.locator,t)};if(e.kind==="not"){let n=ao(e.predicate,t);return n==null?null:{inner:n,kind:"not"}}return e.kind==="value"||e.kind==="text"?{kind:e.kind,locator:Fr(e.locator,t),value:at(e.value,Z,t)}:e.kind!=="browser"?null:{key:$t(e.name,e.part),kind:"browser",value:e.value===null?null:at(e.value,Z,t)}}function Wn(e,t){let n=e.expect.filter(u=>u.kind==="state"),r=aR(n),{browser:i,clears:o,deferred:s,singletons:a}=iR(e,t,r),l=io(e);return{action:lR(e.action,t),label:e.action.kind,pendingChecks:e.expect.flatMap(u=>cR(u,t,l)),reconcile:Il({adopt:[],deferred:s,env:t,predicates:n}),verifyChanges:Ml({adopt:[],deferred:s,env:t,predicates:n}),effect:u=>Vp(jp(Fp(Br(u,n,t),a),i),o)}}function Fr(e,t){return e.by==="role"?{by:"role",name:e.name==null?void 0:at(e.name,Z,t),role:e.role}:e.by==="inside"?{by:"inside",scope:Fr(e.scope,t),target:Fr(e.target,t)}:{by:"testId",value:at(e.value,Z,t)}}function Zp(e){return e.flatMap(t=>t.kind==="and"?Zp(t.predicates):[t])}function iR(e,t,n){let r=e.action.kind==="goto"?Nt(at(e.action.url,Z,t)):wn;return Zp(e.expect).reduce((i,o)=>{if(o.kind==="browser"&&o.value===null){let s=$t(o.name,o.part);return{...i,clears:[...i.clears,s]}}if(o.kind==="browser"&&o.value!==null&&oR(o.value,n)){let s=$t(o.name,o.part);return{...i,deferred:[...i.deferred,{key:s,value:o.value}]}}if(o.kind==="browser"&&o.value!==null){let s=$t(o.name,o.part),a=at(o.value,Z,t);return{...i,browser:eo(i.browser,s,a)}}if(o.kind==="singleton"){let s=He(o.assertion.value,Z,t);return{...i,singletons:{...i.singletons,[o.singleton]:s}}}return i},{browser:r,clears:[],deferred:[],singletons:{}})}function oR(e,t){return sR(e).some(n=>t.has(n.split(".")[0]??n))}function sR(e){return typeof e=="string"?[]:ae(e)?[e.ref]:e.template.filter(t=>typeof t!="string").map(t=>t.ref)}function aR(e){return new Set(e.flatMap(t=>t.assertion.kind==="created"||t.assertion.kind==="updated"?[t.assertion.as]:[]))}function lR(e,t){return{files:e.kind==="upload"?e.files:void 0,key:e.kind==="press"?e.key:void 0,kind:e.kind,locator:uR(e,t),url:e.kind==="goto"?at(e.url,Z,t):void 0,value:"value"in e?dp(e.value,t):void 0}}function uR(e,t){if(!(!("locator"in e)||e.locator==null))return Fr(e.locator,t)}function cR(e,t,n){if(e.kind==="browser"||e.kind==="singleton")return[];let r=ao(e,t),i=n?"slow":"fast",o="wait"in e?e.wait??i:i;return r==null?[]:[{budget:o,check:r}]}import{err as Jp,ok as Nl,okAsync as dR,Result as fR}from"neverthrow";function zn(e,t,n){let r=SR(e),i={env:new Map,generate:n.generate,generatedParams:new Set,indexed:r,overrides:new Map(Object.entries(n.params??{}).map(([s,a])=>[vt(s),a]))};wR(t.params,Z,i);let o=t.world.map(s=>xR(s,Z,i));return n.materialize(o).andThen(s=>kR(s,i.env,r).map(a=>pR({base:a,generatedParams:i.generatedParams,lockfile:e,test:t})))}function lo(e,t){let n=new Map(t.map(r=>[r.name,r]));return r=>dR(yR(r,e,n).rows)}function uo(e){return t=>{let n=t.map(r=>({as:r.as,entity:r.entity,fields:r.fields}));return e(n).andThen(r=>mR(t,r))}}function $l(e,t){let n=jr(t);return Object.fromEntries(Object.entries(e).filter(([r,i])=>n.includes(r)&&i!=null))}function jr(e){return Object.keys(e.props)}function pR({base:e,generatedParams:t,lockfile:n,test:r}){let i=Object.fromEntries(n.singletons.map(c=>[c.name,c.default])),o=Object.fromEntries(Object.entries(r.singletons).map(([c,d])=>[c,He(d,Z,e.env)])),s=Object.entries(r.singletons).filter(([,c])=>hR(c,t)).map(([c])=>c),a={...i,...o},l=new Set(n.singletons.filter(c=>c.source==="client").map(c=>c.name)),u=Object.fromEntries(Object.entries(a).filter(([c])=>l.has(c)));return{...e,clientState:u,generatedSingletons:s,snapshot:{...e.snapshot,singletons:a}}}function hR(e,t){return ae(e)?t.has(ze(Z,e.ref)):Ge(e)?e.template.some(n=>typeof n!="string"&&t.has(ze(Z,n.ref))):!1}function mR(e,t){let n=new Map(t.map(r=>[r.as,r]));return fR.combine(e.map(r=>{let i=n.get(r.as);return i==null?Jp(ip(r.as)):Nl({as:r.as,entity:r.entity,generatedFields:r.generatedFields,row:i.row,session:i.session})}))}function yR(e,t,n){return e.reduce((r,i)=>{let o=gR(i.fields,r.env),s=ER({generate:t,model:i.model,seedPrefix:i.seedPrefix,set:o,valueSpaces:n}),a=Object.entries(s).map(([u,c])=>[`${i.as}.${u}`,c]),l=Object.keys(s).filter(u=>!(u in o));return{env:new Map([...r.env,...a]),rows:[...r.rows,{as:i.as,entity:i.entity,generatedFields:[...new Set([...i.generatedFields,...l])],row:s,session:void 0}]}},{env:new Map,rows:[]})}function gR(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>{if(ae(r))return[n,bR(t,r.ref)];if(Ge(r))throw new Error(`template value not allowed in entity field "${n}"`);return[n,r]}))}function bR(e,t){let n=e.get(t);if(n==null)throw new Error(`setup ref "${t}" was not produced by an earlier entity`);return n}function SR(e){return{models:new Map(e.entities.map(t=>[t.name,t])),valueSpaces:new Map(e.valueSpaces.map(t=>[t.name,t]))}}function wR(e,t,n){Object.entries(e).forEach(([r,i])=>{let o=ze(t,r),s=n.indexed.valueSpaces.get(i.valueSpace);if(s==null)throw new Error(`unknown valueSpace "${i.valueSpace}" for param "${o}"`);let a=n.overrides.get(o);a==null&&n.generatedParams.add(o);let l=a??n.generate.value({anchor:void 0,constraints:s.constraints,generator:s.generator,nullable:!1,seed:o,type:s.type,values:s.values,valueSpace:i.valueSpace});n.env.set(o,l)})}function xR(e,t,n){let r=n.indexed.models.get(e.entity);if(r==null)throw new Error(`model "${e.entity}" not found for setup "${e.as}"`);let i=ze(t,e.as),o=vR(e.set,t,n.env),s=CR(r,o,i,n),a=Object.entries(e.set).filter(([,l])=>ae(l)&&n.generatedParams.has(ze(t,l.ref))).map(([l])=>l);return{as:i,entity:e.entity,fields:{...s,...o},generatedFields:[...Object.keys(s),...a],model:r,seedPrefix:i}}function vR(e,t,n){return Object.fromEntries(Object.entries(e).map(([r,i])=>[r,RR(i,t,n)]))}function RR(e,t,n){if(!ae(e))return e;let r=ze(t,e.ref);return n.get(r)??{ref:r}}function CR(e,t,n,r){return Object.fromEntries(Object.entries(e.props).filter(([i,o])=>!o.optional&&!e.identity.includes(i)&&!(i in t)).map(([i,o])=>[i,Xp({field:i,generate:r.generate,model:e,seedPrefix:n,spec:o,valueSpaces:r.indexed.valueSpaces})]))}function kR(e,t,n){let r=new Map,i=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)throw new Error(`model "${a.entity}" not found for setup "${a.as}"`);Object.entries(a.row).forEach(([c,d])=>t.set(ze(vt(a.as),c),d));let u=r.get(a.entity)??new Map;return u.set(Ol(a.row,l),$l(a.row,l)),r.set(a.entity,u),a.session==null?[]:[a.session]}),o=e.flatMap(a=>{let l=n.models.get(a.entity);return l==null?[]:[{alias:a.as,entity:a.entity,key:Ol(a.row,l)}]}),s=e.flatMap(a=>{let l=n.models.get(a.entity);if(l==null)return[];let u=Ol(a.row,l);return a.generatedFields.map(c=>({entity:a.entity,field:c,key:u}))});return AR(i).map(a=>({aliases:o,auth:a,env:t,generated:s,snapshot:{browser:wn,entities:PR(r),singletons:{}}}))}function AR(e){if(e.length===0)return Nl(void 0);let t=new Set(e.map(r=>JSON.stringify(r.cookies))).size;if(t>1)return Jp(op(t));let n=e.flatMap(r=>Object.entries(r.headers??{}));return Nl({cookies:e.flatMap(r=>r.cookies),headers:n.length===0?void 0:Object.fromEntries(n),origins:e.flatMap(r=>r.origins)})}function ER({generate:e,model:t,seedPrefix:n,set:r,valueSpaces:i}){return{...Object.fromEntries(Object.entries(t.props).filter(([s])=>!(s in r)).map(([s,a])=>[s,Xp({field:s,generate:e,model:t,seedPrefix:n,spec:a,valueSpaces:i})])),...r}}function Xp({field:e,generate:t,model:n,seedPrefix:r,spec:i,valueSpaces:o}){let s=`${n.name}.${e}`;return t.value({anchor:void 0,constraints:o.get(s)?.constraints,generator:o.get(s)?.generator??"lorem.word",nullable:i.optional,seed:ze(r,e),type:i.type,values:o.get(s)?.values,valueSpace:s})}function Ol(e,t){return t.identity.map(n=>String(e[n])).join(":")}function PR(e){return new Map([...e].map(([t,n])=>[t,new Map(n)]))}function Dt(e,t){return[...new Map(e.map(n=>[t(n),n])).values()]}function Qp(e){return Dt(e,F)}function Qe(e){return`${e.workflow}/${e.slug}`}function Rt(e){return e.workflows.flatMap(t=>t.tests.map(n=>({ref:Qe(n),test:n,workflow:t})))}function Ct(e){return`${e.test}#${String(e.index)}`}function kn(e){let t=Rt(e).flatMap(n=>Vr(e,n.test));return Dt(t,n=>`${n.test}:${F(n.steps)}`)}function Vr(e,t){let n=nh(t),r=eh(n,t.singletons),i=eC(t,QR(e)),o=IR(e,t);return MR(r,tC(t.steps),n).reduce((a,{chunk:l,requiredState:u},c)=>({offset:a.offset+l.length,transitions:[...a.transitions,ZR({chunk:l,index:c,intent:t.intent,namespace:n.namespace,paramSpaceOf:i,requiredState:u,testRef:Qe(t),whenChunk:o.slice(a.offset,a.offset+l.length)})]}),{offset:0,transitions:[]}).transitions}function eh(e,t){return{absences:KR(e),browser:Ke,entities:YR(e),exclusives:e.exclusives,singletons:Object.fromEntries(Object.entries(t).filter(([,n])=>!ae(n)&&!Ge(n)))}}function IR(e,t){let n=e.workflows.find(r=>r.name===t.workflow);return n==null||n.steps.length!==t.steps.length?t.steps:n.steps}function co(e,t,n){return Object.values(e).flatMap(r=>ae(r)?_l(r.ref,n):[]).find(r=>r.entity===t)?.aliasPath}function MR(e,t,n){return t.reduce((r,i)=>({requiredState:TR(r.requiredState,i,n),withRequiredState:[...r.withRequiredState,{chunk:i,requiredState:zR(r.requiredState,i)}]}),{requiredState:e,withRequiredState:[]}).withRequiredState}function TR(e,t,n){let r=t.flatMap(i=>i.expect.filter(o=>o.kind==="state")).reduce((i,o)=>OR(i,o,n),e);return{...r,browser:Qt(r.browser,jR(t)),singletons:{...r.singletons,...WR(t)}}}function OR(e,t,n){return t.assertion.kind==="deleted"?NR(e,t,n):t.assertion.kind==="created"?DR(e,t.entity,t.assertion.as,t.assertion.props,n):BR(e,t,n)}function NR(e,t,n){let r=co(t.key,t.entity,n.namespace),i=e.entities.find(a=>a.alias===r),o=Ur($R(t.key),n),s=i==null?{entity:t.entity,...o}:{entity:i.entity,...LR(i,o)};return{...e,absences:[...e.absences,s],entities:e.entities.filter(a=>a.alias!==r)}}function $R(e){return Object.fromEntries(Object.entries(e).flatMap(t=>{let n=t[1];return ih(n)?[]:[[t[0],n]]}))}function LR(e,t){return{literals:{...e.literals,...t.literals},relations:[...e.relations.filter(n=>!t.relations.some(r=>r.field===n.field)),...t.relations]}}function DR(e,t,n,r,i){let o=Ur(r,i);return{...e,absences:e.absences.filter(s=>s.entity!==t||!_R(o,s)),entities:[...e.entities,{alias:n,entity:t,...o}]}}function _R(e,t){return Object.entries(t.literals).every(([r,i])=>e.literals[r]===i)&&t.relations.every(r=>e.relations.some(i=>i.field===r.field&&i.targetAlias===r.targetAlias&&i.targetField===r.targetField))}function BR(e,t,n){if(t.assertion.kind!=="updated")return e;let r=co(t.key,t.entity,n.namespace);if(r==null)return e;let i=Ur(vn(t.assertion.props),n),o=Object.entries(t.assertion.props).filter(([,a])=>en(a)).map(([a])=>a),s=a=>a.alias===r?FR(a,i,o):a;return{...e,entities:e.entities.map(a=>s(a))}}function FR(e,t,n){let r=Object.entries(e.literals).filter(([i])=>!n.includes(i)&&!(i in t.literals));return{...e,literals:{...Object.fromEntries(r),...t.literals},relations:[...e.relations.filter(i=>!t.relations.some(o=>o.field===i.field)),...t.relations]}}function jR(e){return e.reduce((t,n)=>Qt(Qt(t,VR(n)),UR(n)),Ke)}function VR(e){return e.action.kind==="goto"?Dr(e.action.url):Ke}function UR(e){return Dl(e.expect).reduce((t,n)=>n.kind==="browser"?Qi(t,$t(n.name,n.part),n.value):t,Ke)}function Dl(e){return e.flatMap(t=>t.kind==="and"?Dl(t.predicates):[t])}function WR(e){return Object.fromEntries(e.flatMap(t=>Dl(t.expect).flatMap(n=>n.kind==="singleton"?[[n.singleton,n.assertion.value]]:[])))}function zR(e,t){return t[0]?.action.kind!=="goto"?e:{...e,browser:Ke}}function fo(e,t){let n=nh(t);return{namespace:n.namespace,requiredState:eh(n,t.singletons)}}function th(e,t){return[...new Set(e)].flatMap(n=>_l(n,t))}function lt(e){return ae(e)?[e.ref]:Ge(e)?e.template.flatMap(t=>ae(t)?[t.ref]:[]):[]}function Cn(e){switch(e.kind){case"visible":case"unobstructed":case"disabled":case"enabled":case"focused":case"checked":return tn(e.locator);case"value":case"text":return[...tn(e.locator),...lt(e.value)];case"singleton":return lt(e.assertion.value);case"browser":return lt(e.value);case"state":return[...e.assertion.kind==="deleted"?[]:Object.values(vn(e.assertion.props)).flatMap(t=>lt(t)),...Object.values(e.key).flatMap(t=>rh(t))];case"not":return Cn(e.predicate);case"when":return e.branches.flatMap(t=>t.consequence.flatMap(n=>Cn(n)));case"and":return e.predicates.flatMap(t=>Cn(t));case"count":return[]}}function nh(e){return{absences:e.absent,exclusives:e.exclusive,namespace:new Map(e.world.map(t=>[t.as,t.entity])),setups:e.world}}function tn(e){return e.by==="inside"?[...tn(e.scope),...tn(e.target)]:e.by==="role"?e.name==null?[]:lt(e.name):lt(e.value)}function rh(e){return ih(e)?Object.values(e.selection.where).flatMap(t=>rh(t)):lt(e)}function ih(e){return typeof e=="object"&&e!==null&&"kind"in e}function GR(e){return e.kind==="goto"?lt(e.url):e.kind==="fill"||e.kind==="select"?[...tn(e.locator),...lt(e.value)]:e.kind==="press"?e.locator==null?[]:tn(e.locator):(e.kind==="upload",tn(e.locator))}function HR(e){return[...GR(e.action),...e.expect.flatMap(t=>Cn(t))]}function KR(e){return e.absences.map(t=>({entity:t.entity,...Ur(t.where,e)}))}function Ur(e,t){let n=Object.entries(e),r=Object.fromEntries(n.flatMap(([o,s])=>ae(s)||Ge(s)?[]:[[o,s]])),i=n.flatMap(o=>{let s=o[1];if(!ae(s))return[];let a=_l(s.ref,t.namespace).at(0);return a==null?[]:[{entity:a.entity,field:o[0],targetAlias:a.aliasPath,targetField:a.field}]});return{literals:r,relations:i}}function qR(e,t){return e.map(n=>({alias:n.as,entity:n.entity,...Ur(n.set,t)}))}function YR(e){return qR(e.setups,e)}function ZR(e){let t=e.chunk.findIndex(s=>s.action.kind!=="goto"),n=t===-1?e.chunk:e.chunk.slice(0,t),r=e.chunk.slice(n.length),i=r.at(-1)??e.chunk.at(-1);if(i==null)throw new Error("empty transition chunk");let o=[...new Set(e.chunk.flatMap(s=>HR(s)))];return{effectStep:i,index:e.index,intent:e.intent,namespace:e.namespace,nav:n,paramSpaces:Object.fromEntries(o.filter(s=>e.paramSpaceOf.has(s)).map(s=>[s,e.paramSpaceOf.get(s)])),requiredState:e.requiredState,steps:r,test:e.testRef,wait:Ip(r.flatMap(s=>[...JR(s),...XR(s)])),whenSteps:e.whenChunk}}function JR(e){return e.expect.flatMap(t=>t.kind==="state"&&t.wait!=null?[t.wait]:[])}function XR(e){return io(e)?["slow"]:[]}function _l(e,t){let n=Sn(e);if(n==null)return[];let r=t.get(n.alias);return r==null?[]:[{aliasPath:n.alias,entity:r,field:n.field,ref:e}]}function QR(e){return new Map(e.valueSpaces.map(t=>[t.name,t]))}function eC(e,t){return new Map(Object.entries(e.params).map(([n,r])=>[n,t.get(r.valueSpace)]))}function tC(e){return Ll(e,0,[],[])}function Ll(e,t,n,r){let i=e[t];if(i==null)return n.length===0?r:[...r,n];let o=[...n,i];return nC(i)?Ll(e,t+1,[],[...r,o]):Ll(e,t+1,o,r)}function nC(e){return e.expect.some(t=>t.kind==="state")}function oh(e){return sh(e,new Map)}function rC(e,t){return e.reduce((n,r)=>n??t(r),null)}function sh(e,t){let n=e.variables.find(r=>!t.has(r));return n==null?t:rC(e.domain(n),r=>{let i=new Map([...t,[n,r]]);return e.consistent(i)?sh(e,i):null})}function ut(e,t){let n=ah(e,t);if(n==null)return null;let r=dC(n);return fC(e.singletons,t.singletons,r)&&pC(e.browser,t.browser,r)?r:null}function ah(e,t){let{absences:n,entities:r,exclusives:i}=e,o=new Map(r.map(a=>[a.alias,a])),s=oh({variables:r.map(a=>a.alias),consistent:a=>iC(a)&&oC(r,a)&&aC(n,a,t),domain:a=>uC(o.get(a),t)});return s==null?null:cC(i,r,s,t)?s:null}function iC(e){let t=[...e.values()];return new Set(t).size===t.length}function oC(e,t){return e.every(n=>t.has(n.alias)?n.relations.every(r=>sC(n,r,t)):!0)}function sC(e,t,n){if(!n.has(t.targetAlias))return!0;let r=n.get(t.targetAlias)?.[t.targetField];return r==null?!0:n.get(e.alias)?.[t.field]===r}function aC(e,t,n){return e.every(r=>![...n.entities.get(r.entity)?.values()??[]].some(i=>lC(i,r,t)))}function lC(e,t,n){return lh(e,t)?t.relations.every(r=>{if(!n.has(r.targetAlias))return!1;let i=n.get(r.targetAlias)?.[r.targetField];return i!=null&&e[r.field]===i}):!1}function lh(e,t){return Object.entries(t.literals).every(([n,r])=>r===null?e[n]==null:e[n]===r)}function uC(e,t){return e==null?[]:[...t.entities.get(e.entity)?.values()??[]].filter(n=>lh(n,e))}function cC(e,t,n,r){return e.every(i=>{let o=t.filter(a=>a.entity===i&&n.has(a.alias)).length;return(r.entities.get(i)?.size??0)===o})}function dC(e){return new Map([...e].flatMap(([t,n])=>Object.entries(n).flatMap(r=>{let i=r[1];return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?[[vt(`${t}.${r[0]}`),i]]:[]})))}function fC(e,t,n){return Object.entries(e).every(([r,i])=>Cl(i,Z,n)?t[r]===He(i,Z,n):!1)}function pC(e,t,n){return xn(e).every(({clause:r,key:i})=>{if(r===null)return Un(t,i)===void 0;if(!Cl(r,Z,n))return!1;let o=He(r,Z,n);return Un(t,i)===(typeof o=="string"?o:void 0)})}function ch(e,t,n){return e.reduce((r,i)=>{let o=Br(r.snapshot,hC(i),n);return{resolved:[...r.resolved,mC(i,o,n)],snapshot:o}},{resolved:[],snapshot:t}).resolved}function hC(e){return e.expect.filter(t=>t.kind==="state")}function mC(e,t,n){return e.expect.some(r=>r.kind==="when")?{...e,expect:e.expect.flatMap(r=>dh(r,{env:n,snapshot:t}))}:e}function dh(e,t){if(e.kind!=="when")return[e];let n=yC(e,t);return n==null?[]:n.flatMap(r=>dh(r,t))}function yC(e,t){return e.branches.find(n=>n.condition==null||Bl(n.condition,t))?.consequence}function Bl(e,t){if(e.kind==="count")return Rn(t.snapshot,e.entity,{},t.env).length===e.value;if(e.kind==="singleton"){let n=He(e.assertion.value,Z,t.env);return uh(t.snapshot.singletons[e.singleton])===uh(n)}return e.kind==="not"?!Bl(e.predicate,t):e.predicates.every(n=>Bl(n,t))}function uh(e){return e==null?"\u2205":JSON.stringify(e)}function Wr(e,t,n){let r=ut(e.requiredState,t);return r==null?null:new Map([...r,...Object.entries(n).map(([i,o])=>[vt(i),o])])}function zr(e,t,n){let r=ch(e.whenSteps,n,t),i=r.at(-1)??e.effectStep,o=Wn(i,t),s=bC(e,t);return{effect:SC(o.effect,s),steps:r.map(a=>{let l=Wn(a,t);return{action:l.action,effect:l.effect,pendingChecks:l.pendingChecks,reconcile:l.reconcile,source:a,verifyChanges:l.verifyChanges}})}}function ho(e,t,n){return ut(e.requiredState,n)==null?!1:po(t(n))!==po(n)||wC(e)||gC(e)}function gC(e){return[...e.nav,...e.steps].every(t=>t.expect.every(n=>n.kind!=="state"))}var fh=new WeakMap;function po(e){let t=fh.get(e);if(t!=null)return t;let n=F({browser:{...e.browser},entities:[...e.entities].map(([r,i])=>[r,[...i]]),singletons:{...e.singletons}});return fh.set(e,n),n}function bC(e,t){let n=e.nav.at(-1);return n==null?void 0:Wn(n,t).action.url}function SC(e,t){if(t==null)return e;let n=Nt(t);return r=>{let i=e(r);return{...i,browser:to(i.browser,n)}}}function wC(e){return e.effectStep.expect.some(t=>t.kind==="state"&&t.assertion.kind==="updated"&&Object.values(t.assertion.props).some(n=>en(n)))}function mo(e,t,n){let r=Wr(e,t.snapshot,n);if(r==null)return null;let i=xC(e,r,t.snapshot);return i==null||!ho(e,i.effect,t.snapshot)?null:{next:{snapshot:i.effect(t.snapshot)},resolved:i}}function ph(e,t,n){let r=Wr(e,t.snapshot,n);if(r==null)return"required-state-unsatisfied";try{return zr(e,r,t.snapshot),"no-effect"}catch{return"unresolvable"}}function xC(e,t,n){try{return zr(e,t,n)}catch{return null}}function Gr(e,t,n){return e.flatMap((r,i)=>{let o=n(r),s=mo(r,t,o);return s==null?[]:[{idx:i,label:Ct(r),params:o,stepRun:s}]})}var vC={absences:[],browser:Ke,entities:[],exclusives:[],singletons:{}};function Gn(e){return{...vC,...e}}function Hr(e,t){if(e==null)return new Set;if(e.by==="inside")return new Set([...Hr(e.scope,t),...Hr(e.target,t)]);let n=e.by==="role"?e.name:e.value;return new Set(t(n))}function yo(e){return RC(e).flatMap(t=>CC(t))}function RC(e){return[...e.reduce((n,r)=>{let i=F([r.when.singletons,r.when.browser,r.consequence]);return new Map([...n,[i,[...n.get(i)??[],r]]])},new Map).values()]}function CC(e){if(e.length<2)return[];let t=e.map(o=>new Set(o.when.entities.map(s=>Fl(s)))),[n]=t;if(n==null)return[];let r=[...n].filter(o=>t.every(s=>s.has(o))),i=e.toSorted((o,s)=>o.when.entities.length-s.when.entities.length)[0];return i==null||r.length===i.when.entities.length?[]:kC(e,r)?[]:IC(i,r,TC(e))}function Fl(e){return F([e.entity,e.literals])}function kC(e,t){return e.some(n=>{let r=hh(n.consequence),i=AC(r),o=EC(r);return n.when.entities.some(s=>!t.includes(Fl(s))&&(PC(s,i)||o.has(s.alias)))})}function hh(e){return e.kind==="not"?hh(e.predicate):"locator"in e?e.locator:void 0}function AC(e){return Hr(e,t=>t==null||ae(t)||Ge(t)?[]:[t])}function EC(e){return Hr(e,t=>{if(t==null||!ae(t))return[];let n=Sn(t.ref);return n==null?[]:[n.alias]})}function PC(e,t){return Object.values(e.literals).some(n=>typeof n=="string"&&t.has(n))}function IC(e,t,n){let r=e.when.entities.filter(l=>t.includes(Fl(l))),i=e.when.entities.filter(l=>!r.includes(l)).filter(l=>e.when.exclusives.includes(l.entity)).map(l=>({...l,literals:{},relations:[]})),o=[...r,...i],s=new Set(o.map(l=>l.alias));if(![...e.refs].every(l=>s.has(l)))return[];let a=Gn({browser:e.when.browser,entities:o.map(l=>MC(l,s)),exclusives:e.when.exclusives.filter(l=>o.some(u=>u.entity===l)),singletons:e.when.singletons});return[{consequence:e.consequence,origin:{kind:"generalized",tests:n},refs:e.refs,when:a}]}function MC(e,t){return{...e,relations:e.relations.filter(n=>t.has(n.targetAlias))}}function TC(e){return[...new Set(e.flatMap(t=>t.origin==null?[]:t.origin.kind==="generalized"?t.origin.tests:[t.origin.test]))]}function bh(e){return e.flatMap((t,n)=>e.slice(n+1).flatMap(r=>wh(t,r)))}function Sh(e,t){return wh(e,t).length>0}function wh(e,t){let n=mh(e.when,t.when);return!n&&!mh(t.when,e.when)||!$C(e.consequence,t.consequence)?[]:[{a:e.consequence,b:t.consequence,when:n?t.when:e.when}]}function mh(e,t){return yh(e.entities,t.entities)&&yh(e.absences,t.absences)&&e.exclusives.every(n=>t.exclusives.includes(n))&&OC(e.singletons,t.singletons)&&NC(e.browser,t.browser)}function yh(e,t){let n=new Set(t.map(r=>F(r)));return e.every(r=>n.has(F(r)))}function OC(e,t){return Object.entries(e).every(([n,r])=>n in t&&F(t[n])===F(r))}function NC(e,t){let n=new Map(xn(t).map(r=>[F(r.key),r.clause]));return xn(e).every(r=>{let i=F(r.key);return n.has(i)&&F(n.get(i))===F(r.clause)})}function $C(e,t){return e.kind==="not"?jl(e.predicate,t):t.kind==="not"?jl(e,t.predicate):LC(e,t)||DC(e,t)}function jl(e,t){return e.kind===t.kind&&"locator"in e&&"locator"in t&&xh(e,t)}function xh(e,t){return"locator"in t&&F(e.locator)===F(t.locator)}function LC(e,t){let n=new Set([e.kind,t.kind]);return n.has("enabled")&&n.has("disabled")&&"locator"in e&&"locator"in t?xh(e,t):!1}function DC(e,t){let n=gh(e),r=gh(t);return n==null||r==null||e.kind!==t.kind?!1:jl(e,t)&&F(n)!==F(r)}function gh(e){return e.kind==="value"||e.kind==="text"?e.value:null}function vh(e,t){return e.flatMap(n=>{let r=_C(n),i=new Set(n.requiredState.absences.map(o=>o.entity));return t.flatMap(o=>BC(n,o,r,i))})}function _C(e){return new Set(e.steps.flatMap(t=>t.expect.flatMap(n=>n.kind==="state"&&n.assertion.kind==="deleted"?[n.entity]:[])))}function BC(e,t,n,r){let{source:i,target:o}=t.reference;return!n.has(o)||n.has(i)||r.has(i)?[]:[{dataRule:t,source:i,target:o,transition:Ct(e)}]}function Vl(e){return F({consequence:e.consequence,when:e.when})}function bo(e){let t=[...FC(e),...XC(e)],n=yo(t).reduce((r,i)=>[...t,...r].some(s=>Sh(i,s))?r:[...r,i],[]);return Dt([...t,...n],Vl)}function So(e,t){return e.filter(n=>!jC(n)||VC(n)===t)}function wo(e){return e.kind==="not"?wo(e.predicate):e.kind==="visible"||e.kind==="disabled"||e.kind==="enabled"||e.kind==="focused"||e.kind==="checked"||e.kind==="value"||e.kind==="text"}function xo(e,t,n){if(ut(e.when,t)!=null)return null;let r=ut(e.when,n);return r==null?null:ek(e,r)}function FC(e){return Dt(Rt(e).flatMap(t=>UC(e,t)),Vl)}function jC(e){return e.origin==null||e.origin.kind==="generalized"?!1:Cn(e.consequence).some(t=>Sn(t)!=null)}function VC(e){let{origin:t}=e;if(!(t==null||t.kind==="generalized"))return t.test}function UC(e,{test:t,workflow:n}){let r=fo(e,t),i=WC(n.steps);return t.steps.reduce((o,s)=>({pageRules:[...o.pageRules,...JC({branchScoped:i,namespace:r.namespace,origin:{kind:"test",test:Qe(t)},requiredState:o.requiredState,step:s})],requiredState:zC(o.requiredState,s,r)}),{pageRules:[],requiredState:r.requiredState}).pageRules}function WC(e){let t=e.flatMap(n=>n.expect).flatMap(n=>go(n)).map(n=>F(n));return new Set(t)}function go(e){return e.kind==="not"?go(e.predicate):e.kind==="and"?e.predicates.flatMap(t=>go(t)):e.kind!=="when"?[]:e.branches.flatMap(t=>t.consequence.flatMap(n=>[n,...go(n)]))}function zC(e,t,n){return t.expect.reduce((r,i)=>i.kind==="state"?GC(r,i,n):r,e)}function GC(e,t,n){if(t.assertion.kind==="created"){let o=HC(t.assertion.as,t.entity,t.assertion.props,n);return{...e,entities:[...e.entities,o]}}let r=co(t.key,t.entity,n.namespace);if(r==null)return e;if(t.assertion.kind==="deleted")return YC(e,r);let i=vn(t.assertion.props);return{...e,entities:e.entities.map(o=>o.alias===r?Ch(o,i,n):o)}}function HC(e,t,n,r){return Ch({alias:e,entity:t,literals:{},relations:[]},n,r)}function Ch(e,t,n){return Object.entries(t).reduce((r,[i,o])=>{if(Ge(o))return r;if(ae(o)){let s=KC(o.ref,i,n.namespace);return{...r,literals:qC(r.literals,i),relations:s==null?r.relations:[...Rh(r.relations,i),s]}}return{...r,literals:{...r.literals,[i]:o},relations:Rh(r.relations,i)}},e)}function KC(e,t,n){let r=Sn(e);if(r==null)return;let i=n.get(r.alias);return i==null?void 0:{entity:i,field:t,targetAlias:r.alias,targetField:r.field}}function qC(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>n!==t))}function Rh(e,t){return e.filter(n=>n.field!==t)}function YC(e,t){let n=e.entities.find(i=>i.alias===t),r=ZC(e,t);return n==null?r:{...r,absences:[...r.absences,{entity:n.entity,literals:n.literals,relations:n.relations}]}}function ZC(e,t){return{...e,entities:e.entities.filter(n=>n.alias!==t)}}function JC({branchScoped:e,namespace:t,origin:n,requiredState:r,step:i}){if(i.action.kind!=="goto")return[];let o=i.action.url,s=Qt(Dr(o),kh(i));return i.expect.filter(a=>wo(a)).filter(a=>!e.has(F(a))).map(a=>Eh({browser:s,consequence:a,namespace:t,origin:n,requiredState:r,url:o}))}function kh(e){return Ah(e.expect).reduce((t,n)=>n.kind==="browser"?Qi(t,$t(n.name,n.part),n.value):t,Ke)}function Ah(e){return e.flatMap(t=>t.kind==="and"?Ah(t.predicates):[t])}function Eh({browser:e,consequence:t,namespace:n,origin:r,requiredState:i,url:o}){return{consequence:t,origin:r,refs:new Set(th([...lt(o),...Cn(t)],n).map(s=>s.aliasPath)),when:{...i,browser:Qt(i.browser,e)}}}function XC(e){return Dt(kn(e).flatMap(t=>QC(t)),Vl)}function QC(e){let t=e.nav.at(-1),n=e.steps[0]?.action,r=n!=null&&"locator"in n?n.locator:void 0;if(t==null||t.action.kind!=="goto"||r==null)return[];let i={kind:"enabled",locator:r,wait:void 0};return[Eh({browser:Qt(Dr(t.action.url),kh(t)),consequence:i,namespace:e.namespace,origin:{intent:e.intent,kind:"trigger",test:e.test},requiredState:e.requiredState,url:t.action.url})]}function ek(e,t){try{let n=ao(e.consequence,t);return n==null?null:{check:n}}catch{return null}}function vo(e){return Qp(Rt(e).flatMap(t=>tk(e,t.test)))}function Ro(e,t){return ut(e.when,t)==null?!1:ut(e.holds,t)==null}function tk(e,t){let n=fo(e,t);return n.requiredState.entities.flatMap(r=>r.relations.flatMap(i=>nk(e,r,i,n.namespace)?ok(r,i,n.namespace):[]))}function nk(e,t,n,r){let i=r.get(n.targetAlias);return i!=null&&!rk(e,t.entity,n.field)&&ik(e,i,n.targetField)}function rk(e,t,n){return e.entities.find(r=>r.name===t)?.props[n]?.optional===!0}function ik(e,t,n){return e.entities.find(r=>r.name===t)?.identity.includes(n)===!0}function ok(e,t,n){let r=n.get(t.targetAlias);if(r==null)return[];let i=Ph(e.alias,e.entity),o=Ph(t.targetAlias,r);return[{holds:Gn({entities:[{...i,relations:[t]},o]}),reference:{field:t.field,source:e.entity,target:r,targetField:t.targetField},when:Gn({entities:[i]})}]}function Ph(e,t){return{alias:e,entity:t,literals:{},relations:[]}}function Ih(e,t){let n=[...t.entities].flatMap(([o,s])=>[...s].map(([a,l])=>sk({entity:o,key:a,pre:e,row:l}))),r=[...e.entities].flatMap(([o,s])=>[...s].flatMap(([a,l])=>ak({entity:o,key:a,post:t,row:l}))),i=Object.entries(t.singletons).map(([o,s])=>({changed:e.singletons[o]!==s,name:o,value:s}));return{rows:[...n,...r],singletons:i}}function sk({entity:e,key:t,pre:n,row:r}){let i=lk(n.entities.get(e),t),o=Object.entries(r).map(([s,a])=>({changed:i==null||i[s]!==a,field:s,value:a}));return{changed:i==null||o.some(s=>s.changed),entity:e,fields:o,key:t,status:i==null?"created":"present"}}function ak({entity:e,key:t,post:n,row:r}){if(n.entities.get(e)?.has(t)===!0)return[];let i=Object.entries(r).map(([o,s])=>({changed:!1,field:o,value:s}));return[{changed:!0,entity:e,fields:i,key:t,status:"deleted"}]}function lk(e,t){return e?.get(t)}function Co(e,t,n){return t.steps.map(r=>({effect:r.effect,pendingChecks:r.pendingChecks.map(i=>({budget:i.budget,check:{kind:"poll",wait:o=>n.awaitCheck(i.check,o)},source:{check:i.check,kind:"step"},targetIds:()=>n.locateIds(ko(i.check))})),reconcile:r.reconcile,source:r.source,step:{action:r.action,intent:e.intent,test:e.test},sync:e.wait,verifyChanges:r.verifyChanges,perform:()=>n.perform(r.action),requiredState:()=>!0,targetIds:()=>n.locateIds(r.action.locator)}))}function ko(e){if(e.kind==="not")return ko(e.inner);if(e.kind!=="browser")return e.locator}async function Wl(e,t){let{params:n,transition:r}=e.stepRun,i=mo(r,e.state,n);if(i==null){let s={intent:r.intent,kind:"unrunnable",reason:ph(r,e.state,n),test:r.test};return{label:Ct(r),next:e.state,result:{finalModel:e.state.snapshot,findings:[s]}}}let o=await ro({canon:e.canon,classify:e.classify,initialSnapshot:e.state.snapshot,observe:e.driver.observe,onAssertion:e.onAssertion,onStep:e.onStep,pageRulePendingChecks:uk(e.pageRules,e.dataRules,e.driver),steps:Co(e.stepRun.transition,i.resolved,e.driver),stopAfterStep:e.stopAfterStep==null?void 0:e.stopAfterStep-e.stepBase},t);return{label:Ct(e.stepRun.transition),next:{snapshot:o.finalModel},result:o}}function Mh(e,t){return Ro(e,t)?[{budget:"fast",check:{kind:"decided",passed:!1},source:{dataRule:e,kind:"data-rule"},targetIds:()=>Promise.resolve([])}]:[]}function uk(e,t,n){return(r,i)=>[...e.flatMap(o=>ck(o,r,i,n)),...t.flatMap(o=>Mh(o,i))]}function ck(e,t,n,r){let i=xo(e,t,n);return i==null?[]:[{budget:"slow",check:{kind:"poll",wait:o=>r.awaitCheck(i.check,o)},source:{check:i.check,kind:"page-rule",origin:e.origin},targetIds:()=>r.locateIds(ko(i.check))}]}function Kr(e,t){return Ul({acc:{findings:[],ran:[]},index:0,params:e,signal:t,state:e.initialState,stepBase:0})}async function Ul({acc:e,index:t,params:n,signal:r,state:i,stepBase:o}){Xe(r);let s=n.sequence[t];if(s==null)return e;let a=Date.now(),l=[],u=await Wl({canon:n.canon,classify:n.classify,dataRules:n.dataRules,driver:n.driver,onAssertion:n.onAssertion,pageRules:n.pageRules,state:i,stepBase:o,stepRun:s,stopAfterStep:n.stopAfterStep,onStep:d=>{l.push(d.index),n.onEvent({annotations:d.annotations,endMs:d.endMs,findings:d.findings,index:o+d.index,kind:"step",source:d.source,startMs:d.startMs,state:Ih(d.pre,d.post),url:d.url})}},r);if(u==null)return Ul({acc:e,index:t+1,params:n,signal:r,state:i,stepBase:o});n.onEvent({endMs:Date.now(),intent:s.transition.intent,kind:"ran",startMs:a}),u.result.findings.forEach(d=>{n.onEvent({finding:d,kind:"finding"})});let c={findings:[...e.findings,...u.result.findings],ran:[...e.ran,u.label]};return u.result.findings.length>0||n.stopAfterStep!=null&&o+l.length>=n.stopAfterStep?c:Ul({acc:c,index:t+1,params:n,signal:r,state:u.next,stepBase:o+l.length})}var qr={value:e=>dk(e)};function Io(e,t){return{value:n=>e.value({...n,seed:`${t}:${n.seed}`})}}function Mo(e,t){return{value:n=>e.value({...n,anchor:t})}}function dk({anchor:e,constraints:t,generator:n,nullable:r,seed:i,type:o,values:s,valueSpace:a}){let l=zl(`${a}:${i}`);return r&&l%4===0?null:s!=null&&s.length>0?s[l%s.length]??s[0]??null:n==="date.iso"?fk({anchor:e,constraints:t,n:l,timeHash:zl(`${a}:${i}#tod`)}):o==="number"?pk(l,t):o==="boolean"?l%2===0:bk(n,l)}var Ao=864e5;function fk({anchor:e,constraints:t,n,timeHash:r}){if(t?.kind!=="datetime")throw new Error("datetime value space requires offsetDays constraints");if(e==null)throw new Error("datetime value space requires a run anchor timestamp");let i=Date.parse(e);if(Number.isNaN(i))throw new TypeError(`datetime anchor "${e}" is not a valid ISO timestamp`);let o=t.maxOffsetDays-t.minOffsetDays+1,s=o<=0?t.minOffsetDays:t.minOffsetDays+n%o,a=Math.floor(i/Ao)*Ao;return new Date(a+s*Ao+r%Ao).toISOString()}function zl(e,t=0,n=7){return t>=e.length?n>>>0:zl(e,t+1,n*31+(e.codePointAt(t)??0)>>>0)}function pk(e,t){if(t?.kind!=="number"||t.min==null||t.max==null)throw new Error("number value space requires min and max constraints");let n=t.max-t.min+1;return n<=0?t.min:t.min+e%n}var hk=["ada","bruno","carmen","dario","elena","felix","greta","hugo","iris","jonas","kira","lena","mateo","nadia","oscar","petra","quinn","rosa","stefan","tara","ugo","vera","wim","yara"],mk=["abreu","berg","costa","duval","eriksen","fischer","garza","holm","ito","jansen","kovac","laurent","moreau","novak","okafor","petrov","quist","rossi","sato","tanaka","ueda","vargas","weber","zhang"],yk=["amber","brisk","calm","deep","early","fond","glad","hazel","ivory","jade","keen","lush","mauve","noble","opal","plum","quiet","rapid","sage","teal","umber","vivid","warm","zesty"],gk=["aspen","brook","cedar","dune","ember","fjord","grove","harbor","isle","juniper","knoll","lagoon","meadow","nimbus","orchid","prairie","quartz","ridge","summit","thicket","umbra","vale","willow","zephyr"];function Eo(e,t){let n=e[t%e.length];if(n==null)throw new Error("empty word list");return n}function Po(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function bk(e,t){let n=Eo(hk,t),r=Eo(mk,Math.floor(t/31)),i=Eo(yk,t),o=Eo(gk,Math.floor(t/29));return e==="internet.email"?`${n}.${r}${String(t%100)}@test.ripplo.ai`:e==="internet.url"?`https://${i}-${o}.example.com`:e==="person.fullName"?`${Po(n)} ${Po(r)}`:e==="company.name"?`${Po(i)} ${Po(o)}`:e==="lorem.slug"?`${i}-${o}`:`${o}-${String(t%1e3)}`}var oe=Ia(Nh(),1),ke={actual:e=>oe.default.red(e),bad:e=>oe.default.red(oe.default.bold(e)),bold:e=>oe.default.bold(e),dim:e=>oe.default.dim(e),expected:e=>oe.default.green(e),good:e=>oe.default.green(oe.default.bold(e)),heading:e=>oe.default.bold(oe.default.cyan(e)),path:e=>oe.default.cyan(oe.default.underline(e)),warn:e=>oe.default.yellow(oe.default.bold(e))},vk={assertion:oe.default.yellow,consistency:oe.default.magenta,"data rule":oe.default.yellow,driver:oe.default.red,"impossible action":oe.default.cyan,"page rule":oe.default.yellow,skipped:oe.default.red};function ct(e){return`${oe.default.red(oe.default.bold("\u2717"))} ${vk[e](oe.default.bold(e))}`}var Rk=oe.default.red("\u2717"),yF=oe.default.green("\u2713"),Ck=oe.default.dim("\u203A"),kk=8;function $h(e,t,n){let r=n==null?"":` ${ke.dim(n)}`;return` ${ke.dim(e.padStart(kk))} ${t}${r}`}function An(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${An(e.scope)} \u25B8 ${An(e.target)}`:e.name==null?e.role:`${e.role} "${e.name}"`}function Do(e){return e.url!=null?`${e.kind} ${e.url}`:e.locator!=null?`${e.kind} ${An(e.locator)}`:e.kind}function _t(e){if(e.kind==="not")return`not ${_t(e.inner)}`;if(e.kind==="browser"){let t=Ve(e.key);return e.value===null?`${t} absent`:`${t}="${e.value}"`}return e.kind==="value"||e.kind==="text"?`${e.kind} ${An(e.locator)}="${e.value}"`:`${e.kind} ${An(e.locator)}`}function Kn(e){let{field:t,source:n,target:r,targetField:i}=e.reference;return`${n}.${t} \u2192 ${r}.${i}`}function Bt(e){return`${e.intent} \u203A ${Do(e.action)}`}function Hl(e){return e.kind==="data-rule"?`data rule ${Kn(e.dataRule)}`:`${e.kind} ${_t(e.check)}`}function X(e){return e==null?"\u2205":JSON.stringify(e)}function Kl(e){return e.kind==="unexpected-row"?`${e.entity} "${e.key}" present in the app but the test expected none`:e.kind==="missing-row"?`${e.entity} "${e.key}" expected by the test but missing in the app`:e.kind==="wrong-value"?`${e.entity}.${e.field} [${e.key}] expected=${X(e.snapshot)} actual=${X(e.sut)}`:e.kind==="expected-change"?`${e.entity}.${e.field} [${e.key}] expected to change but stayed ${X(e.value)}`:e.kind==="browser-mismatch"?`${Ve(e.key)} expected=${X(e.snapshot)} actual=${X(e.sut)}`:`${e.singleton} expected=${X(e.snapshot)} actual=${X(e.sut)}`}function _o(e){return{label:Hl(e.source),step:Bt(e.step)}}function Bo({evidencePath:e,finding:t}){let n=Ak(t);return e==null?n:`${n} Evidence: ${ke.path(e)}`}function ql(e){return Pk(Ik(e))}function Ak(e){return e.kind==="consistency"?_k(e):e.kind==="pending-check"?jk(e.source,e.step,e.budget):e.kind==="impossible-action"?`${ct("impossible action")} The step "${e.step.intent}" ran ${Do(e.step.action)} from a state the test says can't happen. Either the test's required state is stricter than the app really is, or the app exposes this action somewhere it shouldn't \u2014 check which before loosening the test.`:e.kind==="unrunnable"?`${ct("skipped")} The planned step "${e.intent}" could not run \u2014 ${Lh(e.reason)}. A planned move was skipped, so this run proved less than it claims \u2014 fix the plan or the starting state rather than ignoring the skip.`:`${ct("driver")} The browser failed while running "${e.step.intent}" \u2014 ${xt(e.error)}. This is an environment failure (daemon, dev server, ports), not an app or test bug \u2014 fix the run environment and rerun.`}var Ek=new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`,"g");function Pk(e){return e.replaceAll(Ek,"").replaceAll(/\s+/g," ").trim()}function Ik(e){if(e.kind==="consistency"){let t=e.step==null?"":` after "${e.step.intent}"`;return`${Kl(e.mismatch)}${t}`}return e.kind==="pending-check"?`${Uk(e.source)} failed at "${e.step.intent}": ${Wk(e.source)}`:e.kind==="impossible-action"?`"${e.step.intent}" ran from a state the test says can't happen`:e.kind==="unrunnable"?`planned step "${e.intent}" could not run \u2014 ${Lh(e.reason)}`:`driver failed at "${e.step.intent}": ${xt(e.error)}`}var Mk={"no-effect":"the action has no observable effect from this state","required-state-unsatisfied":"the live state doesn't satisfy the step's required state",unresolvable:"a step references a value that doesn't exist yet (e.g. a not-yet-created id)"};function Lh(e){return Mk[e]}function Dh({debugDir:e,runId:t}){let n=`${e}/${t}`;return $h("behavior",ke.path(`${n}/behavior.jsonl`),void 0)}function _h(e){if(e.kind==="cascade-gap"){let{gap:n}=e;return`${ct("data rule")} ${n.transition} deletes ${n.target} but leaves ${n.source} rows pointing at the deleted row. That breaks the data rule ${Kn(n.dataRule)} \u2014 cascade the delete in the app or declare the cleanup on the deleting step.`}if(e.kind==="create-gap"){let{gap:n}=e,r=n.missing.length===1?"field":"fields",i=n.missing.length===1?"it":"them";return`${ct("data rule")} ${n.transition} creates ${n.entity} without setting the required ${r} ${n.missing.join(", ")}. Set ${i} on the creating step or drop the requirement from the entity.`}let{conflict:t}=e;return`${ct("page rule")} Two page rules contradict each other \u2014 ${t.a.kind} vs ${t.b.kind} when ${JSON.stringify(t.when.singletons)}. They were learned from different tests asserting opposite things about the same page \u2014 one of those tests is wrong, fix it before trusting either rule.`}function Bh(e){return"locator"in e&&e.locator!=null?`${e.kind} ${$o(e.locator)}`:"url"in e?`${e.kind} ${Tk(e.url)}`:e.kind}function Tk(e){return typeof e=="string"?e:"ref"in e?`{${e.ref}}`:Vh(e)}function No(e){return e.kind==="not"?`not ${No(e.predicate)}`:e.kind==="and"?e.predicates.map(t=>No(t)).join(" \u2227 "):e.kind==="when"?e.branches.map(t=>t.name).join(" | "):Ok(e)}function Fh(e){let t=e.browser.path;return t==null?"(any view)":typeof t!="object"?String(t):"template"in t?t.template.map(n=>typeof n=="string"?n:`{${n.ref}}`).join(""):`{${t.ref}}`}function jh(e){let t=[...e.entities.map(n=>Nk(n)),...xn(e.browser).filter(n=>n.key.kind!=="path").map(n=>`${Ve(n.key)}=${nn(n.clause)}`),...Object.entries(e.singletons).map(([n,r])=>`${n}=${nn(r)}`)];return t.length===0?"always":t.join(" \u2227 ")}function Ok(e){if("locator"in e){let t=$o(e.locator);return e.kind==="value"||e.kind==="text"?`${e.kind} ${t}=${nn(e.value)}`:`${e.kind} ${t}`}return e.kind==="browser"?`${e.name}=${nn(e.value)}`:e.kind==="singleton"?`${e.singleton}=${nn(e.assertion.value)}`:e.kind==="count"?`${e.entity} count ${String(e.value)}`:""}function $o(e){return e.by==="role"?e.name==null?e.role:`${e.role} ${nn(e.name)}`:e.by==="inside"?`${$o(e.scope)} \u25B8 ${$o(e.target)}`:nn(e.value)}function nn(e){return e===null?"\u2205":typeof e=="string"?`"${e}"`:typeof e!="object"?String(e):"ref"in e?`{${e.ref}}`:Vh(e)}function Vh(e){return e.template.map(t=>typeof t=="string"?t:":id").join("")}function Nk(e){let t=Object.entries(e.literals).map(([n,r])=>`${n}=${nn(r)}`);return t.length===0?e.entity:`${e.entity}(${t.join(", ")})`}function Lo(e){return e==null?"At the end of the run":`After ${Lk(e.action)} in ${e.intent}`}var $k={click:"clicking",fill:"filling",goto:"opening",hover:"hovering over",press:"pressing",select:"selecting",upload:"uploading to"};function Lk(e){return e.url!=null?`opening ${e.url}`:e.locator!=null?`${$k[e.kind]??e.kind} ${Hn(e.locator)}`:e.kind}function Hn(e){return e.by==="testId"?`the element with testId "${e.value}"`:e.by==="inside"?`${Hn(e.target)} inside ${Hn(e.scope)}`:e.name==null?`the ${e.role}`:`the "${e.name}" ${e.role}`}function Dk(e){return e.kind==="not"&&e.inner.kind==="visible"?`${Hn(e.inner.locator)} never disappeared`:e.kind==="visible"?`${Hn(e.locator)} never appeared`:e.kind==="value"||e.kind==="text"?`${Hn(e.locator)} never showed "${e.value}"`:`the check ${_t(e)} never held`}function _k(e){let t=e.pending?Bk(e):Fk(e.mismatch,e.step);return`${ct("consistency")} ${t}`}function Bk(e){let t=`${Uh(e.budget)} wait window`,n="If this write is legitimately slow, declare wait: on the expectation or move it to a slower tier.",{mismatch:r}=e,i=Lo(e.step);return r.kind==="wrong-value"?`${i}, ${r.entity}.${r.field} on row "${r.key}" never changed within the ${t} \u2014 it still showed ${ke.actual(X(r.sut))} instead of ${ke.expected(X(r.snapshot))}, so the write may not have landed at all. ${n}`:r.kind==="unexpected-row"?`${i}, the ${r.entity} row "${r.key}" was still there at the end of the ${t} \u2014 the delete may not have landed. ${n}`:r.kind==="missing-row"?`${i}, the ${r.entity} row "${r.key}" never appeared within the ${t} \u2014 the create may not have landed. ${n}`:r.kind==="expected-change"?`${i}, ${r.entity}.${r.field} on row "${r.key}" was expected to change but stayed ${ke.actual(X(r.value))} through the ${t}, so the write may not have landed at all. ${n}`:r.kind==="browser-mismatch"?`${i}, ${Ve(r.key)} never changed within the ${t} \u2014 it still showed ${ke.actual(X(r.sut))} instead of ${ke.expected(X(r.snapshot))}, so the write may not have landed at all. ${n}`:`${i}, ${r.singleton} never changed within the ${t} \u2014 it still showed ${ke.actual(X(r.sut))} instead of ${ke.expected(X(r.snapshot))}, so the write may not have landed at all. ${n}`}function Uh(e){return`${String(Lt[e]/1e3)}s`}function Fk(e,t){let n=Lo(t);return e.kind==="wrong-value"?`${n}, ${e.entity}.${e.field} on row "${e.key}" showed ${ke.actual(X(e.sut))} but the test expected ${ke.expected(X(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 if the app legitimately owns this value, assert changed() instead.`:e.kind==="singleton-mismatch"?`${n}, ${e.singleton} showed ${ke.actual(X(e.sut))} but the test expected ${ke.expected(X(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:e.kind==="unexpected-row"?`${n}, the app held a ${e.entity} row "${e.key}" the test never expected. Some step writes this row without declaring it \u2014 declare the effect on the acting step (${e.entity}.created, updated, or deleted), or if this write belongs to a different flow, cover it in that flow's test.`:e.kind==="missing-row"?`${n}, the test expected a ${e.entity} row "${e.key}" but the app had none. This is an app bug if the write was promised \u2014 if it only happens from a different starting state, restrict this test's given and cover that state in its own test.`:e.kind==="browser-mismatch"?`${n}, ${Ve(e.key)} showed ${ke.actual(X(e.sut))} but the test expected ${ke.expected(X(e.snapshot))}. This is an app bug if the expected value is the promised behavior \u2014 otherwise correct the expected value at the step that sets it.`:`${n}, ${e.entity}.${e.field} on row "${e.key}" was expected to change but stayed ${ke.actual(X(e.value))}. This is an app bug if this action should change it \u2014 if the change needs other preconditions, split that case into its own test with the right given.`}function jk(e,t,n){let r=`${Uh(n)} wait window`;if(e.kind==="data-rule")return`${ct("data rule")} ${Lo(t)}, the data rule ${Kn(e.dataRule)} stopped holding \u2014 a referenced row went missing. This is an app bug if the reference should survive this action \u2014 confirm in behavior.jsonl before relaxing the rule.`;if(e.kind==="page-rule")return`${ct("page rule")} A page rule learned from ${Vk(e.origin)} says ${_t(e.check)} at this URL \u2014 it never held here within the ${r}. Either the rule is broader than the app guarantees or this page regressed \u2014 confirm in behavior.jsonl before narrowing the rule.`;let i=`${ct("assertion")} ${Lo(t)}, ${Dk(e.check)} within the ${r}.`;return t.action.locator!=null?`${i} If the page never changed after this action \u2014 the recording goes quiet right after it \u2014 the interaction was likely lost: its target re-rendered or unmounted as it fired, so the click landed on nothing. That is an unstable-render bug in the app, not a missing element. Otherwise it is a wrong accessible name, a UI regression, or a starting state this page doesn't have. Confirm in behavior.jsonl before changing the test.`:`${i} This is usually a wrong accessible name, a UI regression, or a starting state this page doesn't have \u2014 confirm in behavior.jsonl before changing the test.`}function Vk(e){return e==null?"another workflow":e.kind==="test"?`an assertion in test "${e.test}"`:e.kind==="trigger"?`the trigger of "${e.intent}" in test "${e.test}"`:`tests ${e.tests.map(n=>JSON.stringify(n)).join(", ")}`}function Uk(e){return e.kind==="data-rule"?"data rule":e.kind==="page-rule"?"page rule":"assertion"}function Wk(e){return e.kind==="data-rule"?Kn(e.dataRule):_t(e.check)}function Wh(e){let t;return n=>{if(t!==void 0&&t.input===n)return t.output;let r=e(n);return t={input:n,output:r},r}}var Yr=Wh(e=>({dataRules:vo(e),pageRules:bo(e)}));var zh=Object.defineProperty,Gh=(e,t)=>{let n={};for(var r in e)zh(n,r,{get:e[r],enumerable:!0});return t||zh(n,Symbol.toStringTag,{value:"Module"}),n};var zk=class Hh{constructor(t){this.seed=t}clone(){return new Hh(this.seed)}next(){let t=Yl(this.seed),n=Zl(t),r=Yl(t),i=Zl(r);return this.seed=Yl(r),Zl(this.seed)+(i+(n<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function Yl(e){return Math.imul(e,214013)+2531011&4294967295}function Zl(e){return(e&-2147483649)>>16}function Kh(e){return new zk(e)}var Gk="SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000",Hk=class Yh{constructor(t,n){this.states=t,this.index=n}clone(){return new Yh(this.states.slice(),this.index)}next(){let t=this.states[this.index];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,this.index=Fo(this.states,this.index),t}getState(){return[this.index,...this.states]}jump(){let t=this.states.slice(),n=this.index;this.index=Fo(this.states,this.index);for(let r=19932;r>0;--r)Gk.charCodeAt(r/6|0)-48&1<<r%6&&qh(this.states,this.index,t,n),this.index=Fo(this.states,this.index);qh(this.states,this.index,t,n)}};function qh(e,t,n,r){let i=0;if(r>=t){for(;i<624-r;i++)e[i+t]^=n[i+r];for(;i<624-t;i++)e[i+t]^=n[i+r-624];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}else{for(;i<624-t;i++)e[i+t]^=n[i+r];for(;i<624-r;i++)e[i+t-624]^=n[i+r];for(;i<624;i++)e[i+t-624]^=n[i+r-624]}}function Fo(e,t){if(t<227){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397]^n>>>1^-(n&1)&2567483615,t+1}else if(t<623){let n=e[t]&2147483648|e[t+1]&2147483647;return e[t]=e[t+397-624]^n>>>1^-(n&1)&2567483615,t+1}else{let n=e[t]&2147483648|e[0]&2147483647;return e[t]=e[396]^n>>>1^-(n&1)&2567483615,0}}function Kk(e){for(let t=0;t!==624;++t)Fo(e,t)}function Zh(e){let t=[e|0];for(let n=1;n!==624;++n){let r=t[n-1]^t[n-1]>>>30;t.push(Math.imul(1812433253,r)+n|0)}return Kk(t),new Hk(t,0)}var qk=class Jh{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Jh(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00^this.s00<<23,n=this.s01^(this.s01<<23|this.s00>>>9),r=t^this.s10^(t>>>18|n<<14)^(this.s10>>>5|this.s11<<27),i=n^this.s11^n>>>18^this.s11>>>5,o=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=i,this.s10=r,o}jump(){let t=0,n=0,r=0,i=0,o=[1667051007,2321340297,1548169110,304075285];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Jl(e){return new qk(-1,~e,e|0,0)}var Yk=class Xh{constructor(t,n,r,i){this.s01=t,this.s00=n,this.s11=r,this.s10=i}clone(){return new Xh(this.s01,this.s00,this.s11,this.s10)}next(){let t=this.s00+this.s10|0,n=this.s10^this.s00,r=this.s11^this.s01,i=this.s00,o=this.s01;return this.s00=i<<24^o>>>8^n^n<<16,this.s01=o<<24^i>>>8^r^(r<<16|n>>>16),this.s10=r<<5^n>>>27,this.s11=n<<5^r>>>27,t}jump(){let t=0,n=0,r=0,i=0,o=[3639956645,3750757012,1261568508,386426335];for(let s=0;s!==4;++s)for(let a=1;a;a<<=1)o[s]&a&&(t^=this.s01,n^=this.s00,r^=this.s11,i^=this.s10),this.next();this.s01=t,this.s00=n,this.s11=r,this.s10=i}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function Qh(e){return new Yk(-1,~e,e|0,0)}function em(e,t){for(let n=0;n!==t;++n)e.next()}var tm=BigInt,Zk=4294967296n;function rm(e,t,n){let r=n-t+1n,i=Zk,o=1;for(;i<r;)i<<=32n,++o;let s=nm(o,e);if(s<r)return s+t;if(s+r<i)return s%r+t;let a=i-i%r;for(;s>=a;)s=nm(o,e);return s%r+t}function nm(e,t){let n=tm(t.next()+2147483648);for(let r=1;r<e;++r){let i=t.next();n=(n<<32n)+tm(i+2147483648)}return n}function Zr(e,t){let n=t>2?~~(4294967296/t)*t:4294967296,r=e.next()+2147483648;for(;r>=n;)r=e.next()+2147483648;return r%t}function Xl(e,t){if(t<0){let n=-t;e.sign=-1,e.data[0]=~~(n/4294967296),e.data[1]=n>>>0}else e.sign=1,e.data[0]=~~(t/4294967296),e.data[1]=t>>>0;return e}function Jk(e,t,n){let r=t.data[1],i=t.data[0],o=t.sign,s=n.data[1],a=n.data[0],l=n.sign;if(e.sign=1,o===1&&l===-1){let m=r+s,y=i+a+(m>4294967295?1:0);return e.data[0]=y>>>0,e.data[1]=m>>>0,e}let u=r,c=i,d=s,p=a;o===-1&&(u=s,c=a,d=r,p=i);let h=0,f=u-d;return f<0&&(h=1,f=f>>>0),e.data[0]=c-p-h,e.data[1]=f,e}function Xk(e,t,n){let r=n[0]+1;for(t[0]=Zr(e,r),t[1]=Zr(e,4294967296);t[0]>=n[0]&&(t[0]!==n[0]||t[1]>=n[1]);)t[0]=Zr(e,r),t[1]=Zr(e,4294967296);return t}var Qk=Number.MAX_SAFE_INTEGER,eA={sign:1,data:[0,0]},tA={sign:1,data:[0,0]},im={sign:1,data:[0,0]},Ql=[0,0];function nA(e,t,n,r){let i=r<=Qk?Xl(im,r):Jk(im,Xl(eA,n),Xl(tA,t));return i.data[1]===4294967295?(i.data[0]+=1,i.data[1]=0):i.data[1]+=1,Xk(e,Ql,i.data),Ql[0]*4294967296+Ql[1]+t}function jo(e,t,n){let r=n-t;return r<=4294967295?Zr(e,r+1)+t:nA(e,t,n,r)}var om=Symbol.for("fast-check/PreconditionFailure"),cn=class extends Error{constructor(e=!1){super(),this.interruptExecution=e,this.footprint=om}static isFailure(e){return e!=null&&e.footprint===om}};function rA(e){if(!e)throw new cn}var iA=class{[Symbol.iterator](){return this}next(e){return{value:e,done:!0}}},oA=new iA;function sA(){return oA}function*aA(e,t){for(let n of e)yield t(n)}function*lA(e,t){for(let n of e)yield*t(n)}function*uA(e,t){for(let n of e)t(n)&&(yield n)}function*cA(e,t){for(let n=0;n<t;++n){let r=e.next();if(r.done)break;yield r.value}}function*dA(e,t){let n=e.next();for(;!n.done&&t(n.value);)yield n.value,n=e.next()}function*fA(e,t){for(let n=e.next();!n.done;n=e.next())yield n.value;for(let n of t)for(let r=n.next();!r.done;r=n.next())yield r.value}var pA=Symbol.iterator,_=class Ft{static nil(){return new Ft(sA())}static of(...t){return new Ft(t[pA]())}constructor(t){this.g=t}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(t){return new Ft(aA(this.g,t))}flatMap(t){return new Ft(lA(this.g,t))}dropWhile(t){let n=!1;function*r(i){(n||!t(i))&&(n=!0,yield i)}return this.flatMap(r)}drop(t){if(t<=0)return this;let n=0;function r(){return n++<t}return this.dropWhile(r)}takeWhile(t){return new Ft(dA(this.g,t))}take(t){return new Ft(cA(this.g,t))}filter(t){return new Ft(uA(this.g,t))}every(t){for(let n of this.g)if(!t(n))return!1;return!0}has(t){for(let n of this.g)if(t(n))return[!0,n];return[!1,null]}join(...t){return new Ft(fA(this.g,t))}getNthOrLast(t){let n=t,r=null;for(let i of this.g){if(n--===0)return i;r=i}return r}};function ln(e){return new _(e)}var Me=Symbol.for("fast-check/cloneMethod");function Pn(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Me in e&&typeof e[Me]=="function"}function Xn(e){return Pn(e)?e[Me]():e}var hA=Object.defineProperty,M=class{constructor(e,t,n){this.value_=e,this.context=t,this.hasToBeCloned=n!==void 0||Pn(e),this.readOnce=!1,this.value=e,this.hasToBeCloned&&hA(this,"value",{get:n!==void 0?n:this.getValue,enumerable:!1,configurable:!1})}getValue(){return this.hasToBeCloned?this.readOnce?this.value_[Me]():(this.readOnce=!0,this.value_):this.value_}},ue=class{filter(e){return new gA(this,e)}map(e,t){return new yA(this,e,t)}chain(e){return new mA(this,e)}},mA=class extends ue{constructor(e,t){super(),this.arb=e,this.chainer=t}generate(e,t){let n=e.clone(),r=this.arb.generate(e,t);return this.valueChainer(r,e,n,t)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?(t.stoppedForOriginal?_.nil():this.arb.shrink(t.originalValue,t.originalContext).map(n=>this.valueChainer(n,t.clonedMrng.clone(),t.clonedMrng,t.originalBias))).join(t.chainedArbitrary.shrink(e,t.chainedContext).map(n=>{let r={...t,chainedContext:n.context,stoppedForOriginal:!0};return new M(n.value_,r)})):_.nil()}valueChainer(e,t,n,r){let i=this.chainer(e.value_),o=i.generate(t,r),s={originalBias:r,originalValue:e.value_,originalContext:e.context,stoppedForOriginal:!1,chainedArbitrary:i,chainedContext:o.context,clonedMrng:n};return new M(o.value_,s)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalBias"in e&&"originalValue"in e&&"originalContext"in e&&"stoppedForOriginal"in e&&"chainedArbitrary"in e&&"chainedContext"in e&&"clonedMrng"in e}},yA=class extends ue{constructor(e,t,n){super(),this.arb=e,this.mapper=t,this.unmapper=n,this.bindValueMapper=r=>this.valueMapper(r)}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n)}canShrinkWithoutContext(e){if(this.unmapper!==void 0)try{let t=this.unmapper(e);return this.arb.canShrinkWithoutContext(t)}catch{return!1}return!1}shrink(e,t){if(this.isSafeContext(t))return this.arb.shrink(t.originalValue,t.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let n=this.unmapper(e);return this.arb.shrink(n,void 0).map(this.bindValueMapper)}return _.nil()}mapperWithCloneIfNeeded(e){let t=e.value,n=this.mapper(t);return e.hasToBeCloned&&(typeof n=="object"&&n!==null||typeof n=="function")&&Object.isExtensible(n)&&!Pn(n)&&Object.defineProperty(n,Me,{get:()=>()=>this.mapperWithCloneIfNeeded(e)[0]}),[n,t]}valueMapper(e){let[t,n]=this.mapperWithCloneIfNeeded(e);return new M(t,{originalValue:n,originalContext:e.context})}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalValue"in e&&"originalContext"in e}},gA=class extends ue{constructor(e,t){super(),this.arb=e,this.refinement=t,this.bindRefinementOnValue=n=>this.refinementOnValue(n)}generate(e,t){for(;;){let n=this.arb.generate(e,t);if(this.refinementOnValue(n))return n}}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)&&this.refinement(e)}shrink(e,t){return this.arb.shrink(e,t).filter(this.bindRefinementOnValue)}refinementOnValue(e){return this.refinement(e.value)}};function og(e){return typeof e=="object"&&e!==null&&"generate"in e&&"shrink"in e&&"canShrinkWithoutContext"in e}function sg(e){if(!og(e))throw new Error("Unexpected value received: not an instance of Arbitrary")}var ag=Function.prototype.apply,eu=Symbol("apply");function bA(e){try{return e.apply}catch{return}}function SA(e,t,n){let r=e;r[eu]=ag;let i=r[eu](t,n);return delete r[eu],i}function G(e,t,n){return bA(e)===ag?e.apply(t,n):SA(e,t,n)}var lg=Array,E=BigInt,wA=BigInt64Array,xA=BigUint64Array,ug=Boolean,ts=Date,P=Error,cg=Float32Array,dg=Float64Array,vA=Int8Array,RA=Int16Array,CA=Int32Array,Vt=Number,_e=String,Qn=Set,kA=Uint8Array,AA=Uint8ClampedArray,EA=Uint16Array,PA=Uint32Array,IA=encodeURIComponent,Ut=Map,qo=Symbol,sm=Array.prototype.forEach,am=Array.prototype.indexOf,lm=Array.prototype.join,um=Array.prototype.map,cm=Array.prototype.flat,dm=Array.prototype.filter,fm=Array.prototype.push,pm=Array.prototype.pop,hm=Array.prototype.splice,mm=Array.prototype.slice,ym=Array.prototype.sort,gm=Array.prototype.every;function MA(e){try{return e.forEach}catch{return}}function TA(e){try{return e.indexOf}catch{return}}function OA(e){try{return e.join}catch{return}}function NA(e){try{return e.map}catch{return}}function $A(e){try{return e.flat}catch{return}}function LA(e){try{return e.filter}catch{return}}function DA(e){try{return e.push}catch{return}}function _A(e){try{return e.pop}catch{return}}function BA(e){try{return e.splice}catch{return}}function FA(e){try{return e.slice}catch{return}}function jA(e){try{return e.sort}catch{return}}function VA(e){try{return e.every}catch{return}}function fg(e,t){return MA(e)===sm?e.forEach(t):G(sm,e,[t])}function jt(e,...t){return TA(e)===am?e.indexOf(...t):G(am,e,t)}function le(e,...t){return OA(e)===lm?e.join(...t):G(lm,e,t)}function V(e,t){return NA(e)===um?e.map(t):G(um,e,[t])}function UA(e,t){return $A(e)===cm?([].flat(),e.flat(t)):G(cm,e,[t])}function WA(e,t){return LA(e)===dm?e.filter(t):G(dm,e,[t])}function I(e,...t){return DA(e)===fm?e.push(...t):G(fm,e,t)}function pg(e){return _A(e)===pm?e.pop():G(pm,e,[])}function hg(e,...t){return BA(e)===hm?e.splice(...t):G(hm,e,t)}function Oe(e,...t){return FA(e)===mm?e.slice(...t):G(mm,e,t)}function mg(e,...t){return jA(e)===ym?e.sort(...t):G(ym,e,t)}function yg(e,...t){return VA(e)===gm?e.every(...t):G(gm,e,t)}var bm=Date.prototype.getTime,Sm=Date.prototype.toISOString;function zA(e){try{return e.getTime}catch{return}}function GA(e){try{return e.toISOString}catch{return}}function ns(e){return zA(e)===bm?e.getTime():G(bm,e,[])}function HA(e){return GA(e)===Sm?e.toISOString():G(Sm,e,[])}var wm=Set.prototype.add,xm=Set.prototype.has;function KA(e){try{return e.add}catch{return}}function qA(e){try{return e.has}catch{return}}function ti(e,t){return KA(e)===wm?e.add(t):G(wm,e,[t])}function rs(e,t){return qA(e)===xm?e.has(t):G(xm,e,[t])}var vm=WeakMap.prototype.set,Rm=WeakMap.prototype.get;function YA(e){try{return e.set}catch{return}}function ZA(e){try{return e.get}catch{return}}function JA(e,t,n){return YA(e)===vm?e.set(t,n):G(vm,e,[t,n])}function XA(e,t){return ZA(e)===Rm?e.get(t):G(Rm,e,[t])}var Cm=Map.prototype.set,km=Map.prototype.get,Am=Map.prototype.has;function QA(e){try{return e.set}catch{return}}function eE(e){try{return e.get}catch{return}}function tE(e){try{return e.has}catch{return}}function dt(e,t,n){return QA(e)===Cm?e.set(t,n):G(Cm,e,[t,n])}function Ze(e,t){return eE(e)===km?e.get(t):G(km,e,[t])}function nE(e,t){return tE(e)===Am?e.has(t):G(Am,e,[t])}var Em=String.prototype.split,Pm=String.prototype.startsWith,Im=String.prototype.endsWith,Mm=String.prototype.substring,Tm=String.prototype.toLowerCase,Om=String.prototype.toUpperCase,Nm=String.prototype.padStart,$m=String.prototype.charCodeAt,Lm=String.prototype.normalize,Dm=String.prototype.replace;function rE(e){try{return e.split}catch{return}}function iE(e){try{return e.startsWith}catch{return}}function oE(e){try{return e.endsWith}catch{return}}function sE(e){try{return e.substring}catch{return}}function aE(e){try{return e.toLowerCase}catch{return}}function lE(e){try{return e.toUpperCase}catch{return}}function uE(e){try{return e.padStart}catch{return}}function cE(e){try{return e.charCodeAt}catch{return}}function dE(e){try{return e.normalize}catch{return}}function fE(e){try{return e.replace}catch{return}}function Be(e,...t){return rE(e)===Em?e.split(...t):G(Em,e,t)}function pE(e,...t){return iE(e)===Pm?e.startsWith(...t):G(Pm,e,t)}function hE(e,...t){return oE(e)===Im?e.endsWith(...t):G(Im,e,t)}function me(e,...t){return sE(e)===Mm?e.substring(...t):G(Mm,e,t)}function ku(e){return aE(e)===Tm?e.toLowerCase():G(Tm,e,[])}function Ju(e){return lE(e)===Om?e.toUpperCase():G(Om,e,[])}function mE(e,...t){return uE(e)===Nm?e.padStart(...t):G(Nm,e,t)}function er(e,t){return cE(e)===$m?e.charCodeAt(t):G($m,e,[t])}function yE(e,t){return dE(e)===Lm?e.normalize(t):G(Lm,e,[t])}function gE(e,t,n){return fE(e)===Dm?e.replace(t,n):G(Dm,e,[t,n])}var _m=Number.prototype.toString;function bE(e){try{return e.toString}catch{return}}function ni(e,...t){return bE(e)===_m?e.toString(...t):G(_m,e,t)}var SE=Object.prototype.hasOwnProperty,wE=Object.prototype.toString;function gg(e,t){return G(SE,e,[t])}function Au(e){return G(wE,e,[])}var xE=Error.prototype.toString;function vE(e){return G(xE,e,[])}var RE=class{constructor(e){this.producer=e}[Symbol.iterator](){return this.it===void 0&&(this.it=this.producer()),this.it}next(){return this.it===void 0&&(this.it=this.producer()),this.it.next()}};function an(e){return new RE(e)}var bg=Array.isArray,CE=Object.defineProperty;function Sg(e,t){return CE(e,Me,{value:()=>{let n=[];for(let r=0;r!==t.length;++r)I(n,t[r].value);return Sg(n,t),n}})}function wg(e){let t=!1,n=[],r=[];for(let i=0;i!==e.length;++i){let o=e[i];t=t||o.hasToBeCloned,I(n,o.value),I(r,o.context)}return t&&Sg(n,e),new M(n,r)}function xg(e,t,n){let r=[],i=bg(n)?n:[];for(let o=0;o!==e.length;++o)I(r,an(()=>e[o].shrink(t[o],i[o]).map(s=>{let a=V(t,(l,u)=>new M(Xn(l),i[u]));return[...Oe(a,0,o),s,...Oe(a,o+1)]}).map(wg)));return _.nil().join(...r)}var kE=class extends ue{constructor(e){super(),this.arbs=e;for(let t=0;t!==e.length;++t){let n=e[t];if(n==null||n.generate===null||n.generate===void 0)throw new Error(`Invalid parameter encountered at index ${t}: expecting an Arbitrary`)}}generate(e,t){let n=[];for(let r=0;r!==this.arbs.length;++r)I(n,this.arbs[r].generate(e,t));return wg(n)}canShrinkWithoutContext(e){if(!bg(e)||e.length!==this.arbs.length)return!1;for(let t=0;t!==this.arbs.length;++t)if(!this.arbs[t].canShrinkWithoutContext(e[t]))return!1;return!0}shrink(e,t){return xg(this.arbs,e,t)}};function B(...e){return new kE(e)}var AE=Math.log;function vg(e){return 2+~~(AE(e+1)*.4342944819032518)}var Xu={};function EE(e){Xu=e}function ft(){return Xu}function PE(){Xu={}}var ri=Symbol("UndefinedContextPlaceholder");function tr(e){return e.context!==void 0?e:e.hasToBeCloned?new M(e.value_,ri,()=>e.value):new M(e.value_,ri)}var Bm=()=>{},IE=class{constructor(e,t){this.arb=e,this.predicate=t;let{asyncBeforeEach:n,asyncAfterEach:r,beforeEach:i,afterEach:o}=ft()||{};if(n!==void 0&&i!==void 0)throw P(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(r!==void 0&&o!==void 0)throw P(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=n||i||Bm,this.afterEachHook=r||o||Bm}isAsync(){return!0}generate(e,t){return tr(this.arb.generate(e,t!==void 0?vg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==ri?e.context:void 0;return this.arb.shrink(e.value_,t).map(tr)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(e){try{let t=await this.predicate(e);return t===void 0||t===!0?null:{error:new P("Property failed by returning false")}}catch(t){return cn.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}},Rg=class extends ue{constructor(e){super(),this.arb=e}generate(e,t){return tr(this.arb.generate(e,t))}canShrinkWithoutContext(e){return!0}shrink(e,t){if(t===void 0&&!this.arb.canShrinkWithoutContext(e))return _.nil();let n=t!==ri?t:void 0;return this.arb.shrink(e,n).map(tr)}};function ME(...e){if(e.length<2)throw new Error("asyncProperty expects at least two parameters");let t=Oe(e,0,e.length-1),n=e[e.length-1];return fg(t,sg),new IE(B(...V(t,r=>new Rg(r))),r=>n(...r))}var Fm=()=>{},Cg=class{constructor(e,t){this.arb=e,this.predicate=t;let{beforeEach:n=Fm,afterEach:r=Fm,asyncBeforeEach:i,asyncAfterEach:o}=ft()||{};if(i!==void 0)throw P(`"asyncBeforeEach" can't be set when running synchronous properties`);if(o!==void 0)throw P(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=n,this.afterEachHook=r}isAsync(){return!1}generate(e,t){return tr(this.arb.generate(e,t!==void 0?vg(t):void 0))}shrink(e){if(e.context===void 0&&!this.arb.canShrinkWithoutContext(e.value_))return _.nil();let t=e.context!==ri?e.context:void 0;return this.arb.shrink(e.value_,t).map(tr)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(e){try{let t=this.predicate(e);return t===void 0||t===!0?null:{error:new P("Property failed by returning false")}}catch(t){return cn.isFailure(t)?t:{error:t}}}beforeEach(e){let t=this.beforeEachHook;return this.beforeEachHook=()=>e(t),this}afterEach(e){let t=this.afterEachHook;return this.afterEachHook=()=>e(t),this}};function TE(...e){if(e.length<2)throw new Error("property expects at least two parameters");let t=Oe(e,0,e.length-1),n=e[e.length-1];return fg(t,sg),new Cg(B(...V(t,r=>new Rg(r))),r=>n(...r))}var OE=(function(e){return e[e.None=0]="None",e[e.Verbose=1]="Verbose",e[e.VeryVerbose=2]="VeryVerbose",e})({});function Eu(e){return"unsafeNext"in e?e.unsafeJump===void 0?{clone:()=>Eu(e),next:()=>e.unsafeNext(),getState:()=>e.getState()}:{clone:()=>Eu(e),next:()=>e.unsafeNext(),jump:()=>e.unsafeJump(),getState:()=>e.getState()}:e}function kg(e){return"jump"in e&&typeof e.jump=="function"?e:{clone:()=>kg(e),next:()=>e.next(),jump:()=>em(e,42),getState:()=>e.getState()}}function as(e){return kg(Eu(e))}var NE=Date.now,$E=Math.min,LE=Math.random,DE=class{constructor(e){let t=e||{};this.seed=_E(t),this.randomType=BE(t),this.numRuns=FE(t),this.verbose=jE(t),this.maxSkipsPerRun=t.maxSkipsPerRun!==void 0?t.maxSkipsPerRun:100,this.timeout=nu(t.timeout),this.skipAllAfterTimeLimit=nu(t.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=nu(t.interruptAfterTimeLimit),this.markInterruptAsFailure=t.markInterruptAsFailure===!0,this.skipEqualValues=t.skipEqualValues===!0,this.ignoreEqualValues=t.ignoreEqualValues===!0,this.logger=t.logger!==void 0?t.logger:n=>{console.log(n)},this.path=t.path!==void 0?t.path:"",this.unbiased=t.unbiased===!0,this.examples=t.examples!==void 0?t.examples:[],this.endOnFailure=t.endOnFailure===!0,this.reporter=t.reporter,this.asyncReporter=t.asyncReporter,this.includeErrorInReport=t.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function tu(e){return t=>as(e(t))}function _E(e){if(e.seed===void 0)return NE()^LE()*4294967296;let t=e.seed|0;return e.seed===t?t:t^(e.seed-t)*4294967296}function BE(e){if(e.randomType===void 0)return Jl;if(typeof e.randomType=="string")switch(e.randomType){case"mersenne":return tu(Zh);case"congruential":case"congruential32":return tu(Kh);case"xorshift128plus":return Jl;case"xoroshiro128plus":return Qh;default:throw new Error(`Invalid random specified: '${e.randomType}'`)}let t=e.randomType(0);if("min"in t&&t.min!==-2147483648)throw new Error(`Invalid random number generator: min must equal -0x80000000, got ${String(t.min)}`);if("max"in t&&t.max!==2147483647)throw new Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(t.max)}`);return t===as(t)?e.randomType:tu(e.randomType)}function FE(e){return e.numRuns!==void 0?e.numRuns:e.num_runs!==void 0?e.num_runs:100}function jE(e){return e.verbose===void 0?0:typeof e.verbose=="boolean"?e.verbose===!0?1:0:e.verbose<=0?0:e.verbose>=2?2:e.verbose|0}function nu(e){if(e!==void 0)return $E(e,2147483647)}function Qu(e){return new DE(e)}function VE(e,t,n){let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i(new cn(!0))},e)})}}var jm=class{constructor(e,t,n,r,i,o){this.property=e,this.getTime=t,this.interruptExecution=r,this.setTimeoutSafe=i,this.clearTimeoutSafe=o,this.skipAfterTime=this.getTime()+n}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=this.skipAfterTime-this.getTime();if(t<=0){let n=new cn(this.interruptExecution);return this.isAsync()?Promise.resolve(n):n}if(this.interruptExecution&&this.isAsync()){let n=VE(t,this.setTimeoutSafe,this.clearTimeoutSafe),r=Promise.race([this.property.run(e),n.promise]);return r.then(n.clear,n.clear),r}return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},UE=(e,t,n)=>{let r=null;return{clear:()=>n(r),promise:new Promise(i=>{r=t(()=>{i({error:new P(`Property timeout: exceeded limit of ${e} milliseconds`)})},e)})}},WE=class{constructor(e,t,n,r){this.property=e,this.timeMs=t,this.setTimeoutSafe=n,this.clearTimeoutSafe=r}isAsync(){return!0}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}async run(e){let t=UE(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),n=Promise.race([this.property.run(e),t.promise]);return n.then(t.clear,t.clear),n}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},Ag=class{constructor(e){this.property=e}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,void 0)}shrink(e){return this.property.shrink(e)}run(e){return this.property.run(e)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Vm=Array.from,Um=typeof Buffer<"u"?Buffer.isBuffer:void 0,qn=JSON.stringify,Wm=Number.isNaN,zE=Object.keys,GE=Object.getOwnPropertySymbols,HE=Object.getOwnPropertyDescriptor,zm=Object.getPrototypeOf,Gm=Number.NEGATIVE_INFINITY,KE=Number.POSITIVE_INFINITY,pt=Symbol.for("fast-check/toStringMethod");function ec(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&pt in e&&typeof e[pt]=="function"}var Wt=Symbol.for("fast-check/asyncToStringMethod");function tc(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&Wt in e&&typeof e[Wt]=="function"}var qE=/^Symbol\((.*)\)$/;function YE(e){if(e.description!==void 0)return e.description;let t=qE.exec(_e(e));return t&&t[1].length?t[1]:null}function Hm(e){switch(e){case 0:return 1/e===Gm?"-0":"0";case Gm:return"Number.NEGATIVE_INFINITY";case KE:return"Number.POSITIVE_INFINITY";default:return e===e?_e(e):"Number.NaN"}}function ZE(e){let t=-1;for(let n in e){let r=Number(n);if(r!==t+1)return!0;t=r}return t+1!==e.length}function Ye(e,t,n){let r=[...t,e];if(typeof e=="object"&&jt(t,e)!==-1)return"[cyclic]";if(tc(e)){let i=n(e);if(i.state==="fulfilled")return i.value}if(ec(e))try{return e[pt]()}catch{}switch(Au(e)){case"[object Array]":{let i=e;if(i.length>=50&&ZE(i)){let s=[];for(let a in i)Wm(Number(a))||I(s,`${a}:${Ye(i[a],r,n)}`);return s.length!==0?`Object.assign(Array(${i.length}),{${le(s,",")}})`:`Array(${i.length})`}let o=le(V(i,s=>Ye(s,r,n)),",");return i.length===0||i.length-1 in i?`[${o}]`:`[${o},]`}case"[object BigInt]":return`${e}n`;case"[object Boolean]":{let i=e==!0?"true":"false";return typeof e=="boolean"?i:`new Boolean(${i})`}case"[object Date]":{let i=e;return Wm(ns(i))?"new Date(NaN)":`new Date(${qn(HA(i))})`}case"[object Map]":return`new Map(${Ye(Array.from(e),r,n)})`;case"[object Null]":return"null";case"[object Number]":return typeof e=="number"?Hm(e):`new Number(${Hm(Number(e))})`;case"[object Object]":{try{let o=e.toString;if(typeof o=="function"&&o!==Object.prototype.toString)return e.toString()}catch{return"[object Object]"}let i=o=>`${o==="__proto__"?'["__proto__"]':typeof o=="symbol"?`[${Ye(o,r,n)}]`:qn(o)}:${Ye(e[o],r,n)}`;return"{"+le([...zm(e)===null?["__proto__:null"]:[],...V(zE(e),i),...V(WA(GE(e),o=>{let s=HE(e,o);return s&&s.enumerable}),i)],",")+"}"}case"[object Set]":return`new Set(${Ye(Array.from(e),r,n)})`;case"[object String]":return typeof e=="string"?qn(e):`new String(${qn(e)})`;case"[object Symbol]":{let i=e;if(qo.keyFor(i)!==void 0)return`Symbol.for(${qn(qo.keyFor(i))})`;let o=YE(i);return o===null?"Symbol()":i===(o.startsWith("Symbol.")&&qo[o.substring(7)])?o:`Symbol(${qn(o)})`}case"[object Promise]":{let i=n(e);switch(i.state){case"fulfilled":return`Promise.resolve(${Ye(i.value,r,n)})`;case"rejected":return`Promise.reject(${Ye(i.value,r,n)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(e instanceof Error)return`new Error(${Ye(e.message,r,n)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof Um=="function"&&Um(e))return`Buffer.from(${e.buffer.detached?"/*detached ArrayBuffer*/":Ye(Vm(e.values()),r,n)})`;let i=zm(e),o=i&&i.constructor&&i.constructor.name;if(typeof o=="string"){let s=e;return s.buffer.detached?`${o}.from(/*detached ArrayBuffer*/)`:`${o}.from(${Ye(Vm(s.values()),r,n)})`}break}}try{return e.toString()}catch{return Au(e)}}function ve(e){return Ye(e,[],()=>({state:"unknown",value:void 0}))}function Eg(e){let t=qo(),n=[],r=new Ut;function i(){let l=null,u=()=>{l!==null&&clearTimeout(l)};return{delay:new Promise(c=>{l=setTimeout(()=>{l=null,c(t)},0)}),cancel:u}}let o={state:"unknown",value:void 0},s=function(u){let c=u;if(r.has(c))return r.get(c);let d=i(),p=Wt in u?Promise.resolve().then(()=>u[Wt]()):u;return p.catch(()=>{}),n.push(Promise.race([p,d.delay]).then(h=>{h===t?r.set(c,{state:"pending",value:void 0}):r.set(c,{state:"fulfilled",value:h}),d.cancel()},h=>{r.set(c,{state:"rejected",value:h}),d.cancel()})),r.set(c,o),o};function a(){let l=Ye(e,[],s);return n.length===0?l:Promise.all(n.splice(0)).then(a)}return a()}async function nc(e){return Promise.resolve(Eg(e))}function Km(e){return e===null?new cn:e}function JE(...e){return e[1]?e[0].then(Km):Km(e[0])}function XE(e,t){return JE(e,t)}var qm=class{constructor(e,t){this.property=e,this.skipRuns=t,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(e,t){return this.property.generate(e,t)}shrink(e){return this.property.shrink(e)}run(e){let t=ve(e);if(this.coveredCases.has(t)){let r=this.coveredCases.get(t);return this.skipRuns?XE(r,this.property.isAsync()):r}let n=this.property.run(e);return this.coveredCases.set(t,n),n}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},Ym=Date.now,ru=setTimeout,iu=clearTimeout;function QE(e,t){let n=e;return e.isAsync()&&t.timeout!==void 0&&(n=new WE(n,t.timeout,ru,iu)),t.unbiased&&(n=new Ag(n)),t.skipAllAfterTimeLimit!==void 0&&(n=new jm(n,Ym,t.skipAllAfterTimeLimit,!1,ru,iu)),t.interruptAfterTimeLimit!==void 0&&(n=new jm(n,Ym,t.interruptAfterTimeLimit,!0,ru,iu)),t.skipEqualValues&&(n=new qm(n,!0)),t.ignoreEqualValues&&(n=new qm(n,!1)),n}var eP=(function(e){return e[e.Success=0]="Success",e[e.Skipped=-1]="Skipped",e[e.Failure=1]="Failure",e})({}),tP=class Pg{constructor(t,n){this.verbosity=t,this.interruptedAsFailure=n,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(t,n){let r={status:t,value:n,children:[]};return this.currentLevelExecutionTrees.push(r),r}fail(t,n,r){if(this.verbosity>=1){let i=this.appendExecutionTree(1,t);this.currentLevelExecutionTrees=i.children}this.pathToFailure===void 0?this.pathToFailure=`${n}`:this.pathToFailure+=`:${n}`,this.value=t,this.failure=r}skip(t){this.verbosity>=2&&this.appendExecutionTree(-1,t),this.pathToFailure===void 0&&++this.numSkips}success(t){this.verbosity>=2&&this.appendExecutionTree(0,t),this.pathToFailure===void 0&&++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+Be(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?Be(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let t=[],n=this.rootExecutionTrees;for(;n.length>0&&n[n.length-1].status===1;){let r=n[n.length-1];t.push(r.value),n=r.children}return t}static mergePaths(t,n){if(t.length===0)return n;let r=t.split(":"),i=n.split(":"),o=+r[r.length-1]+ +i[0];return[...r.slice(0,r.length-1),`${o}`,...i.slice(1)].join(":")}toRunDetails(t,n,r,i){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:t,counterexample:this.value,counterexamplePath:Pg.mergePaths(n,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()};let o=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>r||this.interrupted&&o,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:t,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:i.toParameters()}}},Ig=class{constructor(e,t,n,r){this.sourceValues=e,this.shrink=t,this.runExecution=new tP(n,r),this.currentIdx=-1,this.nextValues=e}[Symbol.iterator](){return this}next(){let e=this.nextValues.next();return e.done||this.runExecution.interrupted?{done:!0,value:void 0}:(this.currentValue=e.value,++this.currentIdx,{done:!1,value:e.value.value_})}handleResult(e){e!==null&&typeof e=="object"&&!cn.isFailure(e)?(this.runExecution.fail(this.currentValue.value_,this.currentIdx,e),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue)):e!==null?e.interruptExecution?this.runExecution.interrupt():(this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne()):this.runExecution.success(this.currentValue.value_)}},nP=class{constructor(e,t,n){this.initialValues=e,this.maxInitialIterations=t,this.remainingSkips=n}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let e=this.initialValues.next();if(!e.done)return{value:e.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},rP=-2147483648,iP=2147483647,oP=Math.pow(2,27),sP=Math.pow(2,-53),rc=class Mg{constructor(t){this.internalRng=as(t.clone())}clone(){return new Mg(this.internalRng)}next(t){return jo(this.internalRng,0,(1<<t)-1)}nextBoolean(){return jo(this.internalRng,0,1)===1}nextInt(t,n){return jo(this.internalRng,t===void 0?rP:t,n===void 0?iP:n)}nextBigInt(t,n){return rm(this.internalRng,t,n)}nextDouble(){let t=this.next(26),n=this.next(27);return(t*oP+n)*sP}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState=="function")return this.internalRng.getState()}};function aP(e,t,n){return t.jump(),e.generate(new rc(t),n)}function*Tg(e,t,n,r){for(let i=0;i!==r.length;++i)yield new M(r[i],void 0);for(let i=0,o=n(t);;++i)yield aP(e,o,i)}function lP(e,t,n){return()=>e.generate(new rc(t),n)}function*Og(e,t,n,r){yield*V(r,s=>()=>new M(s,void 0));let i=0,o=as(n(t));for(;;)o.jump(),yield lP(e,o,i++)}function Zm(e){return e()}function Ng(e,t,n){let r=t,i=e.split(":").map(s=>+s);if(i.length===0)return r.map(Zm);if(!i.every(s=>!Number.isNaN(s)))throw new Error(`Unable to replay, got invalid path=${e}`);let o=r.drop(i[0]).map(Zm);for(let s of i.slice(1)){let a=o.getNthOrLast(0);if(a===null)throw new Error(`Unable to replay, got wrong path=${e}`);o=n(a).drop(s)}return o}var uP=Object.assign;function cP(e){return e.length===1?`Hint: ${e[0]}`:e.map((t,n)=>`Hint (${n+1}): ${t}`).join(`
21
+ `)}function dP(e,t){return`Encountered failures were:
22
+ - ${e.map(t).join(`
23
+ - `)}`}function ic(e,t){let n=[],r=[];for(let i=e.length-1;i>=0;--i)r.push({depth:1,tree:e[i]});for(;r.length!==0;){let i=r.pop(),o=i.tree,s=i.depth,a=o.status===0?"\x1B[32m\u221A\x1B[0m":o.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",l=s!==0?". ".repeat(s-1):"";n.push(`${l}${a} ${t(o.value)}`);for(let u=o.children.length-1;u>=0;--u)r.push({depth:s+1,tree:o.children[u]})}return`Execution summary:
24
+ ${n.join(`
25
+ `)}`}function fP(e,t){let n=`Failed to run property, too many pre-condition failures encountered
26
+ { seed: ${e.seed} }
27
+
28
+ Ran ${e.numRuns} time(s)
29
+ Skipped ${e.numSkips} time(s)`,r=null,i=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];return e.verbose>=2?r=ic(e.executionSummary,t):I(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function pP(e){if(e instanceof P&&e.stack!==void 0)return e.stack;try{return _e(e)}catch{}if(e instanceof P)try{return vE(e)}catch{}if(e!==null&&typeof e=="object")try{return Au(e)}catch{}return"Failed to serialize errorInstance"}function hP(e,t){let n=e.runConfiguration.includeErrorInReport?`
30
+ Got ${gE(pP(e.errorInstance),/^Error: /,"error: ")}`:"",r=`Property failed after ${e.numRuns} tests
31
+ { seed: ${e.seed}, path: "${e.counterexamplePath}", endOnFailure: true }
32
+ Counterexample: ${t(e.counterexample)}
33
+ Shrunk ${e.numShrinks} time(s)${n}`,i=null,o=[];return e.verbose>=2?i=ic(e.executionSummary,t):e.verbose===1?i=dP(e.failures,t):I(o,"Enable verbose mode in order to have the list of all failing values encountered during the run"),{message:r,details:i,hints:o}}function mP(e,t){let n=`Property interrupted after ${e.numRuns} tests
34
+ { seed: ${e.seed} }`,r=null,i=[];return e.verbose>=2?r=ic(e.executionSummary,t):I(i,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status"),{message:n,details:r,hints:i}}function Pu(e,t){if(!e.failed)return;let{message:n,details:r,hints:i}=e.counterexamplePath===null?e.interrupted?mP(e,t):fP(e,t):hP(e,t),o=n;return r!==null&&(o+=`
35
+
36
+ ${r}`),i.length>0&&(o+=`
37
+
38
+ ${cP(i)}`),o}function $g(e){return Pu(e,ve)}async function Lg(e){let t=[];function n(s){let a=Eg(s);return typeof a=="string"?a:(t.push(Promise.all([s,a])),"\u2026")}let r=Pu(e,n);if(t.length===0)return r;let i=new Ut(await Promise.all(t));function o(s){let a=Ze(i,s);return a!==void 0?a:ve(s)}return Pu(e,o)}function Dg(e,t){if(t.runConfiguration.includeErrorInReport)throw new P(e);let n=new P(e,{cause:t.errorInstance});return"cause"in n||uP(n,{cause:t.errorInstance}),n}function yP(e){if(e.failed)throw Dg($g(e),e)}async function gP(e){if(e.failed)throw Dg(await Lg(e),e)}function bP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):yP(e)}async function SP(e){return e.runConfiguration.asyncReporter?e.runConfiguration.asyncReporter(e):e.runConfiguration.reporter?e.runConfiguration.reporter(e):gP(e)}function wP(e,t,n,r,i){let o=new Ig(n,t,r,i);for(let s of o){e.runBeforeEach();let a=e.run(s);e.runAfterEach(),o.handleResult(a)}return o.runExecution}async function xP(e,t,n,r,i){let o=new Ig(n,t,r,i);for(let s of o){await e.runBeforeEach();let a=await e.run(s);await e.runAfterEach(),o.handleResult(a)}return o.runExecution}function _g(e,t){if(e==null||e.generate===null||e.generate===void 0)throw new Error("Invalid property encountered, please use a valid property");if(e.run===null||e.run===void 0)throw new Error("Invalid property encountered, please use a valid property not an arbitrary");let n=Qu({...ft(),...t});if(n.reporter!==void 0&&n.asyncReporter!==void 0)throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(n.asyncReporter!==void 0&&!e.isAsync())throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let r=QE(e,n),i=n.path.length===0||n.path.indexOf(":")===-1?n.numRuns:-1,o=n.numRuns*n.maxSkipsPerRun,s=(...u)=>r.shrink(...u),a=new nP(n.path.length===0?Tg(r,n.seed,n.randomType,n.examples):Ng(n.path,ln(Og(r,n.seed,n.randomType,n.examples)),s),i,o),l=n.endOnFailure?_.nil:s;return r.isAsync()?xP(r,l,a,n.verbose,n.markInterruptAsFailure).then(u=>u.toRunDetails(n.seed,n.path,o,n)):wP(r,l,a,n.verbose,n.markInterruptAsFailure).toRunDetails(n.seed,n.path,o,n)}function vP(e,t){let n=_g(e,t);if(e.isAsync())return n.then(SP);bP(n)}function RP(e,t){let n=Object.prototype.hasOwnProperty.call(e,"isAsync")?e:new Cg(e,()=>!0);return t.unbiased===!0?new Ag(n):n}function Bg(e,t){let n=Qu(typeof t=="number"?{...ft(),numRuns:t}:{...ft(),...t}),r=RP(e,n),i=r.shrink.bind(r);return(n.path.length===0?ln(Tg(r,n.seed,n.randomType,n.examples)):Ng(n.path,ln(Og(r,n.seed,n.randomType,n.examples)),i)).take(n.numRuns).map(o=>o.value_)}function CP(e,t){return[...Bg(e,t)]}function kP(e){return(Math.round(e*100)/100).toFixed(2)}function AP(e,t,n){let r=Qu(typeof n=="number"?{...ft(),numRuns:n}:{...ft(),...n}),i={};for(let l of Bg(e,n)){let u=t(l),c=Array.isArray(u)?u:[u];for(let d of c)i[d]=(i[d]||0)+1}let o=Object.entries(i).sort((l,u)=>u[1]-l[1]).map(l=>[l[0],`${kP(l[1]*100/r.numRuns)}%`]),s=o.map(l=>l[0].length).reduce((l,u)=>Math.max(l,u),0),a=o.map(l=>l[1].length).reduce((l,u)=>Math.max(l,u),0);for(let l of o)r.logger(`${l[0].padEnd(s,".")}..${l[1].padStart(a,".")}`)}var EP=Object.assign;function Iu(e,t,n,r){let i=n(),o=e.clone(),s={mrng:e.clone(),biasFactor:t,history:[]},a=u=>{let c=i[s.history.length];if(c!==void 0&&c.arb===u){let p=c.value;return I(s.history,{arb:u,value:p,context:c.context,mrng:c.mrng}),o=c.mrng.clone(),p}let d=u.generate(o,t);return I(s.history,{arb:u,value:d.value_,context:d.context,mrng:o.clone()}),d.value},l=(u,...c)=>a(r(u,c));return new M(EP(l,{values(){return V(s.history,u=>u.value)},[Me](){return Iu(e,t,n,r).value},[pt](){return ve(V(s.history,u=>u.value))}}),s)}var ou=Array.isArray,Jm=Object.keys,PP=Object.is;function IP(e){let t=new Ut;return function(r,i){let o=Ze(t,r);if(o===void 0){let l=r(...i);return dt(t,r,[{args:i,value:l}]),l}let s=o;for(let l of s)if(e(i,l.args))return l.value;let a=r(...i);return I(s,{args:i,value:a}),a}}function Fg(e,t){if(e!==null&&typeof e=="object"&&t!==null&&typeof t=="object"){if(ou(e)){if(!ou(t)||e.length!==t.length)return!1}else if(ou(t))return!1;if(Jm(e).length!==Jm(t).length)return!1;for(let n in e)if(!(n in t)||!Fg(e[n],t[n]))return!1;return!0}else return PP(e,t)}var MP=class extends ue{constructor(...e){super(...e),this.arbitraryCache=IP(Fg)}generate(e,t){return Iu(e,t,()=>[],this.arbitraryCache)}canShrinkWithoutContext(e){return!1}shrink(e,t){if(t===void 0)return _.nil();let n=t,r=n.mrng,i=n.biasFactor,o=n.history;return xg(o.map(s=>s.arb),o.map(s=>s.value),o.map(s=>s.context)).map(s=>{function a(){let l=s.value,u=s.context;return V(o,(c,d)=>({arb:c.arb,value:l[d],context:u[d],mrng:c.mrng}))}return Iu(r,i,a,this.arbitraryCache)})}};function TP(){return new MP}var OP=Math.floor,Xm=Math.log;function NP(e){return OP(Xm(e)/Xm(2))}function $P(e){return e===E(0)?E(0):E(_e(e).length)}function jg(e,t,n){if(e===t)return[{min:e,max:t}];if(e<0&&t>0){let s=n(-e),a=n(t);return[{min:-s,max:a},{min:t-a,max:t},{min:e,max:e+s}]}let r=n(t-e),i={min:e,max:e+r},o={min:t-r,max:t};return e<0?[o,i]:[i,o]}var LP=Math.ceil,DP=Math.floor;function Qm(e){return DP(e/2)}function ey(e){return LP(e/2)}function ty(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Qm(r);for(let l=a;l>0;l=Qm(l)){let u=l===r?t:e-l;yield new M(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:ey(r);for(let l=a;l<0;l=ey(l)){let u=l===r?t:e-l;yield new M(u,s),s=u}}return r>0?ln(i()):ln(o())}var ny=Math.sign,_P=Number.isInteger,BP=Object.is,nr=class Vg extends ue{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new M(t.nextInt(r.min,r.max),void 0)}canShrinkWithoutContext(t){return typeof t=="number"&&_P(t)&&!BP(t,-0)&&this.min<=t&&t<=this.max}shrink(t,n){return Vg.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new M(n,void 0)):ty(t,n,!1):ty(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?0:this.min<0?this.max:this.min}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=jg(this.min,this.max,NP);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}isLastChanceTry(t,n){return t>0?t===n+1&&t>this.min:t<0?t===n-1&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="number")throw new Error("Invalid context type passed to IntegerArbitrary (#1)");if(n!==0&&ny(t)!==ny(n))throw new Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},ry=Number.isInteger;function FP(e){return{min:e.min!==void 0?e.min:-2147483648,max:e.max!==void 0?e.max:2147483647}}function ee(e={}){let t=FP(e);if(t.min>t.max)throw new Error("fc.integer maximum value should be equal or greater than the minimum one");if(!ry(t.min))throw new Error("fc.integer minimum value should be an integer");if(!ry(t.max))throw new Error("fc.integer maximum value should be an integer");return new nr(t.min,t.max)}var iy=new Map;function oc(e){if(e===void 0)return{depth:0};if(typeof e!="string")return e;let t=Ze(iy,e);if(t!==void 0)return t;let n={depth:0};return dt(iy,e,n),n}function sc(){return{depth:0}}var jP=class{constructor(e,t,n){this.arb=e,this.mrng=t,this.biasFactor=n}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},VP=Math.min,UP=Math.max,WP=class{constructor(e,t,n,r){this.arb=e,this.mrng=t,this.slices=n,this.biasFactor=r,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(e){if(e!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let t=[];for(let n=0;n!==this.slices.length;++n)this.slices[n].length===e&&I(t,n);if(t.length===0)return;this.activeSliceIndex=t[this.mrng.nextInt(0,t.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=e-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new M(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let e=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=e.length-1,new M(e[0],void 0);let t=this.mrng.nextInt(0,e.length-1),n=this.mrng.nextInt(0,e.length-1);return this.nextIndexInSlice=VP(t,n),this.lastIndexInSlice=UP(t,n),new M(e[this.nextIndexInSlice++],void 0)}};function oy(e,t,n,r){return r===void 0||n.length===0||t.nextInt(1,r)!==1?new jP(e,t,r):new WP(e,t,n,r)}var zP=Math.floor,sy=Math.log,ay=Math.max,GP=Array.isArray;function su(e,t){return e===t?e:e+zP(sy(t-e)/sy(2))}var Ug=class Wg extends ue{constructor(t,n,r,i,o,s,a){super(),this.arb=t,this.minLength=n,this.maxGeneratedLength=r,this.maxLength=i,this.setBuilder=s,this.customSlices=a,this.lengthArb=ee({min:n,max:r}),this.depthContext=oc(o)}preFilter(t){if(this.setBuilder===void 0)return t;let n=this.setBuilder();for(let r=0;r!==t.length;++r)n.tryAdd(t[r]);return n.getData()}static makeItCloneable(t,n){return t[Me]=()=>{let r=[];for(let i=0;i!==n.length;++i)I(r,n[i].value);return this.makeItCloneable(r,n),r},t}generateNItemsNoDuplicates(t,n,r,i){let o=0,s=t(),a=oy(this.arb,r,this.customSlices,i);for(;s.size()<n&&o<this.maxGeneratedLength;){let l=a.next();s.tryAdd(l)?o=0:o+=1}return s.getData()}safeGenerateNItemsNoDuplicates(t,n,r,i){let o=ay(0,n-su(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=o;try{return this.generateNItemsNoDuplicates(t,n,r,i)}finally{this.depthContext.depth-=o}}generateNItems(t,n,r){let i=[],o=oy(this.arb,n,this.customSlices,r);o.attemptExact(t);for(let s=0;s!==t;++s)I(i,o.next());return i}safeGenerateNItems(t,n,r){let i=ay(0,t-su(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=i;try{return this.generateNItems(t,n,r)}finally{this.depthContext.depth-=i}}wrapper(t,n,r,i){let o=n?this.preFilter(t):t,s=!1,a=[],l=[];for(let u=0;u!==o.length;++u){let c=o[u];s=s||c.hasToBeCloned,I(a,c.value),I(l,c.context)}return s&&Wg.makeItCloneable(a,o),new M(a,{shrunkOnce:n,lengthContext:t.length===o.length&&r!==void 0?r:void 0,itemsContexts:l,startIndex:i})}generate(t,n){let r=this.applyBias(t,n),i=r.size,o=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,i,t,r.biasFactorItems):this.safeGenerateNItems(i,t,r.biasFactorItems);return this.wrapper(o,!1,void 0,0)}applyBias(t,n){if(n===void 0)return{size:this.lengthArb.generate(t,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};if(t.nextInt(1,n)!==1)return{size:this.lengthArb.generate(t,void 0).value};if(t.nextInt(1,n)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(t,void 0).value,biasFactorItems:n};let r=su(this.minLength,this.maxGeneratedLength);return{size:ee({min:this.minLength,max:r}).generate(t,void 0).value,biasFactorItems:n}}canShrinkWithoutContext(t){if(!GP(t)||this.minLength>t.length||t.length>this.maxLength)return!1;for(let n=0;n!==t.length;++n)if(!(n in t)||!this.arb.canShrinkWithoutContext(t[n]))return!1;return this.preFilter(V(t,n=>new M(n,void 0))).length===t.length}shrinkItemByItem(t,n,r){let i=[];for(let o=n.startIndex;o<r;++o)I(i,an(()=>this.arb.shrink(t[o],n.itemsContexts[o]).map(s=>{let a=V(Oe(t,0,o),(u,c)=>new M(Xn(u),n.itemsContexts[c])),l=V(Oe(t,o+1),(u,c)=>new M(Xn(u),n.itemsContexts[c+o+1]));return[[...a,s,...l],void 0,o]})));return _.nil().join(...i)}shrinkImpl(t,n){if(t.length===0)return _.nil();let r=n!==void 0?n:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(t.length,r.lengthContext).drop(r.shrunkOnce&&r.lengthContext===void 0&&t.length>this.minLength+1?1:0).map(i=>{let o=t.length-i.value;return[V(Oe(t,o),(s,a)=>new M(Xn(s),r.itemsContexts[a+o])),i.context,0]}).join(an(()=>t.length>this.minLength?this.shrinkItemByItem(t,r,1):this.shrinkItemByItem(t,r,t.length))).join(t.length>this.minLength?an(()=>{let i={shrunkOnce:!1,lengthContext:void 0,itemsContexts:Oe(r.itemsContexts,1),startIndex:0};return this.shrinkImpl(Oe(t,1),i).filter(o=>this.minLength<=o[0].length+1).map(o=>[[new M(Xn(t[0]),r.itemsContexts[0]),...o[0]],void 0,0])}):_.nil())}shrink(t,n){return this.shrinkImpl(t,n).map(r=>this.wrapper(r[0],!0,r[1],r[2]))}},HP=Math.floor,KP=Math.min,In=2147483647,Yn=["xsmall","small","medium","large","xlarge"],qP=["-4","-3","-2","-1","=","+1","+2","+3","+4"],ac="small";function YP(e,t){switch(t){case"xsmall":return HP(1.1*e)+1;case"small":return 2*e+10;case"medium":return 11*e+100;case"large":return 101*e+1e3;case"xlarge":return 1001*e+1e4;default:throw new Error(`Unable to compute lengths based on received size: ${t}`)}}function si(e,t){let n=jt(qP,e);if(n===-1)return e;let r=jt(Yn,t);if(r===-1)throw new Error(`Unable to offset size based on the unknown defaulted one: ${t}`);let i=r+n-4;return i<0?Yn[0]:i>=Yn.length?Yn[Yn.length-1]:Yn[i]}function ii(e,t,n,r){let{baseSize:i=ac,defaultSizeToMaxWhenMaxSpecified:o}=ft()||{},s=e!==void 0?e:r&&o?"max":i;return s==="max"?n:KP(YP(t,si(s,i)),n)}function ZP(e,t){if(typeof e=="number")return 1/e;let{baseSize:n=ac,defaultSizeToMaxWhenMaxSpecified:r}=ft()||{},i=e!==void 0?e:t&&r?"max":n;if(i==="max")return 0;switch(si(i,n)){case"xsmall":return 1;case"small":return .5;case"medium":return .25;case"large":return .125;case"xlarge":return .0625}}function lc(e){let{baseSize:t=ac}=ft()||{};return e===void 0?t:si(e,t)}function se(e,t={}){let n=t.size,r=t.minLength||0,i=t.maxLength,o=t.depthIdentifier,s=i!==void 0?i:In;return new Ug(e,r,ii(n,r,s,i!==void 0),s,o,void 0,t.experimentalCustomSlices||[])}function Vo(e){return e/E(2)}function ly(e,t,n){let r=e-t;function*i(){let s=n?void 0:t,a=n?r:Vo(r);for(let l=a;l>0;l=Vo(l)){let u=e-l;yield new M(u,s),s=u}}function*o(){let s=n?void 0:t,a=n?r:Vo(r);for(let l=a;l<0;l=Vo(l)){let u=e-l;yield new M(u,s),s=u}}return r>0?ln(i()):ln(o())}var JP=class zg extends ue{constructor(t,n){super(),this.min=t,this.max=n}generate(t,n){let r=this.computeGenerateRange(t,n);return new M(t.nextBigInt(r.min,r.max),void 0)}computeGenerateRange(t,n){if(n===void 0||t.nextInt(1,n)!==1)return{min:this.min,max:this.max};let r=jg(this.min,this.max,$P);if(r.length===1)return r[0];let i=t.nextInt(-2*(r.length-1),r.length-2);return i<0?r[0]:r[i+1]}canShrinkWithoutContext(t){return typeof t=="bigint"&&this.min<=t&&t<=this.max}shrink(t,n){return zg.isValidContext(t,n)?this.isLastChanceTry(t,n)?_.of(new M(n,void 0)):ly(t,n,!1):ly(t,this.defaultTarget(),!0)}defaultTarget(){return this.min<=0&&this.max>=0?E(0):this.min<0?this.max:this.min}isLastChanceTry(t,n){return t>0?t===n+E(1)&&t>this.min:t<0?t===n-E(1)&&t<this.max:!1}static isValidContext(t,n){if(n===void 0)return!1;if(typeof n!="bigint")throw new Error("Invalid context type passed to BigIntArbitrary (#1)");let r=t>0&&n<0||t<0&&n>0;if(n!==E(0)&&r)throw new Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function XP(e){let n=E(-1)<<E(255),r=(E(1)<<E(255))-E(1),i=e.min,o=e.max;return{min:i!==void 0?i:n-(o!==void 0&&o<E(0)?o*o:E(0)),max:o!==void 0?o:r+(i!==void 0&&i>E(0)?i*i:E(0))}}function QP(e){return e[0]===void 0?{}:e[1]===void 0?e[0]:{min:e[0],max:e[1]}}function un(...e){let t=XP(QP(e));if(t.min>t.max)throw new Error("fc.bigInt expects max to be greater than or equal to min");return new JP(t.min,t.max)}var eI=Object.getPrototypeOf,Jr=class extends ue{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,void 0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.arb.shrink(e,t)}};function is(e){return eI(e)===Jr.prototype&&e.generate===Jr.prototype.generate&&e.canShrinkWithoutContext===Jr.prototype.canShrinkWithoutContext&&e.shrink===Jr.prototype.shrink?e:new Jr(e)}function tI(e){return e===1}function nI(e){if(typeof e!="boolean")throw new Error("Unsupported input type");return e===!0?1:0}function ai(){return is(ee({min:0,max:1}).map(tI,nI))}var ei=Object.is,rI=class{constructor(e){this.values=e,this.fastValues=new Qn(this.values);let t=!1,n=!1;if(rs(this.fastValues,0))for(let r=0;r!==this.values.length;++r){let i=this.values[r];t=t||ei(i,-0),n=n||ei(i,0)}this.hasMinusZero=t,this.hasPlusZero=n}has(e){return e===0?ei(e,0)?this.hasPlusZero:this.hasMinusZero:rs(this.fastValues,e)}},Gg=class extends ue{constructor(e){super(),this.values=e}generate(e,t){let n=this.values.length===1?0:e.nextInt(0,this.values.length-1),r=this.values[n];return Pn(r)?new M(r,n,()=>r[Me]()):new M(r,n)}canShrinkWithoutContext(e){return this.values.length===1?ei(this.values[0],e):(this.fastValues===void 0&&(this.fastValues=new rI(this.values)),this.fastValues.has(e))}shrink(e,t){return t===0||ei(e,this.values[0])?_.nil():_.of(new M(this.values[0],0))}};function At(...e){if(e.length===0)throw new Error("fc.constantFrom expects at least one parameter");return new Gg(e)}function iI(e){return!e||!e.withBigInt?At(!1,null,void 0,0,"",NaN):At(!1,null,void 0,0,"",NaN,E(0))}function xe(e){return new Gg([e])}var oI=class Hg{constructor(){this.receivedLogs=[]}log(t){this.receivedLogs.push(t)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[Me](){return new Hg}};function sI(){return xe(new oI)}var aI=NaN,lI=Number.isNaN;function Kg(e){return new ts(e)}function qg(e){if(!(e instanceof ts)||e.constructor!==ts)throw new P("Not a valid value for date unmapper");return ns(e)}function uI(e){return t=>t===e?new ts(aI):Kg(t)}function cI(e){return t=>{let n=qg(t);return lI(n)?e:n}}var uy=Number.isNaN;function Yg(e={}){let t=e.min!==void 0?ns(e.min):-864e13,n=e.max!==void 0?ns(e.max):864e13,r=e.noInvalidDate;if(uy(t))throw new Error("fc.date min must be valid instance of Date");if(uy(n))throw new Error("fc.date max must be valid instance of Date");if(t>n)throw new Error("fc.date max must be greater or equal to min");if(r)return ee({min:t,max:n}).map(Kg,qg);let i=n+1;return ee({min:t,max:n+1}).map(uI(i),cI(i))}var dI=class extends ue{constructor(e,t){super(),this.startArb=e,this.chainer=t}generate(e,t){let n=[],r=e.clone(),i=this.startArb.generate(e,t);for(n.push({arbitrary:this.startArb,value:i.value_,context:i.context,clonedMrng:r});;){let s=this.chainer(i.value_);if(s===void 0)break;let a=e.clone();i=s.generate(e,t),n.push({arbitrary:s,value:i.value_,context:i.context,clonedMrng:a})}let o={biasFactor:t,entries:n,currentShrinkLevel:0};return new M(i.value_,o)}canShrinkWithoutContext(e){return!1}shrink(e,t){return this.isSafeContext(t)?new _(this.shrinkIterator(t)):_.nil()}*shrinkIterator(e){let{entries:t,currentShrinkLevel:n,biasFactor:r}=e;for(let i=n;i<t.length;++i){let o=t[i],s=o.arbitrary.shrink(o.value,o.context);for(let a of s){let l=t.slice(0,i);l.push({arbitrary:o.arbitrary,value:a.value_,context:a.context,clonedMrng:o.clonedMrng});let u=a,c=o.clonedMrng.clone();for(;;){let h=this.chainer(u.value_);if(h===void 0)break;let f=c.clone(),m=h.generate(c,r);l.push({arbitrary:h,value:m.value_,context:m.context,clonedMrng:f}),u=m}let d=l[l.length-1],p={biasFactor:r,entries:l,currentShrinkLevel:i};yield new M(d.value,p)}}}isSafeContext(e){return e!=null&&typeof e=="object"&&"biasFactor"in e&&"entries"in e&&"currentShrinkLevel"in e}};function fI(e,t){return new dI(e,t)}var pI=Symbol.iterator,hI=Array.isArray,mI=Object.is,yI=class Zg extends ue{constructor(t,n){super(),this.arb=t,this.numValues=n}generate(t,n){let r=[];if(this.numValues<=0)return this.wrapper(r);for(let i=0;i!==this.numValues-1;++i)I(r,this.arb.generate(t.clone(),n));return I(r,this.arb.generate(t,n)),this.wrapper(r)}canShrinkWithoutContext(t){if(!hI(t)||t.length!==this.numValues)return!1;if(t.length===0)return!0;for(let n=1;n<t.length;++n)if(!mI(t[0],t[n]))return!1;return this.arb.canShrinkWithoutContext(t[0])}shrink(t,n){return t.length===0?_.nil():new _(this.shrinkImpl(t,n!==void 0?n:[])).map(r=>this.wrapper(r))}*shrinkImpl(t,n){let r=V(t,(o,s)=>this.arb.shrink(o,n[s])[pI]()),i=V(r,o=>o.next());for(;!i[0].done;)yield V(i,o=>o.value),i=V(r,o=>o.next())}static makeItCloneable(t,n){return t[Me]=()=>{let r=[];for(let i=0;i!==n.length;++i)I(r,n[i].value);return this.makeItCloneable(r,n),r},t}wrapper(t){let n=!1,r=[],i=[];for(let o=0;o!==t.length;++o){let s=t[o];n=n||s.hasToBeCloned,I(r,s.value),I(i,s.context)}return n&&Zg.makeItCloneable(r,t),new M(r,i)}};function gI(e,t){return new yI(e,t)}var cy=class{constructor(e){this.isEqual=e,this.data=[]}tryAdd(e){for(let t=0;t!==this.data.length;++t)if(this.isEqual(this.data[t],e))return!1;return I(this.data,e),!0}size(){return this.data.length}getData(){return this.data}},bI=Number.isNaN,SI=class{constructor(e){this.selector=e,this.selectedItemsExceptNaN=new Qn,this.data=[]}tryAdd(e){let t=this.selector(e);if(bI(t))return I(this.data,e),!0;let n=this.selectedItemsExceptNaN.size;return ti(this.selectedItemsExceptNaN,t),n!==this.selectedItemsExceptNaN.size?(I(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},wI=Object.is,xI=class{constructor(e){this.selector=e,this.selectedItemsExceptMinusZero=new Qn,this.data=[],this.hasMinusZero=!1}tryAdd(e){let t=this.selector(e);if(wI(t,-0))return this.hasMinusZero?!1:(I(this.data,e),this.hasMinusZero=!0,!0);let n=this.selectedItemsExceptMinusZero.size;return ti(this.selectedItemsExceptMinusZero,t),n!==this.selectedItemsExceptMinusZero.size?(I(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}},vI=class{constructor(e){this.selector=e,this.selectedItems=new Qn,this.data=[]}tryAdd(e){let t=this.selector(e),n=this.selectedItems.size;return ti(this.selectedItems,t),n!==this.selectedItems.size?(I(this.data,e),!0):!1}size(){return this.data.length}getData(){return this.data}};function RI(e){if(typeof e.comparator=="function"){if(e.selector===void 0){let a=e.comparator,l=(u,c)=>a(u.value_,c.value_);return()=>new cy(l)}let r=e.comparator,i=e.selector,o=a=>i(a.value_),s=(a,l)=>r(o(a),o(l));return()=>new cy(s)}let t=e.selector||(r=>r),n=r=>t(r.value_);switch(e.comparator){case"IsStrictlyEqual":return()=>new SI(n);case"SameValueZero":return()=>new vI(n);case"SameValue":case void 0:return()=>new xI(n)}}function Mn(e,t={}){let n=t.minLength!==void 0?t.minLength:0,r=t.maxLength!==void 0?t.maxLength:In,i=ii(t.size,n,r,t.maxLength!==void 0),o=t.depthIdentifier,s=new Ug(e,n,i,r,o,RI(t),[]);return n===0?s:s.filter(a=>a.length>=n)}var CI=Object.create,kI=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,dy=Object.getPrototypeOf,EI=Object.prototype,PI=Reflect.ownKeys;function II(e){let t=e[1]?CI(null):{};for(let n of e[0])kI(t,n[0],{enumerable:!0,configurable:!0,writable:!0,value:n[1]});return t}function MI(e){return e!==void 0&&!!e.configurable&&!!e.enumerable&&!!e.writable&&e.get===void 0&&e.set===void 0}function TI(e){if(typeof e!="object"||e===null)throw new P("Incompatible instance received: should be a non-null object");let t=dy(e)===null,n=dy(e)===EI;if(!t&&!n)throw new P("Incompatible instance received: should be of exact type Object");let r=V(PI(e),i=>[i,AI(e,i)]);if(!yg(r,([,i])=>MI(i)))throw new P("Incompatible instance received: should contain only c/e/w properties without get/set");return[V(r,([i,o])=>[i,o.value]),t]}function OI(e){return e[0]}function uc(e,t,n={}){let r=!!n.noNullPrototype;return B(Mn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:OI,depthIdentifier:n.depthIdentifier}),r?xe(!1):ai()).map(II,TI)}var NI=Number.POSITIVE_INFINITY,$I=Number.MAX_SAFE_INTEGER,LI=Number.isInteger,DI=Math.floor,_I=Math.pow,BI=Math.min,Mu=class Jg extends ue{static from(t,n,r){if(t.length===0)throw new Error(`${r} expects at least one weighted arbitrary`);let i=0;for(let o=0;o!==t.length;++o){if(t[o].arbitrary===void 0)throw new Error(`${r} expects arbitraries to be specified`);let s=t[o].weight;if(i+=s,!LI(s))throw new Error(`${r} expects weights to be integer values`);if(s<0)throw new Error(`${r} expects weights to be superior or equal to 0`)}if(i<=0)throw new Error(`${r} expects the sum of weights to be strictly superior to 0`);return new Jg(t,{depthBias:ZP(n.depthSize,n.maxDepth!==void 0),maxDepth:n.maxDepth!==void 0?n.maxDepth:NI,withCrossShrink:!!n.withCrossShrink},oc(n.depthIdentifier))}constructor(t,n,r){super(),this.warbs=t,this.constraints=n,this.context=r;let i=0;this.cumulatedWeights=[];for(let o=0;o!==t.length;++o)i+=t[o].weight,I(this.cumulatedWeights,i);this.totalWeight=i}generate(t,n){if(this.mustGenerateFirst())return this.safeGenerateForIndex(t,0,n);let r=t.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let i=0;i!==this.cumulatedWeights.length;++i)if(r<this.cumulatedWeights[i])return this.safeGenerateForIndex(t,i,n);throw new Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(t){return this.canShrinkWithoutContextIndex(t)!==-1}shrink(t,n){if(n!==void 0){let i=n,o=i.selectedIndex,s=i.originalBias,a=this.warbs[o].arbitrary.shrink(t,i.originalContext).map(l=>this.mapIntoValue(o,l,null,s));if(i.clonedMrngForFallbackFirst!==null){i.cachedGeneratedForFirst===void 0&&(i.cachedGeneratedForFirst=this.safeGenerateForIndex(i.clonedMrngForFallbackFirst,0,s));let l=i.cachedGeneratedForFirst;return _.of(l).join(a)}return a}let r=this.canShrinkWithoutContextIndex(t);return r===-1?_.nil():this.defaultShrinkForFirst(r).join(this.warbs[r].arbitrary.shrink(t,void 0).map(i=>this.mapIntoValue(r,i,null,void 0)))}defaultShrinkForFirst(t){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(t)||this.warbs[0].fallbackValue===void 0)return _.nil()}finally{--this.context.depth}let n=new M(this.warbs[0].fallbackValue.default,void 0);return _.of(this.mapIntoValue(0,n,null,void 0))}canShrinkWithoutContextIndex(t){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(t)?0:-1;try{++this.context.depth;for(let n=0;n!==this.warbs.length;++n){let r=this.warbs[n];if(r.weight!==0&&r.arbitrary.canShrinkWithoutContext(t))return n}return-1}finally{--this.context.depth}}mapIntoValue(t,n,r,i){let o={selectedIndex:t,originalBias:i,originalContext:n.context,clonedMrngForFallbackFirst:r};return new M(n.value,o)}safeGenerateForIndex(t,n,r){++this.context.depth;try{let i=this.warbs[n].arbitrary.generate(t,r),o=this.mustFallbackToFirstInShrink(n)?t.clone():null;return this.mapIntoValue(n,i,o,r)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(t){return t!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let t=this.constraints.depthBias;if(t<=0||this.warbs[0].weight===0)return 0;let n=DI(_I(1+t,this.context.depth))-1;return-BI(this.totalWeight*n,$I)||0}};function FI(e){return e!=null&&typeof e=="object"&&!("generate"in e)&&!("arbitrary"in e)&&!("weight"in e)}function fy(e){return og(e)?{arbitrary:e,weight:1}:e}function Ie(...e){let t=e[0];if(FI(t)){let r=V(Oe(e,1),fy);return Mu.from(r,t,"fc.oneof")}let n=V(e,fy);return Mu.from(n,{},"fc.oneof")}var jI=Number.isInteger;function sn(e){let t=typeof e=="number"?e:e&&e.max!==void 0?e.max:2147483647;if(t<0)throw new Error("fc.nat value should be greater than or equal to 0");if(!jI(t))throw new Error("fc.nat maximum value should be an integer");return new nr(0,t)}var VI=Object.is;function UI(e){let t=0,n=[];for(let r of e){let i=t;t=i+r.num;let o=t-1;n.push({from:i,to:o,entry:r})}return n}function WI(e,t){let n=0,r=e.length;for(;r-n>1;){let i=~~((n+r)/2);t<e[i].from?r=i:n=i}return e[n]}function zI(e){let t=UI(e);return function(r){let i=WI(t,r);return i.entry.build(r-i.from)}}function GI(e){let t={mapping:new Ut,negativeZeroIndex:void 0},n=0;for(let r=0;r!==e.length;++r){let i=e[r];for(let o=0;o!==i.num;++o){let s=i.build(o);s===0&&1/s===Vt.NEGATIVE_INFINITY?t.negativeZeroIndex=n:dt(t.mapping,s,n),++n}}return t}function HI(e){let t=null;return function(r){t===null&&(t=GI(e));let i=VI(r,-0)?t.negativeZeroIndex:Ze(t.mapping,r);if(i===void 0)throw new P("Unknown value encountered cannot be built using this mapToConstant");return i}}function KI(e){if(e.length===0)throw new P("fc.mapToConstant expects at least one option");let t=0;for(let n=0;n!==e.length;++n){if(e[n].num<0)throw new P("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");t+=e[n].num}if(t===0)throw new P("fc.mapToConstant expects at least one choice among options");return t}function rr(...e){return sn({max:KI(e)-1}).map(zI(e),HI(e))}function Xg(e,t,n,r){if(t.length===0)return n>0?void 0:[];if(r<=0)return;let i=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];for(;i.length>0;){let o=pg(i);for(let s=o.nextStartIndex;s<=t.length;++s){let a=me(t,o.endIndexChunks,s);if(e.canShrinkWithoutContext(a)){let l=[...o.chunks,a];if(s===t.length){if(l.length<n)break;return l}I(i,{endIndexChunks:o.endIndexChunks,nextStartIndex:s+1,chunks:o.chunks}),l.length<r&&I(i,{endIndexChunks:s,nextStartIndex:s+1,chunks:l});break}}}}function qI(e){return le(e,"")}function Qg(e){return e.minLength!==void 0?e.minLength:0}function eb(e){return e.maxLength!==void 0?e.maxLength:In}function YI(e,t){return Qg(t)<=e.length&&e.length<=eb(t)}function ZI(e,t){return function(r){if(typeof r!="string")throw new P("Unsupported value");let i=Xg(e,r,Qg(t),eb(t));if(i===void 0)throw new P("Unable to unmap received string");return i}}var tb=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function JI(e,t,n){let r;try{r=n(e)}catch{return}for(let i of r)if(!t.canShrinkWithoutContext(i))return;return r}function XI(e,t){let n=[];for(let r of tb){let i=JI(r,e,t);i!==void 0&&I(n,i)}return n}var py=new WeakMap;function QI(e){let t=[];for(let n of tb){let r=Xg(e,n,0,In);r!==void 0&&I(t,r)}return t}function e2(e,t){let n=XA(py,e);n===void 0&&(n=QI(e),JA(py,e,n));let r=[];for(let i of n)YI(i,t)&&I(r,i);return r}var t2=[[0,127]],n2=[[0,55295],[57344,1114111]],r2=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6e3],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66e3,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128e3,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],i2=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],hy=String.fromCodePoint,o2=Math.min,s2=Math.max;function Tu(e){if(e.length===1){let n=hy(e[0]);return{num:1,build:()=>n}}let t=e[0];return{num:e[1]-e[0]+1,build:n=>hy(t+n)}}function my(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let o=e[r],s=o[0],a=o.length===1?o[0]:o[1],l=t[i],u=l[0],c=l.length===1?l[0]:l[1];if(a<u)r+=1;else if(c<s)i+=1;else{let d=s2(s,u),p=o2(a,c);if(n.length>=1){let h=n[n.length-1];(h.length===1?h[0]:h[1])+1===d&&(d=h[0],pg(n))}I(n,d===p?[d]:[d,p]),a<=p&&(r+=1),c<=p&&(i+=1)}}return n}var yy=Object.create(null);function a2(e){switch(e){case"full":return n2;case"ascii":return t2}}function l2(e,t){let n=`${e}:${t}`,r=yy[n];if(r!==void 0)return r;let i=a2(t),o=e==="binary"?i:my(i,r2),s=[];for(let l of o)I(s,Tu(l));if(e==="grapheme"){let l=my(i,i2);for(let u of l){let c=Tu(u);I(s,{num:c.num,build:d=>yE(c.build(d),"NFD")})}}let a=rr(...s);return yy[n]=a,a}function Xr(e,t){return l2(e,t)}function u2(e){if(typeof e.unit=="object")return e.unit;switch(e.unit){case"grapheme":return Xr("grapheme","full");case"grapheme-composite":return Xr("composite","full");case"grapheme-ascii":case void 0:return Xr("grapheme","ascii");case"binary":return Xr("binary","full");case"binary-ascii":return Xr("binary","ascii")}}function Ee(e={}){let t=u2(e),n=ZI(t,e),r=e2(t,e);return se(t,{...e,experimentalCustomSlices:r}).map(qI,n)}var nb=Map,cc=String.fromCharCode,dc={num:26,build:e=>cc(e+97)},c2={num:26,build:e=>cc(e+65)},rb={num:10,build:e=>cc(e+48)};function d2(e){let t=IA(e);return e!==t?t:`%${ni(er(e,0),16)}`}function f2(e){if(typeof e!="string")throw new Error("Unsupported");return decodeURIComponent(e)}var p2=()=>Ee({unit:"binary",minLength:1,maxLength:1}).map(d2,f2),au;function h2(){return au===void 0&&(au=rr(dc)),au}var Uo;function Ou(e){Uo===void 0&&(Uo=new nb);let t=Ze(Uo,e);return t===void 0&&(t=rr(dc,rb,{num:e.length,build:n=>e[n]}),dt(Uo,e,t)),t}function m2(e){return rr(dc,c2,rb,{num:e.length,build:t=>e[t]})}var Wo;function fc(e){Wo===void 0&&(Wo=new nb);let t=Ze(Wo,e);return t===void 0&&(t=Ie({weight:10,arbitrary:m2(e)},{weight:1,arbitrary:p2()}),dt(Wo,e,t)),t}function zt(e,t={}){let n=t.freq===void 0?6:t.freq,r=gg(t,"nil")?t.nil:null,i=[{arbitrary:xe(r),weight:1,fallbackValue:{default:r}},{arbitrary:e,weight:n-1}],o={withCrossShrink:!0,depthSize:t.depthSize,maxDepth:t.maxDepth,depthIdentifier:t.depthIdentifier};return Mu.from(i,o,"fc.option")}function y2(e){return e.length>63?!1:e.length<4||e[0]!=="x"||e[1]!=="n"||e[2]!=="-"||e[3]!=="-"}var ib=Symbol("adapted-value");function g2(e,t){let n=t(e.value_);return n.adapted?new M(n.value,ib):e}var b2=class extends ue{constructor(e,t){super(),this.sourceArb=e,this.adapter=t,this.adaptValue=n=>g2(n,t)}generate(e,t){let n=this.sourceArb.generate(e,t);return this.adaptValue(n)}canShrinkWithoutContext(e){return this.sourceArb.canShrinkWithoutContext(e)&&!this.adapter(e).adapted}shrink(e,t){return t===ib?this.sourceArb.canShrinkWithoutContext(e)?this.sourceArb.shrink(e,void 0).map(this.adaptValue):_.nil():this.sourceArb.shrink(e,t).map(this.adaptValue)}};function ob(e,t){return new b2(e,t)}function S2([e,t]){return t===null?e:`${e}${t[0]}${t[1]}`}function w2(e){if(typeof e!="string"||e.length===0)throw new Error("Unsupported");return e.length===1?[e[0],null]:[e[0],[me(e,1,e.length-1),e[e.length-1]]]}function x2(e){let t=Ou("");return B(t,zt(B(Ee({unit:Ou("-"),size:e,maxLength:61}),t))).map(S2,w2).filter(y2)}function v2(e){return`${le(e[0],".")}.${e[1]}`}function R2(e){if(typeof e!="string")throw new Error("Unsupported type");let t=e.lastIndexOf(".");return[Be(me(e,0,t),"."),me(e,t+1)]}function C2(e){let[t,n]=e,r=n.length;for(let i=0;i!==t.length;++i)if(r+=1+t[i].length,r>255)return{adapted:!0,value:[Oe(t,0,i),n]};return{adapted:!1,value:e}}function pc(e={}){let t=lc(e.size),n=si("-1",t),r=Ee({unit:h2(),minLength:2,maxLength:63,size:n});return ob(B(se(x2(t),{size:n,minLength:1,maxLength:127}),r),C2).map(v2,R2)}function k2(e){let t=e[0].length;for(let n=1;n!==e.length;++n)if(t+=1+e[n].length,t>64)return{adapted:!0,value:Oe(e,0,n)};return{adapted:!1,value:e}}function A2(e){return le(e,".")}function E2(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,".")}function P2(e){return`${e[0]}@${e[1]}`}function I2(e){if(typeof e!="string")throw new Error("Unsupported");return Be(e,"@",2)}function M2(e={}){return B(ob(se(Ee({unit:Ou("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:e.size}),{minLength:1,maxLength:32,size:e.size}),k2).map(A2,E2),pc({size:e.size})).map(P2,I2)}var T2=Vt.NEGATIVE_INFINITY,Nu=Vt.POSITIVE_INFINITY,sb=Vt.EPSILON,hc=E(2146435072)*E(4294967296),O2=-hc-E(1),gy=4503599627370496,N2=E(0xfffffffffffff),by=E("9007199254740992"),$u=new Float64Array(1),Sy=new Uint32Array($u.buffer,$u.byteOffset);function $2(e){return $u[0]=e,[Sy[1],Sy[0]]}function L2(e){let{0:t,1:n}=$2(e),r=t>>>31,i=t>>>20&2047,o=(t&1048575)*4294967296+n,s=i===0?-1022:i-1023,a=i===0?0:1;return a+=o*sb,a*=r===0?1:-1,{exponent:s,significand:a}}function wy(e,t){return e===-1022?E(t*gy):E((t-1)*gy)+(E(e+1023)<<E(52))}function mc(e){if(e===Nu)return hc;if(e===T2)return O2;let t=L2(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===Nu?wy(n,r):-wy(n,-r)-E(1)}function Lu(e){if(e<0)return-Lu(-e-E(1));if(e===hc)return Nu;if(e<by)return Vt(e)*2**-1074;let t=e-by,n=-1021+Vt(t>>E(52));return(1+Vt(t&N2)*sb)*2**n}var xy=Number.isInteger,vy=Object.is,lu=Number.NEGATIVE_INFINITY,uu=Number.POSITIVE_INFINITY;function ab(e,t,n,r){let{noDefaultInfinity:i=!1,minExcluded:o=!1,maxExcluded:s=!1,min:a=i?-t:lu,max:l=i?t:uu}=e,u=o?a<-n?-r:Math.max(a,-n):a===lu?Math.max(a,-r):Math.max(a,-n),c=s?l>n?r:Math.min(l,n):l===uu?Math.min(l,r):Math.min(l,n);return{noDefaultInfinity:!1,minExcluded:o||(a!==lu||o)&&xy(u),maxExcluded:s||(l!==uu||s)&&xy(c),min:vy(u,-0)?0:u,max:vy(c,0)?-0:c,noNaN:e.noNaN||!1}}var lb=Number.NEGATIVE_INFINITY,ub=Number.POSITIVE_INFINITY,D2=Number.MAX_VALUE,_2=45035996273704955e-1,Du=4503599627370496;function B2(e){return ab(e,D2,_2,Du)}function F2(e){return e===4503599627370496?ub:e===-4503599627370496?lb:e}function j2(e){if(typeof e!="number")throw new Error("Unsupported type");return e===ub?Du:e===lb?-Du:e}var V2=Number.isInteger,cb=Number.isNaN,U2=Number.NEGATIVE_INFINITY,W2=Number.POSITIVE_INFINITY,Ry=Number.MAX_VALUE,z2=NaN;function Cy(e,t){if(cb(e))throw new Error("fc.double constraints."+t+" must be a 64-bit float");return mc(e)}function G2(e){if(typeof e!="number")throw new Error("Unsupported type");return mc(e)}function H2(e){return!V2(e)}function ky(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-Ry:U2,max:s=t?Ry:W2}=e,a=Cy(o,"min"),l=r?a+E(1):a,u=Cy(s,"max"),c=i?u-E(1):u;if(c<l)throw new Error("fc.double constraints.min must be smaller or equal to constraints.max");if(n)return un({min:l,max:c}).map(Lu,G2);let d=c>E(0),p=d?l:l-E(1),h=d?c+E(1):c;return un({min:p,max:h}).map(f=>c<f||f<l?z2:Lu(f),f=>{if(typeof f!="number")throw new Error("Unsupported type");return cb(f)?c!==h?h:p:mc(f)})}function ls(e={}){return e.noInteger?ky(B2(e)).map(F2,j2).filter(H2):ky(e)}var K2=Number.NEGATIVE_INFINITY,_u=Number.POSITIVE_INFINITY,q2=Math.imul,Bu=2**127*(1+(2**23-1)/2**23),db=2139095040,Y2=-2139095041,Fu=new Float32Array(1),Z2=new Uint32Array(Fu.buffer,Fu.byteOffset);function J2(e){return Fu[0]=e,Z2[0]}function X2(e){let t=J2(e),n=t>>>31,r=t>>>23&255,i=t&8388607,o=r===0?-126:r-127,s=r===0?0:1;return s+=i/2**23,s*=n===0?1:-1,{exponent:o,significand:s}}function Ay(e,t){return e===-126?t*8388608:q2(e+127,8388608)+(t-1)*8388608}function yc(e){if(e===_u)return db;if(e===K2)return Y2;let t=X2(e),n=t.exponent,r=t.significand;return e>0||e===0&&1/e===_u?Ay(n,r):-Ay(n,-r)-1}function ju(e){if(e<0)return-ju(-e-1);if(e===db)return _u;if(e<16777216)return e*2**-149;let t=e-16777216,n=-125+(t>>23);return(1+(t&8388607)/8388608)*2**n}var fb=Number.NEGATIVE_INFINITY,pb=Number.POSITIVE_INFINITY,Q2=Bu,eM=83886075e-1,Vu=8388608;function tM(e){return ab(e,Q2,eM,Vu)}function nM(e){return e===8388608?pb:e===-8388608?fb:e}function rM(e){if(typeof e!="number")throw new Error("Unsupported type");return e===pb?Vu:e===fb?-Vu:e}var iM=Number.isInteger,hb=Number.isNaN,oM=Math.fround,sM=Number.NEGATIVE_INFINITY,aM=Number.POSITIVE_INFINITY,lM=NaN;function Ey(e,t){let n="fc.float constraints."+t+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(hb(e)||oM(e)!==e)throw new Error(n);return yc(e)}function uM(e){if(typeof e!="number")throw new Error("Unsupported type");return yc(e)}function cM(e){return!iM(e)}function Py(e){let{noDefaultInfinity:t=!1,noNaN:n=!1,minExcluded:r=!1,maxExcluded:i=!1,min:o=t?-Bu:sM,max:s=t?Bu:aM}=e,a=Ey(o,"min"),l=r?a+1:a,u=Ey(s,"max"),c=i?u-1:u;if(l>c)throw new Error("fc.float constraints.min must be smaller or equal to constraints.max");if(n)return ee({min:l,max:c}).map(ju,uM);let d=c>0?l:l-1,p=c>0?c+1:c;return ee({min:d,max:p}).map(h=>h>c||h<l?lM:ju(h),h=>{if(typeof h!="number")throw new Error("Unsupported type");return hb(h)?c!==p?p:d:yc(h)})}function mb(e={}){return e.noInteger?Py(tM(e)).map(nM,rM).filter(cM):Py(e)}function dM(e){return e.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function yb(e){return e.replace(/\*\//g,"*\\/")}var qe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function os(e){let t=4294967295;for(let n=0;n<e.length;++n){let r=er(e,n);if(r<128)t=qe[t&255^r]^t>>8;else if(r<2048)t=qe[t&255^(192|r>>6&31)]^t>>8,t=qe[t&255^(128|r&63)]^t>>8;else if(r>=55296&&r<57344){let i=er(e,++n);if(r>=56320||i<56320||i>57343||Number.isNaN(i))n-=1,t=qe[t&255^239]^t>>8,t=qe[t&255^191]^t>>8,t=qe[t&255^189]^t>>8;else{let o=(r&1023)+64,s=i&1023;t=qe[t&255^(240|o>>8&7)]^t>>8,t=qe[t&255^(128|o>>2&63)]^t>>8,t=qe[t&255^(128|s>>6&15|(o&3)<<4)]^t>>8,t=qe[t&255^(128|s&63)]^t>>8}}else t=qe[t&255^(224|r>>12&15)]^t>>8,t=qe[t&255^(128|r>>6&63)]^t>>8,t=qe[t&255^(128|r&63)]^t>>8}return(t|0)+2147483648}var fM=Object.getPrototypeOf,Qr=class extends ue{constructor(e){super(),this.arb=e}generate(e,t){return this.arb.generate(e,t)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return _.nil()}};function ss(e){return fM(e)===Qr.prototype&&e.generate===Qr.prototype.generate&&e.canShrinkWithoutContext===Qr.prototype.canShrinkWithoutContext&&e.shrink===Qr.prototype.shrink?e:new Qr(e)}var pM=Object.assign,hM=Object.keys;function gb(e){return B(ss(ee()),ss(ee({min:1,max:4294967295}))).map(([t,n])=>{let r=()=>{let i={};return pM((s,a)=>{let l=ve(s),u=ve(a),c=e(os(`${t}${l}`)%n,os(`${t}${u}`)%n);return i[`[${l},${u}]`]=c,c},{toString:()=>{let s=hM(i).sort().map(a=>`${a} => ${ve(i[a])}`).map(a=>`/* ${yb(a)} */`);return`function(a, b) {
39
+ // With hash and stringify coming from fast-check${s.length!==0?`
40
+ ${le(s,`
41
+ `)}`:""}
42
+ const cmp = ${e};
43
+ const hA = hash('${t}' + stringify(a)) % ${n};
44
+ const hB = hash('${t}' + stringify(b)) % ${n};
45
+ return cmp(hA, hB);
46
+ }`},[Me]:r})};return r()})}var mM=Object.assign;function yM(){return gb(mM((e,t)=>e<t,{toString(){return"(hA, hB) => hA < hB"}}))}var gM=Object.assign;function bM(){return gb(gM((e,t)=>e-t,{toString(){return"(hA, hB) => hA - hB"}}))}var SM=Object.defineProperties,wM=Object.keys;function xM(e){return B(se(e,{minLength:1}),ss(ee())).map(([t,n])=>{let r=()=>{let i={},o=(...a)=>{let l=ve(a),u=t[os(`${n}${l}`)%t.length];return i[l]=u,Pn(u)?u[Me]():u};function s(a){let l=V(V(mg(wM(i)),u=>`${u} => ${ve(i[u])}`),u=>`/* ${yb(u)} */`);return`function(...args) {
47
+ // With hash and stringify coming from fast-check${l.length!==0?`
48
+ ${l.join(`
49
+ `)}`:""}
50
+ const outs = ${a};
51
+ return outs[hash('${n}' + stringify(args)) % outs.length];
52
+ }`}return SM(o,{toString:{value:()=>s(ve(t))},[pt]:{value:()=>s(ve(t))},[Wt]:{value:async()=>s(await nc(t))},[Me]:{value:r,configurable:!0}})};return r()})}var vM=Number.MIN_SAFE_INTEGER,RM=Number.MAX_SAFE_INTEGER;function bb(){return new nr(vM,RM)}var CM=Number.MAX_SAFE_INTEGER;function kM(){return new nr(0,CM)}var AM=Number.parseInt;function EM(e){let[t,n]=e;switch(t){case"oct":return`0${ni(n,8)}`;case"hex":return`0x${ni(n,16)}`;default:return`${n}`}}function Yo(e,t){let n=AM(e,t);if(ni(n,t)!==e)throw new Error("Invalid value");return n}function PM(e){if(typeof e!="string")throw new Error("Invalid type");return e.length>=2&&e[0]==="0"?e[1]==="x"?["hex",Yo(me(e,2),16)]:["oct",Yo(me(e,1),8)]:["dec",Yo(e,10)]}function IM(e){return le(e,".")}function MM(e){if(typeof e!="string")throw new Error("Invalid type");return V(Be(e,"."),t=>Yo(t,10))}function gc(){return B(sn(255),sn(255),sn(255),sn(255)).map(IM,MM)}function kt(e){return B(At("dec","oct","hex"),sn(e)).map(EM,PM)}function cu(e){return le(e,".")}function du(e){if(typeof e!="string")throw new Error("Invalid type");return Be(e,".")}function Sb(){return Ie(B(kt(255),kt(255),kt(255),kt(255)).map(cu,du),B(kt(255),kt(255),kt(65535)).map(cu,du),B(kt(255),kt(16777215)).map(cu,du),kt(4294967295))}function bc(e){return e.length===0?[]:Be(e,":")}function Sc(e){let t=Be(e,":");return t.length>=2&&t[t.length-1].length<=4?[Oe(t,0,t.length-2),`${t[t.length-2]}:${t[t.length-1]}`]:[Oe(t,0,t.length-1),t[t.length-1]]}function TM(e){return`${le(e[0],":")}:${e[1]}`}function OM(e){if(typeof e!="string")throw new Error("Invalid type");return Sc(e)}function NM(e){return`::${le(e[0],":")}:${e[1]}`}function $M(e){if(typeof e!="string")throw new Error("Invalid type");if(!pE(e,"::"))throw new Error("Invalid value");return Sc(me(e,2))}function Zo(e){return`${le(e[0],":")}::${le(e[1],":")}:${e[2]}`}function Jo(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Be(e,"::",2),[r,i]=Sc(n);return[bc(t),r,i]}function LM(e){return Zo([e[0],[e[1]],e[2]])}function DM(e){let t=Jo(e);return[t[0],le(t[1],":"),t[2]]}function Iy(e){return`${le(e[0],":")}::${e[1]}`}function My(e){if(typeof e!="string")throw new Error("Invalid type");let[t,n]=Be(e,"::",2);return[bc(t),n]}function _M(e){return`${le(e[0],":")}::`}function BM(e){if(typeof e!="string")throw new Error("Invalid type");if(!hE(e,"::"))throw new Error("Invalid value");return[bc(me(e,0,e.length-2))]}function FM([e,t]){return`${e}:${t}`}function jM(e){if(typeof e!="string")throw new P("Invalid type");if(!e.includes(":"))throw new P("Invalid value");return e.split(":",2)}var VM="0123456789abcdef",fu;function UM(){return fu===void 0&&(fu=ee({min:0,max:15}).map(e=>VM[e],e=>{if(typeof e!="string")throw new P("Not a string");if(e.length!==1)throw new P("Invalid length");let t=er(e,0);if(t<=57)return t-48;if(t<97)throw new P("Invalid character");return t-87})),fu}function wb(){let e=Ee({unit:UM(),minLength:1,maxLength:4,size:"max"}),t=Ie(B(e,e).map(FM,jM),gc());return Ie(B(se(e,{minLength:6,maxLength:6,size:"max"}),t).map(TM,OM),B(se(e,{minLength:5,maxLength:5,size:"max"}),t).map(NM,$M),B(se(e,{minLength:0,maxLength:1,size:"max"}),se(e,{minLength:4,maxLength:4,size:"max"}),t).map(Zo,Jo),B(se(e,{minLength:0,maxLength:2,size:"max"}),se(e,{minLength:3,maxLength:3,size:"max"}),t).map(Zo,Jo),B(se(e,{minLength:0,maxLength:3,size:"max"}),se(e,{minLength:2,maxLength:2,size:"max"}),t).map(Zo,Jo),B(se(e,{minLength:0,maxLength:4,size:"max"}),e,t).map(LM,DM),B(se(e,{minLength:0,maxLength:5,size:"max"}),t).map(Iy,My),B(se(e,{minLength:0,maxLength:6,size:"max"}),e).map(Iy,My),B(se(e,{minLength:0,maxLength:7,size:"max"})).map(_M,BM))}var WM=class extends ue{constructor(e){super(),this.name=e,this.underlying=null}generate(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(e,t)}canShrinkWithoutContext(e){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(e)}shrink(e,t){if(this.underlying===null)throw new Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(e,t)}},zM=Object.getOwnPropertyNames;function GM(){let e=new Ut;return n=>{let r=Ze(e,n);return r!==void 0||(r=new WM(String(n)),dt(e,n,r)),r}}function xb(e){let t=GM(),n=e(t),r=zM(n);for(let i of r){let o=t(i);o.underlying=n[i]}return n}function HM(e,t){for(let n of e){let r=t[n]||{};if(r.maxLength===void 0||r.maxLength>0)return!0}return!1}function KM(e,t){if(e.length===0)return xe([]);if(!HM(e,t))throw new P("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return B(...e.map(n=>se(xe(n),t[n]))).map(n=>UA(n)).filter(n=>n.length>0)}var Ty=Object.assign,Xo=Object.create,vb=Object.defineProperty,Oy=Object.getPrototypeOf,qM=Object.prototype;function YM(e){return vb(Xo(null),pt,{configurable:!1,enumerable:!1,writable:!1,value:()=>e})}function Ny(e,t){return YM(`<${_e(e)}#${t}>`)}function ZM(e,t){let n=Xo(qM);for(let r in e){let i=e[r],o=[];for(let s of i){let a=Ty(Xo(Oy(s)),s);o.push(a)}n[r]=o}for(let r in t){let i=t[r];for(let o=0;o!==i.length;++o){let s=i[o],a=n[r][o];for(let l in s){let u=s[l];a[l]=u.index===void 0?void 0:typeof u.index=="number"?n[u.type][u.index]:V(u.index,c=>n[u.type][c])}vb(a,pt,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let l=e[r][o],u=Ty(Xo(Oy(l)),l);for(let c in s){let d=s[c];u[c]=d.index===void 0?void 0:typeof d.index=="number"?Ny(d.type,d.index):V(d.index,p=>Ny(d.type,p))}return ve(u)}})}}return n}function JM(e){let t=0,n=new Ut;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse")continue;let l=Ze(n,a.type);if(l===void 0&&(l=new Ut,dt(n,a.type,l)),nE(l,a.forwardRelationship))throw new P(`Cannot declare multiple inverse relationships for the same forward relationship ${_e(a.forwardRelationship)} on type ${_e(a.type)}`);dt(l,a.forwardRelationship,{type:i,property:s}),t+=1}}let r=new Ut;if(t===0)return r;for(let i in e){let o=e[i],s=Ze(n,i);if(s!==void 0)for(let a in o){let l=o[a];if(l.arity==="inverse")continue;let u=Ze(s,a);if(u!==void 0){if(u.type!==l.type)throw new P(`Inverse relationship ${_e(u.property)} on type ${_e(u.type)} references forward relationship ${_e(a)} but types do not match`);dt(r,l,u)}}}if(r.size!==t)throw new P("Some inverse relationships could not be matched with their corresponding forward relationships");return r}var $y=Object.create;function XM(e,t,n){switch(e){case"exclusive":return xe(n);case"successor":return is(ee({min:t!==void 0?t+1:0,max:n}));case"any":return is(ee({min:0,max:n}))}}function QM(e,t,n,r,i,o,s){let a=XM(t,n,r);switch(e){case"0-1":return zt(a,{nil:void 0,depthIdentifier:i}).generate(o,s).value;case"1":return a.generate(o,s).value;case"many":{let l=0,u=zt(Mn(a,{depthIdentifier:i,selector:d=>d===r?d+ ++l:d,minLength:1}),{nil:[],depthIdentifier:i}).generate(o,s).value,c=0;return V(u,d=>d===r?d+c++:d)}}}var eT=class extends ue{constructor(e,t){super(),this.relations=e,this.defaultEntities=t;let n=new Qn,r=new Qn;for(let i in e){let o=e[i];for(let s in o){let a=o[s];if(a.arity!=="inverse"){if(a.strategy==="exclusive"){if(rs(n,a.type))throw new P(`Cannot mix exclusive with other strategies for type ${_e(a.type)}`);ti(r,a.type)}else{if(rs(r,a.type))throw new P(`Cannot mix exclusive with other strategies for type ${_e(a.type)}`);ti(n,a.type)}if(a.strategy==="successor"&&a.type!==i)throw new P("Cannot mix types for the strategy successor");if(a.strategy==="successor"&&a.arity==="1")throw new P("Cannot use an arity of 1 for the strategy successor")}}}this.inversedRelations=JM(e)}createEmptyLinksInstanceFor(e){let t=$y(null),n=this.relations[e];for(let r in n){let i=n[r];i.arity==="inverse"&&(t[r]={type:i.type,index:[]})}return t}generate(e,t){let n=$y(null);for(let o in this.relations)n[o]=[];let r=[];for(let o of this.defaultEntities)I(r,{type:o,indexInType:n[o].length,depth:0}),I(n[o],this.createEmptyLinksInstanceFor(o));let i=-1;for(;++i<r.length;){let o=r[i],s=this.relations[o.type],a=n[o.type][o.indexInType],l=sc();l.depth=o.depth;for(let u in s){let c=s[u];if(c.arity==="inverse")continue;let d=c.type,p=n[d],h=p.length,f=QM(c.arity,c.strategy||"any",d===o.type?o.indexInType:void 0,p.length,l,e,t);a[u]={type:d,index:f};let m=f===void 0?[]:typeof f=="number"?[f]:f;for(let y of m){y>=h&&(I(r,{type:d,indexInType:y,depth:o.depth+1}),I(p,this.createEmptyLinksInstanceFor(d)));let S=Ze(this.inversedRelations,c);if(S!==void 0){let w=p[y][S.property].index;I(w,o.indexInType)}}}}return r.length=0,new M(n,void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function tT(e,t){return new eT(e,t)}var nT=Object.keys,rT=Object.getOwnPropertySymbols,iT=Object.getOwnPropertyDescriptor;function oT(e){let t=nT(e),n=rT(e);for(let r=0;r!==n.length;++r){let i=n[r],o=iT(e,i);o&&o.enumerable&&t.push(i)}return t}var sT=Object.create,aT=Object.defineProperty,lT=Object.getOwnPropertyDescriptor,uT=Object.getOwnPropertyNames,cT=Object.getOwnPropertySymbols;function dT(e,t){return function(r){let i=r[1]?sT(null):{};for(let o=0;o!==e.length;++o){let s=r[0][o];s!==t&&aT(i,e[o],{value:s,configurable:!0,enumerable:!0,writable:!0})}return i}}function fT(e,t){return function(r){if(typeof r!="object"||r===null)throw new Error("Incompatible instance received: should be a non-null object");let i=Object.getPrototypeOf(r)===null,o="constructor"in r&&r.constructor===Object;if(!i&&!o)throw new Error("Incompatible instance received: should be of exact type Object");let s=0,a=[];for(let c=0;c!==e.length;++c){let d=lT(r,e[c]);if(d!==void 0){if(!d.configurable||!d.enumerable||!d.writable)throw new Error("Incompatible instance received: should contain only c/e/w properties");if(d.get!==void 0||d.set!==void 0)throw new Error("Incompatible instance received: should contain only no get/set properties");++s,I(a,d.value)}else I(a,t)}let l=uT(r).length,u=cT(r).length;if(s!==l+u)throw new Error("Incompatible instance received: should not contain extra properties");return[a,i]}}var pu=Symbol("no-key");function hu(e,t,n){let r=oT(e),i=[];for(let o=0;o!==r.length;++o){let s=r[o],a=e[s];t===void 0||jt(t,s)!==-1?I(i,a):I(i,zt(a,{nil:pu}))}return B(B(...i),n?xe(!1):ai()).map(dT(r,pu),fT(r,pu))}function Uu(e,t){let n=t!==void 0&&!!t.noNullPrototype;if(t===void 0||!("requiredKeys"in t&&t.requiredKeys!==void 0))return hu(e,void 0,n);let r=("requiredKeys"in t?t.requiredKeys:void 0)||[];for(let i=0;i!==r.length;++i){let o=Object.getOwnPropertyDescriptor(e,r[i]);if(o===void 0)throw new Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!o.enumerable)throw new Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return hu(e,r,n)}var pT=Object.create;function hT(e,t,n,r){let i=pT(null);for(let o in e){let s=e[o],a=Uu(s,r),l=t(o),u=n(o),c={minLength:l,maxLength:l};i[o]=u!==void 0?Mn(a,{...c,selector:u}):se(a,c)}return Uu(i)}var Ly=Object.create,mT=Object.keys;function yT(e,t,n={}){let r=mT(e),i=n.initialPoolConstraints||Ly(null),o=n.unicityConstraints||Ly(null),s={noNullPrototype:n.noNullPrototype};return KM(r,i).chain(a=>tT(t,a).chain(l=>hT(e,u=>l[u].length,u=>o[u],s).map(u=>ZM(u,l))))}function gT(e){return le(V(e,t=>t[t.length-1]===","?me(t,0,t.length-1):t)," ")}function bT(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");let r=[];for(let i of Be(n," "))if(e.canShrinkWithoutContext(i))I(r,i);else if(e.canShrinkWithoutContext(i+","))I(r,i+",");else throw new Error("Unsupported word");return r}}function ST(e){let t=le(e," ");return t[t.length-1]===","&&(t=me(t,0,t.length-1)),Ju(t[0])+me(t,1)+"."}function wT(e){return function(n){if(typeof n!="string")throw new Error("Unsupported type");if(n.length<2||n[n.length-1]!=="."||n[n.length-2]===","||Ju(ku(n[0]))!==n[0])throw new Error("Unsupported value");let r=ku(n[0])+me(n,1,n.length-1),i=[],o=Be(r," ");for(let s=0;s!==o.length;++s){let a=o[s];if(e.canShrinkWithoutContext(a))I(i,a);else if(s===o.length-1&&e.canShrinkWithoutContext(a+","))I(i,a+",");else throw new Error("Unsupported word")}return i}}function xT(e){return le(e," ")}function vT(e){if(typeof e!="string")throw new Error("Unsupported type");let t=Be(e,". ");for(let n=0;n<t.length-1;++n)t[n]+=".";return t}var g=(e,t)=>({arbitrary:xe(e),weight:t});function RT(){return Ie(g("non",6),g("adipiscing",5),g("ligula",5),g("enim",5),g("pellentesque",5),g("in",5),g("augue",5),g("et",5),g("nulla",5),g("lorem",4),g("sit",4),g("sed",4),g("diam",4),g("fermentum",4),g("ut",4),g("eu",4),g("aliquam",4),g("mauris",4),g("vitae",4),g("felis",4),g("ipsum",3),g("dolor",3),g("amet,",3),g("elit",3),g("euismod",3),g("mi",3),g("orci",3),g("erat",3),g("praesent",3),g("egestas",3),g("leo",3),g("vel",3),g("sapien",3),g("integer",3),g("curabitur",3),g("convallis",3),g("purus",3),g("risus",2),g("suspendisse",2),g("lectus",2),g("nec,",2),g("ultricies",2),g("sed,",2),g("cras",2),g("elementum",2),g("ultrices",2),g("maecenas",2),g("massa,",2),g("varius",2),g("a,",2),g("semper",2),g("proin",2),g("nec",2),g("nisl",2),g("amet",2),g("duis",2),g("congue",2),g("libero",2),g("vestibulum",2),g("pede",2),g("blandit",2),g("sodales",2),g("ante",2),g("nibh",2),g("ac",2),g("aenean",2),g("massa",2),g("suscipit",2),g("sollicitudin",2),g("fusce",2),g("tempus",2),g("aliquam,",2),g("nunc",2),g("ullamcorper",2),g("rhoncus",2),g("metus",2),g("faucibus,",2),g("justo",2),g("magna",2),g("at",2),g("tincidunt",2),g("consectetur",1),g("tortor,",1),g("dignissim",1),g("congue,",1),g("non,",1),g("porttitor,",1),g("nonummy",1),g("molestie,",1),g("est",1),g("eleifend",1),g("mi,",1),g("arcu",1),g("scelerisque",1),g("vitae,",1),g("consequat",1),g("in,",1),g("pretium",1),g("volutpat",1),g("pharetra",1),g("tempor",1),g("bibendum",1),g("odio",1),g("dui",1),g("primis",1),g("faucibus",1),g("luctus",1),g("posuere",1),g("cubilia",1),g("curae,",1),g("hendrerit",1),g("velit",1),g("mauris,",1),g("gravida",1),g("ornare",1),g("ut,",1),g("pulvinar",1),g("varius,",1),g("turpis",1),g("nibh,",1),g("eros",1),g("id",1),g("aliquet",1),g("quis",1),g("lobortis",1),g("consectetuer",1),g("morbi",1),g("vehicula",1),g("tortor",1),g("tellus,",1),g("id,",1),g("eu,",1),g("quam",1),g("feugiat,",1),g("posuere,",1),g("iaculis",1),g("lectus,",1),g("tristique",1),g("mollis,",1),g("nisl,",1),g("vulputate",1),g("sem",1),g("vivamus",1),g("placerat",1),g("imperdiet",1),g("cursus",1),g("rutrum",1),g("iaculis,",1),g("augue,",1),g("lacus",1))}function CT(e={}){let{maxCount:t,mode:n="words",size:r}=e;if(t!==void 0&&t<1)throw new Error("lorem has to produce at least one word/sentence");let i=RT();return n==="sentences"?se(se(i,{minLength:1,size:"small"}).map(ST,wT(i)),{minLength:1,maxLength:t,size:r}).map(xT,vT):se(i,{minLength:1,maxLength:t,size:r}).map(gT,bT(i))}function kT(e){return new Map(e)}function AT(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Map)throw new Error("Incompatible instance received: should be of exact type Map");return Array.from(e)}function ET(e){return e[0]}function Wu(e,t,n={}){return Mn(B(e,t),{minLength:n.minKeys,maxLength:n.maxKeys,size:n.size,selector:ET,depthIdentifier:n.depthIdentifier,comparator:"SameValueZero"}).map(kT,AT)}var zo=10;function PT(e){let t={};return(n=>{let r=n!==void 0?n:zo;if(!gg(t,r)){let i=zo;zo=r-1,t[r]=e(r),zo=i}return t[r]})}function IT(e){let t=0;for(;e>E(0);)e&E(1)&&++t,e>>=E(1);return t}function MT(e,t){let n=(E(1)<<E(t))-E(1),r=e&n,i=IT(e-r),o=r;for(let s=E(1);s<=n&&i!==0;s<<=E(1))o&s||(o|=s,--i);return o}function Go(e,t){let n=[];for(let r=e.length-1;r!==-1;--r)t(e[r])!==e[r]&&I(n,r);return n}function TT(e,t,n){let r=E(0);for(let i=0,o=E(1);i!==n.length;++i,o<<=E(1))e[n[i]]!==t[n[i]]&&(r|=o);return r}function mu(e,t,n,r){for(let i=0,o=E(1);i!==n.length;++i,o<<=E(1))t&o&&(e[n[i]]=r(e[n[i]]))}var OT=class extends ue{constructor(e,t,n){super(),this.stringArb=e,this.toggleCase=t,this.untoggleAll=n}buildContextFor(e,t){return{rawString:e.value,rawStringContext:e.context,flags:t.value,flagsContext:t.context}}generate(e,t){let n=this.stringArb.generate(e,t),r=[...n.value],i=Go(r,this.toggleCase),o=un(E(0),(E(1)<<E(i.length))-E(1)).generate(e,void 0);return mu(r,o.value,i,this.toggleCase),new M(le(r,""),this.buildContextFor(n,o))}canShrinkWithoutContext(e){return typeof e!="string"?!1:this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(e)):this.stringArb.canShrinkWithoutContext(e)}shrink(e,t){let n;if(t!==void 0)n=t;else if(this.untoggleAll!==void 0){let o=this.untoggleAll(e),s=[...e],a=[...o];n={rawString:o,rawStringContext:void 0,flags:TT(a,s,Go(a,this.toggleCase)),flagsContext:void 0}}else n={rawString:e,rawStringContext:void 0,flags:E(0),flagsContext:void 0};let r=n.rawString,i=n.flags;return this.stringArb.shrink(r,n.rawStringContext).map(o=>{let s=[...o.value],a=Go(s,this.toggleCase),l=MT(i,a.length);return mu(s,l,a,this.toggleCase),new M(le(s,""),this.buildContextFor(o,new M(l,void 0)))}).join(an(()=>{let o=[...r],s=Go(o,this.toggleCase);return un(E(0),(E(1)<<E(s.length))-E(1)).shrink(i,n.flagsContext).map(a=>{let l=Oe(o);return mu(l,a.value,s,this.toggleCase),new M(le(l,""),this.buildContextFor(new M(r,n.rawStringContext),a))})}))}};function NT(e){let t=Ju(e);return t!==e?t:ku(e)}function $T(e,t){return new OT(e,t&&t.toggleCase||NT,t&&t.untoggleAll)}function LT(e){return cg.from(e)}function DT(e){if(!(e instanceof cg))throw new Error("Unexpected type");return[...e]}function Rb(e={}){return se(mb(e),e).map(LT,DT)}function _T(e){return dg.from(e)}function BT(e){if(!(e instanceof dg))throw new Error("Unexpected type");return[...e]}function Cb(e={}){return se(ls(e),e).map(_T,BT)}function Gt(e,t,n,r,i){let o=r.name,{min:s=t,max:a=n,...l}=e;if(s>a)throw new Error(`Invalid range passed to ${o}: min must be lower than or equal to max`);if(s<t)throw new Error(`Invalid min value passed to ${o}: min must be greater than or equal to ${t}`);if(a>n)throw new Error(`Invalid max value passed to ${o}: max must be lower than or equal to ${n}`);return se(i({min:s,max:a}),l).map(u=>r.from(u),u=>{if(!(u instanceof r))throw new Error("Invalid type");return[...u]})}function kb(e={}){return Gt(e,-32768,32767,RA,ee)}function Ab(e={}){return Gt(e,-2147483648,2147483647,CA,ee)}function Eb(e={}){return Gt(e,-128,127,vA,ee)}function Pb(e={}){return Gt(e,0,65535,EA,ee)}function Ib(e={}){return Gt(e,0,4294967295,PA,ee)}function Mb(e={}){return Gt(e,0,255,kA,ee)}function Tb(e={}){return Gt(e,0,255,AA,ee)}function FT(e){return e!==void 0}function Dy(e){return e.hasToBeCloned?new M(e.value_,{generatorContext:e.context},()=>e.value):new M(e.value_,{generatorContext:e.context})}function _y(e){return e.hasToBeCloned?new M(e.value_,{shrinkerContext:e.context},()=>e.value):new M(e.value_,{shrinkerContext:e.context})}var jT=class extends ue{constructor(e,t){super(),this.generatorArbitrary=e,this.shrinkerArbitrary=t}generate(e,t){return Dy(this.generatorArbitrary.generate(e,t))}canShrinkWithoutContext(e){return this.shrinkerArbitrary.canShrinkWithoutContext(e)}shrink(e,t){return FT(t)?"generatorContext"in t?this.generatorArbitrary.shrink(e,t.generatorContext).map(Dy):this.shrinkerArbitrary.shrink(e,t.shrinkerContext).map(_y):this.shrinkerArbitrary.shrink(e,void 0).map(_y)}};function zu(e,t,n){let r=ee({min:e,max:t});return t===n?r:new jT(r,ee({min:e,max:n}))}var VT=Math.min,Gu=Math.max,By=lg.isArray,UT=Object.entries;function WT(e){let t=-1;for(let n=0;n!==e.length;++n)t=Gu(t,e[n][0]);return t}function zT(e,t){let n=lg(e);for(let r=0;r!==t.length;++r){let i=t[r];i[0]<e&&(n[i[0]]=i[1])}return n}function Ob(e,t={}){let{size:n,minNumElements:r=0,maxLength:i=In,maxNumElements:o=i,noTrailingHole:s,depthIdentifier:a}=t,l=ii(n,ii(n,r,o,t.maxNumElements!==void 0),i,t.maxLength!==void 0);if(r>i)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(r>o)throw new Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let u=VT(o,i),c=t.maxNumElements!==void 0||n!==void 0?n:"=",d=Mn(B(zu(0,Gu(l-1,0),Gu(i-1,0)),e),{size:c,minLength:r,maxLength:u,selector:p=>p[0],depthIdentifier:a}).map(p=>zT(WT(p)+1,p),p=>{if(!By(p))throw new Error("Not supported entry type");if(s&&p.length!==0&&!(p.length-1 in p))throw new Error("No trailing hole");return V(UT(p),h=>[Number(h[0]),h[1]])});return s||i===r?d:B(d,zu(r,l,i)).map(p=>{let h=p[0],f=p[1];if(h.length>=f)return h;let m=Oe(h);return m.length=f,m},p=>{if(!By(p))throw new Error("Not supported entry type");return[p,p.length]})}function GT(e){return new Set(e)}function HT(e){if(typeof e!="object"||e===null)throw new Error("Incompatible instance received: should be a non-null object");if(!("constructor"in e)||e.constructor!==Set)throw new Error("Incompatible instance received: should be of exact type Set");return Array.from(e)}function Nb(e,t={}){return Mn(e,{minLength:t.minLength,maxLength:t.maxLength,size:t.size,depthIdentifier:t.depthIdentifier,comparator:"SameValueZero"}).map(GT,HT)}function KT(e,t,n,r,i,o){return uc(e,t,{maxKeys:n,noNullPrototype:!o,size:r,depthIdentifier:i})}function qT(e){return Ie(Eb(e),Mb(e),Tb(e),kb(e),Pb(e),Ab(e),Ib(e),Rb(e),Cb(e))}function $b(e){let t=e.values,n=e.depthSize,r=sc(),i=e.maxDepth,o=e.maxKeys,s=e.size,a=Ie(...t,...e.withBigInt?[un()]:[],...e.withDate?[Yg()]:[]);return xb(l=>({anything:Ie({maxDepth:i,depthSize:n,depthIdentifier:r},a,l("array"),l("object"),...e.withMap?[l("map")]:[],...e.withSet?[l("set")]:[],...e.withObjectString?[l("anything").map(u=>ve(u))]:[],...e.withTypedArray?[qT({maxLength:o,size:s})]:[],...e.withSparseArray?[Ob(l("anything"),{maxNumElements:o,size:s,depthIdentifier:r})]:[]),keys:e.withObjectString?Ie({arbitrary:e.key,weight:10},{arbitrary:l("anything").map(u=>ve(u)),weight:1}):e.key,array:se(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),set:Nb(l("anything"),{maxLength:o,size:s,depthIdentifier:r}),map:Ie(Wu(l("keys"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r}),Wu(l("anything"),l("anything"),{maxKeys:o,size:s,depthIdentifier:r})),object:KT(l("keys"),l("anything"),o,s,r,e.withNullPrototype)})).anything}function YT(e){switch(typeof e){case"boolean":return new ug(e);case"number":return new Vt(e);case"string":return new _e(e);default:return e}}function ZT(e){return typeof e!="object"||e===null||!("constructor"in e)?e:e.constructor===ug||e.constructor===Vt||e.constructor===_e?e.valueOf():e}function JT(e){return e.map(YT,ZT)}function XT(e,t){return[ai(),bb(),ls(),t(e),Ie(t(e),xe(null),xe(void 0))]}function QT(e){return e.map(t=>JT(t))}function e6(e,t){return t?QT(e).concat(e):e}function Lb(e={}){let t={size:e.size,unit:"stringUnit"in e?e.stringUnit:e.withUnicodeString?"binary":void 0};return{key:e.key!==void 0?e.key:Ee(t),values:e6(e.values!==void 0?e.values:XT(t,Ee),e.withBoxedValues===!0),depthSize:e.depthSize,maxDepth:e.maxDepth,maxKeys:e.maxKeys,size:e.size,withSet:e.withSet===!0,withMap:e.withMap===!0,withObjectString:e.withObjectString===!0,withNullPrototype:e.withNullPrototype===!0,withBigInt:e.withBigInt===!0,withDate:e.withDate===!0,withTypedArray:e.withTypedArray===!0,withSparseArray:e.withSparseArray===!0}}function t6(e){return uc(e.key,$b(e),{maxKeys:e.maxKeys,noNullPrototype:!e.withNullPrototype,size:e.size})}function n6(e){return t6(Lb(e))}function r6(e,t){let{depthSize:n,maxDepth:r}=t;return{key:e,values:[ai(),ls({noDefaultInfinity:!0,noNaN:!0}),e,xe(null)],depthSize:n,maxDepth:r}}function Db(e){return $b(Lb(e))}function _b(e={}){let t=e.noUnicodeString===void 0||e.noUnicodeString===!0;return Db(r6("stringUnit"in e?Ee({unit:e.stringUnit}):t?Ee():Ee({unit:"binary"}),e))}var i6=JSON.stringify,o6=JSON.parse;function s6(e){if(typeof e!="string")throw new P("Cannot unmap the passed value");return o6(e)}function a6(e={}){return _b(e).map(i6,s6)}var l6=Object.defineProperties;function yu(e,t){return`Stream(${t!==void 0?`${le(t,",")}\u2026`:`${e} emitted`})`}var u6=class extends ue{constructor(e,t){super(),this.arb=e,this.history=t}generate(e,t){let n=t!==void 0&&e.nextInt(1,t)===1?t:void 0,r=()=>{let i=this.history?[]:null,o=0,s=function*(a,l){for(;;){let u=a.generate(l,n).value;o++,i!==null&&I(i,u),yield u}};return l6(new _(s(this.arb,e.clone())),{toString:{value:()=>yu(o,i!==null?i.map(ve):void 0)},[pt]:{value:()=>yu(o,i!==null?i.map(ve):void 0)},[Wt]:{value:async()=>yu(o,i!==null?await Promise.all(i.map(nc)):void 0)},[Me]:{value:r,enumerable:!0}})};return new M(r(),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function c6(e,t){return new u6(e,t!==void 0&&typeof t=="object"&&"noHistory"in t?!t.noHistory:!0)}function d6(e){return le(e,"")}function Fy(e){if(typeof e!="string")throw new Error("Cannot unmap the passed value");return[...e]}function f6(e){switch(e.length%4){case 0:return e;case 3:return`${e}=`;case 2:return`${e}==`;default:return me(e,1)}}function p6(e){if(typeof e!="string"||e.length%4!==0)throw new Error("Invalid string received");let t=e.indexOf("=");if(t===-1)return e;if(e.length-t>2)throw new Error("Cannot unmap the passed value");return me(e,0,t)}var gu=String.fromCharCode;function h6(e){return e<26?gu(e+65):e<52?gu(e+97-26):e<62?gu(e+48-52):e===62?"+":"/"}function m6(e){if(typeof e!="string"||e.length!==1)throw new P("Invalid entry");let t=er(e,0);return t>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:t===43?62:t===47?63:-1}function y6(){return ee({min:0,max:63}).map(h6,m6)}function g6(e={}){let{minLength:t=0,maxLength:n=In,size:r}=e,i=t+3-(t+3)%4,o=n-n%4,s=e.maxLength===void 0&&r===void 0?"=":r;if(i>o)throw new P("Minimal length should be inferior or equal to maximal length");if(i%4!==0)throw new P("Minimal length of base64 strings must be a multiple of 4");if(o%4!==0)throw new P("Maximal length of base64 strings must be a multiple of 4");let a=y6();return se(a,{minLength:i,maxLength:o,size:s,experimentalCustomSlices:XI(a,Fy)}).map(d6,Fy).map(f6,p6)}var jy=Object.is;function b6(e,t){let n=new Ut,r=0;for(let i of e)jy(i,-0)?++r:dt(n,i,(Ze(n,i)||0)+1);for(let i=0;i!==t.length;++i){if(!(i in t))return!1;let o=t[i];if(jy(o,-0)){if(r===0)return!1;--r}else{let s=Ze(n,o)||0;if(s===0)return!1;dt(n,o,s-1)}}return!0}var S6=Math.floor,Vy=Math.log,w6=Array.isArray,Bb=class extends ue{constructor(e,t,n,r){if(super(),this.originalArray=e,this.isOrdered=t,this.minLength=n,this.maxLength=r,n<0||n>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(r<0||r>e.length)throw new Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(n>r)throw new Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new nr(n,r),this.biasedLengthArb=n!==r?new nr(n,n+S6(Vy(r-n)/Vy(2))):this.lengthArb}generate(e,t){let n=(t!==void 0&&e.nextInt(1,t)===1?this.biasedLengthArb:this.lengthArb).generate(e,void 0),r=n.value,i=V(this.originalArray,(s,a)=>a),o=[];for(let s=0;s!==r;++s){let a=e.nextInt(0,i.length-1);I(o,i[a]),hg(i,a,1)}return this.isOrdered&&mg(o,(s,a)=>s-a),new M(V(o,s=>this.originalArray[s]),n.context)}canShrinkWithoutContext(e){return!w6(e)||!this.lengthArb.canShrinkWithoutContext(e.length)?!1:b6(this.originalArray,e)}shrink(e,t){return e.length===0?_.nil():this.lengthArb.shrink(e.length,t).map(n=>new M(Oe(e,e.length-n.value),n.context)).join(e.length>this.minLength?an(()=>this.shrink(Oe(e,1),void 0).filter(n=>this.minLength<=n.value.length+1).map(n=>new M([e[0],...n.value],void 0))):_.nil())}};function x6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new Bb(e,!0,n,r)}function v6(e,t={}){let{minLength:n=0,maxLength:r=e.length}=t;return new Bb(e,!1,n,r)}var R6={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},C6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function k6(e){return e<10?_e(e):R6[e]}function Uy(e,t){let n="";for(;e.length+n.length<t;)n+="0";return n+e}function Wy(e){let t="";for(let n=e;n!==0;){let r=n>>5;t=k6(n-(r<<5))+t,n=r}return t}function A6(e,t){let n=~~(e/1073741824),r=e&1073741823;return Uy(Wy(n),t-6)+Uy(Wy(r),6)}function Fb(e){return function(n){return A6(n,e)}}function bu(e){if(typeof e!="string")throw new P("Unsupported type");let t=0,n=1;for(let r=e.length-1;r>=0;--r){let i=C6[e[r]];if(i===void 0)throw new P("Unsupported type");t+=i*n,n*=32}return t}var E6=Fb(10),zy=Fb(8);function P6(e){return E6(e[0])+zy(e[1])+zy(e[2])}function I6(e){if(typeof e!="string"||e.length!==26)throw new Error("Unsupported type");return[bu(e.slice(0,10)),bu(e.slice(10,18)),bu(e.slice(18))]}function M6(){return B(ee({min:0,max:0xffffffffffff}),ee({min:0,max:0xffffffffff}),ee({min:0,max:0xffffffffff})).map(P6,I6)}function jb(e){return mE(ni(e,16),8,"0")}function T6(e){if(typeof e!="string")throw new Error("Unsupported type");if(e.length!==8)throw new Error("Unsupported value: invalid length");let t=parseInt(e,16);if(e!==jb(t))throw new Error("Unsupported value: invalid content");return t}function Su(e,t){return ee({min:e,max:t}).map(jb,T6)}function O6(e){return`${e[0]}-${me(e[1],4)}-${me(e[1],0,4)}-${me(e[2],0,4)}-${me(e[2],4)}${e[3]}`}var N6=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function $6(e){if(typeof e!="string")throw new Error("Unsupported type");let t=N6.exec(e);if(t===null)throw new Error("Unsupported type");return[t[1],t[3]+t[2],t[4]+me(t[5],0,4),me(t[5],4)]}var Gy="0123456789abcdef";function L6(e){let t={},n={};for(let o=0;o!==e.length;++o){let s=Gy[o],a=Gy[e[o]];t[s]=a,n[a]=s}function r(o){return t[o[0]]+me(o,1)}function i(o){if(typeof o!="string")throw new P("Cannot produce non-string values");let s=n[o[0]];if(s===void 0)throw new P("Cannot produce strings not starting by the version in hexa code");return s+me(o,1)}return{versionsApplierMapper:r,versionsApplierUnmapper:i}}function D6(e){let t={};for(let n of e){if(t[n])throw new P(`Version ${n} has been requested at least twice for uuid`);if(t[n]=!0,n<1||n>15)throw new P(`Version must be a value in [1-15] for uuid, but received ${n}`);if(~~n!==n)throw new P(`Version must be an integer value for uuid, but received ${n}`)}if(e.length===0)throw new P("Must provide at least one version for uuid")}function _6(e={}){let t=Su(0,4294967295),n=e.version!==void 0?typeof e.version=="number"?[e.version]:e.version:[1,2,3,4,5,6,7,8];D6(n);let{versionsApplierMapper:r,versionsApplierUnmapper:i}=L6(n);return B(t,Su(0,268435456*n.length-1).map(r,i),Su(2147483648,3221225471),t).map(O6,$6)}function B6(e){return Ee({unit:fc("-._~!$&'()*+,;=:"),size:e})}function F6([e,t,n]){return(e===null?"":`${e}@`)+t+(n===null?"":`:${n}`)}function j6(e){if(typeof e!="string")throw new Error("Unsupported");let t=e.indexOf("@"),n=t!==-1?e.substring(0,t):null,r=/:(\d+)$/.exec(e),i=r!==null?Number(r[1]):null;return[n,r!==null?e.substring(t+1,e.length-r[1].length-1):e.substring(t+1),i]}function V6(e){return`[${e}]`}function U6(e){if(typeof e!="string"||e[0]!=="["||e[e.length-1]!=="]")throw new Error("Unsupported");return e.substring(1,e.length-1)}function Vb(e){let t=e||{},n=t.size,r=[pc({size:n}),...t.withIPv4===!0?[gc()]:[],...t.withIPv6===!0?[wb().map(V6,U6)]:[],...t.withIPv4Extended===!0?[Sb()]:[]];return B(t.withUserInfo===!0?zt(B6(n)):xe(null),Ie(...r),t.withPort===!0?zt(sn(65535)):xe(null)).map(F6,j6)}function Ub(e){return Ee({unit:fc("-._~!$&'()*+,;=:@/?"),size:e})}function Wb(e={}){return Ub(e.size)}function zb(e={}){return Ee({unit:fc("-._~!$&'()*+,;=:@"),size:e.size})}function W6(e){return le(V(e,t=>`/${t}`),"")}function z6(e){if(typeof e!="string")throw new Error("Incompatible value received: type");if(e.length!==0&&e[0]!=="/")throw new Error("Incompatible value received: start");return hg(Be(e,"/"),1)}function G6(e){switch(e){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function wu(e,t){return se(zb({size:e}),{size:t}).map(W6,z6)}function H6(e){let[t,n]=G6(e);return t===n?wu(t,n):Ie(wu(t,n),wu(n,t))}function Gb(e){return H6(lc((e||{}).size))}function Hb(e={}){return Ub(e.size)}function K6(e){let[t,n,r]=e;return`${t}://${n}${r}${e[3]===null?"":`?${e[3]}`}${e[4]===null?"":`#${e[4]}`}`}var q6=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function Y6(e){if(typeof e!="string")throw new Error("Incompatible value received: type");let t=q6.exec(e);if(t===null)throw new Error("Incompatible value received");let n=t[1],r=t[2],i=t[3],o=t[4],s=t[5];return[n,r,i,o!==void 0?o.substring(1):null,s!==void 0?s.substring(1):null]}function Z6(e){let t=e||{},n=lc(t.size),r=t.authoritySettings!==void 0&&t.authoritySettings.size!==void 0?si(t.authoritySettings.size,n):n,i={...t.authoritySettings,size:r};return B(At(...t.validSchemes||["http","https"]),Vb(i),Gb({size:n}),t.withQueryParameters===!0?zt(Hb({size:n})):xe(null),t.withFragments===!0?zt(Wb({size:n})):xe(null)).map(K6,Y6)}var J6=class Kb{constructor(t,n){this.commands=t,this.metadataForReplay=n,this[Me]=function(){return new Kb(this.commands.map(r=>r.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let t=this.commands.filter(r=>r.hasRan).map(r=>r.toString()).join(","),n=this.metadataForReplay();return n.length!==0?`${t} /*${n}*/`:t}},X6=class Hu{constructor(t){if(this.cmd=t,this.hasRan=!1,ec(t)){let n=t[pt];this[pt]=function(){return n.call(t)}}if(tc(t)){let n=t[Wt];this[Wt]=function(){return n.call(t)}}}check(t){return this.cmd.check(t)}run(t,n){return this.hasRan=!0,this.cmd.run(t,n)}clone(){return Pn(this.cmd)?new Hu(this.cmd[Me]()):new Hu(this.cmd)}toString(){return this.cmd.toString()}},Hy=class{static parse(e){let[t,n]=e.split(":"),r=this.parseCounts(t),i=this.parseChanges(n);return this.parseOccurences(r,i)}static stringify(e){let t=this.countOccurences(e);return`${this.stringifyCounts(t)}:${this.stringifyChanges(t)}`}static intToB64(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e+97-26):e<62?String.fromCharCode(e+48-52):String.fromCharCode(e===62?43:47)}static b64ToInt(e){return e>="a"?e.charCodeAt(0)-97+26:e>="A"?e.charCodeAt(0)-65:e>="0"?e.charCodeAt(0)-48+52:e==="+"?62:63}static countOccurences(e){return e.reduce((t,n)=>(t.length===0||t[t.length-1].count===64||t[t.length-1].value!==n?t.push({value:n,count:1}):t[t.length-1].count+=1,t),[])}static parseOccurences(e,t){let n=[];for(let r=0;r!==e.length;++r){let i=e[r],o=t[r];for(let s=0;s!==i;++s)n.push(o)}return n}static stringifyChanges(e){let t="";for(let n=0;n<e.length;n+=6){let r=e.slice(n,n+6).reduceRight((i,o)=>(i<<1)+(o.value?1:0),0);t+=this.intToB64(r)}return t}static parseChanges(e){let t=e.split("").map(r=>this.b64ToInt(r)),n=[];for(let r=0;r!==t.length;++r){let i=t[r];for(let o=0;o!==6;++o,i>>=1)n.push(i%2===1)}return n}static stringifyCounts(e){return e.map(({count:t})=>this.intToB64(t-1)).join("")}static parseCounts(e){return e.split("").map(t=>this.b64ToInt(t)+1)}},Q6=class extends ue{constructor(e,t,n,r,i){super(),this.sourceReplayPath=r,this.disableReplayLog=i,this.oneCommandArb=Ie(...e).map(o=>new X6(o)),this.lengthArb=zu(0,t,n),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(Hy.stringify(this.replayPath))}`}buildValueFor(e,t){let n=e.map(i=>i.value_),r={shrunkOnce:t,items:e};return new M(new J6(n,()=>this.metadataForReplay()),r)}generate(e){let t=this.lengthArb.generate(e,void 0).value,n=Array(t);for(let r=0;r!==t;++r)n[r]=this.oneCommandArb.generate(e,void 0);return this.replayPathPosition=0,this.buildValueFor(n,!1)}canShrinkWithoutContext(e){return!1}filterOnExecution(e){let t=[];for(let n of e)n.value_.hasRan?(this.replayPath.push(!0),t.push(n)):this.replayPath.push(!1);return t}filterOnReplay(e){return e.filter((t,n)=>{let r=this.replayPath[this.replayPathPosition+n];if(r===void 0)throw new Error("Too short replayPath");if(!r&&t.value_.hasRan)throw new Error("Mismatch between replayPath and real execution");return r})}filterForShrinkImpl(e){this.replayPathPosition===0&&(this.replayPath=this.sourceReplayPath!==null?Hy.parse(this.sourceReplayPath):[]);let t=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(e):this.filterOnExecution(e);return this.replayPathPosition+=e.length,t}shrink(e,t){if(t===void 0)return _.nil();let n=t,r=n.shrunkOnce,i=n.items,o=this.filterForShrinkImpl(i);if(o.length===0)return _.nil();let s=r?_.nil():new _([[]][Symbol.iterator]()),a=[];for(let l=0;l!==o.length;++l)a.push(an(()=>{let u=o.slice(0,l);return this.lengthArb.shrink(o.length-1-l,void 0).map(c=>u.concat(o.slice(o.length-(c.value+1))))}));for(let l=0;l!==o.length;++l)a.push(an(()=>this.oneCommandArb.shrink(o[l].value_,o[l].context).map(u=>o.slice(0,l).concat([u],o.slice(l+1)))));return s.join(...a).map(l=>this.buildValueFor(l.map(u=>new M(u.value_.clone(),u.context)),!0))}};function e4(e,t={}){let{size:n,maxCommands:r=In,disableReplayLog:i=!1,replayPath:o=null}=t;return new Q6(e,ii(n,0,r,t.maxCommands!==void 0),r,o,i)}var t4=class{constructor(e,t){this.s=e,this.cmd=t}async check(e){let t=null,n=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{n=await Promise.resolve(this.cmd.check(e))}catch(r){throw t=r,r}}}]).task).faulty)throw t;return n}async run(e,t){let n=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(e,t)}catch(r){throw n=r,r}}}]).task).faulty)throw n}},n4=function*(e,t){for(let n of t)yield new t4(e,n)},qb=(e,t,n,r,i)=>e.then(o=>{let{model:s,real:a}=o,l=n;for(let u of t)l=i(l,()=>r(u,s,a));return l}),r4=(e,t)=>qb({then:o=>{o(e())}},t,void 0,(o,s,a)=>{o.check(s)&&o.run(s,a)},(o,s)=>s()),i4=e=>typeof e.then=="function",Yb=async(e,t,n=Promise.resolve())=>await qb({then:s=>{let a=e();return i4(a)?a.then(s):s(a)}},t,n,async(s,a,l)=>{await s.check(a)&&await s.run(a,l)},(s,a)=>s.then(a));function o4(e,t){r4(e,t)}async function s4(e,t){await Yb(e,t)}async function a4(e,t,n){let r=Yb(t,n4(e,n),e.schedule(Promise.resolve(),"startModel"));await e.waitFor(r),await e.waitAll()}var Ho=e=>e(),Zb=class Ku{constructor(t,n){this.act=t,this.taskSelector=n,this.lastTaskId=0,this.sourceTaskSelector=n.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[Me]=function(){return new Ku(this.act,this.sourceTaskSelector)}}static buildLog(t){return`[task\${${t.taskId}}] ${t.label.length!==0?`${t.schedulingType}::${t.label}`:t.schedulingType} ${t.status}${t.outputValue!==void 0?` with value ${dM(t.outputValue)}`:""}`}log(t,n,r,i,o,s){this.triggeredTasks.push({status:o,schedulingType:t,taskId:n,label:r,metadata:i,outputValue:s!==void 0?ve(s):void 0})}scheduleInternal(t,n,r,i,o,s){let a=++this.lastTaskId,l,u=new Promise((c,d)=>{l=()=>{let p=Promise.resolve(s!==void 0?r.then(()=>s()):r);return p.then(h=>{this.log(t,a,n,i,"resolved",h),c(h)},h=>{this.log(t,a,n,i,"rejected",h),d(h)}),p}});return this.scheduledTasks.push({original:r,trigger:l,schedulingType:t,taskId:a,label:n,metadata:i,customAct:o}),this.scheduledWatchers.length!==0&&this.scheduledWatchers[0](),u}schedule(t,n,r,i){return this.scheduleInternal("promise",n||"",t,r,i||Ho)}scheduleFunction(t,n){return(...r)=>this.scheduleInternal("function",`${t.name}(${r.map(ve).join(",")})`,t(...r),void 0,n||Ho)}scheduleSequence(t,n){let r={done:!1,faulty:!1},i={then:c=>c()},o=()=>{},s=new Promise(c=>{o=()=>c({done:r.done,faulty:r.faulty})}),a=()=>{r.faulty=!0,o()},l=()=>{r.done=!0,o()},u=(c,d)=>{if(c>=t.length){d.then(l,a);return}d.then(()=>{let p=t[c],[h,f,m]=typeof p=="function"?[p,p.name,void 0]:[p.builder,p.label,p.metadata],y=this.scheduleInternal("sequence",f,i,m,n||Ho,()=>h());u(c+1,y)},a)};return u(0,i),Object.assign(r,{task:s})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw new Error("No task scheduled");let t=this.taskSelector.nextTaskIndex(this.scheduledTasks),[n]=this.scheduledTasks.splice(t,1);return n.customAct(()=>n.trigger().catch(r=>{}))}waitOne(t){let n=t||Ho;return this.act(()=>n(()=>this.internalWaitOne()))}async waitAll(t){for(;this.scheduledTasks.length>0;)await this.waitOne(t)}async internalWaitFor(t,n){let r=!1,i=n.customAct,o=n.onWaitStart,s=n.onWaitIdle,a=n.launchAwaiterOnInit,l,u,c=0,d=null,p=null,h=async()=>{for(c=50,c=50;!r&&c>0;--c)await Promise.resolve();if(!r&&this.scheduledTasks.length>0)return o!==void 0&&o(),p=this.waitOne(i),p.then(()=>(p=null,h()),S=>{throw p=null,r=!0,u(S),S});!r&&s!==void 0&&s(),d=null},f=()=>{if(d!==null){c=51;return}d=h().catch(()=>{})},m=()=>{let S=this.scheduledWatchers.indexOf(f);S!==-1&&this.scheduledWatchers.splice(S,1),S===0&&this.scheduledWatchers.length!==0&&this.scheduledWatchers[0]()},y=new Promise((S,w)=>{l=b=>{m(),S(b)},u=b=>{m(),w(b)}});return t.then(S=>{r=!0,p===null?l(S):p.then(()=>l(S),w=>u(w))},S=>{r=!0,p===null?u(S):p.then(()=>u(S),()=>u(S))}),(this.scheduledTasks.length>0||a)&&this.scheduledWatchers.length===0&&f(),this.scheduledWatchers.push(f),y}waitNext(t,n){let r,i=t,o=i<=0?Promise.resolve():new Promise(s=>{r=()=>{--i<=0&&s()}});return this.internalWaitFor(o,{customAct:n,onWaitStart:r,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(t){let n,r=new Promise(i=>n=i);return this.internalWaitFor(r,{customAct:t,onWaitStart:void 0,onWaitIdle:n,launchAwaiterOnInit:!0})}waitFor(t,n){return this.internalWaitFor(t,{customAct:n,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map(t=>({status:"pending",schedulingType:t.schedulingType,taskId:t.taskId,label:t.label,metadata:t.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Ku.buildLog).map(t=>`-> ${t}`).join(`
53
+ `)+"`"}};function Jb(e){let t=0;return{clone:()=>Jb(e),nextTaskIndex:n=>{if(e.length<=t)throw new Error("Invalid schedulerFor defined: too many tasks have been scheduled");let r=n.findIndex(i=>i.taskId===e[t]);if(r===-1)throw new Error("Invalid schedulerFor defined: unable to find next task");return++t,r}}}function Ky(e,t){return new Zb(e,Jb(t))}function Xb(e){let t=e.clone();return{clone:()=>Xb(t),nextTaskIndex:n=>e.nextInt(0,n.length-1)}}var l4=class extends ue{constructor(e){super(),this.act=e}generate(e,t){return new M(new Zb(this.act,Xb(e.clone())),void 0)}canShrinkWithoutContext(e){return!1}shrink(e,t){return _.nil()}};function u4(e){let{act:t=n=>n()}=e||{};return new l4(t)}function c4(e,t){let{act:n=r=>r()}=Array.isArray(e)?t||{}:e||{};return Array.isArray(e)?Ky(n,e):function(r,...i){return Ky(n,i)}}function d4(e={}){return Gt(e,E("-9223372036854775808"),E("9223372036854775807"),wA,un)}function f4(e={}){return Gt(e,E(0),E("18446744073709551615"),xA,un)}function p4(e,t){return t}var xu=Math.floor,h4=Math.min;function et(e,t){switch(e.type){case"Char":return{astNode:e,minLength:1};case"Repetition":switch(e.quantifier.kind){case"*":{let n=et(e.expression,t);return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:t},expression:n.astNode},minLength:0}}case"+":{let n=et(e.expression,t),r=n.minLength>1?n.minLength:1;return{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:1,to:xu(t/r)},expression:n.astNode},minLength:n.minLength}}case"?":{let n=et(e.expression,t);return t<n.minLength?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",from:0,to:0},expression:n.astNode},minLength:0}:{astNode:{...e,expression:n.astNode},minLength:0}}case"Range":{let n=e.quantifier.from>1?xu(t/e.quantifier.from):t,r=et(e.expression,n),i=r.minLength>1?r.minLength:1;return e.quantifier.to===void 0||e.quantifier.to*i>t?{astNode:{type:"Repetition",quantifier:{...e.quantifier,kind:"Range",to:xu(t/i)},expression:r.astNode},minLength:e.quantifier.from*r.minLength}:{astNode:{...e,expression:r.astNode},minLength:e.quantifier.from*r.minLength}}default:return p4(e.quantifier,{astNode:e,minLength:0})}case"Quantifier":return{astNode:e,minLength:0};case"Alternative":{let n=0,r=[];for(let o=0;o!==e.expressions.length;++o){let s=t-n,a=et(e.expressions[o],s);n+=a.minLength,I(r,{value:a,allowance:s})}let i=[];for(let o=0;o!==r.length;++o){let s=r[o].value,a=r[o].allowance,l=t-n+s.minLength;I(i,(l!==a?et(s.astNode,l):s).astNode)}return{astNode:{...e,expressions:i},minLength:n}}case"CharacterClass":return{astNode:e,minLength:1};case"ClassRange":return{astNode:e,minLength:1};case"Group":{let n=et(e.expression,t);return{astNode:{...e,expression:n.astNode},minLength:n.minLength}}case"Disjunction":{if(e.left===null){if(e.right===null)return{astNode:e,minLength:0};let i=et(e.right,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:null,right:o},minLength:0}}if(e.right===null){let i=et(e.left,t),o=i.minLength>t?null:i.astNode;return{astNode:{...e,left:o,right:null},minLength:0}}let n=et(e.left,t),r=et(e.right,t);return n.minLength>t?r:r.minLength>t?n:{astNode:{...e,left:n.astNode,right:r.astNode},minLength:h4(n.minLength,r.minLength)}}case"Assertion":return{astNode:e,minLength:0};case"Backreference":return{astNode:e,minLength:0};case"UnicodeProperty":return{astNode:e,minLength:1}}}function m4(e,t){return et(e,t).astNode}function y4(e){return new Error(`Unsupported AST node! Received: ${ve(e)}`)}function Qo(e,t,n){if(!t&&!n)return e;let r={hasStart:!1,hasEnd:!1},i=Qb(e,t,n,r),o=t&&!r.hasStart,s=n&&!r.hasEnd;if(!o&&!s)return i;let a=[];return o&&(a.push({type:"Assertion",kind:"^"}),a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}})),a.push(i),s&&(a.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),a.push({type:"Assertion",kind:"$"})),{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:a}}}function Qb(e,t,n,r){switch(e.type){case"Char":return e;case"Repetition":return e;case"Quantifier":throw new Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return r.hasStart=!0,r.hasEnd=!0,{...e,expressions:e.expressions.map((i,o)=>Qo(i,t&&o===0,n&&o===e.expressions.length-1))};case"CharacterClass":return e;case"ClassRange":return e;case"Group":return{...e,expression:Qb(e.expression,t,n,r)};case"Disjunction":return r.hasStart=!0,r.hasEnd=!0,{...e,left:e.left!==null?Qo(e.left,t,n):null,right:e.right!==null?Qo(e.right,t,n):null};case"Assertion":if(e.kind==="^"||e.kind==="Lookahead")return r.hasStart=!0,e;if(e.kind==="$"||e.kind==="Lookbehind")return r.hasEnd=!0,e;throw new Error(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":return e;case"UnicodeProperty":return e;default:throw y4(e)}}function g4(e){return Qo(e,!0,!0)}function qy(e,t){return e[t]>="\uD800"&&e[t]<="\uDBFF"&&e[t+1]>="\uDC00"&&e[t+1]<="\uDFFF"?2:1}function Ae(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function qu(e){return e>="0"&&e<="9"}function eS(e,t){for(let n=t;n!==e.length;++n){let r=e[n];if(r==="\\")n+=1;else if(r==="]")return n}throw new Error("Missing closing ']'")}function b4(e,t){let n=0;for(let r=t;r!==e.length;++r){let i=e[r];if(i==="\\")r+=1;else if(i===")"){if(n===0)return r;n-=1}else i==="["?r=eS(e,r):i==="("&&(n+=1)}throw new Error("Missing closing ')'")}function S4(e,t){let n=!1;for(let r=t;r!==e.length;++r){let i=e[r];if(!qu(i)){if(t===r)return-1;if(i===","){if(n)return-1;n=!0}else return i==="}"?r:-1}}return-1}function w4(e,t,n,r){switch(e[t]){case"[":return r===1?t+1:eS(e,t+1)+1;case"{":{if(r===1)return t+1;let i=S4(e,t+1);return i===-1?t+1:i+1}case"(":return r===1?t+1:b4(e,t+1)+1;case"]":case"}":case")":return t+1;case"\\":{let i=e[t+1];switch(i){case"x":if(Ae(e[t+2])&&Ae(e[t+3]))return t+4;throw new Error(`Unexpected token '${e.substring(t,t+4)}' found`);case"u":if(e[t+2]==="{"){if(!n)return t+2;if(e[t+4]==="}"){if(Ae(e[t+3]))return t+5;throw new Error(`Unexpected token '${e.substring(t,t+5)}' found`)}if(e[t+5]==="}"){if(Ae(e[t+3])&&Ae(e[t+4]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`)}if(e[t+6]==="}"){if(Ae(e[t+3])&&Ae(e[t+4])&&Ae(e[t+5]))return t+7;throw new Error(`Unexpected token '${e.substring(t,t+7)}' found`)}if(e[t+7]==="}"){if(Ae(e[t+3])&&Ae(e[t+4])&&Ae(e[t+5])&&Ae(e[t+6]))return t+8;throw new Error(`Unexpected token '${e.substring(t,t+8)}' found`)}if(e[t+8]==="}"&&Ae(e[t+3])&&Ae(e[t+4])&&Ae(e[t+5])&&Ae(e[t+6])&&Ae(e[t+7]))return t+9;throw new Error(`Unexpected token '${e.substring(t,t+9)}' found`)}if(Ae(e[t+2])&&Ae(e[t+3])&&Ae(e[t+4])&&Ae(e[t+5]))return t+6;throw new Error(`Unexpected token '${e.substring(t,t+6)}' found`);case"p":case"P":{if(!n)return t+2;let o=t+2;for(;o<e.length&&e[o]!=="}";o+=e[o]==="\\"?2:1);if(e[o]!=="}")throw new Error("Invalid \\P definition");return o+1}case"k":{let o=t+2;for(;o<e.length&&e[o]!==">";++o);if(e[o]!==">"){if(!n)return t+2;throw new Error("Invalid \\k definition")}return o+1}default:if(qu(i)){let o=n?e.length:Math.min(t+4,e.length),s=t+2;for(;s<o&&qu(e[s]);++s);return s}return t+(n?qy(e,t+1):1)+1}}default:return t+(n?qy(e,t):1)}}function Ko(e,t,n,r){let i=w4(e,t,n,r);return e.substring(t,i)}var Yy={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},us={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},oi=xc(us),wc={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},Yu=xc(wc),tS={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},Zy=xc(tS);function xc(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r))for(let i=0;i!==r.length;++i)t[r[i]]=n;else t[r]=n}return t}function x4(e){return e in wc||e in Yu}function v4(e){return e in us||e in oi}function Jy(e){if(e in Yy)return Yy[e];if(e in oi)return oi[e];if(e in us||e==="General_Category"||e==="Script"||e==="Script_Extensions")return e;throw new Error(`Unknown Unicode property name: ${e}`)}function Xy(e){if(e in Yu)return Yu[e];if(e in Zy)return Zy[e];if(e in oi)return oi[e];if(e in wc||e in tS||e in us)return e;throw new Error(`Unknown Unicode property value: ${e}`)}function R4(e,t){let n=e.indexOf("=");if(n!==-1){let r=e.substring(0,n),i=e.substring(n+1);return{type:"UnicodeProperty",name:r,value:i,negative:t,shorthand:!1,binary:!1,canonicalName:Jy(r),canonicalValue:Xy(i)}}if(x4(e))return{type:"UnicodeProperty",name:"General_Category",value:e,negative:t,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:Xy(e)};if(v4(e)){let r=Jy(e);return{type:"UnicodeProperty",name:e,value:e,negative:t,shorthand:!1,binary:!0,canonicalName:r,canonicalValue:r}}throw new Error(`Invalid Unicode property: ${e}`)}var vu=String.fromCodePoint;function Ru(e){let t=e.pop();if(t===void 0)throw new Error("Unable to extract token preceeding the currently parsed one");return t}function nS(e){return e>="0"&&e<="9"}function es(e,t){return{type:"Char",kind:"simple",symbol:e,value:e,codePoint:e.codePointAt(0)||-1,escaped:t}}function Zn(e,t){return{type:"Char",kind:"meta",symbol:t,value:e,codePoint:t.codePointAt(0)||-1}}function rn(e,t){if(e.length>1)return{type:"Alternative",expressions:e};if(!t&&e.length===0)throw new Error("Unsupported no token");return e[0]}function Cu(e){if(e[0]==="\\"){let t=e[1];switch(t){case"x":{let n=e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"hex",symbol:vu(r),value:e,codePoint:r}}case"u":{if(e==="\\u")return es("u",!0);let n=e[2]==="{"?e.substring(3,e.length-1):e.substring(2),r=Number.parseInt(n,16);return{type:"Char",kind:"unicode",symbol:vu(r),value:e,codePoint:r}}case"0":return Zn(e,"\0");case"n":return Zn(e,`
54
+ `);case"f":return Zn(e,"\f");case"r":return Zn(e,"\r");case"t":return Zn(e," ");case"v":return Zn(e,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:e,codePoint:NaN};default:if(nS(t)){let n=e.substring(1),r=Number(n);return{type:"Char",kind:"decimal",symbol:vu(r),value:e,codePoint:r}}if(e.length>2&&(t==="p"||t==="P")){let n=t==="P";return R4(e.substring(3,e.length-1),n)}return es(e.substring(1),!0)}}return es(e)}function Jn(e,t,n,r){let i=null;for(let o=0,s=Ko(t,o,n,0);o!==t.length;o+=s.length,s=Ko(t,o,n,0)){let a=s[0];switch(a){case"|":i===null&&(i=[]),i.push(rn(e.splice(0),!0)||null);break;case".":e.push({type:"Char",kind:"meta",symbol:s,value:s,codePoint:NaN});break;case"*":case"+":{let l=Ru(e);e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"?":{let l=Ru(e);l.type==="Repetition"?(l.quantifier.greedy=!1,e.push(l)):e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:a,greedy:!0}});break}case"{":{if(s==="{"){e.push(es(s));break}let l=Ru(e),u=s.substring(1,s.length-1).split(","),c=Number(u[0]),d=u.length===1?c:u[1].length!==0?Number(u[1]):void 0;e.push({type:"Repetition",expression:l,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:c,to:d}});break}case"[":{let l=s.substring(1,s.length-1),u=[],c,d=!1;for(let p=0,h=Ko(l,p,n,1);p!==l.length;p+=h.length,h=Ko(l,p,n,1)){if(p===0&&h==="^"){c=!0;continue}let f=Cu(h);if(h==="-")u.push(f),d=!0;else{let m=u.length>=2?u[u.length-2]:void 0;d&&m!==void 0&&m.type==="Char"&&f.type==="Char"?(u.pop(),u.pop(),u.push({type:"ClassRange",from:m,to:f})):u.push(f),d=!1}}e.push({type:"CharacterClass",expressions:u,negative:c});break}case"(":{let l=s.substring(1,s.length-1),u=[];if(l[0]==="?")if(l[1]===":")Jn(u,l.substring(2),n,r),e.push({type:"Group",capturing:!1,expression:rn(u)});else if(l[1]==="="||l[1]==="!")Jn(u,l.substring(2),n,r),e.push({type:"Assertion",kind:"Lookahead",negative:l[1]==="!"?!0:void 0,assertion:rn(u)});else if(l[1]==="<"&&(l[2]==="="||l[2]==="!"))Jn(u,l.substring(3),n,r),e.push({type:"Assertion",kind:"Lookbehind",negative:l[2]==="!"?!0:void 0,assertion:rn(u)});else{let c=l.split(">");if(c.length<2||c[0][1]!=="<")throw new Error(`Unsupported regex content found at ${JSON.stringify(s)}`);let d=++r.lastIndex,p=c[0].substring(2);r.named.set(p,d),Jn(u,c.slice(1).join(">"),n,r),e.push({type:"Group",capturing:!0,nameRaw:p,name:p,number:d,expression:rn(u)})}else{let c=++r.lastIndex;Jn(u,l,n,r),e.push({type:"Group",capturing:!0,number:c,expression:rn(u)})}break}default:if(s==="^")e.push({type:"Assertion",kind:s});else if(s==="$")e.push({type:"Assertion",kind:s});else if(s[0]==="\\"&&nS(s[1])){let l=Number(s.substring(1));n||l<=r.lastIndex?e.push({type:"Backreference",kind:"number",number:l,reference:l}):e.push(Cu(s))}else if(s[0]==="\\"&&s[1]==="k"&&s.length!==2){let l=s.substring(3,s.length-1);e.push({type:"Backreference",kind:"name",number:r.named.get(l)||0,referenceRaw:l,reference:l})}else e.push(Cu(s));break}}if(i!==null){i.push(rn(e.splice(0),!0)||null);let o={type:"Disjunction",left:i[0],right:i[1]};for(let s=2;s<i.length;++s)o={type:"Disjunction",left:o,right:i[s]};e.push(o)}}function C4(e){let t=jt([...e.flags],"u")!==-1,n=e.source,r=[];return Jn(r,n,t,{lastIndex:0,named:new Map}),rn(r)}var k4=String.fromCodePoint;function A4(e){return e.binary||e.shorthand?e.canonicalValue:`${e.canonicalName}=${e.canonicalValue}`}function Qy(e,t,n,r){let i=-1;for(let o=t;o<=n;++o)if(e.test(k4(o)))i===-1&&(i=o);else if(i!==-1){let s=o-1;r.push(i===s?[s]:[i,s]),i=-1}i!==-1&&r.push(i===n?[n]:[i,n])}function E4(e,t){let n=new RegExp(`^\\${t?"P":"p"}{${e}}$`,"u"),r=[];return Qy(n,0,55295,r),Qy(n,57344,1114111,r),r}var eg=new Map;function P4(e,t){let n=`${t?"P":"p"}:${e}`,r=eg.get(n);if(r!==void 0)return r;let i=E4(e,t);return eg.set(n,i),i}function I4(e){return rr(...V(P4(A4(e),e.negative),t=>Tu(t)))}var M4=String.fromCodePoint,tg=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],ng=[..."0123456789"],rg=[...` \r
55
+ \v\f`],Zu=[...`\r
56
+ `],rS=[...""],T4=[...Zu,...rS],En=()=>Ee({unit:"grapheme-ascii",minLength:1,maxLength:1});function ig(e){return new P(`Unsupported AST node! Received: ${ve(e)}`)}function on(e,t,n){switch(e.type){case"Char":if(e.kind==="meta")switch(e.value){case"\\w":return At(...tg);case"\\W":return En().filter(r=>jt(tg,r)===-1);case"\\d":return At(...ng);case"\\D":return En().filter(r=>jt(ng,r)===-1);case"\\s":return At(...rg);case"\\S":return En().filter(r=>jt(rg,r)===-1);case"\\b":case"\\B":throw new P(`Meta character ${e.value} not implemented yet!`);case".":{let r=n.dotAll?rS:T4;return En().filter(i=>jt(r,i)===-1)}}if(e.symbol===void 0)throw new P(`Unexpected undefined symbol received for non-meta Char! Received: ${ve(e)}`);return xe(e.symbol);case"Repetition":{let r=on(e.expression,t,n);switch(e.quantifier.kind){case"*":return Ee({...t,unit:r});case"+":return Ee({...t,minLength:1,unit:r});case"?":return Ee({...t,minLength:0,maxLength:1,unit:r});case"Range":return Ee({...t,minLength:e.quantifier.from,maxLength:e.quantifier.to,unit:r});default:throw ig(e.quantifier)}}case"Quantifier":throw new P("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return B(...V(e.expressions,r=>on(r,t,n))).map(r=>le(r,""));case"CharacterClass":if(e.negative){let r=V(e.expressions,i=>on(i,t,n));return En().filter(i=>yg(r,o=>!o.canShrinkWithoutContext(i)))}return Ie(...V(e.expressions,r=>on(r,t,n)));case"ClassRange":{let r=e.from.codePoint,i=e.to.codePoint;return ee({min:r,max:i}).map(o=>M4(o),o=>{if(typeof o!="string")throw new P("Invalid type");if([...o].length!==1)throw new P("Invalid length");return er(o,0)})}case"Group":return on(e.expression,t,n);case"Disjunction":return Ie(e.left!==null?on(e.left,t,n):xe(""),e.right!==null?on(e.right,t,n):xe(""));case"Assertion":if(e.kind==="^"||e.kind==="$")return n.multiline?e.kind==="^"?Ie(xe(""),B(Ee({unit:En()}),At(...Zu)).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new P("Invalid type");return[me(r,0,r.length-1),r[r.length-1]]})):Ie(xe(""),B(At(...Zu),Ee({unit:En()})).map(r=>`${r[0]}${r[1]}`,r=>{if(typeof r!="string"||r.length===0)throw new P("Invalid type");return[r[0],me(r,1)]})):xe("");throw new P(`Assertions of kind ${e.kind} not implemented yet!`);case"Backreference":throw new P("Backreference nodes not implemented yet!");case"UnicodeProperty":return I4(e);default:throw ig(e)}}function O4(e,t={}){for(let a of e.flags)if(a!=="d"&&a!=="g"&&a!=="m"&&a!=="s"&&a!=="u")throw new P(`Unable to use "stringMatching" against a regex using the flag ${a}`);let n=t.maxLength,r={size:t.size,maxLength:n},i={multiline:e.multiline,dotAll:e.dotAll},o=g4(C4(e));n!==void 0&&(o=m4(o,n));let s=on(o,r,i);return n!==void 0?s.filter(a=>[...a].length<=n):s}function N4(e){let t=[];for(let n=0;n!==e.length;++n)t.push(e[n].next());return t}function $4(e,t){for(let n=0;n!==e.length;++n)t[n]=e[n].next()}function L4(e){for(let t=0;t!==e.length;++t)if(e[t].done)return!0;return!1}function*D4(...e){let t=N4(e);for(;!L4(t);)yield t.map(n=>n.value),$4(e,t)}function*_4(e){let t=e;for(;;)yield t,++t}var B4=class extends ue{constructor(e,t){super(),this.arb=e,this.maxShrinks=t}generate(e,t){let n=this.arb.generate(e,t);return this.valueMapper(n,0)}canShrinkWithoutContext(e){return this.arb.canShrinkWithoutContext(e)}shrink(e,t){return this.isSafeContext(t)?this.safeShrink(e,t.originalContext,t.length):this.safeShrink(e,void 0,0)}safeShrink(e,t,n){let r=this.maxShrinks-n;return r<=0?_.nil():new _(D4(this.arb.shrink(e,t),_4(n+1))).take(r).map(i=>this.valueMapper(i[0],i[1]))}valueMapper(e,t){let n={originalContext:e.context,length:t};return new M(e.value,n)}isSafeContext(e){return e!=null&&typeof e=="object"&&"originalContext"in e&&"length"in e}};function F4(e,t){return new B4(e,t)}var j4=Gh({Arbitrary:()=>ue,ExecutionStatus:()=>eP,PreconditionFailure:()=>cn,Random:()=>rc,Stream:()=>_,Value:()=>M,VerbosityLevel:()=>OE,__commitHash:()=>W4,__type:()=>V4,__version:()=>U4,anything:()=>Db,array:()=>se,assert:()=>vP,asyncDefaultReportMessage:()=>Lg,asyncModelRun:()=>s4,asyncProperty:()=>ME,asyncStringify:()=>nc,asyncToStringMethod:()=>Wt,base64String:()=>g6,bigInt:()=>un,bigInt64Array:()=>d4,bigUint64Array:()=>f4,boolean:()=>ai,chainUntil:()=>fI,check:()=>_g,clone:()=>gI,cloneIfNeeded:()=>Xn,cloneMethod:()=>Me,commands:()=>e4,compareBooleanFunc:()=>yM,compareFunc:()=>bM,configureGlobal:()=>EE,constant:()=>xe,constantFrom:()=>At,context:()=>sI,createDepthIdentifier:()=>sc,date:()=>Yg,defaultReportMessage:()=>$g,dictionary:()=>uc,domain:()=>pc,double:()=>ls,emailAddress:()=>M2,entityGraph:()=>yT,falsy:()=>iI,float:()=>mb,float32Array:()=>Rb,float64Array:()=>Cb,func:()=>xM,gen:()=>TP,getDepthContextFor:()=>oc,hasAsyncToStringMethod:()=>tc,hasCloneMethod:()=>Pn,hasToStringMethod:()=>ec,hash:()=>os,infiniteStream:()=>c6,int16Array:()=>kb,int32Array:()=>Ab,int8Array:()=>Eb,integer:()=>ee,ipV4:()=>gc,ipV4Extended:()=>Sb,ipV6:()=>wb,json:()=>a6,jsonValue:()=>_b,letrec:()=>xb,limitShrink:()=>F4,lorem:()=>CT,map:()=>Wu,mapToConstant:()=>rr,maxSafeInteger:()=>bb,maxSafeNat:()=>kM,memo:()=>PT,mixedCase:()=>$T,modelRun:()=>o4,nat:()=>sn,noBias:()=>is,noShrink:()=>ss,object:()=>n6,oneof:()=>Ie,option:()=>zt,pre:()=>rA,property:()=>TE,readConfigureGlobal:()=>ft,record:()=>Uu,resetConfigureGlobal:()=>PE,sample:()=>CP,scheduledModelRun:()=>a4,scheduler:()=>u4,schedulerFor:()=>c4,set:()=>Nb,shuffledSubarray:()=>v6,sparseArray:()=>Ob,statistics:()=>AP,stream:()=>ln,string:()=>Ee,stringMatching:()=>O4,stringify:()=>ve,subarray:()=>x6,toStringMethod:()=>pt,tuple:()=>B,uint16Array:()=>Pb,uint32Array:()=>Ib,uint8Array:()=>Mb,uint8ClampedArray:()=>Tb,ulid:()=>M6,uniqueArray:()=>Mn,uuid:()=>_6,webAuthority:()=>Vb,webFragments:()=>Wb,webPath:()=>Gb,webQueryParameters:()=>Hb,webSegment:()=>zb,webUrl:()=>Z6}),V4="module",U4="4.8.0",W4="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c",$e=j4;var z4=24301;function cs(e,t){return e.reduce((n,r)=>q4(n,t[r.idx]?.paramSpaces),new Map)}function or(e,t){return Object.fromEntries(Object.entries(e.paramSpaces).map(([n,r])=>[n,G4(r,r?.name==null?0:t.get(r.name)??0)]))}var iS=new WeakMap;function G4(e,t){if(e==null)return oS(void 0,t);let n=iS.get(e)??new Map;iS.set(e,n);let r=n.get(t);if(r!=null)return r;let i=oS(e,t);return n.set(t,i),i}function H4(e){return e?.values!=null&&e.values.length>0?$e.constantFrom(...e.values):K4(e)}function oS(e,t){let[n]=$e.sample(H4(e),{numRuns:1,seed:z4+t});if(n==null)throw new Error("arbitrary produced no sample");return n}function K4(e){if(e?.type==="number")return $e.integer();if(e?.type==="boolean")return $e.boolean();let t=e?.generator==null?void 0:Z4[e.generator];if(t!=null)return t;let n=e?.constraints?.kind==="string"?e.constraints:void 0;return $e.string({maxLength:n?.maxLength,minLength:n?.minLength??1}).filter(r=>r.trim().length>0&&r===r.trim())}function q4(e,t){return t==null?e:Object.values(t).reduce((n,r)=>r==null?n:new Map([...n,[r.name,(n.get(r.name)??0)+1]]),e)}var Y4="abcdefghijklmnopqrstuvwxyz0123456789".match(/./g)??[],ir=e=>$e.array($e.constantFrom(...Y4),{maxLength:e,minLength:1}).map(t=>t.join("")),vc=(e,t)=>$e.array(ir(10),{maxLength:t,minLength:1}).map(n=>n.join(e)),Z4={"company.name":vc(" ",3),"date.iso":J4(),"internet.email":X4(),"internet.url":Q4(),"lorem.slug":vc("-",3),"lorem.word":ir(10),"person.fullName":vc(" ",2)};function J4(){return $e.date({max:new Date("2030-12-31T23:59:59.999Z"),min:new Date("2020-01-01T00:00:00.000Z"),noInvalidDate:!0}).map(e=>e.toISOString())}function X4(){return $e.tuple(ir(12),ir(10),$e.constantFrom("com","dev","io","org","ai")).map(([e,t,n])=>`${e}@${t}.${n}`)}function Q4(){return $e.tuple($e.constantFrom("http","https"),ir(12),$e.constantFrom("app","com","dev","io","org"),$e.array(ir(8),{maxLength:3})).map(([e,t,n,r])=>{let i=r.length===0?"":`/${r.join("/")}`;return`${e}://${t}.${n}${i}`})}var eO=new Map;function ds(e){return or(e,eO)}import{z as J}from"zod";var sr=J.enum(["crash","data-rule","page-rule","frame"]),sS=J.object({intent:J.string().min(1),test:J.string().min(1)}),tO=J.union([J.object({kind:J.literal("singleton-mismatch"),singleton:J.string().min(1)}),J.object({browser:J.string().min(1),kind:J.literal("browser-mismatch")}),J.object({entity:J.string().min(1),kind:J.string().min(1)})]),nO=J.discriminatedUnion("kind",[J.object({kind:J.literal("consistency"),layer:sr,mismatch:tO,step:sS.nullable()}),J.object({kind:J.literal("pending-check"),layer:sr,source:J.string().min(1),step:sS}),J.object({intent:J.string().min(1),kind:J.literal("unrunnable"),layer:sr,reason:J.string().min(1),test:J.string().min(1)}),J.object({error:J.string().min(1),kind:J.literal("driver-error"),layer:sr,step:J.string().min(1)}),J.object({kind:J.literal("impossible-action"),layer:sr,step:J.string().min(1)})]);import{z as fs}from"zod";var li=fs.number().min(0).max(10),aS=fs.object({branching:li,destructiveActions:li,maxAttemptLength:fs.number().int().positive(),mixWorkflows:li,mutatingActions:li,scopedBoost:fs.number().min(1),sharedEntity:li}),Rc={even:{branching:3,destructiveActions:2,maxAttemptLength:12,mixWorkflows:3,mutatingActions:2,scopedBoost:8,sharedEntity:5}};function lS(e){return Rc[e]}function Cc(e,t,n){let r=t.reduce((u,c)=>u+c,0),i=t.reduce((u,c)=>[...u,(u.at(-1)??0)+c],[]),o=n()*r,s=i.findIndex(u=>o<u),a=r<=0?Math.floor(n()*e.length):s,l=e[a<0?e.length-1:a];if(l==null)throw new Error("weighted sample drew an empty set");return l}var uS=4;function ps(e){return{startingPoint:e.startingPoint.name,steps:dS(e,e.startingPoint.snapshot,[])}}function dS(e,t,n){if(n.length>=e.strategy.maxAttemptLength)return n;let r=Gr(e.corpus,{snapshot:t},fS(e.corpus,n));if(r.length===0)return n;let i=rO(e,r,n);return dS(e,i.stepRun.next.snapshot,[...n,{idx:i.idx,params:i.params}])}function fS(e,t){let n=cs(t,e);return r=>or(r,n)}function rO(e,t,n){let r=t.map(i=>iO(e,i,n));return Cc(t,r,e.random)}function iO(e,t,n){let r=e.corpus[t.idx];if(r==null)return uS;let i=e.strategy,o=_p(r.effectStep)?i.mutatingActions:0,s=Lp(r.effectStep)?i.destructiveActions:0,a=oO(e.corpus,r,n),l=a?i.mixWorkflows:0,u=a&&sO(e.corpus,r,n)?i.sharedEntity:0,c=aO(e,t,n),d=n.filter(h=>h.idx===t.idx).length,p=(uS+o+s+l+u+c)/(d+1);return e.scopedTests.has(r.test)?p*i.scopedBoost:p}function oO(e,t,n){let r=new Set(n.flatMap(i=>{let o=e[i.idx];return o==null?[]:[o.test]}));return r.size>0&&!r.has(t.test)}function sO(e,t,n){let r=cS(t),i=new Set(n.flatMap(o=>{let s=e[o.idx];return s==null?[]:[...cS(s)]}));return[...r].some(o=>i.has(o))}function cS(e){return new Set([...Bp(e.effectStep),...e.requiredState.entities.map(t=>t.entity)])}function aO(e,t,n){let r=1-n.length/e.strategy.maxAttemptLength;if(r<=0)return 0;let i=Gr(e.corpus,{snapshot:t.stepRun.next.snapshot},fS(e.corpus,n)).length;return e.strategy.branching*r*(i/(i+1))}import{z}from"zod";var pS=z.object({baseStateTest:zi,lockfileHash:z.string().min(1),stepRuns:z.array(z.object({idx:z.number().int().nonnegative(),params:z.record(z.string(),z.union([It,z.null()]))}))}),hS=z.object({baseStateRef:z.string().min(1),steps:z.array(z.object({index:z.number().int().nonnegative(),params:z.record(z.string(),z.union([It,z.null()])),test:z.string().min(1)}))}),mS=z.object({actions:z.array(z.string()),label:z.string().min(1)}),kc=z.object({test:z.string().min(1),text:z.string()}),lO=z.object({baseLabel:z.string(),baseState:z.string().min(1),durationMs:z.number().int().nonnegative(),signature:z.string().optional(),steps:z.array(kc)}),yS=z.object({kind:z.enum(["aborted","clean","error","flaky","finding"]),reason:z.string().optional(),runId:z.string().optional(),trail:lO.optional()});function hs(e,{sweep:t}){let n=Dt(Rt(e),r=>F({s:r.test.singletons,w:r.test.world})).map(r=>({name:r.ref,test:r.test}));return t?[...n,...n.flatMap(r=>uO(r))]:n}function ms(e,t,n){return zn(e,t.test,n)}function uO(e){return cO(e.test).map(t=>{let n={...t,as:`${t.as}~2`},r=`${e.name} +${t.entity}`;return{name:r,test:{...e.test,name:r,world:[...e.test.world,n]}}})}function cO(e){return e.world.filter(t=>{let n=F({...e,world:e.world.filter(r=>r!==t)});return!n.includes(`"${t.as}.`)&&!n.includes(`"ref":"${t.as}"`)})}async function ys(e){let t=kn(e);if(t.length===0)return null;let n=hs(e,{sweep:!1}),r=await dO(e,n);return r.length===0?null:{corpus:t,startingPoints:r,startingPointTests:new Map(n.map(i=>[i.name,i.test]))}}function gS({lockfileHash:e,prepared:t,random:n,scopedTests:r,strategy:i}){let o=t.startingPoints[Math.floor(n()*t.startingPoints.length)];if(o==null)return null;let s=ps({corpus:t.corpus,random:n,scopedTests:r,startingPoint:o,strategy:i}),a=t.startingPointTests.get(s.startingPoint);return a==null||s.steps.length===0?null:{baseStateTest:a,lockfileHash:e,stepRuns:s.steps.map(l=>({idx:l.idx,params:l.params}))}}async function dO(e,t){let n={generate:qr,materialize:lo(qr,e.valueSpaces),params:void 0};return(await Promise.all(t.map(async i=>(await ms(e,i,n)).match(s=>({name:i.name,snapshot:s.snapshot}),()=>null)))).flatMap(i=>i==null?[]:[i])}import{ResultAsync as bs}from"neverthrow";var Tn=class extends Error{mountKey;constructor(t){super("client-mount-unmounted"),this.mountKey=t}},ar=class extends Error{readyKey;timeoutMs;constructor(t,n){super("app-not-ready"),this.readyKey=t,this.timeoutMs=n}};function gs(e){return{read:t=>RO(t,e),seedScript:t=>`globalThis[${JSON.stringify(za)}] = ${JSON.stringify(t)};`}}async function RO(e,t){let n={...Nt(e.url()),title:await e.title(),viewport:AO(e.viewportSize())};if(t.length===0)return{browser:n,singletons:{}};let r=await e.evaluate(kO,{mountKey:Ui,names:t,timeoutMs:CO});if(r.kind==="unmounted")throw new Tn(Ui);return{browser:n,singletons:r.values}}var CO=5e3;async function kO(e){let t=Date.now()+e.timeoutMs;for(;Reflect.get(globalThis,e.mountKey)==null&&Date.now()<t;)await new Promise(r=>setTimeout(r,25));let n=Reflect.get(globalThis,e.mountKey);return n==null?{kind:"unmounted"}:{kind:"values",values:Object.fromEntries(e.names.map(r=>[r,n.readSingleton(r)??null]))}}function AO(e){return e==null?"":`${String(e.width)}x${String(e.height)}`}var EO={backoffMs:[500,1e3,2e3,4e3,8e3],budgetMs:3e4};function Ec(e,t,n,r,i=EO){return{awaitCheck:(o,s)=>bs.fromPromise(MO({check:o,engine:n,page:e,signal:r,timeoutMs:s}),a=>$r(a)?{kind:"aborted"}:Ac(a)),evaluate:o=>bs.fromPromise(SS(xS(e,n,o),`check ${o.kind}`),Ac),locateIds:o=>zO(e,o),observe:()=>t.read().andThen(o=>bs.fromPromise(SS(RS(e,n,0),"observe"),Ac).map(s=>({snapshot:{...o,browser:{...o.browser,...s.browser},singletons:{...o.singletons,...s.singletons}}}))),perform:o=>bs.fromPromise(CS(e,o,0,r,i),s=>PO(o,s))}}function Ac(e){return e instanceof Tn?Ji(e.mountKey):Sl(e)}async function xS(e,t,n){try{return await IS(e,t,n)}catch(r){if(Pc(r))return!1;throw r}}function PO(e,t){return t instanceof ar?hl(t.readyKey,t.timeoutMs):t instanceof Tn?Ji(t.mountKey):bl(e.kind,t)}var IO=75;function MO(e){return e.check.kind==="visible"?TO({locator:e.check.locator,page:e.page,signal:e.signal,timeoutMs:e.timeoutMs}):vS(e,Date.now()+e.timeoutMs)}async function vS(e,t){return Xe(e.signal),await xS(e.page,e.engine,e.check)?!0:Date.now()>=t?!1:(await bn(IO,e.signal),vS(e,t))}async function TO({locator:e,page:t,signal:n,timeoutMs:r}){try{return await Promise.race([Ic(t,e,{visibleOnly:!0}).waitFor({state:"visible",timeout:r}),OO(n)]),!0}catch(i){if(NO(i))return!1;throw i}}function OO(e){return new Promise((t,n)=>{if(e.aborted){n(new st);return}e.addEventListener("abort",()=>{n(new st)},{once:!0})})}function NO(e){return e instanceof Error&&e.name==="TimeoutError"}var $O=[100,250,500];async function RS(e,t,n){try{return await t.read(e)}catch(r){let i=$O[n],o=Pc(r)||r instanceof Tn;if(i==null||!o)throw r;return await PS(i),RS(e,t,n+1)}}function Pc(e){let t=e instanceof Error?e.message:String(e);return/Execution context was destroyed|Cannot find context with specified id|[Ff]rame was detached|frame got detached/.test(t)}var bS=35e3;function SS(e,t){let n,r=new Promise((i,o)=>{n=setTimeout(()=>{o(new Error(`driver op "${t}" exceeded ${String(bS)}ms`))},bS)});return Promise.race([e,r]).finally(()=>{clearTimeout(n)})}var LO=[250,750,2e3];async function CS(e,t,n,r,i){try{await VO(e,t,r,i)}catch(o){let s=LO[n];if(s==null||!ES(o))throw o;await PS(s),await CS(e,t,n+1,r,i)}}async function kS({page:e,readiness:t,signal:n,startMs:r,tries:i,url:o}){if(Xe(n),!await DO(e,o)){if(Date.now()-r>=t.budgetMs)throw new ar(Ar,t.budgetMs);let a=t.backoffMs[Math.min(i,t.backoffMs.length-1)]??8e3;await bn(a,n),await kS({page:e,readiness:t,signal:n,startMs:r,tries:i+1,url:o});return}let s=Math.max(0,t.budgetMs-(Date.now()-r));if(!await FO(e,n,s))throw new ar(Ar,t.budgetMs)}async function DO(e,t){let n=await _O(e,t);return n==="net-error"?!1:n==null||n.status()<400}async function _O(e,t){try{return await e.goto(t,{waitUntil:"domcontentloaded"})}catch(n){if(ES(n))return"net-error";throw n}}var BO=50;async function FO(e,t,n){let r=Date.now()+n;for(;Date.now()<r;){if(Xe(t),await wS(e))return!0;await bn(BO,t)}return wS(e)}async function wS(e){try{return await e.evaluate(jO,Ar)}catch(t){if(Pc(t))return!1;throw t}}function jO(e){return Reflect.get(globalThis,e)===!0}async function VO(e,t,n,r){if(t.kind==="goto"){await kS({page:e,readiness:r,signal:n,startMs:Date.now(),tries:0,url:lr(t.url,t,"url")});return}if(t.kind==="press"&&t.locator==null){await e.keyboard.press(lr(t.key,t,"key"));return}let i=t.kind!=="upload";await UO(e,Ic(e,t.locator,{visibleOnly:i}),t)}function lr(e,t,n){if(e==null)throw new Error(`action "${t.kind}" requires ${n}`);return e}function UO(e,t,n){switch(n.kind){case"goto":throw new Error("goto must not be located");case"fill":return t.fill(String(lr(n.value,n,"value")));case"clear":return t.clear();case"click":return t.click();case"dblclick":return t.dblclick();case"check":return t.check();case"uncheck":return t.uncheck();case"hover":return t.hover();case"select":return WO(e,t,String(lr(n.value,n,"value")));case"upload":return t.setInputFiles(lr(n.files,n,"files"));case"press":return t.press(lr(n.key,n,"key"))}}async function WO(e,t,n){if(await t.evaluate(i=>i.tagName==="SELECT")){await t.selectOption(n);return}await t.click(),await t.fill(n),await e.locator(AS("option",n)).filter({visible:!0}).click()}async function zO(e,t){if(t==null)return[];try{let n=Ss(e,t,{visibleOnly:!1});if(await n.count()===0)return[];let r=await n.first().evaluate(GO);return r>0?[r]:[]}catch{return[]}}function GO(e){return globalThis.__ripploRrwebMirror?.getId(e)??-1}function Ic(e,t,n){if(t==null)throw new Error("action requires a locator");return Ss(e,t,n)}function Ss(e,t,n){if(t.by==="inside"){let i=Ss(e,t.scope,n);return Ss(i,t.target,n)}let r=t.by==="testId"?e.getByTestId(t.value):e.locator(AS(t.role,t.name));return n.visibleOnly?r.filter({visible:!0}):r}function AS(e,t){return t==null?`role=${e}`:`role=${e}[name=${JSON.stringify(t)}i]`}function ES(e){let t=e instanceof Error?e.message:String(e);return/net::ERR_|ERR_HTTP_RESPONSE_CODE_FAILURE|ECONNREFUSED|ECONNRESET|socket hang up|fetch failed|page\.goto: Timeout/.test(t)}function PS(e){return new Promise(t=>{setTimeout(t,e)})}async function IS(e,t,n){if(n.kind==="browser")return qO(e,t,n.key,n.value);if(n.kind==="not")return!await IS(e,t,n.inner);let r=Ic(e,n.locator,{visibleOnly:!0});return n.kind==="value"?await r.inputValue()===n.value:n.kind==="text"?(await r.textContent()??"").includes(n.value):n.kind==="unobstructed"?HO(r):KO(r,n.kind)}function HO(e){return e.evaluate(t=>{let n=t.getBoundingClientRect(),r=t.ownerDocument.defaultView;if(r==null||n.width<=0||n.height<=0)return!1;let i=2,o=Math.min(9,Math.max(3,Math.round(n.width/12))),s=Math.min(5,Math.max(2,Math.round(n.height/12))),a=(c,d,p)=>Array.from({length:p},(h,f)=>c+i+(d-i*2)*f/(p-1)),u=a(n.left,n.width,o).flatMap(c=>a(n.top,n.height,s).map(d=>({x:c,y:d}))).filter(c=>c.x>=0&&c.y>=0&&c.x<=r.innerWidth&&c.y<=r.innerHeight);return u.length===0?!1:u.every(c=>{let d=t.ownerDocument.elementFromPoint(c.x,c.y);return d!=null&&(d===t||t.contains(d)||d.contains(t))})})}function KO(e,t){return t==="visible"?e.isVisible():t==="disabled"?e.isDisabled():t==="enabled"?e.isEnabled():t==="checked"?e.isChecked():e.evaluate(n=>n===n.ownerDocument.activeElement)}async function qO(e,t,n,r){let i=await t.read(e),o=Un(i.browser,n);return r===null?o===void 0:o===r}import YO from"path";var TS={height:720,width:1280};async function ws({baseUrl:e,browser:t,capture:n,clientState:r,engine:i,extraHeaders:o,fixturesDir:s,reader:a,session:l,signal:u,viewport:c}){let d=await t.newContext({baseURL:e,reducedMotion:"reduce",storageState:l==null?void 0:{cookies:ZO(l.cookies,e),origins:l.origins},viewport:c}),p=JO(o,l?.headers);p!=null&&await d.setExtraHTTPHeaders(p),await d.addInitScript(i.seedScript(r));let h=n==null?XO():await n.hub.attach(d,n.runId),f=await d.newPage();return h.onPage(f),{context:d,driver:t3(QO(Ec(f,a,i,u),s),h),emitAssertion:h.emitAssertion,emitFinding:h.emitFinding,close:()=>n3({context:d,handle:h})}}async function Mc(e,t){let n=await NS(e,void 0);try{return await t(n)}finally{await n.close()}}async function OS(e){let{chromium:t}=await import("playwright");return t.launchPersistentContext(e,{headless:!1,viewport:null})}function ZO(e,t){let n=new URL(t).hostname;return e.map(r=>({...r,domain:n}))}function JO(e,t){return e==null?t:t==null?e:{...e,...t}}function XO(){return{emitAction:()=>{},emitAssertion:()=>{},emitFinding:()=>{},finish:()=>Promise.resolve(),onPage:()=>{}}}async function NS(e,t){let{chromium:n}=await import("playwright"),r=t==null?[]:[`--disk-cache-dir=${t}`,"--disk-cache-size=268435456"];return n.launch({args:r,headless:!e})}function xs({cacheDir:e,headed:t}){let n;return{acquire:async()=>{let o=n;if(o!=null){let s=await o.catch(()=>{});if(s?.isConnected()===!0)return s;n===o&&(n=void 0)}return n??=NS(t,e),n},close:async()=>{let o=n;n=void 0,o!=null&&await o.then(s=>s.close()).catch(()=>{})}}}function QO(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>e.perform(e3(n,t))}}function e3(e,t){return e.kind!=="upload"||e.files==null?e:{...e,files:e.files.map(n=>YO.join(t,n))}}function t3(e,t){return{awaitCheck:e.awaitCheck,evaluate:e.evaluate,locateIds:e.locateIds,observe:e.observe,perform:n=>(t.emitAction(n),e.perform(n))}}async function n3({context:e,handle:t}){await MS(t.finish()),await MS(e.close())}var r3=15e3;async function MS(e){let t,n=new Promise(r=>{t=setTimeout(r,r3)});await Promise.race([e.catch(()=>{}),n]).finally(()=>{clearTimeout(t)})}import{err as i3,ok as o3,Result as Tc}from"neverthrow";function Oc(e,t,n){return{read:()=>n.read(e.map(r=>r.name),t).andThen(r=>s3(e,r))}}function s3(e,t){return Tc.combine(e.map(n=>a3(n,t.entities[n.name]??[]).map(r=>[n.name,r]))).map(n=>({browser:wn,entities:new Map(n),singletons:t.singletons}))}function a3(e,t){let n=jr(e);return Tc.combine(t.map(r=>l3(r,e).map(i=>[i,u3(r,n)]))).map(r=>new Map(r))}function l3(e,t){return Tc.combine(t.identity.map(n=>{let r=e[n];return r==null?i3(yl(t.name,n)):o3(String(r))})).map(n=>n.join(":"))}function u3(e,t){let n=t.map(r=>[r,e[r]]).filter(r=>r[1]!=null);return Object.fromEntries(n)}var $S=Ia(cx(),1);import c3 from"crypto";import{err as d3,errAsync as Nc,ok as f3,ResultAsync as ur}from"neverthrow";var p3=3e4,h3=[250,750,2e3],m3=[500,1e3,2e3,3e3];function $c({baseUrl:e,extraHeaders:t,runId:n,secret:r},i){let o=new $S.Webhook(r),s=(a,l,u)=>y3({baseUrl:e,body:l,extraHeaders:t,path:a,retry:u.retry,schema:u.schema,signal:u.signal,webhook:o});return{query:{read:(a,l)=>s("/state",{entities:a,runId:n,singletons:l},{retry:"transient",schema:ll,signal:i}).map(u=>({entities:u.entities,singletons:u.singletons}))},ready:()=>DS(e,t,i,0),setupWorld:a=>s("/setup",{entities:a,runId:n},{retry:"connection",schema:al,signal:i}).map(l=>l.rows),teardown:()=>s("/teardown",{runId:n},{retry:"connection",schema:ul,signal:void 0}).map(()=>{})}}function y3(e){return LS(e.retry,()=>w3(e),0)}function LS(e,t,n){return t().orElse(r=>{let i=h3[n];return i==null||!b3(r,e)?Nc(r):ur.fromSafePromise(_S(i)).andThen(()=>LS(e,t,n+1))})}function DS(e,t,n,r){return ur.fromPromise(fetch(e,{headers:t,method:"HEAD",signal:BS(n)}),i=>jn("",i)).map(()=>{}).orElse(()=>{let i=m3[r];return i==null||n.aborted?Nc(gl(e)):ur.fromSafePromise(_S(i)).andThen(()=>DS(e,t,n,r+1))})}var g3=new Set(["EAI_AGAIN","ECONNREFUSED","ENOTFOUND"]);function b3(e,t){return e.kind==="aborted"?!1:S3(e)?!0:t==="connection"?!1:e.kind==="engine-network"||e.kind==="engine-http"&&e.status>=500}function S3(e){return e.kind==="engine-network"&&e.code!=null&&g3.has(e.code)}function _S(e){return new Promise(t=>{setTimeout(t,e)})}function w3({baseUrl:e,body:t,extraHeaders:n,path:r,schema:i,signal:o,webhook:s}){let a=JSON.stringify(t);return ur.fromPromise(fetch(`${e}${r}`,{body:a,headers:{...n,"Content-Type":"application/json",...x3(s,a)},method:"PUT",signal:BS(o)}),l=>jn(r,l)).andThen(l=>v3(l,r)).andThen(l=>R3(i,l,r)).mapErr(l=>o?.aborted===!0?wl():l)}function x3(e,t){let n=`msg_${c3.randomUUID()}`,r=new Date;return{"webhook-id":n,"webhook-signature":e.sign(n,r,t),"webhook-timestamp":String(Math.floor(r.getTime()/1e3))}}function BS(e){let t=AbortSignal.timeout(p3);return e==null?t:AbortSignal.any([e,t])}function v3(e,t){return e.ok?ur.fromPromise(e.json(),n=>jn(t,n)):ur.fromPromise(e.text().catch(()=>""),n=>jn(t,n)).andThen(n=>Nc(pl(t,e.status,n)))}function R3(e,t,n){let r=e.safeParse(t);return r.success?f3(r.data):d3(ml(n,r.error))}import B5 from"path";import{err as Rr,ok as Ni,ResultAsync as df}from"neverthrow";import K1 from"path";import{z as gt}from"zod";import C3 from"path";function FS({debugDir:e,runId:t,worker:n}){let r=C3.join(e,t,"behavior.jsonl");return n.open({file:r,runId:t}),{close:i=>n.close({noticeLineIfNoRrweb:i?.noticeIfNoRrweb==null?"":JSON.stringify(k3(i.noticeIfNoRrweb)),runId:t}),emit:i=>{let o={...i,timestamp:A3(i.timeNanos)};n.line({line:JSON.stringify(o),runId:t,timeNanos:i.timeNanos})},emitRrwebBatch:i=>{n.rrwebBatch({data:i,runId:t})}}}function dn(e){return String(BigInt(Math.round(e))*1000000n)}function k3(e){return{kind:"notice",message:e,source:"capture",timeNanos:"0"}}function A3(e){return Number(BigInt(e)/1000000n)}import{existsSync as E3}from"fs";import{createRequire as P3}from"module";import{fileURLToPath as I3}from"url";import{Worker as M3}from"worker_threads";var T3=P3(import.meta.url);function jS(e){let t=new M3(O3(),{workerData:e});t.unref();let n=new Map,r={next:0};t.on("message",o=>{let s=n.get(o.seq);s!=null&&(n.delete(o.seq),s())});let i=o=>{t.postMessage(o)};return{close:({noticeLineIfNoRrweb:o,runId:s})=>{let a=r.next;return r.next+=1,new Promise(l=>{n.set(a,l),i({noticeLineIfNoRrweb:o,runId:s,seq:a,t:"close"})})},line:({line:o,runId:s,timeNanos:a})=>{i({line:o,runId:s,t:"line",timeNanos:a})},open:({file:o,runId:s})=>{i({file:o,runId:s,t:"open"})},rrwebBatch:({data:o,runId:s})=>{i({data:o,runId:s,t:"rrweb-batch"})},terminate:async()=>{await t.terminate()}}}function O3(){try{return T3.resolve("@ripplo/runtime/capture-worker")}catch{let e=["../../dist/capture-worker.js","./capture-worker.js"].map(n=>I3(new URL(n,import.meta.url))),t=e.find(n=>E3(n));if(t==null)throw new Error(`capture-worker.js not found; looked at: ${e.join(", ")}`);return t}}function US(e){if(e.kind==="pending-check")return null;let t={kind:"finding",source:"verifier",timeNanos:dn(Date.now())};return e.kind==="consistency"?{...t,...N3(e.mismatch),findingKind:"consistency",pending:e.pending,step:e.step==null?"":Bt(e.step),wait:e.budget,waitMs:Lt[e.budget]}:e.kind==="impossible-action"?{...t,findingKind:e.kind,step:Bt(e.step),subject:"action could not run"}:e.kind==="unrunnable"?{...t,findingKind:e.kind,step:e.intent,subject:`step could not run (${e.reason})`}:{...t,findingKind:e.kind,step:Bt(e.step),subject:xt(e.error)}}function N3(e){if(e.kind==="singleton-mismatch"){let{snapshot:t,sut:n}=e;return{actual:X(n),expected:X(t),mismatchKind:e.kind,subject:e.singleton}}return e.kind==="wrong-value"?{actual:X(e.sut),expected:X(e.snapshot),mismatchKind:e.kind,subject:VS(e.entity,e.field,e.key)}:e.kind==="expected-change"?{expected:`change from ${X(e.value)}`,mismatchKind:e.kind,subject:VS(e.entity,e.field,e.key)}:e.kind==="browser-mismatch"?{actual:X(e.sut),expected:X(e.snapshot),mismatchKind:e.kind,subject:Ve(e.key)}:{mismatchKind:e.kind,subject:`${e.entity} [${e.key}]`}}function VS(e,t,n){return`${e}.${t} [${n}]`}import{readFile as $3}from"fs/promises";import{createRequire as L3}from"module";import{fileURLToPath as D3}from"url";var _3=L3(import.meta.url);function Lc(e,t){try{return _3.resolve(e)}catch{return D3(new URL(`assets/${t}`,import.meta.url))}}var B3=Lc("@ripplo/browser-trace/bundle","browser-trace.js");async function zS(e,t){await e.addInitScript(`globalThis.__ripploRunId = ${JSON.stringify(t)};`),await e.addInitScript(await F3())}var WS;function F3(){return WS??=$3(B3,{encoding:"utf8"}),WS}import{createServer as j3}from"http";import{mkdir as V3,rm as U3,writeFile as W3}from"fs/promises";import z3 from"path";import{z as te}from"zod";var G3="otlp-port",HS=te.object({key:te.string(),value:te.object({boolValue:te.boolean().optional(),doubleValue:te.number().optional(),intValue:te.union([te.string(),te.number()]).optional(),stringValue:te.string().optional()})}),H3=te.object({attributes:te.array(HS).default([]),endTimeUnixNano:te.string(),kind:te.number().default(0),name:te.string(),parentSpanId:te.string().optional(),spanId:te.string(),startTimeUnixNano:te.string(),status:te.object({code:te.number(),message:te.string().optional()}).optional(),traceId:te.string()}),K3=te.object({resourceSpans:te.array(te.object({resource:te.object({attributes:te.array(HS).default([])}).optional(),scopeSpans:te.array(te.object({spans:te.array(H3).default([])})).default([])})).default([])});async function Dc({localDir:e,onRrwebBatch:t,onSpan:n,writePortFile:r}){let{port:i,server:o}=await q3({onRrwebBatch:t,onSpan:n}),s=z3.join(e,G3);return r&&(await V3(e,{recursive:!0}),await W3(s,String(i),{encoding:"utf8"})),{port:i,stop:async()=>{r&&await U3(s,{force:!0}),await Q3(o)}}}function q3(e){return new Promise((t,n)=>{let r=j3((i,o)=>{Y3(i,o,e)});r.on("error",n),r.listen(0,()=>{let i=r.address();if(i==null||typeof i=="string"){n(new Error("otlp_receiver_no_port"));return}t({port:i.port,server:r})})})}function Y3(e,t,n){let r=Z3(e.url);if(r!=null){GS(e).then(i=>{n.onRrwebBatch(r,i),vs(t)}).catch(()=>{vs(t)});return}GS(e).then(i=>{J3(K3.parse(JSON.parse(i.toString("utf8"))),n.onSpan),vs(t)}).catch(()=>{vs(t)})}function Z3(e){if(e==null||!e.startsWith("/rrweb/"))return;let t=decodeURIComponent(e.slice(7));return t.length===0?void 0:t}function GS(e){return new Promise((t,n)=>{let r=[];e.on("data",i=>{r.push(i)}),e.on("end",()=>{t(Buffer.concat(r))}),e.on("error",n)})}function vs(e){e.writeHead(200,{"content-type":"application/json"}),e.end("{}")}function J3(e,t){e.resourceSpans.flatMap(n=>n.scopeSpans).flatMap(n=>n.spans).forEach(n=>{t({attributes:X3(n.attributes),durationMs:Number((BigInt(n.endTimeUnixNano)-BigInt(n.startTimeUnixNano))/1000000n),kind:"span",name:n.name,parentSpanId:n.parentSpanId,source:"server",spanId:n.spanId,spanKind:Va(n.kind),status:{code:Ua(n.status?.code??0),message:n.status?.message},timeNanos:n.startTimeUnixNano,traceId:n.traceId})})}function X3(e){return Object.fromEntries(e.map(({key:t,value:n})=>[t,String(n.stringValue??n.intValue??n.doubleValue??n.boolValue??"")]))}function Q3(e){return new Promise((t,n)=>{e.close(r=>{if(r==null){t();return}n(r)}),e.closeAllConnections()})}import{readFile as v5}from"fs/promises";var eN=Object.defineProperty,tN=(e,t,n)=>t in e?eN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t,n)=>tN(e,typeof t!="symbol"?t+"":t,n),KS,nN=Object.defineProperty,rN=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qS=(e,t,n)=>rN(e,typeof t!="symbol"?t+"":t,n),Te=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Te||{}),YS={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ZS={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rs={},iN=()=>!!globalThis.Zone;function jd(e){if(Rs[e])return Rs[e];let t=globalThis[e],n=t.prototype,r=e in YS?YS[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in ZS?ZS[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!iN())return Rs[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Rs[e]=u:n}catch{return n}}var _c={};function Yt(e,t,n){var r;let i=`${e}.${String(n)}`;if(_c[i])return _c[i].call(t);let o=jd(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(_c[i]=s,s.call(t)):t[n]}var Bc={};function Kw(e,t,n){let r=`${e}.${String(n)}`;if(Bc[r])return Bc[r].bind(t);let o=jd(e)[n];return typeof o!="function"?t[n]:(Bc[r]=o,o.bind(t))}function oN(e){return Yt("Node",e,"ownerDocument")}function sN(e){return Yt("Node",e,"childNodes")}function aN(e){return Yt("Node",e,"parentNode")}function lN(e){return Yt("Node",e,"parentElement")}function uN(e){return Yt("Node",e,"textContent")}function cN(e,t){return Kw("Node",e,"contains")(t)}function dN(e){return Kw("Node",e,"getRootNode")()}function fN(e){return!e||!("host"in e)?null:Yt("ShadowRoot",e,"host")}function pN(e){return e.styleSheets}function hN(e){return!e||!("shadowRoot"in e)?null:Yt("Element",e,"shadowRoot")}function mN(e,t){return Yt("Element",e,"querySelector")(t)}function yN(e,t){return Yt("Element",e,"querySelectorAll")(t)}function gN(){return jd("MutationObserver").constructor}function bN(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Le={ownerDocument:oN,childNodes:sN,parentNode:aN,parentElement:lN,textContent:uN,contains:cN,getRootNode:dN,host:fN,styleSheets:pN,shadowRoot:hN,querySelector:mN,querySelectorAll:yN,mutationObserver:gN,patch:bN};function qw(e){return e.nodeType===e.ELEMENT_NODE}function hi(e){let t=e&&"host"in e&&"mode"in e&&Le.host(e)||null;return!!(t&&"shadowRoot"in t&&Le.shadowRoot(t)===e)}function mi(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function SN(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function wN(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Jc(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);let r=Array.from(t,i=>Yw(i,n)).join("");return SN(r)}catch{return null}}function Yw(e,t){if(vN(e)){let n;try{n=Jc(e.styleSheet)||wN(e)}catch{n=e.cssText}return e.styleSheet.href?ta(n,e.styleSheet.href):n}else{let n=e.cssText;return RN(e)&&e.selectorText.includes(":")&&(n=xN(n)),t?ta(n,t):n}}function xN(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function vN(e){return"styleSheet"in e}function RN(e){return"selectorText"in e}var Xs=class{constructor(){qS(this,"idNodeMap",new Map),qS(this,"nodeMetaMap",new WeakMap)}getId(t){var n;return t?((n=this.getMeta(t))==null?void 0:n.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function CN(){return new Xs}function Qs({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"",a=r&&Nn(r);return(t[n.toLowerCase()]||a&&t[a])&&(o?s=o(s,e):s="*".repeat(s.length)),s}function Nn(e){return e.toLowerCase()}var JS="__rrweb_original__";function kN(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let i=0;i<e.height;i+=n){let o=t.getImageData,s=JS in o?o[JS]:o;if(new Uint32Array(s.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function ea(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Nn(t):null}function Zw(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r);return i?.[1]??null}function AN(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var EN=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,PN=/^(?:[a-z+]+:)?\/\//i,IN=/^www\..*/i,MN=/^(data:)([^,]*),(.*)/i;function ta(e,t){return(e||"").replace(EN,(n,r,i,o,s,a)=>{let l=i||s||a,u=r||o||"";if(!l)return n;if(PN.test(l)||IN.test(l))return`url(${u}${l}${u})`;if(MN.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${AN(t)+l}${u})`;let c=t.split("/"),d=l.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Cs(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function TN(e,t,n=!1){let r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&typeof e=="string"){let s=Cs(e,n),a=s.length/e.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){let u=Cs(r[l].textContent,n),c=100,d=3;for(;d<u.length&&(u[d].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,d),1)!==-1);d++);for(;d<u.length;d++){let p=u.substring(0,d),h=s.split(p),f=-1;if(h.length===2)f=h[0].length;else if(h.length>2&&h[0]===""&&r[l-1].textContent!=="")f=s.indexOf(p,1);else if(h.length===1){if(p=p.substring(0,p.length-1),h=s.split(p),h.length<=1)return i.push(e),i;d=c+1}else d===u.length-1&&(f=s.indexOf(p));if(h.length>=2&&d>c){let m=r[l-1].textContent;if(m&&typeof m=="string"){let y=Cs(m).length;f=s.indexOf(p,y)}f===-1&&(f=h[0].length)}if(f!==-1){let m=Math.floor(f/a);for(;m>0&&m<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;let y=Cs(e.substring(0,m),n);if(y.length===f){i.push(e.substring(0,m)),e=e.substring(m),s=s.substring(f);break}else y.length<f?m+=Math.max(1,Math.floor((f-y.length)/a)):m-=Math.max(1,Math.floor((y.length-f)*a))}break}}}}return i.push(e),i}function ON(e,t){return TN(e,t).join("/* rr_split */")}var NN=1,$N=new RegExp("[^a-z0-9-_:]"),gi=-2;function Jw(){return NN++}function LN(e){if(e instanceof HTMLFormElement)return"form";let t=Nn(e.tagName);return $N.test(t)?"div":t}var cr,XS,DN=/^[^ \t\n\r\u000c]+/,_N=/^[, \t\n\r\u000c]+/;function BN(e,t){if(t.trim()==="")return t;let n=0;function r(o){let s,a=o.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let i=[];for(;r(_N),!(n>=t.length);){let o=r(DN);if(o.slice(-1)===",")o=pr(e,o.substring(0,o.length-1)),i.push(o);else{let s="";o=pr(e,o);let a=!1;for(;;){let l=t.charAt(n);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return i.join(", ")}var QS=new WeakMap;function pr(e,t){return!t||t.trim()===""?t:Vd(e,t)}function FN(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Vd(e,t){let n=QS.get(e);if(n||(n=e.createElement("a"),QS.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Xw(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&["table","td","th"].includes(t)?pr(e,r):n==="srcset"?BN(e,r):n==="style"?ta(r,Vd(e)):t==="object"&&n==="data"?pr(e,r):r)}function Qw(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function jN(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function na(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?na(Le.parentNode(e),t,n):!1;for(let r=e.classList.length;r--;){let i=e.classList[r];if(t.test(i))return!0}return n?na(Le.parentNode(e),t,n):!1}function e0(e,t,n,r){let i;if(qw(e)){if(i=e,!Le.childNodes(i).length)return!1}else{if(Le.parentElement(e)===null)return!1;i=Le.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(na(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function VN(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function UN(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let o=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),r=!0,t()})}function WN(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:y=!1}=t,S=zN(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Te.Document,childNodes:[],compatMode:e.compatMode}:{type:Te.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Te.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return HN(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:S});case e.TEXT_NODE:return GN(e,{doc:n,needsMask:s,maskTextFn:u,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Te.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Te.Comment,textContent:Le.textContent(e)||"",rootId:S};default:return!1}}function zN(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function GN(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=Le.parentNode(e),a=s&&s.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=Le.textContent(e),u&&l&&(l=ta(l,Vd(t.doc)))),!u&&!c&&l&&n&&(l=r?r(l,Le.parentElement(e)):l.replace(/[\S]/g,"*")),{type:Te.Text,textContent:l||"",rootId:i}}function HN(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=jN(e,r,i),m=LN(e),y={},S=e.attributes.length;for(let b=0;b<S;b++){let v=e.attributes[b];Qw(m,v.name,v.value)||(y[v.name]=Xw(n,m,Nn(v.name),v.value))}if(m==="link"&&o){let b=Array.from(n.styleSheets).find(T=>T.href===e.href),v=null;b&&(v=Jc(b)),v&&(delete y.rel,delete y.href,y._cssText=v)}if(m==="style"&&e.sheet){let b=Jc(e.sheet);b&&(e.childNodes.length>1&&(b=ON(b,e)),y._cssText=b)}if(["input","textarea","select"].includes(m)){let b=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&b?y.value=Qs({element:e,type:ea(e),tagName:m,value:b,maskInputOptions:s,maskInputFn:a}):v&&(y.checked=v)}if(m==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),m==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(e.__context==="2d")kN(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),v=n.createElement("canvas");v.width=e.width,v.height=e.height;let T=v.toDataURL(l.type,l.quality);b!==T&&(y.rr_dataURL=b)}}if(m==="img"&&u){cr||(cr=n.createElement("canvas"),XS=cr.getContext("2d"));let b=e,v=b.currentSrc||b.getAttribute("src")||"<unknown-src>",T=b.crossOrigin,N=()=>{b.removeEventListener("load",N);try{cr.width=b.naturalWidth,cr.height=b.naturalHeight,XS.drawImage(b,0,0),y.rr_dataURL=cr.toDataURL(l.type,l.quality)}catch($){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?N():b.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${v}! Error: ${$}`)}b.crossOrigin==="anonymous"&&(T?y.crossOrigin=T:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?N():b.addEventListener("load",N)}if(["audio","video"].includes(m)){let b=y;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){let{width:b,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${b}px`,rr_height:`${v}px`}}m==="iframe"&&!d(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(m)&&(w=!0)}catch{}return{type:Te.Element,tagName:m,attributes:y,childNodes:[],isSVG:FN(e)||void 0,needBlock:f,rootId:h,isCustom:w}}function ce(e){return e==null?"":e.toLowerCase()}function t0(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function KN(e,t){if(t.comment&&e.type===Te.Comment)return!0;if(e.type===Te.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Zw(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ce(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ce(e.attributes.name)==="application-name"||ce(e.attributes.rel)==="icon"||ce(e.attributes.rel)==="apple-touch-icon"||ce(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ce(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ce(e.attributes.property).match(/^(og|twitter|fb):/)||ce(e.attributes.name).match(/^(og|twitter):/)||ce(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ce(e.attributes.name)==="robots"||ce(e.attributes.name)==="googlebot"||ce(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ce(e.attributes.name)==="author"||ce(e.attributes.name)==="generator"||ce(e.attributes.name)==="framework"||ce(e.attributes.name)==="publisher"||ce(e.attributes.name)==="progid"||ce(e.attributes.property).match(/^article:/)||ce(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ce(e.attributes.name)==="google-site-verification"||ce(e.attributes.name)==="yandex-verification"||ce(e.attributes.name)==="csrf-token"||ce(e.attributes.name)==="p:domain_verify"||ce(e.attributes.name)==="verify-v1"||ce(e.attributes.name)==="verification"||ce(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function hr(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:$=!1,cssCaptured:L=!1}=t,{needsMask:O}=t,{preserveWhiteSpace:Y=!0}=t;O||(O=e0(e,s,a,O===void 0));let he=WN(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:O,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:y,keepIframeSrcFn:N,newlyAddedElement:$,cssCaptured:L});if(!he)return console.warn(e,"not serialized"),null;let de;r.hasNode(e)?de=r.getId(e):KN(he,h)||!Y&&he.type===Te.Text&&!he.textContent.replace(/^\s+|\s+$/gm,"").length?de=gi:de=Jw();let D=Object.assign(he,{id:de});if(r.add(e,D),de===gi)return null;S&&S(e);let Ne=!l;if(D.type===Te.Element){Ne=Ne&&!D.needBlock,delete D.needBlock;let Pe=Le.shadowRoot(e);Pe&&mi(Pe)&&(D.isShadowHost=!0)}if((D.type===Te.Document||D.type===Te.Element)&&Ne){h.headWhitespace&&D.type===Te.Element&&D.tagName==="head"&&(Y=!1);let Pe={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:y,preserveWhiteSpace:Y,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:T,keepIframeSrcFn:N,cssCaptured:!1};if(!(D.type===Te.Element&&D.tagName==="textarea"&&D.attributes.value!==void 0)){D.type===Te.Element&&D.attributes._cssText!==void 0&&typeof D.attributes._cssText=="string"&&(Pe.cssCaptured=!0);for(let pn of Array.from(Le.childNodes(e))){let St=hr(pn,Pe);St&&D.childNodes.push(St)}}let Je=null;if(qw(e)&&(Je=Le.shadowRoot(e)))for(let pn of Array.from(Le.childNodes(Je))){let St=hr(pn,Pe);St&&(mi(Je)&&(St.isShadow=!0),D.childNodes.push(St))}}let bt=Le.parentNode(e);return bt&&hi(bt)&&mi(bt)&&(D.isShadow=!0),D.type===Te.Element&&D.tagName==="iframe"&&VN(e,()=>{let Pe=e.contentDocument;if(Pe&&w){let Je=hr(Pe,{doc:Pe,mirror:r,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:y,preserveWhiteSpace:Y,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:T,keepIframeSrcFn:N});Je&&w(e,Je)}},b),D.type===Te.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&Zw(D.attributes.href)==="css")&&UN(e,()=>{if(v){let Pe=hr(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:y,preserveWhiteSpace:Y,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:T,keepIframeSrcFn:N});Pe&&v(e,Pe)}},T),D}function qN(e,t){let{mirror:n=new Xs,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:T=()=>!1}=t||{},N=c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,$=t0(h);return hr(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:d,maskInputFn:p,slimDOMOptions:$,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:T,newlyAddedElement:!1})}var YN=/(max|min)-device-(width|height)/,$U=new RegExp(YN.source,"g");function ZN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function JN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ud={exports:{}},fe=String,n0=function(){return{isColorSupported:!1,reset:fe,bold:fe,dim:fe,italic:fe,underline:fe,inverse:fe,hidden:fe,strikethrough:fe,black:fe,red:fe,green:fe,yellow:fe,blue:fe,magenta:fe,cyan:fe,white:fe,gray:fe,bgBlack:fe,bgRed:fe,bgGreen:fe,bgYellow:fe,bgBlue:fe,bgMagenta:fe,bgCyan:fe,bgWhite:fe}};Ud.exports=n0();Ud.exports.createColors=n0;var XN=Ud.exports,QN={},e$=Object.freeze(Object.defineProperty({__proto__:null,default:QN},Symbol.toStringTag,{value:"Module"})),mt=JN(e$),ew=XN,tw=mt,Xc=class r0 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r0)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=ew.isColorSupported),tw&&t&&(n=tw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=ew.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
57
+ `+h+a("^")}return" "+l(p)+u}).join(`
58
+ `)}toString(){let t=this.showSourceCode();return t&&(t=`
59
+
60
+ `+t+`
61
+ `),this.name+": "+this.message+t}},Wd=Xc;Xc.default=Xc;var Ei={};Ei.isClean=Symbol("isClean");Ei.my=Symbol("my");var nw={after:`
62
+ `,beforeClose:`
63
+ `,beforeComment:`
64
+ `,beforeDecl:`
65
+ `,beforeOpen:" ",beforeRule:`
66
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t$(e){return e[0].toUpperCase()+e.slice(1)}var Qc=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
67
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return nw[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+t$(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=nw[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
68
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
69
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
70
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
71
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
72
+ `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},i0=Qc;Qc.default=Qc;var n$=i0;function ed(e,t){new n$(t).stringify(e)}var ma=ed;ed.default=ed;var{isClean:ks,my:r$}=Ei,i$=Wd,o$=i0,s$=ma;function td(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>td(s,n)):(o==="object"&&i!==null&&(i=td(i)),n[r]=i)}return n}var nd=class{constructor(t={}){this.raws={},this[ks]=!1,this[r$]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=td(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new i$(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[ks]){this[ks]=!1;let t=this;for(;t=t.parent;)t[ks]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
73
+ `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new o$().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=s$){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},ya=nd;nd.default=nd;var a$=ya,rd=class extends a${constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},ga=rd;rd.default=rd;var l$="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",u$=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},c$=(e=21)=>{let t="",n=e;for(;n--;)t+=l$[Math.random()*64|0];return t},d$={nanoid:c$,customAlphabet:u$},{SourceMapConsumer:rw,SourceMapGenerator:iw}=mt,{existsSync:f$,readFileSync:p$}=mt,{dirname:Fc,join:h$}=mt;function m$(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var id=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Fc(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new rw(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(n.test(t)||r.test(t))return m$(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Fc(t),f$(t))return this.mapFile=t,p$(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof rw)return iw.fromSourceMap(n).toString();if(n instanceof iw)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=h$(Fc(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},o0=id;id.default=id;var{SourceMapConsumer:y$,SourceMapGenerator:g$}=mt,{fileURLToPath:ow,pathToFileURL:As}=mt,{isAbsolute:od,resolve:sd}=mt,{nanoid:b$}=d$,jc=mt,sw=Wd,S$=o0,Vc=Symbol("fromOffsetCache"),w$=!!(y$&&g$),aw=!!(sd&&od),ra=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!aw||/^\w+:\/\//.test(n.from)||od(n.from)?this.file=n.from:this.file=sd(n.from)),aw&&w$){let r=new S$(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+b$(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new sw(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new sw(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(As&&(o.input.url=As(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Vc])r=this[Vc];else{let o=this.css.split(`
74
+ `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Vc]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:sd(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;od(s.source)?l=As(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||As(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(ow)u.file=ow(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},ba=ra;ra.default=ra;jc&&jc.registerInput&&jc.registerInput(ra);var{SourceMapConsumer:s0,SourceMapGenerator:Hs}=mt,{dirname:Ks,relative:a0,resolve:l0,sep:u0}=mt,{pathToFileURL:lw}=mt,x$=ba,v$=!!(s0&&Hs),R$=!!(Ks&&l0&&a0&&u0),C$=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
75
+ `;this.css.includes(`\r
76
+ `)&&(n=`\r
77
+ `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ks(t.file),i;this.mapOpts.sourcesContent===!1?(i=new s0(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),R$&&v$&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Hs.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Hs({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Hs({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
78
+ `),n=a.length-s):n+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ks(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ks(l0(r,this.mapOpts.annotation)));let i=a0(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new x$(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(lw){let r=lw(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;u0==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},c0=C$,k$=ya,ad=class extends k${constructor(t){super(t),this.type="comment"}},Sa=ad;ad.default=ad;var{isClean:d0,my:f0}=Ei,p0=ga,h0=Sa,A$=ya,m0,zd,Gd,y0;function g0(e){return e.map(t=>(t.nodes&&(t.nodes=g0(t.nodes)),delete t.source,t))}function b0(e){if(e[d0]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)b0(t)}var Kt=class S0 extends A${append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=g0(m0(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new p0(t)]}else if(t.selector)t=[new zd(t)];else if(t.name)t=[new Gd(t)];else if(t.text)t=[new h0(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[f0]||S0.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[d0]&&b0(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Kt.registerParse=e=>{m0=e};Kt.registerRule=e=>{zd=e};Kt.registerAtRule=e=>{Gd=e};Kt.registerRoot=e=>{y0=e};var $n=Kt;Kt.default=Kt;Kt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Gd.prototype):e.type==="rule"?Object.setPrototypeOf(e,zd.prototype):e.type==="decl"?Object.setPrototypeOf(e,p0.prototype):e.type==="comment"?Object.setPrototypeOf(e,h0.prototype):e.type==="root"&&Object.setPrototypeOf(e,y0.prototype),e[f0]=!0,e.nodes&&e.nodes.forEach(t=>{Kt.rebuild(t)})};var E$=$n,w0,x0,bi=class extends E${constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new w0(new x0,this,t).stringify()}};bi.registerLazyResult=e=>{w0=e};bi.registerProcessor=e=>{x0=e};var Hd=bi;bi.default=bi;var uw={},v0=function(t){uw[t]||(uw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},ld=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},R0=ld;ld.default=ld;var P$=R0,ud=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new P$(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},Kd=ud;ud.default=ud;var Uc=39,cw=34,Es=92,dw=47,Ps=10,ui=32,Is=12,Ms=9,Ts=13,I$=91,M$=93,T$=40,O$=41,N$=123,$$=125,L$=59,D$=42,_$=58,B$=64,Os=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ns=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,F$=/.[\r\n"'(/\\]/,fw=/[\da-f]/i,j$=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=r.length,y=0,S=[],w=[];function b(){return y}function v(L){throw t.error("Unclosed "+L,y)}function T(){return w.length===0&&y>=m}function N(L){if(w.length)return w.pop();if(y>=m)return;let O=L?L.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case Ps:case ui:case Ms:case Ts:case Is:{s=y;do s+=1,o=r.charCodeAt(s);while(o===ui||o===Ps||o===Ms||o===Ts||o===Is);f=["space",r.slice(y,s)],y=s-1;break}case I$:case M$:case N$:case $$:case _$:case L$:case O$:{let Y=String.fromCharCode(o);f=[Y,Y,y];break}case T$:{if(p=S.length?S.pop()[1]:"",h=r.charCodeAt(y+1),p==="url"&&h!==Uc&&h!==cw&&h!==ui&&h!==Ps&&h!==Ms&&h!==Is&&h!==Ts){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||O){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===Es;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||F$.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case Uc:case cw:{a=o===Uc?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||O){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===Es;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case B$:{Os.lastIndex=y+1,Os.test(r),Os.lastIndex===0?s=r.length-1:s=Os.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case Es:{for(s=y,u=!0;r.charCodeAt(s+1)===Es;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==dw&&o!==ui&&o!==Ps&&o!==Ms&&o!==Ts&&o!==Is&&(s+=1,fw.test(r.charAt(s)))){for(;fw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===ui&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===dw&&r.charCodeAt(y+1)===D$?(s=r.indexOf("*/",y+2)+1,s===0&&(i||O?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(Ns.lastIndex=y+1,Ns.test(r),Ns.lastIndex===0?s=r.length-1:s=Ns.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function $(L){w.push(L)}return{back:$,endOfFile:T,nextToken:N,position:b}},C0=$n,ia=class extends C0{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},qd=ia;ia.default=ia;C0.registerAtRule(ia);var k0=$n,A0,E0,yr=class extends k0{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new A0(new E0,this,t).stringify()}};yr.registerLazyResult=e=>{A0=e};yr.registerProcessor=e=>{E0=e};var Pi=yr;yr.default=yr;k0.registerRoot(yr);var Si={comma(e){return Si.split(e,[","],!0)},space(e){let t=[" ",`
79
+ `," "];return Si.split(e,t)},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},P0=Si;Si.default=Si;var I0=$n,V$=P0,oa=class extends I0{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return V$.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},Yd=oa;oa.default=oa;I0.registerRule(oa);var U$=ga,W$=j$,z$=Sa,G$=qd,H$=Pi,pw=Yd,hw={empty:!0,space:!0};function K$(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var q$=class{constructor(t){this.input=t,this.root=new H$,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new G$;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new z$;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=W$(this.input)}decl(t,n){let r=new U$;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||K$(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new pw;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=r[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!hw[d]&&!hw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=r.reduce((h,f)=>h+f[1],"");t.raws[n]={raw:p,value:l}}t[n]=l}rule(t){t.pop();let n=new pw;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},Y$=q$,Z$=$n,J$=Y$,X$=ba;function sa(e,t){let n=new X$(e,t),r=new J$(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
80
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
81
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
82
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Zd=sa;sa.default=sa;Z$.registerParse(sa);var{isClean:Et,my:Q$}=Ei,e7=c0,t7=ma,n7=$n,r7=Hd,i7=v0,mw=Kd,o7=Zd,s7=Pi,a7={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},l7={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},u7={Once:!0,postcssPlugin:!0,prepare:!0},gr=0;function ci(e){return typeof e=="object"&&typeof e.then=="function"}function M0(e){let t=!1,n=a7[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,gr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,gr,n+"Exit"]:[n,n+"Exit"]}function yw(e){let t;return e.type==="document"?t=["Document",gr,"DocumentExit"]:e.type==="root"?t=["Root",gr,"RootExit"]:t=M0(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cd(e){return e[Et]=!1,e.nodes&&e.nodes.forEach(t=>cd(t)),e}var dd={},br=class T0{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=cd(n);else if(n instanceof T0||n instanceof mw)i=cd(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=o7;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[Q$]&&n7.rebuild(i)}this.result=new mw(t,i,r),this.helpers={...dd,postcss:dd,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!l7[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!u7[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(ci(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Et];){t[Et]=!0;let n=[yw(t)];for(;n.length>0;){let r=this.visitTick(n);if(ci(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return ci(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=t7;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new e7(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(ci(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Et];)t[Et]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||i7("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(ci(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[Et]){a[Et]=!0,t.push(yw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===gr){r.nodes&&r.nodes.length&&(r[Et]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Et]=!0;let n=M0(t);for(let r of n)if(r===gr)t.nodes&&t.each(i=>{i[Et]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};br.registerPostcss=e=>{dd=e};var O0=br;br.default=br;s7.registerLazyResult(br);r7.registerLazyResult(br);var c7=c0,d7=ma,f7=v0,p7=Zd,h7=Kd,fd=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=d7;this.result=new h7(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new c7(o,i,this._opts,n);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||f7("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=p7;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},m7=fd;fd.default=fd;var y7=m7,g7=O0,b7=Hd,S7=Pi,wi=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new y7(this,t,n):new g7(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},w7=wi;wi.default=wi;S7.registerProcessor(wi);b7.registerProcessor(wi);var x7=ga,v7=o0,R7=Sa,C7=qd,k7=ba,A7=Pi,E7=Yd;function xi(e,t){if(Array.isArray(e))return e.map(i=>xi(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:k7.prototype};o.map&&(o.map={...o.map,__proto__:v7.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>xi(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new A7(r);if(r.type==="decl")return new x7(r);if(r.type==="rule")return new E7(r);if(r.type==="comment")return new R7(r);if(r.type==="atrule")return new C7(r);throw new Error("Unknown node type: "+e.type)}var P7=xi;xi.default=xi;var I7=Wd,N0=ga,M7=O0,T7=$n,Jd=w7,O7=ma,N7=P7,$0=Hd,$7=R0,L0=Sa,D0=qd,L7=Kd,D7=ba,_7=Zd,B7=P0,_0=Yd,B0=Pi,F7=ya;function ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Jd(e)}ne.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
83
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
84
+ https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new Jd().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return ne([i(l)]).process(s,a)},i};ne.stringify=O7;ne.parse=_7;ne.fromJSON=N7;ne.list=B7;ne.comment=e=>new L0(e);ne.atRule=e=>new D0(e);ne.decl=e=>new N0(e);ne.rule=e=>new _0(e);ne.root=e=>new B0(e);ne.document=e=>new $0(e);ne.CssSyntaxError=I7;ne.Declaration=N0;ne.Container=T7;ne.Processor=Jd;ne.Document=$0;ne.Comment=L0;ne.Warning=$7;ne.AtRule=D0;ne.Result=L7;ne.Input=D7;ne.Rule=_0;ne.Root=B0;ne.Node=F7;M7.registerPostcss(ne);var j7=ne;ne.default=ne;var ye=ZN(j7);ye.stringify;ye.fromJSON;ye.plugin;ye.parse;ye.list;ye.document;ye.comment;ye.atRule;ye.rule;ye.decl;ye.root;ye.CssSyntaxError;ye.Declaration;ye.Container;ye.Processor;ye.Document;ye.Comment;ye.Warning;ye.AtRule;ye.Result;ye.Input;ye.Rule;ye.Root;ye.Node;var V7=Object.defineProperty,U7=(e,t,n)=>t in e?V7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t,n)=>U7(e,typeof t!="symbol"?t+"":t,n);function W7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function z7(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Xd={exports:{}},pe=String,F0=function(){return{isColorSupported:!1,reset:pe,bold:pe,dim:pe,italic:pe,underline:pe,inverse:pe,hidden:pe,strikethrough:pe,black:pe,red:pe,green:pe,yellow:pe,blue:pe,magenta:pe,cyan:pe,white:pe,gray:pe,bgBlack:pe,bgRed:pe,bgGreen:pe,bgYellow:pe,bgBlue:pe,bgMagenta:pe,bgCyan:pe,bgWhite:pe}};Xd.exports=F0();Xd.exports.createColors=F0;var G7=Xd.exports,H7={},K7=Object.freeze(Object.defineProperty({__proto__:null,default:H7},Symbol.toStringTag,{value:"Module"})),yt=z7(K7),gw=G7,bw=yt,pd=class j0 extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,j0)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=gw.isColorSupported),bw&&t&&(n=bw(n));let r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),s=String(o).length,a,l;if(t){let{bold:u,gray:c,red:d}=gw.createColors(!0);a=p=>u(d(p)),l=p=>c(p)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let d=i+1+c,p=" "+(" "+d).slice(-s)+" | ";if(d===this.line){let h=l(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+u+`
85
+ `+h+a("^")}return" "+l(p)+u}).join(`
86
+ `)}toString(){let t=this.showSourceCode();return t&&(t=`
87
+
88
+ `+t+`
89
+ `),this.name+": "+this.message+t}},Qd=pd;pd.default=pd;var Ii={};Ii.isClean=Symbol("isClean");Ii.my=Symbol("my");var Sw={after:`
90
+ `,beforeClose:`
91
+ `,beforeComment:`
92
+ `,beforeDecl:`
93
+ `,beforeOpen:" ",beforeRule:`
94
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function q7(e){return e[0].toUpperCase()+e.slice(1)}var hd=class{constructor(t){this.builder=t}atrule(t,n){let r="@"+t.name,i=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:i&&(r+=" "),t.nodes)this.block(t,r+i);else{let o=(t.raws.between||"")+(n?";":"");this.builder(r+i+o,t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
95
+ `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<o;a++)r+=s}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(n+r+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let n=t.nodes.length-1;for(;n>0&&t.nodes[n].type==="comment";)n-=1;let r=this.raw(t,"semicolon");for(let i=0;i<t.nodes.length;i++){let o=t.nodes[i],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,n!==i||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+n+t.text+r+"*/",t)}decl(t,n){let r=this.raw(t,"between","colon"),i=t.prop+r+this.rawValue(t,"value");t.important&&(i+=t.raws.important||" !important"),n&&(i+=";"),this.builder(i,t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Sw[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+q7(r);this[a]?i=this[a](s,t):s.walk(l=>{if(i=l.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Sw[r]),s.rawCache[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
96
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
97
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
98
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
99
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
100
+ `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}},V0=hd;hd.default=hd;var Y7=V0;function md(e,t){new Y7(t).stringify(e)}var wa=md;md.default=md;var{isClean:$s,my:Z7}=Ii,J7=Qd,X7=V0,Q7=wa;function yd(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(s=>yd(s,n)):(o==="object"&&i!==null&&(i=yd(i)),n[r]=i)}return n}var gd=class{constructor(t={}){this.raws={},this[$s]=!1,this[Z7]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=yd(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new J7(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markDirty(){if(this[$s]){this[$s]=!1;let t=this;for(;t=t.parent;)t[$s]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,n){let r=this.source.start;if(t.index)r=this.positionInside(t.index,n);else if(t.word){n=this.toString();let i=n.indexOf(t.word);i!==-1&&(r=this.positionInside(i,n))}return r}positionInside(t,n){let r=n||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let s=0;s<t;s++)r[s]===`
101
+ `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let n={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:n.column+1,line:n.line};if(t.word){let i=this.toString(),o=i.indexOf(t.word);o!==-1&&(n=this.positionInside(o,i),r=this.positionInside(o+t.word.length,i))}else t.start?n={column:t.start.column,line:t.start.line}:t.index&&(n=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line}),{end:r,start:n}}raw(t,n){return new X7().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))r[s]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,n):l);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,n);else if(s==="source"){let l=n.get(a.input);l==null&&(l=o,n.set(a.input,o),o++),r[s]={end:a.end,inputId:l,start:a.start}}else r[s]=a}return i&&(r.inputs=[...n.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=Q7){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}get proxyOf(){return this}},xa=gd;gd.default=gd;var e8=xa,bd=class extends e8{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},va=bd;bd.default=bd;var t8="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",n8=(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r},r8=(e=21)=>{let t="",n=e;for(;n--;)t+=t8[Math.random()*64|0];return t},i8={nanoid:r8,customAlphabet:n8},{SourceMapConsumer:ww,SourceMapGenerator:xw}=yt,{existsSync:o8,readFileSync:s8}=yt,{dirname:Wc,join:a8}=yt;function l8(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Sd=class{constructor(t,n){if(n.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Wc(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ww(this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(t)||o.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(n.test(t)||r.test(t))return l8(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t){if(this.root=Wc(t),o8(t))return this.mapFile=t,s8(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof ww)return xw.fromSourceMap(n).toString();if(n instanceof xw)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=a8(Wc(t),r)),this.loadFile(r)}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},U0=Sd;Sd.default=Sd;var{SourceMapConsumer:u8,SourceMapGenerator:c8}=yt,{fileURLToPath:vw,pathToFileURL:Ls}=yt,{isAbsolute:wd,resolve:xd}=yt,{nanoid:d8}=i8,zc=yt,Rw=Qd,f8=U0,Gc=Symbol("fromOffsetCache"),p8=!!(u8&&c8),Cw=!!(xd&&wd),aa=class{constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!Cw||/^\w+:\/\//.test(n.from)||wd(n.from)?this.file=n.from:this.file=xd(n.from)),Cw&&p8){let r=new f8(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+d8(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,s,a;if(n&&typeof n=="object"){let u=n,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);n=d.line,r=d.col}else n=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);s=d.line,a=d.col}else s=c.line,a=c.column}else if(!r){let u=this.fromOffset(n);n=u.line,r=u.col}let l=this.origin(n,r,s,a);return l?o=new Rw(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Rw(t,s===void 0?n:{column:r,line:n},s===void 0?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:n,source:this.css},this.file&&(Ls&&(o.input.url=Ls(this.file).toString()),o.input.file=this.file),o}fromOffset(t){let n,r;if(this[Gc])r=this[Gc];else{let o=this.css.split(`
102
+ `);r=new Array(o.length);let s=0;for(let a=0,l=o.length;a<l;a++)r[a]=s,s+=o[a].length+1;this[Gc]=r}n=r[r.length-1];let i=0;if(t>=n)i=r.length-1;else{let o=r.length-2,s;for(;i<o;)if(s=i+(o-i>>1),t<r[s])o=s-1;else if(t>=r[s+1])i=s+1;else{i=s;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:xd(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;wd(s.source)?l=Ls(s.source):l=new URL(s.source,this.map.consumer().sourceRoot||Ls(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:l.toString()};if(l.protocol==="file:")if(vw)u.file=vw(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}},Ra=aa;aa.default=aa;zc&&zc.registerInput&&zc.registerInput(aa);var{SourceMapConsumer:W0,SourceMapGenerator:qs}=yt,{dirname:Ys,relative:z0,resolve:G0,sep:H0}=yt,{pathToFileURL:kw}=yt,h8=Ra,m8=!!(W0&&qs),y8=!!(Ys&&G0&&z0&&H0),g8=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
103
+ `;this.css.includes(`\r
104
+ `)&&(n=`\r
105
+ `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ys(t.file),i;this.mapOpts.sourcesContent===!1?(i=new W0(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),y8&&m8&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=qs.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new qs({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new qs({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(t+=o.length,s=a.lastIndexOf(`
106
+ `),n=a.length-s):n+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ys(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ys(G0(r,this.mapOpts.annotation)));let i=z0(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new h8(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(kw){let r=kw(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;H0==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}},K0=g8,b8=xa,vd=class extends b8{constructor(t){super(t),this.type="comment"}},Ca=vd;vd.default=vd;var{isClean:q0,my:Y0}=Ii,Z0=va,J0=Ca,S8=xa,X0,ef,tf,Q0;function e1(e){return e.map(t=>(t.nodes&&(t.nodes=e1(t.nodes)),delete t.source,t))}function t1(e){if(e[q0]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)t1(t)}var qt=class n1 extends S8{append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,s)=>i(o.toProxy(),s):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of i)this.proxyOf.nodes.splice(r+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],r<o&&(this.indexes[s]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=e1(X0(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Z0(t)]}else if(t.selector)t=[new ef(t)];else if(t.name)t=[new tf(t)];else if(t.text)t=[new J0(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Y0]||n1.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[q0]&&t1(i),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};qt.registerParse=e=>{X0=e};qt.registerRule=e=>{ef=e};qt.registerAtRule=e=>{tf=e};qt.registerRoot=e=>{Q0=e};var Ln=qt;qt.default=qt;qt.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,tf.prototype):e.type==="rule"?Object.setPrototypeOf(e,ef.prototype):e.type==="decl"?Object.setPrototypeOf(e,Z0.prototype):e.type==="comment"?Object.setPrototypeOf(e,J0.prototype):e.type==="root"&&Object.setPrototypeOf(e,Q0.prototype),e[Y0]=!0,e.nodes&&e.nodes.forEach(t=>{qt.rebuild(t)})};var w8=Ln,r1,i1,vi=class extends w8{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new r1(new i1,this,t).stringify()}};vi.registerLazyResult=e=>{r1=e};vi.registerProcessor=e=>{i1=e};var nf=vi;vi.default=vi;var Aw={},o1=function(t){Aw[t]||(Aw[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Rd=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},s1=Rd;Rd.default=Rd;var x8=s1,Cd=class{constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new x8(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}},rf=Cd;Cd.default=Cd;var Hc=39,Ew=34,Ds=92,Pw=47,_s=10,di=32,Bs=12,Fs=9,js=13,v8=91,R8=93,C8=40,k8=41,A8=123,E8=125,P8=59,I8=42,M8=58,T8=64,Vs=/[\t\n\f\r "#'()/;[\\\]{}]/g,Us=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,O8=/.[\r\n"'(/\\]/,Iw=/[\da-f]/i,N8=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,s,a,l,u,c,d,p,h,f,m=r.length,y=0,S=[],w=[];function b(){return y}function v(L){throw t.error("Unclosed "+L,y)}function T(){return w.length===0&&y>=m}function N(L){if(w.length)return w.pop();if(y>=m)return;let O=L?L.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case _s:case di:case Fs:case js:case Bs:{s=y;do s+=1,o=r.charCodeAt(s);while(o===di||o===_s||o===Fs||o===js||o===Bs);f=["space",r.slice(y,s)],y=s-1;break}case v8:case R8:case A8:case E8:case M8:case P8:case k8:{let Y=String.fromCharCode(o);f=[Y,Y,y];break}case C8:{if(p=S.length?S.pop()[1]:"",h=r.charCodeAt(y+1),p==="url"&&h!==Hc&&h!==Ew&&h!==di&&h!==_s&&h!==Fs&&h!==Bs&&h!==js){s=y;do{if(c=!1,s=r.indexOf(")",s+1),s===-1)if(i||O){s=y;break}else v("bracket");for(d=s;r.charCodeAt(d-1)===Ds;)d-=1,c=!c}while(c);f=["brackets",r.slice(y,s+1),y,s],y=s}else s=r.indexOf(")",y+1),l=r.slice(y,s+1),s===-1||O8.test(l)?f=["(","(",y]:(f=["brackets",l,y,s],y=s);break}case Hc:case Ew:{a=o===Hc?"'":'"',s=y;do{if(c=!1,s=r.indexOf(a,s+1),s===-1)if(i||O){s=y+1;break}else v("string");for(d=s;r.charCodeAt(d-1)===Ds;)d-=1,c=!c}while(c);f=["string",r.slice(y,s+1),y,s],y=s;break}case T8:{Vs.lastIndex=y+1,Vs.test(r),Vs.lastIndex===0?s=r.length-1:s=Vs.lastIndex-2,f=["at-word",r.slice(y,s+1),y,s],y=s;break}case Ds:{for(s=y,u=!0;r.charCodeAt(s+1)===Ds;)s+=1,u=!u;if(o=r.charCodeAt(s+1),u&&o!==Pw&&o!==di&&o!==_s&&o!==Fs&&o!==js&&o!==Bs&&(s+=1,Iw.test(r.charAt(s)))){for(;Iw.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===di&&(s+=1)}f=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===Pw&&r.charCodeAt(y+1)===I8?(s=r.indexOf("*/",y+2)+1,s===0&&(i||O?s=r.length:v("comment")),f=["comment",r.slice(y,s+1),y,s],y=s):(Us.lastIndex=y+1,Us.test(r),Us.lastIndex===0?s=r.length-1:s=Us.lastIndex-2,f=["word",r.slice(y,s+1),y,s],S.push(f),y=s);break}}return y++,f}function $(L){w.push(L)}return{back:$,endOfFile:T,nextToken:N,position:b}},a1=Ln,la=class extends a1{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}},of=la;la.default=la;a1.registerAtRule(la);var l1=Ln,u1,c1,Sr=class extends l1{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new u1(new c1,this,t).stringify()}};Sr.registerLazyResult=e=>{u1=e};Sr.registerProcessor=e=>{c1=e};var Mi=Sr;Sr.default=Sr;l1.registerRoot(Sr);var Ri={comma(e){return Ri.split(e,[","],!0)},space(e){let t=[" ",`
107
+ `," "];return Ri.split(e,t)},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?s+=1:c===")"?s>0&&(s-=1):s===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}},d1=Ri;Ri.default=Ri;var f1=Ln,$8=d1,ua=class extends f1{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return $8.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}},sf=ua;ua.default=ua;f1.registerRule(ua);var L8=va,D8=N8,_8=Ca,B8=of,F8=Mi,Mw=sf,Tw={empty:!0,space:!0};function j8(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var V8=class{constructor(t){this.input=t,this.root=new F8,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new B8;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(n.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(n,"params",l),s&&(t=l[l.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),a&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[s,a]of t.entries()){if(r=a,i=r[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return s}o=r}return!1}comment(t){let n=new _8;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=D8(this.input)}decl(t,n){let r=new L8;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||j8(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),d="";for(let p=u;p>0;p--){let h=c[p][0];if(d.trim().indexOf("!")===0&&h!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Mw;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,s=[],a=t[1].startsWith("--"),l=[],u=t;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),s.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),s.push("}");else if(s.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),n=!0;break}else r===":"&&(i=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,s,a=r.length,l="",u=!0,c,d;for(let p=0;p<a;p+=1)o=r[p],s=o[0],s==="space"&&p===a-1&&!i?u=!1:s==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Tw[d]&&!Tw[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let p=r.reduce((h,f)=>h+f[1],"");t.raws[n]={raw:p,value:l}}t[n]=l}rule(t){t.pop();let n=new Mw;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}},U8=V8,W8=Ln,z8=U8,G8=Ra;function ca(e,t){let n=new G8(e,t),r=new z8(n);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
108
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
109
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
110
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var af=ca;ca.default=ca;W8.registerParse(ca);var{isClean:Pt,my:H8}=Ii,K8=K0,q8=wa,Y8=Ln,Z8=nf,J8=o1,Ow=rf,X8=af,Q8=Mi,e9={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},t9={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},n9={Once:!0,postcssPlugin:!0,prepare:!0},wr=0;function fi(e){return typeof e=="object"&&typeof e.then=="function"}function p1(e){let t=!1,n=e9[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,wr,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,wr,n+"Exit"]:[n,n+"Exit"]}function Nw(e){let t;return e.type==="document"?t=["Document",wr,"DocumentExit"]:e.type==="root"?t=["Root",wr,"RootExit"]:t=p1(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function kd(e){return e[Pt]=!1,e.nodes&&e.nodes.forEach(t=>kd(t)),e}var Ad={},xr=class h1{constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=kd(n);else if(n instanceof h1||n instanceof Ow)i=kd(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=X8;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(s){this.processed=!0,this.error=s}i&&!i[H8]&&Y8.rebuild(i)}this.result=new Ow(t,i,r),this.helpers={...Ad,postcss:Ad,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{if(n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=r.postcssPlugin,t.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,s=this.result.processor.version,a=o.split("."),l=s.split(".");(a[0]!==l[0]||parseInt(a[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!t9[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!n9[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(fi(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Pt];){t[Pt]=!0;let n=[Nw(t)];for(;n.length>0;){let r=this.visitTick(n);if(fi(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return fi(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=q8;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=new K8(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(fi(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Pt];)t[Pt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this.opts||J8("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(fi(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[s,a]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(n.iterator!==0){let s=n.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[Pt]){a[Pt]=!0,t.push(Nw(a));return}n.iterator=0,delete r.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===wr){r.nodes&&r.nodes.length&&(r[Pt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[Pt]=!0;let n=p1(t);for(let r of n)if(r===wr)t.nodes&&t.each(i=>{i[Pt]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};xr.registerPostcss=e=>{Ad=e};var m1=xr;xr.default=xr;Q8.registerLazyResult(xr);Z8.registerLazyResult(xr);var r9=K0,i9=wa,o9=o1,s9=af,a9=rf,Ed=class{constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i,o=i9;this.result=new a9(this._processor,i,this._opts),this.result.css=n;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new r9(o,i,this._opts,n);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return process.env.NODE_ENV!=="production"&&("from"in this._opts||o9("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,n)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=s9;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}},l9=Ed;Ed.default=Ed;var u9=l9,c9=m1,d9=nf,f9=Mi,Ci=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new u9(this,t,n):new c9(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}},p9=Ci;Ci.default=Ci;f9.registerProcessor(Ci);d9.registerProcessor(Ci);var h9=va,m9=U0,y9=Ca,g9=of,b9=Ra,S9=Mi,w9=sf;function ki(e,t){if(Array.isArray(e))return e.map(i=>ki(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:b9.prototype};o.map&&(o.map={...o.map,__proto__:m9.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>ki(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new S9(r);if(r.type==="decl")return new h9(r);if(r.type==="rule")return new w9(r);if(r.type==="comment")return new y9(r);if(r.type==="atrule")return new g9(r);throw new Error("Unknown node type: "+e.type)}var x9=ki;ki.default=ki;var v9=Qd,y1=va,R9=m1,C9=Ln,lf=p9,k9=wa,A9=x9,g1=nf,E9=s1,b1=Ca,S1=of,P9=rf,I9=Ra,M9=af,T9=d1,w1=sf,x1=Mi,O9=xa;function re(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new lf(e)}re.plugin=function(t,n){let r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
111
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
112
+ https://www.w3ctech.com/topic/2226`));let a=n(...s);return a.postcssPlugin=t,a.postcssVersion=new lf().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(s,a,l){return re([i(l)]).process(s,a)},i};re.stringify=k9;re.parse=M9;re.fromJSON=A9;re.list=T9;re.comment=e=>new b1(e);re.atRule=e=>new S1(e);re.decl=e=>new y1(e);re.rule=e=>new w1(e);re.root=e=>new x1(e);re.document=e=>new g1(e);re.CssSyntaxError=v9;re.Declaration=y1;re.Container=C9;re.Processor=lf;re.Document=g1;re.Comment=b1;re.Warning=E9;re.AtRule=S1;re.Result=P9;re.Input=I9;re.Rule=w1;re.Root=x1;re.Node=O9;R9.registerPostcss(re);var N9=re;re.default=re;var ge=W7(N9);ge.stringify;ge.fromJSON;ge.plugin;ge.parse;ge.list;ge.document;ge.comment;ge.atRule;ge.rule;ge.decl;ge.root;ge.CssSyntaxError;ge.Declaration;ge.Container;ge.Processor;ge.Document;ge.Comment;ge.Warning;ge.AtRule;ge.Result;ge.Input;ge.Rule;ge.Root;ge.Node;var Pd=class e{constructor(...t){tt(this,"parentElement",null),tt(this,"parentNode",null),tt(this,"ownerDocument"),tt(this,"firstChild",null),tt(this,"lastChild",null),tt(this,"previousSibling",null),tt(this,"nextSibling",null),tt(this,"ELEMENT_NODE",1),tt(this,"TEXT_NODE",3),tt(this,"nodeType"),tt(this,"nodeName"),tt(this,"RRNodeType")}get childNodes(){let t=[],n=this.firstChild;for(;n;)t.push(n),n=n.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var $w={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ws={},$9=()=>!!globalThis.Zone;function uf(e){if(Ws[e])return Ws[e];let t=globalThis[e],n=t.prototype,r=e in $w?$w[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=e in Lw?Lw[e]:void 0,s=!!(o&&o.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!$9())return Ws[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let u=l[e].prototype;return document.body.removeChild(a),u?Ws[e]=u:n}catch{return n}}var Kc={};function Zt(e,t,n){var r;let i=`${e}.${String(n)}`;if(Kc[i])return Kc[i].call(t);let o=uf(e),s=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return s?(Kc[i]=s,s.call(t)):t[n]}var qc={};function v1(e,t,n){let r=`${e}.${String(n)}`;if(qc[r])return qc[r].bind(t);let o=uf(e)[n];return typeof o!="function"?t[n]:(qc[r]=o,o.bind(t))}function L9(e){return Zt("Node",e,"ownerDocument")}function D9(e){return Zt("Node",e,"childNodes")}function _9(e){return Zt("Node",e,"parentNode")}function B9(e){return Zt("Node",e,"parentElement")}function F9(e){return Zt("Node",e,"textContent")}function j9(e,t){return v1("Node",e,"contains")(t)}function V9(e){return v1("Node",e,"getRootNode")()}function U9(e){return!e||!("host"in e)?null:Zt("ShadowRoot",e,"host")}function W9(e){return e.styleSheets}function z9(e){return!e||!("shadowRoot"in e)?null:Zt("Element",e,"shadowRoot")}function G9(e,t){return Zt("Element",e,"querySelector")(t)}function H9(e,t){return Zt("Element",e,"querySelectorAll")(t)}function R1(){return uf("MutationObserver").constructor}function Dn(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var j={ownerDocument:L9,childNodes:D9,parentNode:_9,parentElement:B9,textContent:F9,contains:j9,getRootNode:V9,host:U9,styleSheets:W9,shadowRoot:z9,querySelector:G9,querySelectorAll:H9,mutationObserver:R1,patch:Dn};function Fe(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var dr=`Please stop import mirror directly. Instead of that,\r
113
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
114
+ or you can use record.mirror to access the mirror instance during recording.`,Dw={map:{},getId(){return console.error(dr),-1},getNode(){return console.error(dr),null},removeNodeFromMap(){console.error(dr)},has(){return console.error(dr),!1},reset(){console.error(dr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Dw=new Proxy(Dw,{get(e,t,n){return t==="map"&&console.error(dr),Reflect.get(e,t,n)}}));function Ai(e,t,n={}){let r=null,i=0;return function(...o){let s=Date.now();!i&&n.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(l,o)},a))}}function ka(e,t,n,r,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>ka(e,t,o||{},!0)}var da=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(da=()=>new Date().getTime());function C1(e){var t,n,r,i;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=j.parentElement(o.body))==null?void 0:t.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=j.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o?.body)==null?void 0:i.scrollTop)||0}}function k1(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function A1(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function E1(e){return e?e.nodeType===e.ELEMENT_NODE?e:j.parentElement(e):null}function je(e,t,n,r){if(!e)return!1;let i=E1(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(na(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function K9(e,t){return t.getId(e)!==-1}function Yc(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===gi}function P1(e,t){if(hi(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=j.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?P1(r,t):!0}function Id(e){return!!e.changedTouches}function q9(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function I1(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function M1(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Md(e){return e?e instanceof Pd&&"shadowRoot"in e?!!e.shadowRoot:!!j.shadowRoot(e):!1}var Td=class{constructor(){k(this,"id",1),k(this,"styleIDMap",new WeakMap),k(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function T1(e){var t;let n=null;return"getRootNode"in e&&((t=j.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&j.host(j.getRootNode(e))&&(n=j.host(j.getRootNode(e))),n}function Y9(e){let t=e,n;for(;n=T1(t);)t=n;return t}function Z9(e){let t=j.ownerDocument(e);if(!t)return!1;let n=Y9(e);return j.contains(t,n)}function O1(e){let t=j.ownerDocument(e);return t?j.contains(t,e)||Z9(e):!1}var H=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(H||{}),U=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(U||{}),Ue=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ue||{}),Ht=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ht||{}),vr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(vr||{}),fr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(fr||{});var N1=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(N1||{});function _w(e){return"__ln"in e}var Od=class{constructor(){k(this,"length",0),k(this,"head",null),k(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&_w(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&_w(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Bw=(e,t)=>`${e}@${t}`,Nd=class{constructor(){k(this,"frozen",!1),k(this,"locked",!1),k(this,"texts",[]),k(this,"attributes",[]),k(this,"attributeMap",new WeakMap),k(this,"removes",[]),k(this,"mapRemoves",[]),k(this,"movedMap",{}),k(this,"addedSet",new Set),k(this,"movedSet",new Set),k(this,"droppedSet",new Set),k(this,"removesSubTreeCache",new Set),k(this,"mutationCb"),k(this,"blockClass"),k(this,"blockSelector"),k(this,"maskTextClass"),k(this,"maskTextSelector"),k(this,"inlineStylesheet"),k(this,"maskInputOptions"),k(this,"maskTextFn"),k(this,"maskInputFn"),k(this,"keepIframeSrcFn"),k(this,"recordCanvas"),k(this,"inlineImages"),k(this,"slimDOMOptions"),k(this,"dataURLOptions"),k(this,"doc"),k(this,"mirror"),k(this,"iframeManager"),k(this,"stylesheetManager"),k(this,"shadowDomManager"),k(this,"canvasManager"),k(this,"processedNodeManager"),k(this,"unattachedDoc"),k(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),k(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Od,i=l=>{let u=l,c=gi;for(;c===gi;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{let u=j.parentNode(l);if(!u||!O1(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let f=u.tagName;if(f==="TEXTAREA")return;f==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=hi(u)?this.mirror.getId(T1(l)):this.mirror.getId(u),p=i(l);if(d===-1||p===-1)return r.addNode(l);let h=hr(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{I1(f,this.mirror)&&this.iframeManager.addIframe(f),M1(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Md(l)&&this.shadowDomManager.addShadowRoot(j.shadowRoot(l),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:c});h&&(t.push({parentId:d,nextId:p,node:h}),n.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)Fw(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(j.parentNode(l))||o(l);for(let l of this.addedSet)!jw(this.droppedSet,l)&&!Fw(this.removesSubTreeCache,l,this.mirror)||jw(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){let u=this.mirror.getId(j.parentNode(s.value)),c=i(s.value);u!==-1&&c!==-1&&(l=s)}if(!l){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(j.parentNode(c.value));if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{let h=c.value,f=j.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=j.host(f);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),o(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=j.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),k(this,"genTextAreaValueMutation",t=>{let n=this.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(t,n));let r=Array.from(j.childNodes(t),i=>j.textContent(i)||"").join("");n.attributes.value=Qs({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ea(t),value:r,maskInputFn:this.maskInputFn})}),k(this,"processMutation",t=>{if(!Yc(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let n=j.textContent(t.target);!je(t.target,this.blockClass,this.blockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:e0(t.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,E1(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,i=t.target.getAttribute(r);if(r==="value"){let s=ea(n);i=Qs({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:s,value:i,maskInputFn:this.maskInputFn})}if(je(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Qw(n.tagName,r))if(o.attributes[r]=Xw(this.doc,Nn(n.tagName),Nn(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let s=this.unattachedDoc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(let a of Array.from(n.style)){let l=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);l!==s.style.getPropertyValue(a)||u!==s.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(let a of Array.from(s.style))n.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(je(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),i=hi(t.target)?this.mirror.getId(j.host(t.target)):this.mirror.getId(t.target);je(t.target,this.blockClass,this.blockSelector,!1)||Yc(n,this.mirror,this.slimDOMOptions)||!K9(n,this.mirror)||(this.addedSet.has(n)?($d(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||P1(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Bw(r,i)]?$d(this.movedSet,n):(this.removes.push({parentId:i,id:r,isShadow:hi(t.target)&&mi(t.target)?!0:void 0}),J9(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),k(this,"genAdds",(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Yc(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Bw(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);je(t,this.blockClass,this.blockSelector,!1)||(j.childNodes(t).forEach(r=>this.genAdds(r)),Md(t)&&j.childNodes(j.shadowRoot(t)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function $d(e,t){e.delete(t),j.childNodes(t).forEach(n=>$d(e,n))}function J9(e,t){let n=[e];for(;n.length;){let r=n.pop();t.has(r)||(t.add(r),j.childNodes(r).forEach(i=>n.push(i)))}}function Fw(e,t,n){return e.size===0?!1:X9(e,t)}function X9(e,t,n){let r=j.parentNode(t);return r?e.has(r):!1}function jw(e,t){return e.size===0?!1:$1(e,t)}function $1(e,t){let n=j.parentNode(t);return n?e.has(n)?!0:$1(e,n):!1}var yi;function Q9(e){yi=e}function e5(){yi=void 0}var q=e=>yi?(...n)=>{try{return e(...n)}catch(r){if(yi&&yi(r)===!0)return;throw r}}:e,On=[];function Ti(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function L1(e,t){let n=new Nd;On.push(n),n.init(e);let r=new(R1())(q(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function t5({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Ai(q(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),o),u=q(Ai(q(d=>{let p=Ti(d),{clientX:h,clientY:f}=Id(d)?d.changedTouches[0]:d;a||(a=da()),s.push({x:h,y:f,id:r.getId(p),timeOffset:da()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?U.Drag:d instanceof MouseEvent?U.MouseMove:U.TouchMove)}),i,{trailing:!1})),c=[Fe("mousemove",u,n),Fe("touchmove",u,n),Fe("drag",u,n)];return q(()=>{c.forEach(d=>d())})}function n5({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=null,u=c=>d=>{let p=Ti(d);if(je(p,r,i,!0))return;let h=null,f=c;if("pointerType"in d){switch(d.pointerType){case"mouse":h=Ht.Mouse;break;case"touch":h=Ht.Touch;break;case"pen":h=Ht.Pen;break}h===Ht.Touch?Ue[c]===Ue.MouseDown?f="TouchStart":Ue[c]===Ue.MouseUp&&(f="TouchEnd"):Ht.Pen}else Id(d)&&(h=Ht.Touch);h!==null?(l=h,(f.startsWith("Touch")&&h===Ht.Touch||f.startsWith("Mouse")&&h===Ht.Mouse)&&(h=null)):Ue[c]===Ue.Click&&(h=l,l=null);let m=Id(d)?d.changedTouches[0]:d;if(!m)return;let y=n.getId(p),{clientX:S,clientY:w}=m;q(e)({type:Ue[f],id:y,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(Ue).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let d=Nn(c),p=u(c);if(window.PointerEvent)switch(Ue[c]){case Ue.MouseDown:case Ue.MouseUp:d=d.replace("mouse","pointer");break;case Ue.TouchStart:case Ue.TouchEnd:return}a.push(Fe(d,p,t))}),q(()=>{a.forEach(c=>c())})}function D1({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){let s=q(Ai(q(a=>{let l=Ti(a);if(!l||je(l,r,i,!0))return;let u=n.getId(l);if(l===t&&t.defaultView){let c=C1(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Fe("scroll",s,t)}function r5({viewportResizeCb:e},{win:t}){let n=-1,r=-1,i=q(Ai(q(()=>{let o=k1(),s=A1();(n!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),n=o,r=s)}),200));return Fe("resize",i,t)}var i5=["INPUT","TEXTAREA","SELECT"],Vw=new WeakMap;function o5({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(w){let b=Ti(w),v=w.isTrusted,T=b&&b.tagName;if(b&&T==="OPTION"&&(b=j.parentElement(b)),!b||!T||i5.indexOf(T)<0||je(b,r,i,!0)||b.classList.contains(o)||s&&b.matches(s))return;let N=b.value,$=!1,L=ea(b)||"";L==="radio"||L==="checkbox"?$=b.checked:(a[T.toLowerCase()]||a[L])&&(N=Qs({element:b,maskInputOptions:a,tagName:T,type:L,value:N,maskInputFn:l})),p(b,c?{text:N,isChecked:$,userTriggered:v}:{text:N,isChecked:$});let O=b.name;L==="radio"&&O&&$&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(Y=>{if(Y!==b){let he=Y.value;p(Y,c?{text:he,isChecked:!$,userTriggered:!1}:{text:he,isChecked:!$})}})}function p(w,b){let v=Vw.get(w);if(!v||v.text!==b.text||v.isChecked!==b.isChecked){Vw.set(w,b);let T=n.getId(w);q(e)({...b,id:T})}}let f=(u.input==="last"?["change"]:["input","change"]).map(w=>Fe(w,q(d),t)),m=t.defaultView;if(!m)return()=>{f.forEach(w=>w())};let y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),S=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&f.push(...S.map(w=>ka(w[0],w[1],{set(){q(d)({target:this,isTrusted:!1})}},!1,m))),q(()=>{f.forEach(w=>w())})}function fa(e){let t=[];function n(r,i){if(zs("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||zs("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||zs("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||zs("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(s)}return i}return n(e,t)}function fn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function s5({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:q((c,d,p)=>{let[h,f]=p,{id:m,styleId:y}=fn(d,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,adds:[{rule:h,index:f}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let h=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[h,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:q((c,d,p)=>{let[h]=p,{id:f,styleId:m}=fn(d,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,removes:[{index:h}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:q((c,d,p)=>{let[h]=p,{id:f,styleId:m}=fn(d,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replace:h}),c.apply(d,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:q((c,d,p)=>{let[h]=p,{id:f,styleId:m}=fn(d,t,n.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,replaceSync:h}),c.apply(d,p)})}));let l={};Gs("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Gs("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Gs("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Gs("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:q((p,h,f)=>{let[m,y]=f,{id:S,styleId:w}=fn(h.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:m,index:[...fa(h),y||0]}]}),p.apply(h,f)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:q((p,h,f)=>{let[m]=f,{id:y,styleId:S}=fn(h.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...fa(h),m]}]}),p.apply(h,f)})})}),q(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function _1({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(j.host(n));let a=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(i=n.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=l.set)==null?void 0:c.call(this,u);if(s!==null&&s!==-1)try{t.adoptStyleSheets(u,s)}catch{}return d}}),q(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function a5({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:q((a,l,u)=>{var c;let[d,p,h]=u;if(n.has(d))return o.apply(l,[d,p,h]);let{id:f,styleId:m}=fn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:p,priority:h},index:fa(l.parentRule)}),a.apply(l,u)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:q((a,l,u)=>{var c;let[d]=u;if(n.has(d))return s.apply(l,[d]);let{id:p,styleId:h}=fn((c=l.parentRule)==null?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,remove:{property:d},index:fa(l.parentRule)}),a.apply(l,u)})}),q(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}function l5({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){let s=q(l=>Ai(q(u=>{let c=Ti(u);if(!c||je(c,t,n,!0))return;let{currentTime:d,volume:p,muted:h,playbackRate:f,loop:m}=c;e({type:l,id:r.getId(c),currentTime:d,volume:p,muted:h,playbackRate:f,loop:m})}),i.media||500)),a=[Fe("play",s(fr.Play),o),Fe("pause",s(fr.Pause),o),Fe("seeked",s(fr.Seeked),o),Fe("volumechange",s(fr.VolumeChange),o),Fe("ratechange",s(fr.RateChange),o)];return q(()=>{a.forEach(l=>l())})}function u5({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(l,u,c){let d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let s=Dn(t.fonts,"add",function(a){return function(l){return setTimeout(q(()=>{let u=i.get(l);u&&(e(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=o}),r.push(s),q(()=>{r.forEach(a=>a())})}function c5(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e,s=!0,a=q(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){let p=l.getRangeAt(d),{startContainer:h,startOffset:f,endContainer:m,endOffset:y}=p;je(h,r,i,!0)||je(m,r,i,!0)||u.push({start:n.getId(h),startOffset:f,end:n.getId(m),endOffset:y})}o({ranges:u})});return a(),Fe("selectionchange",a)}function d5({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Dn(n.customElements,"define",function(i){return function(o,s,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,s,a])}})}function f5(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),o(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),s(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),a(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),l(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),c(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),p(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),h(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),f(...m)}}function p5(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};f5(e,t);let r;e.recordDOM&&(r=L1(e,e.doc));let i=t5(e),o=n5(e),s=D1(e),a=r5(e,{win:n}),l=o5(e),u=l5(e),c=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(c=s5(e,{win:n}),d=_1(e,e.doc),p=a5(e,{win:n}),e.collectFonts&&(h=u5(e)));let f=c5(e),m=d5(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,n,S.options));return q(()=>{On.forEach(S=>S.reset()),r?.disconnect(),i(),o(),s(),a(),l(),u(),c(),d(),p(),h(),f(),m(),y.forEach(S=>S())})}function zs(e){return typeof window[e]<"u"}function Gs(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var pa=class{constructor(t){k(this,"iframeIdToRemoteIdMap",new WeakMap),k(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,n,r,i){let o=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(n);return a||(a=this.generateIdFn(),o.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){let i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let o=i.get(n);return o||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},Ld=class{constructor(t){k(this,"iframes",new WeakMap),k(this,"crossOriginIframeMap",new WeakMap),k(this,"crossOriginIframeMirror",new pa(Jw)),k(this,"crossOriginIframeStyleMirror"),k(this,"crossOriginIframeRootIdMap",new WeakMap),k(this,"mirror"),k(this,"mutationCb"),k(this,"wrappedEmit"),k(this,"loadListener"),k(this,"stylesheetManager"),k(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pa(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=t.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let i=this.crossOriginIframeMap.get(t.source);if(!i)return;let o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:H.IncrementalSnapshot,data:{source:U.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return n;case H.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case H.IncrementalSnapshot:switch(n.data.source){case U.Mutation:return n.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case U.Drag:case U.TouchMove:case U.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case U.ViewportResize:return!1;case U.MediaInteraction:case U.MouseInteraction:case U.Scroll:case U.CanvasMutation:case U.Input:return this.replaceIds(n.data,t,["id"]),n;case U.StyleSheetRule:case U.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case U.Font:return n;case U.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case U.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}return!1}replace(t,n,r,i){for(let o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==N1.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Dd=class{constructor(t){k(this,"shadowDoms",new WeakSet),k(this,"mutationCb"),k(this,"scrollCb"),k(this,"bypassOptions"),k(this,"mirror"),k(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!mi(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let r=L1({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(D1({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(j.host(t))),this.restoreHandlers.push(_1({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Dn(t.prototype,"attachShadow",function(i){return function(o){let s=i.call(this,o),a=j.shadowRoot(this);return a&&O1(this)&&r.addShadowRoot(a,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h5=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(pi=0;pi<mr.length;pi++)h5[mr.charCodeAt(pi)]=pi;var pi,m5=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=mr[t[n]>>2],i+=mr[(t[n]&3)<<4|t[n+1]>>4],i+=mr[(t[n+1]&15)<<2|t[n+2]>>6],i+=mr[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Uw=new Map;function y5(e,t){let n=Uw.get(e);return n||(n=new Map,Uw.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var B1=(e,t,n)=>{if(!e||!(j1(e,t)||typeof e=="object"))return;let r=e.constructor.name,i=y5(n,r),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Zs(e,t,n){if(e instanceof Array)return e.map(r=>Zs(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,i=m5(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Zs(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Zs(e.data,t,n),e.width,e.height]};if(j1(e,t)||typeof e=="object"){let r=e.constructor.name,i=B1(e,t,n);return{rr_type:r,index:i}}}}return e}var F1=(e,t,n)=>e.map(r=>Zs(r,t,n)),j1=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function g5(e,t,n,r){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Dn(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...u){return je(this.canvas,n,r,!0)||setTimeout(()=>{let c=F1(u,t,this);e(this.canvas,{type:vr["2D"],property:s,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=ka(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:vr["2D"],property:s,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(s=>s())}}function b5(e){return e==="experimental-webgl"?"webgl":e}function Ww(e,t,n,r){let i=[];try{let o=Dn(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!je(this,t,n,!0)){let u=b5(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function zw(e,t,n,r,i,o){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=Dn(e,l,function(c){return function(...d){let p=c.apply(this,d);if(B1(p,o,this),"tagName"in this.canvas&&!je(this.canvas,r,i,!0)){let h=F1(d,o,this),f={type:t,property:l,args:h};n(this.canvas,f)}return p}});s.push(u)}catch{let u=ka(e,l,{set(c){n(this.canvas,{type:t,property:l,args:[c],setter:!0})}});s.push(u)}return s}function S5(e,t,n,r){let i=[];return i.push(...zw(t.WebGLRenderingContext.prototype,vr.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...zw(t.WebGL2RenderingContext.prototype,vr.WebGL2,e,n,r,t)),()=>{i.forEach(o=>o())}}var V1="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",w5=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Gw=typeof window<"u"&&window.Blob&&new Blob([w5(V1)],{type:"text/javascript;charset=utf-8"});function x5(e){let t;try{if(t=Gw&&(window.URL||window.webkitURL).createObjectURL(Gw),!t)throw"";let n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+V1,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var _d=class{constructor(t){k(this,"pendingCanvasMutations",new Map),k(this,"rafStamps",{latestId:0,invokeId:null}),k(this,"mirror"),k(this,"mutationCb"),k(this,"resetObservers"),k(this,"frozen",!1),k(this,"locked",!1),k(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,i,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r,i,o){let s=Ww(n,r,i,!0),a=new Map,l=new x5;l.onmessage=f=>{let{id:m}=f.data;if(a.set(m,!1),!("base64"in f.data))return;let{base64:y,type:S,width:w,height:b}=f.data;this.mutationCb({id:m,type:vr["2D"],commands:[{property:"clearRect",args:[0,0,w,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let u=1e3/t,c=0,d,p=()=>{let f=[];return n.document.querySelectorAll("canvas").forEach(m=>{je(m,r,i,!0)||f.push(m)}),f},h=f=>{if(c&&f-c<u){d=requestAnimationFrame(h);return}c=f,p().forEach(async m=>{var y;let S=this.mirror.getId(m);if(a.get(S)||m.width===0||m.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(m.__context)){let b=m.getContext(m.__context);((y=b?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let w=await createImageBitmap(m);l.postMessage({id:S,bitmap:w,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[w])}),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Ww(t,n,r,!1),o=g5(this.processMutation.bind(this),t,n,r),s=S5(this.processMutation.bind(this),t,n,r);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let i=r.map(s=>{let{type:a,...l}=s;return l}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}},Bd=class{constructor(t){k(this,"trackedLinkElements",new WeakSet),k(this,"mutationCb"),k(this,"adoptedStyleSheetCb"),k(this,"styleMirror",new Td),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},i=[];for(let o of t){let s;this.styleMirror.has(o)?s=this.styleMirror.getId(o):(s=this.styleMirror.add(o),i.push({styleId:s,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Yw(a,o.href),index:l}))})),r.styleIds.push(s)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Fd=class{constructor(){k(this,"nodeMap",new WeakMap),k(this,"active",!1)}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},Re,Js,Zc,ha=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((KS=e.contentWindow)==null?void 0:KS.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ht=CN();function _n(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:y,packFn:S,sampling:w={},dataURLOptions:b={},mousemoveWait:v,recordDOM:T=!0,recordCanvas:N=!1,recordCrossOriginIframes:$=!1,recordAfter:L=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:Y=!1,inlineImages:he=!1,plugins:de,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:Ne=new Set([]),errorHandler:bt}=e;Q9(bt);let Pe=$?window.parent===window:!0,Je=!1;if(!Pe)try{window.parent.document&&(Je=!1)}catch{Je=!0}if(Pe&&!t)throw new Error("emit function is required");if(!Pe&&!Je)return()=>{};v!==void 0&&w.mousemove===void 0&&(w.mousemove=v),ht.reset();let pn=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},St=t0(h);q9();let gf,Aa=0,bf=Q=>{for(let nt of de||[])nt.eventProcessor&&(Q=nt.eventProcessor(Q));return S&&!Je&&(Q=S(Q)),Q};Re=(Q,nt)=>{var Se;let we=Q;if(we.timestamp=da(),(Se=On[0])!=null&&Se.isFrozen()&&we.type!==H.FullSnapshot&&!(we.type===H.IncrementalSnapshot&&we.data.source===U.Mutation)&&On.forEach(We=>We.unfreeze()),Pe)t?.(bf(we),nt);else if(Je){let We={type:"rrweb",event:bf(we),origin:window.location.origin,isCheckout:nt};window.parent.postMessage(We,"*")}if(we.type===H.FullSnapshot)gf=we,Aa=0;else if(we.type===H.IncrementalSnapshot){if(we.data.source===U.Mutation&&we.data.isAttachIframe)return;Aa++;let We=r&&Aa>=r,ie=n&&we.timestamp-gf.timestamp>n;(We||ie)&&Js(!0)}};let Li=Q=>{Re({type:H.IncrementalSnapshot,data:{source:U.Mutation,...Q}})},Sf=Q=>Re({type:H.IncrementalSnapshot,data:{source:U.Scroll,...Q}}),wf=Q=>Re({type:H.IncrementalSnapshot,data:{source:U.CanvasMutation,...Q}}),ux=Q=>Re({type:H.IncrementalSnapshot,data:{source:U.AdoptedStyleSheet,...Q}}),hn=new Bd({mutationCb:Li,adoptedStyleSheetCb:ux}),mn=new Ld({mirror:ht,mutationCb:Li,stylesheetManager:hn,recordCrossOriginIframes:$,wrappedEmit:Re});for(let Q of de||[])Q.getMirror&&Q.getMirror({nodeMirror:ht,crossOriginIframeMirror:mn.crossOriginIframeMirror,crossOriginIframeStyleMirror:mn.crossOriginIframeStyleMirror});let Ea=new Fd;Zc=new _d({recordCanvas:N,mutationCb:wf,win:window,blockClass:i,blockSelector:o,mirror:ht,sampling:w.canvas,dataURLOptions:b});let Di=new Dd({mutationCb:Li,scrollCb:Sf,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:pn,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:N,inlineImages:he,sampling:w,slimDOMOptions:St,iframeManager:mn,stylesheetManager:hn,canvasManager:Zc,keepIframeSrcFn:D,processedNodeManager:Ea},mirror:ht});Js=(Q=!1)=>{if(!T)return;Re({type:H.Meta,data:{href:window.location.href,width:A1(),height:k1()}},Q),hn.reset(),Di.init(),On.forEach(Se=>Se.lock());let nt=qN(document,{mirror:ht,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:pn,maskTextFn:m,maskInputFn:f,slimDOM:St,dataURLOptions:b,recordCanvas:N,inlineImages:he,onSerialize:Se=>{I1(Se,ht)&&mn.addIframe(Se),M1(Se,ht)&&hn.trackLinkElement(Se),Md(Se)&&Di.addShadowRoot(j.shadowRoot(Se),document)},onIframeLoad:(Se,we)=>{mn.attachIframe(Se,we),Di.observeAttachShadow(Se)},onStylesheetLoad:(Se,we)=>{hn.attachLinkElement(Se,we)},keepIframeSrcFn:D});if(!nt)return console.warn("Failed to snapshot the document");Re({type:H.FullSnapshot,data:{node:nt,initialOffset:C1(window)}},Q),On.forEach(Se=>Se.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&hn.adoptStyleSheets(document.adoptedStyleSheets,ht.getId(document))};try{let Q=[],nt=we=>{var We;return q(p5)({mutationCb:Li,mousemoveCb:(ie,Pa)=>Re({type:H.IncrementalSnapshot,data:{source:Pa,positions:ie}}),mouseInteractionCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.MouseInteraction,...ie}}),scrollCb:Sf,viewportResizeCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.ViewportResize,...ie}}),inputCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.Input,...ie}}),mediaInteractionCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.MediaInteraction,...ie}}),styleSheetRuleCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.StyleSheetRule,...ie}}),styleDeclarationCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.StyleDeclaration,...ie}}),canvasMutationCb:wf,fontCb:ie=>Re({type:H.IncrementalSnapshot,data:{source:U.Font,...ie}}),selectionCb:ie=>{Re({type:H.IncrementalSnapshot,data:{source:U.Selection,...ie}})},customElementCb:ie=>{Re({type:H.IncrementalSnapshot,data:{source:U.CustomElement,...ie}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:pn,inlineStylesheet:c,sampling:w,recordDOM:T,recordCanvas:N,inlineImages:he,userTriggeredOnInput:O,collectFonts:Y,doc:we,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:D,blockSelector:o,slimDOMOptions:St,dataURLOptions:b,mirror:ht,iframeManager:mn,stylesheetManager:hn,shadowDomManager:Di,processedNodeManager:Ea,canvasManager:Zc,ignoreCSSAttributes:Ne,plugins:((We=de?.filter(ie=>ie.observer))==null?void 0:We.map(ie=>({observer:ie.observer,options:ie.options,callback:Pa=>Re({type:H.Plugin,data:{plugin:ie.name,payload:Pa}})})))||[]},y)};mn.addLoadListener(we=>{try{Q.push(nt(we.contentDocument))}catch(We){console.warn(We)}});let Se=()=>{Js(),Q.push(nt(document)),ha=!0};return["interactive","complete"].includes(document.readyState)?Se():(Q.push(Fe("DOMContentLoaded",()=>{Re({type:H.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&Se()})),Q.push(Fe("load",()=>{Re({type:H.Load,data:{}}),L==="load"&&Se()},window))),()=>{Q.forEach(we=>{try{we()}catch(We){String(We).toLowerCase().includes("cross-origin")||console.warn(We)}}),Ea.destroy(),ha=!1,e5()}}catch(Q){console.warn(Q)}}_n.addCustomEvent=(e,t)=>{if(!ha)throw new Error("please add custom event after start recording");Re({type:H.Custom,data:{tag:e,payload:t}})};_n.freezePage=()=>{On.forEach(e=>e.freeze())};_n.takeFullSnapshot=e=>{if(!ha)throw new Error("please take full snapshot after start recording");Js(e)};_n.mirror=ht;var Hw;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Hw||(Hw={}));var pW=5*1e3;var{addCustomEvent:hW}=_n,{freezePage:mW}=_n,{takeFullSnapshot:yW}=_n;var z1="__ripploEmitRrwebEvent";function G1(){return{eventTypes:U1(H),incrementalSources:U1(U)}}function U1(e){return Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="number").map(([t,n])=>[n,t]))}var R5=Lc("@ripplo/rrweb-bundle/bundle","rrweb.js"),W1;function H1(){return W1??=v5(R5,{encoding:"utf8"}),W1}async function Oi({clientVersion:e,debugDir:t,writeOtlpPortFile:n}){let r=new Map,i=jS(G1()),o=await Dc({localDir:K1.join(K1.dirname(t),".local"),writePortFile:n,onRrwebBatch:(l,u)=>{r.get(l)?.emitRrwebBatch(u)},onSpan:l=>{let u=l.attributes["ripplo.run"];u!=null&&r.get(u)?.emit(l)}}),s=await H1();return{attach:async(l,u)=>{let c=FS({debugDir:t,runId:u,worker:i});c.emit({clientVersion:e,kind:"meta",source:"capture",timeNanos:"0"}),r.set(u,c),await zS(l,u),await l.addInitScript(`globalThis.__ripploCapturePort = ${String(o.port)};`),await k5(l,c),await P5(l,c);let d=[];return{emitAction:p=>{T5(c,p)},emitAssertion:p=>{O5(c,p)},emitFinding:p=>{let h=US(p);h!=null&&c.emit(h)},finish:()=>I5(c,{pages:d,registry:r,runId:u}),onPage:p=>{d.push(p),M5(c,s,p)}}},debugDir:t,close:async()=>{await o.stop(),await i.terminate()},injectSpan:(l,u)=>{r.get(l)?.emit(u)}}}async function C5(e){await Promise.all(e.map(t=>t.evaluate("globalThis.__ripploFlushRrweb ? globalThis.__ripploFlushRrweb() : undefined").catch(()=>{})))}async function k5(e,t){await e.exposeBinding(z1,(n,r)=>{let i=typeof r=="string"?r:JSON.stringify(r);t.emitRrwebBatch(Buffer.from(i,"utf8"))})}var A5="__ripploEventPush",E5=gt.discriminatedUnion("kind",[gt.object({kind:gt.literal("console"),level:gt.string(),text:gt.string(),timestamp:gt.number()}),gt.object({kind:gt.literal("error"),message:gt.string(),stack:gt.string().optional(),timestamp:gt.number()})]);async function P5(e,t){await e.exposeBinding(A5,(n,r)=>{let i=E5.safeParse(r);if(!i.success)return;let o=i.data;if(o.kind==="console"){t.emit({kind:"console",level:o.level,source:"browser",text:o.text,timeNanos:dn(o.timestamp)});return}t.emit({kind:"error",message:o.message,source:"browser",stack:o.stack,timeNanos:dn(o.timestamp)})})}async function I5(e,t){await C5(t.pages),t.registry.delete(t.runId),await e.close({noticeIfNoRrweb:"rrweb capture unavailable: recorder never pushed an event \u2014 page never loaded the recorder (blank page, failed navigation, or CSP block)"})}function M5(e,t,n){n.on("load",()=>{n.addScriptTag({content:t}).catch(()=>{})}),n.on("response",r=>{D5(e,r)}),n.url()!=="about:blank"&&n.addScriptTag({content:t}).catch(()=>{})}function T5(e,t){e.emit({action:t.kind,kind:"action",source:"test",target:N5(t),timeNanos:dn(Date.now()),value:$5(t)})}function O5(e,t){let n=_o(t);e.emit({kind:"assertion",label:n.label,outcome:t.outcome,source:"test",step:n.step,timeNanos:dn(Date.now()),wait:t.waitBudget,waitMs:t.waitMs})}function N5(e){if(e.url!=null)return e.url;if(e.locator!=null)return cf(e.locator)}function cf(e){return e.by==="testId"?`testId=${e.value}`:e.by==="inside"?`${cf(e.scope)} \u25B8 ${cf(e.target)}`:`${e.role} ${e.name??""}`.trim()}function $5(e){return e.value!=null?typeof e.value=="object"?JSON.stringify(e.value):String(e.value):e.key}var L5=/^http:\/\/127\.0\.0\.1:\d+\/rrweb\//;async function D5(e,t){let n=t.request(),r=n.resourceType();if(r!=="fetch"&&r!=="xhr"||L5.test(n.url()))return;let i=n.headers().traceparent?.split("-"),o=n.timing().startTime;e.emit({kind:"network",method:n.method(),requestBody:n.postData()??void 0,resourceType:r,responseBody:await _5(t),source:"browser",spanId:i?.[2],status:t.status(),timeNanos:dn(o>0?o:Date.now()),traceId:i?.[1],url:t.url()})}async function _5(e){try{return await e.text()}catch{return}}function $i(e){return{aborted:!0,findings:[],ran:[],teardown:e}}function ff(e,t){return new df(q5(e,t))}function F5(e,t){return new df(j5(e,t))}async function j5(e,t){let n=await OS(e.profileDir).catch(()=>{});if(n==null)return Rr(Ot(new Error("launch")));try{return Ni(await V5({context:n,params:e,signal:t}))}catch(r){return Rr(Ot(r))}finally{await n.close().catch(ot)}}async function V5({context:e,params:t,signal:n}){let r=e.pages()[0]??await e.newPage(),i=await Oi({clientVersion:t.clientVersion,debugDir:t.debugDir,writeOtlpPortFile:!0}),o=await i.attach(e,t.runId);return o.onPage(r),e.on("page",s=>{o.onPage(s)}),await r.goto(t.startUrl).catch(ot),t.onReady(),await U5(e,n),await o.finish(),await i.close(),{behaviorPath:B5.join(t.debugDir,t.runId,"behavior.jsonl")}}function U5(e,t){return new Promise(n=>{let r=()=>{n()};t.addEventListener("abort",r,{once:!0}),e.on("close",r),e.browser()?.on("disconnected",r),e.on("page",i=>i.on("close",r)),e.pages().forEach(i=>i.on("close",r))})}function W5(e,t){return new df(z5(e,t))}async function z5(e,t){let n=G5(e),r=Z1({lockfile:e.lockfile,options:e.options,runId:e.runId,signal:t}),i=async o=>{try{return Ni(await H5({established:o,params:e,signal:t}))}catch(s){return await o.teardown().match(ot,ot),Rr(Ot(s))}};return Y1(r,n).match(i,async o=>(await pf(r.teardown),Rr(o)))}function G5(e){return{capture:!1,lockfile:e.lockfile,onEvent:void 0,onPhase:void 0,options:e.options,params:void 0,runId:e.runId,sequence:e.sequence,test:e.test}}async function H5({established:e,params:t,signal:n}){let r=xs({cacheDir:void 0,headed:!0}),i=await r.acquire(),o=await ws({baseUrl:t.options.baseUrl,browser:i,capture:null,clientState:e.clientState,engine:gs(J1(t.lockfile)),extraHeaders:hf(t.options.tunnelAuth),fixturesDir:t.options.fixturesDir,reader:e.reader,session:e.auth,signal:n,viewport:null}),s=Yr(t.lockfile),a=await Kr({canon:Or(t.lockfile),classify:Tr(t.lockfile),dataRules:s.dataRules,driver:o.driver,initialState:{snapshot:e.snapshot},onAssertion:o.emitAssertion,onEvent:ot,pageRules:So(s.pageRules,Qe(t.test)),sequence:t.sequence,stopAfterStep:t.stopAfterStep},n);return t.onReady(),await K5(i,o.context),await e.teardown().match(ot,ot),await r.close(),{kind:"handed-over",ran:a.ran.length}}function K5(e,t){return new Promise(n=>{let r=()=>{n()};e.on("disconnected",r),t.on("close",r),t.on("page",i=>i.on("close",r)),t.pages().forEach(i=>i.on("close",r))})}async function q5({browser:e,hub:t,request:n},r){if(r.aborted)return Ni($i("skipped"));let i=Z1({lockfile:n.lockfile,options:n.options,runId:n.runId,signal:r}),o=async s=>{try{return Ni(await Z5({browser:e,established:s,hub:t,request:n,signal:r}))}catch(a){return Rr(Ot(a))}};return Y1(i,n).match(o,s=>Y5(s,i.teardown))}async function Y5(e,t){return e.kind!=="aborted"?Rr(e):Ni($i(await pf(t)))}function pf(e){return e().match(()=>"done",()=>"failed")}async function Z5(e){let t=await J5(e);if(t.kind==="completed"){let r=Date.now();return await e.established.teardown().match(ot,xl),e.request.onPhase?.("teardown",Date.now()-r),{aborted:!1,...t.result}}let n=await pf(e.established.teardown);if(t.kind==="aborted")return $i(n);throw t.error}function q1(e,t,n){return Vr(e,t).map(r=>({params:{...ds(r),...n},transition:r}))}async function J5({browser:e,established:t,hub:n,request:r,signal:i}){try{Xe(i);let o=Date.now(),{close:s,driver:a,emitAssertion:l,emitFinding:u}=await ws({baseUrl:r.options.baseUrl,browser:e,capture:r.capture?{hub:n,runId:r.runId}:null,clientState:t.clientState,engine:gs(J1(r.lockfile)),extraHeaders:hf(r.options.tunnelAuth),fixturesDir:r.options.fixturesDir,reader:t.reader,session:t.auth,signal:i,viewport:TS});r.onPhase?.("browser",Date.now()-o);try{r.onEvent?.({aliases:t.aliases,generated:t.generated,generatedSingletons:t.generatedSingletons,kind:"world"});let c=Yr(r.lockfile),d=Date.now(),p=await Kr({canon:Or(r.lockfile),classify:Tr(r.lockfile),dataRules:c.dataRules,driver:a,initialState:{snapshot:t.snapshot},onAssertion:l,pageRules:So(c.pageRules,Qe(r.test)),sequence:r.sequence??q1(r.lockfile,r.test,r.params),stopAfterStep:void 0,onEvent:h=>{h.kind==="finding"&&u(h.finding),r.onEvent?.(h)}},i);return r.onPhase?.("drive",Date.now()-d),{kind:"completed",result:p}}finally{await s()}}catch(o){return $r(o)?{kind:"aborted"}:{error:o,kind:"threw"}}}function Y1(e,t){let n=Date.now();return e.ready().andThen(()=>{t.onPhase?.("engine",Date.now()-n);let r=Date.now();return zn(t.lockfile,t.test,{generate:Mo(Io(t.options.generate,t.runId),new Date().toISOString()),materialize:e.materialize,params:t.params}).map(i=>(t.onPhase?.("world",Date.now()-r),{aliases:i.aliases,auth:i.auth,clientState:i.clientState,generated:i.generated,generatedSingletons:i.generatedSingletons,reader:e.reader,snapshot:i.snapshot,teardown:e.teardown}))})}function Z1({lockfile:e,options:t,runId:n,signal:r}){let i=$c({baseUrl:t.engineUrl,extraHeaders:hf(t.tunnelAuth),runId:n,secret:t.secret},r);return{materialize:uo(i.setupWorld),reader:Oc(e.entities,X5(e),i.query),ready:i.ready,teardown:i.teardown}}function hf(e){if(e!=null)return{"CF-Access-Client-Id":e.clientId,"CF-Access-Client-Secret":e.clientSecret}}function X5(e){return e.singletons.filter(t=>t.source==="backend").map(t=>t.name)}function J1(e){return e.singletons.filter(t=>t.source==="client").map(t=>t.name)}import{err as Q5,ok as eL,ResultAsync as tL}from"neverthrow";function nL({cacheDir:e,clientVersion:t,debugDir:n,headed:r,writeOtlpPortFile:i}){let o=xs({cacheDir:e,headed:r}),s,a,l=async()=>(s??=Oi({clientVersion:t,debugDir:n,writeOtlpPortFile:i}),a=await s,a),u=async(p,h)=>{if(h.aborted)return eL($i("skipped"));try{let f=await l();if(p.options.headed&&!r)return await Mc(!0,async y=>ff({browser:y,hub:f,request:p},h));let m=await o.acquire();return await ff({browser:m,hub:f,request:p},h)}catch(f){return Q5(Ot(f))}};return{close:async()=>{await o.close();let p=s;s=void 0,a=void 0,p!=null&&await p.then(h=>h.close()).catch(()=>{})},prewarm:async()=>{await l(),await o.acquire()},injectSpan:(p,h)=>{a?.injectSpan(p,h)},runOnce:(p,h)=>new tL(u(p,h))}}import{z as W}from"zod";function rL(e){let t=e.split(`
115
+ `).map(i=>SL(i)).filter(i=>i!=null),n=pL(t),r=t.map(i=>aL(i,n)).filter(i=>i!=null).filter(i=>i.kind==="input"||i.element!=null);return iL(r)}function iL(e){return e.filter((t,n)=>{let r=e[n+1];return!(t.kind==="input"&&r?.kind==="input"&&oL(t.element,r.element))})}function oL(e,t){return e?.testId===t?.testId&&e?.ariaLabel===t?.ariaLabel&&e?.placeholder===t?.placeholder}var sL={2:"click",3:"contextmenu",4:"dblclick"};function aL(e,t){return e.rrwebType==="IncrementalSnapshot:MouseInteraction"?lL(e,t):e.rrwebType==="IncrementalSnapshot:Input"?uL(e,t):null}function lL(e,t){let n=kL.safeParse(e.event.data);if(!n.success)return null;let r=sL[n.data.type];if(r==null)return null;let i=X1(n.data.id,t.nodes);return{element:Q1(i,t),kind:r,timeNanos:e.timeNanos,value:void 0}}function uL(e,t){let n=AL.safeParse(e.event.data);return n.success?{element:Q1(n.data.id,t),kind:"input",timeNanos:e.timeNanos,value:n.data.text??cL(n.data.isChecked)}:null}function cL(e){return e==null?void 0:String(e)}var dL=new Set(["button","a","input","select","textarea","summary"]);function X1(e,t){let n=t.get(e);if(n!=null)return fL(n)?e:n.parentId==null?void 0:X1(n.parentId,t)}function fL(e){return e.attrs["data-testid"]!=null||e.attrs["aria-label"]!=null||e.attrs.role!=null||dL.has(e.tag??"")}function Q1(e,t){let n=e==null?void 0:t.nodes.get(e);if(!(n==null||e==null))return{ariaLabel:Cr(n,"aria-label"),href:Cr(n,"href"),name:Cr(n,"name"),placeholder:Cr(n,"placeholder"),role:Cr(n,"role"),tag:n.tag,testId:Cr(n,"data-testid"),text:ex(e,t)}}function Cr(e,t){let n=e.attrs[t];return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):void 0}function ex(e,t){let n=t.nodes.get(e);if(n==null)return;let r=n.text?.trim()??"",o=(t.children.get(e)??[]).map(a=>ex(a,t)??""),s=[r,...o].filter(a=>a.length>0).join(" ");return s.length===0?void 0:s.slice(0,100)}function pL(e){let t=e.flatMap(i=>hL(i).flatMap(o=>mf(o,void 0))),n=e.flatMap(i=>mL(i).flatMap(o=>mf(o.node,o.parentId??void 0))),r=gL(new Map([...t,...n]),e);return{children:yL(r),nodes:r}}function hL(e){if(e.rrwebType!=="FullSnapshot")return[];let t=vL.safeParse(e.event.data);return t.success?[t.data.node]:[]}function mL(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=tx.safeParse(e.event.data);return t.success?t.data.adds.flatMap(n=>{let r=RL.safeParse(n);return r.success?[r.data]:[]}):[]}function yL(e){let t=new Map;return e.forEach((n,r)=>{n.parentId!=null&&t.set(n.parentId,[...t.get(n.parentId)??[],r])}),t}function mf(e,t){let n=xL.safeParse(e);if(!n.success)return[];let r=n.data,i=r.childNodes??[];return[[r.id,{attrs:{...r.attributes},parentId:t,tag:r.tagName,text:r.textContent}],...i.flatMap(s=>mf(s,r.id))]}function gL(e,t){return t.flatMap(r=>bL(r)).reduce((r,i)=>{let o=r.get(i.id);return o==null?r:new Map(r).set(i.id,{...o,attrs:{...o.attrs,...i.attributes}})},e)}function bL(e){if(e.rrwebType!=="IncrementalSnapshot:Mutation")return[];let t=tx.safeParse(e.event.data);return t.success?t.data.attributes.flatMap(n=>{let r=CL.safeParse(n);return r.success?[r.data]:[]}):[]}function SL(e){if(e.trim().length===0)return null;let t=EL.safeParse(wL(e));return t.success?t.data:null}function wL(e){try{return JSON.parse(e)}catch{return null}}var xL=W.object({attributes:W.record(W.string(),W.unknown()).optional(),childNodes:W.array(W.unknown()).optional(),id:W.number(),tagName:W.string().optional(),textContent:W.string().optional()}),vL=W.object({node:W.unknown()}),RL=W.object({node:W.unknown(),parentId:W.number().nullable().default(null)}),CL=W.object({attributes:W.record(W.string(),W.unknown()),id:W.number()}),tx=W.object({adds:W.array(W.unknown()).default([]),attributes:W.array(W.unknown()).default([])}),kL=W.object({id:W.number(),type:W.number()}),AL=W.object({id:W.number(),isChecked:W.boolean().optional(),text:W.string().optional()}),EL=W.object({event:W.object({data:W.unknown()}),kind:W.literal("rrweb"),rrwebType:W.string(),timeNanos:W.string()});function PL(e){let t=n=>e.find(r=>r.phase===n)?.ms??0;return{browserMs:t("browser"),driveMs:t("drive"),engineMs:t("engine"),teardownMs:t("teardown"),worldMs:t("world")}}async function IL(e,t){let n=await sx({attemptIndex:0,capture:!1,params:e,stepRuns:e.stepRuns},t);if(n.kind!=="completed")return rx(n);let r=ix(n.findings);if(r!=null)return{error:r,kind:"error"};if(n.findings.length===0)return{kind:"clean",timing:{confirm:void 0,detect:n.timing}};let i=yf(e.baseState.name,n.findings);return e.seenSignature!=null&&await e.seenSignature(i.signature)?{baseState:e.baseState.name,captureEvents:[],kind:"finding",runId:n.runId,signature:i.signature,timing:{confirm:void 0,detect:n.timing},verifierLayer:i.layer}:ML(e,i,n.timing,t)}function rx(e){return e.kind==="error"?{error:e.error,kind:"error"}:{kind:e.kind}}function ix(e){let t=e.find(n=>n.kind==="driver-error"&&Xi(n.error));return t!=null&&t.kind==="driver-error"?t.error:void 0}async function ML(e,t,n,r){let i=await sx({attemptIndex:1,capture:!0,params:e,stepRuns:e.stepRuns},r);if(i.kind!=="completed")return rx(i);let o=ix(i.findings);if(o!=null)return{error:o,kind:"error"};let s={confirm:i.timing,detect:n};return yf(e.baseState.name,i.findings).signature!==t.signature?{kind:"flaky",timing:s}:{baseState:e.baseState.name,captureEvents:i.events,kind:"finding",runId:i.runId,signature:t.signature,timing:s,verifierLayer:t.layer}}function ox(e){return e.kind==="driver-error"||e.kind==="unrunnable"?"crash":e.kind==="pending-check"?e.source.kind==="data-rule"?"data-rule":e.source.kind==="page-rule"?"page-rule":"frame":"frame"}async function sx({attemptIndex:e,capture:t,params:n,stepRuns:r},i){let o=n.runIdFor(e),s=[],a=[];return(await n.session.runOnce({capture:t,lockfile:n.lockfile,onEvent:t?u=>{s.push(u)}:void 0,options:n.options,params:void 0,runId:o,sequence:TL(n,r),test:n.baseState.test,onPhase:(u,c)=>{a.push({ms:c,phase:u})}},i)).match(u=>u.aborted?{kind:"aborted"}:{events:s,findings:u.findings,kind:"completed",runId:o,timing:PL(a)},u=>({error:u,kind:"error"}))}function TL(e,t){return t.map(n=>{let r=e.corpus[n.idx];if(r==null)throw new Error("transition index out of corpus range");return{params:n.params,transition:r}})}function yf(e,t){let r=t.map(i=>({line:ql(i),part:NL(i)})).toSorted((i,o)=>F(i.part).localeCompare(F(o.part))).map(i=>i.part);return{layer:OL(r),signature:F({baseState:e,parts:r.map(i=>F(i))})}}var nx={crash:0,"data-rule":1,frame:3,"page-rule":2};function OL(e){return e.map(n=>n.layer).toSorted((n,r)=>nx[n]-nx[r]).at(0)??"frame"}function NL(e){let t=ox(e);switch(e.kind){case"consistency":return{kind:"consistency",layer:t,mismatch:$L(e.mismatch),step:e.step==null?null:{intent:e.step.intent,test:e.step.test}};case"pending-check":return{kind:"pending-check",layer:t,source:e.source.kind,step:{intent:e.step.intent,test:e.step.test}};case"unrunnable":return{intent:e.intent,kind:"unrunnable",layer:t,reason:e.reason,test:e.test};case"driver-error":return{error:e.error.kind,kind:"driver-error",layer:t,step:e.step.intent};case"impossible-action":return{kind:"impossible-action",layer:t,step:e.step.intent}}}function $L(e){return e.kind==="singleton-mismatch"?{kind:e.kind,singleton:e.singleton}:e.kind==="browser-mismatch"?{browser:Ve(e.key),kind:e.kind}:{entity:e.entity,kind:e.kind}}async function ax(e,t){let n=await ys(e);if(n==null)return{kind:"unplannable"};let r=[...n.startingPointTests.values()].find(o=>Qe(o)===t.baseStateRef);if(r==null)return{kind:"unplannable"};let i=t.steps.map(o=>{let s=n.corpus.find(a=>a.test===o.test&&a.index===o.index);return s==null?null:{params:o.params,transition:s}});return i.some(o=>o==null)?{kind:"unplannable"}:{baseTest:r,kind:"ok",sequence:i.filter(o=>o!=null)}}async function LL({capture:e,lockfile:t,options:n,repro:r,runId:i,session:o,signal:s}){let a=await ax(t,r);return a.kind==="unplannable"?{kind:"unplannable"}:(await o.runOnce({capture:e,lockfile:t,onEvent:void 0,onPhase:void 0,options:n,params:void 0,runId:i,sequence:a.sequence,test:a.baseTest},s)).match(u=>u.aborted?{kind:"aborted"}:u.findings.length>0?{findings:u.findings,kind:"still-fails"}:{kind:"resolved"},u=>({kind:"state-unavailable",reason:u.kind}))}function hz(e){switch(e.kind){case"empty-response":return"ripplo daemon: cloud tunnel provisioning returned no result. Check server logs and retry.";case"server-error":return`ripplo daemon: cloud tunnel provisioning failed (${e.typename}). Run \`npx ripplo doctor\` to check your setup.`}}function mz(e){switch(e.kind){case"already-running":return`ripplo daemon: daemon already running (socket ${e.socketPath}).`;case"bind-failed":return`ripplo daemon: failed to bind IPC socket: ${e.message}`}}function yz({projectId:e,serverUrl:t}){return[`Project "${e}" (from .ripplo/project.json) was not found on ${t}, or this account does not have access to it.`,"Run `npx ripplo projects list` to see your projects, then update .ripplo/project.json (or re-run `npx ripplo init --project <id>`)."].join(`
116
+ `)}function gz(){return"Not signed in. Run `npx ripplo auth login`, then start the daemon again."}function bz({devSessionId:e,executor:t,tunnelHostname:n,version:r}){let i=t==="cloud"?`cloud executor via ${n??"?"}`:"local executor";return`ripplo daemon: v${r} ready as ${i} for session ${e} (syncs on every \`npx ripplo run\` \u2014 Ctrl-C to stop)`}function Sz({cwd:e,pid:t}){return`ripplo daemon: another daemon is already running for this project${t==null?"":` (pid ${String(t)})`} (cwd ${e}).`}function wz(){return"ripplo daemon: lock compromised \u2014 another daemon likely took over this project. Shutting down."}function xz(e){if(e.kind==="not-running")return"daemon: not running";if(e.kind==="unresponsive")return`daemon: running but no reply within ${String(e.timeoutMs/1e3)}s \u2014 likely busy executing runs, retry when the batch drains`;let{status:t}=e,n=t.version==null?"version unknown (pre-0.7.8)":`v${t.version}`,r=`${String(t.active)} active, ${String(t.queued)} queued`,i=`explorer: ${t.explorer}, ${String(t.exploring)} exploring`,o=`daemon: running (${n} | ${r} | ${i} | ${DL(t.progress)})`;if(t.sseHealth!=null&&!t.sseHealth.ok){let s=t.sseHealth.detail==null?"":`: ${t.sseHealth.detail}`;return`${o}
117
+ daemon: cannot subscribe to run dispatch${s} \u2014 server-side, restarting the daemon will not help`}return o}function DL(e){return e.attempts===0?"explore: idle":`explore: ${String(e.attempts)} attempts, ${String(e.findings)} findings`}function vz(e){let t=e.daemonVersion==null?"an older version":`v${e.daemonVersion}`;return e.kind==="restarted"?`ripplo: daemon was ${t} \u2014 restarted on the current version`:`ripplo: daemon ${t} is older than this CLI but has runs in flight \u2014 restart it when idle to update`}function Rz(e){switch(e.kind){case"pass":return{kind:"pass"};case"findings":return{findingLines:_L(e.findings).map(t=>Bo({evidencePath:`.ripplo/debug/${e.runId}/behavior.jsonl`,finding:t})),kind:"findings"};case"error":return{detail:xt(e.error),kind:"error"};case"dispatch-failed":return{kind:"dispatch-error",reason:{detail:e.reason,type:"generic"}}}}function _L(e){let t=new Set(e.flatMap(n=>BL(n)?[lx(n)]:[]));return e.filter(n=>!(FL(n)&&t.has(lx(n))))}function BL(e){return e.kind==="pending-check"&&e.source.kind==="step"}function lx(e){return e.kind!=="pending-check"||e.source.kind==="data-rule"?"":`${_t(e.source.check)}|${Bt(e.step)}`}function FL(e){return e.kind==="pending-check"&&e.source.kind==="page-rule"}export{Ba as a,Ef as b,Ax as c,Ex as d,Dx as e,_x as f,$f as g,Fx as h,rl as i,Qx as j,qf as k,Yf as l,Xi as m,ap as n,xt as o,Ve as p,Qe as q,Rt as r,kn as s,bh as t,vh as u,bo as v,qr as w,ke as x,Bo as y,Dh as z,_h as A,Bh as B,No as C,Fh as D,jh as E,Yr as F,lS as G,pS as H,hS as I,yS as J,ys as K,gS as L,Dc as M,F5 as N,W5 as O,q1 as P,nL as Q,rL as R,IL as S,ax as T,LL as U,hz as V,mz as W,yz as X,gz as Y,bz as Z,Sz as _,wz as $,xz as aa,DL as ba,vz as ca,Rz as da};
118
+ /*! Bundled license information:
119
+
120
+ rrweb/dist/rrweb.js:
121
+ (*! *****************************************************************************
122
+ Copyright (c) Microsoft Corporation.
123
+
124
+ Permission to use, copy, modify, and/or distribute this software for any
125
+ purpose with or without fee is hereby granted.
126
+
127
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
128
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
129
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
130
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
131
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
132
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
133
+ PERFORMANCE OF THIS SOFTWARE.
134
+ ***************************************************************************** *)
135
+ */