@tonyclaw/agent-inspector 2.0.19 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-D-90PIPw.js → CompareDrawer-CUqYtaH3.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-CxRDWacg.js → ProxyViewerContainer-CX0-R0nn.js} +5 -5
- package/.output/public/assets/{ReplayDialog-DzlLYoTO.js → ReplayDialog-CPXNEqVg.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-0hbyf6oa.js → RequestAnatomy-qkj8QgkY.js} +1 -1
- package/.output/public/assets/{ResponseView-CKe0tNqr.js → ResponseView-BPNLZpuw.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-enhfdeNh.js → StreamingChunkSequence-DGs-YFXI.js} +1 -1
- package/.output/public/assets/_sessionId-CXtbrFTj.js +1 -0
- package/.output/public/assets/index-DrppF281.js +1 -0
- package/.output/public/assets/index-DynnYt7S.css +1 -0
- package/.output/public/assets/{main-o9-hg8g1.js → main-j3vS8rmP.js} +2 -2
- package/.output/server/{_sessionId-F8lm6PIb.mjs → _sessionId-Bc5Nohhe.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-Cf1yfwfd.mjs → CompareDrawer-D0UewydM.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-Bmu9867L.mjs → ProxyViewerContainer-BEUWt2eX.mjs} +9 -9
- package/.output/server/_ssr/{ReplayDialog-DxZfLBOe.mjs → ReplayDialog-zaN-xMOw.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-CbdERGZd.mjs → RequestAnatomy-BMomYged.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-CvLd6qxI.mjs → ResponseView-DSoHCyAM.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-B_lkRB6o.mjs → StreamingChunkSequence-pt3pZOOL.mjs} +2 -2
- package/.output/server/_ssr/{index-ejrSItfz.mjs → index-BCTKxcgV.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-SbCnbDc2.mjs → router-DpaDa5q5.mjs} +3 -3
- package/.output/server/{_tanstack-start-manifest_v-yx8ftqWz.mjs → _tanstack-start-manifest_v-EsubwO0A.mjs} +1 -1
- package/.output/server/index.mjs +54 -54
- package/package.json +1 -1
- package/src/components/ui/scroll-area.tsx +2 -2
- package/.output/public/assets/_sessionId-CJ-SusES.js +0 -1
- package/.output/public/assets/index-BbFsmQRC.js +0 -1
- package/.output/public/assets/index-BfBgrkgU.css +0 -1
package/.output/public/assets/{ProxyViewerContainer-CxRDWacg.js → ProxyViewerContainer-CX0-R0nn.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompareDrawer-
|
|
2
|
-
import{u as qi,a as Vu,r as b,j as l,c as Zr,g as Ji,b as Mr,d as at,e as Hu,f as ng,h as rg,_ as Sn}from"./main-o9-hg8g1.js";function te(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,d=Object.keys(u);for(let f=0;f<d.length;f++){const p=d[f];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class $n extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Wu extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Zu={};function nn(e){return Zu}function qu(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ni(e,t){return typeof t=="bigint"?t.toString():t}function Ho(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ki(e){return e==null}function Gi(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function og(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=n>o?n:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const cl=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==cl)return r===void 0&&(r=cl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Cn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ln(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ul(e){return JSON.stringify(e)}function sg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ju="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ig=Ho(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Zn(e){if(Cr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Cr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ku(e){return Zn(e)?{...e}:Array.isArray(e)?[...e]:e}const ag=new Set(["string","number","symbol"]);function qn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ve(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function lg(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const cg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ug(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ln(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Cn(this,"shape",i),i},checks:[]});return cn(e,s)}function dg(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ln(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Cn(this,"shape",i),i},checks:[]});return cn(e,s)}function fg(e,t){if(!Zn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ln(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Cn(this,"shape",s),s}});return cn(e,o)}function hg(e,t){if(!Zn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ln(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Cn(this,"shape",r),r}});return cn(e,n)}function pg(e,t){const n=ln(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Cn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return cn(e,n)}function mg(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ln(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Cn(this,"shape",c),c},checks:[]});return cn(t,i)}function gg(e,t,n){const r=ln(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Cn(this,"shape",s),s}});return cn(t,r)}function Dn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Fn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qr(e){return typeof e=="string"?e:e?.message}function rn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=qr(e.inst?._zod.def?.error?.(e))??qr(t?.error?.(e))??qr(n.customError?.(e))??qr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Yi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Gu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ni,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Yu=te("$ZodError",Gu),Xu=te("$ZodError",Gu,{Parent:Error});function xg(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function yg(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>r({issues:i}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const Xi=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new $n;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>rn(c,s,nn())));throw Ju(a,o?.callee),a}return i.value},Qi=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>rn(c,s,nn())));throw Ju(a,o?.callee),a}return i.value},Wo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new $n;return s.issues.length?{success:!1,error:new(e??Yu)(s.issues.map(i=>rn(i,o,nn())))}:{success:!0,data:s.value}},bg=Wo(Xu),Zo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>rn(i,o,nn())))}:{success:!0,data:s.value}},vg=Zo(Xu),wg=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xi(e)(t,n,o)},kg=e=>(t,n,r)=>Xi(e)(t,n,r),_g=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qi(e)(t,n,o)},Sg=e=>async(t,n,r)=>Qi(e)(t,n,r),Cg=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wo(e)(t,n,o)},jg=e=>(t,n,r)=>Wo(e)(t,n,r),Eg=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zo(e)(t,n,o)},Ng=e=>async(t,n,r)=>Zo(e)(t,n,r),Tg=/^[cC][^\s-]{8,}$/,Ag=/^[0-9a-z]+$/,Ig=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zg=/^[0-9a-vA-V]{20}$/,Rg=/^[A-Za-z0-9]{27}$/,Pg=/^[a-zA-Z0-9_-]{21}$/,Og=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fg(){return new RegExp(Dg,"u")}const $g=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ug=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qu=/^[A-Za-z0-9_-]*$/,Wg=/^\+[1-9]\d{6,14}$/,ed="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Zg=new RegExp(`^${ed}$`);function td(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qg(e){return new RegExp(`^${td(e)}$`)}function Jg(e){const t=td({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ed}T(?:${r})$`)}const Kg=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Gg=/^-?\d+$/,nd=/^-?\d+(?:\.\d+)?$/,Yg=/^(?:true|false)$/i,Xg=/^null$/i,Qg=/^[^A-Z]*$/,ex=/^[^a-z]*$/,ut=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rd={number:"number",bigint:"bigint",object:"date"},od=te("$ZodCheckLessThan",(e,t)=>{ut.init(e,t);const n=rd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sd=te("$ZodCheckGreaterThan",(e,t)=>{ut.init(e,t);const n=rd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tx=te("$ZodCheckMultipleOf",(e,t)=>{ut.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):og(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nx=te("$ZodCheckNumberFormat",(e,t)=>{ut.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=cg[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=Gg)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),rx=te("$ZodCheckMaxLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Yi(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ox=te("$ZodCheckMinLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Yi(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sx=te("$ZodCheckLengthEquals",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Yi(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qo=te("$ZodCheckStringFormat",(e,t)=>{var n,r;ut.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ix=te("$ZodCheckRegex",(e,t)=>{qo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ax=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qg),qo.init(e,t)}),lx=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ex),qo.init(e,t)}),cx=te("$ZodCheckIncludes",(e,t)=>{ut.init(e,t);const n=qn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ux=te("$ZodCheckStartsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`^${qn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),dx=te("$ZodCheckEndsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`.*${qn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),fx=te("$ZodCheckOverwrite",(e,t)=>{ut.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class hx{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompareDrawer-CUqYtaH3.js","assets/main-j3vS8rmP.js","assets/ReplayDialog-CPXNEqVg.js","assets/ResponseView-BPNLZpuw.js","assets/RequestAnatomy-qkj8QgkY.js","assets/StreamingChunkSequence-DGs-YFXI.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as qi,a as Vu,r as b,j as l,c as Zr,g as Ji,b as Mr,d as at,e as Hu,f as ng,h as rg,_ as Sn}from"./main-j3vS8rmP.js";function te(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,d=Object.keys(u);for(let f=0;f<d.length;f++){const p=d[f];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class $n extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Wu extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Zu={};function nn(e){return Zu}function qu(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ni(e,t){return typeof t=="bigint"?t.toString():t}function Ho(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ki(e){return e==null}function Gi(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function og(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=n>o?n:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const cl=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==cl)return r===void 0&&(r=cl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Cn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ln(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ul(e){return JSON.stringify(e)}function sg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ju="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ig=Ho(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Zn(e){if(Cr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Cr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ku(e){return Zn(e)?{...e}:Array.isArray(e)?[...e]:e}const ag=new Set(["string","number","symbol"]);function qn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ve(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function lg(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const cg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ug(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ln(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Cn(this,"shape",i),i},checks:[]});return cn(e,s)}function dg(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ln(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Cn(this,"shape",i),i},checks:[]});return cn(e,s)}function fg(e,t){if(!Zn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ln(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Cn(this,"shape",s),s}});return cn(e,o)}function hg(e,t){if(!Zn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ln(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Cn(this,"shape",r),r}});return cn(e,n)}function pg(e,t){const n=ln(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Cn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return cn(e,n)}function mg(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ln(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Cn(this,"shape",c),c},checks:[]});return cn(t,i)}function gg(e,t,n){const r=ln(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Cn(this,"shape",s),s}});return cn(t,r)}function Dn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Fn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qr(e){return typeof e=="string"?e:e?.message}function rn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=qr(e.inst?._zod.def?.error?.(e))??qr(t?.error?.(e))??qr(n.customError?.(e))??qr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Yi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Gu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ni,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Yu=te("$ZodError",Gu),Xu=te("$ZodError",Gu,{Parent:Error});function xg(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function yg(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>r({issues:i}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const Xi=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new $n;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>rn(c,s,nn())));throw Ju(a,o?.callee),a}return i.value},Qi=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>rn(c,s,nn())));throw Ju(a,o?.callee),a}return i.value},Wo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new $n;return s.issues.length?{success:!1,error:new(e??Yu)(s.issues.map(i=>rn(i,o,nn())))}:{success:!0,data:s.value}},bg=Wo(Xu),Zo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>rn(i,o,nn())))}:{success:!0,data:s.value}},vg=Zo(Xu),wg=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xi(e)(t,n,o)},kg=e=>(t,n,r)=>Xi(e)(t,n,r),_g=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qi(e)(t,n,o)},Sg=e=>async(t,n,r)=>Qi(e)(t,n,r),Cg=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wo(e)(t,n,o)},jg=e=>(t,n,r)=>Wo(e)(t,n,r),Eg=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zo(e)(t,n,o)},Ng=e=>async(t,n,r)=>Zo(e)(t,n,r),Tg=/^[cC][^\s-]{8,}$/,Ag=/^[0-9a-z]+$/,Ig=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zg=/^[0-9a-vA-V]{20}$/,Rg=/^[A-Za-z0-9]{27}$/,Pg=/^[a-zA-Z0-9_-]{21}$/,Og=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fg(){return new RegExp(Dg,"u")}const $g=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ug=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qu=/^[A-Za-z0-9_-]*$/,Wg=/^\+[1-9]\d{6,14}$/,ed="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Zg=new RegExp(`^${ed}$`);function td(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qg(e){return new RegExp(`^${td(e)}$`)}function Jg(e){const t=td({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ed}T(?:${r})$`)}const Kg=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Gg=/^-?\d+$/,nd=/^-?\d+(?:\.\d+)?$/,Yg=/^(?:true|false)$/i,Xg=/^null$/i,Qg=/^[^A-Z]*$/,ex=/^[^a-z]*$/,ut=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rd={number:"number",bigint:"bigint",object:"date"},od=te("$ZodCheckLessThan",(e,t)=>{ut.init(e,t);const n=rd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sd=te("$ZodCheckGreaterThan",(e,t)=>{ut.init(e,t);const n=rd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tx=te("$ZodCheckMultipleOf",(e,t)=>{ut.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):og(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nx=te("$ZodCheckNumberFormat",(e,t)=>{ut.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=cg[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=Gg)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),rx=te("$ZodCheckMaxLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Yi(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ox=te("$ZodCheckMinLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Yi(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sx=te("$ZodCheckLengthEquals",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Yi(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qo=te("$ZodCheckStringFormat",(e,t)=>{var n,r;ut.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ix=te("$ZodCheckRegex",(e,t)=>{qo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ax=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qg),qo.init(e,t)}),lx=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ex),qo.init(e,t)}),cx=te("$ZodCheckIncludes",(e,t)=>{ut.init(e,t);const n=qn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ux=te("$ZodCheckStartsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`^${qn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),dx=te("$ZodCheckEndsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`.*${qn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),fx=te("$ZodCheckOverwrite",(e,t)=>{ut.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class hx{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
3
3
|
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
|
|
4
4
|
`))}}const px={major:4,minor:3,patch:6},He=te("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=px;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=Dn(i),d;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const p=i.issues.length,h=f._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new $n;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,i.issues.length!==p&&(u||(u=Dn(i,p)))});else{if(i.issues.length===p)continue;u||(u=Dn(i,p))}}return d?d.then(()=>i):i},s=(i,a,c)=>{if(Dn(i))return i.aborted=!0,i;const u=o(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new $n;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new $n;return c.then(u=>o(u,r,a))}return o(c,r,a)}}Ae(e,"~standard",()=>({validate:o=>{try{const s=bg(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vg(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),ea=te("$ZodString",(e,t)=>{He.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Kg(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ze=te("$ZodStringFormat",(e,t)=>{qo.init(e,t),ea.init(e,t)}),mx=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Mg),Ze.init(e,t)}),gx=te("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=dl(r))}else t.pattern??(t.pattern=dl());Ze.init(e,t)}),xx=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lg),Ze.init(e,t)}),yx=te("$ZodURL",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),bx=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fg()),Ze.init(e,t)}),vx=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Pg),Ze.init(e,t)}),wx=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Tg),Ze.init(e,t)}),kx=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ag),Ze.init(e,t)}),_x=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ig),Ze.init(e,t)}),Sx=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zg),Ze.init(e,t)}),Cx=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Rg),Ze.init(e,t)}),jx=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Jg(t)),Ze.init(e,t)}),Ex=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Zg),Ze.init(e,t)}),Nx=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=qg(t)),Ze.init(e,t)}),Tx=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Og),Ze.init(e,t)}),Ax=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$g),Ze.init(e,t),e._zod.bag.format="ipv4"}),Ix=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bg),Ze.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),zx=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ug),Ze.init(e,t)}),Rx=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Vg),Ze.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function id(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Px=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hg),Ze.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{id(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Ox(e){if(!Qu.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return id(n)}const Mx=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qu),Ze.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Ox(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Lx=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wg),Ze.init(e,t)});function Dx(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Fx=te("$ZodJWT",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{Dx(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ad=te("$ZodNumber",(e,t)=>{He.init(e,t),e._zod.pattern=e._zod.bag.pattern??nd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),$x=te("$ZodNumberFormat",(e,t)=>{nx.init(e,t),ad.init(e,t)}),Bx=te("$ZodBoolean",(e,t)=>{He.init(e,t),e._zod.pattern=Yg,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Ux=te("$ZodNull",(e,t)=>{He.init(e,t),e._zod.pattern=Xg,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Vx=te("$ZodUnknown",(e,t)=>{He.init(e,t),e._zod.parse=n=>n}),Hx=te("$ZodNever",(e,t)=>{He.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function fl(e,t,n){e.issues.length&&t.issues.push(...Fn(n,e.issues)),t.value[n]=e.value}const Wx=te("$ZodArray",(e,t)=>{He.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(u=>fl(u,n,i))):fl(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function ko(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Fn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ld(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=lg(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cd(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,d=c.optout==="optional";for(const f in t){if(a.has(f))continue;if(u==="never"){i.push(f);continue}const p=c.run({value:t[f],issues:[]},r);p instanceof Promise?e.push(p.then(h=>ko(h,n,f,t,d))):ko(p,n,f,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Zx=te("$ZodObject",(e,t)=>{if(He.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Ho(()=>ld(t));Ae(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(const f of d.values)c[u].add(f)}}return c});const o=Cr,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const d=[],f=i.shape;for(const p of i.keys){const h=f[p],x=h._zod.optout==="optional",m=h._zod.run({value:u[p],issues:[]},c);m instanceof Promise?d.push(m.then(g=>ko(g,a,p,u,x))):ko(m,a,p,u,x)}return s?cd(d,u,a,c,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),qx=te("$ZodObjectJIT",(e,t)=>{Zx.init(e,t);const n=e._zod.parse,r=Ho(()=>ld(t)),o=p=>{const h=new hx(["shape","payload","ctx"]),x=r.value,m=k=>{const S=ul(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};h.write("const input = payload.value;");const g=Object.create(null);let y=0;for(const k of x.keys)g[k]=`key_${y++}`;h.write("const newResult = {};");for(const k of x.keys){const S=g[k],C=ul(k),N=p[k]?._zod?.optout==="optional";h.write(`const ${S} = ${m(k)};`),N?h.write(`
|
|
5
5
|
if (${S}.issues.length) {
|
|
@@ -38,7 +38,7 @@ import{u as qi,a as Vu,r as b,j as l,c as Zr,g as Ji,b as Mr,d as at,e as Hu,f a
|
|
|
38
38
|
`)}h.write("payload.value = newResult;"),h.write("return payload;");const v=h.compile();return(k,S)=>v(p,k,S)};let s;const i=Cr,a=!Zu.jitless,u=a&&ig.value,d=t.catchall;let f;e._zod.parse=(p,h)=>{f??(f=r.value);const x=p.value;return i(x)?a&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),p=s(p,h),d?cd([],x,p,h,f,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function hl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Dn(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>rn(i,r,nn())))}),t)}const ud=te("$ZodUnion",(e,t)=>{He.init(e,t),Ae(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ae(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Gi(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>hl(c,o,e,s)):hl(a,o,e,s)}}),Jx=te("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ud.init(e,t);const n=e._zod.parse;Ae(e._zod,"propValues",()=>{const o={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(const u of c)o[a].add(u)}}return o});const r=Ho(()=>{const o=t.options,s=new Map;for(const i of o){const a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{const i=o.value;if(!Cr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;const a=r.value.get(i?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),o)}}),Kx=te("$ZodIntersection",(e,t)=>{He.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>pl(n,c,u)):pl(n,s,i)}});function ri(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Zn(e)&&Zn(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=ri(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=ri(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pl(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Dn(e))return e;const i=ri(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Gx=te("$ZodRecord",(e,t)=>{He.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Zn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const d=t.valueType._zod.run({value:o[u],issues:[]},r);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&n.issues.push(...Fn(u,f.issues)),n.value[u]=f.value})):(d.issues.length&&n.issues.push(...Fn(u,d.issues)),n.value[u]=d.value)}let c;for(const u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&nd.test(a)&&c.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>rn(f,r,nn())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:o[a],issues:[]},r);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&n.issues.push(...Fn(a,f.issues)),n.value[c.value]=f.value})):(d.issues.length&&n.issues.push(...Fn(a,d.issues)),n.value[c.value]=d.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Yx=te("$ZodEnum",(e,t)=>{He.init(e,t);const n=qu(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>ag.has(typeof o)).map(o=>typeof o=="string"?qn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Xx=te("$ZodLiteral",(e,t)=>{if(He.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?qn(r):r?qn(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),Qx=te("$ZodTransform",(e,t)=>{He.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Wu(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new $n;return n.value=o,n}});function ml(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const dd=te("$ZodOptional",(e,t)=>{He.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Gi(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ml(s,n.value)):ml(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),e0=te("$ZodExactOptional",(e,t)=>{dd.init(e,t),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),t0=te("$ZodNullable",(e,t)=>{He.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Gi(n.source)}|null)$`):void 0}),Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),n0=te("$ZodDefault",(e,t)=>{He.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>gl(s,t)):gl(o,t)}});function gl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const r0=te("$ZodPrefault",(e,t)=>{He.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),o0=te("$ZodNonOptional",(e,t)=>{He.init(e,t),Ae(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xl(s,e)):xl(o,e)}});function xl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const s0=te("$ZodCatch",(e,t)=>{He.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>rn(i,r,nn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>rn(s,r,nn()))},input:n.value}),n.issues=[]),n)}}),i0=te("$ZodPipe",(e,t)=>{He.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),Ae(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Jr(i,t.in,r)):Jr(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Jr(s,t.out,r)):Jr(o,t.out,r)}});function Jr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const a0=te("$ZodReadonly",(e,t)=>{He.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType?._zod?.optin),Ae(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(yl):yl(o)}});function yl(e){return e.value=Object.freeze(e.value),e}const l0=te("$ZodLazy",(e,t)=>{He.init(e,t),Ae(e._zod,"innerType",()=>t.getter()),Ae(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ae(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ae(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ae(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),c0=te("$ZodCustom",(e,t)=>{ut.init(e,t),He.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>bl(s,n,r,e));bl(o,n,r,e)}});function bl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(jr(o))}}var vl;class u0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function d0(){return new u0}(vl=globalThis).__zod_globalRegistry??(vl.__zod_globalRegistry=d0());const xr=globalThis.__zod_globalRegistry;function f0(e,t){return new e({type:"string",...ve(t)})}function h0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ve(t)})}function wl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ve(t)})}function p0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ve(t)})}function m0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ve(t)})}function g0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ve(t)})}function x0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ve(t)})}function y0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ve(t)})}function b0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ve(t)})}function v0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ve(t)})}function w0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ve(t)})}function k0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ve(t)})}function _0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ve(t)})}function S0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ve(t)})}function C0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ve(t)})}function j0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ve(t)})}function E0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ve(t)})}function N0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ve(t)})}function T0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ve(t)})}function A0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ve(t)})}function I0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ve(t)})}function z0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ve(t)})}function R0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ve(t)})}function P0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ve(t)})}function O0(e,t){return new e({type:"string",format:"date",check:"string_format",...ve(t)})}function M0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ve(t)})}function L0(e,t){return new e({type:"string",format:"duration",check:"string_format",...ve(t)})}function D0(e,t){return new e({type:"number",checks:[],...ve(t)})}function F0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ve(t)})}function $0(e,t){return new e({type:"boolean",...ve(t)})}function B0(e,t){return new e({type:"null",...ve(t)})}function U0(e){return new e({type:"unknown"})}function V0(e,t){return new e({type:"never",...ve(t)})}function kl(e,t){return new od({check:"less_than",...ve(t),value:e,inclusive:!1})}function bs(e,t){return new od({check:"less_than",...ve(t),value:e,inclusive:!0})}function _l(e,t){return new sd({check:"greater_than",...ve(t),value:e,inclusive:!1})}function vs(e,t){return new sd({check:"greater_than",...ve(t),value:e,inclusive:!0})}function Sl(e,t){return new tx({check:"multiple_of",...ve(t),value:e})}function fd(e,t){return new rx({check:"max_length",...ve(t),maximum:e})}function _o(e,t){return new ox({check:"min_length",...ve(t),minimum:e})}function hd(e,t){return new sx({check:"length_equals",...ve(t),length:e})}function H0(e,t){return new ix({check:"string_format",format:"regex",...ve(t),pattern:e})}function W0(e){return new ax({check:"string_format",format:"lowercase",...ve(e)})}function Z0(e){return new lx({check:"string_format",format:"uppercase",...ve(e)})}function q0(e,t){return new cx({check:"string_format",format:"includes",...ve(t),includes:e})}function J0(e,t){return new ux({check:"string_format",format:"starts_with",...ve(t),prefix:e})}function K0(e,t){return new dx({check:"string_format",format:"ends_with",...ve(t),suffix:e})}function Qn(e){return new fx({check:"overwrite",tx:e})}function G0(e){return Qn(t=>t.normalize(e))}function Y0(){return Qn(e=>e.trim())}function X0(){return Qn(e=>e.toLowerCase())}function Q0(){return Qn(e=>e.toUpperCase())}function e1(){return Qn(e=>sg(e))}function t1(e,t,n){return new e({type:"array",element:t,...ve(n)})}function n1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ve(n)})}function r1(e){const t=o1(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(jr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(jr(o))}},e(n.value,n)));return t}function o1(e,t){const n=new ut({check:"custom",...ve(t)});return n._zod.check=e,n}function pd(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??xr,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 Ge(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const p=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,p,d)}const f=e._zod.parent;f&&(i.ref||(i.ref=f),Ge(f,t,d),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&ot(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function md(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(i[0])?.id,p=e.external.uri??(x=>x);if(f)return{ref:p(f)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${p("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const u=`#/${a}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);const d=a.schema;for(const f in d)delete d[f];d.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
39
39
|
|
|
40
40
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function gd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){r(d);const p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===d)for(const m in c)m==="$ref"||m==="allOf"||m in u||delete c[m];if(h.$ref&&p.def)for(const m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}const f=i._zod.parent;if(f&&f!==d){r(f);const p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const h in c)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(c[h])===JSON.stringify(p.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:So(t,"input",e.processors),output:So(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function ot(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ot(r.element,n);if(r.type==="set")return ot(r.valueType,n);if(r.type==="lazy")return ot(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 ot(r.innerType,n);if(r.type==="intersection")return ot(r.left,n)||ot(r.right,n);if(r.type==="record"||r.type==="map")return ot(r.keyType,n)||ot(r.valueType,n);if(r.type==="pipe")return ot(r.in,n)||ot(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ot(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ot(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ot(o,n))return!0;return!!(r.rest&&ot(r.rest,n))}return!1}const s1=(e,t={})=>n=>{const r=pd({...n,processors:t});return Ge(e,r),md(r,e),gd(r,e)},So=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=pd({...o??{},target:s,io:t,processors:n});return Ge(e,i),md(i,e),gd(i,e)},i1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a1=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=i1[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},l1=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof s=="number"&&(o.minimum=s,typeof d=="number"&&t.target!=="draft-04"&&(d>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof i=="number"&&(o.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},c1=(e,t,n,r)=>{n.type="boolean"},u1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},d1=(e,t,n,r)=>{n.not={}},f1=(e,t,n,r)=>{},h1=(e,t,n,r)=>{const o=e._zod.def,s=qu(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},p1=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),s.every(i=>typeof i=="boolean")&&(n.type="boolean"),s.every(i=>i===null)&&(n.type="null"),n.enum=s},m1=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},g1=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},x1=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ge(s.element,t,{...r,path:[...r.path,"items"]})},y1=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=Ge(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const d=s.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ge(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},b1=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Ge(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},v1=(e,t,n,r)=>{const o=e._zod.def,s=Ge(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Ge(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},w1=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){const d=Ge(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const f of c)o.patternProperties[f.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ge(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ge(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=i._zod.values;if(u){const d=[...u].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(o.required=d)}},k1=(e,t,n,r)=>{const o=e._zod.def,s=Ge(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},_1=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},S1=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},C1=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},j1=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},E1=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ge(s,t,r);const i=t.seen.get(e);i.ref=s},N1=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},xd=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},T1=(e,t,n,r)=>{const o=e._zod.innerType;Ge(o,t,r);const s=t.seen.get(e);s.ref=o},A1=te("ZodISODateTime",(e,t)=>{jx.init(e,t),Je.init(e,t)});function I1(e){return P0(A1,e)}const z1=te("ZodISODate",(e,t)=>{Ex.init(e,t),Je.init(e,t)});function R1(e){return O0(z1,e)}const P1=te("ZodISOTime",(e,t)=>{Nx.init(e,t),Je.init(e,t)});function O1(e){return M0(P1,e)}const M1=te("ZodISODuration",(e,t)=>{Tx.init(e,t),Je.init(e,t)});function L1(e){return L0(M1,e)}const D1=(e,t)=>{Yu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>yg(e,n)},flatten:{value:n=>xg(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ni,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ni,2)}},isEmpty:{get(){return e.issues.length===0}}})},yt=te("ZodError",D1,{Parent:Error}),F1=Xi(yt),$1=Qi(yt),B1=Wo(yt),U1=Zo(yt),V1=wg(yt),H1=kg(yt),W1=_g(yt),Z1=Sg(yt),q1=Cg(yt),J1=jg(yt),K1=Eg(yt),G1=Ng(yt),We=te("ZodType",(e,t)=>(He.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:So(e,"input"),output:So(e,"output")}}),e.toJSONSchema=s1(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ln(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>cn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>F1(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>B1(e,n,r),e.parseAsync=async(n,r)=>$1(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>U1(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>V1(e,n,r),e.decode=(n,r)=>H1(e,n,r),e.encodeAsync=async(n,r)=>W1(e,n,r),e.decodeAsync=async(n,r)=>Z1(e,n,r),e.safeEncode=(n,r)=>q1(e,n,r),e.safeDecode=(n,r)=>J1(e,n,r),e.safeEncodeAsync=async(n,r)=>K1(e,n,r),e.safeDecodeAsync=async(n,r)=>G1(e,n,r),e.refine=(n,r)=>e.check(Zy(n,r)),e.superRefine=n=>e.check(qy(n)),e.overwrite=n=>e.check(Qn(n)),e.optional=()=>El(e),e.exactOptional=()=>Iy(e),e.nullable=()=>Nl(e),e.nullish=()=>El(Nl(e)),e.nonoptional=n=>Ly(e,n),e.array=()=>Se(e),e.or=n=>Gt([e,n]),e.and=n=>Cy(e,n),e.transform=n=>Tl(e,Ty(n)),e.default=n=>Py(e,n),e.prefault=n=>My(e,n),e.catch=n=>Fy(e,n),e.pipe=n=>Tl(e,n),e.readonly=()=>Uy(e),e.describe=n=>{const r=e.clone();return xr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return xr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return xr.get(e);const r=e.clone();return xr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),yd=te("_ZodString",(e,t)=>{ea.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,o,s)=>a1(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(H0(...r)),e.includes=(...r)=>e.check(q0(...r)),e.startsWith=(...r)=>e.check(J0(...r)),e.endsWith=(...r)=>e.check(K0(...r)),e.min=(...r)=>e.check(_o(...r)),e.max=(...r)=>e.check(fd(...r)),e.length=(...r)=>e.check(hd(...r)),e.nonempty=(...r)=>e.check(_o(1,...r)),e.lowercase=r=>e.check(W0(r)),e.uppercase=r=>e.check(Z0(r)),e.trim=()=>e.check(Y0()),e.normalize=(...r)=>e.check(G0(...r)),e.toLowerCase=()=>e.check(X0()),e.toUpperCase=()=>e.check(Q0()),e.slugify=()=>e.check(e1())}),Y1=te("ZodString",(e,t)=>{ea.init(e,t),yd.init(e,t),e.email=n=>e.check(h0(X1,n)),e.url=n=>e.check(y0(Q1,n)),e.jwt=n=>e.check(R0(py,n)),e.emoji=n=>e.check(b0(ey,n)),e.guid=n=>e.check(wl(Cl,n)),e.uuid=n=>e.check(p0(Kr,n)),e.uuidv4=n=>e.check(m0(Kr,n)),e.uuidv6=n=>e.check(g0(Kr,n)),e.uuidv7=n=>e.check(x0(Kr,n)),e.nanoid=n=>e.check(v0(ty,n)),e.guid=n=>e.check(wl(Cl,n)),e.cuid=n=>e.check(w0(ny,n)),e.cuid2=n=>e.check(k0(ry,n)),e.ulid=n=>e.check(_0(oy,n)),e.base64=n=>e.check(A0(dy,n)),e.base64url=n=>e.check(I0(fy,n)),e.xid=n=>e.check(S0(sy,n)),e.ksuid=n=>e.check(C0(iy,n)),e.ipv4=n=>e.check(j0(ay,n)),e.ipv6=n=>e.check(E0(ly,n)),e.cidrv4=n=>e.check(N0(cy,n)),e.cidrv6=n=>e.check(T0(uy,n)),e.e164=n=>e.check(z0(hy,n)),e.datetime=n=>e.check(I1(n)),e.date=n=>e.check(R1(n)),e.time=n=>e.check(O1(n)),e.duration=n=>e.check(L1(n))});function Z(e){return f0(Y1,e)}const Je=te("ZodStringFormat",(e,t)=>{Ze.init(e,t),yd.init(e,t)}),X1=te("ZodEmail",(e,t)=>{xx.init(e,t),Je.init(e,t)}),Cl=te("ZodGUID",(e,t)=>{mx.init(e,t),Je.init(e,t)}),Kr=te("ZodUUID",(e,t)=>{gx.init(e,t),Je.init(e,t)}),Q1=te("ZodURL",(e,t)=>{yx.init(e,t),Je.init(e,t)}),ey=te("ZodEmoji",(e,t)=>{bx.init(e,t),Je.init(e,t)}),ty=te("ZodNanoID",(e,t)=>{vx.init(e,t),Je.init(e,t)}),ny=te("ZodCUID",(e,t)=>{wx.init(e,t),Je.init(e,t)}),ry=te("ZodCUID2",(e,t)=>{kx.init(e,t),Je.init(e,t)}),oy=te("ZodULID",(e,t)=>{_x.init(e,t),Je.init(e,t)}),sy=te("ZodXID",(e,t)=>{Sx.init(e,t),Je.init(e,t)}),iy=te("ZodKSUID",(e,t)=>{Cx.init(e,t),Je.init(e,t)}),ay=te("ZodIPv4",(e,t)=>{Ax.init(e,t),Je.init(e,t)}),ly=te("ZodIPv6",(e,t)=>{Ix.init(e,t),Je.init(e,t)}),cy=te("ZodCIDRv4",(e,t)=>{zx.init(e,t),Je.init(e,t)}),uy=te("ZodCIDRv6",(e,t)=>{Rx.init(e,t),Je.init(e,t)}),dy=te("ZodBase64",(e,t)=>{Px.init(e,t),Je.init(e,t)}),fy=te("ZodBase64URL",(e,t)=>{Mx.init(e,t),Je.init(e,t)}),hy=te("ZodE164",(e,t)=>{Lx.init(e,t),Je.init(e,t)}),py=te("ZodJWT",(e,t)=>{Fx.init(e,t),Je.init(e,t)}),bd=te("ZodNumber",(e,t)=>{ad.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,o,s)=>l1(e,r,o),e.gt=(r,o)=>e.check(_l(r,o)),e.gte=(r,o)=>e.check(vs(r,o)),e.min=(r,o)=>e.check(vs(r,o)),e.lt=(r,o)=>e.check(kl(r,o)),e.lte=(r,o)=>e.check(bs(r,o)),e.max=(r,o)=>e.check(bs(r,o)),e.int=r=>e.check(jl(r)),e.safe=r=>e.check(jl(r)),e.positive=r=>e.check(_l(0,r)),e.nonnegative=r=>e.check(vs(0,r)),e.negative=r=>e.check(kl(0,r)),e.nonpositive=r=>e.check(bs(0,r)),e.multipleOf=(r,o)=>e.check(Sl(r,o)),e.step=(r,o)=>e.check(Sl(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function pe(e){return D0(bd,e)}const my=te("ZodNumberFormat",(e,t)=>{$x.init(e,t),bd.init(e,t)});function jl(e){return F0(my,e)}const gy=te("ZodBoolean",(e,t)=>{Bx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>c1(e,n,r)});function nt(e){return $0(gy,e)}const xy=te("ZodNull",(e,t)=>{Ux.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>u1(e,n,r)});function oi(e){return B0(xy,e)}const yy=te("ZodUnknown",(e,t)=>{Vx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>f1()});function si(){return U0(yy)}const by=te("ZodNever",(e,t)=>{Hx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>d1(e,n,r)});function vy(e){return V0(by,e)}const wy=te("ZodArray",(e,t)=>{Wx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x1(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(_o(n,r)),e.nonempty=n=>e.check(_o(1,n)),e.max=(n,r)=>e.check(fd(n,r)),e.length=(n,r)=>e.check(hd(n,r)),e.unwrap=()=>e.element});function Se(e,t){return t1(wy,e,t)}const ky=te("ZodObject",(e,t)=>{qx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>y1(e,n,r,o),Ae(e,"shape",()=>t.shape),e.keyof=()=>et(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:si()}),e.loose=()=>e.clone({...e._zod.def,catchall:si()}),e.strict=()=>e.clone({...e._zod.def,catchall:vy()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>fg(e,n),e.safeExtend=n=>hg(e,n),e.merge=n=>pg(e,n),e.pick=n=>ug(e,n),e.omit=n=>dg(e,n),e.partial=(...n)=>mg(wd,e,n[0]),e.required=(...n)=>gg(kd,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...ve(t)};return new ky(n)}const vd=te("ZodUnion",(e,t)=>{ud.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>b1(e,n,r,o),e.options=t.options});function Gt(e,t){return new vd({type:"union",options:e,...ve(t)})}const _y=te("ZodDiscriminatedUnion",(e,t)=>{vd.init(e,t),Jx.init(e,t)});function jn(e,t,n){return new _y({type:"union",options:t,discriminator:e,...ve(n)})}const Sy=te("ZodIntersection",(e,t)=>{Kx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>v1(e,n,r,o)});function Cy(e,t){return new Sy({type:"intersection",left:e,right:t})}const jy=te("ZodRecord",(e,t)=>{Gx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>w1(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Zt(e,t,n){return new jy({type:"record",keyType:e,valueType:t,...ve(n)})}const ii=te("ZodEnum",(e,t)=>{Yx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,o,s)=>h1(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ii({...t,checks:[],...ve(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new ii({...t,checks:[],...ve(o),entries:s})}});function et(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ii({type:"enum",entries:n,...ve(t)})}const Ey=te("ZodLiteral",(e,t)=>{Xx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>p1(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ce(e,t){return new Ey({type:"literal",values:Array.isArray(e)?e:[e],...ve(t)})}const Ny=te("ZodTransform",(e,t)=>{Qx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>g1(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Wu(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function Ty(e){return new Ny({type:"transform",transform:e})}const wd=te("ZodOptional",(e,t)=>{dd.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xd(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function El(e){return new wd({type:"optional",innerType:e})}const Ay=te("ZodExactOptional",(e,t)=>{e0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xd(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Iy(e){return new Ay({type:"optional",innerType:e})}const zy=te("ZodNullable",(e,t)=>{t0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Nl(e){return new zy({type:"nullable",innerType:e})}const Ry=te("ZodDefault",(e,t)=>{n0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>S1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Py(e,t){return new Ry({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ku(t)}})}const Oy=te("ZodPrefault",(e,t)=>{r0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>C1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function My(e,t){return new Oy({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ku(t)}})}const kd=te("ZodNonOptional",(e,t)=>{o0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ly(e,t){return new kd({type:"nonoptional",innerType:e,...ve(t)})}const Dy=te("ZodCatch",(e,t)=>{s0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fy(e,t){return new Dy({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const $y=te("ZodPipe",(e,t)=>{i0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>E1(e,n,r,o),e.in=t.in,e.out=t.out});function Tl(e,t){return new $y({type:"pipe",in:e,out:t})}const By=te("ZodReadonly",(e,t)=>{a0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>N1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Uy(e){return new By({type:"readonly",innerType:e})}const Vy=te("ZodLazy",(e,t)=>{l0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>T1(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function Hy(e){return new Vy({type:"lazy",getter:e})}const Wy=te("ZodCustom",(e,t)=>{c0.init(e,t),We.init(e,t),e._zod.processJSONSchema=(n,r,o)=>m1(e,n)});function Zy(e,t={}){return n1(Wy,e,t)}function qy(e){return r1(e)}const Jn=Hy(()=>Gt([Z(),pe(),nt(),oi(),Se(Jn),Zt(Z(),Jn)]));const ta=ie({type:Z(),ttl:Z().optional(),scope:Z().optional()}),na=ie({type:Ce("text"),text:Z(),cache_control:ta.optional()}),_d=ie({type:Ce("thinking"),thinking:Z(),signature:Z().optional()}),Jy=ie({type:Ce("think"),thinking:Z(),signature:Z().optional()}),Ky=ie({type:Ce("base64"),media_type:Z(),data:Z()}),Sd=ie({type:Ce("image"),source:Ky}),Cd=ie({type:Ce("tool_use"),id:Z(),name:Z(),input:Zt(Z(),Jn)}),Gy=jn("type",[na,Sd]),Yy=ie({type:Ce("tool_result"),tool_use_id:Z().optional(),content:Gt([Z(),Se(Gy)]),is_error:nt().optional()}),Xy=jn("type",[na,_d,Sd,Cd,Yy]),Qy=Gt([Z(),Se(Xy)]),eb=ie({role:et(["user","assistant"]),content:Qy}),tb=ie({type:Ce("text"),text:Z(),cache_control:ta.optional()}),nb=ie({type:Z(),properties:Zt(Z(),Zt(Z(),Jn)).optional(),required:Se(Z()).optional(),additionalProperties:nt().optional(),$schema:Z().optional()}),rb=ie({name:Z(),description:Z().optional(),input_schema:nb.optional(),cache_control:ta.optional()}),ob=jn("type",[ie({type:Ce("enabled"),budget_tokens:pe()}),ie({type:Ce("disabled")}),ie({type:Ce("adaptive")})]),jd=ie({model:Z(),messages:Se(eb),system:Se(tb).optional(),tools:Se(rb).optional(),max_tokens:pe().optional(),temperature:pe().optional(),stream:nt().optional(),thinking:ob.optional(),metadata:ie({user_id:Z().optional()}).optional()}),ra=jn("type",[na,_d,Jy,Cd]),sb=ie({input_tokens:pe().nullable().optional(),output_tokens:pe().nullable().optional(),cache_creation_input_tokens:pe().nullable().optional(),cache_read_input_tokens:pe().nullable().optional()}).passthrough(),Ed=ie({id:Z(),type:Ce("message"),model:Z(),role:Ce("assistant"),content:Se(ra),stop_reason:Z().nullable(),stop_sequence:Z().nullable().optional(),usage:sb}).passthrough(),ib=ie({type:Ce("message_start"),message:ie({id:Z(),type:Ce("message"),model:Z(),role:Ce("assistant"),content:Se(ra),stop_reason:oi(),stop_sequence:oi(),usage:ie({input_tokens:pe(),cache_creation_input_tokens:pe().optional(),cache_read_input_tokens:pe().optional()}).passthrough()})}),ab=ie({type:Ce("content_block_start"),index:pe(),content_block:ra}),lb=jn("type",[ie({type:Ce("text_delta"),text:Z()}),ie({type:Ce("input_json_delta"),partial_json:Z()}),ie({type:Ce("thinking_delta"),thinking:Z()}),ie({type:Ce("signature_delta"),signature:Z()})]),cb=ie({type:Ce("content_block_delta"),index:pe(),delta:lb}),ub=ie({type:Ce("content_block_stop"),index:pe()}),db=ie({type:Ce("message_delta"),delta:ie({stop_reason:Z().nullable(),stop_sequence:Z().nullable().optional()}),usage:ie({output_tokens:pe(),input_tokens:pe().optional(),cache_creation_input_tokens:pe().optional(),cache_read_input_tokens:pe().optional()}).passthrough()}),fb=ie({type:Ce("message_stop")}),hb=ie({type:Ce("ping")}),pb=ie({type:Ce("error"),error:ie({type:Z(),message:Z()})}),mb=jn("type",[ib,ab,cb,ub,db,fb,hb,pb]),gb=Gt([Z(),Se(jn("type",[ie({type:Ce("text"),text:Z()}),ie({type:Ce("image_url"),image_url:ie({url:Z(),detail:Z().optional()})})]))]),Nd=ie({role:et(["system","user","assistant","tool"]),content:gb,name:Z().optional(),reasoning_content:Z().optional(),thinking:Z().optional(),think:Z().optional()}),xb=ie({name:Z(),arguments:Z()}),Td=ie({index:pe().optional(),id:Z().optional(),type:Ce("function").optional(),function:ie({name:Z().optional(),arguments:Z().optional()})});Nd.extend({content:Gt([Z(),Se(ie({type:Ce("text"),text:Z()}))]).optional(),function_call:xb.optional(),tool_calls:Se(Td).optional()});const yb=ie({type:Ce("function"),function:ie({name:Z(),description:Z().optional(),parameters:Zt(Z(),Jn)})}),Ad=ie({model:Z(),messages:Se(Nd),temperature:pe().optional(),max_tokens:pe().optional(),stream:nt().optional(),tools:Se(yb).optional(),tool_choice:Gt([et(["auto","none","required"]),ie({type:Ce("auto")}),ie({type:Ce("none")}),ie({type:Ce("function"),function:ie({name:Z()})})]).optional(),user:Z().optional()}),Id=ie({role:et(["assistant"]).optional(),content:Z().nullable().optional(),reasoning_content:Z().nullable().optional(),thinking:Z().nullable().optional(),think:Z().nullable().optional(),function_call:ie({name:Z().optional(),arguments:Z().optional()}).nullable().optional(),tool_calls:Se(ie({index:pe(),id:Z().optional(),type:Ce("function").optional(),function:ie({name:Z().optional(),arguments:Z().optional()})})).nullable().optional()}),bb=ie({index:pe(),message:ie({role:et(["assistant"]),content:Z().nullable(),reasoning_content:Z().optional(),thinking:Z().optional(),think:Z().optional(),function_call:ie({name:Z(),arguments:Z()}).nullable().optional(),tool_calls:Se(Td).optional()}).optional(),delta:Id.optional(),finish_reason:Z().nullable()}),vb=ie({id:Z(),object:Ce("chat.completion"),created:pe(),model:Z(),choices:Se(bb),usage:ie({prompt_tokens:pe().nullable().optional(),completion_tokens:pe().nullable().optional(),total_tokens:pe().nullable().optional()}).passthrough(),service_tier:Z().nullable().optional(),system_fingerprint:Z().nullable().optional()}).passthrough(),wb=ie({id:Z(),object:Ce("chat.completion.chunk"),created:pe(),model:Z(),choices:Se(ie({index:pe(),delta:Id,finish_reason:Z().nullable().optional()})),usage:ie({prompt_tokens:pe().nullable().optional(),completion_tokens:pe().nullable().optional(),total_tokens:pe().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function zd(e){try{const t=JSON.parse(e),n=vb.safeParse(t);return n.success?n.data:null}catch{return null}}const Rd=ie({index:pe(),timestamp:pe(),type:Z(),data:Jn}),kb=ie({chunks:Se(Rd),truncated:nt().optional().default(!1)}),Al=ie({id:pe(),timestamp:Z(),method:Z(),path:Z(),model:Z().nullable(),sessionId:Z().nullable(),rawRequestBody:Z().nullable(),responseStatus:pe().nullable(),responseText:Z().nullable(),inputTokens:pe().nullable(),outputTokens:pe().nullable(),cacheCreationInputTokens:pe().nullable(),cacheReadInputTokens:pe().nullable(),elapsedMs:pe().nullable(),streaming:nt(),userAgent:Z().nullable(),origin:Z().nullable(),rawHeaders:Zt(Z(),Z()).optional(),headers:Zt(Z(),Z()).optional(),apiFormat:et(["anthropic","openai","unknown"]).default("unknown"),isTest:nt().optional().default(!1),replayOfLogId:pe().nullable().optional(),providerName:Z().nullable().optional(),clientPort:pe().nullable().optional(),clientPid:pe().nullable().optional(),clientCwd:Z().nullable().optional(),clientProjectFolder:Z().nullable().optional(),streamingChunks:kb.optional(),streamingChunksPath:Z().nullable().optional(),error:Z().nullable().optional()});ie({model:Z()});ie({model:Z().optional(),metadata:ie({user_id:Z().optional()}).passthrough().optional()});const _b=ie({error:Z()});async function Wt(e,t){const n=await e.json();return t.parse(n)}async function xn(e,t){try{const n=await e.json(),r=_b.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function Lr(e,t,n,r){const o=await fetch(e,n);if(!o.ok){const s=r?.(o)??`Request failed with status ${o.status}`;throw new Error(await xn(o,s))}return Wt(o,t)}const Co=10,ai=600,jo="time",oa="simple",Pd=et(["time","full"]),Sb=et(["simple","full"]),Jo=ie({stripClaudeCodeBillingHeader:nt(),hasSeenOnboarding:nt().default(!1),slowResponseThresholdSeconds:pe().int().min(0).max(ai).default(Co),timeDisplayFormat:Pd.default(jo),captureMode:Sb.default(oa)}),yr="/api/config";async function Cb(e){return Lr(e,Jo,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function ws(e){return Lr(yr,Jo,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function Od(){const e=qi(yr,Cb,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Vu(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=e.data?.captureMode??oa,o=e.data?.slowResponseThresholdSeconds??Co,s=e.data?.timeDisplayFormat??jo,i=d=>({stripClaudeCodeBillingHeader:e.data?.stripClaudeCodeBillingHeader??!1,hasSeenOnboarding:e.data?.hasSeenOnboarding??!1,slowResponseThresholdSeconds:e.data?.slowResponseThresholdSeconds??Co,timeDisplayFormat:e.data?.timeDisplayFormat??jo,captureMode:r,...d}),a=async d=>{await t(yr,ws({stripClaudeCodeBillingHeader:d}),{optimisticData:i({stripClaudeCodeBillingHeader:d}),rollbackOnError:!0,revalidate:!1})},c=async d=>{await t(yr,ws({slowResponseThresholdSeconds:d}),{optimisticData:i({slowResponseThresholdSeconds:d}),rollbackOnError:!0,revalidate:!1})},u=async d=>{await t(yr,ws({timeDisplayFormat:d}),{optimisticData:i({timeDisplayFormat:d}),rollbackOnError:!0,revalidate:!1})};return{strip:n,captureMode:r,slowResponseThresholdSeconds:o,timeDisplayFormat:s,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:a,setSlowResponseThresholdSeconds:c,setTimeDisplayFormat:u}}const Md=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const jb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Eb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Il=e=>{const t=Eb(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Nb={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"};const Tb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Ab=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>b.createElement("svg",{ref:c,...Nb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Md("lucide",o),...!s&&!Tb(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>b.createElement(u,d)),...Array.isArray(s)?s:[s]]));const me=(e,t)=>{const n=b.forwardRef(({className:r,...o},s)=>b.createElement(Ab,{ref:s,iconNode:t,className:Md(`lucide-${jb(Il(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Il(e),n};const Ib=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],zb=me("arrow-down-right",Ib);const Rb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Pb=me("arrow-down",Rb);const Ob=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Mb=me("arrow-left",Ob);const Lb=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Db=me("arrow-up-right",Lb);const Fb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],$b=me("arrow-up",Fb);const Bb=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Ub=me("blocks",Bb);const Vb=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Ld=me("brain",Vb);const Hb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ct=me("check",Hb);const Wb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yt=me("chevron-down",Wb);const Zb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],un=me("chevron-right",Zb);const qb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Jb=me("chevron-up",qb);const Kb=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Dd=me("chevrons-down",Kb);const Gb=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Yb=me("chevrons-up",Gb);const Xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Er=me("circle-alert",Xb);const Qb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ev=me("circle-check-big",Qb);const tv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zl=me("circle-check",tv);const nv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],rv=me("circle-question-mark",nv);const ov=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Fd=me("circle-x",ov);const sv=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],on=me("clock",sv);const iv=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],av=me("cloud-upload",iv);const lv=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],cv=me("code-xml",lv);const uv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],dv=me("columns-2",uv);const fv=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ft=me("copy",fv);const hv=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],sa=me("download",hv);const pv=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mv=me("ellipsis",pv);const gv=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],$d=me("external-link",gv);const xv=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ia=me("eye-off",xv);const yv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],aa=me("eye",yv);const bv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],vv=me("file-diff",bv);const wv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],kv=me("file-search",wv);const _v=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]],Sv=me("file-terminal",_v);const Cv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],jv=me("file-text",Cv);const Ev=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Nv=me("gauge",Ev);const Tv=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],Av=me("git-compare-arrows",Tv);const Iv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Bd=me("globe",Iv);const zv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Rv=me("history",zv);const Pv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Nr=me("loader-circle",Pv);const Ov=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Mv=me("lock",Ov);const Lv=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ko=me("message-square",Lv);const Dv=[["path",{d:"M5 12h14",key:"1ays0h"}]],Fv=me("minus",Dv);const $v=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Bv=me("mouse-pointer-click",$v);const Uv=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Vv=me("octagon-alert",Uv);const Hv=[["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"}]],Ud=me("pencil",Hv);const Wv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],li=me("plus",Wv);const Zv=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],qv=me("radio",Zv);const Jv=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Rl=me("refresh-cw",Jv);const Kv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Gv=me("rotate-ccw",Kv);const Yv=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ci=me("rotate-cw",Yv);const Xv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Qv=me("rows-3",Xv);const e2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],t2=me("save",e2);const n2=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],r2=me("scan",n2);const o2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],s2=me("search",o2);const i2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],a2=me("server",i2);const l2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c2=me("settings",l2);const u2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pl=me("shield-check",u2);const d2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Vd=me("terminal",d2);const f2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Hd=me("trash-2",f2);const h2=[["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"}]],Eo=me("triangle-alert",h2);const p2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],m2=me("upload",p2);const g2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],x2=me("user",g2);const y2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],b2=me("wifi-off",y2);const v2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],w2=me("wifi",v2);const k2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Dr=me("wrench",k2);const _2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],la=me("x",_2);const S2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Tr=me("zap",S2),ui="/api/config";async function C2(e){return Lr(e,Jo,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function j2(e){return Lr(ui,Jo,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function E2(){const e=qi(ui,C2,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Vu(),n=e.data?.hasSeenOnboarding??!1,r=e.data?.captureMode??oa,o=async()=>{await t(ui,j2({hasSeenOnboarding:!0}),{optimisticData:{stripClaudeCodeBillingHeader:e.data?.stripClaudeCodeBillingHeader??!1,hasSeenOnboarding:!0,slowResponseThresholdSeconds:e.data?.slowResponseThresholdSeconds??Co,timeDisplayFormat:e.data?.timeDisplayFormat??jo,captureMode:r},rollbackOnError:!0,revalidate:!1})};return{hasSeenOnboarding:n,captureMode:r,isLoading:e.isLoading,markSeen:o}}function N2(){const{hasSeenOnboarding:e,captureMode:t,isLoading:n,markSeen:r}=E2();if(n||e)return null;const o=t==="full";return l.jsxs("div",{role:"note","aria-label":"Onboarding tip",className:"mx-4 mt-2 mb-1 flex items-start gap-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"mb-1 font-medium text-amber-600 dark:text-amber-400",children:o?"Agent Inspector is ready in Full mode":"Agent Inspector is ready in Simple mode"}),l.jsxs("ol",{className:"space-y-0.5 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"1. Start in the right mode"}),": this process is currently running in"," ",l.jsx("code",{children:t}),". Mode is fixed at startup."]}),o?l.jsxs(l.Fragment,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"2. Full diagnostics"}),": raw headers, raw response, and SSE chunks are captured for deep investigations."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"3. Daily work"}),": restart with"," ",l.jsx("code",{children:"agent-inspector --mode simple"})," to reduce capture overhead."]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"2. Simple capture"}),": requests, responses, tools, timing, tokens, replay, and memory candidates are available with lower overhead."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"3. Need raw diagnostics?"})," Restart with"," ",l.jsx("code",{children:"agent-inspector --mode full"})," for raw headers, raw response, and SSE chunks."]})]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Agent setup"}),": run ",l.jsx("code",{children:"agent-inspector onboard --status"}),", then use ",l.jsx("code",{children:"/agent-inspector:onboard"})," in Claude Code or ask Codex to use"," ",l.jsx("code",{children:"agent-inspector-onboard"}),"."]})]})]}),l.jsxs("button",{type:"button",onClick:()=>{r()},className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-amber-500/40 px-3 text-xs text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300","aria-label":"Dismiss onboarding tip",children:[l.jsx(ct,{className:"size-3.5"}),"Got it"]}),l.jsx("button",{type:"button",onClick:()=>{r()},className:"-m-1 shrink-0 p-1 text-muted-foreground transition-colors hover:text-foreground","aria-label":"Dismiss",children:l.jsx(la,{className:"size-3.5"})})]})}function Gr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ks={exports:{}};var Ol;function T2(){return Ol||(Ol=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,s){function i(u,d){if(!o[u]){if(!r[u]){var f=typeof Gr=="function"&&Gr;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var h=o[u]={exports:{}};r[u][0].call(h.exports,function(x){var m=r[u][1][x];return i(m||x)},h,h.exports,n,r,o,s)}return o[u].exports}for(var a=typeof Gr=="function"&&Gr,c=0;c<s.length;c++)i(s[c]);return i})({1:[function(n,r,o){var s=n("./utils"),i=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(c){for(var u,d,f,p,h,x,m,g=[],y=0,v=c.length,k=v,S=s.getTypeOf(c)!=="string";y<c.length;)k=v-y,f=S?(u=c[y++],d=y<v?c[y++]:0,y<v?c[y++]:0):(u=c.charCodeAt(y++),d=y<v?c.charCodeAt(y++):0,y<v?c.charCodeAt(y++):0),p=u>>2,h=(3&u)<<4|d>>4,x=1<k?(15&d)<<2|f>>6:64,m=2<k?63&f:64,g.push(a.charAt(p)+a.charAt(h)+a.charAt(x)+a.charAt(m));return g.join("")},o.decode=function(c){var u,d,f,p,h,x,m=0,g=0,y="data:";if(c.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&k--,c.charAt(c.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=i.uint8array?new Uint8Array(0|k):new Array(0|k);m<c.length;)u=a.indexOf(c.charAt(m++))<<2|(p=a.indexOf(c.charAt(m++)))>>4,d=(15&p)<<4|(h=a.indexOf(c.charAt(m++)))>>2,f=(3&h)<<6|(x=a.indexOf(c.charAt(m++))),v[g++]=u,h!==64&&(v[g++]=d),x!==64&&(v[g++]=f);return v}},{"./support":30,"./utils":32}],2:[function(n,r,o){var s=n("./external"),i=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function u(d,f,p,h,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=p,this.compression=h,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,f,p){return d.pipe(new a).pipe(new c("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",f)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var s=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var s=n("./utils"),i=(function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c})();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?(function(u,d,f,p){var h=i,x=p+f;u^=-1;for(var m=p;m<x;m++)u=u>>>8^h[255&(u^d[m])];return-1^u})(0|c,a,a.length,0):(function(u,d,f,p){var h=i,x=p+f;u^=-1;for(var m=p;m<x;m++)u=u>>>8^h[255&(u^d.charCodeAt(m))];return-1^u})(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),u=s?"uint8array":"array";function d(f,p){c.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(d,c),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,f.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},o.compressWorker=function(f){return new d("Deflate",f)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function s(h,x){var m,g="";for(m=0;m<x;m++)g+=String.fromCharCode(255&h),h>>>=8;return g}function i(h,x,m,g,y,v){var k,S,C=h.file,j=h.compression,N=v!==u.utf8encode,T=a.transformTo("string",v(C.name)),I=a.transformTo("string",u.utf8encode(C.name)),O=C.comment,F=a.transformTo("string",v(O)),E=a.transformTo("string",u.utf8encode(O)),L=I.length!==C.name.length,w=E.length!==O.length,M="",B="",D="",U=C.dir,G=C.date,A={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(A.crc32=h.crc32,A.compressedSize=h.compressedSize,A.uncompressedSize=h.uncompressedSize);var H=0;x&&(H|=8),N||!L&&!w||(H|=2048);var J=0,R=0;U&&(J|=16),y==="UNIX"?(R=798,J|=(function(Q,de){var ae=Q;return Q||(ae=de?16893:33204),(65535&ae)<<16})(C.unixPermissions,U)):(R=20,J|=(function(Q){return 63&(Q||0)})(C.dosPermissions)),k=G.getUTCHours(),k<<=6,k|=G.getUTCMinutes(),k<<=5,k|=G.getUTCSeconds()/2,S=G.getUTCFullYear()-1980,S<<=4,S|=G.getUTCMonth()+1,S<<=5,S|=G.getUTCDate(),L&&(B=s(1,1)+s(d(T),4)+I,M+="up"+s(B.length,2)+B),w&&(D=s(1,1)+s(d(F),4)+E,M+="uc"+s(D.length,2)+D);var ee="";return ee+=`
|
|
41
|
-
\0`,ee+=s(H,2),ee+=j.magic,ee+=s(k,2),ee+=s(S,2),ee+=s(A.crc32,4),ee+=s(A.compressedSize,4),ee+=s(A.uncompressedSize,4),ee+=s(T.length,2),ee+=s(M.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ee+T+M,dirRecord:f.CENTRAL_FILE_HEADER+s(R,2)+ee+s(F.length,2)+"\0\0\0\0"+s(J,4)+s(g,4)+T+M+F}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),f=n("../signature");function p(h,x,m,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,c),p.prototype.push=function(h){var x=h.meta.percent||0,m=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-g-1))/m:100}}))},p.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var x=this.streamFiles&&!h.file.dir;if(x){var m=i(h,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(h){this.accumulate=!1;var x=this.streamFiles&&!h.file.dir,m=i(h,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(g){return f.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var h=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-h,g=(function(y,v,k,S,C){var j=a.transformTo("string",C(S));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(y,2)+s(y,2)+s(v,4)+s(k,4)+s(j.length,2)+j})(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(h){this._sources.push(h);var x=this;return h.on("data",function(m){x.processChunk(m)}),h.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),h.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(h){var x=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var m=0;m<x.length;m++)try{x[m].error(h)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,x=0;x<h.length;x++)h[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var s=n("../compressions"),i=n("./ZipFileWorker");o.generateWorker=function(a,c,u){var d=new i(c.streamFiles,u,c.platform,c.encodeFileName),f=0;try{a.forEach(function(p,h){f++;var x=(function(v,k){var S=v||k,C=s[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(h.options.compression,c.compression),m=h.options.compressionOptions||c.compressionOptions||{},g=h.dir,y=h.date;h._compressWorker(x,m).withStreamInfo("file",{name:p,dir:g,date:y,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(d)}),d.entriesCount=f}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new s;for(var a in this)typeof this[a]!="function"&&(i[a]=this[a]);return i}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(i,a){return new s().loadAsync(i,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var s=n("./utils"),i=n("./external"),a=n("./utf8"),c=n("./zipEntries"),u=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function f(p){return new i.Promise(function(h,x){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(g){x(g)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(p,h){var x=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,h.optimizedBinaryString,h.base64).then(function(m){var g=new c(h);return g.load(m),g}).then(function(m){var g=[i.Promise.resolve(m)],y=m.files;if(h.checkCRC32)for(var v=0;v<y.length;v++)g.push(f(y[v]));return i.Promise.all(g)}).then(function(m){for(var g=m.shift(),y=g.files,v=0;v<y.length;v++){var k=y[v],S=k.fileNameStr,C=s.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:h.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return g.zipComment.length&&(x.comment=g.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var s=n("../utils"),i=n("../stream/GenericWorker");function a(c,u){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(u)}s.inherits(a,i),a.prototype._bindStream=function(c){var u=this;(this._stream=c).pause(),c.on("data",function(d){u.push({data:d,meta:{percent:0}})}).on("error",function(d){u.isPaused?this.generatedError=d:u.error(d)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var s=n("readable-stream").Readable;function i(a,c,u){s.call(this,c),this._helper=a;var d=this;a.on("data",function(f,p){d.push(f)||d._helper.pause(),u&&u(p)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}n("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,o){function s(C,j,N){var T,I=a.getTypeOf(j),O=a.extend(N||{},d);O.date=O.date||new Date,O.compression!==null&&(O.compression=O.compression.toUpperCase()),typeof O.unixPermissions=="string"&&(O.unixPermissions=parseInt(O.unixPermissions,8)),O.unixPermissions&&16384&O.unixPermissions&&(O.dir=!0),O.dosPermissions&&16&O.dosPermissions&&(O.dir=!0),O.dir&&(C=y(C)),O.createFolders&&(T=g(C))&&v.call(this,T,!0);var F=I==="string"&&O.binary===!1&&O.base64===!1;N&&N.binary!==void 0||(O.binary=!F),(j instanceof f&&j.uncompressedSize===0||O.dir||!j||j.length===0)&&(O.base64=!1,O.binary=!0,j="",O.compression="STORE",I="string");var E=null;E=j instanceof f||j instanceof c?j:x.isNode&&x.isStream(j)?new m(C,j):a.prepareContent(C,j,O.binary,O.optimizedBinaryString,O.base64);var L=new p(C,E,O);this.files[C]=L}var i=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),d=n("./defaults"),f=n("./compressedObject"),p=n("./zipObject"),h=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),g=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var j=C.lastIndexOf("/");return 0<j?C.substring(0,j):""},y=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,j){return j=j!==void 0?j:d.createFolders,C=y(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:j}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var j,N,T;for(j in this.files)T=this.files[j],(N=j.slice(this.root.length,j.length))&&j.slice(0,this.root.length)===this.root&&C(N,T)},filter:function(C){var j=[];return this.forEach(function(N,T){C(N,T)&&j.push(T)}),j},file:function(C,j,N){if(arguments.length!==1)return C=this.root+C,s.call(this,C,j,N),this;if(k(C)){var T=C;return this.filter(function(O,F){return!F.dir&&T.test(O)})}var I=this.files[this.root+C];return I&&!I.dir?I:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(I,O){return O.dir&&C.test(I)});var j=this.root+C,N=v.call(this,j),T=this.clone();return T.root=N.name,T},remove:function(C){C=this.root+C;var j=this.files[C];if(j||(C.slice(-1)!=="/"&&(C+="/"),j=this.files[C]),j&&!j.dir)delete this.files[C];else for(var N=this.filter(function(I,O){return O.name.slice(0,C.length)===C}),T=0;T<N.length;T++)delete this.files[N[T].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var j,N={};try{if((N=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");a.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var T=N.comment||this.comment||"";j=h.generateWorker(this,N,T)}catch(I){(j=new c("error")).error(I)}return new u(j,N.type||"string",N.mimeType)},generateAsync:function(C,j){return this.generateInternalStream(C).accumulate(j)},generateNodeStream:function(C,j){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(j)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data[this.zero+a]},i.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===u&&this.data[p+2]===d&&this.data[p+3]===f)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&u===p[1]&&d===p[2]&&f===p[3]},i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var s=n("../utils");function i(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,u=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(f){var p=s.getTypeOf(f);return s.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new u(f):i.uint8array?new d(s.transformTo("uint8array",f)):new a(s.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var s=n("./GenericWorker"),i=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),i=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=s.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}s.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,a)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var a=this;return i.on("data",function(c){a.processChunk(c)}),i.on("end",function(){a.end()}),i.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,a){return this.extraStreamInfo[i]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),d=n("../external"),f=null;if(u.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new d.Promise(function(g,y){var v=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(j,N){v.push(j),m&&m(N)}).on("error",function(j){v=[],y(j)}).on("end",function(){try{var j=(function(N,T,I){switch(N){case"blob":return s.newBlob(s.transformTo("arraybuffer",T),I);case"base64":return c.encode(T);default:return s.transformTo(N,T)}})(S,(function(N,T){var I,O=0,F=null,E=0;for(I=0;I<T.length;I++)E+=T[I].length;switch(N){case"string":return T.join("");case"array":return Array.prototype.concat.apply([],T);case"uint8array":for(F=new Uint8Array(E),I=0;I<T.length;I++)F.set(T[I],O),O+=T[I].length;return F;case"nodebuffer":return Buffer.concat(T);default:throw new Error("concat : unsupported type '"+N+"'")}})(k,v),C);g(j)}catch(N){y(N)}v=[]}).resume()})}function h(x,m,g){var y=m;switch(m){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=m,this._mimeType=g,s.checkSupport(y),this._worker=x.pipe(new i(y)),x.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}h.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var g=this;return x==="data"?this._worker.on(x,function(y){m.call(g,y.data,y.meta)}):this._worker.on(x,function(){s.delay(m,arguments,g)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),o.blob=i.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var s=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}o.utf8encode=function(h){return i.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(x){var m,g,y,v,k,S=x.length,C=0;for(v=0;v<S;v++)(64512&(g=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(y=x.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),C+=g<128?1:g<2048?2:g<65536?3:4;for(m=i.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(g=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(y=x.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),g<128?m[k++]=g:(g<2048?m[k++]=192|g>>>6:(g<65536?m[k++]=224|g>>>12:(m[k++]=240|g>>>18,m[k++]=128|g>>>12&63),m[k++]=128|g>>>6&63),m[k++]=128|63&g);return m})(h)},o.utf8decode=function(h){return i.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):(function(x){var m,g,y,v,k=x.length,S=new Array(2*k);for(m=g=0;m<k;)if((y=x[m++])<128)S[g++]=y;else if(4<(v=u[y]))S[g++]=65533,m+=v-1;else{for(y&=v===2?31:v===3?15:7;1<v&&m<k;)y=y<<6|63&x[m++],v--;1<v?S[g++]=65533:y<65536?S[g++]=y:(y-=65536,S[g++]=55296|y>>10&1023,S[g++]=56320|1023&y)}return S.length!==g&&(S.subarray?S=S.subarray(0,g):S.length=g),s.applyFromCharCode(S)})(h=s.transformTo(i.uint8array?"uint8array":"array",h))},s.inherits(f,c),f.prototype.processChunk=function(h){var x=s.transformTo(i.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var g=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+u[v[S]]>k?S:k})(x),y=x;g!==x.length&&(i.uint8array?(y=x.subarray(0,g),this.leftOver=x.subarray(g,x.length)):(y=x.slice(0,g),this.leftOver=x.slice(g,x.length))),this.push({data:o.utf8decode(y),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,s.inherits(p,c),p.prototype.processChunk=function(h){this.push({data:o.utf8encode(h.data),meta:h.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var s=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(m){return m}function d(m,g){for(var y=0;y<m.length;++y)g[y]=255&m.charCodeAt(y);return g}n("setimmediate"),o.newBlob=function(m,g){o.checkSupport("blob");try{return new Blob([m],{type:g})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(m),y.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,g,y){var v=[],k=0,S=m.length;if(S<=y)return String.fromCharCode.apply(null,m);for(;k<S;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+y,S)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+y,S)))),k+=y;return v.join("")},stringifyByChar:function(m){for(var g="",y=0;y<m.length;y++)g+=String.fromCharCode(m[y]);return g},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var g=65536,y=o.getTypeOf(m),v=!0;if(y==="uint8array"?v=f.applyCanBeUsed.uint8array:y==="nodebuffer"&&(v=f.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return f.stringifyByChunk(m,y,g)}catch{g=Math.floor(g/2)}return f.stringifyByChar(m)}function h(m,g){for(var y=0;y<m.length;y++)g[y]=m[y];return g}o.applyFromCharCode=p;var x={};x.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},x.array={string:p,array:u,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:u,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:u,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:u},o.transformTo=function(m,g){if(g=g||"",!m)return g;o.checkSupport(m);var y=o.getTypeOf(g);return x[y][m](g)},o.resolve=function(m){for(var g=m.split("/"),y=[],v=0;v<g.length;v++){var k=g[v];k==="."||k===""&&v!==0&&v!==g.length-1||(k===".."?y.pop():y.push(k))}return y.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(m)?"nodebuffer":s.uint8array&&m instanceof Uint8Array?"uint8array":s.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!s[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var g,y,v="";for(y=0;y<(m||"").length;y++)v+="\\x"+((g=m.charCodeAt(y))<16?"0":"")+g.toString(16).toUpperCase();return v},o.delay=function(m,g,y){setImmediate(function(){m.apply(y||null,g||[])})},o.inherits=function(m,g){function y(){}y.prototype=g.prototype,m.prototype=new y},o.extend=function(){var m,g,y={};for(m=0;m<arguments.length;m++)for(g in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],g)&&y[g]===void 0&&(y[g]=arguments[m][g]);return y},o.prepareContent=function(m,g,y,v,k){return c.Promise.resolve(g).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new c.Promise(function(C,j){var N=new FileReader;N.onload=function(T){C(T.target.result)},N.onerror=function(T){j(T.target.error)},N.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=i.decode(S):y&&v!==!0&&(S=(function(j){return d(j,s.uint8array?new Uint8Array(j.length):new Array(j.length))})(S))),S):c.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./signature"),c=n("./zipEntry"),u=n("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(f)+")")}},isSignature:function(f,p){var h=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===p;return this.reader.setIndex(h),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=u.uint8array?"uint8array":"array",h=i.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,h,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),p=this.reader.readInt(4),h=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var x=p-h;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=s(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),u=n("./utf8"),d=n("./compressions"),f=n("./support");function p(h,x){this.options=h,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var x,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(g){for(var y in d)if(Object.prototype.hasOwnProperty.call(d,y)&&d[y].magic===g)return d[y];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var x=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(x),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var x,m,g,y=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<y;)x=h.readInt(2),m=h.readInt(2),g=h.readData(m),this.extraFields[x]={id:x,length:m,value:g};h.setIndex(y)},handleUTF8:function(){var h=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=i.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var y=i.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var x=s(h.value);return x.readInt(1)!==1||c(this.fileName)!==x.readInt(4)?null:u.utf8decode(x.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var x=s(h.value);return x.readInt(1)!==1||c(this.fileComment)!==x.readInt(4)?null:u.utf8decode(x.readData(h.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function s(x,m,g){this.name=x,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=m,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var i=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),u=n("./compressedObject"),d=n("./stream/GenericWorker");s.prototype={internalStream:function(x){var m=null,g="string";try{if(!x)throw new Error("No output type specified.");var y=(g=x.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!y&&(m=m.pipe(new c.Utf8EncodeWorker)),!v&&y&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(k){(m=new d("error")).error(k)}return new i(m,g,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof u&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new c.Utf8EncodeWorker)),u.createWorkerFrom(g,x,m)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<f.length;h++)s.prototype[f[h]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(s){var i,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var u=0,d=new c(x),f=s.document.createTextNode("");d.observe(f,{characterData:!0}),i=function(){f.data=u=++u%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var m=s.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},s.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new s.MessageChannel;p.port1.onmessage=x,i=function(){p.port2.postMessage(0)}}var h=[];function x(){var m,g;a=!0;for(var y=h.length;y;){for(g=h,h=[],m=-1;++m<y;)g[m]();y=h.length}a=!1}r.exports=function(m){h.push(m)!==1||a||i()}}).call(this,typeof Zr<"u"?Zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var s=n("immediate");function i(){}var a={},c=["REJECTED"],u=["FULFILLED"],d=["PENDING"];function f(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,y!==i&&m(this,y)}function p(y,v,k){this.promise=y,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function h(y,v,k){s(function(){var S;try{S=v(k)}catch(C){return a.reject(y,C)}S===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,S)})}function x(y){var v=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof v=="function")return function(){v.apply(y,arguments)}}function m(y,v){var k=!1;function S(N){k||(k=!0,a.reject(y,N))}function C(N){k||(k=!0,a.resolve(y,N))}var j=g(function(){v(C,S)});j.status==="error"&&S(j.value)}function g(y,v){var k={};try{k.value=y(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=f).prototype.finally=function(y){if(typeof y!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(y()).then(function(){return k})},function(k){return v.resolve(y()).then(function(){throw k})})},f.prototype.catch=function(y){return this.then(null,y)},f.prototype.then=function(y,v){if(typeof y!="function"&&this.state===u||typeof v!="function"&&this.state===c)return this;var k=new this.constructor(i);return this.state!==d?h(k,this.state===u?y:v,this.outcome):this.queue.push(new p(k,y,v)),k},p.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},p.prototype.otherCallFulfilled=function(y){h(this.promise,this.onFulfilled,y)},p.prototype.callRejected=function(y){a.reject(this.promise,y)},p.prototype.otherCallRejected=function(y){h(this.promise,this.onRejected,y)},a.resolve=function(y,v){var k=g(x,v);if(k.status==="error")return a.reject(y,k.value);var S=k.value;if(S)m(y,S);else{y.state=u,y.outcome=v;for(var C=-1,j=y.queue.length;++C<j;)y.queue[C].callFulfilled(v)}return y},a.reject=function(y,v){y.state=c,y.outcome=v;for(var k=-1,S=y.queue.length;++k<S;)y.queue[k].callRejected(v);return y},f.resolve=function(y){return y instanceof this?y:a.resolve(new this(i),y)},f.reject=function(y){var v=new this(i);return a.reject(v,y)},f.all=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=y.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),j=0,N=-1,T=new this(i);++N<k;)I(y[N],N);return T;function I(O,F){v.resolve(O).then(function(E){C[F]=E,++j!==k||S||(S=!0,a.resolve(T,C))},function(E){S||(S=!0,a.reject(T,E))})}},f.race=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=y.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,j=new this(i);++C<k;)N=y[C],v.resolve(N).then(function(T){S||(S=!0,a.resolve(j,T))},function(T){S||(S=!0,a.reject(j,T))});var N;return j}},{immediate:36}],38:[function(n,r,o){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var s=n("./zlib/deflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=Object.prototype.toString,f=0,p=-1,h=0,x=8;function m(y){if(!(this instanceof m))return new m(y);this.options=i.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},y||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==f)throw new Error(c[k]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):d.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=s.deflateSetDictionary(this.strm,S))!==f)throw new Error(c[k]);this._dict_set=!0}}function g(y,v){var k=new m(v);if(k.push(y,!0),k.err)throw k.msg||c[k.err];return k.result}m.prototype.push=function(y,v){var k,S,C=this.strm,j=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof y=="string"?C.input=a.string2buf(y):d.call(y)==="[object ArrayBuffer]"?C.input=new Uint8Array(y):C.input=y,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new i.Buf8(j),C.next_out=0,C.avail_out=j),(k=s.deflate(C,S))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(i.shrinkBuf(C.output,C.next_out))):this.onData(i.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=s.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):S!==2||(this.onEnd(f),!(C.avail_out=0))},m.prototype.onData=function(y){this.chunks.push(y)},m.prototype.onEnd=function(y){y===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},o.Deflate=m,o.deflate=g,o.deflateRaw=function(y,v){return(v=v||{}).raw=!0,g(y,v)},o.gzip=function(y,v){return(v=v||{}).gzip=!0,g(y,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var s=n("./zlib/inflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),u=n("./zlib/messages"),d=n("./zlib/zstream"),f=n("./zlib/gzheader"),p=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||m&&m.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&(15&g.windowBits)==0&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,g.windowBits);if(y!==c.Z_OK)throw new Error(u[y]);this.header=new f,s.inflateGetHeader(this.strm,this.header)}function x(m,g){var y=new h(g);if(y.push(m,!0),y.err)throw y.msg||u[y.err];return y.result}h.prototype.push=function(m,g){var y,v,k,S,C,j,N=this.strm,T=this.options.chunkSize,I=this.options.dictionary,O=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?N.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?N.input=new Uint8Array(m):N.input=m,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new i.Buf8(T),N.next_out=0,N.avail_out=T),(y=s.inflate(N,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&I&&(j=typeof I=="string"?a.string2buf(I):p.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,y=s.inflateSetDictionary(this.strm,j)),y===c.Z_BUF_ERROR&&O===!0&&(y=c.Z_OK,O=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&y!==c.Z_STREAM_END&&(N.avail_in!==0||v!==c.Z_FINISH&&v!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(N.output,N.next_out),S=N.next_out-k,C=a.buf2string(N.output,k),N.next_out=S,N.avail_out=T-S,S&&i.arraySet(N.output,N.output,k,S,0),this.onData(C)):this.onData(i.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(O=!0)}while((0<N.avail_in||N.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(v=c.Z_FINISH),v===c.Z_FINISH?(y=s.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):v!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(N.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=h,o.inflate=x,o.inflateRaw=function(m,g){return(g=g||{}).raw=!0,x(m,g)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(c[f]=d[f])}}return c},o.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var i={arraySet:function(c,u,d,f,p){if(u.subarray&&c.subarray)c.set(u.subarray(d,d+f),p);else for(var h=0;h<f;h++)c[p+h]=u[d+h]},flattenChunks:function(c){var u,d,f,p,h,x;for(u=f=0,d=c.length;u<d;u++)f+=c[u].length;for(x=new Uint8Array(f),u=p=0,d=c.length;u<d;u++)h=c[u],x.set(h,p),p+=h.length;return x}},a={arraySet:function(c,u,d,f,p){for(var h=0;h<f;h++)c[p+h]=u[d+h]},flattenChunks:function(c){return[].concat.apply([],c)}};o.setTyped=function(c){c?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,i)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(s)},{}],42:[function(n,r,o){var s=n("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function d(f,p){if(p<65537&&(f.subarray&&a||!f.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(f,p));for(var h="",x=0;x<p;x++)h+=String.fromCharCode(f[x]);return h}c[254]=c[254]=1,o.string2buf=function(f){var p,h,x,m,g,y=f.length,v=0;for(m=0;m<y;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<y&&(64512&(x=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(x-56320),m++),v+=h<128?1:h<2048?2:h<65536?3:4;for(p=new s.Buf8(v),m=g=0;g<v;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<y&&(64512&(x=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(x-56320),m++),h<128?p[g++]=h:(h<2048?p[g++]=192|h>>>6:(h<65536?p[g++]=224|h>>>12:(p[g++]=240|h>>>18,p[g++]=128|h>>>12&63),p[g++]=128|h>>>6&63),p[g++]=128|63&h);return p},o.buf2binstring=function(f){return d(f,f.length)},o.binstring2buf=function(f){for(var p=new s.Buf8(f.length),h=0,x=p.length;h<x;h++)p[h]=f.charCodeAt(h);return p},o.buf2string=function(f,p){var h,x,m,g,y=p||f.length,v=new Array(2*y);for(h=x=0;h<y;)if((m=f[h++])<128)v[x++]=m;else if(4<(g=c[m]))v[x++]=65533,h+=g-1;else{for(m&=g===2?31:g===3?15:7;1<g&&h<y;)m=m<<6|63&f[h++],g--;1<g?v[x++]=65533:m<65536?v[x++]=m:(m-=65536,v[x++]=55296|m>>10&1023,v[x++]=56320|1023&m)}return d(v,x)},o.utf8border=function(f,p){var h;for((p=p||f.length)>f.length&&(p=f.length),h=p-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?p:h+c[f[h]]>p?h:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,i,a,c){for(var u=65535&s|0,d=s>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;d=d+(u=u+i[c++]|0)|0,--f;);u%=65521,d%=65521}return u|d<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var s=(function(){for(var i,a=[],c=0;c<256;c++){i=c;for(var u=0;u<8;u++)i=1&i?3988292384^i>>>1:i>>>1;a[c]=i}return a})();r.exports=function(i,a,c,u){var d=s,f=u+c;i^=-1;for(var p=u;p<f;p++)i=i>>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(n,r,o){var s,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),d=n("./messages"),f=0,p=4,h=0,x=-2,m=-1,g=4,y=2,v=8,k=9,S=286,C=30,j=19,N=2*S+1,T=15,I=3,O=258,F=O+I+1,E=42,L=113,w=1,M=2,B=3,D=4;function U(_,q){return _.msg=d[q],q}function G(_){return(_<<1)-(4<_?9:0)}function A(_){for(var q=_.length;0<=--q;)_[q]=0}function H(_){var q=_.state,W=q.pending;W>_.avail_out&&(W=_.avail_out),W!==0&&(i.arraySet(_.output,q.pending_buf,q.pending_out,W,_.next_out),_.next_out+=W,q.pending_out+=W,_.total_out+=W,_.avail_out-=W,q.pending-=W,q.pending===0&&(q.pending_out=0))}function J(_,q){a._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,H(_.strm)}function R(_,q){_.pending_buf[_.pending++]=q}function ee(_,q){_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=255&q}function Q(_,q){var W,P,z=_.max_chain_length,V=_.strstart,ne=_.prev_length,se=_.nice_match,Y=_.strstart>_.w_size-F?_.strstart-(_.w_size-F):0,K=_.window,re=_.w_mask,oe=_.prev,$=_.strstart+O,X=K[V+ne-1],le=K[V+ne];_.prev_length>=_.good_match&&(z>>=2),se>_.lookahead&&(se=_.lookahead);do if(K[(W=q)+ne]===le&&K[W+ne-1]===X&&K[W]===K[V]&&K[++W]===K[V+1]){V+=2,W++;do;while(K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&V<$);if(P=O-($-V),V=$-O,ne<P){if(_.match_start=q,se<=(ne=P))break;X=K[V+ne-1],le=K[V+ne]}}while((q=oe[q&re])>Y&&--z!=0);return ne<=_.lookahead?ne:_.lookahead}function de(_){var q,W,P,z,V,ne,se,Y,K,re,oe=_.w_size;do{if(z=_.window_size-_.lookahead-_.strstart,_.strstart>=oe+(oe-F)){for(i.arraySet(_.window,_.window,oe,oe,0),_.match_start-=oe,_.strstart-=oe,_.block_start-=oe,q=W=_.hash_size;P=_.head[--q],_.head[q]=oe<=P?P-oe:0,--W;);for(q=W=oe;P=_.prev[--q],_.prev[q]=oe<=P?P-oe:0,--W;);z+=oe}if(_.strm.avail_in===0)break;if(ne=_.strm,se=_.window,Y=_.strstart+_.lookahead,K=z,re=void 0,re=ne.avail_in,K<re&&(re=K),W=re===0?0:(ne.avail_in-=re,i.arraySet(se,ne.input,ne.next_in,re,Y),ne.state.wrap===1?ne.adler=c(ne.adler,se,re,Y):ne.state.wrap===2&&(ne.adler=u(ne.adler,se,re,Y)),ne.next_in+=re,ne.total_in+=re,re),_.lookahead+=W,_.lookahead+_.insert>=I)for(V=_.strstart-_.insert,_.ins_h=_.window[V],_.ins_h=(_.ins_h<<_.hash_shift^_.window[V+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[V+I-1])&_.hash_mask,_.prev[V&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=V,V++,_.insert--,!(_.lookahead+_.insert<I)););}while(_.lookahead<F&&_.strm.avail_in!==0)}function ae(_,q){for(var W,P;;){if(_.lookahead<F){if(de(_),_.lookahead<F&&q===f)return w;if(_.lookahead===0)break}if(W=0,_.lookahead>=I&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),W!==0&&_.strstart-W<=_.w_size-F&&(_.match_length=Q(_,W)),_.match_length>=I)if(P=a._tr_tally(_,_.strstart-_.match_start,_.match_length-I),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=I){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else P=a._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(P&&(J(_,!1),_.strm.avail_out===0))return w}return _.insert=_.strstart<I-1?_.strstart:I-1,q===p?(J(_,!0),_.strm.avail_out===0?B:D):_.last_lit&&(J(_,!1),_.strm.avail_out===0)?w:M}function ue(_,q){for(var W,P,z;;){if(_.lookahead<F){if(de(_),_.lookahead<F&&q===f)return w;if(_.lookahead===0)break}if(W=0,_.lookahead>=I&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=I-1,W!==0&&_.prev_length<_.max_lazy_match&&_.strstart-W<=_.w_size-F&&(_.match_length=Q(_,W),_.match_length<=5&&(_.strategy===1||_.match_length===I&&4096<_.strstart-_.match_start)&&(_.match_length=I-1)),_.prev_length>=I&&_.match_length<=_.prev_length){for(z=_.strstart+_.lookahead-I,P=a._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-I),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=I-1,_.strstart++,P&&(J(_,!1),_.strm.avail_out===0))return w}else if(_.match_available){if((P=a._tr_tally(_,0,_.window[_.strstart-1]))&&J(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return w}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(P=a._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<I-1?_.strstart:I-1,q===p?(J(_,!0),_.strm.avail_out===0?B:D):_.last_lit&&(J(_,!1),_.strm.avail_out===0)?w:M}function fe(_,q,W,P,z){this.good_length=_,this.max_lazy=q,this.nice_length=W,this.max_chain=P,this.func=z}function he(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*N),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*j+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(T+1),this.heap=new i.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ye(_){var q;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=y,(q=_.state).pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap?E:L,_.adler=q.wrap===2?0:1,q.last_flush=f,a._tr_init(q),h):U(_,x)}function je(_){var q=ye(_);return q===h&&(function(W){W.window_size=2*W.w_size,A(W.head),W.max_lazy_match=s[W.level].max_lazy,W.good_match=s[W.level].good_length,W.nice_match=s[W.level].nice_length,W.max_chain_length=s[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=I-1,W.match_available=0,W.ins_h=0})(_.state),q}function ze(_,q,W,P,z,V){if(!_)return x;var ne=1;if(q===m&&(q=6),P<0?(ne=0,P=-P):15<P&&(ne=2,P-=16),z<1||k<z||W!==v||P<8||15<P||q<0||9<q||V<0||g<V)return U(_,x);P===8&&(P=9);var se=new he;return(_.state=se).strm=_,se.wrap=ne,se.gzhead=null,se.w_bits=P,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=z+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+I-1)/I),se.window=new i.Buf8(2*se.w_size),se.head=new i.Buf16(se.hash_size),se.prev=new i.Buf16(se.w_size),se.lit_bufsize=1<<z+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new i.Buf8(se.pending_buf_size),se.d_buf=1*se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=q,se.strategy=V,se.method=W,je(_)}s=[new fe(0,0,0,0,function(_,q){var W=65535;for(W>_.pending_buf_size-5&&(W=_.pending_buf_size-5);;){if(_.lookahead<=1){if(de(_),_.lookahead===0&&q===f)return w;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var P=_.block_start+W;if((_.strstart===0||_.strstart>=P)&&(_.lookahead=_.strstart-P,_.strstart=P,J(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-F&&(J(_,!1),_.strm.avail_out===0))return w}return _.insert=0,q===p?(J(_,!0),_.strm.avail_out===0?B:D):(_.strstart>_.block_start&&(J(_,!1),_.strm.avail_out),w)}),new fe(4,4,8,4,ae),new fe(4,5,16,8,ae),new fe(4,6,32,32,ae),new fe(4,4,16,16,ue),new fe(8,16,32,32,ue),new fe(8,16,128,128,ue),new fe(8,32,128,256,ue),new fe(32,128,258,1024,ue),new fe(32,258,258,4096,ue)],o.deflateInit=function(_,q){return ze(_,q,v,15,8,0)},o.deflateInit2=ze,o.deflateReset=je,o.deflateResetKeep=ye,o.deflateSetHeader=function(_,q){return _&&_.state?_.state.wrap!==2?x:(_.state.gzhead=q,h):x},o.deflate=function(_,q){var W,P,z,V;if(!_||!_.state||5<q||q<0)return _?U(_,x):x;if(P=_.state,!_.output||!_.input&&_.avail_in!==0||P.status===666&&q!==p)return U(_,_.avail_out===0?-5:x);if(P.strm=_,W=P.last_flush,P.last_flush=q,P.status===E)if(P.wrap===2)_.adler=0,R(P,31),R(P,139),R(P,8),P.gzhead?(R(P,(P.gzhead.text?1:0)+(P.gzhead.hcrc?2:0)+(P.gzhead.extra?4:0)+(P.gzhead.name?8:0)+(P.gzhead.comment?16:0)),R(P,255&P.gzhead.time),R(P,P.gzhead.time>>8&255),R(P,P.gzhead.time>>16&255),R(P,P.gzhead.time>>24&255),R(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),R(P,255&P.gzhead.os),P.gzhead.extra&&P.gzhead.extra.length&&(R(P,255&P.gzhead.extra.length),R(P,P.gzhead.extra.length>>8&255)),P.gzhead.hcrc&&(_.adler=u(_.adler,P.pending_buf,P.pending,0)),P.gzindex=0,P.status=69):(R(P,0),R(P,0),R(P,0),R(P,0),R(P,0),R(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),R(P,3),P.status=L);else{var ne=v+(P.w_bits-8<<4)<<8;ne|=(2<=P.strategy||P.level<2?0:P.level<6?1:P.level===6?2:3)<<6,P.strstart!==0&&(ne|=32),ne+=31-ne%31,P.status=L,ee(P,ne),P.strstart!==0&&(ee(P,_.adler>>>16),ee(P,65535&_.adler)),_.adler=1}if(P.status===69)if(P.gzhead.extra){for(z=P.pending;P.gzindex<(65535&P.gzhead.extra.length)&&(P.pending!==P.pending_buf_size||(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending!==P.pending_buf_size));)R(P,255&P.gzhead.extra[P.gzindex]),P.gzindex++;P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),P.gzindex===P.gzhead.extra.length&&(P.gzindex=0,P.status=73)}else P.status=73;if(P.status===73)if(P.gzhead.name){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending===P.pending_buf_size)){V=1;break}V=P.gzindex<P.gzhead.name.length?255&P.gzhead.name.charCodeAt(P.gzindex++):0,R(P,V)}while(V!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V===0&&(P.gzindex=0,P.status=91)}else P.status=91;if(P.status===91)if(P.gzhead.comment){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending===P.pending_buf_size)){V=1;break}V=P.gzindex<P.gzhead.comment.length?255&P.gzhead.comment.charCodeAt(P.gzindex++):0,R(P,V)}while(V!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V===0&&(P.status=103)}else P.status=103;if(P.status===103&&(P.gzhead.hcrc?(P.pending+2>P.pending_buf_size&&H(_),P.pending+2<=P.pending_buf_size&&(R(P,255&_.adler),R(P,_.adler>>8&255),_.adler=0,P.status=L)):P.status=L),P.pending!==0){if(H(_),_.avail_out===0)return P.last_flush=-1,h}else if(_.avail_in===0&&G(q)<=G(W)&&q!==p)return U(_,-5);if(P.status===666&&_.avail_in!==0)return U(_,-5);if(_.avail_in!==0||P.lookahead!==0||q!==f&&P.status!==666){var se=P.strategy===2?(function(Y,K){for(var re;;){if(Y.lookahead===0&&(de(Y),Y.lookahead===0)){if(K===f)return w;break}if(Y.match_length=0,re=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,re&&(J(Y,!1),Y.strm.avail_out===0))return w}return Y.insert=0,K===p?(J(Y,!0),Y.strm.avail_out===0?B:D):Y.last_lit&&(J(Y,!1),Y.strm.avail_out===0)?w:M})(P,q):P.strategy===3?(function(Y,K){for(var re,oe,$,X,le=Y.window;;){if(Y.lookahead<=O){if(de(Y),Y.lookahead<=O&&K===f)return w;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=I&&0<Y.strstart&&(oe=le[$=Y.strstart-1])===le[++$]&&oe===le[++$]&&oe===le[++$]){X=Y.strstart+O;do;while(oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&$<X);Y.match_length=O-(X-$),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=I?(re=a._tr_tally(Y,1,Y.match_length-I),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(re=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),re&&(J(Y,!1),Y.strm.avail_out===0))return w}return Y.insert=0,K===p?(J(Y,!0),Y.strm.avail_out===0?B:D):Y.last_lit&&(J(Y,!1),Y.strm.avail_out===0)?w:M})(P,q):s[P.level].func(P,q);if(se!==B&&se!==D||(P.status=666),se===w||se===B)return _.avail_out===0&&(P.last_flush=-1),h;if(se===M&&(q===1?a._tr_align(P):q!==5&&(a._tr_stored_block(P,0,0,!1),q===3&&(A(P.head),P.lookahead===0&&(P.strstart=0,P.block_start=0,P.insert=0))),H(_),_.avail_out===0))return P.last_flush=-1,h}return q!==p?h:P.wrap<=0?1:(P.wrap===2?(R(P,255&_.adler),R(P,_.adler>>8&255),R(P,_.adler>>16&255),R(P,_.adler>>24&255),R(P,255&_.total_in),R(P,_.total_in>>8&255),R(P,_.total_in>>16&255),R(P,_.total_in>>24&255)):(ee(P,_.adler>>>16),ee(P,65535&_.adler)),H(_),0<P.wrap&&(P.wrap=-P.wrap),P.pending!==0?h:1)},o.deflateEnd=function(_){var q;return _&&_.state?(q=_.state.status)!==E&&q!==69&&q!==73&&q!==91&&q!==103&&q!==L&&q!==666?U(_,x):(_.state=null,q===L?U(_,-3):h):x},o.deflateSetDictionary=function(_,q){var W,P,z,V,ne,se,Y,K,re=q.length;if(!_||!_.state||(V=(W=_.state).wrap)===2||V===1&&W.status!==E||W.lookahead)return x;for(V===1&&(_.adler=c(_.adler,q,re,0)),W.wrap=0,re>=W.w_size&&(V===0&&(A(W.head),W.strstart=0,W.block_start=0,W.insert=0),K=new i.Buf8(W.w_size),i.arraySet(K,q,re-W.w_size,W.w_size,0),q=K,re=W.w_size),ne=_.avail_in,se=_.next_in,Y=_.input,_.avail_in=re,_.next_in=0,_.input=q,de(W);W.lookahead>=I;){for(P=W.strstart,z=W.lookahead-(I-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[P+I-1])&W.hash_mask,W.prev[P&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=P,P++,--z;);W.strstart=P,W.lookahead=I-1,de(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=I-1,W.match_available=0,_.next_in=se,_.input=Y,_.avail_in=ne,W.wrap=V,h},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(s,i){var a,c,u,d,f,p,h,x,m,g,y,v,k,S,C,j,N,T,I,O,F,E,L,w,M;a=s.state,c=s.next_in,w=s.input,u=c+(s.avail_in-5),d=s.next_out,M=s.output,f=d-(i-s.avail_out),p=d+(s.avail_out-257),h=a.dmax,x=a.wsize,m=a.whave,g=a.wnext,y=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,j=(1<<a.lenbits)-1,N=(1<<a.distbits)-1;e:do{k<15&&(v+=w[c++]<<k,k+=8,v+=w[c++]<<k,k+=8),T=S[v&j];t:for(;;){if(v>>>=I=T>>>24,k-=I,(I=T>>>16&255)===0)M[d++]=65535&T;else{if(!(16&I)){if((64&I)==0){T=S[(65535&T)+(v&(1<<I)-1)];continue t}if(32&I){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}O=65535&T,(I&=15)&&(k<I&&(v+=w[c++]<<k,k+=8),O+=v&(1<<I)-1,v>>>=I,k-=I),k<15&&(v+=w[c++]<<k,k+=8,v+=w[c++]<<k,k+=8),T=C[v&N];n:for(;;){if(v>>>=I=T>>>24,k-=I,!(16&(I=T>>>16&255))){if((64&I)==0){T=C[(65535&T)+(v&(1<<I)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(F=65535&T,k<(I&=15)&&(v+=w[c++]<<k,(k+=8)<I&&(v+=w[c++]<<k,k+=8)),h<(F+=v&(1<<I)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=I,k-=I,(I=d-f)<F){if(m<(I=F-I)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(L=y,(E=0)===g){if(E+=x-I,I<O){for(O-=I;M[d++]=y[E++],--I;);E=d-F,L=M}}else if(g<I){if(E+=x+g-I,(I-=g)<O){for(O-=I;M[d++]=y[E++],--I;);if(E=0,g<O){for(O-=I=g;M[d++]=y[E++],--I;);E=d-F,L=M}}}else if(E+=g-I,I<O){for(O-=I;M[d++]=y[E++],--I;);E=d-F,L=M}for(;2<O;)M[d++]=L[E++],M[d++]=L[E++],M[d++]=L[E++],O-=3;O&&(M[d++]=L[E++],1<O&&(M[d++]=L[E++]))}else{for(E=d-F;M[d++]=M[E++],M[d++]=M[E++],M[d++]=M[E++],2<(O-=3););O&&(M[d++]=M[E++],1<O&&(M[d++]=M[E++]))}break}}break}}while(c<u&&d<p);c-=O=k>>3,v&=(1<<(k-=O<<3))-1,s.next_in=c,s.next_out=d,s.avail_in=c<u?u-c+5:5-(c-u),s.avail_out=d<p?p-d+257:257-(d-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var s=n("../utils/common"),i=n("./adler32"),a=n("./crc32"),c=n("./inffast"),u=n("./inftrees"),d=1,f=2,p=0,h=-2,x=1,m=852,g=592;function y(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var L;return E&&E.state?(L=E.state,E.total_in=E.total_out=L.total=0,E.msg="",L.wrap&&(E.adler=1&L.wrap),L.mode=x,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new s.Buf32(m),L.distcode=L.distdyn=new s.Buf32(g),L.sane=1,L.back=-1,p):h}function S(E){var L;return E&&E.state?((L=E.state).wsize=0,L.whave=0,L.wnext=0,k(E)):h}function C(E,L){var w,M;return E&&E.state?(M=E.state,L<0?(w=0,L=-L):(w=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?h:(M.window!==null&&M.wbits!==L&&(M.window=null),M.wrap=w,M.wbits=L,S(E))):h}function j(E,L){var w,M;return E?(M=new v,(E.state=M).window=null,(w=C(E,L))!==p&&(E.state=null),w):h}var N,T,I=!0;function O(E){if(I){var L;for(N=new s.Buf32(512),T=new s.Buf32(32),L=0;L<144;)E.lens[L++]=8;for(;L<256;)E.lens[L++]=9;for(;L<280;)E.lens[L++]=7;for(;L<288;)E.lens[L++]=8;for(u(d,E.lens,0,288,N,0,E.work,{bits:9}),L=0;L<32;)E.lens[L++]=5;u(f,E.lens,0,32,T,0,E.work,{bits:5}),I=!1}E.lencode=N,E.lenbits=9,E.distcode=T,E.distbits=5}function F(E,L,w,M){var B,D=E.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new s.Buf8(D.wsize)),M>=D.wsize?(s.arraySet(D.window,L,w-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(M<(B=D.wsize-D.wnext)&&(B=M),s.arraySet(D.window,L,w-M,B,D.wnext),(M-=B)?(s.arraySet(D.window,L,w-M,M,0),D.wnext=M,D.whave=D.wsize):(D.wnext+=B,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=B))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return j(E,15)},o.inflateInit2=j,o.inflate=function(E,L){var w,M,B,D,U,G,A,H,J,R,ee,Q,de,ae,ue,fe,he,ye,je,ze,_,q,W,P,z=0,V=new s.Buf8(4),ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return h;(w=E.state).mode===12&&(w.mode=13),U=E.next_out,B=E.output,A=E.avail_out,D=E.next_in,M=E.input,G=E.avail_in,H=w.hold,J=w.bits,R=G,ee=A,q=p;e:for(;;)switch(w.mode){case x:if(w.wrap===0){w.mode=13;break}for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(2&w.wrap&&H===35615){V[w.check=0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0),J=H=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&H)<<8)+(H>>8))%31){E.msg="incorrect header check",w.mode=30;break}if((15&H)!=8){E.msg="unknown compression method",w.mode=30;break}if(J-=4,_=8+(15&(H>>>=4)),w.wbits===0)w.wbits=_;else if(_>w.wbits){E.msg="invalid window size",w.mode=30;break}w.dmax=1<<_,E.adler=w.check=1,w.mode=512&H?10:12,J=H=0;break;case 2:for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(w.flags=H,(255&w.flags)!=8){E.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){E.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=H>>8&1),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0,w.mode=3;case 3:for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.head&&(w.head.time=H),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,V[2]=H>>>16&255,V[3]=H>>>24&255,w.check=a(w.check,V,4,0)),J=H=0,w.mode=4;case 4:for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.head&&(w.head.xflags=255&H,w.head.os=H>>8),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0,w.mode=5;case 5:if(1024&w.flags){for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.length=H,w.head&&(w.head.extra_len=H),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(G<(Q=w.length)&&(Q=G),Q&&(w.head&&(_=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,M,D,Q,_)),512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,w.length-=Q),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(G===0)break e;for(Q=0;_=M[D+Q++],w.head&&_&&w.length<65536&&(w.head.name+=String.fromCharCode(_)),_&&Q<G;);if(512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,_)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(G===0)break e;for(Q=0;_=M[D+Q++],w.head&&_&&w.length<65536&&(w.head.comment+=String.fromCharCode(_)),_&&Q<G;);if(512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,_)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H!==(65535&w.check)){E.msg="header crc mismatch",w.mode=30;break}J=H=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),E.adler=w.check=0,w.mode=12;break;case 10:for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}E.adler=w.check=y(H),J=H=0,w.mode=11;case 11:if(w.havedict===0)return E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,2;E.adler=w.check=1,w.mode=12;case 12:if(L===5||L===6)break e;case 13:if(w.last){H>>>=7&J,J-=7&J,w.mode=27;break}for(;J<3;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}switch(w.last=1&H,J-=1,3&(H>>>=1)){case 0:w.mode=14;break;case 1:if(O(w),w.mode=20,L!==6)break;H>>>=2,J-=2;break e;case 2:w.mode=17;break;case 3:E.msg="invalid block type",w.mode=30}H>>>=2,J-=2;break;case 14:for(H>>>=7&J,J-=7&J;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if((65535&H)!=(H>>>16^65535)){E.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&H,J=H=0,w.mode=15,L===6)break e;case 15:w.mode=16;case 16:if(Q=w.length){if(G<Q&&(Q=G),A<Q&&(Q=A),Q===0)break e;s.arraySet(B,M,D,Q,U),G-=Q,D+=Q,A-=Q,U+=Q,w.length-=Q;break}w.mode=12;break;case 17:for(;J<14;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(w.nlen=257+(31&H),H>>>=5,J-=5,w.ndist=1+(31&H),H>>>=5,J-=5,w.ncode=4+(15&H),H>>>=4,J-=4,286<w.nlen||30<w.ndist){E.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;J<3;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.lens[ne[w.have++]]=7&H,H>>>=3,J-=3}for(;w.have<19;)w.lens[ne[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,W={bits:w.lenbits},q=u(0,w.lens,0,19,w.lencode,0,w.work,W),w.lenbits=W.bits,q){E.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;fe=(z=w.lencode[H&(1<<w.lenbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(he<16)H>>>=ue,J-=ue,w.lens[w.have++]=he;else{if(he===16){for(P=ue+2;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H>>>=ue,J-=ue,w.have===0){E.msg="invalid bit length repeat",w.mode=30;break}_=w.lens[w.have-1],Q=3+(3&H),H>>>=2,J-=2}else if(he===17){for(P=ue+3;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}J-=ue,_=0,Q=3+(7&(H>>>=ue)),H>>>=3,J-=3}else{for(P=ue+7;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}J-=ue,_=0,Q=11+(127&(H>>>=ue)),H>>>=7,J-=7}if(w.have+Q>w.nlen+w.ndist){E.msg="invalid bit length repeat",w.mode=30;break}for(;Q--;)w.lens[w.have++]=_}}if(w.mode===30)break;if(w.lens[256]===0){E.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,W={bits:w.lenbits},q=u(d,w.lens,0,w.nlen,w.lencode,0,w.work,W),w.lenbits=W.bits,q){E.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,W={bits:w.distbits},q=u(f,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,W),w.distbits=W.bits,q){E.msg="invalid distances set",w.mode=30;break}if(w.mode=20,L===6)break e;case 20:w.mode=21;case 21:if(6<=G&&258<=A){E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,c(E,ee),U=E.next_out,B=E.output,A=E.avail_out,D=E.next_in,M=E.input,G=E.avail_in,H=w.hold,J=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;fe=(z=w.lencode[H&(1<<w.lenbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(fe&&(240&fe)==0){for(ye=ue,je=fe,ze=he;fe=(z=w.lencode[ze+((H&(1<<ye+je)-1)>>ye)])>>>16&255,he=65535&z,!(ye+(ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}H>>>=ye,J-=ye,w.back+=ye}if(H>>>=ue,J-=ue,w.back+=ue,w.length=he,fe===0){w.mode=26;break}if(32&fe){w.back=-1,w.mode=12;break}if(64&fe){E.msg="invalid literal/length code",w.mode=30;break}w.extra=15&fe,w.mode=22;case 22:if(w.extra){for(P=w.extra;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.length+=H&(1<<w.extra)-1,H>>>=w.extra,J-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;fe=(z=w.distcode[H&(1<<w.distbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if((240&fe)==0){for(ye=ue,je=fe,ze=he;fe=(z=w.distcode[ze+((H&(1<<ye+je)-1)>>ye)])>>>16&255,he=65535&z,!(ye+(ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}H>>>=ye,J-=ye,w.back+=ye}if(H>>>=ue,J-=ue,w.back+=ue,64&fe){E.msg="invalid distance code",w.mode=30;break}w.offset=he,w.extra=15&fe,w.mode=24;case 24:if(w.extra){for(P=w.extra;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.offset+=H&(1<<w.extra)-1,H>>>=w.extra,J-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){E.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(A===0)break e;if(Q=ee-A,w.offset>Q){if((Q=w.offset-Q)>w.whave&&w.sane){E.msg="invalid distance too far back",w.mode=30;break}de=Q>w.wnext?(Q-=w.wnext,w.wsize-Q):w.wnext-Q,Q>w.length&&(Q=w.length),ae=w.window}else ae=B,de=U-w.offset,Q=w.length;for(A<Q&&(Q=A),A-=Q,w.length-=Q;B[U++]=ae[de++],--Q;);w.length===0&&(w.mode=21);break;case 26:if(A===0)break e;B[U++]=w.length,A--,w.mode=21;break;case 27:if(w.wrap){for(;J<32;){if(G===0)break e;G--,H|=M[D++]<<J,J+=8}if(ee-=A,E.total_out+=ee,w.total+=ee,ee&&(E.adler=w.check=w.flags?a(w.check,B,ee,U-ee):i(w.check,B,ee,U-ee)),ee=A,(w.flags?H:y(H))!==w.check){E.msg="incorrect data check",w.mode=30;break}J=H=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H!==(4294967295&w.total)){E.msg="incorrect length check",w.mode=30;break}J=H=0}w.mode=29;case 29:q=1;break e;case 30:q=-3;break e;case 31:return-4;default:return h}return E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,(w.wsize||ee!==E.avail_out&&w.mode<30&&(w.mode<27||L!==4))&&F(E,E.output,E.next_out,ee-E.avail_out)?(w.mode=31,-4):(R-=E.avail_in,ee-=E.avail_out,E.total_in+=R,E.total_out+=ee,w.total+=ee,w.wrap&&ee&&(E.adler=w.check=w.flags?a(w.check,B,ee,E.next_out-ee):i(w.check,B,ee,E.next_out-ee)),E.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(R==0&&ee===0||L===4)&&q===p&&(q=-5),q)},o.inflateEnd=function(E){if(!E||!E.state)return h;var L=E.state;return L.window&&(L.window=null),E.state=null,p},o.inflateGetHeader=function(E,L){var w;return E&&E.state?(2&(w=E.state).wrap)==0?h:((w.head=L).done=!1,p):h},o.inflateSetDictionary=function(E,L){var w,M=L.length;return E&&E.state?(w=E.state).wrap!==0&&w.mode!==11?h:w.mode===11&&i(1,L,M,0)!==w.check?-3:F(E,L,M,M)?(w.mode=31,-4):(w.havedict=1,p):h},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var s=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,f,p,h,x,m,g,y){var v,k,S,C,j,N,T,I,O,F=y.bits,E=0,L=0,w=0,M=0,B=0,D=0,U=0,G=0,A=0,H=0,J=null,R=0,ee=new s.Buf16(16),Q=new s.Buf16(16),de=null,ae=0;for(E=0;E<=15;E++)ee[E]=0;for(L=0;L<h;L++)ee[f[p+L]]++;for(B=F,M=15;1<=M&&ee[M]===0;M--);if(M<B&&(B=M),M===0)return x[m++]=20971520,x[m++]=20971520,y.bits=1,0;for(w=1;w<M&&ee[w]===0;w++);for(B<w&&(B=w),E=G=1;E<=15;E++)if(G<<=1,(G-=ee[E])<0)return-1;if(0<G&&(d===0||M!==1))return-1;for(Q[1]=0,E=1;E<15;E++)Q[E+1]=Q[E]+ee[E];for(L=0;L<h;L++)f[p+L]!==0&&(g[Q[f[p+L]]++]=L);if(N=d===0?(J=de=g,19):d===1?(J=i,R-=257,de=a,ae-=257,256):(J=c,de=u,-1),E=w,j=m,U=L=H=0,S=-1,C=(A=1<<(D=B))-1,d===1&&852<A||d===2&&592<A)return 1;for(;;){for(T=E-U,O=g[L]<N?(I=0,g[L]):g[L]>N?(I=de[ae+g[L]],J[R+g[L]]):(I=96,0),v=1<<E-U,w=k=1<<D;x[j+(H>>U)+(k-=v)]=T<<24|I<<16|O|0,k!==0;);for(v=1<<E-1;H&v;)v>>=1;if(v!==0?(H&=v-1,H+=v):H=0,L++,--ee[E]==0){if(E===M)break;E=f[p+g[L]]}if(B<E&&(H&C)!==S){for(U===0&&(U=B),j+=w,G=1<<(D=E-U);D+U<M&&!((G-=ee[D+U])<=0);)D++,G<<=1;if(A+=1<<D,d===1&&852<A||d===2&&592<A)return 1;x[S=H&C]=B<<24|D<<16|j-m|0}}return H!==0&&(x[j+H]=E-U<<24|64<<16|0),y.bits=B,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var s=n("../utils/common"),i=0,a=1;function c(z){for(var V=z.length;0<=--V;)z[V]=0}var u=0,d=29,f=256,p=f+1+d,h=30,x=19,m=2*p+1,g=15,y=16,v=7,k=256,S=16,C=17,j=18,N=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],T=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));c(F);var E=new Array(2*h);c(E);var L=new Array(512);c(L);var w=new Array(256);c(w);var M=new Array(d);c(M);var B,D,U,G=new Array(h);function A(z,V,ne,se,Y){this.static_tree=z,this.extra_bits=V,this.extra_base=ne,this.elems=se,this.max_length=Y,this.has_stree=z&&z.length}function H(z,V){this.dyn_tree=z,this.max_code=0,this.stat_desc=V}function J(z){return z<256?L[z]:L[256+(z>>>7)]}function R(z,V){z.pending_buf[z.pending++]=255&V,z.pending_buf[z.pending++]=V>>>8&255}function ee(z,V,ne){z.bi_valid>y-ne?(z.bi_buf|=V<<z.bi_valid&65535,R(z,z.bi_buf),z.bi_buf=V>>y-z.bi_valid,z.bi_valid+=ne-y):(z.bi_buf|=V<<z.bi_valid&65535,z.bi_valid+=ne)}function Q(z,V,ne){ee(z,ne[2*V],ne[2*V+1])}function de(z,V){for(var ne=0;ne|=1&z,z>>>=1,ne<<=1,0<--V;);return ne>>>1}function ae(z,V,ne){var se,Y,K=new Array(g+1),re=0;for(se=1;se<=g;se++)K[se]=re=re+ne[se-1]<<1;for(Y=0;Y<=V;Y++){var oe=z[2*Y+1];oe!==0&&(z[2*Y]=de(K[oe]++,oe))}}function ue(z){var V;for(V=0;V<p;V++)z.dyn_ltree[2*V]=0;for(V=0;V<h;V++)z.dyn_dtree[2*V]=0;for(V=0;V<x;V++)z.bl_tree[2*V]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function fe(z){8<z.bi_valid?R(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function he(z,V,ne,se){var Y=2*V,K=2*ne;return z[Y]<z[K]||z[Y]===z[K]&&se[V]<=se[ne]}function ye(z,V,ne){for(var se=z.heap[ne],Y=ne<<1;Y<=z.heap_len&&(Y<z.heap_len&&he(V,z.heap[Y+1],z.heap[Y],z.depth)&&Y++,!he(V,se,z.heap[Y],z.depth));)z.heap[ne]=z.heap[Y],ne=Y,Y<<=1;z.heap[ne]=se}function je(z,V,ne){var se,Y,K,re,oe=0;if(z.last_lit!==0)for(;se=z.pending_buf[z.d_buf+2*oe]<<8|z.pending_buf[z.d_buf+2*oe+1],Y=z.pending_buf[z.l_buf+oe],oe++,se===0?Q(z,Y,V):(Q(z,(K=w[Y])+f+1,V),(re=N[K])!==0&&ee(z,Y-=M[K],re),Q(z,K=J(--se),ne),(re=T[K])!==0&&ee(z,se-=G[K],re)),oe<z.last_lit;);Q(z,k,V)}function ze(z,V){var ne,se,Y,K=V.dyn_tree,re=V.stat_desc.static_tree,oe=V.stat_desc.has_stree,$=V.stat_desc.elems,X=-1;for(z.heap_len=0,z.heap_max=m,ne=0;ne<$;ne++)K[2*ne]!==0?(z.heap[++z.heap_len]=X=ne,z.depth[ne]=0):K[2*ne+1]=0;for(;z.heap_len<2;)K[2*(Y=z.heap[++z.heap_len]=X<2?++X:0)]=1,z.depth[Y]=0,z.opt_len--,oe&&(z.static_len-=re[2*Y+1]);for(V.max_code=X,ne=z.heap_len>>1;1<=ne;ne--)ye(z,K,ne);for(Y=$;ne=z.heap[1],z.heap[1]=z.heap[z.heap_len--],ye(z,K,1),se=z.heap[1],z.heap[--z.heap_max]=ne,z.heap[--z.heap_max]=se,K[2*Y]=K[2*ne]+K[2*se],z.depth[Y]=(z.depth[ne]>=z.depth[se]?z.depth[ne]:z.depth[se])+1,K[2*ne+1]=K[2*se+1]=Y,z.heap[1]=Y++,ye(z,K,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(le,we){var Ie,Ke,ft,Pe,At,Ut,qe=we.dyn_tree,Vt=we.max_code,kt=we.stat_desc.static_tree,eg=we.stat_desc.has_stree,tg=we.stat_desc.extra_bits,ll=we.stat_desc.extra_base,lr=we.stat_desc.max_length,Wr=0;for(Pe=0;Pe<=g;Pe++)le.bl_count[Pe]=0;for(qe[2*le.heap[le.heap_max]+1]=0,Ie=le.heap_max+1;Ie<m;Ie++)lr<(Pe=qe[2*qe[2*(Ke=le.heap[Ie])+1]+1]+1)&&(Pe=lr,Wr++),qe[2*Ke+1]=Pe,Vt<Ke||(le.bl_count[Pe]++,At=0,ll<=Ke&&(At=tg[Ke-ll]),Ut=qe[2*Ke],le.opt_len+=Ut*(Pe+At),eg&&(le.static_len+=Ut*(kt[2*Ke+1]+At)));if(Wr!==0){do{for(Pe=lr-1;le.bl_count[Pe]===0;)Pe--;le.bl_count[Pe]--,le.bl_count[Pe+1]+=2,le.bl_count[lr]--,Wr-=2}while(0<Wr);for(Pe=lr;Pe!==0;Pe--)for(Ke=le.bl_count[Pe];Ke!==0;)Vt<(ft=le.heap[--Ie])||(qe[2*ft+1]!==Pe&&(le.opt_len+=(Pe-qe[2*ft+1])*qe[2*ft],qe[2*ft+1]=Pe),Ke--)}})(z,V),ae(K,X,z.bl_count)}function _(z,V,ne){var se,Y,K=-1,re=V[1],oe=0,$=7,X=4;for(re===0&&($=138,X=3),V[2*(ne+1)+1]=65535,se=0;se<=ne;se++)Y=re,re=V[2*(se+1)+1],++oe<$&&Y===re||(oe<X?z.bl_tree[2*Y]+=oe:Y!==0?(Y!==K&&z.bl_tree[2*Y]++,z.bl_tree[2*S]++):oe<=10?z.bl_tree[2*C]++:z.bl_tree[2*j]++,K=Y,X=(oe=0)===re?($=138,3):Y===re?($=6,3):($=7,4))}function q(z,V,ne){var se,Y,K=-1,re=V[1],oe=0,$=7,X=4;for(re===0&&($=138,X=3),se=0;se<=ne;se++)if(Y=re,re=V[2*(se+1)+1],!(++oe<$&&Y===re)){if(oe<X)for(;Q(z,Y,z.bl_tree),--oe!=0;);else Y!==0?(Y!==K&&(Q(z,Y,z.bl_tree),oe--),Q(z,S,z.bl_tree),ee(z,oe-3,2)):oe<=10?(Q(z,C,z.bl_tree),ee(z,oe-3,3)):(Q(z,j,z.bl_tree),ee(z,oe-11,7));K=Y,X=(oe=0)===re?($=138,3):Y===re?($=6,3):($=7,4)}}c(G);var W=!1;function P(z,V,ne,se){ee(z,(u<<1)+(se?1:0),3),(function(Y,K,re,oe){fe(Y),R(Y,re),R(Y,~re),s.arraySet(Y.pending_buf,Y.window,K,re,Y.pending),Y.pending+=re})(z,V,ne)}o._tr_init=function(z){W||((function(){var V,ne,se,Y,K,re=new Array(g+1);for(Y=se=0;Y<d-1;Y++)for(M[Y]=se,V=0;V<1<<N[Y];V++)w[se++]=Y;for(w[se-1]=Y,Y=K=0;Y<16;Y++)for(G[Y]=K,V=0;V<1<<T[Y];V++)L[K++]=Y;for(K>>=7;Y<h;Y++)for(G[Y]=K<<7,V=0;V<1<<T[Y]-7;V++)L[256+K++]=Y;for(ne=0;ne<=g;ne++)re[ne]=0;for(V=0;V<=143;)F[2*V+1]=8,V++,re[8]++;for(;V<=255;)F[2*V+1]=9,V++,re[9]++;for(;V<=279;)F[2*V+1]=7,V++,re[7]++;for(;V<=287;)F[2*V+1]=8,V++,re[8]++;for(ae(F,p+1,re),V=0;V<h;V++)E[2*V+1]=5,E[2*V]=de(V,5);B=new A(F,N,f+1,p,g),D=new A(E,T,0,h,g),U=new A(new Array(0),I,0,x,v)})(),W=!0),z.l_desc=new H(z.dyn_ltree,B),z.d_desc=new H(z.dyn_dtree,D),z.bl_desc=new H(z.bl_tree,U),z.bi_buf=0,z.bi_valid=0,ue(z)},o._tr_stored_block=P,o._tr_flush_block=function(z,V,ne,se){var Y,K,re=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(oe){var $,X=4093624447;for($=0;$<=31;$++,X>>>=1)if(1&X&&oe.dyn_ltree[2*$]!==0)return i;if(oe.dyn_ltree[18]!==0||oe.dyn_ltree[20]!==0||oe.dyn_ltree[26]!==0)return a;for($=32;$<f;$++)if(oe.dyn_ltree[2*$]!==0)return a;return i})(z)),ze(z,z.l_desc),ze(z,z.d_desc),re=(function(oe){var $;for(_(oe,oe.dyn_ltree,oe.l_desc.max_code),_(oe,oe.dyn_dtree,oe.d_desc.max_code),ze(oe,oe.bl_desc),$=x-1;3<=$&&oe.bl_tree[2*O[$]+1]===0;$--);return oe.opt_len+=3*($+1)+5+5+4,$})(z),Y=z.opt_len+3+7>>>3,(K=z.static_len+3+7>>>3)<=Y&&(Y=K)):Y=K=ne+5,ne+4<=Y&&V!==-1?P(z,V,ne,se):z.strategy===4||K===Y?(ee(z,2+(se?1:0),3),je(z,F,E)):(ee(z,4+(se?1:0),3),(function(oe,$,X,le){var we;for(ee(oe,$-257,5),ee(oe,X-1,5),ee(oe,le-4,4),we=0;we<le;we++)ee(oe,oe.bl_tree[2*O[we]+1],3);q(oe,oe.dyn_ltree,$-1),q(oe,oe.dyn_dtree,X-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,re+1),je(z,z.dyn_ltree,z.dyn_dtree)),ue(z),se&&fe(z)},o._tr_tally=function(z,V,ne){return z.pending_buf[z.d_buf+2*z.last_lit]=V>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&V,z.pending_buf[z.l_buf+z.last_lit]=255&ne,z.last_lit++,V===0?z.dyn_ltree[2*ne]++:(z.matches++,V--,z.dyn_ltree[2*(w[ne]+f+1)]++,z.dyn_dtree[2*J(V)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){ee(z,2,3),Q(z,k,F),(function(V){V.bi_valid===16?(R(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):8<=V.bi_valid&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(i,a){if(!i.setImmediate){var c,u,d,f,p=1,h={},x=!1,m=i.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(i);g=g&&g.setTimeout?g:i,c={}.toString.call(i.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(i.postMessage&&!i.importScripts){var S=!0,C=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=C,S}})()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",k,!1):i.attachEvent("onmessage",k),function(S){i.postMessage(f+S,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,u.removeChild(C),C=null},u.appendChild(C)}):function(S){setTimeout(v,0,S)},g.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),j=0;j<C.length;j++)C[j]=arguments[j+1];var N={callback:S,args:C};return h[p]=N,c(p),p++},g.clearImmediate=y}function y(S){delete h[S]}function v(S){if(x)setTimeout(v,0,S);else{var C=h[S];if(C){x=!0;try{(function(j){var N=j.callback,T=j.args;switch(T.length){case 0:N();break;case 1:N(T[0]);break;case 2:N(T[0],T[1]);break;case 3:N(T[0],T[1],T[2]);break;default:N.apply(a,T)}})(C)}finally{y(S),x=!1}}}}function k(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(f)===0&&v(+S.data.slice(f.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof Zr<"u"?Zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ks)),ks.exports}var A2=T2();const I2=Ji(A2),Wd="[REDACTED]",z2=/(^|[-_])(api[-_]?key|authorization|cookie|token|secret|password|access[-_]?token|refresh[-_]?token)([-_]|$)/i,R2=[/Bearer\s+[A-Za-z0-9._~+/=-]{12,}/gi,/\bsk-[A-Za-z0-9_-]{12,}\b/g,/\bsk-ant-[A-Za-z0-9_-]{12,}\b/g,/\bghp_[A-Za-z0-9_]{12,}\b/g,/\bglpat-[A-Za-z0-9_-]{12,}\b/g];async function P2(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}function O2(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function di(e){if(Array.isArray(e))return e.map(n=>di(n));if(!O2(e))return e;const t={};for(const[n,r]of Object.entries(e))t[n]=z2.test(n)?Wd:di(r);return t}function M2(e){const t=n=>{let r=n;for(const o of R2)r=r.replace(o,Wd);return r};try{const n=JSON.parse(e);return t(JSON.stringify(di(n),null,2))}catch{return t(e)}}function _s(e,t){return t==="redacted"?M2(e):e}async function L2(e,t="redacted"){const n=new I2,r=t==="redacted"?"redacted":"raw";n.file("manifest.json",JSON.stringify({exportedAt:new Date().toISOString(),mode:t,redacted:t==="redacted",logCount:e.length,logIds:e.map(c=>c.id)},null,2));for(const c of e)c.rawRequestBody!==null&&n.file(`#${c.id}.Request.json`,_s(c.rawRequestBody,t)),c.responseText!==null&&n.file(`#${c.id}.Response.json`,_s(c.responseText,t));const o=e.filter(c=>c.streaming);await Promise.allSettled(o.map(async c=>{const u=await P2(c.id);u!==null&&n.file(`#${c.id}.SSE.Response.json`,_s(u,t))}));const s=await n.generateAsync({type:"blob"}),i=URL.createObjectURL(s),a=document.createElement("a");a.href=i,a.download=`agent-inspector-export-${r}-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function fi(e,t){switch(t){case"full":return e;case"time":return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}}function ca(e,t,n){return`${fi(e,n)} - ${fi(t,n)}`}function Zd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qd(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zd(e))&&(r&&(r+=" "),r+=t);return r}const D2=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},F2=(e,t)=>({classGroupId:e,validator:t}),Jd=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),No="-",Ml=[],$2="arbitrary..",B2=e=>{const t=V2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return U2(i);const a=i.split(No),c=a[0]===""&&a.length>1?1:0;return Kd(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],u=n[i];return c?u?D2(u,c):c:u||Ml}return n[i]||Ml}}},Kd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=Kd(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const a=t===0?e.join(No):e.slice(t).join(No),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(a))return d.classGroupId}},U2=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?$2+r:void 0})(),V2=e=>{const{theme:t,classGroups:n}=e;return H2(n,t)},H2=(e,t)=>{const n=Jd();for(const r in e){const o=e[r];ua(o,n,r,t)}return n},ua=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];W2(i,t,n,r)}},W2=(e,t,n,r)=>{if(typeof e=="string"){Z2(e,t,n);return}if(typeof e=="function"){q2(e,t,n,r);return}J2(e,t,n,r)},Z2=(e,t,n)=>{const r=e===""?t:Gd(t,e);r.classGroupId=n},q2=(e,t,n,r)=>{if(K2(e)){ua(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(F2(n,e))},J2=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];ua(c,Gd(t,a),n,r)}},Gd=(e,t)=>{let n=e;const r=t.split(No),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=Jd(),n.nextPart.set(i,a)),n=a}return n},K2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,G2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},hi="!",Ll=":",Y2=[],Dl=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),X2=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;const d=o.length;for(let m=0;m<d;m++){const g=o[m];if(i===0&&a===0){if(g===Ll){s.push(o.slice(c,m)),c=m+1;continue}if(g==="/"){u=m;continue}}g==="["?i++:g==="]"?i--:g==="("?a++:g===")"&&a--}const f=s.length===0?o:o.slice(c);let p=f,h=!1;f.endsWith(hi)?(p=f.slice(0,-1),h=!0):f.startsWith(hi)&&(p=f.slice(1),h=!0);const x=u&&u>c?u-c:void 0;return Dl(s,h,p,x)};if(t){const o=t+Ll,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Dl(Y2,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Q2=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},ew=e=>({cache:G2(e.cacheSize),parseClassName:X2(e),sortModifiers:Q2(e),...B2(e)}),tw=/\s+/,nw=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(tw);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:m}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!m,y=r(g?x.substring(0,m):x);if(!y){if(!g){c=d+(c.length>0?" "+c:c);continue}if(y=r(x),!y){c=d+(c.length>0?" "+c:c);continue}g=!1}const v=p.length===0?"":p.length===1?p[0]:s(p).join(":"),k=h?v+hi:v,S=k+y;if(i.indexOf(S)>-1)continue;i.push(S);const C=o(y,g);for(let j=0;j<C.length;++j){const N=C[j];i.push(k+N)}c=d+(c.length>0?" "+c:c)}return c},rw=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Yd(n))&&(o&&(o+=" "),o+=r);return o},Yd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Yd(e[r]))&&(n&&(n+=" "),n+=t);return n},ow=(e,...t)=>{let n,r,o,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=ew(u),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const u=r(c);if(u)return u;const d=nw(c,n);return o(c,d),d};return s=i,(...c)=>s(rw(...c))},sw=[],Qe=e=>{const t=n=>n[e]||sw;return t.isThemeGetter=!0,t},Xd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tn=e=>iw.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Qt=e=>!!e&&Number.isInteger(Number(e)),Ss=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Ht=e=>aw.test(e),fw=()=>!0,hw=e=>lw.test(e)&&!cw.test(e),ef=()=>!1,pw=e=>uw.test(e),mw=e=>dw.test(e),gw=e=>!ge(e)&&!xe(e),xw=e=>er(e,rf,ef),ge=e=>Xd.test(e),mn=e=>er(e,of,hw),Cs=e=>er(e,kw,Te),Fl=e=>er(e,tf,ef),yw=e=>er(e,nf,mw),Yr=e=>er(e,sf,pw),xe=e=>Qd.test(e),cr=e=>tr(e,of),bw=e=>tr(e,_w),$l=e=>tr(e,tf),vw=e=>tr(e,rf),ww=e=>tr(e,nf),Xr=e=>tr(e,sf,!0),er=(e,t,n)=>{const r=Xd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tr=(e,t,n=!1)=>{const r=Qd.exec(e);return r?r[1]?t(r[1]):n:!1},tf=e=>e==="position"||e==="percentage",nf=e=>e==="image"||e==="url",rf=e=>e==="length"||e==="size"||e==="bg-size",of=e=>e==="length",kw=e=>e==="number",_w=e=>e==="family-name",sf=e=>e==="shadow",Sw=()=>{const e=Qe("color"),t=Qe("font"),n=Qe("text"),r=Qe("font-weight"),o=Qe("tracking"),s=Qe("leading"),i=Qe("breakpoint"),a=Qe("container"),c=Qe("spacing"),u=Qe("radius"),d=Qe("shadow"),f=Qe("inset-shadow"),p=Qe("text-shadow"),h=Qe("drop-shadow"),x=Qe("blur"),m=Qe("perspective"),g=Qe("aspect"),y=Qe("ease"),v=Qe("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),xe,ge],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[xe,ge,c],I=()=>[Tn,"full","auto",...T()],O=()=>[Qt,"none","subgrid",xe,ge],F=()=>["auto",{span:["full",Qt,xe,ge]},Qt,xe,ge],E=()=>[Qt,"auto",xe,ge],L=()=>["auto","min","max","fr",xe,ge],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],D=()=>[Tn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],U=()=>[e,xe,ge],G=()=>[...S(),$l,Fl,{position:[xe,ge]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",vw,xw,{size:[xe,ge]}],J=()=>[Ss,cr,mn],R=()=>["","none","full",u,xe,ge],ee=()=>["",Te,cr,mn],Q=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Te,Ss,$l,Fl],ue=()=>["","none",x,xe,ge],fe=()=>["none",Te,xe,ge],he=()=>["none",Te,xe,ge],ye=()=>[Te,xe,ge],je=()=>[Tn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ht],breakpoint:[Ht],color:[fw],container:[Ht],"drop-shadow":[Ht],ease:["in","out","in-out"],font:[gw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ht],shadow:[Ht],spacing:["px",Te],text:[Ht],"text-shadow":[Ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tn,ge,xe,g]}],container:["container"],columns:[{columns:[Te,ge,xe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Qt,"auto",xe,ge]}],basis:[{basis:[Tn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Tn,"auto","initial","none",ge]}],grow:[{grow:["",Te,xe,ge]}],shrink:[{shrink:["",Te,xe,ge]}],order:[{order:[Qt,"first","last","none",xe,ge]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[a,"screen",...D()]}],"min-w":[{"min-w":[a,"screen","none",...D()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,cr,mn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xe,Cs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ss,ge]}],"font-family":[{font:[bw,ge,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,xe,ge]}],"line-clamp":[{"line-clamp":[Te,"none",xe,Cs]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",xe,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",xe,mn]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Te,"auto",xe,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qt,xe,ge],radial:["",xe,ge],conic:[Qt,xe,ge]},ww,yw]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,xe,ge]}],"outline-w":[{outline:["",Te,cr,mn]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",d,Xr,Yr]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,Xr,Yr]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Te,mn]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",p,Xr,Yr]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Te,xe,ge]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[xe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ge]}],filter:[{filter:["","none",xe,ge]}],blur:[{blur:ue()}],brightness:[{brightness:[Te,xe,ge]}],contrast:[{contrast:[Te,xe,ge]}],"drop-shadow":[{"drop-shadow":["","none",h,Xr,Yr]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Te,xe,ge]}],"hue-rotate":[{"hue-rotate":[Te,xe,ge]}],invert:[{invert:["",Te,xe,ge]}],saturate:[{saturate:[Te,xe,ge]}],sepia:[{sepia:["",Te,xe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ge]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Te,xe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Te,xe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,xe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,xe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Te,xe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Te,xe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Te,xe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,xe,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",xe,ge]}],ease:[{ease:["linear","initial",y,xe,ge]}],delay:[{delay:[Te,xe,ge]}],animate:[{animate:["none",v,xe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,xe,ge]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[xe,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,ge]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Te,cr,mn,Cs]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Cw=ow(Sw);function be(...e){return Cw(qd(e))}function Ve(e){return e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":(e/1e3).toFixed(1).replace(/\.0$/,"")+"K"}function af(e){return e>=1024*1024?(e/(1024*1024)).toFixed(1).replace(/\.0$/,"")+"M":(e/1024).toFixed(1).replace(/\.0$/,"")+"K"}function jw(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ew=ie({model:Z().min(1),contextWindow:pe().int().positive().optional(),outputLimit:pe().int().positive().optional(),source:et(["manual","registry"]).optional(),sourceUrl:Z().optional(),updatedAt:Z().optional()}),To=ie({id:Z(),name:Z(),apiKey:Z(),model:Z().optional(),models:Se(Z()).min(1),format:et(["anthropic","openai"]).optional(),baseUrl:Z().optional(),anthropicBaseUrl:Z().optional(),openaiBaseUrl:Z().optional(),authHeader:et(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:Z().optional(),modelMetadataUrl:Z().optional(),modelMetadata:Se(Ew).optional(),source:et(["company","personal"]).optional(),createdAt:Z(),updatedAt:Z()});async function Nw(e){return Lr(e,To.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function lf(){const e=qi("/api/providers?includeSecrets=1",Nw,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}const Tw="2.0.19",Aw={version:Tw},Bl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ul=qd,da=(e,t)=>n=>{var r;if(t?.variants==null)return Ul(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=Bl(d)||Bl(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(x=>{let[m,g]=x;return Array.isArray(g)?g.includes({...s,...a}[m]):{...s,...a}[m]===g})?[...u,f,p]:u},[]);return Ul(e,i,c,n?.class,n?.className)};function Vl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Vl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Vl(e[o],null)}}}}function Le(...e){return b.useCallback(cf(...e),e)}function Kn(e){const t=zw(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(Pw);if(c){const u=c.props.children,d=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Iw=Kn("Slot");function zw(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=Mw(o),a=Ow(s,o.props);return o.type!==b.Fragment&&(a.ref=r?cf(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uf=Symbol("radix.slottable");function Rw(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=uf,t}function Pw(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uf}function Ow(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Mw(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 Lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Lw.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),r=b.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Dw(e,t){e&&Mr.flushSync(()=>e.dispatchEvent(t))}var df=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"}),Fw="VisuallyHidden",ff=b.forwardRef((e,t)=>l.jsx(Ne.span,{...e,ref:t,style:{...df,...e.style}}));ff.displayName=Fw;var $w=ff;function Bw(e,t){const n=b.createContext(t),r=s=>{const{children:i,...a}=s,c=b.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Xt(e,t=[]){let n=[];function r(s,i){const a=b.createContext(i),c=n.length;n=[...n,i];const u=f=>{const{scope:p,children:h,...x}=f,m=p?.[e]?.[c]||a,g=b.useMemo(()=>x,Object.values(x));return l.jsx(m.Provider,{value:g,children:h})};u.displayName=s+"Provider";function d(f,p){const h=p?.[e]?.[c]||a,x=b.useContext(h);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>b.createContext(i));return function(a){const c=a?.[e]||s;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Uw(o,...t)]}function Uw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function hf(e){const t=e+"CollectionProvider",[n,r]=Xt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:y}=m,v=at.useRef(null),k=at.useRef(new Map).current;return l.jsx(o,{scope:g,itemMap:k,collectionRef:v,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=Kn(a),u=at.forwardRef((m,g)=>{const{scope:y,children:v}=m,k=s(a,y),S=Le(g,k.collectionRef);return l.jsx(c,{ref:S,children:v})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Kn(d),h=at.forwardRef((m,g)=>{const{scope:y,children:v,...k}=m,S=at.useRef(null),C=Le(g,S),j=s(d,y);return at.useEffect(()=>(j.itemMap.set(S,{ref:S,...k}),()=>{j.itemMap.delete(S)})),l.jsx(p,{[f]:"",ref:C,children:v})});h.displayName=d;function x(m){const g=s(e+"CollectionConsumer",m);return at.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((j,N)=>k.indexOf(j.ref.current)-k.indexOf(N.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},x,r]}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var tt=globalThis?.document?b.useLayoutEffect:()=>{},Vw=Hu[" useInsertionEffect ".trim().toString()]||tt;function bn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Hw({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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.`),d.current=a},[a,r])}const u=b.useCallback(d=>{if(a){const f=Ww(d)?d(e):d;f!==e&&i.current?.(f)}else s(d)},[a,e,s,i]);return[c,u]}function Hw({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),s=b.useRef(t);return Vw(()=>{s.current=t},[t]),b.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Ww(e){return typeof e=="function"}function Zw(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var bt=e=>{const{present:t,children:n}=e,r=qw(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=Le(r.ref,Jw(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:s}):null};bt.displayName="Presence";function qw(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),s=b.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Zw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Qr(r.current);s.current=a==="mounted"?u:"none"},[a]),tt(()=>{const u=r.current,d=o.current;if(d!==e){const p=s.current,h=Qr(u);e?c("MOUNT"):h==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),tt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const m=Qr(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=h=>{h.target===t&&(s.current=Qr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Qr(e){return e?.animationName||"none"}function Jw(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 Kw=Hu[" useId ".trim().toString()]||(()=>{}),Gw=0;function Ot(e){const[t,n]=b.useState(Kw());return tt(()=>{n(r=>r??String(Gw++))},[e]),e||(t?`radix-${t}`:"")}var Go="Collapsible",[Yw]=Xt(Go),[Xw,fa]=Yw(Go),pf=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=bn({prop:r,defaultProp:o??!1,onChange:i,caller:Go});return l.jsx(Xw,{scope:n,disabled:s,contentId:Ot(),open:c,onOpenToggle:b.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Ne.div,{"data-state":pa(c),"data-disabled":s?"":void 0,...a,ref:t})})});pf.displayName=Go;var mf="CollapsibleTrigger",gf=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fa(mf,n);return l.jsx(Ne.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":pa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ke(e.onClick,o.onOpenToggle)})});gf.displayName=mf;var ha="CollapsibleContent",xf=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fa(ha,e.__scopeCollapsible);return l.jsx(bt,{present:n||o.open,children:({present:s})=>l.jsx(Qw,{...r,ref:t,present:s})})});xf.displayName=ha;var Qw=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=fa(ha,n),[a,c]=b.useState(r),u=b.useRef(null),d=Le(t,u),f=b.useRef(0),p=f.current,h=b.useRef(0),x=h.current,m=i.open||a,g=b.useRef(m),y=b.useRef(void 0);return b.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();f.current=k.height,h.current=k.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(r)}},[i.open,r]),l.jsx(Ne.div,{"data-state":pa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function pa(e){return e?"open":"closed"}var ek=pf,tk=b.createContext(void 0);function Yo(e){const t=b.useContext(tk);return e||t||"ltr"}function st(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function nk(e,t=globalThis?.document){const n=st(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rk="DismissableLayer",pi="dismissableLayer.update",ok="dismissableLayer.pointerDownOutside",sk="dismissableLayer.focusOutside",Hl,yf=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xo=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=b.useContext(yf),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=b.useState({}),x=Le(t,N=>f(N)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),v=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=y,C=lk(N=>{const T=N.target,I=[...u.branches].some(O=>O.contains(T));!S||I||(o?.(N),i?.(N),N.defaultPrevented||a?.())},p),j=ck(N=>{const T=N.target;[...u.branches].some(O=>O.contains(T))||(s?.(N),i?.(N),N.defaultPrevented||a?.())},p);return nk(N=>{v===u.layers.size-1&&(r?.(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Hl)}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wl())},[d,u]),b.useEffect(()=>{const N=()=>h({});return document.addEventListener(pi,N),()=>document.removeEventListener(pi,N)},[]),l.jsx(Ne.div,{...c,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,C.onPointerDownCapture)})});Xo.displayName=rk;var ik="DismissableLayerBranch",ak=b.forwardRef((e,t)=>{const n=b.useContext(yf),r=b.useRef(null),o=Le(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Ne.div,{...e,ref:o})});ak.displayName=ik;function lk(e,t=globalThis?.document){const n=st(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){bf(ok,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ck(e,t=globalThis?.document){const n=st(e),r=b.useRef(!1);return b.useEffect(()=>{const o=s=>{s.target&&!r.current&&bf(sk,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wl(){const e=new CustomEvent(pi);document.dispatchEvent(e)}function bf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Dw(o,s):o.dispatchEvent(s)}var js="focusScope.autoFocusOnMount",Es="focusScope.autoFocusOnUnmount",Zl={bubbles:!1,cancelable:!0},uk="FocusScope",ma=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=b.useState(null),u=st(o),d=st(s),f=b.useRef(null),p=Le(t,m=>c(m)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(k){if(h.paused||!a)return;const S=k.target;a.contains(S)?f.current=S:tn(f.current,{select:!0})},g=function(k){if(h.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||tn(f.current,{select:!0}))},y=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&tn(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,h.paused]),b.useEffect(()=>{if(a){Jl.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(js,Zl);a.addEventListener(js,u),a.dispatchEvent(y),y.defaultPrevented||(dk(gk(vf(a)),{select:!0}),document.activeElement===m&&tn(a))}return()=>{a.removeEventListener(js,u),setTimeout(()=>{const y=new CustomEvent(Es,Zl);a.addEventListener(Es,d),a.dispatchEvent(y),y.defaultPrevented||tn(m??document.body,{select:!0}),a.removeEventListener(Es,d),Jl.remove(h)},0)}}},[a,u,d,h]);const x=b.useCallback(m=>{if(!n&&!r||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const v=m.currentTarget,[k,S]=fk(v);k&&S?!m.shiftKey&&y===S?(m.preventDefault(),n&&tn(k,{select:!0})):m.shiftKey&&y===k&&(m.preventDefault(),n&&tn(S,{select:!0})):y===v&&m.preventDefault()}},[n,r,h.paused]);return l.jsx(Ne.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});ma.displayName=uk;function dk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tn(r,{select:t}),document.activeElement!==n)return}function fk(e){const t=vf(e),n=ql(t,e),r=ql(t.reverse(),e);return[n,r]}function vf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ql(e,t){for(const n of e)if(!hk(n,{upTo:t}))return n}function hk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pk(e){return e instanceof HTMLInputElement&&"select"in e}function tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pk(e)&&t&&e.select()}}var Jl=mk();function mk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kl(e,t),e.unshift(t)},remove(t){e=Kl(e,t),e[0]?.resume()}}}function Kl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gk(e){return e.filter(t=>t.tagName!=="A")}var xk="Portal",Qo=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=b.useState(!1);tt(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?ng.createPortal(l.jsx(Ne.div,{...r,ref:t}),i):null});Qo.displayName=xk;var Ns=0;function wf(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gl()),document.body.insertAdjacentElement("beforeend",e[1]??Gl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function Gl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zt=function(){return zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},zt.apply(this,arguments)};function kf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var xo="right-scroll-bar-position",yo="width-before-scroll-bar",bk="with-scroll-bars-hidden",vk="--removed-body-scroll-bar-size";function Ts(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wk(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var kk=typeof window<"u"?b.useLayoutEffect:b.useEffect,Yl=new WeakMap;function _k(e,t){var n=wk(null,function(r){return e.forEach(function(o){return Ts(o,r)})});return kk(function(){var r=Yl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ts(a,null)}),s.forEach(function(a){o.has(a)||Ts(a,i)})}Yl.set(n,e)},[e]),n}function Sk(e){return e}function Ck(e,t){t===void 0&&(t=Sk);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function jk(e){e===void 0&&(e={});var t=Ck(null);return t.options=zt({async:!0,ssr:!1},e),t}var _f=function(e){var t=e.sideCar,n=kf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,zt({},n))};_f.isSideCarExport=!0;function Ek(e,t){return e.useMedium(t),_f}var Sf=jk(),As=function(){},es=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:As,onWheelCapture:As,onTouchMoveCapture:As}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,x=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,k=e.gapMode,S=kf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,j=_k([n,t]),N=zt(zt({},S),o);return b.createElement(b.Fragment,null,d&&b.createElement(C,{sideCar:Sf,removeScrollBar:u,shards:f,noRelative:h,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:k}),i?b.cloneElement(b.Children.only(a),zt(zt({},N),{ref:j})):b.createElement(v,zt({},N,{className:c,ref:j}),a))});es.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};es.classNames={fullWidth:yo,zeroRight:xo};var Nk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function Ak(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ik(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tk())&&(Ak(t,n),Ik(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Rk=function(){var e=zk();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cf=function(){var e=Rk(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pk={left:0,top:0,right:0,gap:0},Is=function(e){return parseInt(e||"",10)||0},Ok=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Is(n),Is(r),Is(o)]},Mk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pk;var t=Ok(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lk=Cf(),Bn="data-scroll-locked",Dk=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
41
|
+
\0`,ee+=s(H,2),ee+=j.magic,ee+=s(k,2),ee+=s(S,2),ee+=s(A.crc32,4),ee+=s(A.compressedSize,4),ee+=s(A.uncompressedSize,4),ee+=s(T.length,2),ee+=s(M.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ee+T+M,dirRecord:f.CENTRAL_FILE_HEADER+s(R,2)+ee+s(F.length,2)+"\0\0\0\0"+s(J,4)+s(g,4)+T+M+F}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),f=n("../signature");function p(h,x,m,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,c),p.prototype.push=function(h){var x=h.meta.percent||0,m=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-g-1))/m:100}}))},p.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var x=this.streamFiles&&!h.file.dir;if(x){var m=i(h,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(h){this.accumulate=!1;var x=this.streamFiles&&!h.file.dir,m=i(h,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(g){return f.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var h=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-h,g=(function(y,v,k,S,C){var j=a.transformTo("string",C(S));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(y,2)+s(y,2)+s(v,4)+s(k,4)+s(j.length,2)+j})(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(h){this._sources.push(h);var x=this;return h.on("data",function(m){x.processChunk(m)}),h.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),h.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(h){var x=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var m=0;m<x.length;m++)try{x[m].error(h)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,x=0;x<h.length;x++)h[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var s=n("../compressions"),i=n("./ZipFileWorker");o.generateWorker=function(a,c,u){var d=new i(c.streamFiles,u,c.platform,c.encodeFileName),f=0;try{a.forEach(function(p,h){f++;var x=(function(v,k){var S=v||k,C=s[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(h.options.compression,c.compression),m=h.options.compressionOptions||c.compressionOptions||{},g=h.dir,y=h.date;h._compressWorker(x,m).withStreamInfo("file",{name:p,dir:g,date:y,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(d)}),d.entriesCount=f}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new s;for(var a in this)typeof this[a]!="function"&&(i[a]=this[a]);return i}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(i,a){return new s().loadAsync(i,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var s=n("./utils"),i=n("./external"),a=n("./utf8"),c=n("./zipEntries"),u=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function f(p){return new i.Promise(function(h,x){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(g){x(g)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(p,h){var x=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,h.optimizedBinaryString,h.base64).then(function(m){var g=new c(h);return g.load(m),g}).then(function(m){var g=[i.Promise.resolve(m)],y=m.files;if(h.checkCRC32)for(var v=0;v<y.length;v++)g.push(f(y[v]));return i.Promise.all(g)}).then(function(m){for(var g=m.shift(),y=g.files,v=0;v<y.length;v++){var k=y[v],S=k.fileNameStr,C=s.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:h.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return g.zipComment.length&&(x.comment=g.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var s=n("../utils"),i=n("../stream/GenericWorker");function a(c,u){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(u)}s.inherits(a,i),a.prototype._bindStream=function(c){var u=this;(this._stream=c).pause(),c.on("data",function(d){u.push({data:d,meta:{percent:0}})}).on("error",function(d){u.isPaused?this.generatedError=d:u.error(d)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var s=n("readable-stream").Readable;function i(a,c,u){s.call(this,c),this._helper=a;var d=this;a.on("data",function(f,p){d.push(f)||d._helper.pause(),u&&u(p)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}n("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,o){function s(C,j,N){var T,I=a.getTypeOf(j),O=a.extend(N||{},d);O.date=O.date||new Date,O.compression!==null&&(O.compression=O.compression.toUpperCase()),typeof O.unixPermissions=="string"&&(O.unixPermissions=parseInt(O.unixPermissions,8)),O.unixPermissions&&16384&O.unixPermissions&&(O.dir=!0),O.dosPermissions&&16&O.dosPermissions&&(O.dir=!0),O.dir&&(C=y(C)),O.createFolders&&(T=g(C))&&v.call(this,T,!0);var F=I==="string"&&O.binary===!1&&O.base64===!1;N&&N.binary!==void 0||(O.binary=!F),(j instanceof f&&j.uncompressedSize===0||O.dir||!j||j.length===0)&&(O.base64=!1,O.binary=!0,j="",O.compression="STORE",I="string");var E=null;E=j instanceof f||j instanceof c?j:x.isNode&&x.isStream(j)?new m(C,j):a.prepareContent(C,j,O.binary,O.optimizedBinaryString,O.base64);var L=new p(C,E,O);this.files[C]=L}var i=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),d=n("./defaults"),f=n("./compressedObject"),p=n("./zipObject"),h=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),g=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var j=C.lastIndexOf("/");return 0<j?C.substring(0,j):""},y=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,j){return j=j!==void 0?j:d.createFolders,C=y(C),this.files[C]||s.call(this,C,null,{dir:!0,createFolders:j}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var j,N,T;for(j in this.files)T=this.files[j],(N=j.slice(this.root.length,j.length))&&j.slice(0,this.root.length)===this.root&&C(N,T)},filter:function(C){var j=[];return this.forEach(function(N,T){C(N,T)&&j.push(T)}),j},file:function(C,j,N){if(arguments.length!==1)return C=this.root+C,s.call(this,C,j,N),this;if(k(C)){var T=C;return this.filter(function(O,F){return!F.dir&&T.test(O)})}var I=this.files[this.root+C];return I&&!I.dir?I:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(I,O){return O.dir&&C.test(I)});var j=this.root+C,N=v.call(this,j),T=this.clone();return T.root=N.name,T},remove:function(C){C=this.root+C;var j=this.files[C];if(j||(C.slice(-1)!=="/"&&(C+="/"),j=this.files[C]),j&&!j.dir)delete this.files[C];else for(var N=this.filter(function(I,O){return O.name.slice(0,C.length)===C}),T=0;T<N.length;T++)delete this.files[N[T].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var j,N={};try{if((N=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");a.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var T=N.comment||this.comment||"";j=h.generateWorker(this,N,T)}catch(I){(j=new c("error")).error(I)}return new u(j,N.type||"string",N.mimeType)},generateAsync:function(C,j){return this.generateInternalStream(C).accumulate(j)},generateNodeStream:function(C,j){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(j)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data[this.zero+a]},i.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===u&&this.data[p+2]===d&&this.data[p+3]===f)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&u===p[1]&&d===p[2]&&f===p[3]},i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var s=n("../utils");function i(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,u=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(f){var p=s.getTypeOf(f);return s.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new u(f):i.uint8array?new d(s.transformTo("uint8array",f)):new a(s.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var s=n("./GenericWorker"),i=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),i=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=s.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}s.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,a)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var a=this;return i.on("data",function(c){a.processChunk(c)}),i.on("end",function(){a.end()}),i.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,a){return this.extraStreamInfo[i]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),d=n("../external"),f=null;if(u.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new d.Promise(function(g,y){var v=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(j,N){v.push(j),m&&m(N)}).on("error",function(j){v=[],y(j)}).on("end",function(){try{var j=(function(N,T,I){switch(N){case"blob":return s.newBlob(s.transformTo("arraybuffer",T),I);case"base64":return c.encode(T);default:return s.transformTo(N,T)}})(S,(function(N,T){var I,O=0,F=null,E=0;for(I=0;I<T.length;I++)E+=T[I].length;switch(N){case"string":return T.join("");case"array":return Array.prototype.concat.apply([],T);case"uint8array":for(F=new Uint8Array(E),I=0;I<T.length;I++)F.set(T[I],O),O+=T[I].length;return F;case"nodebuffer":return Buffer.concat(T);default:throw new Error("concat : unsupported type '"+N+"'")}})(k,v),C);g(j)}catch(N){y(N)}v=[]}).resume()})}function h(x,m,g){var y=m;switch(m){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=m,this._mimeType=g,s.checkSupport(y),this._worker=x.pipe(new i(y)),x.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}h.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var g=this;return x==="data"?this._worker.on(x,function(y){m.call(g,y.data,y.meta)}):this._worker.on(x,function(){s.delay(m,arguments,g)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),o.blob=i.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var s=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}o.utf8encode=function(h){return i.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(x){var m,g,y,v,k,S=x.length,C=0;for(v=0;v<S;v++)(64512&(g=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(y=x.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),C+=g<128?1:g<2048?2:g<65536?3:4;for(m=i.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(g=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(y=x.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),g<128?m[k++]=g:(g<2048?m[k++]=192|g>>>6:(g<65536?m[k++]=224|g>>>12:(m[k++]=240|g>>>18,m[k++]=128|g>>>12&63),m[k++]=128|g>>>6&63),m[k++]=128|63&g);return m})(h)},o.utf8decode=function(h){return i.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):(function(x){var m,g,y,v,k=x.length,S=new Array(2*k);for(m=g=0;m<k;)if((y=x[m++])<128)S[g++]=y;else if(4<(v=u[y]))S[g++]=65533,m+=v-1;else{for(y&=v===2?31:v===3?15:7;1<v&&m<k;)y=y<<6|63&x[m++],v--;1<v?S[g++]=65533:y<65536?S[g++]=y:(y-=65536,S[g++]=55296|y>>10&1023,S[g++]=56320|1023&y)}return S.length!==g&&(S.subarray?S=S.subarray(0,g):S.length=g),s.applyFromCharCode(S)})(h=s.transformTo(i.uint8array?"uint8array":"array",h))},s.inherits(f,c),f.prototype.processChunk=function(h){var x=s.transformTo(i.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var g=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+u[v[S]]>k?S:k})(x),y=x;g!==x.length&&(i.uint8array?(y=x.subarray(0,g),this.leftOver=x.subarray(g,x.length)):(y=x.slice(0,g),this.leftOver=x.slice(g,x.length))),this.push({data:o.utf8decode(y),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,s.inherits(p,c),p.prototype.processChunk=function(h){this.push({data:o.utf8encode(h.data),meta:h.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var s=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(m){return m}function d(m,g){for(var y=0;y<m.length;++y)g[y]=255&m.charCodeAt(y);return g}n("setimmediate"),o.newBlob=function(m,g){o.checkSupport("blob");try{return new Blob([m],{type:g})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(m),y.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,g,y){var v=[],k=0,S=m.length;if(S<=y)return String.fromCharCode.apply(null,m);for(;k<S;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+y,S)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+y,S)))),k+=y;return v.join("")},stringifyByChar:function(m){for(var g="",y=0;y<m.length;y++)g+=String.fromCharCode(m[y]);return g},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var g=65536,y=o.getTypeOf(m),v=!0;if(y==="uint8array"?v=f.applyCanBeUsed.uint8array:y==="nodebuffer"&&(v=f.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return f.stringifyByChunk(m,y,g)}catch{g=Math.floor(g/2)}return f.stringifyByChar(m)}function h(m,g){for(var y=0;y<m.length;y++)g[y]=m[y];return g}o.applyFromCharCode=p;var x={};x.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},x.array={string:p,array:u,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:u,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:u,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:u},o.transformTo=function(m,g){if(g=g||"",!m)return g;o.checkSupport(m);var y=o.getTypeOf(g);return x[y][m](g)},o.resolve=function(m){for(var g=m.split("/"),y=[],v=0;v<g.length;v++){var k=g[v];k==="."||k===""&&v!==0&&v!==g.length-1||(k===".."?y.pop():y.push(k))}return y.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(m)?"nodebuffer":s.uint8array&&m instanceof Uint8Array?"uint8array":s.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!s[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var g,y,v="";for(y=0;y<(m||"").length;y++)v+="\\x"+((g=m.charCodeAt(y))<16?"0":"")+g.toString(16).toUpperCase();return v},o.delay=function(m,g,y){setImmediate(function(){m.apply(y||null,g||[])})},o.inherits=function(m,g){function y(){}y.prototype=g.prototype,m.prototype=new y},o.extend=function(){var m,g,y={};for(m=0;m<arguments.length;m++)for(g in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],g)&&y[g]===void 0&&(y[g]=arguments[m][g]);return y},o.prepareContent=function(m,g,y,v,k){return c.Promise.resolve(g).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new c.Promise(function(C,j){var N=new FileReader;N.onload=function(T){C(T.target.result)},N.onerror=function(T){j(T.target.error)},N.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=i.decode(S):y&&v!==!0&&(S=(function(j){return d(j,s.uint8array?new Uint8Array(j.length):new Array(j.length))})(S))),S):c.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./signature"),c=n("./zipEntry"),u=n("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(f)+")")}},isSignature:function(f,p){var h=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===p;return this.reader.setIndex(h),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=u.uint8array?"uint8array":"array",h=i.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,h,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),p=this.reader.readInt(4),h=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var x=p-h;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=s(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),u=n("./utf8"),d=n("./compressions"),f=n("./support");function p(h,x){this.options=h,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var x,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(g){for(var y in d)if(Object.prototype.hasOwnProperty.call(d,y)&&d[y].magic===g)return d[y];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var x=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(x),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var x,m,g,y=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<y;)x=h.readInt(2),m=h.readInt(2),g=h.readData(m),this.extraFields[x]={id:x,length:m,value:g};h.setIndex(y)},handleUTF8:function(){var h=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=i.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var y=i.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var x=s(h.value);return x.readInt(1)!==1||c(this.fileName)!==x.readInt(4)?null:u.utf8decode(x.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var x=s(h.value);return x.readInt(1)!==1||c(this.fileComment)!==x.readInt(4)?null:u.utf8decode(x.readData(h.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function s(x,m,g){this.name=x,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=m,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var i=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),u=n("./compressedObject"),d=n("./stream/GenericWorker");s.prototype={internalStream:function(x){var m=null,g="string";try{if(!x)throw new Error("No output type specified.");var y=(g=x.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!y&&(m=m.pipe(new c.Utf8EncodeWorker)),!v&&y&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(k){(m=new d("error")).error(k)}return new i(m,g,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof u&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new c.Utf8EncodeWorker)),u.createWorkerFrom(g,x,m)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<f.length;h++)s.prototype[f[h]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(s){var i,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var u=0,d=new c(x),f=s.document.createTextNode("");d.observe(f,{characterData:!0}),i=function(){f.data=u=++u%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var m=s.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},s.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new s.MessageChannel;p.port1.onmessage=x,i=function(){p.port2.postMessage(0)}}var h=[];function x(){var m,g;a=!0;for(var y=h.length;y;){for(g=h,h=[],m=-1;++m<y;)g[m]();y=h.length}a=!1}r.exports=function(m){h.push(m)!==1||a||i()}}).call(this,typeof Zr<"u"?Zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var s=n("immediate");function i(){}var a={},c=["REJECTED"],u=["FULFILLED"],d=["PENDING"];function f(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,y!==i&&m(this,y)}function p(y,v,k){this.promise=y,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function h(y,v,k){s(function(){var S;try{S=v(k)}catch(C){return a.reject(y,C)}S===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,S)})}function x(y){var v=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof v=="function")return function(){v.apply(y,arguments)}}function m(y,v){var k=!1;function S(N){k||(k=!0,a.reject(y,N))}function C(N){k||(k=!0,a.resolve(y,N))}var j=g(function(){v(C,S)});j.status==="error"&&S(j.value)}function g(y,v){var k={};try{k.value=y(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=f).prototype.finally=function(y){if(typeof y!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(y()).then(function(){return k})},function(k){return v.resolve(y()).then(function(){throw k})})},f.prototype.catch=function(y){return this.then(null,y)},f.prototype.then=function(y,v){if(typeof y!="function"&&this.state===u||typeof v!="function"&&this.state===c)return this;var k=new this.constructor(i);return this.state!==d?h(k,this.state===u?y:v,this.outcome):this.queue.push(new p(k,y,v)),k},p.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},p.prototype.otherCallFulfilled=function(y){h(this.promise,this.onFulfilled,y)},p.prototype.callRejected=function(y){a.reject(this.promise,y)},p.prototype.otherCallRejected=function(y){h(this.promise,this.onRejected,y)},a.resolve=function(y,v){var k=g(x,v);if(k.status==="error")return a.reject(y,k.value);var S=k.value;if(S)m(y,S);else{y.state=u,y.outcome=v;for(var C=-1,j=y.queue.length;++C<j;)y.queue[C].callFulfilled(v)}return y},a.reject=function(y,v){y.state=c,y.outcome=v;for(var k=-1,S=y.queue.length;++k<S;)y.queue[k].callRejected(v);return y},f.resolve=function(y){return y instanceof this?y:a.resolve(new this(i),y)},f.reject=function(y){var v=new this(i);return a.reject(v,y)},f.all=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=y.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),j=0,N=-1,T=new this(i);++N<k;)I(y[N],N);return T;function I(O,F){v.resolve(O).then(function(E){C[F]=E,++j!==k||S||(S=!0,a.resolve(T,C))},function(E){S||(S=!0,a.reject(T,E))})}},f.race=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=y.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,j=new this(i);++C<k;)N=y[C],v.resolve(N).then(function(T){S||(S=!0,a.resolve(j,T))},function(T){S||(S=!0,a.reject(j,T))});var N;return j}},{immediate:36}],38:[function(n,r,o){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var s=n("./zlib/deflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=Object.prototype.toString,f=0,p=-1,h=0,x=8;function m(y){if(!(this instanceof m))return new m(y);this.options=i.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},y||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==f)throw new Error(c[k]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):d.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=s.deflateSetDictionary(this.strm,S))!==f)throw new Error(c[k]);this._dict_set=!0}}function g(y,v){var k=new m(v);if(k.push(y,!0),k.err)throw k.msg||c[k.err];return k.result}m.prototype.push=function(y,v){var k,S,C=this.strm,j=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof y=="string"?C.input=a.string2buf(y):d.call(y)==="[object ArrayBuffer]"?C.input=new Uint8Array(y):C.input=y,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new i.Buf8(j),C.next_out=0,C.avail_out=j),(k=s.deflate(C,S))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(i.shrinkBuf(C.output,C.next_out))):this.onData(i.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=s.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):S!==2||(this.onEnd(f),!(C.avail_out=0))},m.prototype.onData=function(y){this.chunks.push(y)},m.prototype.onEnd=function(y){y===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},o.Deflate=m,o.deflate=g,o.deflateRaw=function(y,v){return(v=v||{}).raw=!0,g(y,v)},o.gzip=function(y,v){return(v=v||{}).gzip=!0,g(y,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var s=n("./zlib/inflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),u=n("./zlib/messages"),d=n("./zlib/zstream"),f=n("./zlib/gzheader"),p=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||m&&m.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&(15&g.windowBits)==0&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,g.windowBits);if(y!==c.Z_OK)throw new Error(u[y]);this.header=new f,s.inflateGetHeader(this.strm,this.header)}function x(m,g){var y=new h(g);if(y.push(m,!0),y.err)throw y.msg||u[y.err];return y.result}h.prototype.push=function(m,g){var y,v,k,S,C,j,N=this.strm,T=this.options.chunkSize,I=this.options.dictionary,O=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?N.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?N.input=new Uint8Array(m):N.input=m,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new i.Buf8(T),N.next_out=0,N.avail_out=T),(y=s.inflate(N,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&I&&(j=typeof I=="string"?a.string2buf(I):p.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,y=s.inflateSetDictionary(this.strm,j)),y===c.Z_BUF_ERROR&&O===!0&&(y=c.Z_OK,O=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&y!==c.Z_STREAM_END&&(N.avail_in!==0||v!==c.Z_FINISH&&v!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(N.output,N.next_out),S=N.next_out-k,C=a.buf2string(N.output,k),N.next_out=S,N.avail_out=T-S,S&&i.arraySet(N.output,N.output,k,S,0),this.onData(C)):this.onData(i.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(O=!0)}while((0<N.avail_in||N.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(v=c.Z_FINISH),v===c.Z_FINISH?(y=s.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):v!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(N.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=h,o.inflate=x,o.inflateRaw=function(m,g){return(g=g||{}).raw=!0,x(m,g)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(c[f]=d[f])}}return c},o.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var i={arraySet:function(c,u,d,f,p){if(u.subarray&&c.subarray)c.set(u.subarray(d,d+f),p);else for(var h=0;h<f;h++)c[p+h]=u[d+h]},flattenChunks:function(c){var u,d,f,p,h,x;for(u=f=0,d=c.length;u<d;u++)f+=c[u].length;for(x=new Uint8Array(f),u=p=0,d=c.length;u<d;u++)h=c[u],x.set(h,p),p+=h.length;return x}},a={arraySet:function(c,u,d,f,p){for(var h=0;h<f;h++)c[p+h]=u[d+h]},flattenChunks:function(c){return[].concat.apply([],c)}};o.setTyped=function(c){c?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,i)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(s)},{}],42:[function(n,r,o){var s=n("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function d(f,p){if(p<65537&&(f.subarray&&a||!f.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(f,p));for(var h="",x=0;x<p;x++)h+=String.fromCharCode(f[x]);return h}c[254]=c[254]=1,o.string2buf=function(f){var p,h,x,m,g,y=f.length,v=0;for(m=0;m<y;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<y&&(64512&(x=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(x-56320),m++),v+=h<128?1:h<2048?2:h<65536?3:4;for(p=new s.Buf8(v),m=g=0;g<v;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<y&&(64512&(x=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(x-56320),m++),h<128?p[g++]=h:(h<2048?p[g++]=192|h>>>6:(h<65536?p[g++]=224|h>>>12:(p[g++]=240|h>>>18,p[g++]=128|h>>>12&63),p[g++]=128|h>>>6&63),p[g++]=128|63&h);return p},o.buf2binstring=function(f){return d(f,f.length)},o.binstring2buf=function(f){for(var p=new s.Buf8(f.length),h=0,x=p.length;h<x;h++)p[h]=f.charCodeAt(h);return p},o.buf2string=function(f,p){var h,x,m,g,y=p||f.length,v=new Array(2*y);for(h=x=0;h<y;)if((m=f[h++])<128)v[x++]=m;else if(4<(g=c[m]))v[x++]=65533,h+=g-1;else{for(m&=g===2?31:g===3?15:7;1<g&&h<y;)m=m<<6|63&f[h++],g--;1<g?v[x++]=65533:m<65536?v[x++]=m:(m-=65536,v[x++]=55296|m>>10&1023,v[x++]=56320|1023&m)}return d(v,x)},o.utf8border=function(f,p){var h;for((p=p||f.length)>f.length&&(p=f.length),h=p-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?p:h+c[f[h]]>p?h:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,i,a,c){for(var u=65535&s|0,d=s>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;d=d+(u=u+i[c++]|0)|0,--f;);u%=65521,d%=65521}return u|d<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var s=(function(){for(var i,a=[],c=0;c<256;c++){i=c;for(var u=0;u<8;u++)i=1&i?3988292384^i>>>1:i>>>1;a[c]=i}return a})();r.exports=function(i,a,c,u){var d=s,f=u+c;i^=-1;for(var p=u;p<f;p++)i=i>>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(n,r,o){var s,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),d=n("./messages"),f=0,p=4,h=0,x=-2,m=-1,g=4,y=2,v=8,k=9,S=286,C=30,j=19,N=2*S+1,T=15,I=3,O=258,F=O+I+1,E=42,L=113,w=1,M=2,B=3,D=4;function U(_,q){return _.msg=d[q],q}function G(_){return(_<<1)-(4<_?9:0)}function A(_){for(var q=_.length;0<=--q;)_[q]=0}function H(_){var q=_.state,W=q.pending;W>_.avail_out&&(W=_.avail_out),W!==0&&(i.arraySet(_.output,q.pending_buf,q.pending_out,W,_.next_out),_.next_out+=W,q.pending_out+=W,_.total_out+=W,_.avail_out-=W,q.pending-=W,q.pending===0&&(q.pending_out=0))}function J(_,q){a._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,H(_.strm)}function R(_,q){_.pending_buf[_.pending++]=q}function ee(_,q){_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=255&q}function Q(_,q){var W,P,z=_.max_chain_length,V=_.strstart,ne=_.prev_length,se=_.nice_match,Y=_.strstart>_.w_size-F?_.strstart-(_.w_size-F):0,K=_.window,re=_.w_mask,oe=_.prev,$=_.strstart+O,X=K[V+ne-1],le=K[V+ne];_.prev_length>=_.good_match&&(z>>=2),se>_.lookahead&&(se=_.lookahead);do if(K[(W=q)+ne]===le&&K[W+ne-1]===X&&K[W]===K[V]&&K[++W]===K[V+1]){V+=2,W++;do;while(K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&K[++V]===K[++W]&&V<$);if(P=O-($-V),V=$-O,ne<P){if(_.match_start=q,se<=(ne=P))break;X=K[V+ne-1],le=K[V+ne]}}while((q=oe[q&re])>Y&&--z!=0);return ne<=_.lookahead?ne:_.lookahead}function de(_){var q,W,P,z,V,ne,se,Y,K,re,oe=_.w_size;do{if(z=_.window_size-_.lookahead-_.strstart,_.strstart>=oe+(oe-F)){for(i.arraySet(_.window,_.window,oe,oe,0),_.match_start-=oe,_.strstart-=oe,_.block_start-=oe,q=W=_.hash_size;P=_.head[--q],_.head[q]=oe<=P?P-oe:0,--W;);for(q=W=oe;P=_.prev[--q],_.prev[q]=oe<=P?P-oe:0,--W;);z+=oe}if(_.strm.avail_in===0)break;if(ne=_.strm,se=_.window,Y=_.strstart+_.lookahead,K=z,re=void 0,re=ne.avail_in,K<re&&(re=K),W=re===0?0:(ne.avail_in-=re,i.arraySet(se,ne.input,ne.next_in,re,Y),ne.state.wrap===1?ne.adler=c(ne.adler,se,re,Y):ne.state.wrap===2&&(ne.adler=u(ne.adler,se,re,Y)),ne.next_in+=re,ne.total_in+=re,re),_.lookahead+=W,_.lookahead+_.insert>=I)for(V=_.strstart-_.insert,_.ins_h=_.window[V],_.ins_h=(_.ins_h<<_.hash_shift^_.window[V+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[V+I-1])&_.hash_mask,_.prev[V&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=V,V++,_.insert--,!(_.lookahead+_.insert<I)););}while(_.lookahead<F&&_.strm.avail_in!==0)}function ae(_,q){for(var W,P;;){if(_.lookahead<F){if(de(_),_.lookahead<F&&q===f)return w;if(_.lookahead===0)break}if(W=0,_.lookahead>=I&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),W!==0&&_.strstart-W<=_.w_size-F&&(_.match_length=Q(_,W)),_.match_length>=I)if(P=a._tr_tally(_,_.strstart-_.match_start,_.match_length-I),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=I){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else P=a._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(P&&(J(_,!1),_.strm.avail_out===0))return w}return _.insert=_.strstart<I-1?_.strstart:I-1,q===p?(J(_,!0),_.strm.avail_out===0?B:D):_.last_lit&&(J(_,!1),_.strm.avail_out===0)?w:M}function ue(_,q){for(var W,P,z;;){if(_.lookahead<F){if(de(_),_.lookahead<F&&q===f)return w;if(_.lookahead===0)break}if(W=0,_.lookahead>=I&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=I-1,W!==0&&_.prev_length<_.max_lazy_match&&_.strstart-W<=_.w_size-F&&(_.match_length=Q(_,W),_.match_length<=5&&(_.strategy===1||_.match_length===I&&4096<_.strstart-_.match_start)&&(_.match_length=I-1)),_.prev_length>=I&&_.match_length<=_.prev_length){for(z=_.strstart+_.lookahead-I,P=a._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-I),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+I-1])&_.hash_mask,W=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=I-1,_.strstart++,P&&(J(_,!1),_.strm.avail_out===0))return w}else if(_.match_available){if((P=a._tr_tally(_,0,_.window[_.strstart-1]))&&J(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return w}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(P=a._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<I-1?_.strstart:I-1,q===p?(J(_,!0),_.strm.avail_out===0?B:D):_.last_lit&&(J(_,!1),_.strm.avail_out===0)?w:M}function fe(_,q,W,P,z){this.good_length=_,this.max_lazy=q,this.nice_length=W,this.max_chain=P,this.func=z}function he(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*N),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*j+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(T+1),this.heap=new i.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ye(_){var q;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=y,(q=_.state).pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap?E:L,_.adler=q.wrap===2?0:1,q.last_flush=f,a._tr_init(q),h):U(_,x)}function je(_){var q=ye(_);return q===h&&(function(W){W.window_size=2*W.w_size,A(W.head),W.max_lazy_match=s[W.level].max_lazy,W.good_match=s[W.level].good_length,W.nice_match=s[W.level].nice_length,W.max_chain_length=s[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=I-1,W.match_available=0,W.ins_h=0})(_.state),q}function ze(_,q,W,P,z,V){if(!_)return x;var ne=1;if(q===m&&(q=6),P<0?(ne=0,P=-P):15<P&&(ne=2,P-=16),z<1||k<z||W!==v||P<8||15<P||q<0||9<q||V<0||g<V)return U(_,x);P===8&&(P=9);var se=new he;return(_.state=se).strm=_,se.wrap=ne,se.gzhead=null,se.w_bits=P,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=z+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+I-1)/I),se.window=new i.Buf8(2*se.w_size),se.head=new i.Buf16(se.hash_size),se.prev=new i.Buf16(se.w_size),se.lit_bufsize=1<<z+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new i.Buf8(se.pending_buf_size),se.d_buf=1*se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=q,se.strategy=V,se.method=W,je(_)}s=[new fe(0,0,0,0,function(_,q){var W=65535;for(W>_.pending_buf_size-5&&(W=_.pending_buf_size-5);;){if(_.lookahead<=1){if(de(_),_.lookahead===0&&q===f)return w;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var P=_.block_start+W;if((_.strstart===0||_.strstart>=P)&&(_.lookahead=_.strstart-P,_.strstart=P,J(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-F&&(J(_,!1),_.strm.avail_out===0))return w}return _.insert=0,q===p?(J(_,!0),_.strm.avail_out===0?B:D):(_.strstart>_.block_start&&(J(_,!1),_.strm.avail_out),w)}),new fe(4,4,8,4,ae),new fe(4,5,16,8,ae),new fe(4,6,32,32,ae),new fe(4,4,16,16,ue),new fe(8,16,32,32,ue),new fe(8,16,128,128,ue),new fe(8,32,128,256,ue),new fe(32,128,258,1024,ue),new fe(32,258,258,4096,ue)],o.deflateInit=function(_,q){return ze(_,q,v,15,8,0)},o.deflateInit2=ze,o.deflateReset=je,o.deflateResetKeep=ye,o.deflateSetHeader=function(_,q){return _&&_.state?_.state.wrap!==2?x:(_.state.gzhead=q,h):x},o.deflate=function(_,q){var W,P,z,V;if(!_||!_.state||5<q||q<0)return _?U(_,x):x;if(P=_.state,!_.output||!_.input&&_.avail_in!==0||P.status===666&&q!==p)return U(_,_.avail_out===0?-5:x);if(P.strm=_,W=P.last_flush,P.last_flush=q,P.status===E)if(P.wrap===2)_.adler=0,R(P,31),R(P,139),R(P,8),P.gzhead?(R(P,(P.gzhead.text?1:0)+(P.gzhead.hcrc?2:0)+(P.gzhead.extra?4:0)+(P.gzhead.name?8:0)+(P.gzhead.comment?16:0)),R(P,255&P.gzhead.time),R(P,P.gzhead.time>>8&255),R(P,P.gzhead.time>>16&255),R(P,P.gzhead.time>>24&255),R(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),R(P,255&P.gzhead.os),P.gzhead.extra&&P.gzhead.extra.length&&(R(P,255&P.gzhead.extra.length),R(P,P.gzhead.extra.length>>8&255)),P.gzhead.hcrc&&(_.adler=u(_.adler,P.pending_buf,P.pending,0)),P.gzindex=0,P.status=69):(R(P,0),R(P,0),R(P,0),R(P,0),R(P,0),R(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),R(P,3),P.status=L);else{var ne=v+(P.w_bits-8<<4)<<8;ne|=(2<=P.strategy||P.level<2?0:P.level<6?1:P.level===6?2:3)<<6,P.strstart!==0&&(ne|=32),ne+=31-ne%31,P.status=L,ee(P,ne),P.strstart!==0&&(ee(P,_.adler>>>16),ee(P,65535&_.adler)),_.adler=1}if(P.status===69)if(P.gzhead.extra){for(z=P.pending;P.gzindex<(65535&P.gzhead.extra.length)&&(P.pending!==P.pending_buf_size||(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending!==P.pending_buf_size));)R(P,255&P.gzhead.extra[P.gzindex]),P.gzindex++;P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),P.gzindex===P.gzhead.extra.length&&(P.gzindex=0,P.status=73)}else P.status=73;if(P.status===73)if(P.gzhead.name){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending===P.pending_buf_size)){V=1;break}V=P.gzindex<P.gzhead.name.length?255&P.gzhead.name.charCodeAt(P.gzindex++):0,R(P,V)}while(V!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V===0&&(P.gzindex=0,P.status=91)}else P.status=91;if(P.status===91)if(P.gzhead.comment){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),H(_),z=P.pending,P.pending===P.pending_buf_size)){V=1;break}V=P.gzindex<P.gzhead.comment.length?255&P.gzhead.comment.charCodeAt(P.gzindex++):0,R(P,V)}while(V!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V===0&&(P.status=103)}else P.status=103;if(P.status===103&&(P.gzhead.hcrc?(P.pending+2>P.pending_buf_size&&H(_),P.pending+2<=P.pending_buf_size&&(R(P,255&_.adler),R(P,_.adler>>8&255),_.adler=0,P.status=L)):P.status=L),P.pending!==0){if(H(_),_.avail_out===0)return P.last_flush=-1,h}else if(_.avail_in===0&&G(q)<=G(W)&&q!==p)return U(_,-5);if(P.status===666&&_.avail_in!==0)return U(_,-5);if(_.avail_in!==0||P.lookahead!==0||q!==f&&P.status!==666){var se=P.strategy===2?(function(Y,K){for(var re;;){if(Y.lookahead===0&&(de(Y),Y.lookahead===0)){if(K===f)return w;break}if(Y.match_length=0,re=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,re&&(J(Y,!1),Y.strm.avail_out===0))return w}return Y.insert=0,K===p?(J(Y,!0),Y.strm.avail_out===0?B:D):Y.last_lit&&(J(Y,!1),Y.strm.avail_out===0)?w:M})(P,q):P.strategy===3?(function(Y,K){for(var re,oe,$,X,le=Y.window;;){if(Y.lookahead<=O){if(de(Y),Y.lookahead<=O&&K===f)return w;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=I&&0<Y.strstart&&(oe=le[$=Y.strstart-1])===le[++$]&&oe===le[++$]&&oe===le[++$]){X=Y.strstart+O;do;while(oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&oe===le[++$]&&$<X);Y.match_length=O-(X-$),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=I?(re=a._tr_tally(Y,1,Y.match_length-I),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(re=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),re&&(J(Y,!1),Y.strm.avail_out===0))return w}return Y.insert=0,K===p?(J(Y,!0),Y.strm.avail_out===0?B:D):Y.last_lit&&(J(Y,!1),Y.strm.avail_out===0)?w:M})(P,q):s[P.level].func(P,q);if(se!==B&&se!==D||(P.status=666),se===w||se===B)return _.avail_out===0&&(P.last_flush=-1),h;if(se===M&&(q===1?a._tr_align(P):q!==5&&(a._tr_stored_block(P,0,0,!1),q===3&&(A(P.head),P.lookahead===0&&(P.strstart=0,P.block_start=0,P.insert=0))),H(_),_.avail_out===0))return P.last_flush=-1,h}return q!==p?h:P.wrap<=0?1:(P.wrap===2?(R(P,255&_.adler),R(P,_.adler>>8&255),R(P,_.adler>>16&255),R(P,_.adler>>24&255),R(P,255&_.total_in),R(P,_.total_in>>8&255),R(P,_.total_in>>16&255),R(P,_.total_in>>24&255)):(ee(P,_.adler>>>16),ee(P,65535&_.adler)),H(_),0<P.wrap&&(P.wrap=-P.wrap),P.pending!==0?h:1)},o.deflateEnd=function(_){var q;return _&&_.state?(q=_.state.status)!==E&&q!==69&&q!==73&&q!==91&&q!==103&&q!==L&&q!==666?U(_,x):(_.state=null,q===L?U(_,-3):h):x},o.deflateSetDictionary=function(_,q){var W,P,z,V,ne,se,Y,K,re=q.length;if(!_||!_.state||(V=(W=_.state).wrap)===2||V===1&&W.status!==E||W.lookahead)return x;for(V===1&&(_.adler=c(_.adler,q,re,0)),W.wrap=0,re>=W.w_size&&(V===0&&(A(W.head),W.strstart=0,W.block_start=0,W.insert=0),K=new i.Buf8(W.w_size),i.arraySet(K,q,re-W.w_size,W.w_size,0),q=K,re=W.w_size),ne=_.avail_in,se=_.next_in,Y=_.input,_.avail_in=re,_.next_in=0,_.input=q,de(W);W.lookahead>=I;){for(P=W.strstart,z=W.lookahead-(I-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[P+I-1])&W.hash_mask,W.prev[P&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=P,P++,--z;);W.strstart=P,W.lookahead=I-1,de(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=I-1,W.match_available=0,_.next_in=se,_.input=Y,_.avail_in=ne,W.wrap=V,h},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(s,i){var a,c,u,d,f,p,h,x,m,g,y,v,k,S,C,j,N,T,I,O,F,E,L,w,M;a=s.state,c=s.next_in,w=s.input,u=c+(s.avail_in-5),d=s.next_out,M=s.output,f=d-(i-s.avail_out),p=d+(s.avail_out-257),h=a.dmax,x=a.wsize,m=a.whave,g=a.wnext,y=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,j=(1<<a.lenbits)-1,N=(1<<a.distbits)-1;e:do{k<15&&(v+=w[c++]<<k,k+=8,v+=w[c++]<<k,k+=8),T=S[v&j];t:for(;;){if(v>>>=I=T>>>24,k-=I,(I=T>>>16&255)===0)M[d++]=65535&T;else{if(!(16&I)){if((64&I)==0){T=S[(65535&T)+(v&(1<<I)-1)];continue t}if(32&I){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}O=65535&T,(I&=15)&&(k<I&&(v+=w[c++]<<k,k+=8),O+=v&(1<<I)-1,v>>>=I,k-=I),k<15&&(v+=w[c++]<<k,k+=8,v+=w[c++]<<k,k+=8),T=C[v&N];n:for(;;){if(v>>>=I=T>>>24,k-=I,!(16&(I=T>>>16&255))){if((64&I)==0){T=C[(65535&T)+(v&(1<<I)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(F=65535&T,k<(I&=15)&&(v+=w[c++]<<k,(k+=8)<I&&(v+=w[c++]<<k,k+=8)),h<(F+=v&(1<<I)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=I,k-=I,(I=d-f)<F){if(m<(I=F-I)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(L=y,(E=0)===g){if(E+=x-I,I<O){for(O-=I;M[d++]=y[E++],--I;);E=d-F,L=M}}else if(g<I){if(E+=x+g-I,(I-=g)<O){for(O-=I;M[d++]=y[E++],--I;);if(E=0,g<O){for(O-=I=g;M[d++]=y[E++],--I;);E=d-F,L=M}}}else if(E+=g-I,I<O){for(O-=I;M[d++]=y[E++],--I;);E=d-F,L=M}for(;2<O;)M[d++]=L[E++],M[d++]=L[E++],M[d++]=L[E++],O-=3;O&&(M[d++]=L[E++],1<O&&(M[d++]=L[E++]))}else{for(E=d-F;M[d++]=M[E++],M[d++]=M[E++],M[d++]=M[E++],2<(O-=3););O&&(M[d++]=M[E++],1<O&&(M[d++]=M[E++]))}break}}break}}while(c<u&&d<p);c-=O=k>>3,v&=(1<<(k-=O<<3))-1,s.next_in=c,s.next_out=d,s.avail_in=c<u?u-c+5:5-(c-u),s.avail_out=d<p?p-d+257:257-(d-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var s=n("../utils/common"),i=n("./adler32"),a=n("./crc32"),c=n("./inffast"),u=n("./inftrees"),d=1,f=2,p=0,h=-2,x=1,m=852,g=592;function y(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var L;return E&&E.state?(L=E.state,E.total_in=E.total_out=L.total=0,E.msg="",L.wrap&&(E.adler=1&L.wrap),L.mode=x,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new s.Buf32(m),L.distcode=L.distdyn=new s.Buf32(g),L.sane=1,L.back=-1,p):h}function S(E){var L;return E&&E.state?((L=E.state).wsize=0,L.whave=0,L.wnext=0,k(E)):h}function C(E,L){var w,M;return E&&E.state?(M=E.state,L<0?(w=0,L=-L):(w=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?h:(M.window!==null&&M.wbits!==L&&(M.window=null),M.wrap=w,M.wbits=L,S(E))):h}function j(E,L){var w,M;return E?(M=new v,(E.state=M).window=null,(w=C(E,L))!==p&&(E.state=null),w):h}var N,T,I=!0;function O(E){if(I){var L;for(N=new s.Buf32(512),T=new s.Buf32(32),L=0;L<144;)E.lens[L++]=8;for(;L<256;)E.lens[L++]=9;for(;L<280;)E.lens[L++]=7;for(;L<288;)E.lens[L++]=8;for(u(d,E.lens,0,288,N,0,E.work,{bits:9}),L=0;L<32;)E.lens[L++]=5;u(f,E.lens,0,32,T,0,E.work,{bits:5}),I=!1}E.lencode=N,E.lenbits=9,E.distcode=T,E.distbits=5}function F(E,L,w,M){var B,D=E.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new s.Buf8(D.wsize)),M>=D.wsize?(s.arraySet(D.window,L,w-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(M<(B=D.wsize-D.wnext)&&(B=M),s.arraySet(D.window,L,w-M,B,D.wnext),(M-=B)?(s.arraySet(D.window,L,w-M,M,0),D.wnext=M,D.whave=D.wsize):(D.wnext+=B,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=B))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return j(E,15)},o.inflateInit2=j,o.inflate=function(E,L){var w,M,B,D,U,G,A,H,J,R,ee,Q,de,ae,ue,fe,he,ye,je,ze,_,q,W,P,z=0,V=new s.Buf8(4),ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return h;(w=E.state).mode===12&&(w.mode=13),U=E.next_out,B=E.output,A=E.avail_out,D=E.next_in,M=E.input,G=E.avail_in,H=w.hold,J=w.bits,R=G,ee=A,q=p;e:for(;;)switch(w.mode){case x:if(w.wrap===0){w.mode=13;break}for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(2&w.wrap&&H===35615){V[w.check=0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0),J=H=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&H)<<8)+(H>>8))%31){E.msg="incorrect header check",w.mode=30;break}if((15&H)!=8){E.msg="unknown compression method",w.mode=30;break}if(J-=4,_=8+(15&(H>>>=4)),w.wbits===0)w.wbits=_;else if(_>w.wbits){E.msg="invalid window size",w.mode=30;break}w.dmax=1<<_,E.adler=w.check=1,w.mode=512&H?10:12,J=H=0;break;case 2:for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(w.flags=H,(255&w.flags)!=8){E.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){E.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=H>>8&1),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0,w.mode=3;case 3:for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.head&&(w.head.time=H),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,V[2]=H>>>16&255,V[3]=H>>>24&255,w.check=a(w.check,V,4,0)),J=H=0,w.mode=4;case 4:for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.head&&(w.head.xflags=255&H,w.head.os=H>>8),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0,w.mode=5;case 5:if(1024&w.flags){for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.length=H,w.head&&(w.head.extra_len=H),512&w.flags&&(V[0]=255&H,V[1]=H>>>8&255,w.check=a(w.check,V,2,0)),J=H=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(G<(Q=w.length)&&(Q=G),Q&&(w.head&&(_=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,M,D,Q,_)),512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,w.length-=Q),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(G===0)break e;for(Q=0;_=M[D+Q++],w.head&&_&&w.length<65536&&(w.head.name+=String.fromCharCode(_)),_&&Q<G;);if(512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,_)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(G===0)break e;for(Q=0;_=M[D+Q++],w.head&&_&&w.length<65536&&(w.head.comment+=String.fromCharCode(_)),_&&Q<G;);if(512&w.flags&&(w.check=a(w.check,M,Q,D)),G-=Q,D+=Q,_)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;J<16;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H!==(65535&w.check)){E.msg="header crc mismatch",w.mode=30;break}J=H=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),E.adler=w.check=0,w.mode=12;break;case 10:for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}E.adler=w.check=y(H),J=H=0,w.mode=11;case 11:if(w.havedict===0)return E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,2;E.adler=w.check=1,w.mode=12;case 12:if(L===5||L===6)break e;case 13:if(w.last){H>>>=7&J,J-=7&J,w.mode=27;break}for(;J<3;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}switch(w.last=1&H,J-=1,3&(H>>>=1)){case 0:w.mode=14;break;case 1:if(O(w),w.mode=20,L!==6)break;H>>>=2,J-=2;break e;case 2:w.mode=17;break;case 3:E.msg="invalid block type",w.mode=30}H>>>=2,J-=2;break;case 14:for(H>>>=7&J,J-=7&J;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if((65535&H)!=(H>>>16^65535)){E.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&H,J=H=0,w.mode=15,L===6)break e;case 15:w.mode=16;case 16:if(Q=w.length){if(G<Q&&(Q=G),A<Q&&(Q=A),Q===0)break e;s.arraySet(B,M,D,Q,U),G-=Q,D+=Q,A-=Q,U+=Q,w.length-=Q;break}w.mode=12;break;case 17:for(;J<14;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(w.nlen=257+(31&H),H>>>=5,J-=5,w.ndist=1+(31&H),H>>>=5,J-=5,w.ncode=4+(15&H),H>>>=4,J-=4,286<w.nlen||30<w.ndist){E.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;J<3;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.lens[ne[w.have++]]=7&H,H>>>=3,J-=3}for(;w.have<19;)w.lens[ne[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,W={bits:w.lenbits},q=u(0,w.lens,0,19,w.lencode,0,w.work,W),w.lenbits=W.bits,q){E.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;fe=(z=w.lencode[H&(1<<w.lenbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(he<16)H>>>=ue,J-=ue,w.lens[w.have++]=he;else{if(he===16){for(P=ue+2;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H>>>=ue,J-=ue,w.have===0){E.msg="invalid bit length repeat",w.mode=30;break}_=w.lens[w.have-1],Q=3+(3&H),H>>>=2,J-=2}else if(he===17){for(P=ue+3;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}J-=ue,_=0,Q=3+(7&(H>>>=ue)),H>>>=3,J-=3}else{for(P=ue+7;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}J-=ue,_=0,Q=11+(127&(H>>>=ue)),H>>>=7,J-=7}if(w.have+Q>w.nlen+w.ndist){E.msg="invalid bit length repeat",w.mode=30;break}for(;Q--;)w.lens[w.have++]=_}}if(w.mode===30)break;if(w.lens[256]===0){E.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,W={bits:w.lenbits},q=u(d,w.lens,0,w.nlen,w.lencode,0,w.work,W),w.lenbits=W.bits,q){E.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,W={bits:w.distbits},q=u(f,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,W),w.distbits=W.bits,q){E.msg="invalid distances set",w.mode=30;break}if(w.mode=20,L===6)break e;case 20:w.mode=21;case 21:if(6<=G&&258<=A){E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,c(E,ee),U=E.next_out,B=E.output,A=E.avail_out,D=E.next_in,M=E.input,G=E.avail_in,H=w.hold,J=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;fe=(z=w.lencode[H&(1<<w.lenbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(fe&&(240&fe)==0){for(ye=ue,je=fe,ze=he;fe=(z=w.lencode[ze+((H&(1<<ye+je)-1)>>ye)])>>>16&255,he=65535&z,!(ye+(ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}H>>>=ye,J-=ye,w.back+=ye}if(H>>>=ue,J-=ue,w.back+=ue,w.length=he,fe===0){w.mode=26;break}if(32&fe){w.back=-1,w.mode=12;break}if(64&fe){E.msg="invalid literal/length code",w.mode=30;break}w.extra=15&fe,w.mode=22;case 22:if(w.extra){for(P=w.extra;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.length+=H&(1<<w.extra)-1,H>>>=w.extra,J-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;fe=(z=w.distcode[H&(1<<w.distbits)-1])>>>16&255,he=65535&z,!((ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if((240&fe)==0){for(ye=ue,je=fe,ze=he;fe=(z=w.distcode[ze+((H&(1<<ye+je)-1)>>ye)])>>>16&255,he=65535&z,!(ye+(ue=z>>>24)<=J);){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}H>>>=ye,J-=ye,w.back+=ye}if(H>>>=ue,J-=ue,w.back+=ue,64&fe){E.msg="invalid distance code",w.mode=30;break}w.offset=he,w.extra=15&fe,w.mode=24;case 24:if(w.extra){for(P=w.extra;J<P;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}w.offset+=H&(1<<w.extra)-1,H>>>=w.extra,J-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){E.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(A===0)break e;if(Q=ee-A,w.offset>Q){if((Q=w.offset-Q)>w.whave&&w.sane){E.msg="invalid distance too far back",w.mode=30;break}de=Q>w.wnext?(Q-=w.wnext,w.wsize-Q):w.wnext-Q,Q>w.length&&(Q=w.length),ae=w.window}else ae=B,de=U-w.offset,Q=w.length;for(A<Q&&(Q=A),A-=Q,w.length-=Q;B[U++]=ae[de++],--Q;);w.length===0&&(w.mode=21);break;case 26:if(A===0)break e;B[U++]=w.length,A--,w.mode=21;break;case 27:if(w.wrap){for(;J<32;){if(G===0)break e;G--,H|=M[D++]<<J,J+=8}if(ee-=A,E.total_out+=ee,w.total+=ee,ee&&(E.adler=w.check=w.flags?a(w.check,B,ee,U-ee):i(w.check,B,ee,U-ee)),ee=A,(w.flags?H:y(H))!==w.check){E.msg="incorrect data check",w.mode=30;break}J=H=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;J<32;){if(G===0)break e;G--,H+=M[D++]<<J,J+=8}if(H!==(4294967295&w.total)){E.msg="incorrect length check",w.mode=30;break}J=H=0}w.mode=29;case 29:q=1;break e;case 30:q=-3;break e;case 31:return-4;default:return h}return E.next_out=U,E.avail_out=A,E.next_in=D,E.avail_in=G,w.hold=H,w.bits=J,(w.wsize||ee!==E.avail_out&&w.mode<30&&(w.mode<27||L!==4))&&F(E,E.output,E.next_out,ee-E.avail_out)?(w.mode=31,-4):(R-=E.avail_in,ee-=E.avail_out,E.total_in+=R,E.total_out+=ee,w.total+=ee,w.wrap&&ee&&(E.adler=w.check=w.flags?a(w.check,B,ee,E.next_out-ee):i(w.check,B,ee,E.next_out-ee)),E.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(R==0&&ee===0||L===4)&&q===p&&(q=-5),q)},o.inflateEnd=function(E){if(!E||!E.state)return h;var L=E.state;return L.window&&(L.window=null),E.state=null,p},o.inflateGetHeader=function(E,L){var w;return E&&E.state?(2&(w=E.state).wrap)==0?h:((w.head=L).done=!1,p):h},o.inflateSetDictionary=function(E,L){var w,M=L.length;return E&&E.state?(w=E.state).wrap!==0&&w.mode!==11?h:w.mode===11&&i(1,L,M,0)!==w.check?-3:F(E,L,M,M)?(w.mode=31,-4):(w.havedict=1,p):h},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var s=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,f,p,h,x,m,g,y){var v,k,S,C,j,N,T,I,O,F=y.bits,E=0,L=0,w=0,M=0,B=0,D=0,U=0,G=0,A=0,H=0,J=null,R=0,ee=new s.Buf16(16),Q=new s.Buf16(16),de=null,ae=0;for(E=0;E<=15;E++)ee[E]=0;for(L=0;L<h;L++)ee[f[p+L]]++;for(B=F,M=15;1<=M&&ee[M]===0;M--);if(M<B&&(B=M),M===0)return x[m++]=20971520,x[m++]=20971520,y.bits=1,0;for(w=1;w<M&&ee[w]===0;w++);for(B<w&&(B=w),E=G=1;E<=15;E++)if(G<<=1,(G-=ee[E])<0)return-1;if(0<G&&(d===0||M!==1))return-1;for(Q[1]=0,E=1;E<15;E++)Q[E+1]=Q[E]+ee[E];for(L=0;L<h;L++)f[p+L]!==0&&(g[Q[f[p+L]]++]=L);if(N=d===0?(J=de=g,19):d===1?(J=i,R-=257,de=a,ae-=257,256):(J=c,de=u,-1),E=w,j=m,U=L=H=0,S=-1,C=(A=1<<(D=B))-1,d===1&&852<A||d===2&&592<A)return 1;for(;;){for(T=E-U,O=g[L]<N?(I=0,g[L]):g[L]>N?(I=de[ae+g[L]],J[R+g[L]]):(I=96,0),v=1<<E-U,w=k=1<<D;x[j+(H>>U)+(k-=v)]=T<<24|I<<16|O|0,k!==0;);for(v=1<<E-1;H&v;)v>>=1;if(v!==0?(H&=v-1,H+=v):H=0,L++,--ee[E]==0){if(E===M)break;E=f[p+g[L]]}if(B<E&&(H&C)!==S){for(U===0&&(U=B),j+=w,G=1<<(D=E-U);D+U<M&&!((G-=ee[D+U])<=0);)D++,G<<=1;if(A+=1<<D,d===1&&852<A||d===2&&592<A)return 1;x[S=H&C]=B<<24|D<<16|j-m|0}}return H!==0&&(x[j+H]=E-U<<24|64<<16|0),y.bits=B,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var s=n("../utils/common"),i=0,a=1;function c(z){for(var V=z.length;0<=--V;)z[V]=0}var u=0,d=29,f=256,p=f+1+d,h=30,x=19,m=2*p+1,g=15,y=16,v=7,k=256,S=16,C=17,j=18,N=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],T=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));c(F);var E=new Array(2*h);c(E);var L=new Array(512);c(L);var w=new Array(256);c(w);var M=new Array(d);c(M);var B,D,U,G=new Array(h);function A(z,V,ne,se,Y){this.static_tree=z,this.extra_bits=V,this.extra_base=ne,this.elems=se,this.max_length=Y,this.has_stree=z&&z.length}function H(z,V){this.dyn_tree=z,this.max_code=0,this.stat_desc=V}function J(z){return z<256?L[z]:L[256+(z>>>7)]}function R(z,V){z.pending_buf[z.pending++]=255&V,z.pending_buf[z.pending++]=V>>>8&255}function ee(z,V,ne){z.bi_valid>y-ne?(z.bi_buf|=V<<z.bi_valid&65535,R(z,z.bi_buf),z.bi_buf=V>>y-z.bi_valid,z.bi_valid+=ne-y):(z.bi_buf|=V<<z.bi_valid&65535,z.bi_valid+=ne)}function Q(z,V,ne){ee(z,ne[2*V],ne[2*V+1])}function de(z,V){for(var ne=0;ne|=1&z,z>>>=1,ne<<=1,0<--V;);return ne>>>1}function ae(z,V,ne){var se,Y,K=new Array(g+1),re=0;for(se=1;se<=g;se++)K[se]=re=re+ne[se-1]<<1;for(Y=0;Y<=V;Y++){var oe=z[2*Y+1];oe!==0&&(z[2*Y]=de(K[oe]++,oe))}}function ue(z){var V;for(V=0;V<p;V++)z.dyn_ltree[2*V]=0;for(V=0;V<h;V++)z.dyn_dtree[2*V]=0;for(V=0;V<x;V++)z.bl_tree[2*V]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function fe(z){8<z.bi_valid?R(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function he(z,V,ne,se){var Y=2*V,K=2*ne;return z[Y]<z[K]||z[Y]===z[K]&&se[V]<=se[ne]}function ye(z,V,ne){for(var se=z.heap[ne],Y=ne<<1;Y<=z.heap_len&&(Y<z.heap_len&&he(V,z.heap[Y+1],z.heap[Y],z.depth)&&Y++,!he(V,se,z.heap[Y],z.depth));)z.heap[ne]=z.heap[Y],ne=Y,Y<<=1;z.heap[ne]=se}function je(z,V,ne){var se,Y,K,re,oe=0;if(z.last_lit!==0)for(;se=z.pending_buf[z.d_buf+2*oe]<<8|z.pending_buf[z.d_buf+2*oe+1],Y=z.pending_buf[z.l_buf+oe],oe++,se===0?Q(z,Y,V):(Q(z,(K=w[Y])+f+1,V),(re=N[K])!==0&&ee(z,Y-=M[K],re),Q(z,K=J(--se),ne),(re=T[K])!==0&&ee(z,se-=G[K],re)),oe<z.last_lit;);Q(z,k,V)}function ze(z,V){var ne,se,Y,K=V.dyn_tree,re=V.stat_desc.static_tree,oe=V.stat_desc.has_stree,$=V.stat_desc.elems,X=-1;for(z.heap_len=0,z.heap_max=m,ne=0;ne<$;ne++)K[2*ne]!==0?(z.heap[++z.heap_len]=X=ne,z.depth[ne]=0):K[2*ne+1]=0;for(;z.heap_len<2;)K[2*(Y=z.heap[++z.heap_len]=X<2?++X:0)]=1,z.depth[Y]=0,z.opt_len--,oe&&(z.static_len-=re[2*Y+1]);for(V.max_code=X,ne=z.heap_len>>1;1<=ne;ne--)ye(z,K,ne);for(Y=$;ne=z.heap[1],z.heap[1]=z.heap[z.heap_len--],ye(z,K,1),se=z.heap[1],z.heap[--z.heap_max]=ne,z.heap[--z.heap_max]=se,K[2*Y]=K[2*ne]+K[2*se],z.depth[Y]=(z.depth[ne]>=z.depth[se]?z.depth[ne]:z.depth[se])+1,K[2*ne+1]=K[2*se+1]=Y,z.heap[1]=Y++,ye(z,K,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(le,we){var Ie,Ke,ft,Pe,At,Ut,qe=we.dyn_tree,Vt=we.max_code,kt=we.stat_desc.static_tree,eg=we.stat_desc.has_stree,tg=we.stat_desc.extra_bits,ll=we.stat_desc.extra_base,lr=we.stat_desc.max_length,Wr=0;for(Pe=0;Pe<=g;Pe++)le.bl_count[Pe]=0;for(qe[2*le.heap[le.heap_max]+1]=0,Ie=le.heap_max+1;Ie<m;Ie++)lr<(Pe=qe[2*qe[2*(Ke=le.heap[Ie])+1]+1]+1)&&(Pe=lr,Wr++),qe[2*Ke+1]=Pe,Vt<Ke||(le.bl_count[Pe]++,At=0,ll<=Ke&&(At=tg[Ke-ll]),Ut=qe[2*Ke],le.opt_len+=Ut*(Pe+At),eg&&(le.static_len+=Ut*(kt[2*Ke+1]+At)));if(Wr!==0){do{for(Pe=lr-1;le.bl_count[Pe]===0;)Pe--;le.bl_count[Pe]--,le.bl_count[Pe+1]+=2,le.bl_count[lr]--,Wr-=2}while(0<Wr);for(Pe=lr;Pe!==0;Pe--)for(Ke=le.bl_count[Pe];Ke!==0;)Vt<(ft=le.heap[--Ie])||(qe[2*ft+1]!==Pe&&(le.opt_len+=(Pe-qe[2*ft+1])*qe[2*ft],qe[2*ft+1]=Pe),Ke--)}})(z,V),ae(K,X,z.bl_count)}function _(z,V,ne){var se,Y,K=-1,re=V[1],oe=0,$=7,X=4;for(re===0&&($=138,X=3),V[2*(ne+1)+1]=65535,se=0;se<=ne;se++)Y=re,re=V[2*(se+1)+1],++oe<$&&Y===re||(oe<X?z.bl_tree[2*Y]+=oe:Y!==0?(Y!==K&&z.bl_tree[2*Y]++,z.bl_tree[2*S]++):oe<=10?z.bl_tree[2*C]++:z.bl_tree[2*j]++,K=Y,X=(oe=0)===re?($=138,3):Y===re?($=6,3):($=7,4))}function q(z,V,ne){var se,Y,K=-1,re=V[1],oe=0,$=7,X=4;for(re===0&&($=138,X=3),se=0;se<=ne;se++)if(Y=re,re=V[2*(se+1)+1],!(++oe<$&&Y===re)){if(oe<X)for(;Q(z,Y,z.bl_tree),--oe!=0;);else Y!==0?(Y!==K&&(Q(z,Y,z.bl_tree),oe--),Q(z,S,z.bl_tree),ee(z,oe-3,2)):oe<=10?(Q(z,C,z.bl_tree),ee(z,oe-3,3)):(Q(z,j,z.bl_tree),ee(z,oe-11,7));K=Y,X=(oe=0)===re?($=138,3):Y===re?($=6,3):($=7,4)}}c(G);var W=!1;function P(z,V,ne,se){ee(z,(u<<1)+(se?1:0),3),(function(Y,K,re,oe){fe(Y),R(Y,re),R(Y,~re),s.arraySet(Y.pending_buf,Y.window,K,re,Y.pending),Y.pending+=re})(z,V,ne)}o._tr_init=function(z){W||((function(){var V,ne,se,Y,K,re=new Array(g+1);for(Y=se=0;Y<d-1;Y++)for(M[Y]=se,V=0;V<1<<N[Y];V++)w[se++]=Y;for(w[se-1]=Y,Y=K=0;Y<16;Y++)for(G[Y]=K,V=0;V<1<<T[Y];V++)L[K++]=Y;for(K>>=7;Y<h;Y++)for(G[Y]=K<<7,V=0;V<1<<T[Y]-7;V++)L[256+K++]=Y;for(ne=0;ne<=g;ne++)re[ne]=0;for(V=0;V<=143;)F[2*V+1]=8,V++,re[8]++;for(;V<=255;)F[2*V+1]=9,V++,re[9]++;for(;V<=279;)F[2*V+1]=7,V++,re[7]++;for(;V<=287;)F[2*V+1]=8,V++,re[8]++;for(ae(F,p+1,re),V=0;V<h;V++)E[2*V+1]=5,E[2*V]=de(V,5);B=new A(F,N,f+1,p,g),D=new A(E,T,0,h,g),U=new A(new Array(0),I,0,x,v)})(),W=!0),z.l_desc=new H(z.dyn_ltree,B),z.d_desc=new H(z.dyn_dtree,D),z.bl_desc=new H(z.bl_tree,U),z.bi_buf=0,z.bi_valid=0,ue(z)},o._tr_stored_block=P,o._tr_flush_block=function(z,V,ne,se){var Y,K,re=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(oe){var $,X=4093624447;for($=0;$<=31;$++,X>>>=1)if(1&X&&oe.dyn_ltree[2*$]!==0)return i;if(oe.dyn_ltree[18]!==0||oe.dyn_ltree[20]!==0||oe.dyn_ltree[26]!==0)return a;for($=32;$<f;$++)if(oe.dyn_ltree[2*$]!==0)return a;return i})(z)),ze(z,z.l_desc),ze(z,z.d_desc),re=(function(oe){var $;for(_(oe,oe.dyn_ltree,oe.l_desc.max_code),_(oe,oe.dyn_dtree,oe.d_desc.max_code),ze(oe,oe.bl_desc),$=x-1;3<=$&&oe.bl_tree[2*O[$]+1]===0;$--);return oe.opt_len+=3*($+1)+5+5+4,$})(z),Y=z.opt_len+3+7>>>3,(K=z.static_len+3+7>>>3)<=Y&&(Y=K)):Y=K=ne+5,ne+4<=Y&&V!==-1?P(z,V,ne,se):z.strategy===4||K===Y?(ee(z,2+(se?1:0),3),je(z,F,E)):(ee(z,4+(se?1:0),3),(function(oe,$,X,le){var we;for(ee(oe,$-257,5),ee(oe,X-1,5),ee(oe,le-4,4),we=0;we<le;we++)ee(oe,oe.bl_tree[2*O[we]+1],3);q(oe,oe.dyn_ltree,$-1),q(oe,oe.dyn_dtree,X-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,re+1),je(z,z.dyn_ltree,z.dyn_dtree)),ue(z),se&&fe(z)},o._tr_tally=function(z,V,ne){return z.pending_buf[z.d_buf+2*z.last_lit]=V>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&V,z.pending_buf[z.l_buf+z.last_lit]=255&ne,z.last_lit++,V===0?z.dyn_ltree[2*ne]++:(z.matches++,V--,z.dyn_ltree[2*(w[ne]+f+1)]++,z.dyn_dtree[2*J(V)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){ee(z,2,3),Q(z,k,F),(function(V){V.bi_valid===16?(R(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):8<=V.bi_valid&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(i,a){if(!i.setImmediate){var c,u,d,f,p=1,h={},x=!1,m=i.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(i);g=g&&g.setTimeout?g:i,c={}.toString.call(i.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(i.postMessage&&!i.importScripts){var S=!0,C=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=C,S}})()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",k,!1):i.attachEvent("onmessage",k),function(S){i.postMessage(f+S,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,u.removeChild(C),C=null},u.appendChild(C)}):function(S){setTimeout(v,0,S)},g.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),j=0;j<C.length;j++)C[j]=arguments[j+1];var N={callback:S,args:C};return h[p]=N,c(p),p++},g.clearImmediate=y}function y(S){delete h[S]}function v(S){if(x)setTimeout(v,0,S);else{var C=h[S];if(C){x=!0;try{(function(j){var N=j.callback,T=j.args;switch(T.length){case 0:N();break;case 1:N(T[0]);break;case 2:N(T[0],T[1]);break;case 3:N(T[0],T[1],T[2]);break;default:N.apply(a,T)}})(C)}finally{y(S),x=!1}}}}function k(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(f)===0&&v(+S.data.slice(f.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof Zr<"u"?Zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ks)),ks.exports}var A2=T2();const I2=Ji(A2),Wd="[REDACTED]",z2=/(^|[-_])(api[-_]?key|authorization|cookie|token|secret|password|access[-_]?token|refresh[-_]?token)([-_]|$)/i,R2=[/Bearer\s+[A-Za-z0-9._~+/=-]{12,}/gi,/\bsk-[A-Za-z0-9_-]{12,}\b/g,/\bsk-ant-[A-Za-z0-9_-]{12,}\b/g,/\bghp_[A-Za-z0-9_]{12,}\b/g,/\bglpat-[A-Za-z0-9_-]{12,}\b/g];async function P2(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}function O2(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function di(e){if(Array.isArray(e))return e.map(n=>di(n));if(!O2(e))return e;const t={};for(const[n,r]of Object.entries(e))t[n]=z2.test(n)?Wd:di(r);return t}function M2(e){const t=n=>{let r=n;for(const o of R2)r=r.replace(o,Wd);return r};try{const n=JSON.parse(e);return t(JSON.stringify(di(n),null,2))}catch{return t(e)}}function _s(e,t){return t==="redacted"?M2(e):e}async function L2(e,t="redacted"){const n=new I2,r=t==="redacted"?"redacted":"raw";n.file("manifest.json",JSON.stringify({exportedAt:new Date().toISOString(),mode:t,redacted:t==="redacted",logCount:e.length,logIds:e.map(c=>c.id)},null,2));for(const c of e)c.rawRequestBody!==null&&n.file(`#${c.id}.Request.json`,_s(c.rawRequestBody,t)),c.responseText!==null&&n.file(`#${c.id}.Response.json`,_s(c.responseText,t));const o=e.filter(c=>c.streaming);await Promise.allSettled(o.map(async c=>{const u=await P2(c.id);u!==null&&n.file(`#${c.id}.SSE.Response.json`,_s(u,t))}));const s=await n.generateAsync({type:"blob"}),i=URL.createObjectURL(s),a=document.createElement("a");a.href=i,a.download=`agent-inspector-export-${r}-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function fi(e,t){switch(t){case"full":return e;case"time":return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}}function ca(e,t,n){return`${fi(e,n)} - ${fi(t,n)}`}function Zd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qd(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zd(e))&&(r&&(r+=" "),r+=t);return r}const D2=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},F2=(e,t)=>({classGroupId:e,validator:t}),Jd=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),No="-",Ml=[],$2="arbitrary..",B2=e=>{const t=V2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return U2(i);const a=i.split(No),c=a[0]===""&&a.length>1?1:0;return Kd(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],u=n[i];return c?u?D2(u,c):c:u||Ml}return n[i]||Ml}}},Kd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=Kd(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const a=t===0?e.join(No):e.slice(t).join(No),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(a))return d.classGroupId}},U2=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?$2+r:void 0})(),V2=e=>{const{theme:t,classGroups:n}=e;return H2(n,t)},H2=(e,t)=>{const n=Jd();for(const r in e){const o=e[r];ua(o,n,r,t)}return n},ua=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];W2(i,t,n,r)}},W2=(e,t,n,r)=>{if(typeof e=="string"){Z2(e,t,n);return}if(typeof e=="function"){q2(e,t,n,r);return}J2(e,t,n,r)},Z2=(e,t,n)=>{const r=e===""?t:Gd(t,e);r.classGroupId=n},q2=(e,t,n,r)=>{if(K2(e)){ua(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(F2(n,e))},J2=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];ua(c,Gd(t,a),n,r)}},Gd=(e,t)=>{let n=e;const r=t.split(No),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=Jd(),n.nextPart.set(i,a)),n=a}return n},K2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,G2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},hi="!",Ll=":",Y2=[],Dl=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),X2=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;const d=o.length;for(let m=0;m<d;m++){const g=o[m];if(i===0&&a===0){if(g===Ll){s.push(o.slice(c,m)),c=m+1;continue}if(g==="/"){u=m;continue}}g==="["?i++:g==="]"?i--:g==="("?a++:g===")"&&a--}const f=s.length===0?o:o.slice(c);let p=f,h=!1;f.endsWith(hi)?(p=f.slice(0,-1),h=!0):f.startsWith(hi)&&(p=f.slice(1),h=!0);const x=u&&u>c?u-c:void 0;return Dl(s,h,p,x)};if(t){const o=t+Ll,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Dl(Y2,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Q2=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},ew=e=>({cache:G2(e.cacheSize),parseClassName:X2(e),sortModifiers:Q2(e),...B2(e)}),tw=/\s+/,nw=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(tw);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:m}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!m,y=r(g?x.substring(0,m):x);if(!y){if(!g){c=d+(c.length>0?" "+c:c);continue}if(y=r(x),!y){c=d+(c.length>0?" "+c:c);continue}g=!1}const v=p.length===0?"":p.length===1?p[0]:s(p).join(":"),k=h?v+hi:v,S=k+y;if(i.indexOf(S)>-1)continue;i.push(S);const C=o(y,g);for(let j=0;j<C.length;++j){const N=C[j];i.push(k+N)}c=d+(c.length>0?" "+c:c)}return c},rw=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Yd(n))&&(o&&(o+=" "),o+=r);return o},Yd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Yd(e[r]))&&(n&&(n+=" "),n+=t);return n},ow=(e,...t)=>{let n,r,o,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=ew(u),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const u=r(c);if(u)return u;const d=nw(c,n);return o(c,d),d};return s=i,(...c)=>s(rw(...c))},sw=[],Qe=e=>{const t=n=>n[e]||sw;return t.isThemeGetter=!0,t},Xd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tn=e=>iw.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Qt=e=>!!e&&Number.isInteger(Number(e)),Ss=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Ht=e=>aw.test(e),fw=()=>!0,hw=e=>lw.test(e)&&!cw.test(e),ef=()=>!1,pw=e=>uw.test(e),mw=e=>dw.test(e),gw=e=>!ge(e)&&!xe(e),xw=e=>er(e,rf,ef),ge=e=>Xd.test(e),mn=e=>er(e,of,hw),Cs=e=>er(e,kw,Te),Fl=e=>er(e,tf,ef),yw=e=>er(e,nf,mw),Yr=e=>er(e,sf,pw),xe=e=>Qd.test(e),cr=e=>tr(e,of),bw=e=>tr(e,_w),$l=e=>tr(e,tf),vw=e=>tr(e,rf),ww=e=>tr(e,nf),Xr=e=>tr(e,sf,!0),er=(e,t,n)=>{const r=Xd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tr=(e,t,n=!1)=>{const r=Qd.exec(e);return r?r[1]?t(r[1]):n:!1},tf=e=>e==="position"||e==="percentage",nf=e=>e==="image"||e==="url",rf=e=>e==="length"||e==="size"||e==="bg-size",of=e=>e==="length",kw=e=>e==="number",_w=e=>e==="family-name",sf=e=>e==="shadow",Sw=()=>{const e=Qe("color"),t=Qe("font"),n=Qe("text"),r=Qe("font-weight"),o=Qe("tracking"),s=Qe("leading"),i=Qe("breakpoint"),a=Qe("container"),c=Qe("spacing"),u=Qe("radius"),d=Qe("shadow"),f=Qe("inset-shadow"),p=Qe("text-shadow"),h=Qe("drop-shadow"),x=Qe("blur"),m=Qe("perspective"),g=Qe("aspect"),y=Qe("ease"),v=Qe("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),xe,ge],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[xe,ge,c],I=()=>[Tn,"full","auto",...T()],O=()=>[Qt,"none","subgrid",xe,ge],F=()=>["auto",{span:["full",Qt,xe,ge]},Qt,xe,ge],E=()=>[Qt,"auto",xe,ge],L=()=>["auto","min","max","fr",xe,ge],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],D=()=>[Tn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],U=()=>[e,xe,ge],G=()=>[...S(),$l,Fl,{position:[xe,ge]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",vw,xw,{size:[xe,ge]}],J=()=>[Ss,cr,mn],R=()=>["","none","full",u,xe,ge],ee=()=>["",Te,cr,mn],Q=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Te,Ss,$l,Fl],ue=()=>["","none",x,xe,ge],fe=()=>["none",Te,xe,ge],he=()=>["none",Te,xe,ge],ye=()=>[Te,xe,ge],je=()=>[Tn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ht],breakpoint:[Ht],color:[fw],container:[Ht],"drop-shadow":[Ht],ease:["in","out","in-out"],font:[gw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ht],shadow:[Ht],spacing:["px",Te],text:[Ht],"text-shadow":[Ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tn,ge,xe,g]}],container:["container"],columns:[{columns:[Te,ge,xe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Qt,"auto",xe,ge]}],basis:[{basis:[Tn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Tn,"auto","initial","none",ge]}],grow:[{grow:["",Te,xe,ge]}],shrink:[{shrink:["",Te,xe,ge]}],order:[{order:[Qt,"first","last","none",xe,ge]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[a,"screen",...D()]}],"min-w":[{"min-w":[a,"screen","none",...D()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,cr,mn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xe,Cs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ss,ge]}],"font-family":[{font:[bw,ge,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,xe,ge]}],"line-clamp":[{"line-clamp":[Te,"none",xe,Cs]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",xe,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",xe,mn]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Te,"auto",xe,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qt,xe,ge],radial:["",xe,ge],conic:[Qt,xe,ge]},ww,yw]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,xe,ge]}],"outline-w":[{outline:["",Te,cr,mn]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",d,Xr,Yr]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,Xr,Yr]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Te,mn]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",p,Xr,Yr]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Te,xe,ge]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[xe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ge]}],filter:[{filter:["","none",xe,ge]}],blur:[{blur:ue()}],brightness:[{brightness:[Te,xe,ge]}],contrast:[{contrast:[Te,xe,ge]}],"drop-shadow":[{"drop-shadow":["","none",h,Xr,Yr]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Te,xe,ge]}],"hue-rotate":[{"hue-rotate":[Te,xe,ge]}],invert:[{invert:["",Te,xe,ge]}],saturate:[{saturate:[Te,xe,ge]}],sepia:[{sepia:["",Te,xe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ge]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Te,xe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Te,xe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,xe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,xe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Te,xe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Te,xe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Te,xe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,xe,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",xe,ge]}],ease:[{ease:["linear","initial",y,xe,ge]}],delay:[{delay:[Te,xe,ge]}],animate:[{animate:["none",v,xe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,xe,ge]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[xe,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,ge]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Te,cr,mn,Cs]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Cw=ow(Sw);function be(...e){return Cw(qd(e))}function Ve(e){return e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":(e/1e3).toFixed(1).replace(/\.0$/,"")+"K"}function af(e){return e>=1024*1024?(e/(1024*1024)).toFixed(1).replace(/\.0$/,"")+"M":(e/1024).toFixed(1).replace(/\.0$/,"")+"K"}function jw(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ew=ie({model:Z().min(1),contextWindow:pe().int().positive().optional(),outputLimit:pe().int().positive().optional(),source:et(["manual","registry"]).optional(),sourceUrl:Z().optional(),updatedAt:Z().optional()}),To=ie({id:Z(),name:Z(),apiKey:Z(),model:Z().optional(),models:Se(Z()).min(1),format:et(["anthropic","openai"]).optional(),baseUrl:Z().optional(),anthropicBaseUrl:Z().optional(),openaiBaseUrl:Z().optional(),authHeader:et(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:Z().optional(),modelMetadataUrl:Z().optional(),modelMetadata:Se(Ew).optional(),source:et(["company","personal"]).optional(),createdAt:Z(),updatedAt:Z()});async function Nw(e){return Lr(e,To.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function lf(){const e=qi("/api/providers?includeSecrets=1",Nw,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}const Tw="2.0.20",Aw={version:Tw},Bl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ul=qd,da=(e,t)=>n=>{var r;if(t?.variants==null)return Ul(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=Bl(d)||Bl(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(x=>{let[m,g]=x;return Array.isArray(g)?g.includes({...s,...a}[m]):{...s,...a}[m]===g})?[...u,f,p]:u},[]);return Ul(e,i,c,n?.class,n?.className)};function Vl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cf(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Vl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Vl(e[o],null)}}}}function Le(...e){return b.useCallback(cf(...e),e)}function Kn(e){const t=zw(e),n=b.forwardRef((r,o)=>{const{children:s,...i}=r,a=b.Children.toArray(s),c=a.find(Pw);if(c){const u=c.props.children,d=a.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Iw=Kn("Slot");function zw(e){const t=b.forwardRef((n,r)=>{const{children:o,...s}=n;if(b.isValidElement(o)){const i=Mw(o),a=Ow(s,o.props);return o.type!==b.Fragment&&(a.ref=r?cf(r,i):i),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uf=Symbol("radix.slottable");function Rw(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=uf,t}function Pw(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uf}function Ow(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Mw(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 Lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Lw.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),r=b.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Dw(e,t){e&&Mr.flushSync(()=>e.dispatchEvent(t))}var df=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"}),Fw="VisuallyHidden",ff=b.forwardRef((e,t)=>l.jsx(Ne.span,{...e,ref:t,style:{...df,...e.style}}));ff.displayName=Fw;var $w=ff;function Bw(e,t){const n=b.createContext(t),r=s=>{const{children:i,...a}=s,c=b.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Xt(e,t=[]){let n=[];function r(s,i){const a=b.createContext(i),c=n.length;n=[...n,i];const u=f=>{const{scope:p,children:h,...x}=f,m=p?.[e]?.[c]||a,g=b.useMemo(()=>x,Object.values(x));return l.jsx(m.Provider,{value:g,children:h})};u.displayName=s+"Provider";function d(f,p){const h=p?.[e]?.[c]||a,x=b.useContext(h);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>b.createContext(i));return function(a){const c=a?.[e]||s;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Uw(o,...t)]}function Uw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function hf(e){const t=e+"CollectionProvider",[n,r]=Xt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:y}=m,v=at.useRef(null),k=at.useRef(new Map).current;return l.jsx(o,{scope:g,itemMap:k,collectionRef:v,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=Kn(a),u=at.forwardRef((m,g)=>{const{scope:y,children:v}=m,k=s(a,y),S=Le(g,k.collectionRef);return l.jsx(c,{ref:S,children:v})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Kn(d),h=at.forwardRef((m,g)=>{const{scope:y,children:v,...k}=m,S=at.useRef(null),C=Le(g,S),j=s(d,y);return at.useEffect(()=>(j.itemMap.set(S,{ref:S,...k}),()=>{j.itemMap.delete(S)})),l.jsx(p,{[f]:"",ref:C,children:v})});h.displayName=d;function x(m){const g=s(e+"CollectionConsumer",m);return at.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((j,N)=>k.indexOf(j.ref.current)-k.indexOf(N.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},x,r]}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var tt=globalThis?.document?b.useLayoutEffect:()=>{},Vw=Hu[" useInsertionEffect ".trim().toString()]||tt;function bn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Hw({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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.`),d.current=a},[a,r])}const u=b.useCallback(d=>{if(a){const f=Ww(d)?d(e):d;f!==e&&i.current?.(f)}else s(d)},[a,e,s,i]);return[c,u]}function Hw({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),o=b.useRef(n),s=b.useRef(t);return Vw(()=>{s.current=t},[t]),b.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Ww(e){return typeof e=="function"}function Zw(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var bt=e=>{const{present:t,children:n}=e,r=qw(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=Le(r.ref,Jw(o));return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:s}):null};bt.displayName="Presence";function qw(e){const[t,n]=b.useState(),r=b.useRef(null),o=b.useRef(e),s=b.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Zw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Qr(r.current);s.current=a==="mounted"?u:"none"},[a]),tt(()=>{const u=r.current,d=o.current;if(d!==e){const p=s.current,h=Qr(u);e?c("MOUNT"):h==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),tt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const m=Qr(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=h=>{h.target===t&&(s.current=Qr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Qr(e){return e?.animationName||"none"}function Jw(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 Kw=Hu[" useId ".trim().toString()]||(()=>{}),Gw=0;function Ot(e){const[t,n]=b.useState(Kw());return tt(()=>{n(r=>r??String(Gw++))},[e]),e||(t?`radix-${t}`:"")}var Go="Collapsible",[Yw]=Xt(Go),[Xw,fa]=Yw(Go),pf=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=bn({prop:r,defaultProp:o??!1,onChange:i,caller:Go});return l.jsx(Xw,{scope:n,disabled:s,contentId:Ot(),open:c,onOpenToggle:b.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Ne.div,{"data-state":pa(c),"data-disabled":s?"":void 0,...a,ref:t})})});pf.displayName=Go;var mf="CollapsibleTrigger",gf=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fa(mf,n);return l.jsx(Ne.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":pa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ke(e.onClick,o.onOpenToggle)})});gf.displayName=mf;var ha="CollapsibleContent",xf=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fa(ha,e.__scopeCollapsible);return l.jsx(bt,{present:n||o.open,children:({present:s})=>l.jsx(Qw,{...r,ref:t,present:s})})});xf.displayName=ha;var Qw=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=fa(ha,n),[a,c]=b.useState(r),u=b.useRef(null),d=Le(t,u),f=b.useRef(0),p=f.current,h=b.useRef(0),x=h.current,m=i.open||a,g=b.useRef(m),y=b.useRef(void 0);return b.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),tt(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();f.current=k.height,h.current=k.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(r)}},[i.open,r]),l.jsx(Ne.div,{"data-state":pa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function pa(e){return e?"open":"closed"}var ek=pf,tk=b.createContext(void 0);function Yo(e){const t=b.useContext(tk);return e||t||"ltr"}function st(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function nk(e,t=globalThis?.document){const n=st(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rk="DismissableLayer",pi="dismissableLayer.update",ok="dismissableLayer.pointerDownOutside",sk="dismissableLayer.focusOutside",Hl,yf=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xo=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=b.useContext(yf),[d,f]=b.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=b.useState({}),x=Le(t,N=>f(N)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),v=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=y,C=lk(N=>{const T=N.target,I=[...u.branches].some(O=>O.contains(T));!S||I||(o?.(N),i?.(N),N.defaultPrevented||a?.())},p),j=ck(N=>{const T=N.target;[...u.branches].some(O=>O.contains(T))||(s?.(N),i?.(N),N.defaultPrevented||a?.())},p);return nk(N=>{v===u.layers.size-1&&(r?.(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Hl)}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wl())},[d,u]),b.useEffect(()=>{const N=()=>h({});return document.addEventListener(pi,N),()=>document.removeEventListener(pi,N)},[]),l.jsx(Ne.div,{...c,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,C.onPointerDownCapture)})});Xo.displayName=rk;var ik="DismissableLayerBranch",ak=b.forwardRef((e,t)=>{const n=b.useContext(yf),r=b.useRef(null),o=Le(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Ne.div,{...e,ref:o})});ak.displayName=ik;function lk(e,t=globalThis?.document){const n=st(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){bf(ok,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ck(e,t=globalThis?.document){const n=st(e),r=b.useRef(!1);return b.useEffect(()=>{const o=s=>{s.target&&!r.current&&bf(sk,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wl(){const e=new CustomEvent(pi);document.dispatchEvent(e)}function bf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Dw(o,s):o.dispatchEvent(s)}var js="focusScope.autoFocusOnMount",Es="focusScope.autoFocusOnUnmount",Zl={bubbles:!1,cancelable:!0},uk="FocusScope",ma=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=b.useState(null),u=st(o),d=st(s),f=b.useRef(null),p=Le(t,m=>c(m)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(k){if(h.paused||!a)return;const S=k.target;a.contains(S)?f.current=S:tn(f.current,{select:!0})},g=function(k){if(h.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||tn(f.current,{select:!0}))},y=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&tn(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,h.paused]),b.useEffect(()=>{if(a){Jl.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(js,Zl);a.addEventListener(js,u),a.dispatchEvent(y),y.defaultPrevented||(dk(gk(vf(a)),{select:!0}),document.activeElement===m&&tn(a))}return()=>{a.removeEventListener(js,u),setTimeout(()=>{const y=new CustomEvent(Es,Zl);a.addEventListener(Es,d),a.dispatchEvent(y),y.defaultPrevented||tn(m??document.body,{select:!0}),a.removeEventListener(Es,d),Jl.remove(h)},0)}}},[a,u,d,h]);const x=b.useCallback(m=>{if(!n&&!r||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const v=m.currentTarget,[k,S]=fk(v);k&&S?!m.shiftKey&&y===S?(m.preventDefault(),n&&tn(k,{select:!0})):m.shiftKey&&y===k&&(m.preventDefault(),n&&tn(S,{select:!0})):y===v&&m.preventDefault()}},[n,r,h.paused]);return l.jsx(Ne.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});ma.displayName=uk;function dk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tn(r,{select:t}),document.activeElement!==n)return}function fk(e){const t=vf(e),n=ql(t,e),r=ql(t.reverse(),e);return[n,r]}function vf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ql(e,t){for(const n of e)if(!hk(n,{upTo:t}))return n}function hk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pk(e){return e instanceof HTMLInputElement&&"select"in e}function tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pk(e)&&t&&e.select()}}var Jl=mk();function mk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kl(e,t),e.unshift(t)},remove(t){e=Kl(e,t),e[0]?.resume()}}}function Kl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gk(e){return e.filter(t=>t.tagName!=="A")}var xk="Portal",Qo=b.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=b.useState(!1);tt(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?ng.createPortal(l.jsx(Ne.div,{...r,ref:t}),i):null});Qo.displayName=xk;var Ns=0;function wf(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gl()),document.body.insertAdjacentElement("beforeend",e[1]??Gl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function Gl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zt=function(){return zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},zt.apply(this,arguments)};function kf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var xo="right-scroll-bar-position",yo="width-before-scroll-bar",bk="with-scroll-bars-hidden",vk="--removed-body-scroll-bar-size";function Ts(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wk(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var kk=typeof window<"u"?b.useLayoutEffect:b.useEffect,Yl=new WeakMap;function _k(e,t){var n=wk(null,function(r){return e.forEach(function(o){return Ts(o,r)})});return kk(function(){var r=Yl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ts(a,null)}),s.forEach(function(a){o.has(a)||Ts(a,i)})}Yl.set(n,e)},[e]),n}function Sk(e){return e}function Ck(e,t){t===void 0&&(t=Sk);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function jk(e){e===void 0&&(e={});var t=Ck(null);return t.options=zt({async:!0,ssr:!1},e),t}var _f=function(e){var t=e.sideCar,n=kf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,zt({},n))};_f.isSideCarExport=!0;function Ek(e,t){return e.useMedium(t),_f}var Sf=jk(),As=function(){},es=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:As,onWheelCapture:As,onTouchMoveCapture:As}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,x=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,k=e.gapMode,S=kf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,j=_k([n,t]),N=zt(zt({},S),o);return b.createElement(b.Fragment,null,d&&b.createElement(C,{sideCar:Sf,removeScrollBar:u,shards:f,noRelative:h,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:k}),i?b.cloneElement(b.Children.only(a),zt(zt({},N),{ref:j})):b.createElement(v,zt({},N,{className:c,ref:j}),a))});es.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};es.classNames={fullWidth:yo,zeroRight:xo};var Nk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function Ak(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ik(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tk())&&(Ak(t,n),Ik(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Rk=function(){var e=zk();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cf=function(){var e=Rk(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pk={left:0,top:0,right:0,gap:0},Is=function(e){return parseInt(e||"",10)||0},Ok=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Is(n),Is(r),Is(o)]},Mk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pk;var t=Ok(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lk=Cf(),Bn="data-scroll-locked",Dk=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
42
42
|
.`.concat(bk,` {
|
|
43
43
|
overflow: hidden `).concat(r,`;
|
|
44
44
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -82,7 +82,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
82
82
|
|
|
83
83
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
84
84
|
|
|
85
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},d_="DialogDescriptionWarning",f_=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wf(d_).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},h_=zf,p_=Pf,m_=Mf,g_=Lf,x_=Df,y_=$f,b_=Vf;function v_(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function w_(e){const[t,n]=b.useState(void 0);return tt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const k_=["top","right","bottom","left"],sn=Math.min,pt=Math.max,Io=Math.round,oo=Math.floor,Mt=e=>({x:e,y:e}),__={left:"right",right:"left",bottom:"top",top:"bottom"},S_={start:"end",end:"start"};function gi(e,t,n){return pt(e,sn(t,n))}function qt(e,t){return typeof e=="function"?e(t):e}function Jt(e){return e.split("-")[0]}function nr(e){return e.split("-")[1]}function va(e){return e==="x"?"y":"x"}function wa(e){return e==="y"?"height":"width"}const C_=new Set(["top","bottom"]);function Pt(e){return C_.has(Jt(e))?"y":"x"}function ka(e){return va(Pt(e))}function j_(e,t,n){n===void 0&&(n=!1);const r=nr(e),o=ka(e),s=wa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zo(i)),[i,zo(i)]}function E_(e){const t=zo(e);return[xi(e),t,xi(t)]}function xi(e){return e.replace(/start|end/g,t=>S_[t])}const nc=["left","right"],rc=["right","left"],N_=["top","bottom"],T_=["bottom","top"];function A_(e,t,n){switch(e){case"top":case"bottom":return n?t?rc:nc:t?nc:rc;case"left":case"right":return t?N_:T_;default:return[]}}function I_(e,t,n,r){const o=nr(e);let s=A_(Jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(xi)))),s}function zo(e){return e.replace(/left|right|bottom|top/g,t=>__[t])}function z_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zf(e){return typeof e!="number"?z_(e):{top:e,right:e,bottom:e,left:e}}function Ro(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function oc(e,t,n){let{reference:r,floating:o}=e;const s=Pt(t),i=ka(t),a=wa(i),c=Jt(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(nr(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}async function R_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=qt(t,e),x=Zf(h),g=a[p?f==="floating"?"reference":"floating":f],y=Ro(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),v=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},C=Ro(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:c}):v);return{top:(y.top-C.top+x.top)/S.y,bottom:(C.bottom-y.bottom+x.bottom)/S.y,left:(y.left-C.left+x.left)/S.x,right:(C.right-y.right+x.right)/S.x}}const P_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=oc(u,r,c),p=r,h={},x=0;for(let g=0;g<a.length;g++){var m;const{name:y,fn:v}=a[g],{x:k,y:S,data:C,reset:j}=await v({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:R_},elements:{reference:e,floating:t}});d=k??d,f=S??f,h={...h,[y]:{...h[y],...C}},j&&x<=50&&(x++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(u=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=oc(u,p,c)),g=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}},O_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=qt(e,t)||{};if(u==null)return{};const f=Zf(d),p={x:n,y:r},h=ka(o),x=wa(h),m=await i.getDimensions(u),g=h==="y",y=g?"top":"left",v=g?"bottom":"right",k=g?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[h]-p[h]-s.floating[x],C=p[h]-s.reference[h],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let N=j?j[k]:0;(!N||!await(i.isElement==null?void 0:i.isElement(j)))&&(N=a.floating[k]||s.floating[x]);const T=S/2-C/2,I=N/2-m[x]/2-1,O=sn(f[y],I),F=sn(f[v],I),E=O,L=N-m[x]-F,w=N/2-m[x]/2+T,M=gi(E,w,L),B=!c.arrow&&nr(o)!=null&&w!==M&&s.reference[x]/2-(w<E?O:F)-m[x]/2<0,D=B?w<E?w-E:w-L:0;return{[h]:p[h]+D,data:{[h]:M,centerOffset:w-M-D,...B&&{alignmentOffset:D}},reset:B}}}),M_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...g}=qt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Jt(o),v=Pt(a),k=Jt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=p||(k||!m?[zo(a)]:E_(a)),j=x!=="none";!p&&j&&C.push(...I_(a,m,x,S));const N=[a,...C],T=await c.detectOverflow(t,g),I=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&I.push(T[y]),f){const w=j_(o,i,S);I.push(T[w[0]],T[w[1]])}if(O=[...O,{placement:o,overflows:I}],!I.every(w=>w<=0)){var F,E;const w=(((F=s.flip)==null?void 0:F.index)||0)+1,M=N[w];if(M&&(!(f==="alignment"?v!==Pt(M):!1)||O.every(U=>Pt(U.placement)===v?U.overflows[0]>0:!0)))return{data:{index:w,overflows:O},reset:{placement:M}};let B=(E=O.filter(D=>D.overflows[0]<=0).sort((D,U)=>D.overflows[1]-U.overflows[1])[0])==null?void 0:E.placement;if(!B)switch(h){case"bestFit":{var L;const D=(L=O.filter(U=>{if(j){const G=Pt(U.placement);return G===v||G==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((U,G)=>U[1]-G[1])[0])==null?void 0:L[0];D&&(B=D);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function sc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ic(e){return k_.some(t=>e[t]>=0)}const L_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=qt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=sc(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ic(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=sc(i,n.floating);return{data:{escapedOffsets:a,escaped:ic(a)}}}default:return{}}}}},qf=new Set(["left","top"]);async function D_(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Jt(n),a=nr(n),c=Pt(n)==="y",u=qf.has(i)?-1:1,d=s&&c?-1:1,f=qt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(h=a==="end"?x*-1:x),c?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const F_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await D_(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},$_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:v,y:k}=y;return{x:v,y:k}}},...u}=qt(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),p=Pt(Jt(o)),h=va(p);let x=d[h],m=d[p];if(i){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",k=x+f[y],S=x-f[v];x=gi(k,x,S)}if(a){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=m+f[y],S=m-f[v];m=gi(k,m,S)}const g=c.fn({...t,[h]:x,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[p]:a}}}}}},B_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=qt(e,t),d={x:n,y:r},f=Pt(o),p=va(f);let h=d[p],x=d[f];const m=qt(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const k=p==="y"?"height":"width",S=s.reference[p]-s.floating[k]+g.mainAxis,C=s.reference[p]+s.reference[k]-g.mainAxis;h<S?h=S:h>C&&(h=C)}if(u){var y,v;const k=p==="y"?"width":"height",S=qf.has(Jt(o)),C=s.reference[f]-s.floating[k]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:g.crossAxis),j=s.reference[f]+s.reference[k]+(S?0:((v=i.offset)==null?void 0:v[f])||0)-(S?g.crossAxis:0);x<C?x=C:x>j&&(x=j)}return{[p]:h,[f]:x}}}},U_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=qt(e,t),d=await i.detectOverflow(t,u),f=Jt(o),p=nr(o),h=Pt(o)==="y",{width:x,height:m}=s.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,g=p==="end"?"top":"bottom");const v=m-d.top-d.bottom,k=x-d.left-d.right,S=sn(m-d[g],v),C=sn(x-d[y],k),j=!t.middlewareData.shift;let N=S,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=v),j&&!p){const O=pt(d.left,0),F=pt(d.right,0),E=pt(d.top,0),L=pt(d.bottom,0);h?T=x-2*(O!==0||F!==0?O+F:pt(d.left,d.right)):N=m-2*(E!==0||L!==0?E+L:pt(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:N});const I=await i.getDimensions(a.floating);return x!==I.width||m!==I.height?{reset:{rects:!0}}:{}}}};function ns(){return typeof window<"u"}function rr(e){return Jf(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $t(e){var t;return(t=(Jf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jf(e){return ns()?e instanceof Node||e instanceof gt(e).Node:!1}function Et(e){return ns()?e instanceof Element||e instanceof gt(e).Element:!1}function Lt(e){return ns()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function ac(e){return!ns()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}const V_=new Set(["inline","contents"]);function Fr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!V_.has(o)}const H_=new Set(["table","td","th"]);function W_(e){return H_.has(rr(e))}const Z_=[":popover-open",":modal"];function rs(e){return Z_.some(t=>{try{return e.matches(t)}catch{return!1}})}const q_=["transform","translate","scale","rotate","perspective"],J_=["transform","translate","scale","rotate","perspective","filter"],K_=["paint","layout","strict","content"];function _a(e){const t=Sa(),n=Et(e)?Nt(e):e;return q_.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||J_.some(r=>(n.willChange||"").includes(r))||K_.some(r=>(n.contain||"").includes(r))}function G_(e){let t=an(e);for(;Lt(t)&&!Gn(t);){if(_a(t))return t;if(rs(t))return null;t=an(t)}return null}function Sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Y_=new Set(["html","body","#document"]);function Gn(e){return Y_.has(rr(e))}function Nt(e){return gt(e).getComputedStyle(e)}function os(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ac(e)&&e.host||$t(e);return ac(t)?t.host:t}function Kf(e){const t=an(e);return Gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Fr(t)?t:Kf(t)}function Ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Kf(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=gt(o);if(s){const a=yi(i);return t.concat(i,i.visualViewport||[],Fr(o)?o:[],a&&n?Ar(a):[])}return t.concat(o,Ar(o,[],n))}function yi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gf(e){const t=Nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Io(n)!==s||Io(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ca(e){return Et(e)?e:e.contextElement}function Un(e){const t=Ca(e);if(!Lt(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Gf(t);let i=(s?Io(n.width):n.width)/r,a=(s?Io(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const X_=Mt(0);function Yf(e){const t=gt(e);return!Sa()||!t.visualViewport?X_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Q_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ca(e);let i=Mt(1);t&&(r?Et(r)&&(i=Un(r)):i=Un(e));const a=Q_(s,n,r)?Yf(s):Mt(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=gt(s),h=r&&Et(r)?gt(r):r;let x=p,m=yi(x);for(;m&&r&&h!==x;){const g=Un(m),y=m.getBoundingClientRect(),v=Nt(m),k=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,S=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,f*=g.y,c+=k,u+=S,x=gt(m),m=yi(x)}}return Ro({width:d,height:f,x:c,y:u})}function ss(e,t){const n=os(e).scrollLeft;return t?t.left+n:wn($t(e)).left+n}function Xf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ss(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function eS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=$t(r),a=t?rs(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mt(1);const d=Mt(0),f=Lt(r);if((f||!f&&!s)&&((rr(r)!=="body"||Fr(i))&&(c=os(r)),Lt(r))){const h=wn(r);u=Un(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?Xf(i,c):Mt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function tS(e){return Array.from(e.getClientRects())}function nS(e){const t=$t(e),n=os(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ss(e);const a=-n.scrollTop;return Nt(r).direction==="rtl"&&(i+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const lc=25;function rS(e,t){const n=gt(e),r=$t(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Sa();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ss(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-h);x<=lc&&(s-=x)}else u<=lc&&(s+=u);return{width:s,height:i,x:a,y:c}}const oS=new Set(["absolute","fixed"]);function sS(e,t){const n=wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Lt(e)?Un(e):Mt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function cc(e,t,n){let r;if(t==="viewport")r=rS(e,n);else if(t==="document")r=nS($t(e));else if(Et(t))r=sS(t,n);else{const o=Yf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ro(r)}function Qf(e,t){const n=an(e);return n===t||!Et(n)||Gn(n)?!1:Nt(n).position==="fixed"||Qf(n,t)}function iS(e,t){const n=t.get(e);if(n)return n;let r=Ar(e,[],!1).filter(a=>Et(a)&&rr(a)!=="body"),o=null;const s=Nt(e).position==="fixed";let i=s?an(e):e;for(;Et(i)&&!Gn(i);){const a=Nt(i),c=_a(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&oS.has(o.position)||Fr(i)&&!c&&Qf(e,i))?r=r.filter(d=>d!==i):o=a,i=an(i)}return t.set(e,r),r}function aS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?rs(t)?[]:iS(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,d)=>{const f=cc(t,d,o);return u.top=pt(f.top,u.top),u.right=sn(f.right,u.right),u.bottom=sn(f.bottom,u.bottom),u.left=pt(f.left,u.left),u},cc(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lS(e){const{width:t,height:n}=Gf(e);return{width:t,height:n}}function cS(e,t,n){const r=Lt(t),o=$t(t),s=n==="fixed",i=wn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Mt(0);function u(){c.x=ss(o)}if(r||!r&&!s)if((rr(t)!=="body"||Fr(o))&&(a=os(t)),r){const h=wn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Xf(o,a):Mt(0),f=i.left+a.scrollLeft-c.x-d.x,p=i.top+a.scrollTop-c.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Rs(e){return Nt(e).position==="static"}function uc(e,t){if(!Lt(e)||Nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $t(e)===n&&(n=n.ownerDocument.body),n}function eh(e,t){const n=gt(e);if(rs(e))return n;if(!Lt(e)){let o=an(e);for(;o&&!Gn(o);){if(Et(o)&&!Rs(o))return o;o=an(o)}return n}let r=uc(e,t);for(;r&&W_(r)&&Rs(r);)r=uc(r,t);return r&&Gn(r)&&Rs(r)&&!_a(r)?n:r||G_(e)||n}const uS=async function(e){const t=this.getOffsetParent||eh,n=this.getDimensions,r=await n(e.floating);return{reference:cS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dS(e){return Nt(e).direction==="rtl"}const fS={convertOffsetParentRelativeRectToViewportRelativeRect:eS,getDocumentElement:$t,getClippingRect:aS,getOffsetParent:eh,getElementRects:uS,getClientRects:tS,getDimensions:lS,getScale:Un,isElement:Et,isRTL:dS};function th(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hS(e,t){let n=null,r;const o=$t(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(a||t(),!p||!h)return;const x=oo(f),m=oo(o.clientWidth-(d+p)),g=oo(o.clientHeight-(f+h)),y=oo(d),k={rootMargin:-x+"px "+-m+"px "+-g+"px "+-y+"px",threshold:pt(0,sn(1,c))||1};let S=!0;function C(j){const N=j[0].intersectionRatio;if(N!==c){if(!S)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!th(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,k)}n.observe(e)}return i(!0),s}function pS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Ca(e),d=o||s?[...u?Ar(u):[],...Ar(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&a?hS(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=h)==null||k.observe(t)})),n()}),u&&!c&&h.observe(u),h.observe(t));let x,m=c?wn(e):null;c&&g();function g(){const y=wn(e);m&&!th(m,y)&&n(),m=y,x=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(x)}}const mS=F_,gS=$_,xS=M_,yS=U_,bS=L_,dc=O_,vS=B_,wS=(e,t,n)=>{const r=new Map,o={platform:fS,...n},s={...o.platform,_c:r};return P_(e,t,{...o,platform:s})};var kS=typeof document<"u",_S=function(){},bo=kS?b.useLayoutEffect:_S;function Po(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,o;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(!Po(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Po(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function nh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fc(e,t){const n=nh(e);return Math.round(t*n)/n}function Ps(e){const t=b.useRef(e);return bo(()=>{t.current=e}),t}function SS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=b.useState(r);Po(p,r)||h(r);const[x,m]=b.useState(null),[g,y]=b.useState(null),v=b.useCallback(U=>{U!==j.current&&(j.current=U,m(U))},[]),k=b.useCallback(U=>{U!==N.current&&(N.current=U,y(U))},[]),S=s||x,C=i||g,j=b.useRef(null),N=b.useRef(null),T=b.useRef(d),I=c!=null,O=Ps(c),F=Ps(o),E=Ps(u),L=b.useCallback(()=>{if(!j.current||!N.current)return;const U={placement:t,strategy:n,middleware:p};F.current&&(U.platform=F.current),wS(j.current,N.current,U).then(G=>{const A={...G,isPositioned:E.current!==!1};w.current&&!Po(T.current,A)&&(T.current=A,Mr.flushSync(()=>{f(A)}))})},[p,t,n,F,E]);bo(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[u]);const w=b.useRef(!1);bo(()=>(w.current=!0,()=>{w.current=!1}),[]),bo(()=>{if(S&&(j.current=S),C&&(N.current=C),S&&C){if(O.current)return O.current(S,C,L);L()}},[S,C,L,O,I]);const M=b.useMemo(()=>({reference:j,floating:N,setReference:v,setFloating:k}),[v,k]),B=b.useMemo(()=>({reference:S,floating:C}),[S,C]),D=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!B.floating)return U;const G=fc(B.floating,d.x),A=fc(B.floating,d.y);return a?{...U,transform:"translate("+G+"px, "+A+"px)",...nh(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:A}},[n,a,B.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:L,refs:M,elements:B,floatingStyles:D}),[d,L,M,B,D])}const CS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dc({element:r.current,padding:o}).fn(n):{}:r?dc({element:r,padding:o}).fn(n):{}}}},jS=(e,t)=>({...mS(e),options:[e,t]}),ES=(e,t)=>({...gS(e),options:[e,t]}),NS=(e,t)=>({...vS(e),options:[e,t]}),TS=(e,t)=>({...xS(e),options:[e,t]}),AS=(e,t)=>({...yS(e),options:[e,t]}),IS=(e,t)=>({...bS(e),options:[e,t]}),zS=(e,t)=>({...CS(e),options:[e,t]});var RS="Arrow",rh=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Ne.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});rh.displayName=RS;var PS=rh,ja="Popper",[oh,is]=Xt(ja),[OS,sh]=oh(ja),ih=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return l.jsx(OS,{scope:t,anchor:r,onAnchorChange:o,children:n})};ih.displayName=ja;var ah="PopperAnchor",lh=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=sh(ah,n),i=b.useRef(null),a=Le(t,i),c=b.useRef(null);return b.useEffect(()=>{const u=c.current;c.current=r?.current||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Ne.div,{...o,ref:a})});lh.displayName=ah;var Ea="PopperContent",[MS,LS]=oh(Ea),ch=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:x,...m}=e,g=sh(Ea,n),[y,v]=b.useState(null),k=Le(t,ae=>v(ae)),[S,C]=b.useState(null),j=w_(S),N=j?.width??0,T=j?.height??0,I=r+(s!=="center"?"-"+s:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(u)?u:[u],E=F.length>0,L={padding:O,boundary:F.filter(FS),altBoundary:E},{refs:w,floatingStyles:M,placement:B,isPositioned:D,middlewareData:U}=SS({strategy:"fixed",placement:I,whileElementsMounted:(...ae)=>pS(...ae,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[jS({mainAxis:o+T,alignmentAxis:i}),c&&ES({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?NS():void 0,...L}),c&&TS({...L}),AS({...L,apply:({elements:ae,rects:ue,availableWidth:fe,availableHeight:he})=>{const{width:ye,height:je}=ue.reference,ze=ae.floating.style;ze.setProperty("--radix-popper-available-width",`${fe}px`),ze.setProperty("--radix-popper-available-height",`${he}px`),ze.setProperty("--radix-popper-anchor-width",`${ye}px`),ze.setProperty("--radix-popper-anchor-height",`${je}px`)}}),S&&zS({element:S,padding:a}),$S({arrowWidth:N,arrowHeight:T}),p&&IS({strategy:"referenceHidden",...L})]}),[G,A]=fh(B),H=st(x);tt(()=>{D&&H?.()},[D,H]);const J=U.arrow?.x,R=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,de]=b.useState();return tt(()=>{y&&de(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(MS,{scope:n,placedSide:G,onArrowChange:C,arrowX:J,arrowY:R,shouldHideArrow:ee,children:l.jsx(Ne.div,{"data-side":G,"data-align":A,...m,ref:k,style:{...m.style,animation:D?void 0:"none"}})})})});ch.displayName=Ea;var uh="PopperArrow",DS={top:"bottom",right:"left",bottom:"top",left:"right"},dh=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=LS(uh,r),i=DS[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(PS,{...o,ref:n,style:{...o.style,display:"block"}})})});dh.displayName=uh;function FS(e){return e!==null}var $S=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=fh(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let x="",m="";return u==="bottom"?(x=i?f:`${p}px`,m=`${-c}px`):u==="top"?(x=i?f:`${p}px`,m=`${r.floating.height+c}px`):u==="right"?(x=`${-c}px`,m=i?f:`${h}px`):u==="left"&&(x=`${r.floating.width+c}px`,m=i?f:`${h}px`),{data:{x,y:m}}}});function fh(e){const[t,n="center"]=e.split("-");return[t,n]}var hh=ih,ph=lh,mh=ch,gh=dh,Os="rovingFocusGroup.onEntryFocus",BS={bubbles:!1,cancelable:!0},$r="RovingFocusGroup",[bi,xh,US]=hf($r),[VS,yh]=Xt($r,[US]),[HS,WS]=VS($r),bh=b.forwardRef((e,t)=>l.jsx(bi.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(bi.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ZS,{...e,ref:t})})}));bh.displayName=$r;var ZS=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=b.useRef(null),h=Le(t,p),x=Yo(s),[m,g]=bn({prop:i,defaultProp:a??null,onChange:c,caller:$r}),[y,v]=b.useState(!1),k=st(u),S=xh(n),C=b.useRef(!1),[j,N]=b.useState(0);return b.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Os,k),()=>T.removeEventListener(Os,k)},[k]),l.jsx(HS,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:b.useCallback(T=>g(T),[g]),onItemShiftTab:b.useCallback(()=>v(!0),[]),onFocusableItemAdd:b.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:b.useCallback(()=>N(T=>T-1),[]),children:l.jsx(Ne.div,{tabIndex:y||j===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{C.current=!0}),onFocus:ke(e.onFocus,T=>{const I=!C.current;if(T.target===T.currentTarget&&I&&!y){const O=new CustomEvent(Os,BS);if(T.currentTarget.dispatchEvent(O),!O.defaultPrevented){const F=S().filter(B=>B.focusable),E=F.find(B=>B.active),L=F.find(B=>B.id===m),M=[E,L,...F].filter(Boolean).map(B=>B.ref.current);kh(M,d)}}C.current=!1}),onBlur:ke(e.onBlur,()=>v(!1))})})}),vh="RovingFocusGroupItem",wh=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Ot(),u=s||c,d=WS(vh,n),f=d.currentTabStopId===u,p=xh(n),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return h(),()=>x()},[r,h,x]),l.jsx(bi.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Ne.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ke(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ke(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=KS(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")k.reverse();else if(y==="prev"||y==="next"){y==="prev"&&k.reverse();const S=k.indexOf(g.currentTarget);k=d.loop?GS(k,S+1):k.slice(S+1)}setTimeout(()=>kh(k))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});wh.displayName=vh;var qS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function JS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function KS(e,t,n){const r=JS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qS[r]}function kh(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function GS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YS=bh,XS=wh;function vi(e,[t,n]){return Math.min(n,Math.max(t,e))}function QS(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Na="ScrollArea",[_h]=Xt(Na),[eC,vt]=_h(Na),Sh=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(null),[h,x]=b.useState(null),[m,g]=b.useState(null),[y,v]=b.useState(0),[k,S]=b.useState(0),[C,j]=b.useState(!1),[N,T]=b.useState(!1),I=Le(t,F=>c(F)),O=Yo(o);return l.jsx(eC,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:N,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:S,children:l.jsx(Ne.div,{dir:O,...i,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Sh.displayName=Na;var Ch="ScrollAreaViewport",jh=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=vt(Ch,n),a=b.useRef(null),c=Le(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});jh.displayName=Ch;var Bt="ScrollAreaScrollbar",Eh=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return b.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?l.jsx(tC,{...r,ref:t,forceMount:n}):o.type==="scroll"?l.jsx(nC,{...r,ref:t,forceMount:n}):o.type==="auto"?l.jsx(Nh,{...r,ref:t,forceMount:n}):o.type==="always"?l.jsx(Ta,{...r,ref:t}):null});Eh.displayName=Bt;var tC=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),[s,i]=b.useState(!1);return b.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),l.jsx(bt,{present:n||s,children:l.jsx(Nh,{"data-state":s?"visible":"hidden",...r,ref:t})})}),nC=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),s=e.orientation==="horizontal",i=ls(()=>c("SCROLL_END"),100),[a,c]=QS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,c]),b.useEffect(()=>{const u=o.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(c("SCROLL"),i()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,s,c,i]),l.jsx(bt,{present:n||a!=="hidden",children:l.jsx(Ta,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Nh=b.forwardRef((e,t)=>{const n=vt(Bt,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=b.useState(!1),a=e.orientation==="horizontal",c=ls(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?u:d)}},10);return Yn(n.viewport,c),Yn(n.content,c),l.jsx(bt,{present:r||s,children:l.jsx(Ta,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ta=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=vt(Bt,e.__scopeScrollArea),s=b.useRef(null),i=b.useRef(0),[a,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Rh(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,h){return lC(p,i.current,a,h)}return n==="horizontal"?l.jsx(rC,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,h=hc(p,a,o.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?l.jsx(oC,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,h=hc(p,a);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),rC=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vt(Bt,e.__scopeScrollArea),[i,a]=b.useState(),c=b.useRef(null),u=Le(t,c,s.onScrollbarXChange);return b.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(Ah,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":as(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Oh(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Mo(i.paddingLeft),paddingEnd:Mo(i.paddingRight)}})}})}),oC=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vt(Bt,e.__scopeScrollArea),[i,a]=b.useState(),c=b.useRef(null),u=Le(t,c,s.onScrollbarYChange);return b.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(Ah,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":as(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Oh(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Mo(i.paddingTop),paddingEnd:Mo(i.paddingBottom)}})}})}),[sC,Th]=_h(Bt),Ah=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=vt(Bt,n),[x,m]=b.useState(null),g=Le(t,I=>m(I)),y=b.useRef(null),v=b.useRef(""),k=h.viewport,S=r.content-r.viewport,C=st(d),j=st(c),N=ls(f,10);function T(I){if(y.current){const O=I.clientX-y.current.left,F=I.clientY-y.current.top;u({x:O,y:F})}}return b.useEffect(()=>{const I=O=>{const F=O.target;x?.contains(F)&&C(O,S)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[k,x,S,C]),b.useEffect(j,[r,j]),Yn(x,N),Yn(h.content,N),l.jsx(sC,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:st(s),onThumbPointerUp:st(i),onThumbPositionChange:j,onThumbPointerDown:st(a),children:l.jsx(Ne.div,{...p,ref:g,style:{position:"absolute",...p.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),y.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(I))}),onPointerMove:ke(e.onPointerMove,T),onPointerUp:ke(e.onPointerUp,I=>{const O=I.target;O.hasPointerCapture(I.pointerId)&&O.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),Oo="ScrollAreaThumb",Ih=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Th(Oo,e.__scopeScrollArea);return l.jsx(bt,{present:n||o.hasThumb,children:l.jsx(iC,{ref:t,...r})})}),iC=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=vt(Oo,n),i=Th(Oo,n),{onThumbPositionChange:a}=i,c=Le(t,f=>i.onThumbChange(f)),u=b.useRef(void 0),d=ls(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(d(),!u.current){const h=cC(f,a);u.current=h,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,d,a]),l.jsx(Ne.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),x=f.clientX-h.left,m=f.clientY-h.top;i.onThumbPointerDown({x,y:m})}),onPointerUp:ke(e.onPointerUp,i.onThumbPointerUp)})});Ih.displayName=Oo;var Aa="ScrollAreaCorner",zh=b.forwardRef((e,t)=>{const n=vt(Aa,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(aC,{...e,ref:t}):null});zh.displayName=Aa;var aC=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=vt(Aa,n),[s,i]=b.useState(0),[a,c]=b.useState(0),u=!!(s&&a);return Yn(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),c(d)}),Yn(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),i(d)}),u?l.jsx(Ne.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mo(e){return e?parseInt(e,10):0}function Rh(e,t){const n=e/t;return isNaN(n)?0:n}function as(e){const t=Rh(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function lC(e,t,n,r="ltr"){const o=as(n),s=o/2,i=t||s,a=o-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Ph([c,u],f)(e)}function hc(e,t,n="ltr"){const r=as(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,c=n==="ltr"?[0,i]:[i*-1,0],u=vi(e,c);return Ph([0,i],[0,a])(u)}function Ph(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Oh(e,t){return e>0&&e<t}var cC=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function ls(e,t){const n=st(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Yn(e,t){const n=st(t);tt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var uC=Sh,dC=jh,fC=zh,hC=[" ","Enter","ArrowUp","ArrowDown"],pC=[" ","Enter"],kn="Select",[cs,us,mC]=hf(kn),[or]=Xt(kn,[mC,is]),ds=is(),[gC,dn]=or(kn),[xC,yC]=or(kn),Mh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:x}=e,m=ds(t),[g,y]=b.useState(null),[v,k]=b.useState(null),[S,C]=b.useState(!1),j=Yo(u),[N,T]=bn({prop:r,defaultProp:o??!1,onChange:s,caller:kn}),[I,O]=bn({prop:i,defaultProp:a,onChange:c,caller:kn}),F=b.useRef(null),E=g?x||!!g.closest("form"):!0,[L,w]=b.useState(new Set),M=Array.from(L).map(B=>B.props.value).join(";");return l.jsx(hh,{...m,children:l.jsxs(gC,{required:h,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ot(),value:I,onValueChange:O,open:N,onOpenChange:T,dir:j,triggerPointerDownPosRef:F,disabled:p,children:[l.jsx(cs.Provider,{scope:t,children:l.jsx(xC,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(B=>{w(D=>new Set(D).add(B))},[]),onNativeOptionRemove:b.useCallback(B=>{w(D=>{const U=new Set(D);return U.delete(B),U})},[]),children:n})}),E?l.jsxs(op,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:B=>O(B.target.value),disabled:p,form:x,children:[I===void 0?l.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Mh.displayName=kn;var Lh="SelectTrigger",Dh=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ds(n),i=dn(Lh,n),a=i.disabled||r,c=Le(t,i.onTriggerChange),u=us(n),d=b.useRef("touch"),[f,p,h]=ip(m=>{const g=u().filter(k=>!k.disabled),y=g.find(k=>k.value===i.value),v=ap(g,m,y);v!==void 0&&i.onValueChange(v.value)}),x=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(ph,{asChild:!0,...s,children:l.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":sp(i.value)?"":void 0,...o,ref:c,onClick:ke(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&x(m)}),onPointerDown:ke(o.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:ke(o.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&hC.includes(m.key)&&(x(),m.preventDefault())})})})});Dh.displayName=Lh;var Fh="SelectValue",$h=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=dn(Fh,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=Le(t,c.onValueNodeChange);return tt(()=>{u(d)},[u,d]),l.jsx(Ne.span,{...a,ref:f,style:{pointerEvents:"none"},children:sp(c.value)?l.jsx(l.Fragment,{children:i}):s})});$h.displayName=Fh;var bC="SelectIcon",Bh=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Bh.displayName=bC;var vC="SelectPortal",Uh=e=>l.jsx(Qo,{asChild:!0,...e});Uh.displayName=vC;var _n="SelectContent",Vh=b.forwardRef((e,t)=>{const n=dn(_n,e.__scopeSelect),[r,o]=b.useState();if(tt(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Mr.createPortal(l.jsx(Hh,{scope:e.__scopeSelect,children:l.jsx(cs.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(Wh,{...e,ref:t})});Vh.displayName=_n;var _t=10,[Hh,fn]=or(_n),wC="SelectContentImpl",kC=Kn("SelectContent.RemoveScroll"),Wh=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g,...y}=e,v=dn(_n,n),[k,S]=b.useState(null),[C,j]=b.useState(null),N=Le(t,ae=>S(ae)),[T,I]=b.useState(null),[O,F]=b.useState(null),E=us(n),[L,w]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(k)return Af(k)},[k]),wf();const B=b.useCallback(ae=>{const[ue,...fe]=E().map(je=>je.ref.current),[he]=fe.slice(-1),ye=document.activeElement;for(const je of ae)if(je===ye||(je?.scrollIntoView({block:"nearest"}),je===ue&&C&&(C.scrollTop=0),je===he&&C&&(C.scrollTop=C.scrollHeight),je?.focus(),document.activeElement!==ye))return},[E,C]),D=b.useCallback(()=>B([T,k]),[B,T,k]);b.useEffect(()=>{L&&D()},[L,D]);const{onOpenChange:U,triggerPointerDownPosRef:G}=v;b.useEffect(()=>{if(k){let ae={x:0,y:0};const ue=he=>{ae={x:Math.abs(Math.round(he.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(he.pageY)-(G.current?.y??0))}},fe=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():k.contains(he.target)||U(!1),document.removeEventListener("pointermove",ue),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",fe,{capture:!0})}}},[k,U,G]),b.useEffect(()=>{const ae=()=>U(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[U]);const[A,H]=ip(ae=>{const ue=E().filter(ye=>!ye.disabled),fe=ue.find(ye=>ye.ref.current===document.activeElement),he=ap(ue,ae,fe);he&&setTimeout(()=>he.ref.current.focus())}),J=b.useCallback((ae,ue,fe)=>{const he=!M.current&&!fe;(v.value!==void 0&&v.value===ue||he)&&(I(ae),he&&(M.current=!0))},[v.value]),R=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ae,ue,fe)=>{const he=!M.current&&!fe;(v.value!==void 0&&v.value===ue||he)&&F(ae)},[v.value]),Q=r==="popper"?wi:Zh,de=Q===wi?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g}:{};return l.jsx(Hh,{scope:n,content:k,viewport:C,onViewportChange:j,itemRefCallback:J,selectedItem:T,onItemLeave:R,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:O,position:r,isPositioned:L,searchRef:A,children:l.jsx(ga,{as:kC,allowPinchZoom:!0,children:l.jsx(ma,{asChild:!0,trapped:v.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:ke(o,ae=>{v.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:l.jsx(Xo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ae=>ae.preventDefault(),...y,...de,onPlaced:()=>w(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ke(y.onKeyDown,ae=>{const ue=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ue&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=E().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ye=ae.target,je=he.indexOf(ye);he=he.slice(je+1)}setTimeout(()=>B(he)),ae.preventDefault()}})})})})})})});Wh.displayName=wC;var _C="SelectItemAlignedPosition",Zh=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=dn(_n,n),i=fn(_n,n),[a,c]=b.useState(null),[u,d]=b.useState(null),f=Le(t,N=>d(N)),p=us(n),h=b.useRef(!1),x=b.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=i,k=b.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&g&&y){const N=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(s.dir!=="rtl"){const ye=O.left-T.left,je=I.left-ye,ze=N.left-je,_=N.width+ze,q=Math.max(_,T.width),W=window.innerWidth-_t,P=vi(je,[_t,Math.max(_t,W-q)]);a.style.minWidth=_+"px",a.style.left=P+"px"}else{const ye=T.right-O.right,je=window.innerWidth-I.right-ye,ze=window.innerWidth-N.right-je,_=N.width+ze,q=Math.max(_,T.width),W=window.innerWidth-_t,P=vi(je,[_t,Math.max(_t,W-q)]);a.style.minWidth=_+"px",a.style.right=P+"px"}const F=p(),E=window.innerHeight-_t*2,L=m.scrollHeight,w=window.getComputedStyle(u),M=parseInt(w.borderTopWidth,10),B=parseInt(w.paddingTop,10),D=parseInt(w.borderBottomWidth,10),U=parseInt(w.paddingBottom,10),G=M+B+L+U+D,A=Math.min(g.offsetHeight*5,G),H=window.getComputedStyle(m),J=parseInt(H.paddingTop,10),R=parseInt(H.paddingBottom,10),ee=N.top+N.height/2-_t,Q=E-ee,de=g.offsetHeight/2,ae=g.offsetTop+de,ue=M+B+ae,fe=G-ue;if(ue<=ee){const ye=F.length>0&&g===F[F.length-1].ref.current;a.style.bottom="0px";const je=u.clientHeight-m.offsetTop-m.offsetHeight,ze=Math.max(Q,de+(ye?R:0)+je+D),_=ue+ze;a.style.height=_+"px"}else{const ye=F.length>0&&g===F[0].ref.current;a.style.top="0px";const ze=Math.max(ee,M+m.offsetTop+(ye?J:0)+de)+fe;a.style.height=ze+"px",m.scrollTop=ue-ee+m.offsetTop}a.style.margin=`${_t}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,u,m,g,y,s.dir,r]);tt(()=>k(),[k]);const[S,C]=b.useState();tt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const j=b.useCallback(N=>{N&&x.current===!0&&(k(),v?.(),x.current=!1)},[k,v]);return l.jsx(CC,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Ne.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zh.displayName=_C;var SC="SelectPopperPosition",wi=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_t,...s}=e,i=ds(n);return l.jsx(mh,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wi.displayName=SC;var[CC,Ia]=or(_n,{}),ki="SelectViewport",qh=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=fn(ki,n),i=Ia(ki,n),a=Le(t,s.onViewportChange),c=b.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(cs.Slot,{scope:n,children:l.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p?.current&&f){const h=Math.abs(c.current-d.scrollTop);if(h>0){const x=window.innerHeight-_t*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),y=Math.max(m,g);if(y<x){const v=y+h,k=Math.min(x,v),S=v-k;f.style.height=k+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});qh.displayName=ki;var Jh="SelectGroup",[jC,EC]=or(Jh),NC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ot();return l.jsx(jC,{scope:n,id:o,children:l.jsx(Ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});NC.displayName=Jh;var Kh="SelectLabel",TC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=EC(Kh,n);return l.jsx(Ne.div,{id:o.id,...r,ref:t})});TC.displayName=Kh;var Lo="SelectItem",[AC,Gh]=or(Lo),Yh=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=dn(Lo,n),c=fn(Lo,n),u=a.value===r,[d,f]=b.useState(s??""),[p,h]=b.useState(!1),x=Le(t,v=>c.itemRefCallback?.(v,r,o)),m=Ot(),g=b.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(AC,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:b.useCallback(v=>{f(k=>k||(v?.textContent??"").trim())},[]),children:l.jsx(cs.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(Ne.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:ke(i.onFocus,()=>h(!0)),onBlur:ke(i.onBlur,()=>h(!1)),onClick:ke(i.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:ke(i.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:ke(i.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:ke(i.onPointerMove,v=>{g.current=v.pointerType,o?c.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ke(i.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(pC.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Yh.displayName=Lo;var br="SelectItemText",Xh=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=dn(br,n),a=fn(br,n),c=Gh(br,n),u=yC(br,n),[d,f]=b.useState(null),p=Le(t,y=>f(y),c.onItemTextChange,y=>a.itemTextRefCallback?.(y,c.value,c.disabled)),h=d?.textContent,x=b.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return tt(()=>(m(x),()=>g(x)),[m,g,x]),l.jsxs(l.Fragment,{children:[l.jsx(Ne.span,{id:c.textId,...s,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Mr.createPortal(s.children,i.valueNode):null]})});Xh.displayName=br;var Qh="SelectItemIndicator",ep=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Gh(Qh,n).isSelected?l.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});ep.displayName=Qh;var _i="SelectScrollUpButton",tp=b.forwardRef((e,t)=>{const n=fn(_i,e.__scopeSelect),r=Ia(_i,e.__scopeSelect),[o,s]=b.useState(!1),i=Le(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(rp,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});tp.displayName=_i;var Si="SelectScrollDownButton",np=b.forwardRef((e,t)=>{const n=fn(Si,e.__scopeSelect),r=Ia(Si,e.__scopeSelect),[o,s]=b.useState(!1),i=Le(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(rp,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});np.displayName=Si;var rp=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=fn("SelectScrollButton",n),i=b.useRef(null),a=us(n),c=b.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),tt(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),l.jsx(Ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ke(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{c()})})}),IC="SelectSeparator",zC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});zC.displayName=IC;var Ci="SelectArrow",RC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ds(n),s=dn(Ci,n),i=fn(Ci,n);return s.open&&i.position==="popper"?l.jsx(gh,{...o,...r,ref:t}):null});RC.displayName=Ci;var PC="SelectBubbleInput",op=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=b.useRef(null),s=Le(r,o),i=v_(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Ne.select,{...n,style:{...df,...n.style},ref:s,defaultValue:t})});op.displayName=PC;function sp(e){return e===""||e===void 0}function ip(e){const t=st(e),n=b.useRef(""),r=b.useRef(0),o=b.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ap(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=OC(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function OC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var MC=Mh,LC=Dh,DC=$h,FC=Bh,$C=Uh,BC=Vh,UC=qh,VC=Yh,HC=Xh,WC=ep,ZC=tp,qC=np,fs="Tabs",[JC]=Xt(fs,[yh]),lp=yh(),[KC,za]=JC(fs),cp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Yo(a),[f,p]=bn({prop:r,onChange:o,defaultProp:s??"",caller:fs});return l.jsx(KC,{scope:n,baseId:Ot(),value:f,onValueChange:p,orientation:i,dir:d,activationMode:c,children:l.jsx(Ne.div,{dir:d,"data-orientation":i,...u,ref:t})})});cp.displayName=fs;var up="TabsList",dp=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=za(up,n),i=lp(n);return l.jsx(YS,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Ne.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});dp.displayName=up;var fp="TabsTrigger",hp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=za(fp,n),a=lp(n),c=gp(i.baseId,r),u=xp(i.baseId,r),d=r===i.value;return l.jsx(XS,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(Ne.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:ke(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:ke(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});hp.displayName=fp;var pp="TabsContent",mp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=za(pp,n),c=gp(a.baseId,r),u=xp(a.baseId,r),d=r===a.value,f=b.useRef(d);return b.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(bt,{present:o||d,children:({present:p})=>l.jsx(Ne.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});mp.displayName=pp;function gp(e,t){return`${e}-trigger-${t}`}function xp(e,t){return`${e}-content-${t}`}var GC=cp,YC=dp,XC=hp,QC=mp,[hs]=Xt("Tooltip",[is]),ps=is(),yp="TooltipProvider",e5=700,ji="tooltip.open",[t5,Ra]=hs(yp),bp=e=>{const{__scopeTooltip:t,delayDuration:n=e5,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=b.useRef(!0),a=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(t5,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};bp.displayName=yp;var Ir="Tooltip",[n5,Br]=hs(Ir),vp=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ra(Ir,e.__scopeTooltip),u=ps(t),[d,f]=b.useState(null),p=Ot(),h=b.useRef(0),x=i??c.disableHoverableContent,m=a??c.delayDuration,g=b.useRef(!1),[y,v]=bn({prop:r,defaultProp:o??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(ji))):c.onClose(),s?.(N)},caller:Ir}),k=b.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),S=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,v(!0)},[v]),C=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v(!1)},[v]),j=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,v(!0),h.current=0},m)},[m,v]);return b.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),l.jsx(hh,{...u,children:l.jsx(n5,{scope:t,contentId:p,open:y,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:b.useCallback(()=>{x?C():(window.clearTimeout(h.current),h.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:n})})};vp.displayName=Ir;var Ei="TooltipTrigger",wp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(Ei,n),s=Ra(Ei,n),i=ps(n),a=b.useRef(null),c=Le(t,a,o.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(ph,{asChild:!0,...i,children:l.jsx(Ne.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:ke(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ke(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});wp.displayName=Ei;var Pa="TooltipPortal",[r5,o5]=hs(Pa,{forceMount:void 0}),kp=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Br(Pa,t);return l.jsx(r5,{scope:t,forceMount:n,children:l.jsx(bt,{present:n||s.open,children:l.jsx(Qo,{asChild:!0,container:o,children:r})})})};kp.displayName=Pa;var Xn="TooltipContent",_p=b.forwardRef((e,t)=>{const n=o5(Xn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Br(Xn,e.__scopeTooltip);return l.jsx(bt,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Sp,{side:o,...s,ref:t}):l.jsx(s5,{side:o,...s,ref:t})})}),s5=b.forwardRef((e,t)=>{const n=Br(Xn,e.__scopeTooltip),r=Ra(Xn,e.__scopeTooltip),o=b.useRef(null),s=Le(t,o),[i,a]=b.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{a(null),f(!1)},[f]),h=b.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},v=c5(y,g.getBoundingClientRect()),k=u5(y,v),S=d5(m.getBoundingClientRect()),C=h5([...k,...S]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(c&&d){const x=g=>h(g,d),m=g=>h(g,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",m)}}},[c,d,h,p]),b.useEffect(()=>{if(i){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},v=c?.contains(g)||d?.contains(g),k=!f5(y,i);v?p():k&&(p(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,p]),l.jsx(Sp,{...e,ref:s})}),[i5,a5]=hs(Ir,{isInside:!1}),l5=Rw("TooltipContent"),Sp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Br(Xn,n),u=ps(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(ji,d),()=>document.removeEventListener(ji,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=p=>{p.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Xo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(mh,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.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:[l.jsx(l5,{children:r}),l.jsx(i5,{scope:n,isInside:!0,children:l.jsx($w,{id:c.contentId,role:"tooltip",children:o||r})})]})})});_p.displayName=Xn;var Cp="TooltipArrow",jp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ps(n);return a5(Cp,n).isInside?null:l.jsx(gh,{...o,...r,ref:t})});jp.displayName=Cp;function c5(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function u5(e,t,n=5){const 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 d5(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function f5(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,f=c.x,p=c.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function h5(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),p5(t)}function p5(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}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 m5=bp,g5=vp,x5=wp,y5=kp,b5=_p,v5=jp;const w5=da("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function jt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?Iw:"span";return l.jsx(o,{"data-slot":"badge","data-variant":t,className:be(w5({variant:t}),e),...r})}function Oa({...e}){return l.jsx(h_,{"data-slot":"dialog",...e})}function k5({...e}){return l.jsx(p_,{"data-slot":"dialog-trigger",...e})}function _5({...e}){return l.jsx(m_,{"data-slot":"dialog-portal",...e})}function S5({className:e,...t}){return l.jsx(g_,{"data-slot":"dialog-overlay",className:be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Ma({className:e,children:t,...n}){return l.jsxs(_5,{children:[l.jsx(S5,{}),l.jsxs(x_,{"data-slot":"dialog-content",className:be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,l.jsxs(b_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(la,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function La({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Da({className:e,...t}){return l.jsx(y_,{"data-slot":"dialog-title",className:be("text-lg font-semibold leading-none tracking-tight",e),...t})}const C5=da("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Re({className:e,variant:t,size:n,...r}){return l.jsx("button",{"data-slot":"button",className:be(C5({variant:t,size:n,className:e})),...r})}function Ep({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o="Confirm",variant:s="default",onConfirm:i}){return l.jsx(Oa,{open:e,onOpenChange:t,children:l.jsxs(Ma,{children:[l.jsx(La,{children:l.jsx(Da,{children:n})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx(Re,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Cancel"}),l.jsx(Re,{variant:s,size:"sm",onClick:()=>{i(),t(!1)},children:o})]})]})})}const j5={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function E5({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:s,apiFormat:i,expanded:a,onToggle:c,hideApiFormat:u=!1,isLoading:d=!1,userAgent:f,timeDisplayFormat:p,onClear:h}){const[x,m]=b.useState(!1),g=v=>{v.stopPropagation(),h!==void 0&&m(!0)},y=b.useCallback(v=>{v.stopPropagation(),window.open(rg(e),"_blank","noopener,noreferrer")},[e]);return l.jsxs("div",{role:"button",tabIndex:0,"data-nav-id":`conv-${e}`,"data-nav-action":a?"collapse":"expand",className:be("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-background sticky top-0 z-10","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-none"),onClick:c,onKeyDown:v=>{v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),c())},children:[a?l.jsx(Yt,{className:"size-4 text-muted-foreground shrink-0"}):d?l.jsx(Nr,{className:"size-4 animate-spin text-muted-foreground shrink-0"}):l.jsx(un,{className:"size-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.startsWith("PID:")||e.includes("|")?e:e.length>24?e.slice(0,12)+"..."+e.slice(-12):e}),f!=null&&f!==""&&l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:f,children:[l.jsx(x2,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",children:f})]}),!u&&l.jsx(jt,{variant:"outline",className:be("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",i==="openai"&&"border-blue-500/40 text-blue-400",i==="anthropic"&&"border-orange-500/40 text-orange-400",i==="unknown"&&"border-muted text-muted-foreground"),children:j5[i]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(on,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums",children:ca(t,n,p)})]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(Ko,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Tr,{className:"size-3 text-muted-foreground"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[l.jsx("span",{className:"text-blue-400",children:Ve(o)})," / ",l.jsx("span",{className:"text-amber-400",children:Ve(s)})]})]}),l.jsx("span",{className:"flex-1 min-w-0"}),l.jsx("button",{type:"button",onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&y(v)},"aria-label":`Open session ${e} in a new tab`,title:"Open this session in a new tab",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 inline-flex items-center justify-center size-8 rounded hover:bg-muted cursor-pointer",children:l.jsx($d,{className:"size-3.5"})}),h!==void 0&&l.jsx("button",{type:"button",onClick:g,"aria-label":`Clear group (${r} request${r!==1?"s":""})`,title:"Clear this group",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 inline-flex items-center justify-center size-8 rounded hover:bg-muted cursor-pointer",children:l.jsx(Hd,{className:"size-3.5"})}),l.jsx(Ep,{open:x,onOpenChange:m,title:"Clear this group?",description:`This will remove ${r} request${r!==1?"s":""} from this conversation. This action cannot be undone.`,confirmLabel:"Clear",variant:"destructive",onConfirm:()=>{h?.()}})]})}function N5(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function T5(e){let t=!1,n=!1;for(const r of e)if(r.apiFormat==="anthropic"?t=!0:r.apiFormat==="openai"&&(n=!0),t&&n)return!0;return!1}function A5(e){if(e.isTest===!0)return"provider-test";if(e.sessionId!==null&&e.sessionId!==""&&e.sessionId!==void 0)return e.sessionId;const t=e.clientPid!==null&&e.clientPid!==void 0,n=e.clientProjectFolder!==null&&e.clientProjectFolder!==void 0;if(!t&&!n)return"default";const r=t?`PID:${e.clientPid}`:"unknown",o=n?e.clientProjectFolder:"no-folder";return`${r}|${o}`}function I5(e){const t=new Map;for(const r of e){const o=A5(r),s=t.get(o);s!==void 0?s.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const s=[...o].sort((i,a)=>i.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:s})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}function pc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function z5(e){if(e.responseText===null)return null;try{let t=JSON.parse(e.responseText);return typeof t=="string"&&(t=JSON.parse(t)),pc(t)?typeof t.stop_reason=="string"?t.stop_reason==="end_turn"||t.stop_reason==="tool_use"?t.stop_reason:null:Array.isArray(t.choices)&&t.choices.length>0&&pc(t.choices[0])&&typeof t.choices[0].finish_reason=="string"&&t.choices[0].finish_reason==="stop"?"stop":null:null}catch{return null}}function Np(e){return e==="end_turn"||e==="stop"}function wt({className:e,style:t,d:n,eyeStalks:r,eyes:o,legs:s,extras:i}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:t,className:be("inline-block size-5",e),children:[l.jsx("path",{d:n}),r,o,s,i]})}const hn=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),l.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),l.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),l.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]}),Tp=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"16",x2:"5.5",y2:"18.5"}),l.jsx("line",{x1:"9.5",y1:"17",x2:"8.5",y2:"19.5"}),l.jsx("line",{x1:"14.5",y1:"17",x2:"15.5",y2:"19.5"}),l.jsx("line",{x1:"17",y1:"16",x2:"18.5",y2:"18.5"})]});function Ap({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function R5({className:e}){return l.jsx(wt,{className:e,d:"M4 13 C4 7 7.5 5.5 12 5.5 C16.5 5.5 20 7 20 13 C20 17.5 16.5 19 12 19 C7.5 19 4 17.5 4 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"6.5",x2:"9.5",y2:"4.5"}),l.jsx("line",{x1:"14.5",y1:"6.5",x2:"14.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"})]}),legs:Tp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C4 9.5 2.5 10 3 12 C3.5 13.5 4.5 13 5 12"}),l.jsx("path",{d:"M19 11 C20 9.5 21.5 10 21 12 C20.5 13.5 19.5 13 19 12"})]})})}function P5({className:e}){return l.jsx(wt,{className:e,d:"M3 13.5 C3 8 7 6 12 6 C17 6 21 8 21 13.5 C21 17 17 19 12 19 C7 19 3 17 3 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"7",x2:"6.5",y2:"4.5"}),l.jsx("line",{x1:"17",y1:"7",x2:"17.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"6.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"17.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M4 12 C2.5 10.5 1 11 1.5 13 C2 14.5 3.5 14 4.5 13"}),l.jsx("path",{d:"M20 12 C21.5 10.5 23 11 22.5 13 C22 14.5 20.5 14 19.5 13"})]})})}function O5({className:e}){return l.jsx(wt,{className:e,d:"M6 14 C6 8 9 5.5 12 5.5 C15 5.5 18 8 18 14 C18 18 15 20 12 20 C9 20 6 18 6 14 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"6.5",x2:"10",y2:"3.5"}),l.jsx("line",{x1:"14",y1:"6.5",x2:"14",y2:"3.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"17",x2:"5",y2:"20.5"}),l.jsx("line",{x1:"9.5",y1:"18.5",x2:"8.5",y2:"21.5"}),l.jsx("line",{x1:"14.5",y1:"18.5",x2:"15.5",y2:"21.5"}),l.jsx("line",{x1:"17",y1:"17",x2:"19",y2:"20.5"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6.5 11 C5 8.5 3 9 3.5 11.5 C4 13.5 5 13 6 12"}),l.jsx("path",{d:"M17.5 11 C19 8.5 21 9 20.5 11.5 C20 13.5 19 13 18 12"})]})})}function M5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 L13 4 L14 7 C16 7 19 9 19 13 C19 16 16 18 13 18 L12 21 L11 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function L5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("line",{x1:"13.5",y1:"4",x2:"15.5",y2:"5"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function D5({className:e}){return l.jsx(wt,{className:e,d:"M5.5 13.5 C5.5 10 8.5 8 12 8 C15.5 8 18.5 10 18.5 13.5 C18.5 16 15.5 17.5 12 17.5 C8.5 17.5 5.5 16 5.5 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"6"}),l.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"6"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9",y1:"6",x2:"11",y2:"6.5"}),l.jsx("line",{x1:"13",y1:"6",x2:"15",y2:"6.5"})]}),legs:Tp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6 11.5 C4.5 10.5 3 11 3.5 12.5 C4 13.5 5 13 5.5 12.5"}),l.jsx("path",{d:"M18 11.5 C19.5 10.5 21 11 20.5 12.5 C20 13.5 19 13 18.5 12.5"})]})})}function F5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("line",{x1:"8.5",y1:"4",x2:"10.5",y2:"4.5"}),l.jsx("line",{x1:"15.5",y1:"4",x2:"13.5",y2:"4.5"}),l.jsx("path",{d:"M9 15.5 C10 14.5 14 14.5 15 15.5"})]})})}function $5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("ellipse",{cx:"12",cy:"15",rx:"2",ry:"1.5",fill:"currentColor",stroke:"none"})]})})}function B5({className:e}){return l.jsx(wt,{className:e,d:"M4.5 13 C4.5 8 7.5 6 12 6 C16.5 6 19.5 8 19.5 13 C19.5 17 16.5 18.5 12 18.5 C7.5 18.5 4.5 17 4.5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"7",x2:"9",y2:"5"}),l.jsx("line",{x1:"14.5",y1:"7",x2:"15",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"15",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9 2 9.5 2.5 12 C3 14 4 13 5 12"}),l.jsx("path",{d:"M19 11 C20.5 9 22 9.5 21.5 12 C21 14 20 13 19 12"}),l.jsx("path",{d:"M9 14.5 C10 16 14 16 15 14.5"}),l.jsx("circle",{cx:"7",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"}),l.jsx("circle",{cx:"17",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"})]})})}function U5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5.5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7.5",y1:"5.5",x2:"16.5",y2:"5.5"}),l.jsx("rect",{x:"7",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"}),l.jsx("rect",{x:"13",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("path",{d:"M9.5 15 C10.5 16 13.5 16 14.5 15"})]})})}function V5({className:e}){return l.jsx(wt,{className:e,d:"M7 13.5 C7 10.5 9.5 9 12 9 C14.5 9 17 10.5 17 13.5 C17 16 14.5 17.5 12 17.5 C9.5 17.5 7 16 7 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10.5",y1:"9.5",x2:"10.5",y2:"8"}),l.jsx("line",{x1:"13.5",y1:"9.5",x2:"13.5",y2:"8"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"13.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"8",y1:"16",x2:"6.5",y2:"18"}),l.jsx("line",{x1:"10",y1:"17",x2:"9.5",y2:"19"}),l.jsx("line",{x1:"14",y1:"17",x2:"14.5",y2:"19"}),l.jsx("line",{x1:"16",y1:"16",x2:"17.5",y2:"18"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M7.5 12 C6.5 11 5.5 11.5 6 13 C6.5 14 7 13.5 7.5 13"}),l.jsx("path",{d:"M16.5 12 C17.5 11 18.5 11.5 18 13 C17.5 14 17 13.5 16.5 13"})]})})}const zr=[Ap,R5,P5,O5,M5,L5,D5,F5,$5,B5,U5,V5];function Do(e){return zr[Math.abs(e)%zr.length]??Ap}function H5(e){const t=zr.length-2;return t<=0?0:1+((Number.isFinite(e)?Math.trunc(e):0)%t+t)%t}function W5(e){return Do(H5(e))}const Z5="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",q5="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",J5="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",K5="/assets/minimax-BPMzvuL-.jpeg",G5="/assets/alibaba-TTwafVwX.svg",Y5="/assets/qwen-CONDcHqt.png",X5="/assets/zhipuai-BPNAnxo-.svg",Q5={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function Ip(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(Q5))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const En={width:24,height:24,objectFit:"contain"},ej=at.memo(({className:e})=>l.jsx("img",{src:Z5,alt:"Anthropic",className:e,style:En})),tj=at.memo(({className:e})=>l.jsx("img",{src:q5,alt:"OpenAI",className:e,style:{...En,background:"white",borderRadius:"4px"}})),nj=at.memo(({className:e})=>l.jsx("img",{src:J5,alt:"DeepSeek",className:e,style:En})),rj=at.memo(({className:e})=>l.jsx("img",{src:K5,alt:"MiniMax",className:e,style:En})),oj=at.memo(({className:e})=>l.jsx("img",{src:G5,alt:"Alibaba",className:e,style:En})),sj=at.memo(({className:e})=>l.jsx("img",{src:Y5,alt:"Qwen",className:e,style:En})),ij=at.memo(({className:e})=>l.jsx("img",{src:X5,alt:"ZhipuAI",className:e,style:En}));function zp({provider:e,className:t}){switch(e){case"anthropic":return l.jsx(ej,{className:t});case"openai":return l.jsx(tj,{className:t});case"deepseek":return l.jsx(nj,{className:t});case"minimax":return l.jsx(rj,{className:t});case"alibaba":return l.jsx(oj,{className:t});case"qwen":return l.jsx(sj,{className:t});case"zhipuai":return l.jsx(ij,{className:t});case"unknown":return null}}function Xe({delayDuration:e=0,...t}){return l.jsx(m5,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function De({...e}){return l.jsx(g5,{"data-slot":"tooltip",...e})}function Fe({...e}){return l.jsx(x5,{"data-slot":"tooltip-trigger",...e})}function $e({className:e,sideOffset:t=0,children:n,...r}){return l.jsx(y5,{children:l.jsxs(b5,{"data-slot":"tooltip-content",sideOffset:t,className:be("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,l.jsx(v5,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Oe(e,t){return e===null||typeof e!="object"||Array.isArray(e)?void 0:Object.getOwnPropertyDescriptor(e,t)?.value}const aj="x-anthropic-billing-header:";function lj(e){return e.trimStart().toLowerCase().startsWith(aj)}function cj(e){return Fa(e)?Object.prototype.hasOwnProperty.call(e,"system"):!1}function uj(e){if(!Fa(e))return!1;const t=Oe(e,"type"),n=Oe(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:lj(n)}function dj(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!cj(t))return{body:e,removed:0};const n=t.system;if(!Array.isArray(n)||n.length===0)return{body:e,removed:0};const r=[];let o=0;for(const s of n){if(uj(s)){o+=1;continue}r.push(s)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}function fj(e){return{depth:Number.POSITIVE_INFINITY}}function Rp(e){try{const t=JSON.parse(e);return{kind:"json",data:Fo(t)}}catch{return{kind:"text"}}}function Ms(e){const t=b.useMemo(()=>e===null?null:Rp(e),[e]),n=t?.kind==="json"?t.data:null,r=b.useMemo(()=>n===null?null:fj(),[n]),[o,s]=b.useState(!1),[i,a]=b.useState(0),[c,u]=b.useState(0),[d,f]=b.useTransition(),p=b.useCallback(()=>{const h=!o,x=h&&r!==null?r.depth:0;f(()=>{s(h),a(x),u(m=>m+1)})},[o,r]);return{parsedData:n,policy:r,isExpanded:o,toggle:p,isPending:d,bulkDepth:i,bulkRevision:c}}function Fo(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>Fo(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=Fo(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Pp({className:e,orientation:t="horizontal",...n}){return l.jsx(GC,{"data-slot":"tabs","data-orientation":t,orientation:t,className:be("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const hj=da("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Op({className:e,variant:t="default",...n}){return l.jsx(YC,{"data-slot":"tabs-list","data-variant":t,className:be(hj({variant:t}),e),...n})}function St({className:e,...t}){return l.jsx(XC,{"data-slot":"tabs-trigger",className:be("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ct({className:e,...t}){return l.jsx(QC,{"data-slot":"tabs-content",className:be("flex-1 outline-none",e),...t})}function gn(e){const[t,n]=b.useState(!1),r=b.useRef(null);b.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const o=b.useCallback(s=>{s.stopPropagation(),e!==null&&window.navigator.clipboard.writeText(e).then(()=>{n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),2e3)})},[e]);return{copied:t,copy:o}}const pj=b.lazy(()=>Sn(()=>import("./CompareDrawer-D-90PIPw.js"),__vite__mapDeps([0,1])).then(e=>({default:e.CompareDrawer}))),mj=b.lazy(()=>Sn(()=>import("./ReplayDialog-DzlLYoTO.js"),__vite__mapDeps([2,1,3])).then(e=>({default:e.ReplayDialog}))),gj=b.lazy(()=>Sn(()=>import("./RequestAnatomy-0hbyf6oa.js"),__vite__mapDeps([4,1])).then(e=>({default:e.RequestAnatomy}))),xj=b.lazy(()=>Sn(()=>import("./ResponseView-CKe0tNqr.js"),__vite__mapDeps([3,1])).then(e=>({default:e.ResponseView}))),yj=b.lazy(()=>Sn(()=>import("./StreamingChunkSequence-enhfdeNh.js"),__vite__mapDeps([5,1])).then(e=>({default:e.StreamingChunkSequence}))),mc=b.lazy(()=>Sn(()=>Promise.resolve().then(()=>Nm),void 0).then(e=>({default:e.JsonViewer}))),bj=b.lazy(()=>Sn(()=>Promise.resolve().then(()=>Nm),void 0).then(e=>({default:e.JsonViewerFromString}))),vj=1200,wj=12;function kj(e){const{containerRef:t,setExpandToPath:n,ensureTabActive:r,highlightMs:o}=e,s=b.useRef(null);return b.useCallback(i=>{r?.(),n(i.path);const a=f=>{f.scrollIntoView({behavior:"smooth",block:"center"}),f.classList.add("ring-2","ring-primary/60","ring-offset-1","ring-offset-background","rounded-sm","transition-shadow"),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{f.classList.remove("ring-2","ring-primary/60","ring-offset-1","ring-offset-background","rounded-sm","transition-shadow"),n(null)},o??vj)},u=`[data-anatomy-path="${(f=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["'\\[\](){}])/g,"\\$1"))(i.path)}"]`,d=f=>{const p=t.current;if(p!==null){const h=p.querySelector(u);if(h!==null){a(h);return}}f>0?window.requestAnimationFrame(()=>d(f-1)):n(null)};window.requestAnimationFrame(()=>d(wj))},[t,r,o,n])}class Mp{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const s=this.castInput(t,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,c,r,o)}diffWithOptionsObj(t,n,r,o){var s;const i=v=>{if(v=this.postProcess(v,r),o){setTimeout(function(){o(v)},0);return}else return v},a=n.length,c=t.length;let u=1,d=a+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(s=r.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&x+1>=a)return i(this.buildValues(h[0].lastComponent,n,t));let m=-1/0,g=1/0;const y=()=>{for(let v=Math.max(m,-u);v<=Math.min(g,u);v+=2){let k;const S=h[v-1],C=h[v+1];S&&(h[v-1]=void 0);let j=!1;if(C){const T=C.oldPos-v;j=C&&0<=T&&T<a}const N=S&&S.oldPos+1<c;if(!j&&!N){h[v]=void 0;continue}if(!N||j&&S.oldPos<C.oldPos?k=this.addToPath(C,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(k,n,t,v,r),k.oldPos+1>=c&&x+1>=a)return i(this.buildValues(k.lastComponent,n,t))||!0;h[v]=k,k.oldPos+1>=c&&(g=Math.min(g,v-1)),x+1>=a&&(m=Math.max(m,v+1))}u++};if(o)(function v(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);y()||v()},0)})();else for(;u<=d&&Date.now()<=p;){const v=y();if(v)return v}}addToPath(t,n,r,o,s){const i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(t,n,r,o,s){const i=n.length,a=r.length;let c=t.oldPos,u=c-o,d=0;for(;u+1<i&&c+1<a&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const i=o.length;let a=0,c=0,u=0;for(;a<i;a++){const d=o[a];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){const x=r[u+h];return x.length>p.length?x:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return o}}class _j extends Mp{constructor(){super(...arguments),this.tokenize=Dp}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
85
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},d_="DialogDescriptionWarning",f_=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wf(d_).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},h_=zf,p_=Pf,m_=Mf,g_=Lf,x_=Df,y_=$f,b_=Vf;function v_(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function w_(e){const[t,n]=b.useState(void 0);return tt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const k_=["top","right","bottom","left"],sn=Math.min,pt=Math.max,Io=Math.round,oo=Math.floor,Mt=e=>({x:e,y:e}),__={left:"right",right:"left",bottom:"top",top:"bottom"},S_={start:"end",end:"start"};function gi(e,t,n){return pt(e,sn(t,n))}function qt(e,t){return typeof e=="function"?e(t):e}function Jt(e){return e.split("-")[0]}function nr(e){return e.split("-")[1]}function va(e){return e==="x"?"y":"x"}function wa(e){return e==="y"?"height":"width"}const C_=new Set(["top","bottom"]);function Pt(e){return C_.has(Jt(e))?"y":"x"}function ka(e){return va(Pt(e))}function j_(e,t,n){n===void 0&&(n=!1);const r=nr(e),o=ka(e),s=wa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zo(i)),[i,zo(i)]}function E_(e){const t=zo(e);return[xi(e),t,xi(t)]}function xi(e){return e.replace(/start|end/g,t=>S_[t])}const nc=["left","right"],rc=["right","left"],N_=["top","bottom"],T_=["bottom","top"];function A_(e,t,n){switch(e){case"top":case"bottom":return n?t?rc:nc:t?nc:rc;case"left":case"right":return t?N_:T_;default:return[]}}function I_(e,t,n,r){const o=nr(e);let s=A_(Jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(xi)))),s}function zo(e){return e.replace(/left|right|bottom|top/g,t=>__[t])}function z_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zf(e){return typeof e!="number"?z_(e):{top:e,right:e,bottom:e,left:e}}function Ro(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function oc(e,t,n){let{reference:r,floating:o}=e;const s=Pt(t),i=ka(t),a=wa(i),c=Jt(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(nr(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}async function R_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=qt(t,e),x=Zf(h),g=a[p?f==="floating"?"reference":"floating":f],y=Ro(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),v=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},C=Ro(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:c}):v);return{top:(y.top-C.top+x.top)/S.y,bottom:(C.bottom-y.bottom+x.bottom)/S.y,left:(y.left-C.left+x.left)/S.x,right:(C.right-y.right+x.right)/S.x}}const P_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=oc(u,r,c),p=r,h={},x=0;for(let g=0;g<a.length;g++){var m;const{name:y,fn:v}=a[g],{x:k,y:S,data:C,reset:j}=await v({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:R_},elements:{reference:e,floating:t}});d=k??d,f=S??f,h={...h,[y]:{...h[y],...C}},j&&x<=50&&(x++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(u=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=oc(u,p,c)),g=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}},O_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=qt(e,t)||{};if(u==null)return{};const f=Zf(d),p={x:n,y:r},h=ka(o),x=wa(h),m=await i.getDimensions(u),g=h==="y",y=g?"top":"left",v=g?"bottom":"right",k=g?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[h]-p[h]-s.floating[x],C=p[h]-s.reference[h],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let N=j?j[k]:0;(!N||!await(i.isElement==null?void 0:i.isElement(j)))&&(N=a.floating[k]||s.floating[x]);const T=S/2-C/2,I=N/2-m[x]/2-1,O=sn(f[y],I),F=sn(f[v],I),E=O,L=N-m[x]-F,w=N/2-m[x]/2+T,M=gi(E,w,L),B=!c.arrow&&nr(o)!=null&&w!==M&&s.reference[x]/2-(w<E?O:F)-m[x]/2<0,D=B?w<E?w-E:w-L:0;return{[h]:p[h]+D,data:{[h]:M,centerOffset:w-M-D,...B&&{alignmentOffset:D}},reset:B}}}),M_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...g}=qt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Jt(o),v=Pt(a),k=Jt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=p||(k||!m?[zo(a)]:E_(a)),j=x!=="none";!p&&j&&C.push(...I_(a,m,x,S));const N=[a,...C],T=await c.detectOverflow(t,g),I=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&I.push(T[y]),f){const w=j_(o,i,S);I.push(T[w[0]],T[w[1]])}if(O=[...O,{placement:o,overflows:I}],!I.every(w=>w<=0)){var F,E;const w=(((F=s.flip)==null?void 0:F.index)||0)+1,M=N[w];if(M&&(!(f==="alignment"?v!==Pt(M):!1)||O.every(U=>Pt(U.placement)===v?U.overflows[0]>0:!0)))return{data:{index:w,overflows:O},reset:{placement:M}};let B=(E=O.filter(D=>D.overflows[0]<=0).sort((D,U)=>D.overflows[1]-U.overflows[1])[0])==null?void 0:E.placement;if(!B)switch(h){case"bestFit":{var L;const D=(L=O.filter(U=>{if(j){const G=Pt(U.placement);return G===v||G==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((U,G)=>U[1]-G[1])[0])==null?void 0:L[0];D&&(B=D);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function sc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ic(e){return k_.some(t=>e[t]>=0)}const L_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=qt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=sc(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ic(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=sc(i,n.floating);return{data:{escapedOffsets:a,escaped:ic(a)}}}default:return{}}}}},qf=new Set(["left","top"]);async function D_(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Jt(n),a=nr(n),c=Pt(n)==="y",u=qf.has(i)?-1:1,d=s&&c?-1:1,f=qt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(h=a==="end"?x*-1:x),c?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const F_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await D_(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},$_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:v,y:k}=y;return{x:v,y:k}}},...u}=qt(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),p=Pt(Jt(o)),h=va(p);let x=d[h],m=d[p];if(i){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",k=x+f[y],S=x-f[v];x=gi(k,x,S)}if(a){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=m+f[y],S=m-f[v];m=gi(k,m,S)}const g=c.fn({...t,[h]:x,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[p]:a}}}}}},B_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=qt(e,t),d={x:n,y:r},f=Pt(o),p=va(f);let h=d[p],x=d[f];const m=qt(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const k=p==="y"?"height":"width",S=s.reference[p]-s.floating[k]+g.mainAxis,C=s.reference[p]+s.reference[k]-g.mainAxis;h<S?h=S:h>C&&(h=C)}if(u){var y,v;const k=p==="y"?"width":"height",S=qf.has(Jt(o)),C=s.reference[f]-s.floating[k]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:g.crossAxis),j=s.reference[f]+s.reference[k]+(S?0:((v=i.offset)==null?void 0:v[f])||0)-(S?g.crossAxis:0);x<C?x=C:x>j&&(x=j)}return{[p]:h,[f]:x}}}},U_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=qt(e,t),d=await i.detectOverflow(t,u),f=Jt(o),p=nr(o),h=Pt(o)==="y",{width:x,height:m}=s.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,g=p==="end"?"top":"bottom");const v=m-d.top-d.bottom,k=x-d.left-d.right,S=sn(m-d[g],v),C=sn(x-d[y],k),j=!t.middlewareData.shift;let N=S,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=v),j&&!p){const O=pt(d.left,0),F=pt(d.right,0),E=pt(d.top,0),L=pt(d.bottom,0);h?T=x-2*(O!==0||F!==0?O+F:pt(d.left,d.right)):N=m-2*(E!==0||L!==0?E+L:pt(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:N});const I=await i.getDimensions(a.floating);return x!==I.width||m!==I.height?{reset:{rects:!0}}:{}}}};function ns(){return typeof window<"u"}function rr(e){return Jf(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $t(e){var t;return(t=(Jf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jf(e){return ns()?e instanceof Node||e instanceof gt(e).Node:!1}function Et(e){return ns()?e instanceof Element||e instanceof gt(e).Element:!1}function Lt(e){return ns()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function ac(e){return!ns()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}const V_=new Set(["inline","contents"]);function Fr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!V_.has(o)}const H_=new Set(["table","td","th"]);function W_(e){return H_.has(rr(e))}const Z_=[":popover-open",":modal"];function rs(e){return Z_.some(t=>{try{return e.matches(t)}catch{return!1}})}const q_=["transform","translate","scale","rotate","perspective"],J_=["transform","translate","scale","rotate","perspective","filter"],K_=["paint","layout","strict","content"];function _a(e){const t=Sa(),n=Et(e)?Nt(e):e;return q_.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||J_.some(r=>(n.willChange||"").includes(r))||K_.some(r=>(n.contain||"").includes(r))}function G_(e){let t=an(e);for(;Lt(t)&&!Gn(t);){if(_a(t))return t;if(rs(t))return null;t=an(t)}return null}function Sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Y_=new Set(["html","body","#document"]);function Gn(e){return Y_.has(rr(e))}function Nt(e){return gt(e).getComputedStyle(e)}function os(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ac(e)&&e.host||$t(e);return ac(t)?t.host:t}function Kf(e){const t=an(e);return Gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Fr(t)?t:Kf(t)}function Ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Kf(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=gt(o);if(s){const a=yi(i);return t.concat(i,i.visualViewport||[],Fr(o)?o:[],a&&n?Ar(a):[])}return t.concat(o,Ar(o,[],n))}function yi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gf(e){const t=Nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Io(n)!==s||Io(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ca(e){return Et(e)?e:e.contextElement}function Un(e){const t=Ca(e);if(!Lt(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Gf(t);let i=(s?Io(n.width):n.width)/r,a=(s?Io(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const X_=Mt(0);function Yf(e){const t=gt(e);return!Sa()||!t.visualViewport?X_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Q_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ca(e);let i=Mt(1);t&&(r?Et(r)&&(i=Un(r)):i=Un(e));const a=Q_(s,n,r)?Yf(s):Mt(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=gt(s),h=r&&Et(r)?gt(r):r;let x=p,m=yi(x);for(;m&&r&&h!==x;){const g=Un(m),y=m.getBoundingClientRect(),v=Nt(m),k=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,S=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,f*=g.y,c+=k,u+=S,x=gt(m),m=yi(x)}}return Ro({width:d,height:f,x:c,y:u})}function ss(e,t){const n=os(e).scrollLeft;return t?t.left+n:wn($t(e)).left+n}function Xf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ss(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function eS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=$t(r),a=t?rs(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mt(1);const d=Mt(0),f=Lt(r);if((f||!f&&!s)&&((rr(r)!=="body"||Fr(i))&&(c=os(r)),Lt(r))){const h=wn(r);u=Un(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?Xf(i,c):Mt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function tS(e){return Array.from(e.getClientRects())}function nS(e){const t=$t(e),n=os(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ss(e);const a=-n.scrollTop;return Nt(r).direction==="rtl"&&(i+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const lc=25;function rS(e,t){const n=gt(e),r=$t(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Sa();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ss(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-h);x<=lc&&(s-=x)}else u<=lc&&(s+=u);return{width:s,height:i,x:a,y:c}}const oS=new Set(["absolute","fixed"]);function sS(e,t){const n=wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Lt(e)?Un(e):Mt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function cc(e,t,n){let r;if(t==="viewport")r=rS(e,n);else if(t==="document")r=nS($t(e));else if(Et(t))r=sS(t,n);else{const o=Yf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ro(r)}function Qf(e,t){const n=an(e);return n===t||!Et(n)||Gn(n)?!1:Nt(n).position==="fixed"||Qf(n,t)}function iS(e,t){const n=t.get(e);if(n)return n;let r=Ar(e,[],!1).filter(a=>Et(a)&&rr(a)!=="body"),o=null;const s=Nt(e).position==="fixed";let i=s?an(e):e;for(;Et(i)&&!Gn(i);){const a=Nt(i),c=_a(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&oS.has(o.position)||Fr(i)&&!c&&Qf(e,i))?r=r.filter(d=>d!==i):o=a,i=an(i)}return t.set(e,r),r}function aS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?rs(t)?[]:iS(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,d)=>{const f=cc(t,d,o);return u.top=pt(f.top,u.top),u.right=sn(f.right,u.right),u.bottom=sn(f.bottom,u.bottom),u.left=pt(f.left,u.left),u},cc(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lS(e){const{width:t,height:n}=Gf(e);return{width:t,height:n}}function cS(e,t,n){const r=Lt(t),o=$t(t),s=n==="fixed",i=wn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Mt(0);function u(){c.x=ss(o)}if(r||!r&&!s)if((rr(t)!=="body"||Fr(o))&&(a=os(t)),r){const h=wn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Xf(o,a):Mt(0),f=i.left+a.scrollLeft-c.x-d.x,p=i.top+a.scrollTop-c.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Rs(e){return Nt(e).position==="static"}function uc(e,t){if(!Lt(e)||Nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $t(e)===n&&(n=n.ownerDocument.body),n}function eh(e,t){const n=gt(e);if(rs(e))return n;if(!Lt(e)){let o=an(e);for(;o&&!Gn(o);){if(Et(o)&&!Rs(o))return o;o=an(o)}return n}let r=uc(e,t);for(;r&&W_(r)&&Rs(r);)r=uc(r,t);return r&&Gn(r)&&Rs(r)&&!_a(r)?n:r||G_(e)||n}const uS=async function(e){const t=this.getOffsetParent||eh,n=this.getDimensions,r=await n(e.floating);return{reference:cS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dS(e){return Nt(e).direction==="rtl"}const fS={convertOffsetParentRelativeRectToViewportRelativeRect:eS,getDocumentElement:$t,getClippingRect:aS,getOffsetParent:eh,getElementRects:uS,getClientRects:tS,getDimensions:lS,getScale:Un,isElement:Et,isRTL:dS};function th(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hS(e,t){let n=null,r;const o=$t(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(a||t(),!p||!h)return;const x=oo(f),m=oo(o.clientWidth-(d+p)),g=oo(o.clientHeight-(f+h)),y=oo(d),k={rootMargin:-x+"px "+-m+"px "+-g+"px "+-y+"px",threshold:pt(0,sn(1,c))||1};let S=!0;function C(j){const N=j[0].intersectionRatio;if(N!==c){if(!S)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!th(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,k)}n.observe(e)}return i(!0),s}function pS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Ca(e),d=o||s?[...u?Ar(u):[],...Ar(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&a?hS(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=h)==null||k.observe(t)})),n()}),u&&!c&&h.observe(u),h.observe(t));let x,m=c?wn(e):null;c&&g();function g(){const y=wn(e);m&&!th(m,y)&&n(),m=y,x=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(x)}}const mS=F_,gS=$_,xS=M_,yS=U_,bS=L_,dc=O_,vS=B_,wS=(e,t,n)=>{const r=new Map,o={platform:fS,...n},s={...o.platform,_c:r};return P_(e,t,{...o,platform:s})};var kS=typeof document<"u",_S=function(){},bo=kS?b.useLayoutEffect:_S;function Po(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,o;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(!Po(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Po(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function nh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fc(e,t){const n=nh(e);return Math.round(t*n)/n}function Ps(e){const t=b.useRef(e);return bo(()=>{t.current=e}),t}function SS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=b.useState(r);Po(p,r)||h(r);const[x,m]=b.useState(null),[g,y]=b.useState(null),v=b.useCallback(U=>{U!==j.current&&(j.current=U,m(U))},[]),k=b.useCallback(U=>{U!==N.current&&(N.current=U,y(U))},[]),S=s||x,C=i||g,j=b.useRef(null),N=b.useRef(null),T=b.useRef(d),I=c!=null,O=Ps(c),F=Ps(o),E=Ps(u),L=b.useCallback(()=>{if(!j.current||!N.current)return;const U={placement:t,strategy:n,middleware:p};F.current&&(U.platform=F.current),wS(j.current,N.current,U).then(G=>{const A={...G,isPositioned:E.current!==!1};w.current&&!Po(T.current,A)&&(T.current=A,Mr.flushSync(()=>{f(A)}))})},[p,t,n,F,E]);bo(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[u]);const w=b.useRef(!1);bo(()=>(w.current=!0,()=>{w.current=!1}),[]),bo(()=>{if(S&&(j.current=S),C&&(N.current=C),S&&C){if(O.current)return O.current(S,C,L);L()}},[S,C,L,O,I]);const M=b.useMemo(()=>({reference:j,floating:N,setReference:v,setFloating:k}),[v,k]),B=b.useMemo(()=>({reference:S,floating:C}),[S,C]),D=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!B.floating)return U;const G=fc(B.floating,d.x),A=fc(B.floating,d.y);return a?{...U,transform:"translate("+G+"px, "+A+"px)",...nh(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:A}},[n,a,B.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:L,refs:M,elements:B,floatingStyles:D}),[d,L,M,B,D])}const CS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dc({element:r.current,padding:o}).fn(n):{}:r?dc({element:r,padding:o}).fn(n):{}}}},jS=(e,t)=>({...mS(e),options:[e,t]}),ES=(e,t)=>({...gS(e),options:[e,t]}),NS=(e,t)=>({...vS(e),options:[e,t]}),TS=(e,t)=>({...xS(e),options:[e,t]}),AS=(e,t)=>({...yS(e),options:[e,t]}),IS=(e,t)=>({...bS(e),options:[e,t]}),zS=(e,t)=>({...CS(e),options:[e,t]});var RS="Arrow",rh=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Ne.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});rh.displayName=RS;var PS=rh,ja="Popper",[oh,is]=Xt(ja),[OS,sh]=oh(ja),ih=e=>{const{__scopePopper:t,children:n}=e,[r,o]=b.useState(null);return l.jsx(OS,{scope:t,anchor:r,onAnchorChange:o,children:n})};ih.displayName=ja;var ah="PopperAnchor",lh=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=sh(ah,n),i=b.useRef(null),a=Le(t,i),c=b.useRef(null);return b.useEffect(()=>{const u=c.current;c.current=r?.current||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Ne.div,{...o,ref:a})});lh.displayName=ah;var Ea="PopperContent",[MS,LS]=oh(Ea),ch=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:x,...m}=e,g=sh(Ea,n),[y,v]=b.useState(null),k=Le(t,ae=>v(ae)),[S,C]=b.useState(null),j=w_(S),N=j?.width??0,T=j?.height??0,I=r+(s!=="center"?"-"+s:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(u)?u:[u],E=F.length>0,L={padding:O,boundary:F.filter(FS),altBoundary:E},{refs:w,floatingStyles:M,placement:B,isPositioned:D,middlewareData:U}=SS({strategy:"fixed",placement:I,whileElementsMounted:(...ae)=>pS(...ae,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[jS({mainAxis:o+T,alignmentAxis:i}),c&&ES({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?NS():void 0,...L}),c&&TS({...L}),AS({...L,apply:({elements:ae,rects:ue,availableWidth:fe,availableHeight:he})=>{const{width:ye,height:je}=ue.reference,ze=ae.floating.style;ze.setProperty("--radix-popper-available-width",`${fe}px`),ze.setProperty("--radix-popper-available-height",`${he}px`),ze.setProperty("--radix-popper-anchor-width",`${ye}px`),ze.setProperty("--radix-popper-anchor-height",`${je}px`)}}),S&&zS({element:S,padding:a}),$S({arrowWidth:N,arrowHeight:T}),p&&IS({strategy:"referenceHidden",...L})]}),[G,A]=fh(B),H=st(x);tt(()=>{D&&H?.()},[D,H]);const J=U.arrow?.x,R=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[Q,de]=b.useState();return tt(()=>{y&&de(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(MS,{scope:n,placedSide:G,onArrowChange:C,arrowX:J,arrowY:R,shouldHideArrow:ee,children:l.jsx(Ne.div,{"data-side":G,"data-align":A,...m,ref:k,style:{...m.style,animation:D?void 0:"none"}})})})});ch.displayName=Ea;var uh="PopperArrow",DS={top:"bottom",right:"left",bottom:"top",left:"right"},dh=b.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=LS(uh,r),i=DS[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(PS,{...o,ref:n,style:{...o.style,display:"block"}})})});dh.displayName=uh;function FS(e){return e!==null}var $S=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=fh(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let x="",m="";return u==="bottom"?(x=i?f:`${p}px`,m=`${-c}px`):u==="top"?(x=i?f:`${p}px`,m=`${r.floating.height+c}px`):u==="right"?(x=`${-c}px`,m=i?f:`${h}px`):u==="left"&&(x=`${r.floating.width+c}px`,m=i?f:`${h}px`),{data:{x,y:m}}}});function fh(e){const[t,n="center"]=e.split("-");return[t,n]}var hh=ih,ph=lh,mh=ch,gh=dh,Os="rovingFocusGroup.onEntryFocus",BS={bubbles:!1,cancelable:!0},$r="RovingFocusGroup",[bi,xh,US]=hf($r),[VS,yh]=Xt($r,[US]),[HS,WS]=VS($r),bh=b.forwardRef((e,t)=>l.jsx(bi.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(bi.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ZS,{...e,ref:t})})}));bh.displayName=$r;var ZS=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=b.useRef(null),h=Le(t,p),x=Yo(s),[m,g]=bn({prop:i,defaultProp:a??null,onChange:c,caller:$r}),[y,v]=b.useState(!1),k=st(u),S=xh(n),C=b.useRef(!1),[j,N]=b.useState(0);return b.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Os,k),()=>T.removeEventListener(Os,k)},[k]),l.jsx(HS,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:b.useCallback(T=>g(T),[g]),onItemShiftTab:b.useCallback(()=>v(!0),[]),onFocusableItemAdd:b.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:b.useCallback(()=>N(T=>T-1),[]),children:l.jsx(Ne.div,{tabIndex:y||j===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{C.current=!0}),onFocus:ke(e.onFocus,T=>{const I=!C.current;if(T.target===T.currentTarget&&I&&!y){const O=new CustomEvent(Os,BS);if(T.currentTarget.dispatchEvent(O),!O.defaultPrevented){const F=S().filter(B=>B.focusable),E=F.find(B=>B.active),L=F.find(B=>B.id===m),M=[E,L,...F].filter(Boolean).map(B=>B.ref.current);kh(M,d)}}C.current=!1}),onBlur:ke(e.onBlur,()=>v(!1))})})}),vh="RovingFocusGroupItem",wh=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Ot(),u=s||c,d=WS(vh,n),f=d.currentTabStopId===u,p=xh(n),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return h(),()=>x()},[r,h,x]),l.jsx(bi.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Ne.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ke(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ke(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=KS(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")k.reverse();else if(y==="prev"||y==="next"){y==="prev"&&k.reverse();const S=k.indexOf(g.currentTarget);k=d.loop?GS(k,S+1):k.slice(S+1)}setTimeout(()=>kh(k))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});wh.displayName=vh;var qS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function JS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function KS(e,t,n){const r=JS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qS[r]}function kh(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function GS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YS=bh,XS=wh;function vi(e,[t,n]){return Math.min(n,Math.max(t,e))}function QS(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Na="ScrollArea",[_h]=Xt(Na),[eC,vt]=_h(Na),Sh=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(null),[h,x]=b.useState(null),[m,g]=b.useState(null),[y,v]=b.useState(0),[k,S]=b.useState(0),[C,j]=b.useState(!1),[N,T]=b.useState(!1),I=Le(t,F=>c(F)),O=Yo(o);return l.jsx(eC,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:N,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:S,children:l.jsx(Ne.div,{dir:O,...i,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Sh.displayName=Na;var Ch="ScrollAreaViewport",jh=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=vt(Ch,n),a=b.useRef(null),c=Le(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});jh.displayName=Ch;var Bt="ScrollAreaScrollbar",Eh=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return b.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?l.jsx(tC,{...r,ref:t,forceMount:n}):o.type==="scroll"?l.jsx(nC,{...r,ref:t,forceMount:n}):o.type==="auto"?l.jsx(Nh,{...r,ref:t,forceMount:n}):o.type==="always"?l.jsx(Ta,{...r,ref:t}):null});Eh.displayName=Bt;var tC=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),[s,i]=b.useState(!1);return b.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),l.jsx(bt,{present:n||s,children:l.jsx(Nh,{"data-state":s?"visible":"hidden",...r,ref:t})})}),nC=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vt(Bt,e.__scopeScrollArea),s=e.orientation==="horizontal",i=ls(()=>c("SCROLL_END"),100),[a,c]=QS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,c]),b.useEffect(()=>{const u=o.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(c("SCROLL"),i()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,s,c,i]),l.jsx(bt,{present:n||a!=="hidden",children:l.jsx(Ta,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Nh=b.forwardRef((e,t)=>{const n=vt(Bt,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=b.useState(!1),a=e.orientation==="horizontal",c=ls(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?u:d)}},10);return Yn(n.viewport,c),Yn(n.content,c),l.jsx(bt,{present:r||s,children:l.jsx(Ta,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ta=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=vt(Bt,e.__scopeScrollArea),s=b.useRef(null),i=b.useRef(0),[a,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Rh(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,h){return lC(p,i.current,a,h)}return n==="horizontal"?l.jsx(rC,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,h=hc(p,a,o.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?l.jsx(oC,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,h=hc(p,a);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),rC=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vt(Bt,e.__scopeScrollArea),[i,a]=b.useState(),c=b.useRef(null),u=Le(t,c,s.onScrollbarXChange);return b.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(Ah,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":as(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Oh(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Mo(i.paddingLeft),paddingEnd:Mo(i.paddingRight)}})}})}),oC=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vt(Bt,e.__scopeScrollArea),[i,a]=b.useState(),c=b.useRef(null),u=Le(t,c,s.onScrollbarYChange);return b.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(Ah,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":as(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Oh(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Mo(i.paddingTop),paddingEnd:Mo(i.paddingBottom)}})}})}),[sC,Th]=_h(Bt),Ah=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=vt(Bt,n),[x,m]=b.useState(null),g=Le(t,I=>m(I)),y=b.useRef(null),v=b.useRef(""),k=h.viewport,S=r.content-r.viewport,C=st(d),j=st(c),N=ls(f,10);function T(I){if(y.current){const O=I.clientX-y.current.left,F=I.clientY-y.current.top;u({x:O,y:F})}}return b.useEffect(()=>{const I=O=>{const F=O.target;x?.contains(F)&&C(O,S)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[k,x,S,C]),b.useEffect(j,[r,j]),Yn(x,N),Yn(h.content,N),l.jsx(sC,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:st(s),onThumbPointerUp:st(i),onThumbPositionChange:j,onThumbPointerDown:st(a),children:l.jsx(Ne.div,{...p,ref:g,style:{position:"absolute",...p.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),y.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(I))}),onPointerMove:ke(e.onPointerMove,T),onPointerUp:ke(e.onPointerUp,I=>{const O=I.target;O.hasPointerCapture(I.pointerId)&&O.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),Oo="ScrollAreaThumb",Ih=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Th(Oo,e.__scopeScrollArea);return l.jsx(bt,{present:n||o.hasThumb,children:l.jsx(iC,{ref:t,...r})})}),iC=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=vt(Oo,n),i=Th(Oo,n),{onThumbPositionChange:a}=i,c=Le(t,f=>i.onThumbChange(f)),u=b.useRef(void 0),d=ls(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(d(),!u.current){const h=cC(f,a);u.current=h,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,d,a]),l.jsx(Ne.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),x=f.clientX-h.left,m=f.clientY-h.top;i.onThumbPointerDown({x,y:m})}),onPointerUp:ke(e.onPointerUp,i.onThumbPointerUp)})});Ih.displayName=Oo;var Aa="ScrollAreaCorner",zh=b.forwardRef((e,t)=>{const n=vt(Aa,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(aC,{...e,ref:t}):null});zh.displayName=Aa;var aC=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=vt(Aa,n),[s,i]=b.useState(0),[a,c]=b.useState(0),u=!!(s&&a);return Yn(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),c(d)}),Yn(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),i(d)}),u?l.jsx(Ne.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mo(e){return e?parseInt(e,10):0}function Rh(e,t){const n=e/t;return isNaN(n)?0:n}function as(e){const t=Rh(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function lC(e,t,n,r="ltr"){const o=as(n),s=o/2,i=t||s,a=o-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Ph([c,u],f)(e)}function hc(e,t,n="ltr"){const r=as(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,c=n==="ltr"?[0,i]:[i*-1,0],u=vi(e,c);return Ph([0,i],[0,a])(u)}function Ph(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Oh(e,t){return e>0&&e<t}var cC=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function ls(e,t){const n=st(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Yn(e,t){const n=st(t);tt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var uC=Sh,dC=jh,fC=zh,hC=[" ","Enter","ArrowUp","ArrowDown"],pC=[" ","Enter"],kn="Select",[cs,us,mC]=hf(kn),[or]=Xt(kn,[mC,is]),ds=is(),[gC,dn]=or(kn),[xC,yC]=or(kn),Mh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:x}=e,m=ds(t),[g,y]=b.useState(null),[v,k]=b.useState(null),[S,C]=b.useState(!1),j=Yo(u),[N,T]=bn({prop:r,defaultProp:o??!1,onChange:s,caller:kn}),[I,O]=bn({prop:i,defaultProp:a,onChange:c,caller:kn}),F=b.useRef(null),E=g?x||!!g.closest("form"):!0,[L,w]=b.useState(new Set),M=Array.from(L).map(B=>B.props.value).join(";");return l.jsx(hh,{...m,children:l.jsxs(gC,{required:h,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ot(),value:I,onValueChange:O,open:N,onOpenChange:T,dir:j,triggerPointerDownPosRef:F,disabled:p,children:[l.jsx(cs.Provider,{scope:t,children:l.jsx(xC,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(B=>{w(D=>new Set(D).add(B))},[]),onNativeOptionRemove:b.useCallback(B=>{w(D=>{const U=new Set(D);return U.delete(B),U})},[]),children:n})}),E?l.jsxs(op,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:B=>O(B.target.value),disabled:p,form:x,children:[I===void 0?l.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Mh.displayName=kn;var Lh="SelectTrigger",Dh=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ds(n),i=dn(Lh,n),a=i.disabled||r,c=Le(t,i.onTriggerChange),u=us(n),d=b.useRef("touch"),[f,p,h]=ip(m=>{const g=u().filter(k=>!k.disabled),y=g.find(k=>k.value===i.value),v=ap(g,m,y);v!==void 0&&i.onValueChange(v.value)}),x=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(ph,{asChild:!0,...s,children:l.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":sp(i.value)?"":void 0,...o,ref:c,onClick:ke(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&x(m)}),onPointerDown:ke(o.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:ke(o.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&hC.includes(m.key)&&(x(),m.preventDefault())})})})});Dh.displayName=Lh;var Fh="SelectValue",$h=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=dn(Fh,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=Le(t,c.onValueNodeChange);return tt(()=>{u(d)},[u,d]),l.jsx(Ne.span,{...a,ref:f,style:{pointerEvents:"none"},children:sp(c.value)?l.jsx(l.Fragment,{children:i}):s})});$h.displayName=Fh;var bC="SelectIcon",Bh=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Bh.displayName=bC;var vC="SelectPortal",Uh=e=>l.jsx(Qo,{asChild:!0,...e});Uh.displayName=vC;var _n="SelectContent",Vh=b.forwardRef((e,t)=>{const n=dn(_n,e.__scopeSelect),[r,o]=b.useState();if(tt(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Mr.createPortal(l.jsx(Hh,{scope:e.__scopeSelect,children:l.jsx(cs.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(Wh,{...e,ref:t})});Vh.displayName=_n;var _t=10,[Hh,fn]=or(_n),wC="SelectContentImpl",kC=Kn("SelectContent.RemoveScroll"),Wh=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g,...y}=e,v=dn(_n,n),[k,S]=b.useState(null),[C,j]=b.useState(null),N=Le(t,ae=>S(ae)),[T,I]=b.useState(null),[O,F]=b.useState(null),E=us(n),[L,w]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(k)return Af(k)},[k]),wf();const B=b.useCallback(ae=>{const[ue,...fe]=E().map(je=>je.ref.current),[he]=fe.slice(-1),ye=document.activeElement;for(const je of ae)if(je===ye||(je?.scrollIntoView({block:"nearest"}),je===ue&&C&&(C.scrollTop=0),je===he&&C&&(C.scrollTop=C.scrollHeight),je?.focus(),document.activeElement!==ye))return},[E,C]),D=b.useCallback(()=>B([T,k]),[B,T,k]);b.useEffect(()=>{L&&D()},[L,D]);const{onOpenChange:U,triggerPointerDownPosRef:G}=v;b.useEffect(()=>{if(k){let ae={x:0,y:0};const ue=he=>{ae={x:Math.abs(Math.round(he.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(he.pageY)-(G.current?.y??0))}},fe=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():k.contains(he.target)||U(!1),document.removeEventListener("pointermove",ue),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",fe,{capture:!0})}}},[k,U,G]),b.useEffect(()=>{const ae=()=>U(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[U]);const[A,H]=ip(ae=>{const ue=E().filter(ye=>!ye.disabled),fe=ue.find(ye=>ye.ref.current===document.activeElement),he=ap(ue,ae,fe);he&&setTimeout(()=>he.ref.current.focus())}),J=b.useCallback((ae,ue,fe)=>{const he=!M.current&&!fe;(v.value!==void 0&&v.value===ue||he)&&(I(ae),he&&(M.current=!0))},[v.value]),R=b.useCallback(()=>k?.focus(),[k]),ee=b.useCallback((ae,ue,fe)=>{const he=!M.current&&!fe;(v.value!==void 0&&v.value===ue||he)&&F(ae)},[v.value]),Q=r==="popper"?wi:Zh,de=Q===wi?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g}:{};return l.jsx(Hh,{scope:n,content:k,viewport:C,onViewportChange:j,itemRefCallback:J,selectedItem:T,onItemLeave:R,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:O,position:r,isPositioned:L,searchRef:A,children:l.jsx(ga,{as:kC,allowPinchZoom:!0,children:l.jsx(ma,{asChild:!0,trapped:v.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:ke(o,ae=>{v.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:l.jsx(Xo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ae=>ae.preventDefault(),...y,...de,onPlaced:()=>w(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ke(y.onKeyDown,ae=>{const ue=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ue&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=E().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ye=ae.target,je=he.indexOf(ye);he=he.slice(je+1)}setTimeout(()=>B(he)),ae.preventDefault()}})})})})})})});Wh.displayName=wC;var _C="SelectItemAlignedPosition",Zh=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=dn(_n,n),i=fn(_n,n),[a,c]=b.useState(null),[u,d]=b.useState(null),f=Le(t,N=>d(N)),p=us(n),h=b.useRef(!1),x=b.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=i,k=b.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&g&&y){const N=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(s.dir!=="rtl"){const ye=O.left-T.left,je=I.left-ye,ze=N.left-je,_=N.width+ze,q=Math.max(_,T.width),W=window.innerWidth-_t,P=vi(je,[_t,Math.max(_t,W-q)]);a.style.minWidth=_+"px",a.style.left=P+"px"}else{const ye=T.right-O.right,je=window.innerWidth-I.right-ye,ze=window.innerWidth-N.right-je,_=N.width+ze,q=Math.max(_,T.width),W=window.innerWidth-_t,P=vi(je,[_t,Math.max(_t,W-q)]);a.style.minWidth=_+"px",a.style.right=P+"px"}const F=p(),E=window.innerHeight-_t*2,L=m.scrollHeight,w=window.getComputedStyle(u),M=parseInt(w.borderTopWidth,10),B=parseInt(w.paddingTop,10),D=parseInt(w.borderBottomWidth,10),U=parseInt(w.paddingBottom,10),G=M+B+L+U+D,A=Math.min(g.offsetHeight*5,G),H=window.getComputedStyle(m),J=parseInt(H.paddingTop,10),R=parseInt(H.paddingBottom,10),ee=N.top+N.height/2-_t,Q=E-ee,de=g.offsetHeight/2,ae=g.offsetTop+de,ue=M+B+ae,fe=G-ue;if(ue<=ee){const ye=F.length>0&&g===F[F.length-1].ref.current;a.style.bottom="0px";const je=u.clientHeight-m.offsetTop-m.offsetHeight,ze=Math.max(Q,de+(ye?R:0)+je+D),_=ue+ze;a.style.height=_+"px"}else{const ye=F.length>0&&g===F[0].ref.current;a.style.top="0px";const ze=Math.max(ee,M+m.offsetTop+(ye?J:0)+de)+fe;a.style.height=ze+"px",m.scrollTop=ue-ee+m.offsetTop}a.style.margin=`${_t}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,u,m,g,y,s.dir,r]);tt(()=>k(),[k]);const[S,C]=b.useState();tt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const j=b.useCallback(N=>{N&&x.current===!0&&(k(),v?.(),x.current=!1)},[k,v]);return l.jsx(CC,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Ne.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zh.displayName=_C;var SC="SelectPopperPosition",wi=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_t,...s}=e,i=ds(n);return l.jsx(mh,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wi.displayName=SC;var[CC,Ia]=or(_n,{}),ki="SelectViewport",qh=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=fn(ki,n),i=Ia(ki,n),a=Le(t,s.onViewportChange),c=b.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(cs.Slot,{scope:n,children:l.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p?.current&&f){const h=Math.abs(c.current-d.scrollTop);if(h>0){const x=window.innerHeight-_t*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),y=Math.max(m,g);if(y<x){const v=y+h,k=Math.min(x,v),S=v-k;f.style.height=k+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});qh.displayName=ki;var Jh="SelectGroup",[jC,EC]=or(Jh),NC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ot();return l.jsx(jC,{scope:n,id:o,children:l.jsx(Ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});NC.displayName=Jh;var Kh="SelectLabel",TC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=EC(Kh,n);return l.jsx(Ne.div,{id:o.id,...r,ref:t})});TC.displayName=Kh;var Lo="SelectItem",[AC,Gh]=or(Lo),Yh=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=dn(Lo,n),c=fn(Lo,n),u=a.value===r,[d,f]=b.useState(s??""),[p,h]=b.useState(!1),x=Le(t,v=>c.itemRefCallback?.(v,r,o)),m=Ot(),g=b.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(AC,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:b.useCallback(v=>{f(k=>k||(v?.textContent??"").trim())},[]),children:l.jsx(cs.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(Ne.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:ke(i.onFocus,()=>h(!0)),onBlur:ke(i.onBlur,()=>h(!1)),onClick:ke(i.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:ke(i.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:ke(i.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:ke(i.onPointerMove,v=>{g.current=v.pointerType,o?c.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ke(i.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(pC.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Yh.displayName=Lo;var br="SelectItemText",Xh=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=dn(br,n),a=fn(br,n),c=Gh(br,n),u=yC(br,n),[d,f]=b.useState(null),p=Le(t,y=>f(y),c.onItemTextChange,y=>a.itemTextRefCallback?.(y,c.value,c.disabled)),h=d?.textContent,x=b.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return tt(()=>(m(x),()=>g(x)),[m,g,x]),l.jsxs(l.Fragment,{children:[l.jsx(Ne.span,{id:c.textId,...s,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Mr.createPortal(s.children,i.valueNode):null]})});Xh.displayName=br;var Qh="SelectItemIndicator",ep=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Gh(Qh,n).isSelected?l.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});ep.displayName=Qh;var _i="SelectScrollUpButton",tp=b.forwardRef((e,t)=>{const n=fn(_i,e.__scopeSelect),r=Ia(_i,e.__scopeSelect),[o,s]=b.useState(!1),i=Le(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(rp,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});tp.displayName=_i;var Si="SelectScrollDownButton",np=b.forwardRef((e,t)=>{const n=fn(Si,e.__scopeSelect),r=Ia(Si,e.__scopeSelect),[o,s]=b.useState(!1),i=Le(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(rp,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});np.displayName=Si;var rp=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=fn("SelectScrollButton",n),i=b.useRef(null),a=us(n),c=b.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),tt(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),l.jsx(Ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ke(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{c()})})}),IC="SelectSeparator",zC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});zC.displayName=IC;var Ci="SelectArrow",RC=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ds(n),s=dn(Ci,n),i=fn(Ci,n);return s.open&&i.position==="popper"?l.jsx(gh,{...o,...r,ref:t}):null});RC.displayName=Ci;var PC="SelectBubbleInput",op=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=b.useRef(null),s=Le(r,o),i=v_(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Ne.select,{...n,style:{...df,...n.style},ref:s,defaultValue:t})});op.displayName=PC;function sp(e){return e===""||e===void 0}function ip(e){const t=st(e),n=b.useRef(""),r=b.useRef(0),o=b.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ap(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=OC(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function OC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var MC=Mh,LC=Dh,DC=$h,FC=Bh,$C=Uh,BC=Vh,UC=qh,VC=Yh,HC=Xh,WC=ep,ZC=tp,qC=np,fs="Tabs",[JC]=Xt(fs,[yh]),lp=yh(),[KC,za]=JC(fs),cp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Yo(a),[f,p]=bn({prop:r,onChange:o,defaultProp:s??"",caller:fs});return l.jsx(KC,{scope:n,baseId:Ot(),value:f,onValueChange:p,orientation:i,dir:d,activationMode:c,children:l.jsx(Ne.div,{dir:d,"data-orientation":i,...u,ref:t})})});cp.displayName=fs;var up="TabsList",dp=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=za(up,n),i=lp(n);return l.jsx(YS,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Ne.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});dp.displayName=up;var fp="TabsTrigger",hp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=za(fp,n),a=lp(n),c=gp(i.baseId,r),u=xp(i.baseId,r),d=r===i.value;return l.jsx(XS,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(Ne.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:ke(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:ke(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});hp.displayName=fp;var pp="TabsContent",mp=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=za(pp,n),c=gp(a.baseId,r),u=xp(a.baseId,r),d=r===a.value,f=b.useRef(d);return b.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(bt,{present:o||d,children:({present:p})=>l.jsx(Ne.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});mp.displayName=pp;function gp(e,t){return`${e}-trigger-${t}`}function xp(e,t){return`${e}-content-${t}`}var GC=cp,YC=dp,XC=hp,QC=mp,[hs]=Xt("Tooltip",[is]),ps=is(),yp="TooltipProvider",e5=700,ji="tooltip.open",[t5,Ra]=hs(yp),bp=e=>{const{__scopeTooltip:t,delayDuration:n=e5,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=b.useRef(!0),a=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(t5,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};bp.displayName=yp;var Ir="Tooltip",[n5,Br]=hs(Ir),vp=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ra(Ir,e.__scopeTooltip),u=ps(t),[d,f]=b.useState(null),p=Ot(),h=b.useRef(0),x=i??c.disableHoverableContent,m=a??c.delayDuration,g=b.useRef(!1),[y,v]=bn({prop:r,defaultProp:o??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(ji))):c.onClose(),s?.(N)},caller:Ir}),k=b.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),S=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,v(!0)},[v]),C=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v(!1)},[v]),j=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,v(!0),h.current=0},m)},[m,v]);return b.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),l.jsx(hh,{...u,children:l.jsx(n5,{scope:t,contentId:p,open:y,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:b.useCallback(()=>{x?C():(window.clearTimeout(h.current),h.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:n})})};vp.displayName=Ir;var Ei="TooltipTrigger",wp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(Ei,n),s=Ra(Ei,n),i=ps(n),a=b.useRef(null),c=Le(t,a,o.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(ph,{asChild:!0,...i,children:l.jsx(Ne.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:ke(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ke(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});wp.displayName=Ei;var Pa="TooltipPortal",[r5,o5]=hs(Pa,{forceMount:void 0}),kp=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Br(Pa,t);return l.jsx(r5,{scope:t,forceMount:n,children:l.jsx(bt,{present:n||s.open,children:l.jsx(Qo,{asChild:!0,container:o,children:r})})})};kp.displayName=Pa;var Xn="TooltipContent",_p=b.forwardRef((e,t)=>{const n=o5(Xn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Br(Xn,e.__scopeTooltip);return l.jsx(bt,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Sp,{side:o,...s,ref:t}):l.jsx(s5,{side:o,...s,ref:t})})}),s5=b.forwardRef((e,t)=>{const n=Br(Xn,e.__scopeTooltip),r=Ra(Xn,e.__scopeTooltip),o=b.useRef(null),s=Le(t,o),[i,a]=b.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{a(null),f(!1)},[f]),h=b.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},v=c5(y,g.getBoundingClientRect()),k=u5(y,v),S=d5(m.getBoundingClientRect()),C=h5([...k,...S]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(c&&d){const x=g=>h(g,d),m=g=>h(g,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",m)}}},[c,d,h,p]),b.useEffect(()=>{if(i){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},v=c?.contains(g)||d?.contains(g),k=!f5(y,i);v?p():k&&(p(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,p]),l.jsx(Sp,{...e,ref:s})}),[i5,a5]=hs(Ir,{isInside:!1}),l5=Rw("TooltipContent"),Sp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Br(Xn,n),u=ps(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(ji,d),()=>document.removeEventListener(ji,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=p=>{p.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Xo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(mh,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.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:[l.jsx(l5,{children:r}),l.jsx(i5,{scope:n,isInside:!0,children:l.jsx($w,{id:c.contentId,role:"tooltip",children:o||r})})]})})});_p.displayName=Xn;var Cp="TooltipArrow",jp=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ps(n);return a5(Cp,n).isInside?null:l.jsx(gh,{...o,...r,ref:t})});jp.displayName=Cp;function c5(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function u5(e,t,n=5){const 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 d5(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function f5(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,f=c.x,p=c.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function h5(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),p5(t)}function p5(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}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 m5=bp,g5=vp,x5=wp,y5=kp,b5=_p,v5=jp;const w5=da("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function jt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?Iw:"span";return l.jsx(o,{"data-slot":"badge","data-variant":t,className:be(w5({variant:t}),e),...r})}function Oa({...e}){return l.jsx(h_,{"data-slot":"dialog",...e})}function k5({...e}){return l.jsx(p_,{"data-slot":"dialog-trigger",...e})}function _5({...e}){return l.jsx(m_,{"data-slot":"dialog-portal",...e})}function S5({className:e,...t}){return l.jsx(g_,{"data-slot":"dialog-overlay",className:be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Ma({className:e,children:t,...n}){return l.jsxs(_5,{children:[l.jsx(S5,{}),l.jsxs(x_,{"data-slot":"dialog-content",className:be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,l.jsxs(b_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(la,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function La({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Da({className:e,...t}){return l.jsx(y_,{"data-slot":"dialog-title",className:be("text-lg font-semibold leading-none tracking-tight",e),...t})}const C5=da("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Re({className:e,variant:t,size:n,...r}){return l.jsx("button",{"data-slot":"button",className:be(C5({variant:t,size:n,className:e})),...r})}function Ep({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o="Confirm",variant:s="default",onConfirm:i}){return l.jsx(Oa,{open:e,onOpenChange:t,children:l.jsxs(Ma,{children:[l.jsx(La,{children:l.jsx(Da,{children:n})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx(Re,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Cancel"}),l.jsx(Re,{variant:s,size:"sm",onClick:()=>{i(),t(!1)},children:o})]})]})})}const j5={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function E5({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:s,apiFormat:i,expanded:a,onToggle:c,hideApiFormat:u=!1,isLoading:d=!1,userAgent:f,timeDisplayFormat:p,onClear:h}){const[x,m]=b.useState(!1),g=v=>{v.stopPropagation(),h!==void 0&&m(!0)},y=b.useCallback(v=>{v.stopPropagation(),window.open(rg(e),"_blank","noopener,noreferrer")},[e]);return l.jsxs("div",{role:"button",tabIndex:0,"data-nav-id":`conv-${e}`,"data-nav-action":a?"collapse":"expand",className:be("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-background sticky top-0 z-10","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-none"),onClick:c,onKeyDown:v=>{v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),c())},children:[a?l.jsx(Yt,{className:"size-4 text-muted-foreground shrink-0"}):d?l.jsx(Nr,{className:"size-4 animate-spin text-muted-foreground shrink-0"}):l.jsx(un,{className:"size-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.startsWith("PID:")||e.includes("|")?e:e.length>24?e.slice(0,12)+"..."+e.slice(-12):e}),f!=null&&f!==""&&l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:f,children:[l.jsx(x2,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",children:f})]}),!u&&l.jsx(jt,{variant:"outline",className:be("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",i==="openai"&&"border-blue-500/40 text-blue-400",i==="anthropic"&&"border-orange-500/40 text-orange-400",i==="unknown"&&"border-muted text-muted-foreground"),children:j5[i]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(on,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums",children:ca(t,n,p)})]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(Ko,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Tr,{className:"size-3 text-muted-foreground"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[l.jsx("span",{className:"text-blue-400",children:Ve(o)})," / ",l.jsx("span",{className:"text-amber-400",children:Ve(s)})]})]}),l.jsx("span",{className:"flex-1 min-w-0"}),l.jsx("button",{type:"button",onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&y(v)},"aria-label":`Open session ${e} in a new tab`,title:"Open this session in a new tab",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 inline-flex items-center justify-center size-8 rounded hover:bg-muted cursor-pointer",children:l.jsx($d,{className:"size-3.5"})}),h!==void 0&&l.jsx("button",{type:"button",onClick:g,"aria-label":`Clear group (${r} request${r!==1?"s":""})`,title:"Clear this group",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 inline-flex items-center justify-center size-8 rounded hover:bg-muted cursor-pointer",children:l.jsx(Hd,{className:"size-3.5"})}),l.jsx(Ep,{open:x,onOpenChange:m,title:"Clear this group?",description:`This will remove ${r} request${r!==1?"s":""} from this conversation. This action cannot be undone.`,confirmLabel:"Clear",variant:"destructive",onConfirm:()=>{h?.()}})]})}function N5(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function T5(e){let t=!1,n=!1;for(const r of e)if(r.apiFormat==="anthropic"?t=!0:r.apiFormat==="openai"&&(n=!0),t&&n)return!0;return!1}function A5(e){if(e.isTest===!0)return"provider-test";if(e.sessionId!==null&&e.sessionId!==""&&e.sessionId!==void 0)return e.sessionId;const t=e.clientPid!==null&&e.clientPid!==void 0,n=e.clientProjectFolder!==null&&e.clientProjectFolder!==void 0;if(!t&&!n)return"default";const r=t?`PID:${e.clientPid}`:"unknown",o=n?e.clientProjectFolder:"no-folder";return`${r}|${o}`}function I5(e){const t=new Map;for(const r of e){const o=A5(r),s=t.get(o);s!==void 0?s.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const s=[...o].sort((i,a)=>i.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:s})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}function pc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function z5(e){if(e.responseText===null)return null;try{let t=JSON.parse(e.responseText);return typeof t=="string"&&(t=JSON.parse(t)),pc(t)?typeof t.stop_reason=="string"?t.stop_reason==="end_turn"||t.stop_reason==="tool_use"?t.stop_reason:null:Array.isArray(t.choices)&&t.choices.length>0&&pc(t.choices[0])&&typeof t.choices[0].finish_reason=="string"&&t.choices[0].finish_reason==="stop"?"stop":null:null}catch{return null}}function Np(e){return e==="end_turn"||e==="stop"}function wt({className:e,style:t,d:n,eyeStalks:r,eyes:o,legs:s,extras:i}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:t,className:be("inline-block size-5",e),children:[l.jsx("path",{d:n}),r,o,s,i]})}const hn=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),l.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),l.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),l.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]}),Tp=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"16",x2:"5.5",y2:"18.5"}),l.jsx("line",{x1:"9.5",y1:"17",x2:"8.5",y2:"19.5"}),l.jsx("line",{x1:"14.5",y1:"17",x2:"15.5",y2:"19.5"}),l.jsx("line",{x1:"17",y1:"16",x2:"18.5",y2:"18.5"})]});function Ap({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function R5({className:e}){return l.jsx(wt,{className:e,d:"M4 13 C4 7 7.5 5.5 12 5.5 C16.5 5.5 20 7 20 13 C20 17.5 16.5 19 12 19 C7.5 19 4 17.5 4 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"6.5",x2:"9.5",y2:"4.5"}),l.jsx("line",{x1:"14.5",y1:"6.5",x2:"14.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"})]}),legs:Tp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C4 9.5 2.5 10 3 12 C3.5 13.5 4.5 13 5 12"}),l.jsx("path",{d:"M19 11 C20 9.5 21.5 10 21 12 C20.5 13.5 19.5 13 19 12"})]})})}function P5({className:e}){return l.jsx(wt,{className:e,d:"M3 13.5 C3 8 7 6 12 6 C17 6 21 8 21 13.5 C21 17 17 19 12 19 C7 19 3 17 3 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"7",x2:"6.5",y2:"4.5"}),l.jsx("line",{x1:"17",y1:"7",x2:"17.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"6.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"17.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M4 12 C2.5 10.5 1 11 1.5 13 C2 14.5 3.5 14 4.5 13"}),l.jsx("path",{d:"M20 12 C21.5 10.5 23 11 22.5 13 C22 14.5 20.5 14 19.5 13"})]})})}function O5({className:e}){return l.jsx(wt,{className:e,d:"M6 14 C6 8 9 5.5 12 5.5 C15 5.5 18 8 18 14 C18 18 15 20 12 20 C9 20 6 18 6 14 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"6.5",x2:"10",y2:"3.5"}),l.jsx("line",{x1:"14",y1:"6.5",x2:"14",y2:"3.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"17",x2:"5",y2:"20.5"}),l.jsx("line",{x1:"9.5",y1:"18.5",x2:"8.5",y2:"21.5"}),l.jsx("line",{x1:"14.5",y1:"18.5",x2:"15.5",y2:"21.5"}),l.jsx("line",{x1:"17",y1:"17",x2:"19",y2:"20.5"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6.5 11 C5 8.5 3 9 3.5 11.5 C4 13.5 5 13 6 12"}),l.jsx("path",{d:"M17.5 11 C19 8.5 21 9 20.5 11.5 C20 13.5 19 13 18 12"})]})})}function M5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 L13 4 L14 7 C16 7 19 9 19 13 C19 16 16 18 13 18 L12 21 L11 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function L5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("line",{x1:"13.5",y1:"4",x2:"15.5",y2:"5"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function D5({className:e}){return l.jsx(wt,{className:e,d:"M5.5 13.5 C5.5 10 8.5 8 12 8 C15.5 8 18.5 10 18.5 13.5 C18.5 16 15.5 17.5 12 17.5 C8.5 17.5 5.5 16 5.5 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"6"}),l.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"6"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9",y1:"6",x2:"11",y2:"6.5"}),l.jsx("line",{x1:"13",y1:"6",x2:"15",y2:"6.5"})]}),legs:Tp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6 11.5 C4.5 10.5 3 11 3.5 12.5 C4 13.5 5 13 5.5 12.5"}),l.jsx("path",{d:"M18 11.5 C19.5 10.5 21 11 20.5 12.5 C20 13.5 19 13 18.5 12.5"})]})})}function F5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("line",{x1:"8.5",y1:"4",x2:"10.5",y2:"4.5"}),l.jsx("line",{x1:"15.5",y1:"4",x2:"13.5",y2:"4.5"}),l.jsx("path",{d:"M9 15.5 C10 14.5 14 14.5 15 15.5"})]})})}function $5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("ellipse",{cx:"12",cy:"15",rx:"2",ry:"1.5",fill:"currentColor",stroke:"none"})]})})}function B5({className:e}){return l.jsx(wt,{className:e,d:"M4.5 13 C4.5 8 7.5 6 12 6 C16.5 6 19.5 8 19.5 13 C19.5 17 16.5 18.5 12 18.5 C7.5 18.5 4.5 17 4.5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"7",x2:"9",y2:"5"}),l.jsx("line",{x1:"14.5",y1:"7",x2:"15",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"15",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9 2 9.5 2.5 12 C3 14 4 13 5 12"}),l.jsx("path",{d:"M19 11 C20.5 9 22 9.5 21.5 12 C21 14 20 13 19 12"}),l.jsx("path",{d:"M9 14.5 C10 16 14 16 15 14.5"}),l.jsx("circle",{cx:"7",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"}),l.jsx("circle",{cx:"17",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"})]})})}function U5({className:e}){return l.jsx(wt,{className:e,d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5.5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7.5",y1:"5.5",x2:"16.5",y2:"5.5"}),l.jsx("rect",{x:"7",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"}),l.jsx("rect",{x:"13",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"})]}),legs:hn,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("path",{d:"M9.5 15 C10.5 16 13.5 16 14.5 15"})]})})}function V5({className:e}){return l.jsx(wt,{className:e,d:"M7 13.5 C7 10.5 9.5 9 12 9 C14.5 9 17 10.5 17 13.5 C17 16 14.5 17.5 12 17.5 C9.5 17.5 7 16 7 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10.5",y1:"9.5",x2:"10.5",y2:"8"}),l.jsx("line",{x1:"13.5",y1:"9.5",x2:"13.5",y2:"8"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"13.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"8",y1:"16",x2:"6.5",y2:"18"}),l.jsx("line",{x1:"10",y1:"17",x2:"9.5",y2:"19"}),l.jsx("line",{x1:"14",y1:"17",x2:"14.5",y2:"19"}),l.jsx("line",{x1:"16",y1:"16",x2:"17.5",y2:"18"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M7.5 12 C6.5 11 5.5 11.5 6 13 C6.5 14 7 13.5 7.5 13"}),l.jsx("path",{d:"M16.5 12 C17.5 11 18.5 11.5 18 13 C17.5 14 17 13.5 16.5 13"})]})})}const zr=[Ap,R5,P5,O5,M5,L5,D5,F5,$5,B5,U5,V5];function Do(e){return zr[Math.abs(e)%zr.length]??Ap}function H5(e){const t=zr.length-2;return t<=0?0:1+((Number.isFinite(e)?Math.trunc(e):0)%t+t)%t}function W5(e){return Do(H5(e))}const Z5="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",q5="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",J5="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",K5="/assets/minimax-BPMzvuL-.jpeg",G5="/assets/alibaba-TTwafVwX.svg",Y5="/assets/qwen-CONDcHqt.png",X5="/assets/zhipuai-BPNAnxo-.svg",Q5={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function Ip(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(Q5))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const En={width:24,height:24,objectFit:"contain"},ej=at.memo(({className:e})=>l.jsx("img",{src:Z5,alt:"Anthropic",className:e,style:En})),tj=at.memo(({className:e})=>l.jsx("img",{src:q5,alt:"OpenAI",className:e,style:{...En,background:"white",borderRadius:"4px"}})),nj=at.memo(({className:e})=>l.jsx("img",{src:J5,alt:"DeepSeek",className:e,style:En})),rj=at.memo(({className:e})=>l.jsx("img",{src:K5,alt:"MiniMax",className:e,style:En})),oj=at.memo(({className:e})=>l.jsx("img",{src:G5,alt:"Alibaba",className:e,style:En})),sj=at.memo(({className:e})=>l.jsx("img",{src:Y5,alt:"Qwen",className:e,style:En})),ij=at.memo(({className:e})=>l.jsx("img",{src:X5,alt:"ZhipuAI",className:e,style:En}));function zp({provider:e,className:t}){switch(e){case"anthropic":return l.jsx(ej,{className:t});case"openai":return l.jsx(tj,{className:t});case"deepseek":return l.jsx(nj,{className:t});case"minimax":return l.jsx(rj,{className:t});case"alibaba":return l.jsx(oj,{className:t});case"qwen":return l.jsx(sj,{className:t});case"zhipuai":return l.jsx(ij,{className:t});case"unknown":return null}}function Xe({delayDuration:e=0,...t}){return l.jsx(m5,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function De({...e}){return l.jsx(g5,{"data-slot":"tooltip",...e})}function Fe({...e}){return l.jsx(x5,{"data-slot":"tooltip-trigger",...e})}function $e({className:e,sideOffset:t=0,children:n,...r}){return l.jsx(y5,{children:l.jsxs(b5,{"data-slot":"tooltip-content",sideOffset:t,className:be("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,l.jsx(v5,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Oe(e,t){return e===null||typeof e!="object"||Array.isArray(e)?void 0:Object.getOwnPropertyDescriptor(e,t)?.value}const aj="x-anthropic-billing-header:";function lj(e){return e.trimStart().toLowerCase().startsWith(aj)}function cj(e){return Fa(e)?Object.prototype.hasOwnProperty.call(e,"system"):!1}function uj(e){if(!Fa(e))return!1;const t=Oe(e,"type"),n=Oe(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:lj(n)}function dj(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!cj(t))return{body:e,removed:0};const n=t.system;if(!Array.isArray(n)||n.length===0)return{body:e,removed:0};const r=[];let o=0;for(const s of n){if(uj(s)){o+=1;continue}r.push(s)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}function fj(e){return{depth:Number.POSITIVE_INFINITY}}function Rp(e){try{const t=JSON.parse(e);return{kind:"json",data:Fo(t)}}catch{return{kind:"text"}}}function Ms(e){const t=b.useMemo(()=>e===null?null:Rp(e),[e]),n=t?.kind==="json"?t.data:null,r=b.useMemo(()=>n===null?null:fj(),[n]),[o,s]=b.useState(!1),[i,a]=b.useState(0),[c,u]=b.useState(0),[d,f]=b.useTransition(),p=b.useCallback(()=>{const h=!o,x=h&&r!==null?r.depth:0;f(()=>{s(h),a(x),u(m=>m+1)})},[o,r]);return{parsedData:n,policy:r,isExpanded:o,toggle:p,isPending:d,bulkDepth:i,bulkRevision:c}}function Fo(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>Fo(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=Fo(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Pp({className:e,orientation:t="horizontal",...n}){return l.jsx(GC,{"data-slot":"tabs","data-orientation":t,orientation:t,className:be("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const hj=da("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Op({className:e,variant:t="default",...n}){return l.jsx(YC,{"data-slot":"tabs-list","data-variant":t,className:be(hj({variant:t}),e),...n})}function St({className:e,...t}){return l.jsx(XC,{"data-slot":"tabs-trigger",className:be("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ct({className:e,...t}){return l.jsx(QC,{"data-slot":"tabs-content",className:be("flex-1 outline-none",e),...t})}function gn(e){const[t,n]=b.useState(!1),r=b.useRef(null);b.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const o=b.useCallback(s=>{s.stopPropagation(),e!==null&&window.navigator.clipboard.writeText(e).then(()=>{n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),2e3)})},[e]);return{copied:t,copy:o}}const pj=b.lazy(()=>Sn(()=>import("./CompareDrawer-CUqYtaH3.js"),__vite__mapDeps([0,1])).then(e=>({default:e.CompareDrawer}))),mj=b.lazy(()=>Sn(()=>import("./ReplayDialog-CPXNEqVg.js"),__vite__mapDeps([2,1,3])).then(e=>({default:e.ReplayDialog}))),gj=b.lazy(()=>Sn(()=>import("./RequestAnatomy-qkj8QgkY.js"),__vite__mapDeps([4,1])).then(e=>({default:e.RequestAnatomy}))),xj=b.lazy(()=>Sn(()=>import("./ResponseView-BPNLZpuw.js"),__vite__mapDeps([3,1])).then(e=>({default:e.ResponseView}))),yj=b.lazy(()=>Sn(()=>import("./StreamingChunkSequence-DGs-YFXI.js"),__vite__mapDeps([5,1])).then(e=>({default:e.StreamingChunkSequence}))),mc=b.lazy(()=>Sn(()=>Promise.resolve().then(()=>Nm),void 0).then(e=>({default:e.JsonViewer}))),bj=b.lazy(()=>Sn(()=>Promise.resolve().then(()=>Nm),void 0).then(e=>({default:e.JsonViewerFromString}))),vj=1200,wj=12;function kj(e){const{containerRef:t,setExpandToPath:n,ensureTabActive:r,highlightMs:o}=e,s=b.useRef(null);return b.useCallback(i=>{r?.(),n(i.path);const a=f=>{f.scrollIntoView({behavior:"smooth",block:"center"}),f.classList.add("ring-2","ring-primary/60","ring-offset-1","ring-offset-background","rounded-sm","transition-shadow"),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{f.classList.remove("ring-2","ring-primary/60","ring-offset-1","ring-offset-background","rounded-sm","transition-shadow"),n(null)},o??vj)},u=`[data-anatomy-path="${(f=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["'\\[\](){}])/g,"\\$1"))(i.path)}"]`,d=f=>{const p=t.current;if(p!==null){const h=p.querySelector(u);if(h!==null){a(h);return}}f>0?window.requestAnimationFrame(()=>d(f-1)):n(null)};window.requestAnimationFrame(()=>d(wj))},[t,r,o,n])}class Mp{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const s=this.castInput(t,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,c,r,o)}diffWithOptionsObj(t,n,r,o){var s;const i=v=>{if(v=this.postProcess(v,r),o){setTimeout(function(){o(v)},0);return}else return v},a=n.length,c=t.length;let u=1,d=a+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(s=r.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&x+1>=a)return i(this.buildValues(h[0].lastComponent,n,t));let m=-1/0,g=1/0;const y=()=>{for(let v=Math.max(m,-u);v<=Math.min(g,u);v+=2){let k;const S=h[v-1],C=h[v+1];S&&(h[v-1]=void 0);let j=!1;if(C){const T=C.oldPos-v;j=C&&0<=T&&T<a}const N=S&&S.oldPos+1<c;if(!j&&!N){h[v]=void 0;continue}if(!N||j&&S.oldPos<C.oldPos?k=this.addToPath(C,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(k,n,t,v,r),k.oldPos+1>=c&&x+1>=a)return i(this.buildValues(k.lastComponent,n,t))||!0;h[v]=k,k.oldPos+1>=c&&(g=Math.min(g,v-1)),x+1>=a&&(m=Math.max(m,v+1))}u++};if(o)(function v(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);y()||v()},0)})();else for(;u<=d&&Date.now()<=p;){const v=y();if(v)return v}}addToPath(t,n,r,o,s){const i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(t,n,r,o,s){const i=n.length,a=r.length;let c=t.oldPos,u=c-o,d=0;for(;u+1<i&&c+1<a&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const i=o.length;let a=0,c=0,u=0;for(;a<i;a++){const d=o[a];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){const x=r[u+h];return x.length>p.length?x:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return o}}class _j extends Mp{constructor(){super(...arguments),this.tokenize=Dp}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
86
86
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
87
87
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
88
88
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
@@ -103,7 +103,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
103
103
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
104
104
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
105
105
|
`}),n}function eu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function tu(e,t){const n=VT(e,t),r=n.one(e,void 0),o=zT(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
106
|
-
`},o),s}function JT(e,t){return e&&"run"in e?async function(n,r){const o=tu(n,{file:r,...t});await e.run(o,r)}:function(n,r){return tu(n,{file:r,...e||t})}}function nu(e){if(e)throw e}var Hs,ru;function KT(){if(ru)return Hs;ru=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!f)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},i=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return Hs=function c(){var u,d,f,p,h,x,m=arguments[0],g=1,y=arguments.length,v=!1;for(typeof m=="boolean"&&(v=m,m=arguments[1]||{},g=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});g<y;++g)if(u=arguments[g],u!=null)for(d in u)f=a(m,d),p=a(u,d),m!==p&&(v&&p&&(s(p)||(h=o(p)))?(h?(h=!1,x=f&&o(f)?f:[]):x=f&&s(f)?f:{},i(m,{name:d,newValue:c(v,x,p)})):typeof p<"u"&&i(m,{name:d,newValue:p}));return m},Hs}var GT=KT();const Ws=Ji(GT);function Di(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YT(){const e=[],t={run:n,use:r};return t;function n(...o){let s=-1;const i=o.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);a(null,...o);function a(c,...u){const d=e[++s];let f=-1;if(c){i(c);return}for(;++f<o.length;)(u[f]===null||u[f]===void 0)&&(u[f]=o[f]);o=u,d?XT(d,a)(...u):i(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function XT(e,t){let n;return r;function r(...i){const a=e.length>i.length;let c;a&&i.push(o);try{c=e.apply(this,i)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(c&&c.then&&typeof c.then=="function"?c.then(s,o):c instanceof Error?o(c):s(c))}function o(i,...a){n||(n=!0,t(i,...a))}function s(i){o(null,i)}}const It={basename:QT,dirname:e4,extname:t4,join:n4,sep:"/"};function QT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vr(e);let n=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function e4(e){if(Vr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function t4(e){Vr(e);let t=e.length,n=-1,r=0,o=-1,s=0,i;for(;t--;){const a=e.codePointAt(t);if(a===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),a===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function n4(...e){let t=-1,n;for(;++t<e.length;)Vr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":r4(n)}function r4(e){Vr(e);const t=e.codePointAt(0)===47;let n=o4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function o4(e,t){let n="",r=0,o=-1,s=0,i=-1,a,c;for(;++i<=e.length;){if(i<e.length)a=e.codePointAt(i);else{if(a===47)break;a=47}if(a===47){if(!(o===i-1||s===1))if(o!==i-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),o=i,s=0;continue}}else if(n.length>0){n="",r=0,o=i,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,i):n=e.slice(o+1,i),r=i-o-1;o=i,s=0}else a===46&&s>-1?s++:s=-1}return n}function Vr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const s4={cwd:i4};function i4(){return"/"}function Fi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function a4(e){if(typeof e=="string")e=new URL(e);else if(!Fi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return l4(e)}function l4(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Zs=["history","path","basename","stem","extname","dirname"];class Sm{constructor(t){let n;t?Fi(t)?n={path:t}:typeof t=="string"||c4(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":s4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zs.length;){const s=Zs[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)Zs.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Js(t,"basename"),qs(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){ou(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(qs(t,"extname"),ou(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fi(t)&&(t=a4(t)),Js(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Js(t,"stem"),qs(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new rt(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qs(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Js(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ou(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function c4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u4=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),d4={}.hasOwnProperty;class Qa extends u4{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YT()}copy(){const t=new Qa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ws(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ys("data",this.frozen),this.namespace[t]=n,this):d4.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ys("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ao(t),r=this.parser||this.Parser;return Ks("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ks("process",this.parser||this.Parser),Gs("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,i){const a=ao(t),c=r.parse(a);r.run(c,a,function(d,f,p){if(d||!f||!p)return u(d);const h=f,x=r.stringify(h,p);p4(x)?p.value=x:p.result=x,u(d,p)});function u(d,f){d||!f?i(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ks("processSync",this.parser||this.Parser),Gs("processSync",this.compiler||this.Compiler),this.process(t,o),iu("processSync","process",n),r;function o(s,i){n=!0,nu(s),r=i}}run(t,n,r){su(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(i,a){const c=ao(n);o.run(t,c,u);function u(d,f,p){const h=f||t;d?a(d):i?i(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,s),iu("runSync","run",r),o;function s(i,a){nu(i),o=a,r=!0}}stringify(t,n){this.freeze();const r=ao(n),o=this.compiler||this.Compiler;return Gs("stringify",o),su(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ys("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(o.settings=Ws(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...x]=d;const m=r[p][1];Di(m)&&Di(h)&&(h=Ws(!0,m,h)),r[p]=[u,h,...x]}}}}const f4=new Qa().freeze();function Ks(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ys(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function su(e){if(!Di(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ao(e){return h4(e)?e:new Sm(e)}function h4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function p4(e){return typeof e=="string"||m4(e)}function m4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g4="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",au=[],lu={allowDangerousHtml:!0},x4=/^(https?|ircs?|mailto|xmpp)$/i,y4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cu(e){const t=b4(e),n=v4(e);return w4(t.runSync(t.parse(n),n),e)}function b4(e){const t=e.rehypePlugins||au,n=e.remarkPlugins||au,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lu}:lu;return f4().use(Q3).use(n).use(JT,r).use(t)}function v4(e){const t=e.children||"",n=new Sm;return typeof t=="string"&&(n.value=t),n}function w4(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,i=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||k4;for(const d of y4)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+g4+d.id,void 0);return _m(e,u),zE(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return i?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in Bs)if(Object.hasOwn(Bs,h)&&Object.hasOwn(d.properties,h)){const x=d.properties[h],m=Bs[h];(m===null||m.includes(d.tagName))&&(d.properties[h]=c(String(x||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return a&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function k4(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||x4.test(e.slice(0,t))?e:""}function Cm(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function vr(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function jm(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.entries(e):[]}const uu=120;function _4({text:e}){const[t,n]=b.useState(!1);return e.length>uu?l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?l.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:l.jsx(cu,{children:e})}):l.jsxs(De,{delayDuration:300,children:[l.jsxs(Fe,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[l.jsx("span",{children:e.slice(0,uu)}),l.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),l.jsxs($e,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',l.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:l.jsx(cu,{children:e})}),'"']})}function Em({value:e}){if(e===null)return l.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return l.jsx(_4,{text:e});case"number":return l.jsx("span",{className:"text-amber-400",children:e});case"boolean":return l.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return l.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function du({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?l.jsx(ct,{className:"size-3 text-green-500"}):l.jsx(Ft,{className:"size-3"})})}function S4({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?l.jsx(ct,{className:"size-3 text-green-500"}):l.jsx(Ft,{className:"size-3 text-muted-foreground"})})}function C4({onClick:e}){return l.jsx("button",{type:"button",onClick:e,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Expand all descendants",children:l.jsx(Dd,{className:"size-3.5 text-muted-foreground"})})}const j4=b.memo(function e({name:t,value:n,level:r,defaultExpandDepth:o,isArrayItem:s,path:i,expandTargetPath:a,anatomyPaths:c}){const u=b.useMemo(()=>a===null?!1:i===""?a.length>0:a===i||a.startsWith(`${i}/`),[a,i]),d=r<o||u&&vr(n),[f,p]=b.useState(d);b.useEffect(()=>{u&&vr(n)&&!f&&p(!0)},[a]);const[h,x]=b.useState(0),[m,g]=b.useState(null),y=vr(n),v=m===Number.POSITIVE_INFINITY,k=b.useMemo(()=>jm(n),[n]),S=b.useMemo(()=>k.some(([,w])=>vr(w)),[k]),C=Cm(n),j=C==="array"?"[":"{",N=C==="array"?"]":"}",T=c!==null&&c.has(i);function I(){p(!0),g(Number.POSITIVE_INFINITY),x(w=>w+1)}function O(){p(!1),g(0),x(w=>w+1)}function F(){v?O():p(!f)}function E(w){w.stopPropagation(),I()}const L=m??o;return l.jsxs("div",{className:be(r>0&&"border-l border-border/50 ml-2"),children:[l.jsxs("div",{className:be("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",y&&"cursor-pointer hover:bg-muted/50"),"data-anatomy-path":T?i:void 0,onClick:y?F:void 0,onKeyDown:y?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),F())}:void 0,onDoubleClick:y&&S?()=>I():void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[y?l.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:f?l.jsx(Yt,{className:"size-3 text-muted-foreground"}):l.jsx(un,{className:"size-3 text-muted-foreground"})}):l.jsx("span",{className:"w-4 shrink-0"}),l.jsx("span",{className:be("shrink-0",s?"text-muted-foreground":"text-cyan-400"),children:s?t:`"${t}"`}),l.jsx("span",{className:"text-muted-foreground shrink-0",children:y?"":":"}),y?l.jsxs("span",{className:"text-muted-foreground",children:[j,l.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",k.length," ",k.length===1?"item":"items"," ",N]})]}):l.jsx("span",{className:"min-w-0",children:l.jsx(Em,{value:n})}),y&&S&&!v&&l.jsx(C4,{onClick:E}),l.jsx(S4,{value:n})]}),y&&f&&l.jsxs("div",{className:"pl-4",children:[k.map(([w,M])=>l.jsx(e,{name:w,value:M,level:r+1,defaultExpandDepth:L,isArrayItem:C==="array",path:i===""?`/${w}`:`${i}/${w}`,expandTargetPath:a,anatomyPaths:c},w)),l.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:N})]},h)]})});function el({data:e,defaultExpandDepth:t=0,className:n,showCopy:r=!1,bulkDepth:o,bulkRevision:s,anatomyPaths:i=null,expandToPath:a=null}){const c=vr(e),u=b.useMemo(()=>jm(e),[e]),d=o??t,f=s??0;if(!c)return l.jsx(Xe,{children:l.jsx("div",{className:be("font-mono text-xs leading-relaxed",n),children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Em,{value:e}),r&&l.jsx(du,{value:e})]})})});const h=Cm(e)==="array";return l.jsx(Xe,{children:l.jsxs("div",{className:be("font-mono text-xs leading-relaxed",n),children:[r&&l.jsx("div",{className:"mb-2 flex items-center justify-end gap-2",children:l.jsx(du,{value:e})}),l.jsx("div",{children:u.map(([x,m])=>l.jsx(j4,{name:x,value:m,level:0,defaultExpandDepth:d,isArrayItem:h,path:`/${x}`,expandTargetPath:a,anatomyPaths:i},x))},f)]})})}const E4=b.memo(function({text:t,defaultExpandDepth:n=0,className:r,bulkDepth:o,bulkRevision:s}){const i=b.useMemo(()=>Rp(t),[t]);return i.kind==="json"?l.jsx(el,{data:i.data,defaultExpandDepth:n,className:r,bulkDepth:o,bulkRevision:s}):l.jsx("pre",{className:be("font-mono text-xs whitespace-pre-wrap break-words",r),children:t})}),Nm=Object.freeze(Object.defineProperty({__proto__:null,JsonViewer:el,JsonViewerFromString:E4},Symbol.toStringTag,{value:"Module"}));function N4({className:e,children:t,...n}){return l.jsxs(uC,{"data-slot":"scroll-area",className:be("relative",e),...n,children:[l.jsx(dC,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),l.jsx(T4,{}),l.jsx(fC,{})]})}function T4({className:e,orientation:t="vertical",...n}){return l.jsx(Eh,{"data-slot":"scroll-area-scrollbar",orientation:t,className:be("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:l.jsx(Ih,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Tm={file:"file",shell:"shell",browser:"browser",web:"web",mcp:"MCP",code:"code",other:"other"},A4={file:"border-blue-400/20 bg-blue-400/5 text-blue-300",shell:"border-teal-400/20 bg-teal-400/5 text-teal-300",browser:"border-cyan-400/20 bg-cyan-400/5 text-cyan-300",web:"border-sky-400/20 bg-sky-400/5 text-sky-300",mcp:"border-violet-400/20 bg-violet-400/5 text-violet-300",code:"border-emerald-400/20 bg-emerald-400/5 text-emerald-300",other:"border-muted-foreground/20 bg-muted/30 text-muted-foreground"};function I4({category:e}){switch(e){case"file":return l.jsx(jv,{className:"size-3.5"});case"shell":return l.jsx(Vd,{className:"size-3.5"});case"browser":return l.jsx(Bv,{className:"size-3.5"});case"web":return l.jsx(Bd,{className:"size-3.5"});case"mcp":return l.jsx(Ub,{className:"size-3.5"});case"code":return l.jsx(cv,{className:"size-3.5"});case"other":return l.jsx(mv,{className:"size-3.5"})}}function z4({names:e}){return e.length===0?null:l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"required"}),e.slice(0,4).map(t=>l.jsx(jt,{variant:"outline",className:"h-5 max-w-36 truncate rounded-md px-1.5 py-0 font-mono text-[10px]",children:t},t)),e.length>4&&l.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",e.length-4]})]})}function R4({tool:e,called:t}){const[n,r]=b.useState(!1),o=gn(e.name),s=e.description!==null||e.requiredParameters.length>0||e.schema!==null;return l.jsx(nE,{open:n,onOpenChange:r,children:l.jsxs("div",{className:"rounded-md border border-border/60 bg-background/40",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2.5 py-2",children:[l.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>r(i=>!i),"aria-expanded":n,disabled:!s,children:[l.jsx(I4,{category:e.category}),l.jsx("span",{className:"min-w-0 truncate font-mono text-xs font-semibold text-foreground/90",children:e.name}),t&&l.jsx(jt,{variant:"outline",className:"h-5 rounded-md border-emerald-400/20 bg-emerald-400/5 px-1.5 py-0 text-[10px] text-emerald-300",children:"called"}),l.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.parameterCount," params"]}),e.descriptionPreview!==null&&l.jsx("span",{className:"hidden min-w-0 truncate text-xs text-muted-foreground md:inline",children:e.descriptionPreview}),l.jsx("span",{className:"flex-1"}),s&&(n?l.jsx(Yt,{className:"size-3.5 shrink-0 text-muted-foreground"}):l.jsx(un,{className:"size-3.5 shrink-0 text-muted-foreground"}))]}),l.jsx("button",{type:"button",className:"inline-flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:o.copy,"aria-label":o.copied?"Copied tool name":"Copy tool name",children:o.copied?l.jsx(ct,{className:"size-3.5 text-emerald-400"}):l.jsx(Ft,{className:"size-3.5"})})]}),l.jsx(rE,{children:l.jsxs("div",{className:"space-y-2 border-t border-border/60 px-2.5 py-2",children:[e.description!==null&&l.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.description}),l.jsx(z4,{names:e.requiredParameters}),e.schema!==null&&l.jsx(N4,{className:"max-h-64 rounded-md border border-border/60 bg-muted/20 p-2",children:l.jsx(el,{data:Fo(e.schema),defaultExpandDepth:0})})]})})]})})}function P4(e,t){return t.length===0?!0:`${e.name} ${e.description??""} ${Tm[e.category]}`.toLowerCase().trim().includes(t)}const O4=b.memo(function({summary:t,calledToolNames:n}){const[r,o]=b.useState(!1),[s,i]=b.useState(""),a=b.useMemo(()=>new Set(n),[n]),c=s.trim().toLowerCase(),u=b.useMemo(()=>t===null?[]:t.tools.filter(p=>P4(p,c)),[c,t]);if(t===null)return null;const d=t.tools.slice(0,6),f=t.tools.length-d.length;return l.jsxs("section",{className:"mb-3 rounded-lg border border-border/70 bg-muted/20",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-3 py-2",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[l.jsx(Dr,{className:"size-4 shrink-0 text-sky-300/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Request Tools"}),l.jsx(jt,{variant:"outline",className:"h-5 rounded-md px-1.5 py-0 font-mono text-[10px]",children:t.tools.length}),t.toolChoiceLabel!==null&&l.jsxs(jt,{variant:"outline",className:"h-5 rounded-md px-1.5 py-0 font-mono text-[10px] text-muted-foreground",children:["tool_choice: ",t.toolChoiceLabel]})]}),l.jsx("div",{className:"mt-1 flex min-w-0 flex-wrap gap-1",children:t.categories.map(p=>l.jsxs(jt,{variant:"outline",className:be("h-5 rounded-md px-1.5 py-0 font-mono text-[10px]",A4[p.category]),children:[p.count," ",Tm[p.category]]},p.category))})]})]}),l.jsxs(Re,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>o(p=>!p),"aria-expanded":r,children:[r?l.jsx(Yt,{className:"size-3.5"}):l.jsx(un,{className:"size-3.5"}),r?"Hide":"Show"]})]}),l.jsxs("div",{className:"flex min-w-0 flex-wrap gap-1.5 border-t border-border/60 px-3 py-2",children:[d.map(p=>l.jsx(jt,{variant:"outline",className:be("h-5 max-w-44 truncate rounded-md px-1.5 py-0 font-mono text-[10px]",a.has(p.name)&&"border-emerald-400/20 text-emerald-300"),children:p.name},p.name)),f>0&&l.jsxs("span",{className:"font-mono text-[10px] leading-5 text-muted-foreground",children:["+",f]})]}),r&&l.jsxs("div",{className:"space-y-2 border-t border-border/60 px-3 py-3",children:[l.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-border/70 bg-background/50 px-2 text-xs",children:[l.jsx(s2,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("input",{value:s,onChange:p=>i(p.target.value),placeholder:"Filter tools",className:"min-w-0 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground/70"})]}),l.jsx("div",{className:"grid gap-1.5",children:u.length>0?u.map(p=>l.jsx(R4,{tool:p,called:a.has(p.name)},p.name)):l.jsx("p",{className:"py-2 text-xs text-muted-foreground",children:"No matching tools"})})]})]})}),M4="/v1/chat/completions",L4="/chat/completions",D4="/v1/messages";class F4{handlers=new Map;pathMap=new Map;register(t){this.handlers.set(t.format,t)}registerPath(t,n){this.pathMap.set(t,n)}get(t){return this.handlers.get(t)}getByPath(t){const n=t.split("?")[0]??"",r=this.pathMap.get(n);return r===void 0?void 0:this.handlers.get(r)}detectFormat(t){if(t===null)return"unknown";for(const n of this.handlers.values())if(n.detectFormat(t))return n.format;return"unknown"}}const ar=new F4;function $4(e){return ar.getByPath(e)??null}function B4(e){return $4(e)?.format??"unknown"}ar.registerPath(D4,"anthropic");ar.registerPath(M4,"openai");ar.registerPath(L4,"openai");function U4(e){if(e==="")return{};try{const t=JSON.parse(e);return t!==null&&typeof t=="object"&&!Array.isArray(t)?{...t}:{}}catch{return{}}}function V4(e){switch(e.type){case"text":return{type:"text",text:e.text};case"thinking":{const t={type:"thinking",thinking:e.thinking};return e.signature!==""&&(t.signature=e.signature),t}case"think":{const t={type:"think",thinking:e.thinking};return e.signature!==""&&(t.signature=e.signature),t}case"tool_use":return{type:"tool_use",id:e.id,name:e.name,input:U4(e.inputJson)}}}function Am(e,t,n,r){const o=new Map;let s="",i="",a=null,c=null,u=0,d=0;const f=1e3;let p=0,h=0;const x=[];for(const g of e.split(`
|
|
106
|
+
`},o),s}function JT(e,t){return e&&"run"in e?async function(n,r){const o=tu(n,{file:r,...t});await e.run(o,r)}:function(n,r){return tu(n,{file:r,...e||t})}}function nu(e){if(e)throw e}var Hs,ru;function KT(){if(ru)return Hs;ru=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!f)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},i=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return Hs=function c(){var u,d,f,p,h,x,m=arguments[0],g=1,y=arguments.length,v=!1;for(typeof m=="boolean"&&(v=m,m=arguments[1]||{},g=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});g<y;++g)if(u=arguments[g],u!=null)for(d in u)f=a(m,d),p=a(u,d),m!==p&&(v&&p&&(s(p)||(h=o(p)))?(h?(h=!1,x=f&&o(f)?f:[]):x=f&&s(f)?f:{},i(m,{name:d,newValue:c(v,x,p)})):typeof p<"u"&&i(m,{name:d,newValue:p}));return m},Hs}var GT=KT();const Ws=Ji(GT);function Di(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YT(){const e=[],t={run:n,use:r};return t;function n(...o){let s=-1;const i=o.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);a(null,...o);function a(c,...u){const d=e[++s];let f=-1;if(c){i(c);return}for(;++f<o.length;)(u[f]===null||u[f]===void 0)&&(u[f]=o[f]);o=u,d?XT(d,a)(...u):i(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function XT(e,t){let n;return r;function r(...i){const a=e.length>i.length;let c;a&&i.push(o);try{c=e.apply(this,i)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(c&&c.then&&typeof c.then=="function"?c.then(s,o):c instanceof Error?o(c):s(c))}function o(i,...a){n||(n=!0,t(i,...a))}function s(i){o(null,i)}}const It={basename:QT,dirname:e4,extname:t4,join:n4,sep:"/"};function QT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vr(e);let n=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function e4(e){if(Vr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function t4(e){Vr(e);let t=e.length,n=-1,r=0,o=-1,s=0,i;for(;t--;){const a=e.codePointAt(t);if(a===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),a===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function n4(...e){let t=-1,n;for(;++t<e.length;)Vr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":r4(n)}function r4(e){Vr(e);const t=e.codePointAt(0)===47;let n=o4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function o4(e,t){let n="",r=0,o=-1,s=0,i=-1,a,c;for(;++i<=e.length;){if(i<e.length)a=e.codePointAt(i);else{if(a===47)break;a=47}if(a===47){if(!(o===i-1||s===1))if(o!==i-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),o=i,s=0;continue}}else if(n.length>0){n="",r=0,o=i,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,i):n=e.slice(o+1,i),r=i-o-1;o=i,s=0}else a===46&&s>-1?s++:s=-1}return n}function Vr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const s4={cwd:i4};function i4(){return"/"}function Fi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function a4(e){if(typeof e=="string")e=new URL(e);else if(!Fi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return l4(e)}function l4(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Zs=["history","path","basename","stem","extname","dirname"];class Sm{constructor(t){let n;t?Fi(t)?n={path:t}:typeof t=="string"||c4(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":s4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zs.length;){const s=Zs[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)Zs.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Js(t,"basename"),qs(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){ou(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(qs(t,"extname"),ou(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fi(t)&&(t=a4(t)),Js(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Js(t,"stem"),qs(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new rt(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qs(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Js(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ou(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function c4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u4=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),d4={}.hasOwnProperty;class Qa extends u4{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YT()}copy(){const t=new Qa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ws(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ys("data",this.frozen),this.namespace[t]=n,this):d4.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ys("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ao(t),r=this.parser||this.Parser;return Ks("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ks("process",this.parser||this.Parser),Gs("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,i){const a=ao(t),c=r.parse(a);r.run(c,a,function(d,f,p){if(d||!f||!p)return u(d);const h=f,x=r.stringify(h,p);p4(x)?p.value=x:p.result=x,u(d,p)});function u(d,f){d||!f?i(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ks("processSync",this.parser||this.Parser),Gs("processSync",this.compiler||this.Compiler),this.process(t,o),iu("processSync","process",n),r;function o(s,i){n=!0,nu(s),r=i}}run(t,n,r){su(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(i,a){const c=ao(n);o.run(t,c,u);function u(d,f,p){const h=f||t;d?a(d):i?i(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,s),iu("runSync","run",r),o;function s(i,a){nu(i),o=a,r=!0}}stringify(t,n){this.freeze();const r=ao(n),o=this.compiler||this.Compiler;return Gs("stringify",o),su(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ys("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(o.settings=Ws(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...x]=d;const m=r[p][1];Di(m)&&Di(h)&&(h=Ws(!0,m,h)),r[p]=[u,h,...x]}}}}const f4=new Qa().freeze();function Ks(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ys(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function su(e){if(!Di(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ao(e){return h4(e)?e:new Sm(e)}function h4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function p4(e){return typeof e=="string"||m4(e)}function m4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g4="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",au=[],lu={allowDangerousHtml:!0},x4=/^(https?|ircs?|mailto|xmpp)$/i,y4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cu(e){const t=b4(e),n=v4(e);return w4(t.runSync(t.parse(n),n),e)}function b4(e){const t=e.rehypePlugins||au,n=e.remarkPlugins||au,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lu}:lu;return f4().use(Q3).use(n).use(JT,r).use(t)}function v4(e){const t=e.children||"",n=new Sm;return typeof t=="string"&&(n.value=t),n}function w4(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,i=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||k4;for(const d of y4)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+g4+d.id,void 0);return _m(e,u),zE(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return i?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in Bs)if(Object.hasOwn(Bs,h)&&Object.hasOwn(d.properties,h)){const x=d.properties[h],m=Bs[h];(m===null||m.includes(d.tagName))&&(d.properties[h]=c(String(x||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return a&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function k4(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||x4.test(e.slice(0,t))?e:""}function Cm(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function vr(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function jm(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.entries(e):[]}const uu=120;function _4({text:e}){const[t,n]=b.useState(!1);return e.length>uu?l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?l.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:l.jsx(cu,{children:e})}):l.jsxs(De,{delayDuration:300,children:[l.jsxs(Fe,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[l.jsx("span",{children:e.slice(0,uu)}),l.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),l.jsxs($e,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',l.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:l.jsx(cu,{children:e})}),'"']})}function Em({value:e}){if(e===null)return l.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return l.jsx(_4,{text:e});case"number":return l.jsx("span",{className:"text-amber-400",children:e});case"boolean":return l.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return l.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function du({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?l.jsx(ct,{className:"size-3 text-green-500"}):l.jsx(Ft,{className:"size-3"})})}function S4({value:e}){const[t,n]=b.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?l.jsx(ct,{className:"size-3 text-green-500"}):l.jsx(Ft,{className:"size-3 text-muted-foreground"})})}function C4({onClick:e}){return l.jsx("button",{type:"button",onClick:e,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Expand all descendants",children:l.jsx(Dd,{className:"size-3.5 text-muted-foreground"})})}const j4=b.memo(function e({name:t,value:n,level:r,defaultExpandDepth:o,isArrayItem:s,path:i,expandTargetPath:a,anatomyPaths:c}){const u=b.useMemo(()=>a===null?!1:i===""?a.length>0:a===i||a.startsWith(`${i}/`),[a,i]),d=r<o||u&&vr(n),[f,p]=b.useState(d);b.useEffect(()=>{u&&vr(n)&&!f&&p(!0)},[a]);const[h,x]=b.useState(0),[m,g]=b.useState(null),y=vr(n),v=m===Number.POSITIVE_INFINITY,k=b.useMemo(()=>jm(n),[n]),S=b.useMemo(()=>k.some(([,w])=>vr(w)),[k]),C=Cm(n),j=C==="array"?"[":"{",N=C==="array"?"]":"}",T=c!==null&&c.has(i);function I(){p(!0),g(Number.POSITIVE_INFINITY),x(w=>w+1)}function O(){p(!1),g(0),x(w=>w+1)}function F(){v?O():p(!f)}function E(w){w.stopPropagation(),I()}const L=m??o;return l.jsxs("div",{className:be(r>0&&"border-l border-border/50 ml-2"),children:[l.jsxs("div",{className:be("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",y&&"cursor-pointer hover:bg-muted/50"),"data-anatomy-path":T?i:void 0,onClick:y?F:void 0,onKeyDown:y?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),F())}:void 0,onDoubleClick:y&&S?()=>I():void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[y?l.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:f?l.jsx(Yt,{className:"size-3 text-muted-foreground"}):l.jsx(un,{className:"size-3 text-muted-foreground"})}):l.jsx("span",{className:"w-4 shrink-0"}),l.jsx("span",{className:be("shrink-0",s?"text-muted-foreground":"text-cyan-400"),children:s?t:`"${t}"`}),l.jsx("span",{className:"text-muted-foreground shrink-0",children:y?"":":"}),y?l.jsxs("span",{className:"text-muted-foreground",children:[j,l.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",k.length," ",k.length===1?"item":"items"," ",N]})]}):l.jsx("span",{className:"min-w-0",children:l.jsx(Em,{value:n})}),y&&S&&!v&&l.jsx(C4,{onClick:E}),l.jsx(S4,{value:n})]}),y&&f&&l.jsxs("div",{className:"pl-4",children:[k.map(([w,M])=>l.jsx(e,{name:w,value:M,level:r+1,defaultExpandDepth:L,isArrayItem:C==="array",path:i===""?`/${w}`:`${i}/${w}`,expandTargetPath:a,anatomyPaths:c},w)),l.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:N})]},h)]})});function el({data:e,defaultExpandDepth:t=0,className:n,showCopy:r=!1,bulkDepth:o,bulkRevision:s,anatomyPaths:i=null,expandToPath:a=null}){const c=vr(e),u=b.useMemo(()=>jm(e),[e]),d=o??t,f=s??0;if(!c)return l.jsx(Xe,{children:l.jsx("div",{className:be("font-mono text-xs leading-relaxed",n),children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Em,{value:e}),r&&l.jsx(du,{value:e})]})})});const h=Cm(e)==="array";return l.jsx(Xe,{children:l.jsxs("div",{className:be("font-mono text-xs leading-relaxed",n),children:[r&&l.jsx("div",{className:"mb-2 flex items-center justify-end gap-2",children:l.jsx(du,{value:e})}),l.jsx("div",{children:u.map(([x,m])=>l.jsx(j4,{name:x,value:m,level:0,defaultExpandDepth:d,isArrayItem:h,path:`/${x}`,expandTargetPath:a,anatomyPaths:i},x))},f)]})})}const E4=b.memo(function({text:t,defaultExpandDepth:n=0,className:r,bulkDepth:o,bulkRevision:s}){const i=b.useMemo(()=>Rp(t),[t]);return i.kind==="json"?l.jsx(el,{data:i.data,defaultExpandDepth:n,className:r,bulkDepth:o,bulkRevision:s}):l.jsx("pre",{className:be("font-mono text-xs whitespace-pre-wrap break-words",r),children:t})}),Nm=Object.freeze(Object.defineProperty({__proto__:null,JsonViewer:el,JsonViewerFromString:E4},Symbol.toStringTag,{value:"Module"}));function N4({className:e,children:t,...n}){return l.jsxs(uC,{"data-slot":"scroll-area",className:be("relative overflow-hidden",e),...n,children:[l.jsx(dC,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full max-h-[inherit] rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),l.jsx(T4,{}),l.jsx(fC,{})]})}function T4({className:e,orientation:t="vertical",...n}){return l.jsx(Eh,{"data-slot":"scroll-area-scrollbar",orientation:t,className:be("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:l.jsx(Ih,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Tm={file:"file",shell:"shell",browser:"browser",web:"web",mcp:"MCP",code:"code",other:"other"},A4={file:"border-blue-400/20 bg-blue-400/5 text-blue-300",shell:"border-teal-400/20 bg-teal-400/5 text-teal-300",browser:"border-cyan-400/20 bg-cyan-400/5 text-cyan-300",web:"border-sky-400/20 bg-sky-400/5 text-sky-300",mcp:"border-violet-400/20 bg-violet-400/5 text-violet-300",code:"border-emerald-400/20 bg-emerald-400/5 text-emerald-300",other:"border-muted-foreground/20 bg-muted/30 text-muted-foreground"};function I4({category:e}){switch(e){case"file":return l.jsx(jv,{className:"size-3.5"});case"shell":return l.jsx(Vd,{className:"size-3.5"});case"browser":return l.jsx(Bv,{className:"size-3.5"});case"web":return l.jsx(Bd,{className:"size-3.5"});case"mcp":return l.jsx(Ub,{className:"size-3.5"});case"code":return l.jsx(cv,{className:"size-3.5"});case"other":return l.jsx(mv,{className:"size-3.5"})}}function z4({names:e}){return e.length===0?null:l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"required"}),e.slice(0,4).map(t=>l.jsx(jt,{variant:"outline",className:"h-5 max-w-36 truncate rounded-md px-1.5 py-0 font-mono text-[10px]",children:t},t)),e.length>4&&l.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",e.length-4]})]})}function R4({tool:e,called:t}){const[n,r]=b.useState(!1),o=gn(e.name),s=e.description!==null||e.requiredParameters.length>0||e.schema!==null;return l.jsx(nE,{open:n,onOpenChange:r,children:l.jsxs("div",{className:"rounded-md border border-border/60 bg-background/40",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2.5 py-2",children:[l.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>r(i=>!i),"aria-expanded":n,disabled:!s,children:[l.jsx(I4,{category:e.category}),l.jsx("span",{className:"min-w-0 truncate font-mono text-xs font-semibold text-foreground/90",children:e.name}),t&&l.jsx(jt,{variant:"outline",className:"h-5 rounded-md border-emerald-400/20 bg-emerald-400/5 px-1.5 py-0 text-[10px] text-emerald-300",children:"called"}),l.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.parameterCount," params"]}),e.descriptionPreview!==null&&l.jsx("span",{className:"hidden min-w-0 truncate text-xs text-muted-foreground md:inline",children:e.descriptionPreview}),l.jsx("span",{className:"flex-1"}),s&&(n?l.jsx(Yt,{className:"size-3.5 shrink-0 text-muted-foreground"}):l.jsx(un,{className:"size-3.5 shrink-0 text-muted-foreground"}))]}),l.jsx("button",{type:"button",className:"inline-flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:o.copy,"aria-label":o.copied?"Copied tool name":"Copy tool name",children:o.copied?l.jsx(ct,{className:"size-3.5 text-emerald-400"}):l.jsx(Ft,{className:"size-3.5"})})]}),l.jsx(rE,{children:l.jsxs("div",{className:"space-y-2 border-t border-border/60 px-2.5 py-2",children:[e.description!==null&&l.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.description}),l.jsx(z4,{names:e.requiredParameters}),e.schema!==null&&l.jsx(N4,{className:"max-h-64 rounded-md border border-border/60 bg-muted/20 p-2",children:l.jsx(el,{data:Fo(e.schema),defaultExpandDepth:0})})]})})]})})}function P4(e,t){return t.length===0?!0:`${e.name} ${e.description??""} ${Tm[e.category]}`.toLowerCase().trim().includes(t)}const O4=b.memo(function({summary:t,calledToolNames:n}){const[r,o]=b.useState(!1),[s,i]=b.useState(""),a=b.useMemo(()=>new Set(n),[n]),c=s.trim().toLowerCase(),u=b.useMemo(()=>t===null?[]:t.tools.filter(p=>P4(p,c)),[c,t]);if(t===null)return null;const d=t.tools.slice(0,6),f=t.tools.length-d.length;return l.jsxs("section",{className:"mb-3 rounded-lg border border-border/70 bg-muted/20",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-3 py-2",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[l.jsx(Dr,{className:"size-4 shrink-0 text-sky-300/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Request Tools"}),l.jsx(jt,{variant:"outline",className:"h-5 rounded-md px-1.5 py-0 font-mono text-[10px]",children:t.tools.length}),t.toolChoiceLabel!==null&&l.jsxs(jt,{variant:"outline",className:"h-5 rounded-md px-1.5 py-0 font-mono text-[10px] text-muted-foreground",children:["tool_choice: ",t.toolChoiceLabel]})]}),l.jsx("div",{className:"mt-1 flex min-w-0 flex-wrap gap-1",children:t.categories.map(p=>l.jsxs(jt,{variant:"outline",className:be("h-5 rounded-md px-1.5 py-0 font-mono text-[10px]",A4[p.category]),children:[p.count," ",Tm[p.category]]},p.category))})]})]}),l.jsxs(Re,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>o(p=>!p),"aria-expanded":r,children:[r?l.jsx(Yt,{className:"size-3.5"}):l.jsx(un,{className:"size-3.5"}),r?"Hide":"Show"]})]}),l.jsxs("div",{className:"flex min-w-0 flex-wrap gap-1.5 border-t border-border/60 px-3 py-2",children:[d.map(p=>l.jsx(jt,{variant:"outline",className:be("h-5 max-w-44 truncate rounded-md px-1.5 py-0 font-mono text-[10px]",a.has(p.name)&&"border-emerald-400/20 text-emerald-300"),children:p.name},p.name)),f>0&&l.jsxs("span",{className:"font-mono text-[10px] leading-5 text-muted-foreground",children:["+",f]})]}),r&&l.jsxs("div",{className:"space-y-2 border-t border-border/60 px-3 py-3",children:[l.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-border/70 bg-background/50 px-2 text-xs",children:[l.jsx(s2,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("input",{value:s,onChange:p=>i(p.target.value),placeholder:"Filter tools",className:"min-w-0 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground/70"})]}),l.jsx("div",{className:"grid gap-1.5",children:u.length>0?u.map(p=>l.jsx(R4,{tool:p,called:a.has(p.name)},p.name)):l.jsx("p",{className:"py-2 text-xs text-muted-foreground",children:"No matching tools"})})]})]})}),M4="/v1/chat/completions",L4="/chat/completions",D4="/v1/messages";class F4{handlers=new Map;pathMap=new Map;register(t){this.handlers.set(t.format,t)}registerPath(t,n){this.pathMap.set(t,n)}get(t){return this.handlers.get(t)}getByPath(t){const n=t.split("?")[0]??"",r=this.pathMap.get(n);return r===void 0?void 0:this.handlers.get(r)}detectFormat(t){if(t===null)return"unknown";for(const n of this.handlers.values())if(n.detectFormat(t))return n.format;return"unknown"}}const ar=new F4;function $4(e){return ar.getByPath(e)??null}function B4(e){return $4(e)?.format??"unknown"}ar.registerPath(D4,"anthropic");ar.registerPath(M4,"openai");ar.registerPath(L4,"openai");function U4(e){if(e==="")return{};try{const t=JSON.parse(e);return t!==null&&typeof t=="object"&&!Array.isArray(t)?{...t}:{}}catch{return{}}}function V4(e){switch(e.type){case"text":return{type:"text",text:e.text};case"thinking":{const t={type:"thinking",thinking:e.thinking};return e.signature!==""&&(t.signature=e.signature),t}case"think":{const t={type:"think",thinking:e.thinking};return e.signature!==""&&(t.signature=e.signature),t}case"tool_use":return{type:"tool_use",id:e.id,name:e.name,input:U4(e.inputJson)}}}function Am(e,t,n,r){const o=new Map;let s="",i="",a=null,c=null,u=0,d=0;const f=1e3;let p=0,h=0;const x=[];for(const g of e.split(`
|
|
107
107
|
`)){const y=g.trim();if(y.startsWith("data: "))try{const v=JSON.parse(y.slice(6)),k=mb.safeParse(v);if(!k.success)continue;const S=k.data;switch(p===0&&(h=Date.now()),r===!0&&x.length<f&&x.push({index:p,timestamp:Date.now()-h,type:S.type,data:S}),p++,S.type){case"message_start":s=S.message.id,i=S.message.model,u=S.message.usage.input_tokens,t.inputTokens=u,t.cacheCreationInputTokens=S.message.usage.cache_creation_input_tokens??null,t.cacheReadInputTokens=S.message.usage.cache_read_input_tokens??null,t.model===null&&(t.model=i);break;case"content_block_start":{const C=S.content_block;switch(C.type){case"text":o.set(S.index,{type:"text",text:C.text??""});break;case"thinking":o.set(S.index,{type:"thinking",thinking:C.thinking??"",signature:C.signature??""});break;case"think":o.set(S.index,{type:"think",thinking:C.thinking??"",signature:C.signature??""});break;case"tool_use":o.set(S.index,{type:"tool_use",id:C.id,name:C.name,inputJson:""});break}break}case"content_block_delta":{const C=o.get(S.index);if(C===void 0)break;const j=S.delta;j.type==="text_delta"&&C.type==="text"?C.text+=j.text:j.type==="thinking_delta"&&(C.type==="thinking"||C.type==="think")?C.thinking+=j.thinking:j.type==="signature_delta"&&(C.type==="thinking"||C.type==="think")?C.signature+=j.signature:j.type==="input_json_delta"&&C.type==="tool_use"&&(C.inputJson+=j.partial_json);break}case"message_delta":a=S.delta.stop_reason,c=S.delta.stop_sequence??null,d=S.usage.output_tokens,t.outputTokens=d,S.usage.cache_creation_input_tokens!==void 0&&(t.cacheCreationInputTokens=S.usage.cache_creation_input_tokens),S.usage.cache_read_input_tokens!==void 0&&(t.cacheReadInputTokens=S.usage.cache_read_input_tokens);break;case"error":t.error=S.error.message;break;case"content_block_stop":case"message_stop":case"ping":break}}catch{}}r===!0&&(t.streamingChunks={chunks:x,truncated:p>f});const m=[...o.entries()].sort(([g],[y])=>g-y).map(([,g])=>V4(g));return JSON.stringify({id:s,type:"message",model:i!==""?i:n??"",role:"assistant",content:m,stop_reason:a,stop_sequence:c,usage:{input_tokens:u,output_tokens:d}})}const H4={format:"anthropic",parseRequest(e,t){try{const n=JSON.parse(e),r=jd.safeParse(n);return r.success?{model:r.data.model,sessionId:r.data.metadata?.user_id??t?.get("x-session-affinity")??null}:null}catch{return null}},extractTokens(e){try{const t=JSON.parse(e),n=Ed.safeParse(t);if(n.success)return{inputTokens:n.data.usage.input_tokens??null,outputTokens:n.data.usage.output_tokens??null,cacheCreationInputTokens:n.data.usage.cache_creation_input_tokens??null,cacheReadInputTokens:n.data.usage.cache_read_input_tokens??null}}catch{}return{inputTokens:null,outputTokens:null,cacheCreationInputTokens:null,cacheReadInputTokens:null}},extractStream(e,t,n,r){return Am(e,t,n,r)},detectFormat(e){if(e===null)return!1;try{const t=JSON.parse(e);if(typeof t=="object"&&t!==null&&!Array.isArray(t)){const n=Object.keys(t);return n.includes("model")&&n.includes("messages")&&n.includes("system")}return!1}catch{return!1}}};ar.register(H4);class W4{providers=[];register(t){this.providers.push(t)}findProvider(t){let n=null;for(const r of this.providers)if(r.matches(t)){if(r.name!=="anthropic")return r;n=r}return n}getAll(){return[...this.providers]}}const tl=new W4,Z4="https://api.anthropic.com",q4={MiniMax:"https://api.minimaxi.com/anthropic"},J4={name:"anthropic",matches(e){const t=e.toLowerCase();if(t.startsWith("openai-"))return!1;if(t.includes("claude")||t.includes("anthropic"))return!0;for(const n of Object.keys(q4))if(t.startsWith(n.toLowerCase()))return!0;return!0},getUpstreamBase(e,t){return t?.baseUrl!==void 0?t.baseUrl:Z4},extractStream(e,t,n,r){return Am(e,t,n,r)}};tl.register(J4);function nl(e,t,n,r=!0){let o="",s="",i="",a="",c=null,u=0,d=0,f=!1,p=!1;const h=new Map,x=1e3;let m=0,g=0;const y=[];for(const k of e.split(`
|
|
108
108
|
`)){const S=k.trim();if(!S.startsWith("data: "))continue;const C=S.slice(6);if(C==="[DONE]")break;try{const j=JSON.parse(C);if(typeof j=="object"&&j!==null&&!Array.isArray(j)){const I=Object.getOwnPropertyDescriptor(j,"error");if(I!==void 0&&typeof I.value=="object"&&I.value!==null){const O=Object.getOwnPropertyDescriptor(I.value,"message");O!==void 0&&typeof O.value=="string"&&(t.error=O.value);continue}}const N=wb.safeParse(j);if(!N.success)continue;const T=N.data;if(m===0&&(g=Date.now()),r===!0&&y.length<x&&y.push({index:m,timestamp:Date.now()-g,type:"chat.completion.chunk",data:T}),m++,p||(o=T.id,s=T.model,p=!0),!f&&T.usage!==void 0&&T.usage!==null){if(u=T.usage.prompt_tokens??0,d=T.usage.completion_tokens??0,t.inputTokens=u,typeof j=="object"&&j!==null&&!Array.isArray(j)){const I=Object.getOwnPropertyDescriptor(j,"usage");if(I!==void 0&&typeof I.value=="object"&&I.value!==null){const O=Object.getOwnPropertyDescriptor(I.value,"prompt_tokens_details");if(O!==void 0&&typeof O.value=="object"&&O.value!==null){const F=Object.getOwnPropertyDescriptor(O.value,"cached_tokens");F!==void 0&&typeof F.value=="number"&&(t.cacheReadInputTokens=F.value)}}}f=!0}for(const I of T.choices){const O=I.delta;O.content!==void 0&&O.content!==null&&(i+=O.content),O.reasoning_content!==void 0&&O.reasoning_content!==null&&(a+=O.reasoning_content),O.thinking!==void 0&&O.thinking!==null&&(a+=O.thinking);const F=O.think;if(F!=null&&(a+=F),I.finish_reason!==void 0&&I.finish_reason!==null&&(c=I.finish_reason),O.tool_calls!==void 0&&O.tool_calls!==null)for(const E of O.tool_calls){let L=h.get(E.index);L===void 0&&(L={index:E.index,type:"function",function:{name:"",arguments:""}},h.set(E.index,L)),E.id!==void 0&&(L.id=E.id),E.function?.name!==void 0&&(L.function.name+=E.function.name),E.function?.arguments!==void 0&&(L.function.arguments+=E.function.arguments)}}}catch{}}r===!0&&(t.streamingChunks={chunks:y,truncated:m>x}),f||(d=Math.ceil(i.length/4)),t.outputTokens=d;const v={role:"assistant",content:i};return a&&(v.reasoning_content=a),h.size>0&&(v.tool_calls=[...h.values()]),JSON.stringify({id:o,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:s!==""?s:n??"",choices:[{index:0,message:v,finish_reason:c}],usage:{prompt_tokens:u,completion_tokens:d,total_tokens:u+d}})}const K4={format:"openai",parseRequest(e,t){try{const n=JSON.parse(e),r=Ad.safeParse(n);return r.success?{model:r.data.model,sessionId:t?.get("x-session-affinity")??null}:null}catch{return null}},extractTokens(e){const t=zd(e);if(t){let n=null;try{const r=JSON.parse(e);if(r!==null&&typeof r=="object"&&!Array.isArray(r)){const o=Object.getOwnPropertyDescriptor(r,"usage");if(o!==void 0&&typeof o.value=="object"&&o.value!==null){const s=Object.getOwnPropertyDescriptor(o.value,"prompt_tokens_details");if(s!==void 0&&typeof s.value=="object"&&s.value!==null){const i=Object.getOwnPropertyDescriptor(s.value,"cached_tokens");i!==void 0&&typeof i.value=="number"&&(n=i.value)}}}}catch{}return{inputTokens:t.usage.prompt_tokens??null,outputTokens:t.usage.completion_tokens??null,cacheCreationInputTokens:null,cacheReadInputTokens:n}}return{inputTokens:null,outputTokens:null,cacheCreationInputTokens:null,cacheReadInputTokens:null}},extractStream(e,t,n,r){return nl(e,t,n,r)},detectFormat(e){if(e===null)return!1;try{const t=JSON.parse(e);if(typeof t=="object"&&t!==null&&!Array.isArray(t)){const n=Object.keys(t);return n.includes("model")&&n.includes("messages")&&!n.includes("system")}return!1}catch{return!1}}};ar.register(K4);const G4="https://api.openai.com/v1",Y4={name:"openai",matches(e){const t=e.toLowerCase();return!!(t.startsWith("openai-")||t.includes("gpt-")||t.includes("o1")||t.includes("o2")||t.includes("o3"))},getUpstreamBase(e,t){return t?.baseUrl!==void 0?t.baseUrl:G4},extractStream(e,t,n,r){return nl(e,t,n,r)}};tl.register(Y4);const X4="https://dashscope.aliyuncs.com/compatible-mode/v1",Q4={name:"alibaba",matches(e){const t=e.toLowerCase().replace(/\s+/g,"-");return!!(t.startsWith("glm-5")||t.startsWith("qwen"))},getUpstreamBase(e,t){return X4},extractStream(e,t,n){return nl(e,t,n)}};tl.register(Q4);function Im(e,t){for(const n of Array.from(e))t(n)}const eA=/[\u3000-\u9FFF\uAC00-\uD7FF\uF900-\uFAFF\uFF00-\uFFEF\u{1F300}-\u{1FAFF}]/u;function rl(e){if(e.length===0)return 0;let t=0,n=0;return Im(e,r=>{eA.test(r)?t+=1:n+=1}),Math.ceil(t*1)+Math.ceil(n/4)}function ol(e){if(e.length===0)return 0;let t=0;return Im(e,()=>{t+=1}),t}function yn(e){return{parsed:null,comparisonValue:e,messageCount:null,toolCount:null}}const Wn={parsed:null,toolNames:null};function tA(e){if(typeof e=="string")return e;if(!Array.isArray(e))return"";const t=[];for(const n of e){if(n===null||typeof n!="object")continue;const r=n;switch(r.type){case"text":typeof r.text=="string"&&t.push(r.text);break;case"thinking":case"think":typeof r.thinking=="string"&&t.push(r.thinking);break;case"tool_use":{const s=typeof r.name=="string"?r.name:"",i=r.input!==void 0?JSON.stringify(r.input):"";t.push(`${s} ${i}`.trim());break}case"tool_result":{const s=r.content;if(typeof s=="string")t.push(s);else if(Array.isArray(s)){for(const i of s)if(i!==null&&typeof i=="object"){const a=i.text;typeof a=="string"&&t.push(a)}}break}case"image":t.push("[image]");break}}return t.join(`
|
|
109
109
|
`)}function nA(e){if(typeof e=="string")return e;if(!Array.isArray(e))return"";const t=[];for(const n of e)if(n!==null&&typeof n=="object"){const r=n.text;n.type==="text"&&typeof r=="string"&&t.push(r)}return t.join(`
|