@cevek/screentest 0.3.3 → 0.3.4

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.
@@ -69,4 +69,4 @@ Error generating stack: `+e.message+`
69
69
 
70
70
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=pi,s=!ei.jitless,c=s&&mi.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xo([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Oi(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Mi(e,r,ti())))}),t)}var To=F(`$ZodUnion`,(e,t)=>{Va.init(e,t),I(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),I(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),I(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>oi(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>wo(t,r,e,i)):wo(o,r,e,i)}}),Eo=F(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,To.init(e,t);let n=e._zod.parse;I(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ii(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!pi(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Do=F(`$ZodIntersection`,(e,t)=>{Va.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ko(e,t,n)):ko(e,i,a)}});function Oo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(hi(e)&&hi(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Oo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Oo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ko(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Oi(e))return e;let o=Oo(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Ao=F(`$ZodEnum`,(e,t)=>{Va.init(e,t);let n=ni(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>_i.has(typeof e)).map(e=>typeof e==`string`?vi(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jo=F(`$ZodLiteral`,(e,t)=>{if(Va.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?vi(e):e?vi(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Mo=F(`$ZodTransform`,(e,t)=>{Va.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $r(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Qr;return n.value=i,n.fallback=!0,n}});function No(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Po=F(`$ZodOptional`,(e,t)=>{Va.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,I(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),I(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oi(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>No(e,r)):No(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Fo=F(`$ZodExactOptional`,(e,t)=>{Po.init(e,t),I(e._zod,`values`,()=>t.innerType._zod.values),I(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Io=F(`$ZodNullable`,(e,t)=>{Va.init(e,t),I(e._zod,`optin`,()=>t.innerType._zod.optin),I(e._zod,`optout`,()=>t.innerType._zod.optout),I(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oi(e.source)}|null)$`):void 0}),I(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Lo=F(`$ZodDefault`,(e,t)=>{Va.init(e,t),e._zod.optin=`optional`,I(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ro(e,t)):Ro(r,t)}});function Ro(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var zo=F(`$ZodPrefault`,(e,t)=>{Va.init(e,t),e._zod.optin=`optional`,I(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Bo=F(`$ZodNonOptional`,(e,t)=>{Va.init(e,t),I(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Vo(t,e)):Vo(i,e)}});function Vo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Ho=F(`$ZodCatch`,(e,t)=>{Va.init(e,t),e._zod.optin=`optional`,I(e._zod,`optout`,()=>t.innerType._zod.optout),I(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mi(e,n,ti()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mi(e,n,ti()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Uo=F(`$ZodPipe`,(e,t)=>{Va.init(e,t),I(e._zod,`values`,()=>t.in._zod.values),I(e._zod,`optin`,()=>t.in._zod.optin),I(e._zod,`optout`,()=>t.out._zod.optout),I(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Wo(e,t.in,n)):Wo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Wo(e,t.out,n)):Wo(r,t.out,n)}});function Wo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Go=F(`$ZodReadonly`,(e,t)=>{Va.init(e,t),I(e._zod,`propValues`,()=>t.innerType._zod.propValues),I(e._zod,`values`,()=>t.innerType._zod.values),I(e._zod,`optin`,()=>t.innerType?._zod?.optin),I(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ko):Ko(r)}});function Ko(e){return e.value=Object.freeze(e.value),e}var qo=F(`$ZodLazy`,(e,t)=>{Va.init(e,t),I(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),I(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),I(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),I(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),I(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Jo=F(`$ZodCustom`,(e,t)=>{Da.init(e,t),Va.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Yo(t,n,r,e));Yo(i,n,r,e)}});function Yo(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pi(e))}}var Xo,Zo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Qo(){return new Zo}(Xo=globalThis).__zod_globalRegistry??(Xo.__zod_globalRegistry=Qo());var $o=globalThis.__zod_globalRegistry;function es(e,t){return new e({type:`string`,...L(t)})}function ts(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L(t)})}function ns(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L(t)})}function rs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L(t)})}function is(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L(t)})}function as(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L(t)})}function os(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L(t)})}function ss(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L(t)})}function cs(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L(t)})}function ls(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L(t)})}function us(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L(t)})}function ds(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L(t)})}function fs(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L(t)})}function ps(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L(t)})}function ms(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L(t)})}function hs(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L(t)})}function gs(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L(t)})}function _s(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L(t)})}function vs(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L(t)})}function ys(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L(t)})}function bs(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L(t)})}function xs(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L(t)})}function Ss(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L(t)})}function Cs(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L(t)})}function ws(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L(t)})}function Ts(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L(t)})}function Es(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L(t)})}function Ds(e,t){return new e({type:`null`,...L(t)})}function Os(e){return new e({type:`unknown`})}function ks(e,t){return new e({type:`never`,...L(t)})}function As(e,t){return new Oa({check:`max_length`,...L(t),maximum:e})}function js(e,t){return new ka({check:`min_length`,...L(t),minimum:e})}function Ms(e,t){return new Aa({check:`length_equals`,...L(t),length:e})}function Ns(e,t){return new Ma({check:`string_format`,format:`regex`,...L(t),pattern:e})}function Ps(e){return new Na({check:`string_format`,format:`lowercase`,...L(e)})}function Fs(e){return new Pa({check:`string_format`,format:`uppercase`,...L(e)})}function Is(e,t){return new Fa({check:`string_format`,format:`includes`,...L(t),includes:e})}function Ls(e,t){return new Ia({check:`string_format`,format:`starts_with`,...L(t),prefix:e})}function Rs(e,t){return new La({check:`string_format`,format:`ends_with`,...L(t),suffix:e})}function zs(e){return new Ra({check:`overwrite`,tx:e})}function Bs(e){return zs(t=>t.normalize(e))}function Vs(){return zs(e=>e.trim())}function Hs(){return zs(e=>e.toLowerCase())}function Us(){return zs(e=>e.toUpperCase())}function Ws(){return zs(e=>di(e))}function Gs(e,t,n){return new e({type:`array`,element:t,...L(n)})}function Ks(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L(n)})}function qs(e,t){let n=Js(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pi(r))}},e(t.value,t)),t);return n}function Js(e,t){let n=new Da({check:`custom`,...L(t)});return n._zod.check=e,n}function Ys(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??$o,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Xs(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Xs(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&$s(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Zs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
71
71
 
72
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Qs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:tc(t,`input`,e.processors),output:tc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $s(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return $s(r.element,n);if(r.type===`set`)return $s(r.valueType,n);if(r.type===`lazy`)return $s(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return $s(r.innerType,n);if(r.type===`intersection`)return $s(r.left,n)||$s(r.right,n);if(r.type===`record`||r.type===`map`)return $s(r.keyType,n)||$s(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$s(r.in,n)||$s(r.out,n);if(r.type===`object`){for(let e in r.shape)if($s(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($s(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($s(e,n))return!0;return!!(r.rest&&$s(r.rest,n))}return!1}var ec=(e,t={})=>n=>{let r=Ys({...n,processors:t});return Xs(e,r),Zs(r,e),Qs(r,e)},tc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ys({...i??{},target:a,io:t,processors:n});return Xs(e,o),Zs(o,e),Qs(o,e)},nc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},rc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=nc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ic=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ac=(e,t,n,r)=>{n.not={}},oc=(e,t,n,r)=>{let i=e._zod.def,a=ni(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},sc=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},cc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},lc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},uc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Xs(a.element,t,{...r,path:[...r.path,`items`]})},dc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Xs(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Xs(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},fc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Xs(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},pc=(e,t,n,r)=>{let i=e._zod.def,a=Xs(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Xs(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},mc=(e,t,n,r)=>{let i=e._zod.def,a=Xs(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},hc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_c=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},vc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},yc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Xs(o,t,r);let s=t.seen.get(e);s.ref=o},bc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sc=(e,t,n,r)=>{let i=e._zod.innerType;Xs(i,t,r);let a=t.seen.get(e);a.ref=i},Cc=F(`ZodISODateTime`,(e,t)=>{eo.init(e,t),W.init(e,t)});function wc(e){return Cs(Cc,e)}var Tc=F(`ZodISODate`,(e,t)=>{to.init(e,t),W.init(e,t)});function Ec(e){return ws(Tc,e)}var Dc=F(`ZodISOTime`,(e,t)=>{no.init(e,t),W.init(e,t)});function Oc(e){return Ts(Dc,e)}var kc=F(`ZodISODuration`,(e,t)=>{ro.init(e,t),W.init(e,t)});function Ac(e){return Es(kc,e)}var jc=F(`ZodError`,(e,t)=>{z.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Li(e,t)},flatten:{value:t=>Ii(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ri,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ri,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Mc=Ri(jc),Nc=zi(jc),Pc=Bi(jc),Fc=Hi(jc),Ic=Wi(jc),Lc=Gi(jc),Rc=Ki(jc),U=qi(jc),zc=Ji(jc),Bc=Yi(jc),Vc=Xi(jc),Hc=Zi(jc),Uc=new WeakMap;function Wc(e,t,n){let r=Object.getPrototypeOf(e),i=Uc.get(r);if(i||(i=new Set,Uc.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Gc=F(`ZodType`,(e,t)=>(Va.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:tc(e,`input`),output:tc(e,`output`)}}),e.toJSONSchema=ec(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Mc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pc(e,t,n),e.parseAsync=async(t,n)=>Nc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Fc(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ic(e,t,n),e.decode=(t,n)=>Lc(e,t,n),e.encodeAsync=async(t,n)=>Rc(e,t,n),e.decodeAsync=async(t,n)=>U(e,t,n),e.safeEncode=(t,n)=>zc(e,t,n),e.safeDecode=(t,n)=>Bc(e,t,n),e.safeEncodeAsync=async(t,n)=>Vc(e,t,n),e.safeDecodeAsync=async(t,n)=>Hc(e,t,n),Wc(e,`ZodType`,{check(...e){let t=this.def;return this.clone(li(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return yi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ql(e,t))},superRefine(e,t){return this.check($l(e,t))},overwrite(e){return this.check(zs(e))},optional(){return Ll(this)},exactOptional(){return zl(this)},nullable(){return K(this)},nullish(){return Ll(K(this))},nonoptional(e){return Hl(this,e)},array(){return xl(this)},or(e){return Tl([this,e])},and(e){return kl(this,e)},transform(e){return Kl(this,Fl(e))},default(e){return J(this,e)},prefault(e){return Bl(this,e)},catch(e){return Wl(this,e)},pipe(e){return Kl(this,e)},readonly(){return Jl(this)},describe(e){let t=this.clone();return $o.add(t,{description:e}),t},meta(...e){if(e.length===0)return $o.get(this);let t=this.clone();return $o.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return $o.get(e)?.description},configurable:!0}),e)),Kc=F(`_ZodString`,(e,t)=>{Ha.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Wc(e,`_ZodString`,{regex(...e){return this.check(Ns(...e))},includes(...e){return this.check(Is(...e))},startsWith(...e){return this.check(Ls(...e))},endsWith(...e){return this.check(Rs(...e))},min(...e){return this.check(js(...e))},max(...e){return this.check(As(...e))},length(...e){return this.check(Ms(...e))},nonempty(...e){return this.check(js(1,...e))},lowercase(e){return this.check(Ps(e))},uppercase(e){return this.check(Fs(e))},trim(){return this.check(Vs())},normalize(...e){return this.check(Bs(...e))},toLowerCase(){return this.check(Hs())},toUpperCase(){return this.check(Us())},slugify(){return this.check(Ws())}})}),qc=F(`ZodString`,(e,t)=>{Ha.init(e,t),Kc.init(e,t),e.email=t=>e.check(ts(Yc,t)),e.url=t=>e.check(ss(Qc,t)),e.jwt=t=>e.check(Ss(pl,t)),e.emoji=t=>e.check(cs($c,t)),e.guid=t=>e.check(ns(Xc,t)),e.uuid=t=>e.check(rs(Zc,t)),e.uuidv4=t=>e.check(is(Zc,t)),e.uuidv6=t=>e.check(as(Zc,t)),e.uuidv7=t=>e.check(os(Zc,t)),e.nanoid=t=>e.check(ls(el,t)),e.guid=t=>e.check(ns(Xc,t)),e.cuid=t=>e.check(us(tl,t)),e.cuid2=t=>e.check(ds(nl,t)),e.ulid=t=>e.check(fs(rl,t)),e.base64=t=>e.check(ys(ul,t)),e.base64url=t=>e.check(bs(dl,t)),e.xid=t=>e.check(ps(il,t)),e.ksuid=t=>e.check(ms(al,t)),e.ipv4=t=>e.check(hs(ol,t)),e.ipv6=t=>e.check(gs(sl,t)),e.cidrv4=t=>e.check(_s(cl,t)),e.cidrv6=t=>e.check(vs(ll,t)),e.e164=t=>e.check(xs(fl,t)),e.datetime=t=>e.check(wc(t)),e.date=t=>e.check(Ec(t)),e.time=t=>e.check(Oc(t)),e.duration=t=>e.check(Ac(t))});function Jc(e){return es(qc,e)}var W=F(`ZodStringFormat`,(e,t)=>{B.init(e,t),Kc.init(e,t)}),Yc=F(`ZodEmail`,(e,t)=>{Ga.init(e,t),W.init(e,t)}),Xc=F(`ZodGUID`,(e,t)=>{Ua.init(e,t),W.init(e,t)}),Zc=F(`ZodUUID`,(e,t)=>{Wa.init(e,t),W.init(e,t)}),Qc=F(`ZodURL`,(e,t)=>{Ka.init(e,t),W.init(e,t)}),$c=F(`ZodEmoji`,(e,t)=>{qa.init(e,t),W.init(e,t)}),el=F(`ZodNanoID`,(e,t)=>{Ja.init(e,t),W.init(e,t)}),tl=F(`ZodCUID`,(e,t)=>{Ya.init(e,t),W.init(e,t)}),nl=F(`ZodCUID2`,(e,t)=>{Xa.init(e,t),W.init(e,t)}),rl=F(`ZodULID`,(e,t)=>{Za.init(e,t),W.init(e,t)}),il=F(`ZodXID`,(e,t)=>{Qa.init(e,t),W.init(e,t)}),al=F(`ZodKSUID`,(e,t)=>{$a.init(e,t),W.init(e,t)}),ol=F(`ZodIPv4`,(e,t)=>{io.init(e,t),W.init(e,t)}),sl=F(`ZodIPv6`,(e,t)=>{ao.init(e,t),W.init(e,t)}),cl=F(`ZodCIDRv4`,(e,t)=>{oo.init(e,t),W.init(e,t)}),ll=F(`ZodCIDRv6`,(e,t)=>{so.init(e,t),W.init(e,t)}),ul=F(`ZodBase64`,(e,t)=>{lo.init(e,t),W.init(e,t)}),dl=F(`ZodBase64URL`,(e,t)=>{fo.init(e,t),W.init(e,t)}),fl=F(`ZodE164`,(e,t)=>{V.init(e,t),W.init(e,t)}),pl=F(`ZodJWT`,(e,t)=>{po.init(e,t),W.init(e,t)}),ml=F(`ZodNull`,(e,t)=>{mo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r)});function hl(e){return Ds(ml,e)}var gl=F(`ZodUnknown`,(e,t)=>{ho.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function _l(){return Os(gl)}var vl=F(`ZodNever`,(e,t)=>{go.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r)});function yl(e){return ks(vl,e)}var bl=F(`ZodArray`,(e,t)=>{vo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r),e.element=t.element,Wc(e,`ZodArray`,{min(e,t){return this.check(js(e,t))},nonempty(e){return this.check(js(1,e))},max(e,t){return this.check(As(e,t))},length(e,t){return this.check(Ms(e,t))},unwrap(){return this.element}})});function xl(e,t){return Gs(bl,e,t)}var Sl=F(`ZodObject`,(e,t)=>{Co.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dc(e,t,n,r),I(e,`shape`,()=>t.shape),Wc(e,`ZodObject`,{keyof(){return jl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:_l()})},loose(){return this.clone({...this._zod.def,catchall:_l()})},strict(){return this.clone({...this._zod.def,catchall:yl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Ci(this,e)},safeExtend(e){return wi(this,e)},merge(e){return Ti(this,e)},pick(e){return xi(this,e)},omit(e){return Si(this,e)},partial(...e){return Ei(Il,this,e[0])},required(...e){return Di(Vl,this,e[0])}})});function Cl(e,t){return new Sl({type:`object`,shape:e??{},...L(t)})}var wl=F(`ZodUnion`,(e,t)=>{To.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fc(e,t,n,r),e.options=t.options});function Tl(e,t){return new wl({type:`union`,options:e,...L(t)})}var El=F(`ZodDiscriminatedUnion`,(e,t)=>{wl.init(e,t),Eo.init(e,t)});function Dl(e,t,n){return new El({type:`union`,options:t,discriminator:e,...L(n)})}var Ol=F(`ZodIntersection`,(e,t)=>{Do.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pc(e,t,n,r)});function kl(e,t){return new Ol({type:`intersection`,left:e,right:t})}var Al=F(`ZodEnum`,(e,t)=>{Ao.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Al({...t,checks:[],...L(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Al({...t,checks:[],...L(r),entries:i})}});function jl(e,t){return new Al({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var Ml=F(`ZodLiteral`,(e,t)=>{jo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Nl(e,t){return new Ml({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var Pl=F(`ZodTransform`,(e,t)=>{Mo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Fl(e){return new Pl({type:`transform`,transform:e})}var Il=F(`ZodOptional`,(e,t)=>{Po.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ll(e){return new Il({type:`optional`,innerType:e})}var Rl=F(`ZodExactOptional`,(e,t)=>{Fo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zl(e){return new Rl({type:`optional`,innerType:e})}var G=F(`ZodNullable`,(e,t)=>{Io.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function K(e){return new G({type:`nullable`,innerType:e})}var q=F(`ZodDefault`,(e,t)=>{Lo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function J(e,t){return new q({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var Y=F(`ZodPrefault`,(e,t)=>{zo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bl(e,t){return new Y({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var Vl=F(`ZodNonOptional`,(e,t)=>{Bo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hl(e,t){return new Vl({type:`nonoptional`,innerType:e,...L(t)})}var Ul=F(`ZodCatch`,(e,t)=>{Ho.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Wl(e,t){return new Ul({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Gl=F(`ZodPipe`,(e,t)=>{Uo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r),e.in=t.in,e.out=t.out});function Kl(e,t){return new Gl({type:`pipe`,in:e,out:t})}var ql=F(`ZodReadonly`,(e,t)=>{Go.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jl(e){return new ql({type:`readonly`,innerType:e})}var Yl=F(`ZodLazy`,(e,t)=>{qo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Xl(e){return new Yl({type:`lazy`,getter:e})}var Zl=F(`ZodCustom`,(e,t)=>{Jo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r)});function Ql(e,t={}){return Ks(Zl,e,t)}function $l(e,t){return qs(e,t)}var eu=g(),tu=Dl(`type`,[Cl({name:Jc().min(1),type:Nl(`new`),actualFilename:Jc().min(1),patchSnapshotJsonFile:Jc().min(1)}),Cl({name:Jc().min(1),type:Nl(`change`),expectedHash:Jc().regex(/^[a-f0-9]{64}$/i),actualFilename:Jc().min(1),patchSnapshotJsonFile:Jc().min(1)}),Cl({name:Jc().min(1),type:Nl(`deleted`),expectedHash:Jc().regex(/^[a-f0-9]{64}$/i),patchSnapshotJsonFile:Jc().min(1)})]),nu=Xl(()=>Cl({name:Jc().min(1),items:xl(Tl([nu,tu])).min(0)})),ru=Cl({project:Cl({path:Jc(),branch:Jc().nullable()}).optional(),groups:xl(nu)}),iu=Cl({name:Jc().min(1),hash:Tl([Jc().regex(/^[a-f0-9]{64}$/i),hl()])}),au=Xl(()=>Cl({name:Jc().min(1),items:xl(Tl([au,iu]))}));Cl({groups:xl(au)});var ou=Cl({doc:ru,expectedUrlPattern:Jc(),workerUrl:Jc(),serverVersion:Jc()});Cl({testId:Jc().min(1)});var su=Cl({hash:Jc().regex(/^[a-f0-9]{64}$/i).optional(),url:Jc().optional()});Cl({error:Jc()});function cu(e,t){return[...e,t].join(`/`)}function lu(e){return encodeURIComponent(e)}function uu(e){return decodeURIComponent(e)}async function du(e,t){let n=null,r=``;try{r=await e.text(),n=r?JSON.parse(r):null}catch{throw e.ok?Error(`Invalid JSON in server response`):Error(`HTTP ${e.status} ${e.statusText}: ${r.slice(0,200)}`)}if(!e.ok){let t=n&&typeof n==`object`&&`error`in n?String(n.error):`HTTP ${e.status} ${e.statusText}`;throw Error(t)}return t(n)}async function fu(){return du(await fetch(`/api/doc`,{method:`GET`}),e=>ou.parse(e))}async function pu(e){return du(await fetch(`/api/accept`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({testId:e})}),e=>su.parse(e))}function mu(e){return`/api/actual?testId=${encodeURIComponent(e)}`}function hu(e,t){return[...e,t].join(`/`)+`/`}function gu(e){let t={},n=(e,r)=>{for(let i of e)if(`items`in i)n(i.items,[...r,i.name]);else{let e=cu(r,i.name);t[e]={testId:e,parents:[...r],name:i.name,item:i}}};for(let t of e.groups)n(t.items,[t.name]);return t}function _u(e,t){let n=(e,r)=>{let i=[];for(let a of e)if(`items`in a){let e=n(a.items,[...r,a.name]);e.length>0&&i.push({kind:`group`,name:a.name,parents:[...r],items:e})}else{let e=cu(r,a.name);t(e,a)&&i.push({kind:`test`,testId:e,parents:[...r],item:a})}return i},r=[];for(let t of e.groups){let e=n(t.items,[t.name]);e.length>0&&r.push({kind:`group`,name:t.name,parents:[],items:e})}return r}function vu(e,t){for(let n of e)n.kind===`group`?vu(n.items,t):t(n)}var yu=`screentest:expandedGroups:v1`;function bu(){try{let e=localStorage.getItem(yu);if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set}function xu(e){try{localStorage.setItem(yu,JSON.stringify([...e]))}catch{}}var X=Xr((e,t)=>({selectedTestId:null,expandedGroups:bu(),acceptedIds:new Set,staleIds:new Set,acceptingIds:new Set,showDiff:!1,acceptAllRunning:!1,acceptAllCancel:!1,acceptAllTotal:0,acceptAllDone:0,setSelected(t){e({selectedTestId:t})},toggleGroup(n){let r=t().expandedGroups,i=new Set(r);i.has(n)?i.delete(n):i.add(n),xu(i),e({expandedGroups:i})},setExpanded(n,r){let i=t().expandedGroups;if(r&&i.has(n)||!r&&!i.has(n))return;let a=new Set(i);r?a.add(n):a.delete(n),xu(a),e({expandedGroups:a})},expandPath(n){let r=t().expandedGroups,i=!1,a=new Set(r);for(let e of n)a.has(e)||(a.add(e),i=!0);i&&(xu(a),e({expandedGroups:a}))},markAccepted(n){let r=new Set(t().acceptedIds);r.add(n),e({acceptedIds:r})},markStale(n){if(t().staleIds.has(n))return;let r=new Set(t().staleIds);r.add(n),e({staleIds:r})},markAccepting(n,r){let i=t().acceptingIds;if(r&&i.has(n)||!r&&!i.has(n))return;let a=new Set(i);r?a.add(n):a.delete(n),e({acceptingIds:a})},setShowDiff(n){t().showDiff!==n&&e({showDiff:n})},setAcceptAllRunning(t){e({acceptAllRunning:t})},setAcceptAllCancel(t){e({acceptAllCancel:t})},setAcceptAllProgress(t,n){e({acceptAllDone:t,acceptAllTotal:n})}})),Su=Xr((e,t)=>({doc:null,flat:{},expectedUrlPattern:``,workerUrl:``,serverVersion:``,loading:!1,error:null,async load(){e({loading:!0,error:null});try{let t=await fu();e({doc:t.doc,flat:gu(t.doc),expectedUrlPattern:t.expectedUrlPattern,workerUrl:t.workerUrl,serverVersion:t.serverVersion,loading:!1})}catch(t){throw e({loading:!1,error:t instanceof Error?t.message:String(t)}),t}},async accept(e){let t=X.getState();if(t.acceptingIds.has(e))return{ok:!1,error:`Already in flight`};if(t.acceptedIds.has(e))return{ok:!0};X.getState().markAccepting(e,!0);try{return await pu(e),X.getState().markAccepted(e),X.getState().markAccepting(e,!1),{ok:!0}}catch(t){return X.getState().markAccepting(e,!1),{ok:!1,error:t instanceof Error?t.message:String(t)}}},expectedUrlFor(e){let{expectedUrlPattern:n}=t();return n.replace(`{hash}`,e)}})),Cu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),wu=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Tu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Eu=e=>{let t=Tu(e);return t.charAt(0).toUpperCase()+t.slice(1)},Du={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ou=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ku=(0,_.createContext)({}),Au=()=>(0,_.useContext)(ku),ju=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Au()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...Du,width:t??l??Du.width,height:t??l??Du.height,stroke:e??f,strokeWidth:m,className:Cu(`lucide`,p,i),...!a&&!Ou(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Mu=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(ju,{ref:i,iconNode:t,className:Cu(`lucide-${wu(Eu(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Eu(e),n},Nu=Mu(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Pu=Mu(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Fu=Mu(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Iu=Mu(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Lu=Mu(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ru=Mu(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),zu=Mu(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Bu=Mu(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Vu=Mu(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Hu=Mu(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Uu=Mu(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Wu(){let e=Su.getState().doc,t=X.getState();if(!e)return{pending:[],accepted:[],pendingIdsOrdered:[],counts:{pending:0,accepted:0,stale:0}};let n=_u(e,e=>!t.acceptedIds.has(e)),r=_u(e,e=>t.acceptedIds.has(e)),i=[];vu(n,e=>i.push(e.testId));let a=0;vu(n,e=>{t.staleIds.has(e.testId)&&a++});let o=0;vu(n,()=>o++);let s=0;return vu(r,()=>s++),{pending:n,accepted:r,pendingIdsOrdered:i,counts:{pending:o,accepted:s,stale:a}}}function Z(e){if(e.kind===`test`)return+!!X.getState().staleIds.has(e.testId);let t=0;for(let n of e.items)t+=Z(n);return t}function Gu(e){let t=X.getState(),n=_u(e,(e,n)=>!(t.acceptedIds.has(e)||n.type===`change`&&t.staleIds.has(e))),r=[];return vu(n,e=>r.push(e.testId)),r}typeof window<`u`&&window.document&&window.document.createElement;function Ku(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function qu(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,N.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ju(i,...t)]}function Ju(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Yu=globalThis?.document?_.useLayoutEffect:()=>{},Xu=_.useInsertionEffect||Yu;function Zu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Qu({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=$u(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Qu({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Xu(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function $u(e){return typeof e==`function`}function ed(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function td(...e){return t=>{let n=!1,r=e.map(e=>{let r=ed(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ed(e[t],null)}}}}function nd(...e){return _.useCallback(td(...e),e)}function rd(e){let t=id(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(sd);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,N.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,N.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function id(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ld(n),i=cd(r,n.props);return n.type!==_.Fragment&&(i.ref=t?td(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ad=Symbol(`radix.slottable`);function od(e){let t=({children:e})=>(0,N.jsx)(N.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=ad,t}function sd(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ad}function cd(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ld(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ud=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=rd(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,N.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dd(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function fd(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var pd=e=>{let{present:t,children:n}=e,r=md(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=nd(r.ref,gd(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};pd.displayName=`Presence`;function md(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=fd(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=hd(r.current);a.current=o===`mounted`?e:`none`},[o]),Yu(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=hd(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Yu(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=hd(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=hd(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function hd(e){return e?.animationName||`none`}function gd(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _d=_.useId||(()=>void 0),vd=0;function yd(e){let[t,n]=_.useState(_d());return Yu(()=>{e||n(e=>e??String(vd++))},[e]),e||(t?`radix-${t}`:``)}var Q=`Collapsible`,[bd,xd]=qu(Q),[Sd,Cd]=bd(Q),wd=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Zu({prop:r,defaultProp:i??!1,onChange:o,caller:Q});return(0,N.jsx)(Sd,{scope:n,disabled:a,contentId:yd(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,N.jsx)(ud.div,{"data-state":Ad(c),"data-disabled":a?``:void 0,...s,ref:t})})});wd.displayName=Q;var Td=`CollapsibleTrigger`,Ed=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Cd(Td,n);return(0,N.jsx)(ud.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ad(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Ku(e.onClick,i.onOpenToggle)})});Ed.displayName=Td;var Dd=`CollapsibleContent`,Od=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Cd(Dd,e.__scopeCollapsible);return(0,N.jsx)(pd,{present:n||i.open,children:({present:e})=>(0,N.jsx)(kd,{...r,ref:t,present:e})})});Od.displayName=Dd;var kd=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Cd(Dd,n),[s,c]=_.useState(r),l=_.useRef(null),u=nd(t,l),d=_.useRef(0),f=d.current,p=_.useRef(0),m=p.current,h=o.open||s,g=_.useRef(h),v=_.useRef(void 0);return _.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Yu(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,N.jsx)(ud.div,{"data-state":Ad(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Ad(e){return e?`open`:`closed`}var jd=wd,Md=Ed,$=Od;function Nd(e){let t=e+`CollectionProvider`,[n,r]=qu(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,N.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=rd(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,N.jsx)(c,{ref:nd(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=rd(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=nd(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,N.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}function Pd(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...e)=>t.current?.(...e),[])}function Fd(e,t=globalThis?.document){let n=Pd(e);_.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Id=`DismissableLayer`,Ld=`dismissableLayer.update`,Rd=`dismissableLayer.pointerDownOutside`,zd=`dismissableLayer.focusOutside`,Bd,Vd=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=_.useContext(Vd),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=_.useState({}),m=nd(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Gd(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Kd(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Fd(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Bd=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),qd(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Bd)}},[u,f,n,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),qd())},[u,l]),_.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ld,e),()=>document.removeEventListener(Ld,e)},[]),(0,N.jsx)(ud.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Ku(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ku(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ku(e.onPointerDownCapture,S.onPointerDownCapture)})});Hd.displayName=Id;var Ud=`DismissableLayerBranch`,Wd=_.forwardRef((e,t)=>{let n=_.useContext(Vd),r=_.useRef(null),i=nd(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,N.jsx)(ud.div,{...e,ref:i})});Wd.displayName=Ud;function Gd(e,t=globalThis?.document){let n=Pd(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Jd(Rd,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Kd(e,t=globalThis?.document){let n=Pd(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&Jd(zd,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qd(){let e=new CustomEvent(Ld);document.dispatchEvent(e)}function Jd(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dd(i,a):i.dispatchEvent(a)}var Yd=Hd,Xd=Wd,Zd=`Portal`,Qd=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);Yu(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ur.createPortal((0,N.jsx)(ud.div,{...r,ref:t}),o):null});Qd.displayName=Zd;var $d=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ef=`VisuallyHidden`,tf=_.forwardRef((e,t)=>(0,N.jsx)(ud.span,{...e,ref:t,style:{...$d,...e.style}}));tf.displayName=ef;var nf=tf,rf=`ToastProvider`,[af,of,sf]=Nd(`Toast`),[cf,lf]=qu(`Toast`,[sf]),[uf,df]=cf(rf),ff=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=_.useState(null),[l,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${rf}\`. Expected non-empty \`string\`.`),(0,N.jsx)(af.Provider,{scope:t,children:(0,N.jsx)(uf,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:_.useCallback(()=>u(e=>e+1),[]),onToastRemove:_.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};ff.displayName=rf;var pf=`ToastViewport`,mf=[`F8`],hf=`toast.viewportPause`,gf=`toast.viewportResume`,_f=_.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=mf,label:i=`Notifications ({hotkey})`,...a}=e,o=df(pf,n),s=of(n),c=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=nd(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;_.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),_.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(hf);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(gf);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=_.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Wf(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return _.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Gf(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,N.jsxs)(Xd,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,N.jsx)(yf,{ref:l,onFocusFromOutsideViewport:()=>{Gf(h({tabbingDirection:`forwards`}))}}),(0,N.jsx)(af.Slot,{scope:n,children:(0,N.jsx)(ud.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,N.jsx)(yf,{ref:u,onFocusFromOutsideViewport:()=>{Gf(h({tabbingDirection:`backwards`}))}})]})});_f.displayName=pf;var vf=`ToastFocusProxy`,yf=_.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=df(vf,n);return(0,N.jsx)(tf,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});yf.displayName=vf;var bf=`Toast`,xf=`toast.swipeStart`,Sf=`toast.swipeMove`,Cf=`toast.swipeCancel`,wf=`toast.swipeEnd`,Tf=_.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Zu({prop:r,defaultProp:i??!0,onChange:a,caller:bf});return(0,N.jsx)(pd,{present:n||s,children:(0,N.jsx)(Of,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Pd(e.onPause),onResume:Pd(e.onResume),onSwipeStart:Ku(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Ku(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Ku(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Ku(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Tf.displayName=bf;var[Ef,Df]=cf(bf,{onClose(){}}),Of=_.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=df(bf,n),[g,v]=_.useState(null),y=nd(t,e=>v(e)),b=_.useRef(null),x=_.useRef(null),S=i||h.duration,C=_.useRef(0),w=_.useRef(S),T=_.useRef(0),{onToastAdd:ee,onToastRemove:te}=h,E=Pd(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),D=_.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(E,e))},[E]);_.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{D(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(hf,n),e.addEventListener(gf,t),()=>{e.removeEventListener(hf,n),e.removeEventListener(gf,t)}}},[h.viewport,S,c,l,D]),_.useEffect(()=>{a&&!h.isClosePausedRef.current&&D(S)},[a,S,h.isClosePausedRef,D]),_.useEffect(()=>(ee(),()=>te()),[ee,te]);let O=_.useMemo(()=>g?zf(g):null,[g]);return h.viewport?(0,N.jsxs)(N.Fragment,{children:[O&&(0,N.jsx)(kf,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:O}),(0,N.jsx)(Ef,{scope:n,onClose:E,children:ur.createPortal((0,N.jsx)(af.ItemSlot,{scope:n,children:(0,N.jsx)(Yd,{asChild:!0,onEscapeKeyDown:Ku(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||E(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,N.jsx)(ud.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Ku(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:Ku(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:Ku(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Bf(Sf,d,f,{discrete:!1})):Vf(l,h.swipeDirection,c)?(x.current=l,Bf(xf,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:Ku(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Vf(t,h.swipeDirection,h.swipeThreshold)?Bf(wf,p,r,{discrete:!0}):Bf(Cf,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),kf=e=>{let{__scopeToast:t,children:n,...r}=e,i=df(bf,t),[a,o]=_.useState(!1),[s,c]=_.useState(!1);return Hf(()=>o(!0)),_.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,N.jsx)(Qd,{asChild:!0,children:(0,N.jsx)(tf,{...r,children:a&&(0,N.jsxs)(N.Fragment,{children:[i.label,` `,n]})})})},Af=`ToastTitle`,jf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(ud.div,{...r,ref:t})});jf.displayName=Af;var Mf=`ToastDescription`,Nf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(ud.div,{...r,ref:t})});Nf.displayName=Mf;var Pf=`ToastAction`,Ff=_.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,N.jsx)(Rf,{altText:n,asChild:!0,children:(0,N.jsx)(Lf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Pf}\`. Expected non-empty \`string\`.`),null)});Ff.displayName=Pf;var If=`ToastClose`,Lf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Df(If,n);return(0,N.jsx)(Rf,{asChild:!0,children:(0,N.jsx)(ud.button,{type:`button`,...r,ref:t,onClick:Ku(e.onClick,i.onClose)})})});Lf.displayName=If;var Rf=_.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,N.jsx)(ud.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function zf(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Uf(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...zf(e))}}),t}function Bf(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dd(i,a):i.dispatchEvent(a)}var Vf=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Hf(e=()=>{}){let t=Pd(e);Yu(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Uf(e){return e.nodeType===e.ELEMENT_NODE}function Wf(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Gf(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var Kf=ff,qf=_f,Jf=Tf,Yf=jf,Xf=Nf,Zf={viewport:`_viewport_1obvw_1`,toast:`_toast_1obvw_17`,slideIn:`_slideIn_1obvw_1`,fadeOut:`_fadeOut_1obvw_1`,error:`_error_1obvw_32`,success:`_success_1obvw_36`,info:`_info_1obvw_40`,title:`_title_1obvw_44`,desc:`_desc_1obvw_50`},Qf=new Set,$f=0;function ep(e){let t={id:++$f,...e};Qf.forEach(e=>e(t))}function tp(){let[e,t]=(0,_.useState)([]);return(0,_.useEffect)(()=>{let e=e=>{t(t=>[...t,e])};return Qf.add(e),()=>{Qf.delete(e)}},[]),(0,N.jsxs)(N.Fragment,{children:[e.map(e=>(0,N.jsxs)(Jf,{className:`${Zf.toast} ${e.tone?Zf[e.tone]:``}`,duration:5e3,onOpenChange:n=>{n||t(t=>t.filter(t=>t.id!==e.id))},children:[(0,N.jsx)(Yf,{className:Zf.title,children:e.title}),e.description?(0,N.jsx)(Xf,{className:Zf.desc,children:e.description}):null]},e.id)),(0,N.jsx)(qf,{className:Zf.viewport})]})}function np(e,t){let n=e.indexOf(t);return n===-1?e[0]??null:n+1<e.length?e[n+1]??null:n-1>=0?e[n-1]??null:null}async function rp(e){let t=Wu().pendingIdsOrdered,n=await Su.getState().accept(e);if(!n.ok){ep({title:`Accept failed`,description:n.error,tone:`error`});return}let r=np(t,e);r?l_.navigate({to:`/test/$testId`,params:{testId:lu(r)}}):l_.navigate({to:`/`})}var ip={tree:`_tree_4auq3_1`,groupLi:`_groupLi_4auq3_7`,leafLi:`_leafLi_4auq3_8`,group:`_group_4auq3_7`,leaf:`_leaf_4auq3_8`,chevron:`_chevron_4auq3_31`,chevronOpen:`_chevronOpen_4auq3_37`,groupName:`_groupName_4auq3_41`,leafName:`_leafName_4auq3_42`,staleBadge:`_staleBadge_4auq3_55`,leafSelected:`_leafSelected_4auq3_70`,icon:`_icon_4auq3_78`,acceptInline:`_acceptInline_4auq3_82`,toneGreen:`_toneGreen_4auq3_103`,toneYellow:`_toneYellow_4auq3_107`,toneOrange:`_toneOrange_4auq3_111`,toneRed:`_toneRed_4auq3_115`,toneRedDim:`_toneRedDim_4auq3_119`,toneBlueGrey:`_toneBlueGrey_4auq3_123`,toneAccent:`_toneAccent_4auq3_127`,spin:`_spin_4auq3_131`};function ap(e){return(0,N.jsx)(`ul`,{className:ip.tree,children:e.nodes.map(t=>(0,N.jsx)(sp,{node:t,kind:e.kind,depth:0},op(t)))})}function op(e){return e.kind===`group`?`g:`+hu(e.parents,e.name):`t:`+e.testId}function sp(e){return e.node.kind===`group`?(0,N.jsx)(cp,{node:e.node,kind:e.kind,depth:e.depth}):(0,N.jsx)(lp,{node:e.node,kind:e.kind,depth:e.depth})}function cp(e){let t=hu(e.node.parents,e.node.name),n=X(e=>e.expandedGroups.has(t)),r=e.kind===`pending`?Z(e.node):0;return(0,N.jsx)(`li`,{className:ip.groupLi,children:(0,N.jsxs)(jd,{open:n,onOpenChange:()=>X.getState().toggleGroup(t),children:[(0,N.jsx)(Md,{asChild:!0,children:(0,N.jsxs)(`button`,{className:ip.group,style:{paddingLeft:6+e.depth*12},children:[(0,N.jsx)(Fu,{size:12,className:`${ip.chevron} ${n?ip.chevronOpen:``}`}),(0,N.jsx)(`span`,{className:ip.groupName,children:e.node.name}),r>0?(0,N.jsx)(`span`,{className:ip.staleBadge,children:r}):null]})}),(0,N.jsx)($,{children:(0,N.jsx)(`ul`,{className:ip.tree,children:e.node.items.map(t=>(0,N.jsx)(sp,{node:t,kind:e.kind,depth:e.depth+1},op(t)))})})]})})}function lp(e){let t=cr(),n=X(t=>t.selectedTestId===e.node.testId),r=X(t=>t.staleIds.has(e.node.testId)),i=X(t=>t.acceptingIds.has(e.node.testId)),a=e.kind===`accepted`,o=X(e=>e.acceptAllRunning),s=e.node.item.type,{Icon:c,toneClass:l,label:u}=up(s,r,a,i),d=!a&&!i&&!o&&(s===`new`||s===`change`&&!r||s===`deleted`);return(0,N.jsx)(`li`,{className:ip.leafLi,children:(0,N.jsxs)(`button`,{className:`${ip.leaf} ${n?ip.leafSelected:``}`,style:{paddingLeft:6+e.depth*12},title:u,onClick:()=>t({to:`/test/$testId`,params:{testId:lu(e.node.testId)}}),children:[(0,N.jsx)(c,{size:13,className:`${ip.icon} ${l}`}),(0,N.jsx)(`span`,{className:ip.leafName,children:e.node.item.name}),d?(0,N.jsx)(`span`,{className:ip.acceptInline,onClick:async t=>{t.stopPropagation(),await rp(e.node.testId)},role:`button`,"aria-label":`Accept`,children:(0,N.jsx)(Pu,{size:12})}):null]})})}function up(e,t,n,r){return r?{Icon:Ru,toneClass:`${ip.toneAccent} ${ip.spin}`,label:`Accepting…`}:n?{Icon:Pu,toneClass:ip.toneBlueGrey,label:`Accepted`}:e===`new`?{Icon:Vu,toneClass:ip.toneGreen,label:`New`}:e===`change`?t?{Icon:Uu,toneClass:ip.toneOrange,label:`Change (stale)`}:{Icon:Bu,toneClass:ip.toneYellow,label:`Change`}:t?{Icon:Uu,toneClass:ip.toneRedDim,label:`Deleted (stale)`}:{Icon:zu,toneClass:ip.toneRed,label:`Deleted`}}var dp=[`top`,`right`,`bottom`,`left`],fp=Math.min,pp=Math.max,mp=Math.round,hp=Math.floor,gp=e=>({x:e,y:e}),_p={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vp(e,t,n){return pp(e,fp(t,n))}function yp(e,t){return typeof e==`function`?e(t):e}function bp(e){return e.split(`-`)[0]}function xp(e){return e.split(`-`)[1]}function Sp(e){return e===`x`?`y`:`x`}function Cp(e){return e===`y`?`height`:`width`}function wp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Tp(e){return Sp(wp(e))}function Ep(e,t,n){n===void 0&&(n=!1);let r=xp(e),i=Tp(e),a=Cp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fp(o)),[o,Fp(o)]}function Dp(e){let t=Fp(e);return[Op(e),t,Op(t)]}function Op(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kp=[`left`,`right`],Ap=[`right`,`left`],jp=[`top`,`bottom`],Mp=[`bottom`,`top`];function Np(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ap:kp:t?kp:Ap;case`left`:case`right`:return t?jp:Mp;default:return[]}}function Pp(e,t,n,r){let i=xp(e),a=Np(bp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Op)))),a}function Fp(e){let t=bp(e);return _p[t]+e.slice(t.length)}function Ip(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ip(e)}function Rp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zp(e,t,n){let{reference:r,floating:i}=e,a=wp(t),o=Tp(t),s=Cp(o),c=bp(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(xp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Bp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=yp(t,e),p=Lp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Rp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Rp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Vp=50,Hp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Bp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zp(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Vp&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Up=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=yp(e,t)||{};if(l==null)return{};let d=Lp(u),f={x:n,y:r},p=Tp(i),m=Cp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=fp(d[_],T),te=fp(d[v],T),E=ee,D=C-h[m]-te,O=C/2-h[m]/2+w,ne=vp(E,O,D),re=!c.arrow&&xp(i)!=null&&O!==ne&&a.reference[m]/2-(O<E?ee:te)-h[m]/2<0,ie=re?O<E?O-E:O-D:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:O-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),Wp=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=yp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bp(r),_=wp(o),v=bp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fp(o)]:Dp(o)),x=p!==`none`;!d&&x&&b.push(...Pp(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ep(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==wp(t))||T.every(e=>wp(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=wp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Gp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kp(e){return dp.some(t=>e[t]>=0)}var qp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=yp(e,t);switch(i){case`referenceHidden`:{let e=Gp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Kp(e)}}}case`escaped`:{let e=Gp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Kp(e)}}}default:return{}}}}},Jp=new Set([`left`,`top`]);async function Yp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bp(n),s=xp(n),c=wp(n)===`y`,l=Jp.has(o)?-1:1,u=a&&c?-1:1,d=yp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Xp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Yp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Zp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wp(bp(i)),p=Sp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=vp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=vp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Qp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yp(e,t),u={x:n,y:r},d=wp(i),f=Sp(d),p=u[f],m=u[d],h=yp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Jp.has(bp(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},$p=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=yp(e,t),u=await o.detectOverflow(t,l),d=bp(i),f=xp(i),p=wp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=fp(h-u[g],v),x=fp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=pp(u.left,0),t=pp(u.right,0),n=pp(u.top,0),r=pp(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:pp(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:pp(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function em(){return typeof window<`u`}function tm(e){return im(e)?(e.nodeName||``).toLowerCase():`#document`}function nm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rm(e){return((im(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function im(e){return em()?e instanceof Node||e instanceof nm(e).Node:!1}function am(e){return em()?e instanceof Element||e instanceof nm(e).Element:!1}function om(e){return em()?e instanceof HTMLElement||e instanceof nm(e).HTMLElement:!1}function sm(e){return!em()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof nm(e).ShadowRoot}function cm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ym(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function lm(e){return/^(table|td|th)$/.test(tm(e))}function um(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dm=/transform|translate|scale|rotate|perspective|filter/,fm=/paint|layout|strict|content/,pm=e=>!!e&&e!==`none`,mm;function hm(e){let t=am(e)?ym(e):e;return pm(t.transform)||pm(t.translate)||pm(t.scale)||pm(t.rotate)||pm(t.perspective)||!_m()&&(pm(t.backdropFilter)||pm(t.filter))||dm.test(t.willChange||``)||fm.test(t.contain||``)}function gm(e){let t=xm(e);for(;om(t)&&!vm(t);){if(hm(t))return t;if(um(t))return null;t=xm(t)}return null}function _m(){return mm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mm}function vm(e){return/^(html|body|#document)$/.test(tm(e))}function ym(e){return nm(e).getComputedStyle(e)}function bm(e){return am(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xm(e){if(tm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sm(e)&&e.host||rm(e);return sm(t)?t.host:t}function Sm(e){let t=xm(e);return vm(t)?e.ownerDocument?e.ownerDocument.body:e.body:om(t)&&cm(t)?t:Sm(t)}function Cm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Sm(e),i=r===e.ownerDocument?.body,a=nm(r);if(i){let e=wm(a);return t.concat(a,a.visualViewport||[],cm(r)?r:[],e&&n?Cm(e):[])}else return t.concat(r,Cm(r,[],n))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tm(e){let t=ym(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=om(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mp(n)!==a||mp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Em(e){return am(e)?e:e.contextElement}function Dm(e){let t=Em(e);if(!om(t))return gp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Tm(t),o=(a?mp(n.width):n.width)/r,s=(a?mp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Om=gp(0);function km(e){let t=nm(e);return!_m()||!t.visualViewport?Om:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Am(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nm(e)?!1:t}function jm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Em(e),o=gp(1);t&&(r?am(r)&&(o=Dm(r)):o=Dm(e));let s=Am(a,n,r)?km(a):gp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=nm(a),t=r&&am(r)?nm(r):r,n=e,i=wm(n);for(;i&&r&&t!==n;){let e=Dm(i),t=i.getBoundingClientRect(),r=ym(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=nm(i),i=wm(n)}}return Rp({width:u,height:d,x:c,y:l})}function Mm(e,t){let n=bm(e).scrollLeft;return t?t.left+n:jm(rm(e)).left+n}function Nm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Mm(e,n),y:n.top+t.scrollTop}}function Pm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rm(r),s=t?um(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gp(1),u=gp(0),d=om(r);if((d||!d&&!a)&&((tm(r)!==`body`||cm(o))&&(c=bm(r)),d)){let e=jm(r);l=Dm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Nm(o,c):gp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Fm(e){return Array.from(e.getClientRects())}function Im(e){let t=rm(e),n=bm(e),r=e.ownerDocument.body,i=pp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=pp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Mm(e),s=-n.scrollTop;return ym(r).direction===`rtl`&&(o+=pp(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Lm=25;function Rm(e,t){let n=nm(e),r=rm(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=_m();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Mm(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Lm&&(a-=o)}else l<=Lm&&(a+=l);return{width:a,height:o,x:s,y:c}}function zm(e,t){let n=jm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=om(e)?Dm(e):gp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Bm(e,t,n){let r;if(t===`viewport`)r=Rm(e,n);else if(t===`document`)r=Im(rm(e));else if(am(t))r=zm(t,n);else{let n=km(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rp(r)}function Vm(e,t){let n=xm(e);return n===t||!am(n)||vm(n)?!1:ym(n).position===`fixed`||Vm(n,t)}function Hm(e,t){let n=t.get(e);if(n)return n;let r=Cm(e,[],!1).filter(e=>am(e)&&tm(e)!==`body`),i=null,a=ym(e).position===`fixed`,o=a?xm(e):e;for(;am(o)&&!vm(o);){let t=ym(o),n=hm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||cm(o)&&!n&&Vm(e,o))?r=r.filter(e=>e!==o):i=t,o=xm(o)}return t.set(e,r),r}function Um(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?um(t)?[]:Hm(t,this._c):[].concat(n),r],o=Bm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Bm(t,a[e],i);s=pp(n.top,s),c=fp(n.right,c),l=fp(n.bottom,l),u=pp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Wm(e){let{width:t,height:n}=Tm(e);return{width:t,height:n}}function Gm(e,t,n){let r=om(t),i=rm(t),a=n===`fixed`,o=jm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gp(0);function l(){c.x=Mm(i)}if(r||!r&&!a)if((tm(t)!==`body`||cm(i))&&(s=bm(t)),r){let e=jm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Nm(i,s):gp(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Km(e){return ym(e).position===`static`}function qm(e,t){if(!om(e)||ym(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rm(e)===n&&(n=n.ownerDocument.body),n}function Jm(e,t){let n=nm(e);if(um(e))return n;if(!om(e)){let t=xm(e);for(;t&&!vm(t);){if(am(t)&&!Km(t))return t;t=xm(t)}return n}let r=qm(e,t);for(;r&&lm(r)&&Km(r);)r=qm(r,t);return r&&vm(r)&&Km(r)&&!hm(r)?n:r||gm(e)||n}var Ym=async function(e){let t=this.getOffsetParent||Jm,n=this.getDimensions,r=await n(e.floating);return{reference:Gm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xm(e){return ym(e).direction===`rtl`}var Zm={convertOffsetParentRelativeRectToViewportRelativeRect:Pm,getDocumentElement:rm,getClippingRect:Um,getOffsetParent:Jm,getElementRects:Ym,getClientRects:Fm,getDimensions:Wm,getScale:Dm,isElement:am,isRTL:Xm};function Qm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $m(e,t){let n=null,r,i=rm(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=hp(d),h=hp(i.clientWidth-(u+f)),g=hp(i.clientHeight-(d+p)),_=hp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pp(0,fp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Qm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function eh(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Em(e),u=i||a?[...l?Cm(l):[],...t?Cm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?$m(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?jm(e):null;c&&g();function g(){let t=jm(e);h&&!Qm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var th=Xp,nh=Zp,rh=Wp,ih=$p,ah=qp,oh=Up,sh=Qp,ch=(e,t,n)=>{let r=new Map,i={platform:Zm,...n},a={...i.platform,_c:r};return Hp(e,t,{...i,platform:a})},lh=typeof document<`u`?_.useLayoutEffect:function(){};function uh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fh(e,t){let n=dh(e);return Math.round(t*n)/n}function ph(e){let t=_.useRef(e);return lh(()=>{t.current=e}),t}function mh(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);uh(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),ee=c!=null,te=ph(c),E=ph(i),D=ph(l),O=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),ch(C.current,w.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};ne.current&&!uh(T.current,t)&&(T.current=t,ur.flushSync(()=>{d(t)}))})},[f,t,n,E,D]);lh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ne=_.useRef(!1);lh(()=>(ne.current=!0,()=>{ne.current=!1}),[]),lh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,O);O()}},[x,S,O,te,ee]);let re=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ie=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=fh(ie.floating,u.x),r=fh(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dh(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:O,refs:re,elements:ie,floatingStyles:ae}),[u,O,re,ie,ae])}var hh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:oh({element:r.current,padding:i}).fn(n):r?oh({element:r,padding:i}).fn(n):{}}}},gh=(e,t)=>{let n=th(e);return{name:n.name,fn:n.fn,options:[e,t]}},_h=(e,t)=>{let n=nh(e);return{name:n.name,fn:n.fn,options:[e,t]}},vh=(e,t)=>({fn:sh(e).fn,options:[e,t]}),yh=(e,t)=>{let n=rh(e);return{name:n.name,fn:n.fn,options:[e,t]}},bh=(e,t)=>{let n=ih(e);return{name:n.name,fn:n.fn,options:[e,t]}},xh=(e,t)=>{let n=ah(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sh=(e,t)=>{let n=hh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ch=`Arrow`,wh=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,N.jsx)(ud.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,N.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});wh.displayName=Ch;var Th=wh;function Eh(e){let[t,n]=_.useState(void 0);return Yu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Dh=`Popper`,[Oh,kh]=qu(Dh),[Ah,jh]=Oh(Dh),Mh=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,N.jsx)(Ah,{scope:t,anchor:r,onAnchorChange:i,children:n})};Mh.displayName=Dh;var Nh=`PopperAnchor`,Ph=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=jh(Nh,n),o=_.useRef(null),s=nd(t,o),c=_.useRef(null);return _.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,N.jsx)(ud.div,{...i,ref:s})});Ph.displayName=Nh;var Fh=`PopperContent`,[Ih,Lh]=Oh(Fh),Rh=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=jh(Fh,n),[v,y]=_.useState(null),b=nd(t,e=>y(e)),[x,S]=_.useState(null),C=Eh(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},E=Array.isArray(l)?l:[l],D=E.length>0,O={padding:te,boundary:E.filter(Hh),altBoundary:D},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:oe}=mh({strategy:`fixed`,placement:ee,whileElementsMounted:(...e)=>eh(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[gh({mainAxis:i+T,alignmentAxis:o}),c&&_h({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?vh():void 0,...O}),c&&yh({...O}),bh({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Sh({element:x,padding:s}),Uh({arrowWidth:w,arrowHeight:T}),f&&xh({strategy:`referenceHidden`,...O})]}),[k,A]=Wh(ie),se=Pd(m);Yu(()=>{ae&&se?.()},[ae,se]);let ce=oe.arrow?.x,le=oe.arrow?.y,ue=oe.arrow?.centerOffset!==0,[de,j]=_.useState();return Yu(()=>{v&&j(window.getComputedStyle(v).zIndex)},[v]),(0,N.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,N.jsx)(Ih,{scope:n,placedSide:k,onArrowChange:S,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,N.jsx)(ud.div,{"data-side":k,"data-align":A,...h,ref:b,style:{...h.style,animation:ae?void 0:`none`}})})})});Rh.displayName=Fh;var zh=`PopperArrow`,Bh={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vh=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lh(zh,n),a=Bh[i.placedSide];return(0,N.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,N.jsx)(Th,{...r,ref:t,style:{...r.style,display:`block`}})})});Vh.displayName=zh;function Hh(e){return e!==null}var Uh=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Wh(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Wh(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gh=Mh,Kh=Ph,qh=Rh,Jh=Vh,[Yh,Xh]=qu(`Tooltip`,[kh]),Zh=kh(),Qh=`TooltipProvider`,$h=700,eg=`tooltip.open`,[tg,ng]=Yh(Qh),rg=e=>{let{__scopeTooltip:t,delayDuration:n=$h,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,N.jsx)(tg,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};rg.displayName=Qh;var ig=`Tooltip`,[ag,og]=Yh(ig),sg=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ng(ig,e.__scopeTooltip),l=Zh(t),[u,d]=_.useState(null),f=yd(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=Zu({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(eg))):c.onClose(),a?.(e)},caller:ig}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,N.jsx)(Gh,{...l,children:(0,N.jsx)(ag,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};sg.displayName=ig;var cg=`TooltipTrigger`,lg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=og(cg,n),a=ng(cg,n),o=Zh(n),s=nd(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,N.jsx)(Kh,{asChild:!0,...o,children:(0,N.jsx)(ud.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Ku(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Ku(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Ku(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Ku(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ku(e.onBlur,i.onClose),onClick:Ku(e.onClick,i.onClose)})})});lg.displayName=cg;var ug=`TooltipPortal`,[dg,fg]=Yh(ug,{forceMount:void 0}),pg=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=og(ug,t);return(0,N.jsx)(dg,{scope:t,forceMount:n,children:(0,N.jsx)(pd,{present:n||a.open,children:(0,N.jsx)(Qd,{asChild:!0,container:i,children:r})})})};pg.displayName=ug;var mg=`TooltipContent`,hg=_.forwardRef((e,t)=>{let n=fg(mg,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=og(mg,e.__scopeTooltip);return(0,N.jsx)(pd,{present:r||o.open,children:o.disableHoverableContent?(0,N.jsx)(bg,{side:i,...a,ref:t}):(0,N.jsx)(gg,{side:i,...a,ref:t})})}),gg=_.forwardRef((e,t)=>{let n=og(mg,e.__scopeTooltip),r=ng(mg,e.__scopeTooltip),i=_.useRef(null),a=nd(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=wg(r,Cg(r,n.getBoundingClientRect())),a=Tg(t.getBoundingClientRect());s(Dg([...i,...a])),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Eg(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,N.jsx)(bg,{...e,ref:a})}),[_g,vg]=Yh(ig,{isInside:!1}),yg=od(`TooltipContent`),bg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=og(mg,n),l=Zh(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(eg,u),()=>document.removeEventListener(eg,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,N.jsx)(Hd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,N.jsxs)(qh,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,N.jsx)(yg,{children:r}),(0,N.jsx)(_g,{scope:n,isInside:!0,children:(0,N.jsx)(nf,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});hg.displayName=mg;var xg=`TooltipArrow`,Sg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Zh(n);return vg(xg,n).isInside?null:(0,N.jsx)(Jh,{...i,...r,ref:t})});Sg.displayName=xg;function Cg(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function wg(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Tg(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Eg(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Dg(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Og(t)}function Og(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var kg=rg,Ag=sg,jg=lg,Mg=pg,Ng=hg,Pg={root:`_root_12w7q_1`,row:`_row_12w7q_10`,action:`_action_12w7q_16`,actionCount:`_actionCount_12w7q_33`,stop:`_stop_12w7q_41`,progressOuter:`_progressOuter_12w7q_57`,progressInner:`_progressInner_12w7q_66`,progressLabel:`_progressLabel_12w7q_73`,counts:`_counts_12w7q_81`,tip:`_tip_12w7q_86`};function Fg(e){let t=X(e=>e.acceptAllRunning),n=X(e=>e.acceptAllDone),r=X(e=>e.acceptAllTotal),i=(()=>{let e=Su.getState().doc;return e?Gu(e).length:0})(),a=async()=>{let e=Su.getState().doc;if(!e)return;let t=Gu(e);if(t.length===0)return;X.getState().setAcceptAllRunning(!0),X.getState().setAcceptAllCancel(!1),X.getState().setAcceptAllProgress(0,t.length);let n=0,r=!1;for(let e=0;e<t.length;e++){if(X.getState().acceptAllCancel){r=!0;break}let i=t[e],a=await Su.getState().accept(i);a.ok?n++:ep({title:`Accept failed`,description:`${i}: ${a.error}`,tone:`error`}),X.getState().setAcceptAllProgress(n,t.length)}X.getState().setAcceptAllRunning(!1),X.getState().setAcceptAllCancel(!1),ep(r?{title:`Accept all stopped`,description:`Stopped after ${n} test${n===1?``:`s`}.`,tone:`info`}:{title:`Accept all finished`,description:`Accepted ${n} test${n===1?``:`s`}.`,tone:`success`})},o=()=>{X.getState().setAcceptAllCancel(!0)},s=r>0?n/r*100:0;return(0,N.jsxs)(`div`,{className:Pg.root,children:[(0,N.jsxs)(`div`,{className:Pg.row,children:[(0,N.jsxs)(Ag,{children:[(0,N.jsx)(jg,{asChild:!0,children:(0,N.jsxs)(`button`,{className:Pg.action,disabled:i===0||t,onClick:a,"aria-label":`Accept all`,children:[(0,N.jsx)(Nu,{size:14}),(0,N.jsx)(`span`,{children:`Accept all`}),i>0?(0,N.jsx)(`span`,{className:Pg.actionCount,children:i}):null]})}),(0,N.jsx)(Mg,{children:(0,N.jsx)(Ng,{className:Pg.tip,side:`bottom`,sideOffset:4,children:"Accepts every pending `new` and `change` test (skips stale and deleted)."})})]}),t?(0,N.jsxs)(`button`,{className:Pg.stop,onClick:o,"aria-label":`Stop`,children:[(0,N.jsx)(Iu,{size:14}),(0,N.jsx)(`span`,{children:`Stop`})]}):null]}),t?(0,N.jsxs)(`div`,{className:Pg.progressOuter,children:[(0,N.jsx)(`div`,{className:Pg.progressInner,style:{width:`${s}%`}}),(0,N.jsxs)(`span`,{className:Pg.progressLabel,children:[n,` / `,r]})]}):null,(0,N.jsxs)(`div`,{className:Pg.counts,children:[`Pending `,(0,N.jsx)(`b`,{children:e.counts.pending}),` · Accepted `,(0,N.jsx)(`b`,{children:e.counts.accepted}),` · Stale`,` `,(0,N.jsx)(`b`,{children:e.counts.stale})]})]})}var Ig={root:`_root_1d1kr_1`,projectHeader:`_projectHeader_1d1kr_8`,projectName:`_projectName_1d1kr_17`,projectBranch:`_projectBranch_1d1kr_26`,scroll:`_scroll_1d1kr_37`,section:`_section_1d1kr_44`,sectionTitle:`_sectionTitle_1d1kr_48`,sectionEmpty:`_sectionEmpty_1d1kr_57`,sectionBody:`_sectionBody_1d1kr_64`,versionFooter:`_versionFooter_1d1kr_68`};function Lg(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}function Rg(){let e=Su(e=>e.doc),t=X(e=>e.acceptedIds),n=X(e=>e.staleIds),r=Su(e=>e.serverVersion),i=e?.project,a=(0,_.useMemo)(()=>Wu(),[e,t,n]);return(0,N.jsxs)(`div`,{className:Ig.root,children:[i?(0,N.jsxs)(`header`,{className:Ig.projectHeader,title:i.path,children:[(0,N.jsx)(`div`,{className:Ig.projectName,children:Lg(i.path)}),i.branch?(0,N.jsxs)(`div`,{className:Ig.projectBranch,children:[(0,N.jsx)(Lu,{size:11,"aria-hidden":!0}),(0,N.jsx)(`span`,{children:i.branch})]}):null]}):null,(0,N.jsx)(Fg,{counts:a.counts}),(0,N.jsxs)(`div`,{className:Ig.scroll,children:[(0,N.jsx)(zg,{title:`Pending (${a.counts.pending})`,empty:a.pending.length===0?`No pending tests.`:null,children:(0,N.jsx)(ap,{nodes:a.pending,kind:`pending`})}),(0,N.jsx)(zg,{title:`Accepted (${a.counts.accepted})`,empty:(a.accepted.length,null),children:(0,N.jsx)(ap,{nodes:a.accepted,kind:`accepted`})})]}),r?(0,N.jsxs)(`footer`,{className:Ig.versionFooter,title:`@cevek/screentest package version`,children:[`v`,r]}):null]})}function zg(e){return(0,N.jsxs)(`section`,{className:Ig.section,children:[(0,N.jsx)(`div`,{className:Ig.sectionTitle,children:e.title}),e.empty?(0,N.jsx)(`div`,{className:Ig.sectionEmpty,children:e.empty}):(0,N.jsx)(`div`,{className:Ig.sectionBody,children:e.children})]})}var Bg=6;function Vg(e){let t=!1,n=[],r=(t,i)=>{for(let a of t)if(`items`in a)r(a.items,[...i,a.name]);else{let t=a;if(t.type===`new`)continue;let r=cu(i,t.name);n.push({id:r,url:e.expectedUrlFor(t.expectedHash)})}};for(let t of e.doc.groups)r(t.items,[t.name]);let i=0,a=n=>new Promise(r=>{let i=new Image;i.onload=()=>r(),i.onerror=()=>{t||e.onStale(n.id),r()},i.src=n.url}),o=async()=>{for(;!t;){let e=i++;if(e>=n.length)return;let t=n[e];await a(t)}},s=[];for(let e=0;e<Bg;e++)s.push(o());return Promise.all(s),()=>{t=!0}}function Hg(){let e=cr();(0,_.useEffect)(()=>{let t=async t=>{if(t.metaKey||t.ctrlKey||t.altKey)return;let n=t.target;if(n&&/^(input|textarea|select)$/i.test(n.tagName))return;let r=X.getState();if(Su.getState().doc){if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault();let n=Wu().pendingIdsOrdered;if(n.length===0)return;let i=r.selectedTestId?n.indexOf(r.selectedTestId):-1;i=i===-1?t.key===`ArrowDown`?0:n.length-1:t.key===`ArrowDown`?Math.min(n.length-1,i+1):Math.max(0,i-1);let a=n[i];e({to:`/test/$testId`,params:{testId:lu(a)}});return}if(t.key===`Enter`){if(!r.selectedTestId)return;let e=Su.getState().flat[r.selectedTestId];if(!e)return;let n=r.staleIds.has(r.selectedTestId);if(e.item.type===`change`&&n||r.acceptingIds.has(r.selectedTestId)||r.acceptAllRunning||r.acceptedIds.has(r.selectedTestId))return;t.preventDefault(),await rp(r.selectedTestId)}}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var Ug={shell:`_shell_wtjyy_1`,aside:`_aside_wtjyy_8`,main:`_main_wtjyy_18`,splash:`_splash_wtjyy_26`,spinner:`_spinner_wtjyy_37`,spin:`_spin_wtjyy_37`,errorTitle:`_errorTitle_wtjyy_46`,errorMsg:`_errorMsg_wtjyy_51`,retry:`_retry_wtjyy_57`};function Wg(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}function Gg(e){let t=Su(e=>e.loading),n=Su(e=>e.doc),r=Su(e=>e.error),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{Su.getState().load().catch(e=>{let t=e instanceof Error?e.message:String(e);a(t),ep({title:`Failed to load doc`,description:t,tone:`error`})})},[]),(0,_.useEffect)(()=>{let e=n?.project;if(!e){document.title=`screentest`;return}let t=Wg(e.path),r=e.branch?` @${e.branch}`:``;document.title=`${t}${r} — screentest`},[n?.project]),(0,_.useEffect)(()=>{if(n)return Vg({doc:n,expectedUrlFor:e=>Su.getState().expectedUrlFor(e),onStale:e=>X.getState().markStale(e)})},[n]),Hg(),t||!n&&!r&&!i?(0,N.jsxs)(`div`,{className:Ug.splash,children:[(0,N.jsx)(`div`,{className:Ug.spinner}),(0,N.jsx)(`div`,{children:`Loading…`})]}):i||r?(0,N.jsxs)(`div`,{className:Ug.splash,children:[(0,N.jsx)(`div`,{className:Ug.errorTitle,children:`Failed to load.`}),(0,N.jsx)(`div`,{className:Ug.errorMsg,children:i??r}),(0,N.jsx)(`button`,{className:Ug.retry,onClick:()=>{a(null),Su.getState().load().catch(e=>{a(e instanceof Error?e.message:String(e))})},children:`Retry`})]}):(0,N.jsxs)(`div`,{className:Ug.shell,children:[(0,N.jsx)(`aside`,{className:Ug.aside,children:(0,N.jsx)(Rg,{})}),(0,N.jsx)(`main`,{className:Ug.main,children:e.children})]})}function Kg(e){return new Worker(`/assets/pixelmatch.worker-BL1KzKED.js`,{type:`module`,name:e?.name})}var qg=class{worker=null;pending=new Map;counter=0;cache=new Map;inFlight=new Map;ensureWorker(){if(this.worker)return this.worker;let e=new Kg;return e.addEventListener(`message`,e=>{let t=e.data,n=this.pending.get(t.id);if(n)if(this.pending.delete(t.id),`error`in t)n.reject(Error(t.error));else{let e=new Uint8ClampedArray(t.buffer);if(t.width===0||t.height===0)n.resolve({width:0,height:0,imageData:new ImageData(1,1)});else{let r=new ImageData(e,t.width,t.height);n.resolve({width:t.width,height:t.height,imageData:r})}}}),this.worker=e,e}computeCached(e,t,n){let r=this.cache.get(e);if(r)return Promise.resolve(r);let i=this.inFlight.get(e);if(i)return i;let a=(async()=>{let[r,i]=await Promise.all([Jg(t),Jg(n)]),a=await this.run(r,i);return this.cache.set(e,a),a})();return this.inFlight.set(e,a),a.finally(()=>this.inFlight.delete(e)),a}run(e,t){return new Promise((n,r)=>{let i=String(++this.counter);this.pending.set(i,{id:i,resolve:n,reject:r});let a=this.ensureWorker(),o=[];e&&o.push(e),t&&o.push(t),a.postMessage({id:i,expected:e,actual:t},o)})}invalidate(e){this.cache.delete(e),this.inFlight.delete(e)}};async function Jg(e){if(!e)return null;let t=await fetch(e);if(!t.ok)return null;let n=await t.blob();return await createImageBitmap(n,{colorSpaceConversion:`none`})}var Yg=new qg,Xg={stageWrap:`_stageWrap_byixq_2`,canvas:`_canvas_byixq_21`,canvasInteractive:`_canvasInteractive_byixq_30`,canvasDragging:`_canvasDragging_byixq_34`,layer:`_layer_byixq_39`,hiddenProbe:`_hiddenProbe_byixq_49`,diffLayer:`_diffLayer_byixq_57`,sliderLine:`_sliderLine_byixq_65`,sliderHandle:`_sliderHandle_byixq_75`,plate:`_plate_byixq_88`},Zg={loaded:!1,error:!1,width:0,height:0};function Qg(e){let[t,n]=(0,_.useState)(Zg),[r,i]=(0,_.useState)(Zg),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=(0,_.useRef)(null),u=(0,_.useRef)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{n(Zg),i(Zg),o(null),c(!1)},[e.testId]);let f=Math.max(t.width,r.width),p=Math.max(t.height,r.height);(0,_.useEffect)(()=>{if(e.type!==`change`||!e.expectedUrl||!e.actualUrl||!t.loaded||!r.loaded)return;let n=!1,i=`${e.testId}::${e.expectedUrl}::${e.actualUrl}`;return Yg.computeCached(i,e.expectedUrl,e.actualUrl).then(e=>{n||o(e)}).catch(()=>{}),()=>{n=!0}},[e.type,e.testId,e.expectedUrl,e.actualUrl,t.loaded,r.loaded]),(0,_.useEffect)(()=>{let e=l.current;if(!e||!a||a.width===0)return;e.width!==a.width&&(e.width=a.width),e.height!==a.height&&(e.height=a.height);let t=e.getContext(`2d`);t&&t.putImageData(a.imageData,0,0)},[a,e.showDiff]),(0,_.useEffect)(()=>{if(e.type!==`change`)return;let t=u.current;if(!t)return;let n=t=>{if(!(t.metaKey||t.ctrlKey))return;t.preventDefault();let n=t.deltaY*(.05/100),r=Math.max(0,Math.min(1,e.sliderFrac+n));e.onSliderChange(r)};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[e.type,e.sliderFrac,e.onSliderChange]);let m=(0,_.useCallback)(t=>{let n=d.current;if(!n)return;let r=n.getBoundingClientRect();if(r.width===0)return;let i=t-r.left,a=Math.max(0,Math.min(1,i/r.width));e.onSliderChange(a)},[e.onSliderChange]);(0,_.useEffect)(()=>{if(!s)return;let e=e=>m(e.clientX),t=()=>c(!1);return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[s,m]);let h=(0,_.useCallback)(t=>{e.type===`change`&&t.button===0&&(t.preventDefault(),m(t.clientX),c(!0))},[e.type,m]),g=e=>{let t=e.currentTarget;n({loaded:!0,error:!1,width:t.naturalWidth,height:t.naturalHeight})},v=()=>{n({loaded:!1,error:!0,width:0,height:0}),X.getState().markStale(e.testId)},y=e=>{let t=e.currentTarget;i({loaded:!0,error:!1,width:t.naturalWidth,height:t.naturalHeight})},b=()=>{i({loaded:!1,error:!0,width:0,height:0})},x=Xg.canvas+(e.type===`change`?` ${Xg.canvasInteractive}`:``)+(s?` ${Xg.canvasDragging}`:``);return(0,N.jsxs)(`div`,{className:Xg.stageWrap,ref:u,children:[(0,N.jsxs)(`div`,{ref:d,className:x,style:f>0?{width:`${f}px`,height:`${p}px`}:void 0,onMouseDown:h,children:[e.type===`change`?(0,N.jsxs)(N.Fragment,{children:[e.expectedUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.expectedUrl,alt:`expected`,onLoad:g,onError:v,draggable:!1,style:{width:t.width||void 0,height:t.height||void 0}}):null,e.actualUrl&&r.loaded?(0,N.jsx)(`img`,{className:Xg.layer,src:e.actualUrl,alt:`actual`,onLoad:y,onError:b,draggable:!1,style:{width:r.width||void 0,height:r.height||void 0,clipPath:`inset(0 ${(1-e.sliderFrac)*100}% 0 0)`}}):e.actualUrl?(0,N.jsx)(`img`,{className:Xg.hiddenProbe,src:e.actualUrl,alt:``,onLoad:y,onError:b}):null,a&&a.width>0?(0,N.jsx)(`canvas`,{ref:l,className:Xg.diffLayer,style:{display:e.showDiff?`block`:`none`}}):null,f>0?(0,N.jsx)(`div`,{className:Xg.sliderLine,style:{left:`${e.sliderFrac*f}px`},"aria-hidden":!0,children:(0,N.jsx)(`div`,{className:Xg.sliderHandle})}):null]}):null,e.type===`new`&&e.actualUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.actualUrl,alt:`actual`,onLoad:y,onError:b,draggable:!1,style:{width:r.width||void 0,height:r.height||void 0}}):null,e.type===`deleted`&&e.expectedUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.expectedUrl,alt:`expected`,onLoad:g,onError:v,draggable:!1,style:{width:t.width||void 0,height:t.height||void 0}}):null]}),e.type===`new`?(0,N.jsx)(`div`,{className:Xg.plate,children:`New snapshot`}):null,e.type===`deleted`?(0,N.jsx)(`div`,{className:Xg.plate,children:e.stale?`Expected file was already missing in Cloudflare`:`This snapshot will be removed`}):null,e.type===`change`&&t.error?(0,N.jsx)(`div`,{className:Xg.plate,children:`Expected file is missing in Cloudflare`}):null,e.type===`change`&&r.error?(0,N.jsx)(`div`,{className:Xg.plate,children:`Actual file failed to load`}):null]})}var $g={root:`_root_j601s_1`,header:`_header_j601s_8`,spacer:`_spacer_j601s_18`,badges:`_badges_j601s_22`,badge:`_badge_j601s_22`,badgeNew:`_badgeNew_j601s_39`,badgeChange:`_badgeChange_j601s_45`,badgeStale:`_badgeStale_j601s_51`,badgeDeleted:`_badgeDeleted_j601s_57`,badgeDeletedStale:`_badgeDeletedStale_j601s_63`,badgeAccepted:`_badgeAccepted_j601s_69`,headerBtn:`_headerBtn_j601s_75`,acceptBtn:`_acceptBtn_j601s_92`,tip:`_tip_j601s_101`,spin:`_spin_j601s_113`};function e_(e){let{flat:t}=e,n=t.item.type,r=X(e=>e.staleIds.has(t.testId)),i=X(e=>e.acceptingIds.has(t.testId)),a=X(e=>e.acceptedIds.has(t.testId)),o=X(e=>e.acceptAllRunning),s=X(e=>e.showDiff),[c,l]=(0,_.useState)(.5),u=n!==`new`&&`expectedHash`in t.item&&t.item.expectedHash?Su.getState().expectedUrlFor(t.item.expectedHash):null,d=n===`deleted`?null:mu(t.testId);(0,_.useEffect)(()=>{l(.5)},[t.testId]);let f=!a&&!i&&!o&&(n===`new`||n===`change`&&!r||n===`deleted`),p=(0,_.useCallback)(async()=>{await rp(t.testId)},[t.testId]),m=n===`change`&&!r,h=(0,_.useCallback)(()=>{m&&X.getState().setShowDiff(!0)},[m]),g=(0,_.useCallback)(()=>{X.getState().setShowDiff(!1)},[]);(0,_.useEffect)(()=>{X.getState().setShowDiff(!1)},[t.testId]);let v=n===`deleted`?`Remove`:`Accept`,y=(0,_.useMemo)(()=>a?`Already accepted`:n===`change`&&r?`Expected snapshot is missing in Cloudflare`:o?`Accept all in progress`:i?n===`deleted`?`Removing…`:`Accepting…`:n===`deleted`?`Remove from snapshot`:`Accept`,[a,n,r,o,i]);return(0,N.jsxs)(`div`,{className:$g.root,children:[(0,N.jsxs)(`header`,{className:$g.header,children:[(0,N.jsx)(t_,{type:n,stale:r,accepted:a}),(0,N.jsx)(`div`,{className:$g.spacer}),n===`change`?(0,N.jsxs)(`button`,{className:$g.headerBtn,disabled:!m,onMouseDown:h,onMouseUp:g,onMouseLeave:g,onTouchStart:e=>{e.preventDefault(),h()},onTouchEnd:g,title:m?`Hold to show diff`:`Diff not available`,children:[(0,N.jsx)(Hu,{size:14}),(0,N.jsx)(`span`,{children:`Show diff`})]}):null,(0,N.jsxs)(Ag,{children:[(0,N.jsx)(jg,{asChild:!0,children:(0,N.jsxs)(`button`,{className:`${$g.headerBtn} ${$g.acceptBtn}`,disabled:!f,onClick:p,children:[i?(0,N.jsx)(Ru,{size:14,className:$g.spin}):(0,N.jsx)(Pu,{size:14}),(0,N.jsx)(`span`,{children:v})]})}),(0,N.jsx)(Mg,{children:(0,N.jsx)(Ng,{className:$g.tip,side:`bottom`,sideOffset:4,children:y})})]})]}),(0,N.jsx)(Qg,{testId:t.testId,type:n,stale:r,expectedUrl:u,actualUrl:d,sliderFrac:c,onSliderChange:l,showDiff:s&&m})]})}function t_(e){let t=e.type.toUpperCase(),n=e.type===`new`?$g.badgeNew:e.type===`change`?e.stale?$g.badgeStale:$g.badgeChange:e.stale?$g.badgeDeletedStale:$g.badgeDeleted;return(0,N.jsxs)(`div`,{className:$g.badges,children:[(0,N.jsx)(`span`,{className:`${$g.badge} ${n}`,children:t}),e.stale?(0,N.jsx)(`span`,{className:`${$g.badge} ${$g.badgeStale}`,children:`STALE`}):null,e.accepted?(0,N.jsx)(`span`,{className:`${$g.badge} ${$g.badgeAccepted}`,children:`ACCEPTED`}):null]})}var n_={notFound:`_notFound_15r13_1`};function r_(){let{testId:e}=or({strict:!1}),t=uu(e),n=Su(e=>e.flat)[t];return(0,_.useEffect)(()=>{X.getState().setSelected(t);let e=n?.parents??[],r=[];for(let t=0;t<e.length;t++)r.push(e.slice(0,t+1).join(`/`)+`/`);r.length>0&&X.getState().expandPath(r)},[t,n]),n?(0,N.jsx)(e_,{flat:n}):(0,N.jsxs)(`div`,{className:n_.notFound,children:[`Test "`,t,`" not found.`]})}var i_={empty:`_empty_19hhh_1`};function a_(){let e=cr(),t=Su(e=>e.doc);if((0,_.useEffect)(()=>{if(!t)return;let n=Wu().pendingIdsOrdered[0];n&&e({to:`/test/$testId`,params:{testId:lu(n)}})},[t,X(e=>e.acceptedIds),e]),!t)return(0,N.jsx)(N.Fragment,{});let n=Wu();return n.counts.pending===0&&n.counts.accepted===0?(0,N.jsx)(`div`,{className:i_.empty,children:`No tests to review.`}):n.counts.pending===0&&n.counts.accepted>0?(0,N.jsx)(`div`,{className:i_.empty,children:`All tests reviewed. Nice.`}):(0,N.jsx)(`div`,{className:i_.empty,children:`Select a test in the sidebar.`})}var o_=Dr({component:()=>(0,N.jsx)(Gg,{children:(0,N.jsx)(Ir,{})})}),s_=Tr({getParentRoute:()=>o_,path:`/`,component:a_}),c_=Tr({getParentRoute:()=>o_,path:`/test/$testId`,component:r_}),l_=Vr({routeTree:o_.addChildren([s_,c_])});(0,eu.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(_.StrictMode,{children:(0,N.jsxs)(Kf,{swipeDirection:`right`,duration:5e3,children:[(0,N.jsx)(kg,{delayDuration:200,children:(0,N.jsx)(Wr,{router:l_})}),(0,N.jsx)(tp,{})]})})),window.addEventListener(`pagehide`,()=>{try{navigator.sendBeacon(`/api/shutdown`)}catch{}});
72
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Qs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:tc(t,`input`,e.processors),output:tc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $s(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return $s(r.element,n);if(r.type===`set`)return $s(r.valueType,n);if(r.type===`lazy`)return $s(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return $s(r.innerType,n);if(r.type===`intersection`)return $s(r.left,n)||$s(r.right,n);if(r.type===`record`||r.type===`map`)return $s(r.keyType,n)||$s(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$s(r.in,n)||$s(r.out,n);if(r.type===`object`){for(let e in r.shape)if($s(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($s(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($s(e,n))return!0;return!!(r.rest&&$s(r.rest,n))}return!1}var ec=(e,t={})=>n=>{let r=Ys({...n,processors:t});return Xs(e,r),Zs(r,e),Qs(r,e)},tc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ys({...i??{},target:a,io:t,processors:n});return Xs(e,o),Zs(o,e),Qs(o,e)},nc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},rc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=nc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ic=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ac=(e,t,n,r)=>{n.not={}},oc=(e,t,n,r)=>{let i=e._zod.def,a=ni(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},sc=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},cc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},lc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},uc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Xs(a.element,t,{...r,path:[...r.path,`items`]})},dc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Xs(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Xs(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},fc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Xs(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},pc=(e,t,n,r)=>{let i=e._zod.def,a=Xs(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Xs(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},mc=(e,t,n,r)=>{let i=e._zod.def,a=Xs(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},hc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_c=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},vc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},yc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Xs(o,t,r);let s=t.seen.get(e);s.ref=o},bc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xc=(e,t,n,r)=>{let i=e._zod.def;Xs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sc=(e,t,n,r)=>{let i=e._zod.innerType;Xs(i,t,r);let a=t.seen.get(e);a.ref=i},Cc=F(`ZodISODateTime`,(e,t)=>{eo.init(e,t),W.init(e,t)});function wc(e){return Cs(Cc,e)}var Tc=F(`ZodISODate`,(e,t)=>{to.init(e,t),W.init(e,t)});function Ec(e){return ws(Tc,e)}var Dc=F(`ZodISOTime`,(e,t)=>{no.init(e,t),W.init(e,t)});function Oc(e){return Ts(Dc,e)}var kc=F(`ZodISODuration`,(e,t)=>{ro.init(e,t),W.init(e,t)});function Ac(e){return Es(kc,e)}var jc=F(`ZodError`,(e,t)=>{z.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Li(e,t)},flatten:{value:t=>Ii(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ri,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ri,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Mc=Ri(jc),Nc=zi(jc),Pc=Bi(jc),Fc=Hi(jc),Ic=Wi(jc),Lc=Gi(jc),Rc=Ki(jc),U=qi(jc),zc=Ji(jc),Bc=Yi(jc),Vc=Xi(jc),Hc=Zi(jc),Uc=new WeakMap;function Wc(e,t,n){let r=Object.getPrototypeOf(e),i=Uc.get(r);if(i||(i=new Set,Uc.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Gc=F(`ZodType`,(e,t)=>(Va.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:tc(e,`input`),output:tc(e,`output`)}}),e.toJSONSchema=ec(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Mc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pc(e,t,n),e.parseAsync=async(t,n)=>Nc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Fc(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ic(e,t,n),e.decode=(t,n)=>Lc(e,t,n),e.encodeAsync=async(t,n)=>Rc(e,t,n),e.decodeAsync=async(t,n)=>U(e,t,n),e.safeEncode=(t,n)=>zc(e,t,n),e.safeDecode=(t,n)=>Bc(e,t,n),e.safeEncodeAsync=async(t,n)=>Vc(e,t,n),e.safeDecodeAsync=async(t,n)=>Hc(e,t,n),Wc(e,`ZodType`,{check(...e){let t=this.def;return this.clone(li(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return yi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ql(e,t))},superRefine(e,t){return this.check($l(e,t))},overwrite(e){return this.check(zs(e))},optional(){return Ll(this)},exactOptional(){return zl(this)},nullable(){return K(this)},nullish(){return Ll(K(this))},nonoptional(e){return Hl(this,e)},array(){return xl(this)},or(e){return Tl([this,e])},and(e){return kl(this,e)},transform(e){return Kl(this,Fl(e))},default(e){return J(this,e)},prefault(e){return Bl(this,e)},catch(e){return Wl(this,e)},pipe(e){return Kl(this,e)},readonly(){return Jl(this)},describe(e){let t=this.clone();return $o.add(t,{description:e}),t},meta(...e){if(e.length===0)return $o.get(this);let t=this.clone();return $o.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return $o.get(e)?.description},configurable:!0}),e)),Kc=F(`_ZodString`,(e,t)=>{Ha.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Wc(e,`_ZodString`,{regex(...e){return this.check(Ns(...e))},includes(...e){return this.check(Is(...e))},startsWith(...e){return this.check(Ls(...e))},endsWith(...e){return this.check(Rs(...e))},min(...e){return this.check(js(...e))},max(...e){return this.check(As(...e))},length(...e){return this.check(Ms(...e))},nonempty(...e){return this.check(js(1,...e))},lowercase(e){return this.check(Ps(e))},uppercase(e){return this.check(Fs(e))},trim(){return this.check(Vs())},normalize(...e){return this.check(Bs(...e))},toLowerCase(){return this.check(Hs())},toUpperCase(){return this.check(Us())},slugify(){return this.check(Ws())}})}),qc=F(`ZodString`,(e,t)=>{Ha.init(e,t),Kc.init(e,t),e.email=t=>e.check(ts(Yc,t)),e.url=t=>e.check(ss(Qc,t)),e.jwt=t=>e.check(Ss(pl,t)),e.emoji=t=>e.check(cs($c,t)),e.guid=t=>e.check(ns(Xc,t)),e.uuid=t=>e.check(rs(Zc,t)),e.uuidv4=t=>e.check(is(Zc,t)),e.uuidv6=t=>e.check(as(Zc,t)),e.uuidv7=t=>e.check(os(Zc,t)),e.nanoid=t=>e.check(ls(el,t)),e.guid=t=>e.check(ns(Xc,t)),e.cuid=t=>e.check(us(tl,t)),e.cuid2=t=>e.check(ds(nl,t)),e.ulid=t=>e.check(fs(rl,t)),e.base64=t=>e.check(ys(ul,t)),e.base64url=t=>e.check(bs(dl,t)),e.xid=t=>e.check(ps(il,t)),e.ksuid=t=>e.check(ms(al,t)),e.ipv4=t=>e.check(hs(ol,t)),e.ipv6=t=>e.check(gs(sl,t)),e.cidrv4=t=>e.check(_s(cl,t)),e.cidrv6=t=>e.check(vs(ll,t)),e.e164=t=>e.check(xs(fl,t)),e.datetime=t=>e.check(wc(t)),e.date=t=>e.check(Ec(t)),e.time=t=>e.check(Oc(t)),e.duration=t=>e.check(Ac(t))});function Jc(e){return es(qc,e)}var W=F(`ZodStringFormat`,(e,t)=>{B.init(e,t),Kc.init(e,t)}),Yc=F(`ZodEmail`,(e,t)=>{Ga.init(e,t),W.init(e,t)}),Xc=F(`ZodGUID`,(e,t)=>{Ua.init(e,t),W.init(e,t)}),Zc=F(`ZodUUID`,(e,t)=>{Wa.init(e,t),W.init(e,t)}),Qc=F(`ZodURL`,(e,t)=>{Ka.init(e,t),W.init(e,t)}),$c=F(`ZodEmoji`,(e,t)=>{qa.init(e,t),W.init(e,t)}),el=F(`ZodNanoID`,(e,t)=>{Ja.init(e,t),W.init(e,t)}),tl=F(`ZodCUID`,(e,t)=>{Ya.init(e,t),W.init(e,t)}),nl=F(`ZodCUID2`,(e,t)=>{Xa.init(e,t),W.init(e,t)}),rl=F(`ZodULID`,(e,t)=>{Za.init(e,t),W.init(e,t)}),il=F(`ZodXID`,(e,t)=>{Qa.init(e,t),W.init(e,t)}),al=F(`ZodKSUID`,(e,t)=>{$a.init(e,t),W.init(e,t)}),ol=F(`ZodIPv4`,(e,t)=>{io.init(e,t),W.init(e,t)}),sl=F(`ZodIPv6`,(e,t)=>{ao.init(e,t),W.init(e,t)}),cl=F(`ZodCIDRv4`,(e,t)=>{oo.init(e,t),W.init(e,t)}),ll=F(`ZodCIDRv6`,(e,t)=>{so.init(e,t),W.init(e,t)}),ul=F(`ZodBase64`,(e,t)=>{lo.init(e,t),W.init(e,t)}),dl=F(`ZodBase64URL`,(e,t)=>{fo.init(e,t),W.init(e,t)}),fl=F(`ZodE164`,(e,t)=>{V.init(e,t),W.init(e,t)}),pl=F(`ZodJWT`,(e,t)=>{po.init(e,t),W.init(e,t)}),ml=F(`ZodNull`,(e,t)=>{mo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r)});function hl(e){return Ds(ml,e)}var gl=F(`ZodUnknown`,(e,t)=>{ho.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function _l(){return Os(gl)}var vl=F(`ZodNever`,(e,t)=>{go.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r)});function yl(e){return ks(vl,e)}var bl=F(`ZodArray`,(e,t)=>{vo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r),e.element=t.element,Wc(e,`ZodArray`,{min(e,t){return this.check(js(e,t))},nonempty(e){return this.check(js(1,e))},max(e,t){return this.check(As(e,t))},length(e,t){return this.check(Ms(e,t))},unwrap(){return this.element}})});function xl(e,t){return Gs(bl,e,t)}var Sl=F(`ZodObject`,(e,t)=>{Co.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dc(e,t,n,r),I(e,`shape`,()=>t.shape),Wc(e,`ZodObject`,{keyof(){return jl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:_l()})},loose(){return this.clone({...this._zod.def,catchall:_l()})},strict(){return this.clone({...this._zod.def,catchall:yl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Ci(this,e)},safeExtend(e){return wi(this,e)},merge(e){return Ti(this,e)},pick(e){return xi(this,e)},omit(e){return Si(this,e)},partial(...e){return Ei(Il,this,e[0])},required(...e){return Di(Vl,this,e[0])}})});function Cl(e,t){return new Sl({type:`object`,shape:e??{},...L(t)})}var wl=F(`ZodUnion`,(e,t)=>{To.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fc(e,t,n,r),e.options=t.options});function Tl(e,t){return new wl({type:`union`,options:e,...L(t)})}var El=F(`ZodDiscriminatedUnion`,(e,t)=>{wl.init(e,t),Eo.init(e,t)});function Dl(e,t,n){return new El({type:`union`,options:t,discriminator:e,...L(n)})}var Ol=F(`ZodIntersection`,(e,t)=>{Do.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pc(e,t,n,r)});function kl(e,t){return new Ol({type:`intersection`,left:e,right:t})}var Al=F(`ZodEnum`,(e,t)=>{Ao.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Al({...t,checks:[],...L(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Al({...t,checks:[],...L(r),entries:i})}});function jl(e,t){return new Al({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var Ml=F(`ZodLiteral`,(e,t)=>{jo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Nl(e,t){return new Ml({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var Pl=F(`ZodTransform`,(e,t)=>{Mo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Fl(e){return new Pl({type:`transform`,transform:e})}var Il=F(`ZodOptional`,(e,t)=>{Po.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ll(e){return new Il({type:`optional`,innerType:e})}var Rl=F(`ZodExactOptional`,(e,t)=>{Fo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zl(e){return new Rl({type:`optional`,innerType:e})}var G=F(`ZodNullable`,(e,t)=>{Io.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function K(e){return new G({type:`nullable`,innerType:e})}var q=F(`ZodDefault`,(e,t)=>{Lo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function J(e,t){return new q({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var Y=F(`ZodPrefault`,(e,t)=>{zo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bl(e,t){return new Y({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var Vl=F(`ZodNonOptional`,(e,t)=>{Bo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hl(e,t){return new Vl({type:`nonoptional`,innerType:e,...L(t)})}var Ul=F(`ZodCatch`,(e,t)=>{Ho.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Wl(e,t){return new Ul({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Gl=F(`ZodPipe`,(e,t)=>{Uo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r),e.in=t.in,e.out=t.out});function Kl(e,t){return new Gl({type:`pipe`,in:e,out:t})}var ql=F(`ZodReadonly`,(e,t)=>{Go.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jl(e){return new ql({type:`readonly`,innerType:e})}var Yl=F(`ZodLazy`,(e,t)=>{qo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Xl(e){return new Yl({type:`lazy`,getter:e})}var Zl=F(`ZodCustom`,(e,t)=>{Jo.init(e,t),Gc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r)});function Ql(e,t={}){return Ks(Zl,e,t)}function $l(e,t){return qs(e,t)}var eu=g(),tu=Dl(`type`,[Cl({name:Jc().min(1),type:Nl(`new`),actualFilename:Jc().min(1),patchSnapshotJsonFile:Jc().min(1)}),Cl({name:Jc().min(1),type:Nl(`change`),expectedHash:Jc().regex(/^[a-f0-9]{64}$/i),actualFilename:Jc().min(1),patchSnapshotJsonFile:Jc().min(1)}),Cl({name:Jc().min(1),type:Nl(`deleted`),expectedHash:Jc().regex(/^[a-f0-9]{64}$/i),patchSnapshotJsonFile:Jc().min(1)})]),nu=Xl(()=>Cl({name:Jc().min(1),items:xl(Tl([nu,tu])).min(0)})),ru=Cl({project:Cl({path:Jc(),branch:Jc().nullable()}).optional(),groups:xl(nu)}),iu=Cl({name:Jc().min(1),hash:Tl([Jc().regex(/^[a-f0-9]{64}$/i),hl()])}),au=Xl(()=>Cl({name:Jc().min(1),items:xl(Tl([au,iu]))}));Cl({groups:xl(au)});var ou=Cl({doc:ru,expectedUrlPattern:Jc(),workerUrl:Jc(),serverVersion:Jc()});Cl({testId:Jc().min(1)});var su=Cl({hash:Jc().regex(/^[a-f0-9]{64}$/i).optional(),url:Jc().optional()});Cl({error:Jc()});function cu(e,t){return[...e,t].join(`/`)}function lu(e){return encodeURIComponent(e)}function uu(e){return decodeURIComponent(e)}async function du(e,t){let n=null,r=``;try{r=await e.text(),n=r?JSON.parse(r):null}catch{throw e.ok?Error(`Invalid JSON in server response`):Error(`HTTP ${e.status} ${e.statusText}: ${r.slice(0,200)}`)}if(!e.ok){let t=n&&typeof n==`object`&&`error`in n?String(n.error):`HTTP ${e.status} ${e.statusText}`;throw Error(t)}return t(n)}async function fu(){return du(await fetch(`/api/doc`,{method:`GET`}),e=>ou.parse(e))}async function pu(e){return du(await fetch(`/api/accept`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({testId:e})}),e=>su.parse(e))}function mu(e){return`/api/actual?testId=${encodeURIComponent(e)}`}function hu(e,t){return[...e,t].join(`/`)+`/`}function gu(e){let t={},n=(e,r)=>{for(let i of e)if(`items`in i)n(i.items,[...r,i.name]);else{let e=cu(r,i.name);t[e]={testId:e,parents:[...r],name:i.name,item:i}}};for(let t of e.groups)n(t.items,[t.name]);return t}function _u(e,t){let n=(e,r)=>{let i=[];for(let a of e)if(`items`in a){let e=n(a.items,[...r,a.name]);e.length>0&&i.push({kind:`group`,name:a.name,parents:[...r],items:e})}else{let e=cu(r,a.name);t(e,a)&&i.push({kind:`test`,testId:e,parents:[...r],item:a})}return i},r=[];for(let t of e.groups){let e=n(t.items,[t.name]);e.length>0&&r.push({kind:`group`,name:t.name,parents:[],items:e})}return r}function vu(e,t){for(let n of e)n.kind===`group`?vu(n.items,t):t(n)}var yu=`screentest:expandedGroups:v1`;function bu(){try{let e=localStorage.getItem(yu);if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set}function xu(e){try{localStorage.setItem(yu,JSON.stringify([...e]))}catch{}}var X=Xr((e,t)=>({selectedTestId:null,expandedGroups:bu(),acceptedIds:new Set,staleIds:new Set,acceptingIds:new Set,showDiff:!1,acceptAllRunning:!1,acceptAllCancel:!1,acceptAllTotal:0,acceptAllDone:0,setSelected(t){e({selectedTestId:t})},toggleGroup(n){let r=t().expandedGroups,i=new Set(r);i.has(n)?i.delete(n):i.add(n),xu(i),e({expandedGroups:i})},setExpanded(n,r){let i=t().expandedGroups;if(r&&i.has(n)||!r&&!i.has(n))return;let a=new Set(i);r?a.add(n):a.delete(n),xu(a),e({expandedGroups:a})},expandPath(n){let r=t().expandedGroups,i=!1,a=new Set(r);for(let e of n)a.has(e)||(a.add(e),i=!0);i&&(xu(a),e({expandedGroups:a}))},markAccepted(n){let r=new Set(t().acceptedIds);r.add(n),e({acceptedIds:r})},markStale(n){if(t().staleIds.has(n))return;let r=new Set(t().staleIds);r.add(n),e({staleIds:r})},markAccepting(n,r){let i=t().acceptingIds;if(r&&i.has(n)||!r&&!i.has(n))return;let a=new Set(i);r?a.add(n):a.delete(n),e({acceptingIds:a})},setShowDiff(n){t().showDiff!==n&&e({showDiff:n})},setAcceptAllRunning(t){e({acceptAllRunning:t})},setAcceptAllCancel(t){e({acceptAllCancel:t})},setAcceptAllProgress(t,n){e({acceptAllDone:t,acceptAllTotal:n})}})),Su=Xr((e,t)=>({doc:null,flat:{},expectedUrlPattern:``,workerUrl:``,serverVersion:``,loading:!1,error:null,async load(){e({loading:!0,error:null});try{let t=await fu();e({doc:t.doc,flat:gu(t.doc),expectedUrlPattern:t.expectedUrlPattern,workerUrl:t.workerUrl,serverVersion:t.serverVersion,loading:!1})}catch(t){throw e({loading:!1,error:t instanceof Error?t.message:String(t)}),t}},async accept(e){let t=X.getState();if(t.acceptingIds.has(e))return{ok:!1,error:`Already in flight`};if(t.acceptedIds.has(e))return{ok:!0};X.getState().markAccepting(e,!0);try{return await pu(e),X.getState().markAccepted(e),X.getState().markAccepting(e,!1),{ok:!0}}catch(t){return X.getState().markAccepting(e,!1),{ok:!1,error:t instanceof Error?t.message:String(t)}}},expectedUrlFor(e){let{expectedUrlPattern:n}=t();return n.replace(`{hash}`,e)}})),Cu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),wu=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Tu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Eu=e=>{let t=Tu(e);return t.charAt(0).toUpperCase()+t.slice(1)},Du={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ou=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ku=(0,_.createContext)({}),Au=()=>(0,_.useContext)(ku),ju=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Au()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...Du,width:t??l??Du.width,height:t??l??Du.height,stroke:e??f,strokeWidth:m,className:Cu(`lucide`,p,i),...!a&&!Ou(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Mu=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(ju,{ref:i,iconNode:t,className:Cu(`lucide-${wu(Eu(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Eu(e),n},Nu=Mu(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Pu=Mu(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Fu=Mu(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Iu=Mu(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Lu=Mu(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ru=Mu(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),zu=Mu(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Bu=Mu(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Vu=Mu(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Hu=Mu(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Uu=Mu(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Wu(){let e=Su.getState().doc,t=X.getState();if(!e)return{pending:[],accepted:[],pendingIdsOrdered:[],counts:{pending:0,accepted:0,stale:0}};let n=_u(e,e=>!t.acceptedIds.has(e)),r=_u(e,e=>t.acceptedIds.has(e)),i=[];vu(n,e=>i.push(e.testId));let a=0;vu(n,e=>{t.staleIds.has(e.testId)&&a++});let o=0;vu(n,()=>o++);let s=0;return vu(r,()=>s++),{pending:n,accepted:r,pendingIdsOrdered:i,counts:{pending:o,accepted:s,stale:a}}}function Z(e){if(e.kind===`test`)return+!!X.getState().staleIds.has(e.testId);let t=0;for(let n of e.items)t+=Z(n);return t}function Gu(e){let t=X.getState(),n=_u(e,(e,n)=>!(t.acceptedIds.has(e)||n.type===`change`&&t.staleIds.has(e))),r=[];return vu(n,e=>r.push(e.testId)),r}typeof window<`u`&&window.document&&window.document.createElement;function Ku(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function qu(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,N.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ju(i,...t)]}function Ju(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Yu=globalThis?.document?_.useLayoutEffect:()=>{},Xu=_.useInsertionEffect||Yu;function Zu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Qu({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=$u(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Qu({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Xu(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function $u(e){return typeof e==`function`}function ed(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function td(...e){return t=>{let n=!1,r=e.map(e=>{let r=ed(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ed(e[t],null)}}}}function nd(...e){return _.useCallback(td(...e),e)}function rd(e){let t=id(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(sd);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,N.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,N.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function id(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ld(n),i=cd(r,n.props);return n.type!==_.Fragment&&(i.ref=t?td(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ad=Symbol(`radix.slottable`);function od(e){let t=({children:e})=>(0,N.jsx)(N.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=ad,t}function sd(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ad}function cd(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ld(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ud=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=rd(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,N.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dd(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function fd(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var pd=e=>{let{present:t,children:n}=e,r=md(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=nd(r.ref,gd(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};pd.displayName=`Presence`;function md(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=fd(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=hd(r.current);a.current=o===`mounted`?e:`none`},[o]),Yu(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=hd(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Yu(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=hd(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=hd(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function hd(e){return e?.animationName||`none`}function gd(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _d=_.useId||(()=>void 0),vd=0;function yd(e){let[t,n]=_.useState(_d());return Yu(()=>{e||n(e=>e??String(vd++))},[e]),e||(t?`radix-${t}`:``)}var Q=`Collapsible`,[bd,xd]=qu(Q),[Sd,Cd]=bd(Q),wd=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Zu({prop:r,defaultProp:i??!1,onChange:o,caller:Q});return(0,N.jsx)(Sd,{scope:n,disabled:a,contentId:yd(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,N.jsx)(ud.div,{"data-state":Ad(c),"data-disabled":a?``:void 0,...s,ref:t})})});wd.displayName=Q;var Td=`CollapsibleTrigger`,Ed=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Cd(Td,n);return(0,N.jsx)(ud.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ad(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Ku(e.onClick,i.onOpenToggle)})});Ed.displayName=Td;var Dd=`CollapsibleContent`,Od=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Cd(Dd,e.__scopeCollapsible);return(0,N.jsx)(pd,{present:n||i.open,children:({present:e})=>(0,N.jsx)(kd,{...r,ref:t,present:e})})});Od.displayName=Dd;var kd=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Cd(Dd,n),[s,c]=_.useState(r),l=_.useRef(null),u=nd(t,l),d=_.useRef(0),f=d.current,p=_.useRef(0),m=p.current,h=o.open||s,g=_.useRef(h),v=_.useRef(void 0);return _.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Yu(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,N.jsx)(ud.div,{"data-state":Ad(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Ad(e){return e?`open`:`closed`}var jd=wd,Md=Ed,$=Od;function Nd(e){let t=e+`CollectionProvider`,[n,r]=qu(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,N.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=rd(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,N.jsx)(c,{ref:nd(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=rd(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=nd(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,N.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}function Pd(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...e)=>t.current?.(...e),[])}function Fd(e,t=globalThis?.document){let n=Pd(e);_.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Id=`DismissableLayer`,Ld=`dismissableLayer.update`,Rd=`dismissableLayer.pointerDownOutside`,zd=`dismissableLayer.focusOutside`,Bd,Vd=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=_.useContext(Vd),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=_.useState({}),m=nd(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Gd(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Kd(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Fd(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Bd=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),qd(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Bd)}},[u,f,n,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),qd())},[u,l]),_.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ld,e),()=>document.removeEventListener(Ld,e)},[]),(0,N.jsx)(ud.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Ku(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ku(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ku(e.onPointerDownCapture,S.onPointerDownCapture)})});Hd.displayName=Id;var Ud=`DismissableLayerBranch`,Wd=_.forwardRef((e,t)=>{let n=_.useContext(Vd),r=_.useRef(null),i=nd(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,N.jsx)(ud.div,{...e,ref:i})});Wd.displayName=Ud;function Gd(e,t=globalThis?.document){let n=Pd(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Jd(Rd,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Kd(e,t=globalThis?.document){let n=Pd(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&Jd(zd,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qd(){let e=new CustomEvent(Ld);document.dispatchEvent(e)}function Jd(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dd(i,a):i.dispatchEvent(a)}var Yd=Hd,Xd=Wd,Zd=`Portal`,Qd=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);Yu(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ur.createPortal((0,N.jsx)(ud.div,{...r,ref:t}),o):null});Qd.displayName=Zd;var $d=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ef=`VisuallyHidden`,tf=_.forwardRef((e,t)=>(0,N.jsx)(ud.span,{...e,ref:t,style:{...$d,...e.style}}));tf.displayName=ef;var nf=tf,rf=`ToastProvider`,[af,of,sf]=Nd(`Toast`),[cf,lf]=qu(`Toast`,[sf]),[uf,df]=cf(rf),ff=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=_.useState(null),[l,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${rf}\`. Expected non-empty \`string\`.`),(0,N.jsx)(af.Provider,{scope:t,children:(0,N.jsx)(uf,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:_.useCallback(()=>u(e=>e+1),[]),onToastRemove:_.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};ff.displayName=rf;var pf=`ToastViewport`,mf=[`F8`],hf=`toast.viewportPause`,gf=`toast.viewportResume`,_f=_.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=mf,label:i=`Notifications ({hotkey})`,...a}=e,o=df(pf,n),s=of(n),c=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=nd(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;_.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),_.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(hf);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(gf);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=_.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Wf(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return _.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Gf(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,N.jsxs)(Xd,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,N.jsx)(yf,{ref:l,onFocusFromOutsideViewport:()=>{Gf(h({tabbingDirection:`forwards`}))}}),(0,N.jsx)(af.Slot,{scope:n,children:(0,N.jsx)(ud.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,N.jsx)(yf,{ref:u,onFocusFromOutsideViewport:()=>{Gf(h({tabbingDirection:`backwards`}))}})]})});_f.displayName=pf;var vf=`ToastFocusProxy`,yf=_.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=df(vf,n);return(0,N.jsx)(tf,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});yf.displayName=vf;var bf=`Toast`,xf=`toast.swipeStart`,Sf=`toast.swipeMove`,Cf=`toast.swipeCancel`,wf=`toast.swipeEnd`,Tf=_.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Zu({prop:r,defaultProp:i??!0,onChange:a,caller:bf});return(0,N.jsx)(pd,{present:n||s,children:(0,N.jsx)(Of,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Pd(e.onPause),onResume:Pd(e.onResume),onSwipeStart:Ku(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Ku(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Ku(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Ku(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Tf.displayName=bf;var[Ef,Df]=cf(bf,{onClose(){}}),Of=_.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=df(bf,n),[g,v]=_.useState(null),y=nd(t,e=>v(e)),b=_.useRef(null),x=_.useRef(null),S=i||h.duration,C=_.useRef(0),w=_.useRef(S),T=_.useRef(0),{onToastAdd:ee,onToastRemove:te}=h,E=Pd(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),D=_.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(E,e))},[E]);_.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{D(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(hf,n),e.addEventListener(gf,t),()=>{e.removeEventListener(hf,n),e.removeEventListener(gf,t)}}},[h.viewport,S,c,l,D]),_.useEffect(()=>{a&&!h.isClosePausedRef.current&&D(S)},[a,S,h.isClosePausedRef,D]),_.useEffect(()=>(ee(),()=>te()),[ee,te]);let O=_.useMemo(()=>g?zf(g):null,[g]);return h.viewport?(0,N.jsxs)(N.Fragment,{children:[O&&(0,N.jsx)(kf,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:O}),(0,N.jsx)(Ef,{scope:n,onClose:E,children:ur.createPortal((0,N.jsx)(af.ItemSlot,{scope:n,children:(0,N.jsx)(Yd,{asChild:!0,onEscapeKeyDown:Ku(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||E(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,N.jsx)(ud.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Ku(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:Ku(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:Ku(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Bf(Sf,d,f,{discrete:!1})):Vf(l,h.swipeDirection,c)?(x.current=l,Bf(xf,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:Ku(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Vf(t,h.swipeDirection,h.swipeThreshold)?Bf(wf,p,r,{discrete:!0}):Bf(Cf,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),kf=e=>{let{__scopeToast:t,children:n,...r}=e,i=df(bf,t),[a,o]=_.useState(!1),[s,c]=_.useState(!1);return Hf(()=>o(!0)),_.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,N.jsx)(Qd,{asChild:!0,children:(0,N.jsx)(tf,{...r,children:a&&(0,N.jsxs)(N.Fragment,{children:[i.label,` `,n]})})})},Af=`ToastTitle`,jf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(ud.div,{...r,ref:t})});jf.displayName=Af;var Mf=`ToastDescription`,Nf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,N.jsx)(ud.div,{...r,ref:t})});Nf.displayName=Mf;var Pf=`ToastAction`,Ff=_.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,N.jsx)(Rf,{altText:n,asChild:!0,children:(0,N.jsx)(Lf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Pf}\`. Expected non-empty \`string\`.`),null)});Ff.displayName=Pf;var If=`ToastClose`,Lf=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Df(If,n);return(0,N.jsx)(Rf,{asChild:!0,children:(0,N.jsx)(ud.button,{type:`button`,...r,ref:t,onClick:Ku(e.onClick,i.onClose)})})});Lf.displayName=If;var Rf=_.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,N.jsx)(ud.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function zf(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Uf(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...zf(e))}}),t}function Bf(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dd(i,a):i.dispatchEvent(a)}var Vf=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Hf(e=()=>{}){let t=Pd(e);Yu(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Uf(e){return e.nodeType===e.ELEMENT_NODE}function Wf(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Gf(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var Kf=ff,qf=_f,Jf=Tf,Yf=jf,Xf=Nf,Zf={viewport:`_viewport_1obvw_1`,toast:`_toast_1obvw_17`,slideIn:`_slideIn_1obvw_1`,fadeOut:`_fadeOut_1obvw_1`,error:`_error_1obvw_32`,success:`_success_1obvw_36`,info:`_info_1obvw_40`,title:`_title_1obvw_44`,desc:`_desc_1obvw_50`},Qf=new Set,$f=0;function ep(e){let t={id:++$f,...e};Qf.forEach(e=>e(t))}function tp(){let[e,t]=(0,_.useState)([]);return(0,_.useEffect)(()=>{let e=e=>{t(t=>[...t,e])};return Qf.add(e),()=>{Qf.delete(e)}},[]),(0,N.jsxs)(N.Fragment,{children:[e.map(e=>(0,N.jsxs)(Jf,{className:`${Zf.toast} ${e.tone?Zf[e.tone]:``}`,duration:5e3,onOpenChange:n=>{n||t(t=>t.filter(t=>t.id!==e.id))},children:[(0,N.jsx)(Yf,{className:Zf.title,children:e.title}),e.description?(0,N.jsx)(Xf,{className:Zf.desc,children:e.description}):null]},e.id)),(0,N.jsx)(qf,{className:Zf.viewport})]})}function np(e,t){let n=e.indexOf(t);return n===-1?e[0]??null:n+1<e.length?e[n+1]??null:n-1>=0?e[n-1]??null:null}async function rp(e){let t=Wu().pendingIdsOrdered,n=await Su.getState().accept(e);if(!n.ok){ep({title:`Accept failed`,description:n.error,tone:`error`});return}let r=np(t,e);r?l_.navigate({to:`/test/$testId`,params:{testId:lu(r)}}):l_.navigate({to:`/`})}var ip={tree:`_tree_4auq3_1`,groupLi:`_groupLi_4auq3_7`,leafLi:`_leafLi_4auq3_8`,group:`_group_4auq3_7`,leaf:`_leaf_4auq3_8`,chevron:`_chevron_4auq3_31`,chevronOpen:`_chevronOpen_4auq3_37`,groupName:`_groupName_4auq3_41`,leafName:`_leafName_4auq3_42`,staleBadge:`_staleBadge_4auq3_55`,leafSelected:`_leafSelected_4auq3_70`,icon:`_icon_4auq3_78`,acceptInline:`_acceptInline_4auq3_82`,toneGreen:`_toneGreen_4auq3_103`,toneYellow:`_toneYellow_4auq3_107`,toneOrange:`_toneOrange_4auq3_111`,toneRed:`_toneRed_4auq3_115`,toneRedDim:`_toneRedDim_4auq3_119`,toneBlueGrey:`_toneBlueGrey_4auq3_123`,toneAccent:`_toneAccent_4auq3_127`,spin:`_spin_4auq3_131`};function ap(e){return(0,N.jsx)(`ul`,{className:ip.tree,children:e.nodes.map(t=>(0,N.jsx)(sp,{node:t,kind:e.kind,depth:0},op(t)))})}function op(e){return e.kind===`group`?`g:`+hu(e.parents,e.name):`t:`+e.testId}function sp(e){return e.node.kind===`group`?(0,N.jsx)(cp,{node:e.node,kind:e.kind,depth:e.depth}):(0,N.jsx)(lp,{node:e.node,kind:e.kind,depth:e.depth})}function cp(e){let t=hu(e.node.parents,e.node.name),n=X(e=>e.expandedGroups.has(t)),r=e.kind===`pending`?Z(e.node):0;return(0,N.jsx)(`li`,{className:ip.groupLi,children:(0,N.jsxs)(jd,{open:n,onOpenChange:()=>X.getState().toggleGroup(t),children:[(0,N.jsx)(Md,{asChild:!0,children:(0,N.jsxs)(`button`,{className:ip.group,style:{paddingLeft:6+e.depth*12},children:[(0,N.jsx)(Fu,{size:12,className:`${ip.chevron} ${n?ip.chevronOpen:``}`}),(0,N.jsx)(`span`,{className:ip.groupName,children:e.node.name}),r>0?(0,N.jsx)(`span`,{className:ip.staleBadge,children:r}):null]})}),(0,N.jsx)($,{children:(0,N.jsx)(`ul`,{className:ip.tree,children:e.node.items.map(t=>(0,N.jsx)(sp,{node:t,kind:e.kind,depth:e.depth+1},op(t)))})})]})})}function lp(e){let t=cr(),n=X(t=>t.selectedTestId===e.node.testId),r=X(t=>t.staleIds.has(e.node.testId)),i=X(t=>t.acceptingIds.has(e.node.testId)),a=e.kind===`accepted`,o=X(e=>e.acceptAllRunning),s=e.node.item.type,{Icon:c,toneClass:l,label:u}=up(s,r,a,i),d=!a&&!i&&!o&&(s===`new`||s===`change`&&!r||s===`deleted`);return(0,N.jsx)(`li`,{className:ip.leafLi,children:(0,N.jsxs)(`button`,{className:`${ip.leaf} ${n?ip.leafSelected:``}`,style:{paddingLeft:6+e.depth*12},title:u,onClick:()=>t({to:`/test/$testId`,params:{testId:lu(e.node.testId)}}),children:[(0,N.jsx)(c,{size:13,className:`${ip.icon} ${l}`}),(0,N.jsx)(`span`,{className:ip.leafName,children:e.node.item.name}),d?(0,N.jsx)(`span`,{className:ip.acceptInline,onClick:async t=>{t.stopPropagation(),await rp(e.node.testId)},role:`button`,"aria-label":`Accept`,children:(0,N.jsx)(Pu,{size:12})}):null]})})}function up(e,t,n,r){return r?{Icon:Ru,toneClass:`${ip.toneAccent} ${ip.spin}`,label:`Accepting…`}:n?{Icon:Pu,toneClass:ip.toneBlueGrey,label:`Accepted`}:e===`new`?{Icon:Vu,toneClass:ip.toneGreen,label:`New`}:e===`change`?t?{Icon:Uu,toneClass:ip.toneOrange,label:`Change (stale)`}:{Icon:Bu,toneClass:ip.toneYellow,label:`Change`}:t?{Icon:Uu,toneClass:ip.toneRedDim,label:`Deleted (stale)`}:{Icon:zu,toneClass:ip.toneRed,label:`Deleted`}}var dp=[`top`,`right`,`bottom`,`left`],fp=Math.min,pp=Math.max,mp=Math.round,hp=Math.floor,gp=e=>({x:e,y:e}),_p={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vp(e,t,n){return pp(e,fp(t,n))}function yp(e,t){return typeof e==`function`?e(t):e}function bp(e){return e.split(`-`)[0]}function xp(e){return e.split(`-`)[1]}function Sp(e){return e===`x`?`y`:`x`}function Cp(e){return e===`y`?`height`:`width`}function wp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Tp(e){return Sp(wp(e))}function Ep(e,t,n){n===void 0&&(n=!1);let r=xp(e),i=Tp(e),a=Cp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fp(o)),[o,Fp(o)]}function Dp(e){let t=Fp(e);return[Op(e),t,Op(t)]}function Op(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kp=[`left`,`right`],Ap=[`right`,`left`],jp=[`top`,`bottom`],Mp=[`bottom`,`top`];function Np(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ap:kp:t?kp:Ap;case`left`:case`right`:return t?jp:Mp;default:return[]}}function Pp(e,t,n,r){let i=xp(e),a=Np(bp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Op)))),a}function Fp(e){let t=bp(e);return _p[t]+e.slice(t.length)}function Ip(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ip(e)}function Rp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zp(e,t,n){let{reference:r,floating:i}=e,a=wp(t),o=Tp(t),s=Cp(o),c=bp(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(xp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Bp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=yp(t,e),p=Lp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Rp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Rp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Vp=50,Hp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Bp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zp(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Vp&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Up=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=yp(e,t)||{};if(l==null)return{};let d=Lp(u),f={x:n,y:r},p=Tp(i),m=Cp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=fp(d[_],T),te=fp(d[v],T),E=ee,D=C-h[m]-te,O=C/2-h[m]/2+w,ne=vp(E,O,D),re=!c.arrow&&xp(i)!=null&&O!==ne&&a.reference[m]/2-(O<E?ee:te)-h[m]/2<0,ie=re?O<E?O-E:O-D:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:O-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),Wp=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=yp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bp(r),_=wp(o),v=bp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fp(o)]:Dp(o)),x=p!==`none`;!d&&x&&b.push(...Pp(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ep(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==wp(t))||T.every(e=>wp(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=wp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Gp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kp(e){return dp.some(t=>e[t]>=0)}var qp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=yp(e,t);switch(i){case`referenceHidden`:{let e=Gp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Kp(e)}}}case`escaped`:{let e=Gp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Kp(e)}}}default:return{}}}}},Jp=new Set([`left`,`top`]);async function Yp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bp(n),s=xp(n),c=wp(n)===`y`,l=Jp.has(o)?-1:1,u=a&&c?-1:1,d=yp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Xp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Yp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Zp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wp(bp(i)),p=Sp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=vp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=vp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Qp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yp(e,t),u={x:n,y:r},d=wp(i),f=Sp(d),p=u[f],m=u[d],h=yp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Jp.has(bp(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},$p=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=yp(e,t),u=await o.detectOverflow(t,l),d=bp(i),f=xp(i),p=wp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=fp(h-u[g],v),x=fp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=pp(u.left,0),t=pp(u.right,0),n=pp(u.top,0),r=pp(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:pp(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:pp(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function em(){return typeof window<`u`}function tm(e){return im(e)?(e.nodeName||``).toLowerCase():`#document`}function nm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rm(e){return((im(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function im(e){return em()?e instanceof Node||e instanceof nm(e).Node:!1}function am(e){return em()?e instanceof Element||e instanceof nm(e).Element:!1}function om(e){return em()?e instanceof HTMLElement||e instanceof nm(e).HTMLElement:!1}function sm(e){return!em()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof nm(e).ShadowRoot}function cm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ym(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function lm(e){return/^(table|td|th)$/.test(tm(e))}function um(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dm=/transform|translate|scale|rotate|perspective|filter/,fm=/paint|layout|strict|content/,pm=e=>!!e&&e!==`none`,mm;function hm(e){let t=am(e)?ym(e):e;return pm(t.transform)||pm(t.translate)||pm(t.scale)||pm(t.rotate)||pm(t.perspective)||!_m()&&(pm(t.backdropFilter)||pm(t.filter))||dm.test(t.willChange||``)||fm.test(t.contain||``)}function gm(e){let t=xm(e);for(;om(t)&&!vm(t);){if(hm(t))return t;if(um(t))return null;t=xm(t)}return null}function _m(){return mm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mm}function vm(e){return/^(html|body|#document)$/.test(tm(e))}function ym(e){return nm(e).getComputedStyle(e)}function bm(e){return am(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xm(e){if(tm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sm(e)&&e.host||rm(e);return sm(t)?t.host:t}function Sm(e){let t=xm(e);return vm(t)?e.ownerDocument?e.ownerDocument.body:e.body:om(t)&&cm(t)?t:Sm(t)}function Cm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Sm(e),i=r===e.ownerDocument?.body,a=nm(r);if(i){let e=wm(a);return t.concat(a,a.visualViewport||[],cm(r)?r:[],e&&n?Cm(e):[])}else return t.concat(r,Cm(r,[],n))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tm(e){let t=ym(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=om(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mp(n)!==a||mp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Em(e){return am(e)?e:e.contextElement}function Dm(e){let t=Em(e);if(!om(t))return gp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Tm(t),o=(a?mp(n.width):n.width)/r,s=(a?mp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Om=gp(0);function km(e){let t=nm(e);return!_m()||!t.visualViewport?Om:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Am(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nm(e)?!1:t}function jm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Em(e),o=gp(1);t&&(r?am(r)&&(o=Dm(r)):o=Dm(e));let s=Am(a,n,r)?km(a):gp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=nm(a),t=r&&am(r)?nm(r):r,n=e,i=wm(n);for(;i&&r&&t!==n;){let e=Dm(i),t=i.getBoundingClientRect(),r=ym(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=nm(i),i=wm(n)}}return Rp({width:u,height:d,x:c,y:l})}function Mm(e,t){let n=bm(e).scrollLeft;return t?t.left+n:jm(rm(e)).left+n}function Nm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Mm(e,n),y:n.top+t.scrollTop}}function Pm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rm(r),s=t?um(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gp(1),u=gp(0),d=om(r);if((d||!d&&!a)&&((tm(r)!==`body`||cm(o))&&(c=bm(r)),d)){let e=jm(r);l=Dm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Nm(o,c):gp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Fm(e){return Array.from(e.getClientRects())}function Im(e){let t=rm(e),n=bm(e),r=e.ownerDocument.body,i=pp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=pp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Mm(e),s=-n.scrollTop;return ym(r).direction===`rtl`&&(o+=pp(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Lm=25;function Rm(e,t){let n=nm(e),r=rm(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=_m();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Mm(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Lm&&(a-=o)}else l<=Lm&&(a+=l);return{width:a,height:o,x:s,y:c}}function zm(e,t){let n=jm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=om(e)?Dm(e):gp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Bm(e,t,n){let r;if(t===`viewport`)r=Rm(e,n);else if(t===`document`)r=Im(rm(e));else if(am(t))r=zm(t,n);else{let n=km(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rp(r)}function Vm(e,t){let n=xm(e);return n===t||!am(n)||vm(n)?!1:ym(n).position===`fixed`||Vm(n,t)}function Hm(e,t){let n=t.get(e);if(n)return n;let r=Cm(e,[],!1).filter(e=>am(e)&&tm(e)!==`body`),i=null,a=ym(e).position===`fixed`,o=a?xm(e):e;for(;am(o)&&!vm(o);){let t=ym(o),n=hm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||cm(o)&&!n&&Vm(e,o))?r=r.filter(e=>e!==o):i=t,o=xm(o)}return t.set(e,r),r}function Um(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?um(t)?[]:Hm(t,this._c):[].concat(n),r],o=Bm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Bm(t,a[e],i);s=pp(n.top,s),c=fp(n.right,c),l=fp(n.bottom,l),u=pp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Wm(e){let{width:t,height:n}=Tm(e);return{width:t,height:n}}function Gm(e,t,n){let r=om(t),i=rm(t),a=n===`fixed`,o=jm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gp(0);function l(){c.x=Mm(i)}if(r||!r&&!a)if((tm(t)!==`body`||cm(i))&&(s=bm(t)),r){let e=jm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Nm(i,s):gp(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Km(e){return ym(e).position===`static`}function qm(e,t){if(!om(e)||ym(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rm(e)===n&&(n=n.ownerDocument.body),n}function Jm(e,t){let n=nm(e);if(um(e))return n;if(!om(e)){let t=xm(e);for(;t&&!vm(t);){if(am(t)&&!Km(t))return t;t=xm(t)}return n}let r=qm(e,t);for(;r&&lm(r)&&Km(r);)r=qm(r,t);return r&&vm(r)&&Km(r)&&!hm(r)?n:r||gm(e)||n}var Ym=async function(e){let t=this.getOffsetParent||Jm,n=this.getDimensions,r=await n(e.floating);return{reference:Gm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xm(e){return ym(e).direction===`rtl`}var Zm={convertOffsetParentRelativeRectToViewportRelativeRect:Pm,getDocumentElement:rm,getClippingRect:Um,getOffsetParent:Jm,getElementRects:Ym,getClientRects:Fm,getDimensions:Wm,getScale:Dm,isElement:am,isRTL:Xm};function Qm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $m(e,t){let n=null,r,i=rm(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=hp(d),h=hp(i.clientWidth-(u+f)),g=hp(i.clientHeight-(d+p)),_=hp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pp(0,fp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Qm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function eh(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Em(e),u=i||a?[...l?Cm(l):[],...t?Cm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?$m(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?jm(e):null;c&&g();function g(){let t=jm(e);h&&!Qm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var th=Xp,nh=Zp,rh=Wp,ih=$p,ah=qp,oh=Up,sh=Qp,ch=(e,t,n)=>{let r=new Map,i={platform:Zm,...n},a={...i.platform,_c:r};return Hp(e,t,{...i,platform:a})},lh=typeof document<`u`?_.useLayoutEffect:function(){};function uh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!uh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fh(e,t){let n=dh(e);return Math.round(t*n)/n}function ph(e){let t=_.useRef(e);return lh(()=>{t.current=e}),t}function mh(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);uh(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),ee=c!=null,te=ph(c),E=ph(i),D=ph(l),O=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),ch(C.current,w.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};ne.current&&!uh(T.current,t)&&(T.current=t,ur.flushSync(()=>{d(t)}))})},[f,t,n,E,D]);lh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ne=_.useRef(!1);lh(()=>(ne.current=!0,()=>{ne.current=!1}),[]),lh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,O);O()}},[x,S,O,te,ee]);let re=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ie=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=fh(ie.floating,u.x),r=fh(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dh(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:O,refs:re,elements:ie,floatingStyles:ae}),[u,O,re,ie,ae])}var hh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:oh({element:r.current,padding:i}).fn(n):r?oh({element:r,padding:i}).fn(n):{}}}},gh=(e,t)=>{let n=th(e);return{name:n.name,fn:n.fn,options:[e,t]}},_h=(e,t)=>{let n=nh(e);return{name:n.name,fn:n.fn,options:[e,t]}},vh=(e,t)=>({fn:sh(e).fn,options:[e,t]}),yh=(e,t)=>{let n=rh(e);return{name:n.name,fn:n.fn,options:[e,t]}},bh=(e,t)=>{let n=ih(e);return{name:n.name,fn:n.fn,options:[e,t]}},xh=(e,t)=>{let n=ah(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sh=(e,t)=>{let n=hh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ch=`Arrow`,wh=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,N.jsx)(ud.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,N.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});wh.displayName=Ch;var Th=wh;function Eh(e){let[t,n]=_.useState(void 0);return Yu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Dh=`Popper`,[Oh,kh]=qu(Dh),[Ah,jh]=Oh(Dh),Mh=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,N.jsx)(Ah,{scope:t,anchor:r,onAnchorChange:i,children:n})};Mh.displayName=Dh;var Nh=`PopperAnchor`,Ph=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=jh(Nh,n),o=_.useRef(null),s=nd(t,o),c=_.useRef(null);return _.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,N.jsx)(ud.div,{...i,ref:s})});Ph.displayName=Nh;var Fh=`PopperContent`,[Ih,Lh]=Oh(Fh),Rh=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=jh(Fh,n),[v,y]=_.useState(null),b=nd(t,e=>y(e)),[x,S]=_.useState(null),C=Eh(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},E=Array.isArray(l)?l:[l],D=E.length>0,O={padding:te,boundary:E.filter(Hh),altBoundary:D},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:oe}=mh({strategy:`fixed`,placement:ee,whileElementsMounted:(...e)=>eh(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[gh({mainAxis:i+T,alignmentAxis:o}),c&&_h({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?vh():void 0,...O}),c&&yh({...O}),bh({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Sh({element:x,padding:s}),Uh({arrowWidth:w,arrowHeight:T}),f&&xh({strategy:`referenceHidden`,...O})]}),[k,A]=Wh(ie),se=Pd(m);Yu(()=>{ae&&se?.()},[ae,se]);let ce=oe.arrow?.x,le=oe.arrow?.y,ue=oe.arrow?.centerOffset!==0,[de,j]=_.useState();return Yu(()=>{v&&j(window.getComputedStyle(v).zIndex)},[v]),(0,N.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,N.jsx)(Ih,{scope:n,placedSide:k,onArrowChange:S,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,N.jsx)(ud.div,{"data-side":k,"data-align":A,...h,ref:b,style:{...h.style,animation:ae?void 0:`none`}})})})});Rh.displayName=Fh;var zh=`PopperArrow`,Bh={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vh=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lh(zh,n),a=Bh[i.placedSide];return(0,N.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,N.jsx)(Th,{...r,ref:t,style:{...r.style,display:`block`}})})});Vh.displayName=zh;function Hh(e){return e!==null}var Uh=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Wh(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Wh(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gh=Mh,Kh=Ph,qh=Rh,Jh=Vh,[Yh,Xh]=qu(`Tooltip`,[kh]),Zh=kh(),Qh=`TooltipProvider`,$h=700,eg=`tooltip.open`,[tg,ng]=Yh(Qh),rg=e=>{let{__scopeTooltip:t,delayDuration:n=$h,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,N.jsx)(tg,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};rg.displayName=Qh;var ig=`Tooltip`,[ag,og]=Yh(ig),sg=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ng(ig,e.__scopeTooltip),l=Zh(t),[u,d]=_.useState(null),f=yd(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=Zu({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(eg))):c.onClose(),a?.(e)},caller:ig}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,N.jsx)(Gh,{...l,children:(0,N.jsx)(ag,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};sg.displayName=ig;var cg=`TooltipTrigger`,lg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=og(cg,n),a=ng(cg,n),o=Zh(n),s=nd(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,N.jsx)(Kh,{asChild:!0,...o,children:(0,N.jsx)(ud.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Ku(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Ku(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Ku(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Ku(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ku(e.onBlur,i.onClose),onClick:Ku(e.onClick,i.onClose)})})});lg.displayName=cg;var ug=`TooltipPortal`,[dg,fg]=Yh(ug,{forceMount:void 0}),pg=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=og(ug,t);return(0,N.jsx)(dg,{scope:t,forceMount:n,children:(0,N.jsx)(pd,{present:n||a.open,children:(0,N.jsx)(Qd,{asChild:!0,container:i,children:r})})})};pg.displayName=ug;var mg=`TooltipContent`,hg=_.forwardRef((e,t)=>{let n=fg(mg,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=og(mg,e.__scopeTooltip);return(0,N.jsx)(pd,{present:r||o.open,children:o.disableHoverableContent?(0,N.jsx)(bg,{side:i,...a,ref:t}):(0,N.jsx)(gg,{side:i,...a,ref:t})})}),gg=_.forwardRef((e,t)=>{let n=og(mg,e.__scopeTooltip),r=ng(mg,e.__scopeTooltip),i=_.useRef(null),a=nd(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=wg(r,Cg(r,n.getBoundingClientRect())),a=Tg(t.getBoundingClientRect());s(Dg([...i,...a])),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Eg(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,N.jsx)(bg,{...e,ref:a})}),[_g,vg]=Yh(ig,{isInside:!1}),yg=od(`TooltipContent`),bg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=og(mg,n),l=Zh(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(eg,u),()=>document.removeEventListener(eg,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,N.jsx)(Hd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,N.jsxs)(qh,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,N.jsx)(yg,{children:r}),(0,N.jsx)(_g,{scope:n,isInside:!0,children:(0,N.jsx)(nf,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});hg.displayName=mg;var xg=`TooltipArrow`,Sg=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Zh(n);return vg(xg,n).isInside?null:(0,N.jsx)(Jh,{...i,...r,ref:t})});Sg.displayName=xg;function Cg(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function wg(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Tg(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Eg(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Dg(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Og(t)}function Og(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var kg=rg,Ag=sg,jg=lg,Mg=pg,Ng=hg,Pg={root:`_root_12w7q_1`,row:`_row_12w7q_10`,action:`_action_12w7q_16`,actionCount:`_actionCount_12w7q_33`,stop:`_stop_12w7q_41`,progressOuter:`_progressOuter_12w7q_57`,progressInner:`_progressInner_12w7q_66`,progressLabel:`_progressLabel_12w7q_73`,counts:`_counts_12w7q_81`,tip:`_tip_12w7q_86`};function Fg(e){let t=X(e=>e.acceptAllRunning),n=X(e=>e.acceptAllDone),r=X(e=>e.acceptAllTotal),i=(()=>{let e=Su.getState().doc;return e?Gu(e).length:0})(),a=async()=>{let e=Su.getState().doc;if(!e)return;let t=Gu(e);if(t.length===0)return;X.getState().setAcceptAllRunning(!0),X.getState().setAcceptAllCancel(!1),X.getState().setAcceptAllProgress(0,t.length);let n=0,r=!1;for(let e=0;e<t.length;e++){if(X.getState().acceptAllCancel){r=!0;break}let i=t[e],a=await Su.getState().accept(i);a.ok?n++:ep({title:`Accept failed`,description:`${i}: ${a.error}`,tone:`error`}),X.getState().setAcceptAllProgress(n,t.length)}X.getState().setAcceptAllRunning(!1),X.getState().setAcceptAllCancel(!1),ep(r?{title:`Accept all stopped`,description:`Stopped after ${n} test${n===1?``:`s`}.`,tone:`info`}:{title:`Accept all finished`,description:`Accepted ${n} test${n===1?``:`s`}.`,tone:`success`})},o=()=>{X.getState().setAcceptAllCancel(!0)},s=r>0?n/r*100:0;return(0,N.jsxs)(`div`,{className:Pg.root,children:[(0,N.jsxs)(`div`,{className:Pg.row,children:[(0,N.jsxs)(Ag,{children:[(0,N.jsx)(jg,{asChild:!0,children:(0,N.jsxs)(`button`,{className:Pg.action,disabled:i===0||t,onClick:a,"aria-label":`Accept all`,children:[(0,N.jsx)(Nu,{size:14}),(0,N.jsx)(`span`,{children:`Accept all`}),i>0?(0,N.jsx)(`span`,{className:Pg.actionCount,children:i}):null]})}),(0,N.jsx)(Mg,{children:(0,N.jsx)(Ng,{className:Pg.tip,side:`bottom`,sideOffset:4,children:"Accepts every pending `new` and `change` test (skips stale and deleted)."})})]}),t?(0,N.jsxs)(`button`,{className:Pg.stop,onClick:o,"aria-label":`Stop`,children:[(0,N.jsx)(Iu,{size:14}),(0,N.jsx)(`span`,{children:`Stop`})]}):null]}),t?(0,N.jsxs)(`div`,{className:Pg.progressOuter,children:[(0,N.jsx)(`div`,{className:Pg.progressInner,style:{width:`${s}%`}}),(0,N.jsxs)(`span`,{className:Pg.progressLabel,children:[n,` / `,r]})]}):null,(0,N.jsxs)(`div`,{className:Pg.counts,children:[`Pending `,(0,N.jsx)(`b`,{children:e.counts.pending}),` · Accepted `,(0,N.jsx)(`b`,{children:e.counts.accepted}),` · Stale`,` `,(0,N.jsx)(`b`,{children:e.counts.stale})]})]})}var Ig={root:`_root_1d1kr_1`,projectHeader:`_projectHeader_1d1kr_8`,projectName:`_projectName_1d1kr_17`,projectBranch:`_projectBranch_1d1kr_26`,scroll:`_scroll_1d1kr_37`,section:`_section_1d1kr_44`,sectionTitle:`_sectionTitle_1d1kr_48`,sectionEmpty:`_sectionEmpty_1d1kr_57`,sectionBody:`_sectionBody_1d1kr_64`,versionFooter:`_versionFooter_1d1kr_68`};function Lg(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}function Rg(){let e=Su(e=>e.doc),t=X(e=>e.acceptedIds),n=X(e=>e.staleIds),r=Su(e=>e.serverVersion),i=e?.project,a=(0,_.useMemo)(()=>Wu(),[e,t,n]);return(0,N.jsxs)(`div`,{className:Ig.root,children:[i?(0,N.jsxs)(`header`,{className:Ig.projectHeader,title:i.path,children:[(0,N.jsx)(`div`,{className:Ig.projectName,children:Lg(i.path)}),i.branch?(0,N.jsxs)(`div`,{className:Ig.projectBranch,children:[(0,N.jsx)(Lu,{size:11,"aria-hidden":!0}),(0,N.jsx)(`span`,{children:i.branch})]}):null]}):null,(0,N.jsx)(Fg,{counts:a.counts}),(0,N.jsxs)(`div`,{className:Ig.scroll,children:[(0,N.jsx)(zg,{title:`Pending (${a.counts.pending})`,empty:a.pending.length===0?`No pending tests.`:null,children:(0,N.jsx)(ap,{nodes:a.pending,kind:`pending`})}),(0,N.jsx)(zg,{title:`Accepted (${a.counts.accepted})`,empty:(a.accepted.length,null),children:(0,N.jsx)(ap,{nodes:a.accepted,kind:`accepted`})})]}),r?(0,N.jsxs)(`footer`,{className:Ig.versionFooter,title:`@cevek/screentest package version`,children:[`v`,r]}):null]})}function zg(e){return(0,N.jsxs)(`section`,{className:Ig.section,children:[(0,N.jsx)(`div`,{className:Ig.sectionTitle,children:e.title}),e.empty?(0,N.jsx)(`div`,{className:Ig.sectionEmpty,children:e.empty}):(0,N.jsx)(`div`,{className:Ig.sectionBody,children:e.children})]})}var Bg=6;function Vg(e){let t=!1,n=[],r=(t,i)=>{for(let a of t)if(`items`in a)r(a.items,[...i,a.name]);else{let t=a;if(t.type===`new`)continue;let r=cu(i,t.name);n.push({id:r,url:e.expectedUrlFor(t.expectedHash)})}};for(let t of e.doc.groups)r(t.items,[t.name]);let i=0,a=n=>new Promise(r=>{let i=new Image;i.onload=()=>r(),i.onerror=()=>{t||e.onStale(n.id),r()},i.src=n.url}),o=async()=>{for(;!t;){let e=i++;if(e>=n.length)return;let t=n[e];await a(t)}},s=[];for(let e=0;e<Bg;e++)s.push(o());return Promise.all(s),()=>{t=!0}}function Hg(){let e=cr();(0,_.useEffect)(()=>{let t=async t=>{if(t.metaKey||t.ctrlKey||t.altKey)return;let n=t.target;if(n&&/^(input|textarea|select)$/i.test(n.tagName))return;let r=X.getState();if(Su.getState().doc){if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault();let n=Wu().pendingIdsOrdered;if(n.length===0)return;let i=r.selectedTestId?n.indexOf(r.selectedTestId):-1;i=i===-1?t.key===`ArrowDown`?0:n.length-1:t.key===`ArrowDown`?Math.min(n.length-1,i+1):Math.max(0,i-1);let a=n[i];e({to:`/test/$testId`,params:{testId:lu(a)}});return}if(t.key===`Enter`){if(!r.selectedTestId)return;let e=Su.getState().flat[r.selectedTestId];if(!e)return;let n=r.staleIds.has(r.selectedTestId);if(e.item.type===`change`&&n||r.acceptingIds.has(r.selectedTestId)||r.acceptAllRunning||r.acceptedIds.has(r.selectedTestId))return;t.preventDefault(),await rp(r.selectedTestId)}}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var Ug={shell:`_shell_wtjyy_1`,aside:`_aside_wtjyy_8`,main:`_main_wtjyy_18`,splash:`_splash_wtjyy_26`,spinner:`_spinner_wtjyy_37`,spin:`_spin_wtjyy_37`,errorTitle:`_errorTitle_wtjyy_46`,errorMsg:`_errorMsg_wtjyy_51`,retry:`_retry_wtjyy_57`};function Wg(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}function Gg(e){let t=Su(e=>e.loading),n=Su(e=>e.doc),r=Su(e=>e.error),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{Su.getState().load().catch(e=>{let t=e instanceof Error?e.message:String(e);a(t),ep({title:`Failed to load doc`,description:t,tone:`error`})})},[]),(0,_.useEffect)(()=>{let e=n?.project;if(!e){document.title=`screentest`;return}let t=Wg(e.path),r=e.branch?` @${e.branch}`:``;document.title=`${t}${r} — screentest`},[n?.project]),(0,_.useEffect)(()=>{if(n)return Vg({doc:n,expectedUrlFor:e=>Su.getState().expectedUrlFor(e),onStale:e=>X.getState().markStale(e)})},[n]),Hg(),t||!n&&!r&&!i?(0,N.jsxs)(`div`,{className:Ug.splash,children:[(0,N.jsx)(`div`,{className:Ug.spinner}),(0,N.jsx)(`div`,{children:`Loading…`})]}):i||r?(0,N.jsxs)(`div`,{className:Ug.splash,children:[(0,N.jsx)(`div`,{className:Ug.errorTitle,children:`Failed to load.`}),(0,N.jsx)(`div`,{className:Ug.errorMsg,children:i??r}),(0,N.jsx)(`button`,{className:Ug.retry,onClick:()=>{a(null),Su.getState().load().catch(e=>{a(e instanceof Error?e.message:String(e))})},children:`Retry`})]}):(0,N.jsxs)(`div`,{className:Ug.shell,children:[(0,N.jsx)(`aside`,{className:Ug.aside,children:(0,N.jsx)(Rg,{})}),(0,N.jsx)(`main`,{className:Ug.main,children:e.children})]})}function Kg(e){return new Worker(`/assets/pixelmatch.worker-BL1KzKED.js`,{type:`module`,name:e?.name})}var qg=class{worker=null;pending=new Map;counter=0;cache=new Map;inFlight=new Map;ensureWorker(){if(this.worker)return this.worker;let e=new Kg;return e.addEventListener(`message`,e=>{let t=e.data,n=this.pending.get(t.id);if(n)if(this.pending.delete(t.id),`error`in t)n.reject(Error(t.error));else{let e=new Uint8ClampedArray(t.buffer);if(t.width===0||t.height===0)n.resolve({width:0,height:0,imageData:new ImageData(1,1)});else{let r=new ImageData(e,t.width,t.height);n.resolve({width:t.width,height:t.height,imageData:r})}}}),this.worker=e,e}computeCached(e,t,n){let r=this.cache.get(e);if(r)return Promise.resolve(r);let i=this.inFlight.get(e);if(i)return i;let a=(async()=>{let[r,i]=await Promise.all([Jg(t),Jg(n)]),a=await this.run(r,i);return this.cache.set(e,a),a})();return this.inFlight.set(e,a),a.finally(()=>this.inFlight.delete(e)),a}run(e,t){return new Promise((n,r)=>{let i=String(++this.counter);this.pending.set(i,{id:i,resolve:n,reject:r});let a=this.ensureWorker(),o=[];e&&o.push(e),t&&o.push(t),a.postMessage({id:i,expected:e,actual:t},o)})}invalidate(e){this.cache.delete(e),this.inFlight.delete(e)}};async function Jg(e){if(!e)return null;let t=await fetch(e);if(!t.ok)return null;let n=await t.blob();return await createImageBitmap(n,{colorSpaceConversion:`none`})}var Yg=new qg,Xg={stageWrap:`_stageWrap_byixq_2`,canvas:`_canvas_byixq_21`,canvasInteractive:`_canvasInteractive_byixq_30`,canvasDragging:`_canvasDragging_byixq_34`,layer:`_layer_byixq_39`,hiddenProbe:`_hiddenProbe_byixq_49`,diffLayer:`_diffLayer_byixq_57`,sliderLine:`_sliderLine_byixq_65`,sliderHandle:`_sliderHandle_byixq_75`,plate:`_plate_byixq_88`},Zg={loaded:!1,error:!1,width:0,height:0};function Qg(e){let[t,n]=(0,_.useState)(Zg),[r,i]=(0,_.useState)(Zg),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=(0,_.useRef)(null),u=(0,_.useRef)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{n(Zg),i(Zg),o(null),c(!1)},[e.testId]);let f=Math.max(t.width,r.width),p=Math.max(t.height,r.height);(0,_.useEffect)(()=>{if(e.type!==`change`||!e.expectedUrl||!e.actualUrl||!t.loaded||!r.loaded)return;let n=!1,i=`${e.testId}::${e.expectedUrl}::${e.actualUrl}`;return Yg.computeCached(i,e.expectedUrl,e.actualUrl).then(e=>{n||o(e)}).catch(()=>{}),()=>{n=!0}},[e.type,e.testId,e.expectedUrl,e.actualUrl,t.loaded,r.loaded]),(0,_.useEffect)(()=>{let e=l.current;if(!e||!a||a.width===0)return;e.width!==a.width&&(e.width=a.width),e.height!==a.height&&(e.height=a.height);let t=e.getContext(`2d`);t&&t.putImageData(a.imageData,0,0)},[a,e.showDiff]),(0,_.useEffect)(()=>{if(e.type!==`change`)return;let t=u.current;if(!t)return;let n=t=>{if(!(t.metaKey||t.ctrlKey))return;t.preventDefault();let n=t.deltaY*(.05/100),r=Math.max(0,Math.min(1,e.sliderFrac+n));e.onSliderChange(r)};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[e.type,e.sliderFrac,e.onSliderChange]);let m=(0,_.useCallback)(t=>{let n=d.current;if(!n)return;let r=n.getBoundingClientRect();if(r.width===0)return;let i=t-r.left,a=Math.max(0,Math.min(1,i/r.width));e.onSliderChange(a)},[e.onSliderChange]);(0,_.useEffect)(()=>{if(!s)return;let e=e=>m(e.clientX),t=()=>c(!1);return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[s,m]);let h=(0,_.useCallback)(t=>{e.type===`change`&&t.button===0&&(t.preventDefault(),m(t.clientX),c(!0))},[e.type,m]),g=e=>{let t=e.currentTarget;n({loaded:!0,error:!1,width:t.naturalWidth,height:t.naturalHeight})},v=()=>{n({loaded:!1,error:!0,width:0,height:0}),X.getState().markStale(e.testId)},y=e=>{let t=e.currentTarget;i({loaded:!0,error:!1,width:t.naturalWidth,height:t.naturalHeight})},b=()=>{i({loaded:!1,error:!0,width:0,height:0})},x=Xg.canvas+(e.type===`change`?` ${Xg.canvasInteractive}`:``)+(s?` ${Xg.canvasDragging}`:``);return(0,N.jsxs)(`div`,{className:Xg.stageWrap,ref:u,children:[(0,N.jsxs)(`div`,{ref:d,className:x,style:f>0?{width:`${f}px`,height:`${p}px`}:void 0,onMouseDown:h,children:[e.type===`change`?(0,N.jsxs)(N.Fragment,{children:[e.expectedUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.expectedUrl,alt:`expected`,onLoad:g,onError:v,draggable:!1,style:{width:t.width||void 0,height:t.height||void 0,visibility:t.loaded?`visible`:`hidden`}}):null,e.actualUrl&&r.loaded?(0,N.jsx)(`img`,{className:Xg.layer,src:e.actualUrl,alt:`actual`,onLoad:y,onError:b,draggable:!1,style:{width:r.width||void 0,height:r.height||void 0,clipPath:`inset(0 ${(1-e.sliderFrac)*100}% 0 0)`}}):e.actualUrl?(0,N.jsx)(`img`,{className:Xg.hiddenProbe,src:e.actualUrl,alt:``,onLoad:y,onError:b}):null,a&&a.width>0?(0,N.jsx)(`canvas`,{ref:l,className:Xg.diffLayer,style:{display:e.showDiff?`block`:`none`}}):null,f>0?(0,N.jsx)(`div`,{className:Xg.sliderLine,style:{left:`${e.sliderFrac*f}px`},"aria-hidden":!0,children:(0,N.jsx)(`div`,{className:Xg.sliderHandle})}):null]}):null,e.type===`new`&&e.actualUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.actualUrl,alt:`actual`,onLoad:y,onError:b,draggable:!1,style:{width:r.width||void 0,height:r.height||void 0,visibility:r.loaded?`visible`:`hidden`}}):null,e.type===`deleted`&&e.expectedUrl?(0,N.jsx)(`img`,{className:Xg.layer,src:e.expectedUrl,alt:`expected`,onLoad:g,onError:v,draggable:!1,style:{width:t.width||void 0,height:t.height||void 0,visibility:t.loaded?`visible`:`hidden`}}):null]}),e.type===`new`?(0,N.jsx)(`div`,{className:Xg.plate,children:`New snapshot`}):null,e.type===`deleted`?(0,N.jsx)(`div`,{className:Xg.plate,children:e.stale?`Expected file was already missing in Cloudflare`:`This snapshot will be removed`}):null,e.type===`change`&&t.error?(0,N.jsx)(`div`,{className:Xg.plate,children:`Expected file is missing in Cloudflare`}):null,e.type===`change`&&r.error?(0,N.jsx)(`div`,{className:Xg.plate,children:`Actual file failed to load`}):null]})}var $g={root:`_root_j601s_1`,header:`_header_j601s_8`,spacer:`_spacer_j601s_18`,badges:`_badges_j601s_22`,badge:`_badge_j601s_22`,badgeNew:`_badgeNew_j601s_39`,badgeChange:`_badgeChange_j601s_45`,badgeStale:`_badgeStale_j601s_51`,badgeDeleted:`_badgeDeleted_j601s_57`,badgeDeletedStale:`_badgeDeletedStale_j601s_63`,badgeAccepted:`_badgeAccepted_j601s_69`,headerBtn:`_headerBtn_j601s_75`,acceptBtn:`_acceptBtn_j601s_92`,tip:`_tip_j601s_101`,spin:`_spin_j601s_113`};function e_(e){let{flat:t}=e,n=t.item.type,r=X(e=>e.staleIds.has(t.testId)),i=X(e=>e.acceptingIds.has(t.testId)),a=X(e=>e.acceptedIds.has(t.testId)),o=X(e=>e.acceptAllRunning),s=X(e=>e.showDiff),[c,l]=(0,_.useState)(.5),u=n!==`new`&&`expectedHash`in t.item&&t.item.expectedHash?Su.getState().expectedUrlFor(t.item.expectedHash):null,d=n===`deleted`?null:mu(t.testId);(0,_.useEffect)(()=>{l(.5)},[t.testId]);let f=!a&&!i&&!o&&(n===`new`||n===`change`&&!r||n===`deleted`),p=(0,_.useCallback)(async()=>{await rp(t.testId)},[t.testId]),m=n===`change`&&!r,h=(0,_.useCallback)(()=>{m&&X.getState().setShowDiff(!0)},[m]),g=(0,_.useCallback)(()=>{X.getState().setShowDiff(!1)},[]);(0,_.useEffect)(()=>{X.getState().setShowDiff(!1)},[t.testId]);let v=n===`deleted`?`Remove`:`Accept`,y=(0,_.useMemo)(()=>a?`Already accepted`:n===`change`&&r?`Expected snapshot is missing in Cloudflare`:o?`Accept all in progress`:i?n===`deleted`?`Removing…`:`Accepting…`:n===`deleted`?`Remove from snapshot`:`Accept`,[a,n,r,o,i]);return(0,N.jsxs)(`div`,{className:$g.root,children:[(0,N.jsxs)(`header`,{className:$g.header,children:[(0,N.jsx)(t_,{type:n,stale:r,accepted:a}),(0,N.jsx)(`div`,{className:$g.spacer}),n===`change`?(0,N.jsxs)(`button`,{className:$g.headerBtn,disabled:!m,onMouseDown:h,onMouseUp:g,onMouseLeave:g,onTouchStart:e=>{e.preventDefault(),h()},onTouchEnd:g,title:m?`Hold to show diff`:`Diff not available`,children:[(0,N.jsx)(Hu,{size:14}),(0,N.jsx)(`span`,{children:`Show diff`})]}):null,(0,N.jsxs)(Ag,{children:[(0,N.jsx)(jg,{asChild:!0,children:(0,N.jsxs)(`button`,{className:`${$g.headerBtn} ${$g.acceptBtn}`,disabled:!f,onClick:p,children:[i?(0,N.jsx)(Ru,{size:14,className:$g.spin}):(0,N.jsx)(Pu,{size:14}),(0,N.jsx)(`span`,{children:v})]})}),(0,N.jsx)(Mg,{children:(0,N.jsx)(Ng,{className:$g.tip,side:`bottom`,sideOffset:4,children:y})})]})]}),(0,N.jsx)(Qg,{testId:t.testId,type:n,stale:r,expectedUrl:u,actualUrl:d,sliderFrac:c,onSliderChange:l,showDiff:s&&m})]})}function t_(e){let t=e.type.toUpperCase(),n=e.type===`new`?$g.badgeNew:e.type===`change`?e.stale?$g.badgeStale:$g.badgeChange:e.stale?$g.badgeDeletedStale:$g.badgeDeleted;return(0,N.jsxs)(`div`,{className:$g.badges,children:[(0,N.jsx)(`span`,{className:`${$g.badge} ${n}`,children:t}),e.stale?(0,N.jsx)(`span`,{className:`${$g.badge} ${$g.badgeStale}`,children:`STALE`}):null,e.accepted?(0,N.jsx)(`span`,{className:`${$g.badge} ${$g.badgeAccepted}`,children:`ACCEPTED`}):null]})}var n_={notFound:`_notFound_15r13_1`};function r_(){let{testId:e}=or({strict:!1}),t=uu(e),n=Su(e=>e.flat)[t];return(0,_.useEffect)(()=>{X.getState().setSelected(t);let e=n?.parents??[],r=[];for(let t=0;t<e.length;t++)r.push(e.slice(0,t+1).join(`/`)+`/`);r.length>0&&X.getState().expandPath(r)},[t,n]),n?(0,N.jsx)(e_,{flat:n}):(0,N.jsxs)(`div`,{className:n_.notFound,children:[`Test "`,t,`" not found.`]})}var i_={empty:`_empty_19hhh_1`};function a_(){let e=cr(),t=Su(e=>e.doc);if((0,_.useEffect)(()=>{if(!t)return;let n=Wu().pendingIdsOrdered[0];n&&e({to:`/test/$testId`,params:{testId:lu(n)}})},[t,X(e=>e.acceptedIds),e]),!t)return(0,N.jsx)(N.Fragment,{});let n=Wu();return n.counts.pending===0&&n.counts.accepted===0?(0,N.jsx)(`div`,{className:i_.empty,children:`No tests to review.`}):n.counts.pending===0&&n.counts.accepted>0?(0,N.jsx)(`div`,{className:i_.empty,children:`All tests reviewed. Nice.`}):(0,N.jsx)(`div`,{className:i_.empty,children:`Select a test in the sidebar.`})}var o_=Dr({component:()=>(0,N.jsx)(Gg,{children:(0,N.jsx)(Ir,{})})}),s_=Tr({getParentRoute:()=>o_,path:`/`,component:a_}),c_=Tr({getParentRoute:()=>o_,path:`/test/$testId`,component:r_}),l_=Vr({routeTree:o_.addChildren([s_,c_])});(0,eu.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(_.StrictMode,{children:(0,N.jsxs)(Kf,{swipeDirection:`right`,duration:5e3,children:[(0,N.jsx)(kg,{delayDuration:200,children:(0,N.jsx)(Wr,{router:l_})}),(0,N.jsx)(tp,{})]})})),window.addEventListener(`pagehide`,()=>{try{navigator.sendBeacon(`/api/shutdown`)}catch{}});
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
6
  <title>screentest</title>
7
- <script type="module" crossorigin src="/assets/index-Ca30omZK.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BF1haFuK.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-Bi-jx470.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.3",
6
+ "version": "0.3.4",
7
7
  "description": "Local desktop tool for visual screenshot-test review — CLI, runner helpers, and review UI shipped as a single package.",
8
8
  "license": "MIT",
9
9
  "type": "module",