=0}function Ls(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Is(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Is(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Rs(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function zs(e,t=`|`){return e.map(e=>fc(e)).join(t)}function Bs(e,t){return typeof t==`bigint`?t.toString():t}var Vs=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Hs(e){return new Vs(e)}function Us(e){return e==null}function Ws(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Gs(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){let e=t._zod.def.shape[a];return r?r(e,a):e}):Qs(e,a,r?r(n.value,a):n.value))}}function ec(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Zs(e,n,()=>t[n]):Qs(e,n,r.value))}}function tc(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function nc(e){return JSON.stringify(e)}function rc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ic=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ac(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var oc=Hs(()=>{if(nl.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function sc(e){if(ac(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ac(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function cc(e){return sc(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var lc=new Set([`string`,`number`,`symbol`]);function uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function dc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 fc(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function pc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var mc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hc={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function gc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return $s(i,e,_c(e,t)),dc(e,tc(n,{shape:i,checks:[]}))}function _c(e,t){let n=Xs(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function vc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(_c(e,t)),a={};return $s(a,e,Reflect.ownKeys(Xs(e)).filter(e=>!i.has(e))),dc(e,tc(n,{shape:a,checks:[]}))}function yc(e,t){if(!sc(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Xs(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return dc(e,tc(e._zod.def,{shape:bc(e,t)}))}function bc(e,t){let n={};return $s(n,e,Reflect.ownKeys(Xs(e))),ec(n,t),n}function xc(e,t){if(!sc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return dc(e,tc(e._zod.def,{shape:bc(e,t)}))}function Sc(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return $s(n,e,Reflect.ownKeys(Xs(e))),$s(n,t,Reflect.ownKeys(Xs(t))),dc(e,tc(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Cc(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(_c(t,n)):void 0,o={};return $s(o,t,Reflect.ownKeys(Xs(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),dc(t,tc(t._zod.def,{shape:o,checks:[]}))}function wc(e,t,n){let r=n?new Set(_c(t,n)):void 0,i={};return $s(i,t,Reflect.ownKeys(Xs(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),dc(t,tc(t._zod.def,{shape:i}))}function Tc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Oc(e){return typeof e==`string`?e:e?.message}function kc(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ac(e,t,n){var r;for(let i=t;ie;return t[qc]=!0,t}var Yc,Xc=Object.freeze({status:`aborted`}),Zc={value:void 0,enumerable:!1},Qc=`captureStackTrace`in Error?Error:null;function $c(e){let t=Qc;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Qc=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function R(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Zc.value=new a(r);try{Object.defineProperty(n,"_zod",Zc)}finally{Zc.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Lc(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?$c(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var el=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},tl=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Yc=globalThis).__zod_globalConfig??(Yc.__zod_globalConfig={});var nl=globalThis.__zod_globalConfig;function rl(e){return e&&Object.assign(nl,e),nl}function il(){let e=this._zod;return e.message??=JSON.stringify(e.def,Bs,2),e.message}function al(e){this._zod.message=e}var ol={get:il,set:al,enumerable:!0,configurable:!0},sl={value:void 0,enumerable:!1},cl=new WeakSet([Object.prototype,Error.prototype]),ll=(e,t)=>{e.name=`$ZodError`,sl.value=t,Object.defineProperty(e,"issues",sl),sl.value=void 0,Object.defineProperty(e,"message",ol);let n=Object.getPrototypeOf(e);cl.has(n)||(cl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ul=R(`$ZodError`,ll);R(`$ZodError`,ll,void 0,{Parent:Error});function dl(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function fl(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?dl(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function pl(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new el;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>jc(e,o,rl())));throw ic(n,a?.callee??t),n}return s.value};return t},gl=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>jc(e,o,rl())));throw ic(n,a?.callee??t),n}return s.value};return t},_l=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new el;return a.issues.length?vl(e,a.issues,i):{success:!0,data:a.value}};function vl(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>jc(e,n,rl()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var yl=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?vl(e,a.issues,i):{success:!0,data:a.value}},bl=Symbol.for(`zod.compile.invalid`),xl=Symbol.for(`zod.compile.fallback`),Sl=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==bl)return!0;if(r.definite===!0&&n===void 0)return!1}return Cl(e,t,n)});function Cl(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[xl]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new el;return a.issues.length===0}var wl=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Tl=e=>{let t=hl(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ml(n,a))};return n},El=e=>{let t=hl(e),n=(e,r,i,a)=>t(e,r,i,ml(n,a));return n},Dl=e=>{let t=gl(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ml(n,a))};return n},Ol=e=>{let t=gl(e),n=async(e,r,i,a)=>await t(e,r,i,ml(n,a));return n},kl=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _l(e)(t,n,i)},Al=e=>(t,n,r)=>_l(e)(t,n,r),jl=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yl(e)(t,n,i)},Ml=e=>async(t,n,r)=>yl(e)(t,n,r),Nl=/^[cC][0-9a-z]{6,}$/,Pl=/^[0-9a-z]+$/,Fl=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Il=/^[0-9a-vA-V]{20}$/,Ll=/^[A-Za-z0-9]{27}$/,Rl=/^[a-zA-Z0-9_-]{21}$/;function zl(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Bl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vl=/^([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})$/,Hl=e=>e?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)$/,Ul=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wl=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Gl(){return new RegExp(Wl,`u`)}var Kl=/^(?:(?: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])$/,ql=/^(([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}|:))$/,Jl=/^((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])$/,Yl=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zl=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ql=/^https?$/,$l=/^\+[1-9]\d{6,14}$/,eu=`(?:(?:\\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])))`;function tu(e){return RegExp(`^${e}$`)}var nu=tu(eu);function ru(e){let 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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function iu(e){return RegExp(`^${ru(e)}$`)}function au(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${ru({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${ru({precision:e.precision})}`:n;return RegExp(`^${eu}T(?:${r})$`)}var ou=/^[\s\S]{0,}$/,su=/^-?\d+$/,cu=/^-?\d+(?:\.\d+)?$/,lu=/^(?:true|false)$/i,uu=/^null$/i,du=/^undefined$/i,fu=/^[^A-Z]*$/,pu=/^[^a-z]*$/,mu=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hu=e=>{let t=e.value;return!Us(t)&&t.length!==void 0},gu={number:`number`,bigint:`bigint`,object:`date`},_u=R(`$ZodCheckLessThan`,(e,t)=>{mu.init(e,t);let n=gu[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{mu.init(e,t);let n=gu[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:gu[typeof r.value]??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})}}),yu=R(`$ZodCheckMultipleOf`,(e,t)=>{mu.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Gs(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})}}),bu=R(`$ZodCheckNumberFormat`,(e,t)=>{mu.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=mc[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),xu=R(`$ZodCheckMaxLength`,(e,t)=>{var n;mu.init(e,t),(n=e._zod.def).when??(n.when=hu),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Nc(r):i)<=t.maximum)return;let a=Pc(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Su=R(`$ZodCheckMinLength`,(e,t)=>{var n;mu.init(e,t),(n=e._zod.def).when??(n.when=hu),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Pc(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cu=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;mu.init(e,t),(n=e._zod.def).when??(n.when=hu),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Nc(r):i;if(a===t.length)return;let o=Pc(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),wu=R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;mu.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Tu=R(`$ZodCheckRegex`,(e,t)=>{wu.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})}}),Eu=R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=fu,wu.init(e,t)}),Du=R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=pu,wu.init(e,t)}),Ou=R(`$ZodCheckIncludes`,(e,t)=>{mu.init(e,t);let n=uc(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ku=R(`$ZodCheckStartsWith`,(e,t)=>{mu.init(e,t);let n=RegExp(`^${uc(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Au=R(`$ZodCheckEndsWith`,(e,t)=>{mu.init(e,t);let n=RegExp(`.*${uc(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ju=R(`$ZodCheckOverwrite`,(e,t)=>{mu.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Mu=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
-`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
-`)}\n};`)(...Object.values(this.closed))}},Nu={major:4,minor:6,patch:6},Pu=R(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nu;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Tc(t),a;for(let o of n){if(o._zod.def.when){if(Ec(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new el;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ac(t.issues,n,e),i||=Tc(t,n))});else{if(t.issues.length===n)continue;Ac(t.issues,n,e),i||=Tc(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Tc(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new el;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new el;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return zc(this,`~standard`,Lu(this))},set"~standard"(e){Rc(this,`~standard`,e)}}),Fu=(e,t)=>e.issues.length?{issues:e.issues.map(e=>jc(e,t,rl()))}:{value:e.value};async function Iu(e,t){let n={async:!0};return Fu(await e._zod.run({value:t,issues:[]},n),n)}function Lu(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Fu(r,n)}catch{}return Iu(e,t)},vendor:`zod`,version:1}}var Ru=R(`$ZodString`,(e,t)=>{Pu.init(e,t),e._zod.pattern=t.pattern??ou,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}}),zu=R(`$ZodStringFormat`,(e,t)=>{wu.init(e,t),Ru.init(e,t)}),Bu=R(`$ZodGUID`,(e,t)=>{t.pattern??=Vl,zu.init(e,t)}),Vu=R(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Hl(e)}else t.pattern??=Hl();zu.init(e,t)}),Hu=R(`$ZodEmail`,(e,t)=>{t.pattern??=Ul,zu.init(e,t)});function Uu(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Wu(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Uu(e)||2:Gu(e,t)}function Gu(e,t){if(!t.normalize&&t.protocol?.source===Ql.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Ku=/[\t\n\r]/g;function qu(e){return e.replace(Ku,``)}function Ju(e,t){return t.lastIndex=0,t.test(e.hostname)}function Yu(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Xu=R(`$ZodURL`,(e,t)=>{zu.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Wu(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=qu(r);return}t.hostname&&!Ju(i,t.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&&!Yu(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:qu(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Zu=R(`$ZodEmoji`,(e,t)=>{t.pattern??=Gl(),zu.init(e,t)}),Qu=R(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Rl:zl(t.length),zu.init(e,t)}),$u=R(`$ZodCUID`,(e,t)=>{t.pattern??=Nl,zu.init(e,t)}),ed=R(`$ZodCUID2`,(e,t)=>{t.pattern??=Pl,zu.init(e,t)}),td=R(`$ZodULID`,(e,t)=>{t.pattern??=Fl,zu.init(e,t)}),nd=R(`$ZodXID`,(e,t)=>{t.pattern??=Il,zu.init(e,t)}),rd=R(`$ZodKSUID`,(e,t)=>{t.pattern??=Ll,zu.init(e,t)}),id=R(`$ZodISODateTime`,(e,t)=>{t.pattern??=au(t),zu.init(e,t)}),ad=R(`$ZodISODate`,(e,t)=>{t.pattern??=nu,zu.init(e,t)}),od=R(`$ZodISOTime`,(e,t)=>{t.pattern??=iu(t),zu.init(e,t)}),sd=R(`$ZodISODuration`,(e,t)=>{t.pattern??=Bl,zu.init(e,t)}),cd=R(`$ZodIPv4`,(e,t)=>{t.pattern??=Kl,zu.init(e,t)}),z=/^[0-9a-fA-F:.]+$/;function B(e){return z.test(e)?Uu(`http://[${e}]`):!1}var ld=R(`$ZodIPv6`,(e,t)=>{t.pattern??=ql,zu.init(e,t),e._zod.check=n=>{B(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ud=R(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Jl,zu.init(e,t)});function dd(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:B(n)}var fd=R(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Yl,zu.init(e,t),e._zod.check=n=>{dd(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function pd(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var md=/^[0-9a-zA-Z+/]*={0,2}$/,hd=R(`$ZodBase64`,(e,t)=>{t.pattern??=md,zu.init(e,t),e._zod.check=n=>{pd(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),gd=/^[A-Za-z0-9_-]*$/;function _d(e){if(!gd.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return pd(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var vd=R(`$ZodBase64URL`,(e,t)=>{t.pattern??=gd,zu.init(e,t),e._zod.check=n=>{_d(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),yd=R(`$ZodE164`,(e,t)=>{t.pattern??=$l,zu.init(e,t)});function bd(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var xd=R(`$ZodJWT`,(e,t)=>{zu.init(e,t),e._zod.check=n=>{bd(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Sd=R(`$ZodNumber`,(e,t)=>{Pu.init(e,t),e._zod.pattern=cu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Cd=R(`$ZodNumberFormat`,(e,t)=>{bu.init(e,t),Sd.init(e,t)}),wd=R(`$ZodBoolean`,(e,t)=>{Pu.init(e,t),e._zod.pattern=lu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Td=R(`$ZodUndefined`,(e,t)=>{Pu.init(e,t),e._zod.pattern=du,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Ed=R(`$ZodNull`,(e,t)=>{Pu.init(e,t),e._zod.pattern=uu,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Dd=R(`$ZodAny`,(e,t)=>{Pu.init(e,t),e._zod.parse=e=>e}),Od=R(`$ZodUnknown`,(e,t)=>{Pu.init(e,t),e._zod.parse=e=>e}),kd=R(`$ZodNever`,(e,t)=>{Pu.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ad(e,t){let n=kc(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of kc(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ac(n.issues,t,e),n}}return i(n,a)}}var jd=e=>Array.isArray(e)?e.length:-1;function Md(e,t,n){e.issues.length&&t.issues.push(...Dc(n,e.issues)),t.value[n]=e.value}var Nd=R(`$ZodArray`,(e,t)=>{Pu.init(e,t);let n=nl.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;eMd(t,r,e)));else if(Md(c,r,e),s&&c.issues.length!==0&&Tc(c))break}return o.length?Promise.all(o).then(()=>r):r},Ad(e,jd)});function Pd(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Dc(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Fd=[];function Id(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fd,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=pc(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Ld(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Tc(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Pd(e,n,i,t,d,f))):Pd(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Rd=R(`$ZodObject`,(e,t)=>{Pu.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Hs(()=>Id(t));L(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Js(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ac,o=t.catchall,s,c=nl.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Tc(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Pd(n,t,e,r,a,o))):Pd(s,t,e,r,a,o)}return o?Ld(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),zd=R(`$ZodObjectJIT`,(e,t)=>{Rd.init(e,t);let n=e._zod.parse,r=Hs(()=>Id(t)),i=nl.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Mu([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
- let ${e}_ab = false;
- for (let i = 0; i < ${e}.issues.length; i++) {
- const iss = ${e}.issues[i];
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
- payload.issues.push(iss);
- if (iss.continue !== true) ${e}_ab = true;
- }
- if (${e}_ab && ctx && ctx.abortEarly) {
- payload.value = newResult;
- return payload;
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:nc(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
- const ${n}_present = ${i};
- if (!${n}.issues.length || ${n}_present) {
- if (${n}.issues.length) {${c(n,r)}
- }
-
- if (${e}) {
- newResult[${r}] = ${n}.value;
- }
- }
-
- `)}else f?(o.write(`
- if (${n}.issues.length) {${c(n,r)}
- }
- `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
- if (${n}.value !== undefined || ${i}) {
- newResult[${r}] = ${n}.value;
- }
- `)):o.write(`
- const ${n}_present = ${i};
- if (${n}.issues.length) {${c(n,r)}
- }
- if (!${n}_present && !${n}.issues.length) {
- payload.issues.push({
- code: "invalid_type",
- expected: "nonoptional",
- input: undefined,
- path: [${r}]
- });
- if (ctx && ctx.abortEarly) {
- payload.value = newResult;
- return payload;
- }
- }
-
- if (${n}_present) {
- newResult[${r}] = ${n}.value;
- }
-
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ac,c=!nl.jitless,l=c&&oc.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Ld([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Bd(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Tc(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>jc(e,r,rl())))}),t)}var Vd=R(`$ZodUnion`,(e,t)=>{Pu.init(e,t),L(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),L(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),L(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),L(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ws(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Bd(t,r,e,i)):Bd(o,r,e,i)}});function Hd(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ud=R(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Vd.init(e,t);let n=e._zod.parse;L(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Js(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Ys(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Hs(()=>Hd(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ac(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Wd=R(`$ZodIntersection`,(e,t)=>{Pu.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Kd(e,t,n)):Kd(e,i,a)}});function Gd(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sc(e)&&sc(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Gd(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Gd(t.value,n.value);if(!c.valid){if(Tc(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var qd=R(`$ZodRecord`,(e,t)=>{Pu.init(e,t);let n=nl.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!sc(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>jc(e,i,rl())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Dc(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Dc(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&cu.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>jc(e,i,rl())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Dc(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Dc(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Jd=R(`$ZodEnum`,(e,t)=>{Pu.init(e,t);let n=Rs(t.entries),r=new Set(n);e._zod.values=r,L(e,`pattern`,e=>{let t=Rs(e.def.entries).filter(e=>lc.has(typeof e));return RegExp(t.length?`^(${t.map(e=>uc(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Yd=R(`$ZodLiteral`,(e,t)=>{Pu.init(e,t);let n=new Set(t.values);e._zod.values=n,L(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?uc(e):e?uc(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Xd=R(`$ZodTransform`,(e,t)=>{Pu.init(e,t),e._zod.optin=`optional`,nl.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tl(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new el;return n.value=i,n}});function Zd(e,t){return e.value=t.issues.length?void 0:t.value,e}var Qd=R(`$ZodOptional`,(e,t)=>{Pu.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ws(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Zd(e,t)):Zd(e,r)}return t.innerType._zod.run(e,n)}}),$d=R(`$ZodExactOptional`,(e,t)=>{Qd.init(e,t),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ef=R(`$ZodNullable`,(e,t)=>{Pu.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ws(t.source)}|null)$`):void 0}),L(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),tf=R(`$ZodDefault`,(e,t)=>{Pu.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>nf(e,t)):nf(r,t)}});function nf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rf=R(`$ZodPrefault`,(e,t)=>{Pu.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),af=R(`$ZodNonOptional`,(e,t)=>{Pu.init(e,t),L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>of(t,e)):of(i,e)}});function of(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function sf(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>jc(e,r,rl()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var cf=R(`$ZodCatch`,(e,t)=>{Pu.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>sf(e,r,t,n)):sf(e,r,t,n)}}),lf=R(`$ZodPipe`,(e,t)=>{Pu.init(e,t),L(e,`values`,e=>e.def.in._zod.values),L(e,`optin`,e=>e.def.in._zod.optin),L(e,`optout`,e=>e.def.out._zod.optout),L(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>uf(e,t.in,n)):uf(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>uf(e,t.out,n)):uf(r,t.out,n)}});function uf(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var df=R(`$ZodPreprocess`,(e,t)=>{lf.init(e,t)}),ff=R(`$ZodReadonly`,(e,t)=>{Pu.init(e,t),L(e,`propValues`,e=>e.def.innerType._zod.propValues),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`optin`,e=>e.def.innerType?._zod?.optin),L(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(pf):pf(r)}});function pf(e){return e.memo||(e.value=Object.freeze(e.value)),e}var mf=R(`$ZodLazy`,(e,t)=>{Pu.init(e,t),qs(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),L(e,`pattern`,e=>e.innerType?._zod?.pattern),L(e,`propValues`,e=>e.innerType?._zod?.propValues),L(e,`optin`,e=>e.innerType?._zod?.optin??void 0),L(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),hf=R(`$ZodCustom`,(e,t)=>{mu.init(e,t),Pu.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>gf(t,n,r,e));gf(i,n,r,e)}});function gf(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ic(e))}}var _f=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},vf=`~memo`,yf=[];function bf(e){return typeof e==`object`&&!!e}function xf(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Sf=new WeakMap,Cf=0,wf=1,Tf=2;function Ef(e,t,n){let r=Sf.get(e);if(r!==void 0)return r?Tf:Cf;if(t.has(e))return Tf;t.add(e);let i=Cf,a=e=>{if(i!==Tf&&e?._zod){let r=Ef(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Cf;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?wf:o.value?._zod?Ef(o.value,t,n):Cf;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ys(c);s(e?o(e,!0):wf),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ef(r,t,!1):wf);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Df(e,i)}function Df(e,t){return t!==wf&&Sf.set(e,t===Tf),t}function Of(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var kf,Af=[],jf={alloc(e,t,n){let r=kf;if(!r)return n;kf=void 0;let i={value:n,issues:null};return r.set(t.value,i),Af.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Nf(n,e.value))throw new _f;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ef(e,new Set,!1);if(i===Cf)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Tf||r?n=!0:r=!0}let l=s.value;if(!bf(l))return t(s,c);let u=c[vf];u||(u={buckets:new WeakMap,backEdges:void 0},c[vf]=u);let d;i===c?d=a:(d=Of(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...xf(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;kf=d;let p=Af.length,m=t(s,c);kf=void 0;let h=Af.length>p?Af.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?xf(e.issues):yf),e)):(h&&(h.issues=m.issues.length?xf(m.issues):yf),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Mf(){return jf}function Nf(e,t){let n=e[vf]?.backEdges;return n!==void 0&&bf(t)&&n.has(t)}var Pf=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Fc(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${fc(e.values[0])}`:`Invalid option: expected one of ${zs(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${zs(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ff(){return{localeError:Pf()}}var If,Lf=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Rf(){return new Lf}(If=globalThis).__zod_globalRegistry??(If.__zod_globalRegistry=Rf());var zf=globalThis.__zod_globalRegistry;function Bf(e){return e.checks&&=[...e.checks],e}function Vf(e,t){return new e(Bf({type:`string`,...I(t)}))}function Hf(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Uf(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Wf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Gf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Kf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function qf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Jf(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Yf(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function Xf(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Zf(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Qf(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function V(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function $f(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function ep(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function tp(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function np(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function rp(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function ip(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function ap(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function op(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function sp(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function cp(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function lp(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function up(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function dp(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function fp(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function pp(e,t){return new e(Bf({type:`number`,checks:[],...I(t)}))}function mp(e,t){return new e(Bf({type:`number`,coerce:!0,checks:[],...I(t)}))}function hp(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function gp(e,t){return new e({type:`boolean`,...I(t)})}function _p(e,t){return new e({type:`undefined`,...I(t)})}function vp(e,t){return new e({type:`null`,...I(t)})}function yp(e){return new e({type:`any`})}function bp(e){return new e({type:`unknown`})}function xp(e,t){return new e({type:`never`,...I(t)})}function Sp(e,t){return new _u({check:`less_than`,...I(t),value:e,inclusive:!1})}function Cp(e,t){return new _u({check:`less_than`,...I(t),value:e,inclusive:!0})}function wp(e,t){return new vu({check:`greater_than`,...I(t),value:e,inclusive:!1})}function Tp(e,t){return new vu({check:`greater_than`,...I(t),value:e,inclusive:!0})}function Ep(e,t){return new yu({check:`multiple_of`,...I(t),value:e})}function Dp(e,t){return new xu({check:`max_length`,...I(t),maximum:e})}function Op(e,t){return new Su({check:`min_length`,...I(t),minimum:e})}function kp(e,t){return new Cu({check:`length_equals`,...I(t),length:e})}function Ap(e,t){return new Tu({check:`string_format`,format:`regex`,...I(t),pattern:e})}function jp(e){return new Eu({check:`string_format`,format:`lowercase`,...I(e)})}function Mp(e){return new Du({check:`string_format`,format:`uppercase`,...I(e)})}function Np(e,t){return new Ou({check:`string_format`,format:`includes`,...I(t),includes:e})}function Pp(e,t){return new ku({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function Fp(e,t){return new Au({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function Ip(e){return new ju({check:`overwrite`,tx:e})}function Lp(e){return Ip(t=>t.normalize(e))}function Rp(){return Ip(e=>e.trim())}function zp(){return Ip(e=>e.toLowerCase())}function Bp(){return Ip(e=>e.toUpperCase())}function Vp(){return Ip(e=>rc(e))}function Hp(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Up(e,t,n){let r=I(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Wp(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Gp(e,t){let n=Kp(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ic(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ic(r))}},e(t.value,t)),t);return n}function Kp(e,t){let n=new mu({check:`custom`,...I(t)});return n._zod.check=e,n}function qp(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Js(e,t,n[t]);return e}function Jp(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??zf,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Yp(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Xp(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Xp(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&qp(o.schema,c),t.io===`input`&&om(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Zp(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Qp(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Zp(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Zp(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/
-
-Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function $p(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;$p(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var em=new Set([`type`,`properties`,`required`,`additionalProperties`]),tm=[`oneOf`,`anyOf`];function nm(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function rm(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!em.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??nm(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Js(n,r,e.length===1?e[0]:rm(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=nm(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function im(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of em)if(t in e)return;let n=t.filter(e=>tm.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=rm(t);else{let e=n[0],i=tm.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>rm([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,qp(e,r))}function am(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):qp(i,s),qp(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())$p(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])im(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}qp(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Js(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:cm(t,`input`,e.processors),output:cm(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function om(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return om(r.element,n);if(r.type===`set`)return om(r.valueType,n);if(r.type===`lazy`)return om(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`||r.type===`catch`)return om(r.innerType,n);if(r.type===`intersection`)return om(r.left,n)||om(r.right,n);if(r.type===`record`||r.type===`map`)return om(r.keyType,n)||om(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:om(r.in,n)||om(r.out,n);if(r.type===`object`){for(let e in r.shape)if(om(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(om(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(om(e,n))return!0;return!!(r.rest&&om(r.rest,n))}return!1}var sm=(e,t={})=>n=>{let r=Jp({...n,processors:t});return Xp(e,r),Qp(r,e),am(r,e)},cm=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Jp({...i??{},target:a,io:t,processors:n});return Xp(e,o),Qp(o,e),am(o,e)},lm=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},um=(e,t,n)=>{(e[t]===void 0||n{lm(e,`minimum`,t),um(e,`maximum`,t)},fm=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},pm=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},mm=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},hm=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},gm=(e,t)=>lm(e,`minimum`,t.minimum),_m=(e,t)=>um(e,`maximum`,t.maximum),vm=e=>(t,n)=>{hm(t,n.format);let[r,i]=e[n.format];lm(t,`minimum`,r),um(t,`maximum`,i)},ym={greater_than:(e,t)=>lm(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>um(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>fm(e,t.value),number_format:vm(mc),bigint_format:vm(hc),min_length:gm,max_length:_m,length_equals:(e,t)=>dm(e,t.length),min_size:gm,max_size:_m,size_equals:(e,t)=>dm(e,t.size),string_format:(e,t)=>{hm(e,t.format),t.pattern&&pm(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>mm(e,t.mime)};function bm(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ym[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&lm(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&lm(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&um(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&um(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&fm(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&mm(t,i.mime);for(let e of i.patterns??[])pm(t,e);return t}var xm={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Sm=new Map([[md,Xl],[gd,Zl]]),Cm=e=>Sm.get(e)??e,wm=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=bm(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=xm[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Cm);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Tm=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=bm(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Yp(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Em=(e,t,n,r)=>{n.type=`boolean`},Dm=(e,t,n,r)=>{Yp(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Om=(e,t,n,r)=>{Yp(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},km=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Am=(e,t,n,r)=>{Yp(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},jm=(e,t,n,r)=>{Yp(e,t,n,r,`Void cannot be represented in JSON Schema`)},Mm=(e,t,n,r)=>{n.not={}},Nm=(e,t,n,r)=>{},Pm=(e,t,n,r)=>{},Fm=(e,t,n,r)=>{Yp(e,t,n,r,`Date cannot be represented in JSON Schema`)},Im=(e,t,n,r)=>{let i=e._zod.def,a=Rs(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Lm=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Yp(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Yp(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Rm=(e,t,n,r)=>{Yp(e,t,n,r,`NaN cannot be represented in JSON Schema`)},zm=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Bm=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=bm(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Vm=(e,t,n,r)=>{n.type=`boolean`},Hm=(e,t,n,r)=>{Yp(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Um=(e,t,n,r)=>{Yp(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Wm=(e,t,n,r)=>{Yp(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Gm=(e,t,n,r)=>{Yp(e,t,n,r,`Map cannot be represented in JSON Schema`)},Km=(e,t,n,r)=>{Yp(e,t,n,r,`Set cannot be represented in JSON Schema`)},qm=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=bm(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Xp(a.element,t,{...r,path:[...r.path,`items`]})};function Jm(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Jm(t.out):t.type===`catch`?Jm(t.innerType):e._zod.optin}var Ym=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Yp(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Js(i.properties,e,Xp(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Jm(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Xp(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Xm=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Xp(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Zm=(e,t,n,r)=>{let i=e._zod.def,a=Xp(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Xp(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Qm=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>Xp(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Xp(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Jm(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=bm(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function $m(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=$m(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>$m(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?cu:su).source),p):p}var eh=new WeakMap;function th(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of eh.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=$m(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var nh=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=bm(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Xp(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Js(i.patternProperties,Cm(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Xp(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=eh.get(t);n||(n=[],eh.set(t,n),t.deferred.push(()=>th(t))),n.push(e)}i.additionalProperties=Xp(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Jm(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},rh=(e,t,n,r)=>{let i=e._zod.def,a=Xp(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ih=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ah=Symbol();function oh(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Yp(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ah):JSON.parse(o)}var sh=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=oh(i.defaultValue,e,t,n,r);o!==ah&&(n.default=o)},ch=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=oh(i.defaultValue,e,t,n,r);o!==ah&&(n._prefault=o)},lh=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Yp(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},uh=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Xp(o,t,r);let s=t.seen.get(e);s.ref=o},dh=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fh=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ph=(e,t,n,r)=>{let i=e._zod.def;Xp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mh=(e,t,n,r)=>{let i=e._zod.innerType;Xp(i,t,r);let a=t.seen.get(e);a.ref=i},hh={string:wm,number:Tm,boolean:Em,bigint:Dm,symbol:Om,null:km,undefined:Am,void:jm,never:Mm,any:Nm,unknown:Pm,date:Fm,enum:Im,literal:Lm,nan:Rm,template_literal:zm,file:Bm,success:Vm,custom:Hm,function:Um,transform:Wm,map:Gm,set:Km,array:qm,object:Ym,union:Xm,intersection:Zm,tuple:Qm,record:nh,nullable:rh,nonoptional:ih,default:sh,prefault:ch,catch:lh,pipe:uh,readonly:dh,promise:fh,optional:ph,lazy:mh};function gh(e,t){if(`_idmap`in e){let n=e,r=Jp({...t,processors:hh}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Xp(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Qp(r,n),Js(a,t,am(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Jp({...t,processors:hh});return Xp(e,n),Qp(n,e),am(n,e)}var _h=new WeakSet([Object.prototype,Error.prototype]);function vh(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var yh=R(`ZodError`,(e,t)=>{ul.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);_h.has(n)||(_h.add(n),vh(n,`format`,e=>t=>pl(e,t)),vh(n,`flatten`,e=>t=>fl(e,t)),vh(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Bs,2)}),vh(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Bs,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),bh=hl(yh),xh=gl(yh),Sh=_l(yh),Ch=yl(yh),wh=Tl(yh),Th=El(yh),Eh=Dl(yh),Dh=Ol(yh),Oh=kl(yh),kh=Al(yh),Ah=jl(yh),jh=Ml(yh);function Mh(){nl.localeError||rl(Ff())}function Nh(){nl.memoizer||rl({memoizer:Mf()})}var Ph=R(`ZodType`,(e,t)=>(Mh(),Pu.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(tc(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return dc(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(l_(e,t))},superRefine(e,t){return this.check(u_(e,t))},overwrite(e){return this.check(Ip(e))},optional(){return Vg(this)},exactOptional(){return Ug(this)},nullable(){return Gg(this)},nullish(){return Vg(Gg(this))},nonoptional(e){return Zg(this,e)},array(){return wg(this)},or(e){return Og([this,e])},and(e){return Mg(this,e)},transform(e){return t_(this,zg(e))},default(e){return qg(this,e)},prefault(e){return Yg(this,e)},catch(e){return $g(this,e)},pipe(e){return t_(this,e)},readonly(){return i_(this)},describe(e){let t=this.clone();return zf.add(t,{description:e}),t},meta(...e){if(e.length===0)return zf.get(this);let t=this.clone();return zf.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return zc(this,`~standard`,{...Lu(this),jsonSchema:{input:cm(this,`input`),output:cm(this,`output`)}})},set"~standard"(e){Rc(this,`~standard`,e)},parse:function e(t,n){return bh(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await xh(this,t,n,{callee:e})},safeParse(e,t){return Sh(this,e,t)},async safeParseAsync(e,t){return Ch(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Rc(this,`spa`,e)},validate(e,t){return Sl(this,e,t)},validateAsync(e,t){return wl(this,e,t)},encode:function e(t,n){return wh(this,t,n,{callee:e})},decode:function e(t,n){return Th(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Eh(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Dh(this,t,n,{callee:e})},safeEncode(e,t){return Oh(this,e,t)},safeDecode(e,t){return kh(this,e,t)},async safeEncodeAsync(e,t){return Ah(this,e,t)},async safeDecodeAsync(e,t){return jh(this,e,t)},toJSONSchema(e){return sm(this,{})(e)},get description(){return zf.get(this)?.description},get _def(){return this._zod.def}}),Fh=R(`_ZodString`,(e,t)=>{Ru.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wm(e,t,n,r)},Bc({format:e=>bm(e).format??null,minLength:e=>bm(e).minimum??null,maxLength:e=>bm(e).maximum??null},{regex(...e){return this.check(Ap(...e))},includes(...e){return this.check(Np(...e))},startsWith(...e){return this.check(Pp(...e))},endsWith(...e){return this.check(Fp(...e))},min(...e){return this.check(Op(...e))},max(...e){return this.check(Dp(...e))},length(...e){return this.check(kp(...e))},nonempty(...e){return this.check(Op(1,...e))},lowercase(e){return this.check(jp(e))},uppercase(e){return this.check(Mp(e))},trim(){return this.check(Rp())},normalize(...e){return this.check(Lp(...e))},toLowerCase(){return this.check(zp())},toUpperCase(){return this.check(Bp())},slugify(){return this.check(Vp())}})),Ih=R(`ZodString`,(e,t)=>{Ru.init(e,t),Fh.init(e,t)},{email(e){return this.check(Hf(Hh,e))},url(e){return this.check(Jf(Kh,e))},jwt(e){return this.check(cp(cg,e))},emoji(e){return this.check(Yf(Jh,e))},guid(e){return this.check(Uf(Wh,e))},uuid(e){return this.check(Wf(Gh,e))},uuidv4(e){return this.check(Gf(Gh,e))},uuidv6(e){return this.check(Kf(Gh,e))},uuidv7(e){return this.check(qf(Gh,e))},nanoid(e){return this.check(Xf(Yh,e))},cuid(e){return this.check(Zf(Xh,e))},cuid2(e){return this.check(Qf(Zh,e))},ulid(e){return this.check(V(Qh,e))},base64(e){return this.check(ap(ag,e))},base64url(e){return this.check(op(og,e))},xid(e){return this.check($f($h,e))},ksuid(e){return this.check(ep(eg,e))},ipv4(e){return this.check(tp(tg,e))},ipv6(e){return this.check(np(ng,e))},cidrv4(e){return this.check(rp(rg,e))},cidrv6(e){return this.check(ip(ig,e))},e164(e){return this.check(sp(sg,e))},datetime(e){return this.check(lp(Rh,e))},date(e){return this.check(up(zh,e))},time(e){return this.check(dp(Bh,e))},duration(e){return this.check(fp(Vh,e))}});function H(e){return Vf(Ih,e)}var Lh=R(`ZodStringFormat`,(e,t)=>{zu.init(e,t),Fh.init(e,t)}),Rh=R(`ZodISODateTime`,(e,t)=>{id.init(e,t),Lh.init(e,t)}),zh=R(`ZodISODate`,(e,t)=>{ad.init(e,t),Lh.init(e,t)}),Bh=R(`ZodISOTime`,(e,t)=>{od.init(e,t),Lh.init(e,t)}),Vh=R(`ZodISODuration`,(e,t)=>{sd.init(e,t),Lh.init(e,t)}),Hh=R(`ZodEmail`,(e,t)=>{Hu.init(e,t),Lh.init(e,t)});function Uh(e){return Hf(Hh,e)}var Wh=R(`ZodGUID`,(e,t)=>{Bu.init(e,t),Lh.init(e,t)}),Gh=R(`ZodUUID`,(e,t)=>{Vu.init(e,t),Lh.init(e,t)}),Kh=R(`ZodURL`,(e,t)=>{Xu.init(e,t),Lh.init(e,t)});function qh(e){return Jf(Kh,e)}var Jh=R(`ZodEmoji`,(e,t)=>{Zu.init(e,t),Lh.init(e,t)}),Yh=R(`ZodNanoID`,(e,t)=>{Qu.init(e,t),Lh.init(e,t)}),Xh=R(`ZodCUID`,(e,t)=>{$u.init(e,t),Lh.init(e,t)}),Zh=R(`ZodCUID2`,(e,t)=>{ed.init(e,t),Lh.init(e,t)}),Qh=R(`ZodULID`,(e,t)=>{td.init(e,t),Lh.init(e,t)}),$h=R(`ZodXID`,(e,t)=>{nd.init(e,t),Lh.init(e,t)}),eg=R(`ZodKSUID`,(e,t)=>{rd.init(e,t),Lh.init(e,t)}),tg=R(`ZodIPv4`,(e,t)=>{cd.init(e,t),Lh.init(e,t)}),ng=R(`ZodIPv6`,(e,t)=>{ld.init(e,t),Lh.init(e,t)}),rg=R(`ZodCIDRv4`,(e,t)=>{ud.init(e,t),Lh.init(e,t)}),ig=R(`ZodCIDRv6`,(e,t)=>{fd.init(e,t),Lh.init(e,t)}),ag=R(`ZodBase64`,(e,t)=>{hd.init(e,t),Lh.init(e,t)}),og=R(`ZodBase64URL`,(e,t)=>{vd.init(e,t),Lh.init(e,t)}),sg=R(`ZodE164`,(e,t)=>{yd.init(e,t),Lh.init(e,t)}),cg=R(`ZodJWT`,(e,t)=>{xd.init(e,t),Lh.init(e,t)}),lg=R(`ZodNumber`,(e,t)=>{Sd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tm(e,t,n,r),e.isFinite=!0},Bc({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=bm(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=bm(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=bm(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>bm(e).format??null},{gt(e,t){return this.check(wp(e,t))},gte(e,t){return this.check(Tp(e,t))},min(e,t){return this.check(Tp(e,t))},lt(e,t){return this.check(Sp(e,t))},lte(e,t){return this.check(Cp(e,t))},max(e,t){return this.check(Cp(e,t))},int(e){return this.check(U(e))},safe(e){return this.check(U(e))},positive(e){return this.check(wp(0,e))},nonnegative(e){return this.check(Tp(0,e))},negative(e){return this.check(Sp(0,e))},nonpositive(e){return this.check(Cp(0,e))},multipleOf(e,t){return this.check(Ep(e,t))},step(e,t){return this.check(Ep(e,t))},finite(){return this}}));function ug(e){return pp(lg,e)}var dg=R(`ZodNumberFormat`,(e,t)=>{Cd.init(e,t),lg.init(e,t)});function U(e){return hp(dg,e)}var fg=R(`ZodBoolean`,(e,t)=>{wd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Em(e,t,n,r)});function pg(e){return gp(fg,e)}var mg=R(`ZodUndefined`,(e,t)=>{Td.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Am(e,t,n,r)});function hg(e){return _p(mg,e)}var gg=R(`ZodNull`,(e,t)=>{Ed.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>km(e,t,n,r)});function _g(e){return vp(gg,e)}var vg=R(`ZodAny`,(e,t)=>{Dd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function W(){return yp(vg)}var yg=R(`ZodUnknown`,(e,t)=>{Od.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function bg(){return bp(yg)}var xg=R(`ZodNever`,(e,t)=>{kd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mm(e,t,n,r)});function Sg(e){return xp(xg,e)}var Cg=R(`ZodArray`,(e,t)=>{Nh(),Nd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qm(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Op(e,t))},nonempty(e){return this.check(Op(1,e))},max(e,t){return this.check(Dp(e,t))},length(e,t){return this.check(kp(e,t))},unwrap(){return this.element}});function wg(e,t){return Hp(Cg,e,t)}var Tg=R(`ZodObject`,(e,t)=>{Nh(),zd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ym(e,t,n,r),Kc(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ig(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(tc(this._zod.def,{catchall:e}))},passthrough(){return this.clone(tc(this._zod.def,{catchall:bg()}))},loose(){return this.clone(tc(this._zod.def,{catchall:bg()}))},strict(){return this.clone(tc(this._zod.def,{catchall:Sg()}))},strip(){return this.clone(tc(this._zod.def,{catchall:void 0}))},extend(e){return yc(this,e)},safeExtend(e){return xc(this,e)},merge(e){return Sc(this,e)},pick(e){return gc(this,e)},omit(e){return vc(this,e)},partial(...e){return Cc(Bg,this,e[0])},exactPartial(...e){return Cc(Hg,this,e[0],`exactPartial`)},required(...e){return wc(Xg,this,e[0])}});function Eg(e,t){return new Tg({type:`object`,shape:e??{},...I(t)})}function G(e,t){return new Tg({type:`object`,shape:e,catchall:bg(),...I(t)})}var Dg=R(`ZodUnion`,(e,t)=>{Vd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xm(e,t,n,r),e.options=t.options});function Og(e,t){return new Dg({type:`union`,options:e,...I(t)})}var kg=R(`ZodDiscriminatedUnion`,(e,t)=>{Dg.init(e,t),Ud.init(e,t)});function Ag(e,t,n){return new kg({type:`union`,options:t,discriminator:e,...I(n)})}var jg=R(`ZodIntersection`,(e,t)=>{Wd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zm(e,t,n,r)});function Mg(e,t){return new jg({type:`intersection`,left:e,right:t})}var Ng=R(`ZodRecord`,(e,t)=>{Nh(),qd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nh(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Pg(e,t,n){return!t||!t._zod?new Ng({type:`record`,keyType:H(),valueType:e,...I(t)}):new Ng({type:`record`,keyType:e,valueType:t,...I(n)})}var Fg=R(`ZodEnum`,(e,t)=>{Jd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Im(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Fg({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Fg({...t,checks:[],...I(r),entries:i})}});function Ig(e,t){return new Fg({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}var Lg=R(`ZodLiteral`,(e,t)=>{Yd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lm(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new Lg({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}var Rg=R(`ZodTransform`,(e,t)=>{Nh(),Xd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wm(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tl(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ic(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ic(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function zg(e){return new Rg({type:`transform`,transform:e})}var Bg=R(`ZodOptional`,(e,t)=>{Qd.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ph(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vg(e){return new Bg({type:`optional`,innerType:e})}var Hg=R(`ZodExactOptional`,(e,t)=>{$d.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ph(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ug(e){return new Hg({type:`optional`,innerType:e})}var Wg=R(`ZodNullable`,(e,t)=>{ef.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rh(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gg(e){return new Wg({type:`nullable`,innerType:e})}var Kg=R(`ZodDefault`,(e,t)=>{tf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sh(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qg(e,t){return new Kg({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():cc(t)}})}var Jg=R(`ZodPrefault`,(e,t)=>{rf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ch(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yg(e,t){return new Jg({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():cc(t)}})}var Xg=R(`ZodNonOptional`,(e,t)=>{af.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ih(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zg(e,t){return new Xg({type:`nonoptional`,innerType:e,...I(t)})}var Qg=R(`ZodCatch`,(e,t)=>{cf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lh(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $g(e,t){return new Qg({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Jc(t)})}var e_=R(`ZodPipe`,(e,t)=>{lf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uh(e,t,n,r),e.in=t.in,e.out=t.out});function t_(e,t){return new e_({type:`pipe`,in:e,out:t})}var n_=R(`ZodPreprocess`,(e,t)=>{e_.init(e,t),df.init(e,t)}),r_=R(`ZodReadonly`,(e,t)=>{ff.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dh(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function i_(e){return new r_({type:`readonly`,innerType:e})}var a_=R(`ZodLazy`,(e,t)=>{mf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mh(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function o_(e){return new a_({type:`lazy`,getter:e})}var s_=R(`ZodCustom`,(e,t)=>{hf.init(e,t),Ph.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hm(e,t,n,r)});function c_(e,t){return Up(s_,e??(()=>!0),t)}function l_(e,t={}){return Wp(s_,e,t)}function u_(e,t){return Gp(e,t)}function d_(e,t){return new n_({type:`pipe`,in:zg(e),out:t})}var f_=Ig(j),q=c_(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),J=H(),p_=Ig([`developer`,`system`,`assistant`,`user`]),m_=G({type:K(j.TEXT_MESSAGE_START),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),role:p_.optional(),name:H().optional()}),h_=G({type:K(j.TEXT_MESSAGE_CONTENT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),delta:H()}),g_=G({type:K(j.TEXT_MESSAGE_END),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H()}),__=G({type:K(j.TEXT_MESSAGE_CHUNK),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H().optional(),role:p_.optional(),delta:H().optional(),name:H().optional()}),v_=G({type:K(j.TOOL_CALL_START),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:H(),toolCallName:H(),parentMessageId:H().optional()}),y_=G({type:K(j.TOOL_CALL_ARGS),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:H(),delta:H()}),b_=G({type:K(j.TOOL_CALL_END),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:H()}),x_=G({type:K(j.TOOL_CALL_CHUNK),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:H().optional(),toolCallName:H().optional(),parentMessageId:H().optional(),delta:H().optional()}),S_=G({type:K(`text`),id:H().optional(),text:H(),metadata:W().refine(e=>e!==null).optional()}),C_=Ag(`type`,[G({type:K(`data`),value:H(),mimeType:H()}),G({type:K(`url`),value:H(),mimeType:H().optional()}),G({type:K(`file`),value:H(),provider:H().optional(),mimeType:H().optional()})]),w_=Ag(`type`,[S_,G({type:K(`image`),id:H().optional(),source:C_,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`audio`),id:H().optional(),source:C_,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`video`),id:H().optional(),source:C_,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`document`),id:H().optional(),source:C_,metadata:W().refine(e=>e!==null).optional()})]),T_=G({type:K(j.TOOL_CALL_RESULT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),toolCallId:H(),content:Og([H(),wg(w_)]),role:K(`tool`).optional()}),E_=W(),D_=G({type:K(j.STATE_SNAPSHOT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),snapshot:E_.refine(e=>e!==void 0)}),O_=H().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),k_=wg(Ag(`op`,[G({op:K(`add`),path:O_,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`remove`),path:O_}).meta({specOpen:!0}),G({op:K(`replace`),path:O_,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`move`),from:O_,path:O_}).meta({specOpen:!0}),G({op:K(`copy`),from:O_,path:O_}).meta({specOpen:!0}),G({op:K(`test`),path:O_,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0})])),A_=G({type:K(j.STATE_DELTA),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),delta:k_}),j_=G({subagentRunId:J.optional(),id:H(),role:K(`developer`),name:H().optional(),encryptedValue:H().optional(),metadata:q.optional(),content:H()}),M_=G({subagentRunId:J.optional(),id:H(),role:K(`system`),name:H().optional(),encryptedValue:H().optional(),metadata:q.optional(),content:H()}),N_=G({name:H(),arguments:H()}),P_=G({id:H(),type:K(`function`),function:N_,encryptedValue:H().optional(),metadata:q.optional()}),F_=Ag(`role`,[j_,M_,G({subagentRunId:J.optional(),id:H(),role:K(`assistant`),name:H().optional(),encryptedValue:H().optional(),metadata:q.optional(),content:H().optional(),toolCalls:wg(P_).optional()}),G({subagentRunId:J.optional(),id:H(),role:K(`user`),name:H().optional(),encryptedValue:H().optional(),metadata:q.optional(),content:Og([H(),wg(w_)])}),G({subagentRunId:J.optional(),id:H(),role:K(`tool`),content:Og([H(),wg(w_)]),toolCallId:H(),error:H().optional(),encryptedValue:H().optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:H(),role:K(`activity`),activityType:H(),content:c_(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:q.optional()}),G({subagentRunId:J.optional(),id:H(),role:K(`reasoning`),content:H(),encryptedValue:H().optional(),metadata:q.optional()})]),I_=G({type:K(j.MESSAGES_SNAPSHOT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),messages:wg(F_)}),L_=G({type:K(j.ACTIVITY_SNAPSHOT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),activityType:H(),content:c_(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:pg().optional()}),R_=G({type:K(j.ACTIVITY_DELTA),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),activityType:H(),patch:k_}),z_=G({type:K(j.RAW),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),event:W().refine(e=>e!==void 0),source:H().optional()}),B_=G({type:K(j.CUSTOM),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),name:H(),value:W().refine(e=>e!==void 0)}),V_=G({name:H(),description:H(),parameters:W().refine(e=>e!==null).optional(),metadata:q.optional()}),H_=G({description:H(),value:H()}),U_=G({interruptId:H(),status:Ig([`resolved`,`cancelled`]),payload:W().refine(e=>e!==null).optional(),metadata:q.optional()}),W_=G({threadId:H(),runId:H(),protocolVersion:H().optional(),parentRunId:H().optional(),state:E_.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:wg(F_),tools:wg(V_).default(()=>[]),context:wg(H_).default(()=>[]),forwardedProps:W().refine(e=>e!==null).optional(),resume:wg(U_).optional()}),G_=G({type:K(j.RUN_STARTED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:H(),runId:H(),protocolVersion:H().optional(),parentRunId:H().optional(),input:W_.optional()}),K_=G({type:K(`success`),pendingToolCallIds:wg(H()).optional()}),q_=G({subagentRunId:J.optional(),id:H(),reason:H(),message:H().optional(),toolCallId:H().optional(),responseSchema:c_(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:H().optional(),metadata:q.optional()}),J_=Ag(`type`,[K_,G({type:K(`interrupt`),interrupts:wg(q_).min(1)}),G({type:K(`cancelled`)})]),Y_=G({provider:H().optional(),model:H().optional(),inputTokens:U().min(0).max(9007199254740991).optional(),outputTokens:U().min(0).max(9007199254740991).optional(),totalTokens:U().min(0).max(9007199254740991).optional(),reasoningTokens:U().min(0).max(9007199254740991).optional(),cachedInputTokens:U().min(0).max(9007199254740991).optional(),cacheWriteInputTokens:U().min(0).max(9007199254740991).optional()}),X_=G({type:K(j.RUN_FINISHED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:H(),runId:H(),result:W().refine(e=>e!==null).optional(),outcome:J_.optional(),usage:wg(Y_).optional()}),Z_=G({type:K(j.RUN_ERROR),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),message:H(),code:H().optional(),usage:wg(Y_).optional()}),Q_=G({type:K(j.STEP_STARTED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:H()}),$_=G({type:K(j.STEP_FINISHED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:H()}),ev=G({type:K(j.REASONING_START),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H()}),tv=G({type:K(j.REASONING_MESSAGE_START),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),role:K(`reasoning`)}),nv=G({type:K(j.REASONING_MESSAGE_CONTENT),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H(),delta:H()}),rv=G({type:K(j.REASONING_MESSAGE_END),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H()}),iv=G({type:K(j.REASONING_MESSAGE_CHUNK),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H().optional(),delta:H().optional()}),av=G({type:K(j.REASONING_END),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:H()}),ov=Ig([`tool-call`,`message`]),sv=G({type:K(j.REASONING_ENCRYPTED_VALUE),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),subtype:ov,entityId:H(),encryptedValue:H()}),cv=G({type:K(j.SUBAGENT_STARTED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,name:H(),description:H().optional(),parentSubagentRunId:J.optional(),parentToolCallId:H().optional(),parentMessageId:H().optional()}),lv=Ag(`type`,[G({type:K(`success`)}),G({type:K(`suspended`),interruptIds:wg(H()).optional()})]),uv=Ag(`type`,[m_,h_,g_,__,v_,y_,b_,x_,T_,D_,A_,I_,L_,R_,z_,B_,G_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,sv,cv,G({type:K(j.SUBAGENT_FINISHED),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,result:W().refine(e=>e!==null).optional(),outcome:lv.optional()}),G({type:K(j.SUBAGENT_ERROR),timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,message:H(),code:H().optional()})]);Ig([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var dv=G({name:H(),description:H().optional()}),fv=G({name:H().optional(),type:H().optional(),description:H().optional(),version:H().optional(),provider:H().optional(),documentationUrl:H().optional(),metadata:q.optional()}),pv=G({streaming:pg().optional(),websocket:pg().optional(),httpBinary:pg().optional(),pushNotifications:pg().optional(),resumable:pg().optional()}),mv=G({supported:pg().optional(),items:wg(V_).optional(),parallelCalls:pg().optional(),clientProvided:pg().optional()}),hv=G({structuredOutput:pg().optional(),supportedMimeTypes:wg(H()).optional()}),gv=G({snapshots:pg().optional(),deltas:pg().optional(),memory:pg().optional(),persistentState:pg().optional()}),_v=G({supported:pg().optional(),delegation:pg().optional(),handoffs:pg().optional(),subagents:wg(dv).optional()}),vv=G({supported:pg().optional(),streaming:pg().optional(),encrypted:pg().optional()}),yv=G({image:pg().optional(),audio:pg().optional(),video:pg().optional(),pdf:pg().optional(),file:pg().optional()}),bv=G({image:pg().optional(),audio:pg().optional()}),xv=G({input:yv.optional(),output:bv.optional()}),Sv=G({codeExecution:pg().optional(),sandboxed:pg().optional(),maxIterations:U().min(0).max(9007199254740991).optional(),maxExecutionTime:U().min(0).max(9007199254740991).optional()}),Cv=G({supported:pg().optional(),approvals:pg().optional(),interventions:pg().optional(),feedback:pg().optional(),interrupts:pg().optional(),approveWithEdits:pg().optional()});G({identity:fv.optional(),transport:pv.optional(),tools:mv.optional(),output:hv.optional(),state:gv.optional(),multiAgent:_v.optional(),reasoning:vv.optional(),multimodal:xv.optional(),execution:Sv.optional(),humanInTheLoop:Cv.optional(),custom:c_(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),G({subagentRunId:J.optional()}),G({type:f_,timestamp:U().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:H(),role:H(),name:H().optional(),encryptedValue:H().optional(),metadata:q.optional()}),q.optional();function wv(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=Tv&&(i+=r/Tv|0,r%=Tv)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?jv(r,i):Av(r,i)}function Dv(e,t){let n=Av(e,t),r=n.hi&2147483648;r&&(n=jv(n.lo,n.hi));let i=Ov(n.lo,n.hi);return r?`-`+i:i}function Ov(e,t){if({lo:e,hi:t}=kv(e,t),t<=2097151)return String(Tv*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+Mv(o)+Mv(a)}function kv(e,t){return{lo:e>>>0,hi:t>>>0}}function Av(e,t){return{lo:e|0,hi:t|0}}function jv(e,t){return t=~t,e?e=~e+1:t+=1,Av(e,t)}var Mv=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function Nv(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var Pv=Fv();function Fv(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),zv(i)}return Rv}function Vv(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var Hv;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(Hv||={});var Y=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?Vv(e):Bv().encodeUtf8Into,this.buffer=Gv,this.viewCache=Kv,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||Uv;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(Wv),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-Wv,n=Jv(t);return n>Wv&&(this.ensureCapacity(n-Wv),this.buffer.copyWithin(e+n,e+Wv,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(Xv(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(Yv(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=qv){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=Jv(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=Jv(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return Zv(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return Xv(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return Yv(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return Yv(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=Pv.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=Pv.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=Pv.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=Pv.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=Pv.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},Uv=128,Wv=1,Gv=new Uint8Array,Kv=new DataView(Gv.buffer),qv=32;function Jv(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var X=class{constructor(e,t=Bv().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=wv,this.uint32=Nv,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case Hv.Varint:for(;this.buf[this.pos++]&128;);break;case Hv.Bit64:this.pos+=4;case Hv.Bit32:this.pos+=4;break;case Hv.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Hv.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===Hv.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),Pv.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),Pv.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,Pv.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Pv.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Pv.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=qv){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function Yv(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function Xv(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function Zv(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(!Number.isFinite(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var Qv=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function $v(){return{fields:{}}}var ey={encode(e,t=new Y){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&ny.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$v();for(;n.pos>>3){case 1:{if(e!==10)break;let t=ny.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ey.fromPartial(e??{})},fromPartial(e){let t=$v();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=$v();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function ty(){return{key:``,value:void 0}}var ny={encode(e,t=new Y){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ty();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ny.fromPartial(e??{})},fromPartial(e){let t=ty();return t.key=e.key??``,t.value=e.value??void 0,t}};function ry(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Z={encode(e,t=new Y){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&ey.encode(ey.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&ay.encode(ay.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ry();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=ey.unwrap(ey.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=ay.unwrap(ay.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Z.fromPartial(e??{})},fromPartial(e){let t=ry();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=ry();if(e===null)t.nullValue=Qv.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function iy(){return{values:[]}}var ay={encode(e,t=new Y){for(let n of e.values)Z.encode(Z.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=iy();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(Z.unwrap(Z.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ay.fromPartial(e??{})},fromPartial(e){let t=iy();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=iy();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},oy=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function sy(){return{op:0,path:``,from:void 0,value:void 0}}var cy={encode(e,t=new Y){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sy();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cy.fromPartial(e??{})},fromPartial(e){let t=sy();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function ly(){return{text:``,id:void 0,metadata:void 0}}var uy={encode(e,t=new Y){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ly();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uy.fromPartial(e??{})},fromPartial(e){let t=ly();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function dy(){return{source:void 0,metadata:void 0,id:void 0}}var fy={encode(e,t=new Y){return e.source!==void 0&&by.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dy();for(;n.pos>>3){case 1:if(e!==10)break;i.source=by.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fy.fromPartial(e??{})},fromPartial(e){let t=dy();return t.source=e.source!==void 0&&e.source!==null?by.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function py(){return{value:``,mimeType:``}}var my={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=py();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return my.fromPartial(e??{})},fromPartial(e){let t=py();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function hy(){return{value:``,mimeType:void 0}}var gy={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hy();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gy.fromPartial(e??{})},fromPartial(e){let t=hy();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function _y(){return{value:``,provider:void 0,mimeType:void 0}}var vy={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_y();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vy.fromPartial(e??{})},fromPartial(e){let t=_y();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function yy(){return{data:void 0,url:void 0,file:void 0}}var by={encode(e,t=new Y){return e.data!==void 0&&my.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&gy.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&vy.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yy();for(;n.pos>>3){case 1:if(e!==10)break;i.data=my.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=gy.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=vy.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return by.fromPartial(e??{})},fromPartial(e){let t=yy();return t.data=e.data!==void 0&&e.data!==null?my.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?gy.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?vy.fromPartial(e.file):void 0,t}};function xy(){return{source:void 0,metadata:void 0,id:void 0}}var Sy={encode(e,t=new Y){return e.source!==void 0&&by.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xy();for(;n.pos>>3){case 1:if(e!==10)break;i.source=by.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sy.fromPartial(e??{})},fromPartial(e){let t=xy();return t.source=e.source!==void 0&&e.source!==null?by.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Cy(){return{source:void 0,metadata:void 0,id:void 0}}var wy={encode(e,t=new Y){return e.source!==void 0&&by.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Cy();for(;n.pos>>3){case 1:if(e!==10)break;i.source=by.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wy.fromPartial(e??{})},fromPartial(e){let t=Cy();return t.source=e.source!==void 0&&e.source!==null?by.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Ty(){return{source:void 0,metadata:void 0,id:void 0}}var Ey={encode(e,t=new Y){return e.source!==void 0&&by.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ty();for(;n.pos>>3){case 1:if(e!==10)break;i.source=by.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ey.fromPartial(e??{})},fromPartial(e){let t=Ty();return t.source=e.source!==void 0&&e.source!==null?by.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Dy(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Oy={encode(e,t=new Y){return e.text!==void 0&&uy.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&fy.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Sy.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&wy.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Ey.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Dy();for(;n.pos>>3){case 1:if(e!==10)break;i.text=uy.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=fy.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=Sy.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=wy.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=Ey.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Oy.fromPartial(e??{})},fromPartial(e){let t=Dy();return t.text=e.text!==void 0&&e.text!==null?uy.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?fy.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Sy.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?wy.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Ey.fromPartial(e.document):void 0,t}};function ky(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var Ay={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&My.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&ey.encode(ey.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ky();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=My.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=ey.unwrap(ey.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ay.fromPartial(e??{})},fromPartial(e){let t=ky();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?My.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function jy(){return{name:``,arguments:``}}var My={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jy();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return My.fromPartial(e??{})},fromPartial(e){let t=jy();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function Ny(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var Py={encode(e,t=new Y){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)Ay.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)Oy.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&ey.encode(ey.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&ey.encode(ey.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ny();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(Ay.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(Oy.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=ey.unwrap(ey.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=ey.unwrap(ey.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Py.fromPartial(e??{})},fromPartial(e){let t=Ny();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>Ay.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>Oy.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function Fy(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var Iy={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&Z.encode(Z.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&ey.encode(ey.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fy();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=ey.unwrap(ey.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Iy.fromPartial(e??{})},fromPartial(e){let t=Fy();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function Ly(){return{description:``,value:``}}var Ry={encode(e,t=new Y){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ly();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ry.fromPartial(e??{})},fromPartial(e){let t=Ly();return t.description=e.description??``,t.value=e.value??``,t}};function zy(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var By={encode(e,t=new Y){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&Z.encode(Z.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&ey.encode(ey.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zy();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=ey.unwrap(ey.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return By.fromPartial(e??{})},fromPartial(e){let t=zy();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function Vy(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var Hy={encode(e,t=new Y){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&Z.encode(Z.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)Py.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)Iy.encode(n,t.uint32(50).fork()).join();for(let n of e.context)Ry.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&Z.encode(Z.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)By.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Vy();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(Py.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(Iy.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(Ry.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=Z.unwrap(Z.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(By.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hy.fromPartial(e??{})},fromPartial(e){let t=Vy();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>Py.fromPartial(e))||[],t.tools=e.tools?.map(e=>Iy.fromPartial(e))||[],t.context=e.context?.map(e=>Ry.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>By.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function Uy(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var Wy={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&Z.encode(Z.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Uy();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=Z.unwrap(Z.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wy.fromPartial(e??{})},fromPartial(e){let t=Uy();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},Gy=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Ky(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Q={encode(e,t=new Y){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Z.encode(Z.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&ey.encode(ey.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ky();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=ax(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=ey.unwrap(ey.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Q.fromPartial(e??{})},fromPartial(e){let t=Ky();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function qy(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var Jy={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qy();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jy.fromPartial(e??{})},fromPartial(e){let t=qy();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Yy(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var Xy={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yy();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xy.fromPartial(e??{})},fromPartial(e){let t=Yy();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Zy(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var Qy={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zy();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qy.fromPartial(e??{})},fromPartial(e){let t=Zy();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function $y(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var eb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$y();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eb.fromPartial(e??{})},fromPartial(e){let t=$y();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function tb(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var nb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nb.fromPartial(e??{})},fromPartial(e){let t=tb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function rb(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var ib={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ib.fromPartial(e??{})},fromPartial(e){let t=rb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function ab(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var ob={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ab();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ob.fromPartial(e??{})},fromPartial(e){let t=ab();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function sb(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var cb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cb.fromPartial(e??{})},fromPartial(e){let t=sb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function lb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var ub={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)Oy.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(Oy.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ub.fromPartial(e??{})},fromPartial(e){let t=lb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>Oy.fromPartial(e))||[],t}};function db(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var fb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Z.encode(Z.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=db();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fb.fromPartial(e??{})},fromPartial(e){let t=db();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function pb(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var mb={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)cy.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=pb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(cy.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mb.fromPartial(e??{})},fromPartial(e){let t=pb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>cy.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function hb(){return{baseEvent:void 0,messages:[]}}var gb={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)Py.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(Py.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gb.fromPartial(e??{})},fromPartial(e){let t=hb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>Py.fromPartial(e))||[],t}};function _b(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var vb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&ey.encode(ey.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_b();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=ey.unwrap(ey.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vb.fromPartial(e??{})},fromPartial(e){let t=_b();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function yb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var bb={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)cy.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(cy.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bb.fromPartial(e??{})},fromPartial(e){let t=yb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>cy.fromPartial(e))||[],t}};function xb(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var Sb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Z.encode(Z.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sb.fromPartial(e??{})},fromPartial(e){let t=xb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Cb(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var wb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Cb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wb.fromPartial(e??{})},fromPartial(e){let t=Cb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Tb(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var Eb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&Hy.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Tb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=Hy.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Eb.fromPartial(e??{})},fromPartial(e){let t=Tb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?Hy.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function Db(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var Ob={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Wy.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)ix.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Db();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(Wy.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(ix.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ob.fromPartial(e??{})},fromPartial(e){let t=Db();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>Wy.fromPartial(e))||[],t.usage=e.usage?.map(e=>ix.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function kb(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var Ab={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)ix.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(ix.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ab.fromPartial(e??{})},fromPartial(e){let t=kb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>ix.fromPartial(e))||[],t}};function jb(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var Mb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mb.fromPartial(e??{})},fromPartial(e){let t=jb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Nb(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var Pb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Nb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pb.fromPartial(e??{})},fromPartial(e){let t=Nb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Fb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Ib={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ib.fromPartial(e??{})},fromPartial(e){let t=Fb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function Lb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var Rb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rb.fromPartial(e??{})},fromPartial(e){let t=Lb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function zb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var Bb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Bb.fromPartial(e??{})},fromPartial(e){let t=zb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function Vb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Hb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Vb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hb.fromPartial(e??{})},fromPartial(e){let t=Vb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function Ub(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var Wb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ub();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wb.fromPartial(e??{})},fromPartial(e){let t=Ub();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function Gb(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Kb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kb.fromPartial(e??{})},fromPartial(e){let t=Gb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function qb(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var Jb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jb.fromPartial(e??{})},fromPartial(e){let t=qb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function Yb(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var Xb={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xb.fromPartial(e??{})},fromPartial(e){let t=Yb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function Zb(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var Qb={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zb();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qb.fromPartial(e??{})},fromPartial(e){let t=Zb();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function $b(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var ex={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$b();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ex.fromPartial(e??{})},fromPartial(e){let t=$b();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function tx(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var nx={encode(e,t=new Y){return e.textMessageStart!==void 0&&Jy.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Xy.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Qy.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&nb.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&ib.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&ob.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&fb.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&mb.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&gb.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Sb.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&wb.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Eb.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Ob.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Ab.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Mb.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Pb.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&eb.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&cb.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&Xb.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&Qb.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&ex.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&ub.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&vb.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&bb.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&Ib.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&Rb.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&Bb.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&Hb.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&Wb.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&Kb.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&Jb.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tx();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=Jy.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Xy.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=Qy.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=nb.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=ib.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=ob.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=fb.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=mb.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=gb.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=Sb.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=wb.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=Eb.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=Ob.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=Ab.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=Mb.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=Pb.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=eb.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=cb.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=Xb.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=Qb.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=ex.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=ub.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=vb.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=bb.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=Ib.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=Rb.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=Bb.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=Hb.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=Wb.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=Kb.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=Jb.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nx.fromPartial(e??{})},fromPartial(e){let t=tx();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Jy.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Xy.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Qy.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?nb.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?ib.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?ob.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?fb.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?mb.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?gb.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Sb.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?wb.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Eb.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Ob.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Ab.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Mb.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Pb.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?eb.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?cb.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?Xb.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?Qb.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?ex.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?ub.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?vb.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?bb.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?Ib.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?Rb.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?Bb.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?Hb.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?Wb.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?Kb.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?Jb.fromPartial(e.reasoningEncryptedValue):void 0,t}};function rx(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var ix={encode(e,t=new Y){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rx();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=ax(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=ax(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=ax(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=ax(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=ax(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=ax(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ix.fromPartial(e??{})},fromPartial(e){let t=rx();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function ax(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,sx=e=>Array.isArray(e)?e:[],cx=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,lx=()=>{cx()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(j));var ux={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},dx=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),fx=e=>{let t=ox(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},px=e=>{let t=ox(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&fx(e.source)===void 0?void 0:{type:`image`,id:e.id,source:fx(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&fx(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:fx(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&fx(e.source)===void 0?void 0:{type:`video`,id:e.id,source:fx(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&fx(e.source)===void 0?void 0:{type:`document`,id:e.id,source:fx(e.source),metadata:e.metadata}}}},mx=new Set([`activity`]),hx=new Set([`user`,`tool`]),gx=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),_x=e=>{let t=ox(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=gx.has(r),a=i?hx.has(r):sx(t.contentParts).length>0,o=i?mx.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(sx(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&sx(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&sx(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=sx(t.contentParts).map(e=>{let t=px(e);return t===void 0&&lx(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,sx(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},vx=e=>{if(Array.isArray(e)){for(let t of e)vx(t);return}let t=ox(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:vx(t[e])},yx=e=>{let t=ox(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=sx(t.messages).map(_x).filter(e=>e!==void 0),n.tools=sx(t.tools),n.context=sx(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=sx(t.resume),n},bx={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},xx={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function Sx(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function Cx(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=bx[r];t!==void 0&&Cx(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function wx(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)Sx(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=Sx(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=xx[a];if(r!==void 0){let i=bx[r];i!==void 0&&Cx(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function Tx(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function Ex(e,t){let n=new X(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new Y().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?Tx(s):e}var Dx=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function Ox(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var kx=(e,t)=>Ox(e,t,5,15),Ax=(e,t)=>Ox(e,t,10,1);function jx(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function Mx(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(dx.has(a)||!jx(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function Nx(e){wx(e);let t=nx.decode(Ex(e,{singular:dx,descend:xx})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&Mx(e)?new Dx:Error(`Invalid event`);let r=n[0],i=ux[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=ox(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=Gy[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map(_x).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(sx(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),sx(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...sx(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...sx(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:sx(n.interrupts),...sx(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...sx(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...sx(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...sx(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...sx(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&sx(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...sx(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...sx(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...sx(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=oy[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=oy[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&sx(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=sx(e.contentParts).map(e=>{let t=px(e);return t===void 0&&lx(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=yx(a.input)),vx(a),a}var Px=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Fx=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(Px);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ix=e=>e===`*`||e===`x`||e===`X`,Lx=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Rx=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],zx=(e,t)=>{if(Ix(e)||Ix(t))return 0;let[n,r]=Rx(Lx(e),Lx(t));return n>r?1:n{for(let n=0;n{let n=Fx(e),r=Fx(t),i=n.pop(),a=r.pop(),o=Bx(n,r);return o===0?i&&a?Bx(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},Hx=e=>typeof e==`string`&&/^[v\d]/.test(e)&&Px.test(e),Ux=`@ag-ui/client`;function Wx(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,Ux))return;let t=e.metadata?.[Ux];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var $=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function Gx(){return qi()}function Kx(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function qx(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&qx(t);return e}var Jx=524288;function Yx(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function Xx(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!Yx(t,n,Jx),c=s?$(t):t,l=s?$(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(qx(c),qx(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=$(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=$(e.state),d=!0,n=!0),s&&n&&Yx(c,l,Jx)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&Kx(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?$(c):c}:{},...d?{state:Object.isFrozen(l)?$(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function Zx(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function Qx(e){if(e instanceof $x)return e;if(e===!0)return new $x(Zx(!0))}var $x=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function eS(e){return e.enabled?new $x(e):void 0}function tS(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function nS(e,t){return!e||t.metadata===void 0?!1:(e.metadata=$i(e.metadata,$(t.metadata)),!0)}var rS=e=>typeof e==`object`&&e?e.role:void 0;function iS(e){if(rS(e)!==`assistant`)return[];let t=e.toolCalls;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e.id;typeof t==`string`&&n.push(t)}return n}function aS(e){let t=new Map,n=new Map,r=(e,t)=>{t.answered=!0,n.set(e,n.get(e)-1)},i=new Map,a=new Map,o=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},s=-1;for(let c=0;c=0&&u[e].issuer===s;e--)u[e].answered||(d=u[e]);if(d){r(e,d);continue}n.get(e)>0&&o(i,e,c)}else if(u!==`activity`&&u!==`reasoning`){s=c;for(let e of iS(l))o(t,e,{issuer:c,answered:!1}),n.set(e,(n.get(e)??0)+1)}}let c=new Map,l=[],u=(e,t,n)=>{r(e,n),o(c,n.issuer,t),l[t]=!0};for(let[e,n]of i){let r=t.get(e),i=r.length-1;for(let t=n.length-1;t>=0;t--){let a=n[t];for(;i>=0&&(r[i].answered||r[i].issuer>=a);)i--;if(i<0)break;u(e,a,r[i])}}for(let[e,n]of a){let r=t.get(e);r?.length!==1||r[0].answered||u(e,n[0],r[0])}if(c.size===0)return e;for(let e of c.values())e.sort((e,t)=>e-t);let d=[],f,p=()=>{if(f){let t=d.length;for(let e=d.length-1;e>=0;e--){let n=d[e],r=rS(n);if(typeof n==`object`&&n&&r!==`activity`&&r!==`reasoning`)break;r===`reasoning`&&(t=e)}let n=d.splice(t);for(let t of f)d.push(e[t]);for(let e of n)d.push(e)}f=void 0};for(let t=0;te?.function?{...e,function:{...e.function}}:{...e})),t}function sS(e,t,n){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let i of r){let r=i===`content`?n:e[i],a=t[i];if(i===`toolCalls`&&Array.isArray(r)&&Array.isArray(a)){if(!cS(r,a))return!1}else if(r!==a)return!1}return!0}function cS(e,t){if(e.length!==t.length)return!1;for(let n=0;n{let a=Qx(i),o=$(n.messages),s=$(e.state),c={},l=new Set,u=new Set,d=[],f=new Set,p=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:d.filter(e=>!f.has(e))},m=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},h=new WeakMap,g=e=>e.map(e=>{let t=h.get(e);if(t!==void 0&&sS(t.copy,e,t.content))return t.copy;let n=oS(e);return h.set(e,{copy:n,content:e.content}),n}),_=()=>{let e={};return c.messages!==void 0&&(e.messages=g(c.messages)),c.state!==void 0&&(e.state=$(c.state)),c={},e.messages!==void 0||e.state!==void 0?_s(e):zo};return t.pipe(Os(async t=>{let i=await Xx(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(m(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return _();switch(t.type){case j.TEXT_MESSAGE_START:{let i=await Xx(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),_();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=nS(s,t);(!a||c)&&m({messages:o})}return _()}case j.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),_();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),_();let l=await Xx(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return m(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,nS(c,t),m({messages:o})),_()}case j.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),_();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),_();let c=await Xx(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return m(c),c.stopPropagation!==!0&&nS(a,t)&&m({messages:o}),await Promise.all(r.map(t=>t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e}))),_()}case j.TOOL_CALL_START:{let i=await Xx(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;d.includes(e)||d.push(e);let a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(l.has(e)||(l.add(e),a&&u.add(e)),a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(nS(a,t)||r)&&m({messages:o}),_()}let s=new Set(o.map(e=>e.id)),c=tS(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let f={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(f),nS(f,t),m({messages:o})}return _()}case j.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),_();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),_();let d=await Xx(r,o,s,(r,a,o)=>{let s=u.has(i)?``:l.function.arguments,c=l.function.name,d={};try{d=Ls(s)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:a,state:o,agent:n,input:e,toolCallBuffer:s,toolCallName:c,partialToolCallArgs:d})});return m(d),d.stopPropagation!==!0&&(u.delete(i)?l.function.arguments=a:l.function.arguments+=a,nS(l,t),m({messages:o})),_()}case j.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),_();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),_();let d=await Xx(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return m(d),d.stopPropagation!==!0&&(l.delete(i),u.delete(i)),d.stopPropagation!==!0&&nS(c,t)&&m({messages:o}),await Promise.all(r.map(t=>t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e}))),_()}case j.TOOL_CALL_RESULT:{let i=await Xx(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:u}=t;f.add(a);let d=o.findIndex(e=>e.id===i&&e.role===`tool`&&e.toolCallId===a),p={...d===-1?{}:o[d],id:i,toolCallId:a,role:l||`tool`,content:c,...u!=null&&{subagentRunId:u}};if(u??delete p.subagentRunId,nS(p,t),d!==-1)o[d]=p;else{let t=-1,i=-1,c=!1;for(let e=o.length-1;e>=0;e--){let n=o[e];if(rS(n)===`tool`&&n.toolCallId===a)c=!0;else if(iS(n).includes(a)){if(i===-1&&(i=e),!c){t=e;break}c=!1}}if(t===-1&&(t=i),t===-1)o.push(p);else{let e=t+1;for(;et.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})))}m({messages:o})}return _()}case j.STATE_SNAPSHOT:{let i=await Xx(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=$(e),m({state:s})}return _()}case j.STATE_DELTA:{let i=await Xx(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Ia.applyPatch(s,$(e),!0,!1).newDocument,m({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return _()}case j.MESSAGES_SNAPSHOT:{let i=await Xx(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let e=$(t.messages).map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),n=new Map(e.map(e=>[e.id,e])),r=Wx(t),i=e.some(e=>e.role===`activity`),a=e.some(e=>e.role===`reasoning`),s=e=>e.role===`activity`&&(r?!r.includes(e.activityType):r!==null&&!i)||e.role===`reasoning`&&!a;o=o.filter(e=>n.has(e.id)||s(e)).map(e=>n.get(e.id)??e);let c=new Set(o.map(e=>e.id));for(let t of e)c.has(t.id)||o.push(t);o=aS(o),m({messages:o})}return _()}case j.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await Xx(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(m(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:$(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:$(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),nS(d,i),m({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return _()}case j.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return _();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),_();let l=c,u=await Xx(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(m(u),u.stopPropagation!==!0)try{nS(l,i)&&m({messages:o});let e=$(l.content??{}),t=Ia.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:$(t),activityType:i.activityType},m({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return _()}case j.RAW:return m(await Xx(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.CUSTOM:return m(await Xx(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.RUN_STARTED:{let i=await Xx(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),d=[],f=new Set,i.stopPropagation!==!0){l.clear(),u.clear();let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}m({messages:o})}}return _()}case j.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:p(i)},c=await Xx(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return m(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),_()}case j.RUN_ERROR:return m(await Xx(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.STEP_STARTED:return m(await Xx(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.STEP_FINISHED:return m(await Xx(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case j.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case j.REASONING_START:return m(await Xx(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.REASONING_MESSAGE_START:{let i=await Xx(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),_();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=nS(i,t);(!r||a)&&m({messages:o})}return _()}case j.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),_();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),_();let l=await Xx(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return m(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,nS(c,t),m({messages:o})),_()}case j.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),_();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),_();let c=await Xx(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return m(c),c.stopPropagation!==!0&&nS(a,t)&&m({messages:o}),await Promise.all(r.map(t=>t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e}))),_()}case j.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case j.REASONING_END:return m(await Xx(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await Xx(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(m(u),u.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return _()}case j.SUBAGENT_STARTED:return m(await Xx(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.SUBAGENT_FINISHED:return m(await Xx(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_();case j.SUBAGENT_ERROR:return m(await Xx(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),_()}return t.type,_()}),Cs(),r.length>0?js({}):e=>e)};function uS(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var dS=e=>t=>{let n=Qx(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new M(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new M(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Ss(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==j.RUN_STARTED)return F(()=>new M(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==j.RUN_ERROR&&t!==j.RUN_STARTED)return F(()=>new M(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==j.RUN_STARTED&&t!==j.RUN_ERROR)return F(()=>new M(`First event must be 'RUN_STARTED'`))}else if(t===j.RUN_STARTED){if(g&&!c&&!l)return F(()=>new M(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,uS(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===j.SUBAGENT_STARTED||t===j.SUBAGENT_FINISHED||t===j.SUBAGENT_ERROR){let n=t===j.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===j.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return F(()=>new M(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return F(()=>new M(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return F(()=>new M(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return F(()=>new M(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===j.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return F(()=>new M(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case j.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return F(()=>new M(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return F(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),_s(e)}case j.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return F(()=>new M(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?F(()=>i):_s(e)}case j.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return F(()=>new M(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?F(()=>i):(r.delete(n),_s(e))}case j.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return F(()=>new M(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return F(()=>new M(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return F(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return F(()=>new M(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),_s(e)}case j.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return F(()=>new M(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?F(()=>r):_s(e)}case j.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return F(()=>new M(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?F(()=>r):(i.delete(n),_s(e))}case j.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?F(()=>new M(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),_s(e))}case j.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return F(r?()=>new M(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new M(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),_s(e)}case j.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),_s(e)}case j.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),_s(e)}case j.REASONING_START:case j.REASONING_MESSAGE_START:{let n=e.messageId,r=t===j.REASONING_START,i=r?a:o;if(i.has(n))return F(()=>new M(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return F(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),_s(e)}case j.REASONING_MESSAGE_CONTENT:case j.REASONING_MESSAGE_END:case j.REASONING_END:{let n=e.messageId,r=t===j.REASONING_END,i=r?a:o;if(!i.has(n))return F(()=>new M(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?F(()=>c):((t===j.REASONING_END||t===j.REASONING_MESSAGE_END)&&i.delete(n),_s(e))}case j.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?F(()=>o):_s(e)}case j.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?F(()=>r):_s(e)}case j.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return F(()=>new M(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return F(()=>new M(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?F(()=>new M(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?F(()=>new M(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?F(()=>new M(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),_s(e))}case j.SUBAGENT_FINISHED:case j.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return F(()=>new M(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===j.SUBAGENT_ERROR&&typeof e.message!=`string`)return F(()=>new M(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),_s(e)):F(()=>new M(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case j.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return F(()=>t)}return _s(e);case j.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return F(()=>t)}return _s(e);case j.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return F(()=>new M(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,_s(e);case j.RUN_ERROR:return l=!0,_s(e);case j.CUSTOM:return _s(e);default:return _s(e)}}))},fS=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),pS=e=>Ts(()=>gs(e())).pipe(Ns(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return gs(e.text()).pipe(Ss(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,F(()=>i)}))}let t={type:fS.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Eo(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:fS.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):F(()=>Error(`Failed to getReader() from response`))})),mS=10485760,hS=(e,t)=>{let n=Qx(t),r=new Fo,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==fS.HEADERS&&e.type===fS.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>mS){r.error(Error(`SSE buffer size exceeded maximum limit of ${mS/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(`
-`),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(`
-`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},gS=10485760,_S=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,vS=(e,t)=>{let n=Qx(t),r=new Fo,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==fS.HEADERS&&e.type===fS.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>gS){r.error(Error(`Protobuf message size exceeded maximum limit of ${gS/1048576} MB`));return}if(i.length{let n=Qx(t),r=new Fo,i=new Ro(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===fS.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?vS(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):hS(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:j.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},bS={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},xS=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(`
-`)};function SS(e,t){return ta(t)&&CS(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),ea(t)}var CS=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},wS=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Ss(r=>{switch(r.type){case j.TEXT_MESSAGE_START:{let e=r;return[{type:bS.TextMessageStart,messageId:e.messageId,role:e.role}]}case j.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bS.TextMessageContent,messageId:e.messageId,content:e.delta}]}case j.TEXT_MESSAGE_END:{let e=r;return[{type:bS.TextMessageEnd,messageId:e.messageId}]}case j.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bS.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case j.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return CS(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Ls(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:bS.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case j.TOOL_CALL_END:{let e=r;return[{type:bS.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case j.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&CS(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:bS.ActionExecutionResult,actionExecutionId:e.toolCallId,result:SS(e.toolCallId,e.content),actionName:t||`unknown`}]}case j.RAW:return f||(f=!0,CS(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case j.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bS.MetaEvent,name:e.name,value:e.value}]}case j.STATE_SNAPSHOT:return p(r.snapshot),[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case j.STATE_DELTA:{let c=r,l;try{l=Ia.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return CS(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case j.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case j.RUN_STARTED:return[];case j.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=TS(c)}catch(e){return[{type:bS.RunError,message:e.message}]}return[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case j.RUN_ERROR:{let e=r;return[{type:bS.RunError,message:e.message,code:e.code}]}case j.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case j.STEP_FINISHED:return u=[],l=null,[{type:bS.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function TS(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=xS(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:SS(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var ES=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,DS=e=>e===`tool`?`toolCallId`:`messageId`,OS=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},kS=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},AS=(e,t)=>{let n=kS(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},jS=e=>new Set(Object.keys(e.shape)),MS=jS(__),NS=jS(x_),PS=jS(iv),FS=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},IS=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},LS=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&IS(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},RS=e=>t=>{let n=Qx(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:j.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:j.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:j.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&ES(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${DS(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Ss(e=>{switch(e.type){case j.TEXT_MESSAGE_START:case j.TEXT_MESSAGE_CONTENT:case j.TEXT_MESSAGE_END:case j.TOOL_CALL_START:case j.TOOL_CALL_ARGS:case j.TOOL_CALL_END:case j.TOOL_CALL_RESULT:case j.STATE_SNAPSHOT:case j.STATE_DELTA:case j.CUSTOM:case j.STEP_STARTED:case j.STEP_FINISHED:case j.REASONING_START:case j.REASONING_MESSAGE_START:case j.REASONING_MESSAGE_CONTENT:case j.REASONING_MESSAGE_END:case j.REASONING_END:return[...i(e.subagentRunId??void 0),e];case j.RUN_STARTED:case j.RUN_FINISHED:case j.RUN_ERROR:case j.MESSAGES_SNAPSHOT:return[...a(),e];case j.RAW:case j.ACTIVITY_SNAPSHOT:case j.ACTIVITY_DELTA:case j.REASONING_ENCRYPTED_VALUE:case j.SUBAGENT_STARTED:return[e];case j.SUBAGENT_FINISHED:case j.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case j.TEXT_MESSAGE_CHUNK:{let t=e,a=FS(e,MS),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))OS(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),OS(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=kS({type:j.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=AS({...a,type:j.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:j.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return LS(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case j.TOOL_CALL_CHUNK:{let t=e,a=FS(e,NS),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))OS(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),OS(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=kS({type:j.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=AS({...a,type:j.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:j.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return LS(l,a,u,`TOOL_CALL_CHUNK`),l}case j.REASONING_MESSAGE_CHUNK:{let t=e,a=FS(e,PS),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=kS({type:j.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=AS({...a,type:j.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:j.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return LS(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),Ms(()=>{a()}))},zS=1e6;function BS(e){if(e===void 0)return zS;if(e===1/0||Number.isSafeInteger(e)&&e>0)return e;throw new M(`Invalid enforcement entry budget ${String(e)}: expected a positive integer, or Infinity to disable it.`)}var VS=class extends M{constructor(e,t){super(`Enforcement limit exceeded at '${t||`(root)`}': the payload has more than ${e} entries to validate. If it is legitimate, raise or disable the limit (maxEnforcedEntries on the agent, or maxEntries in the enforcement options).`),this.name=`AGUIEnforcementLimitError`,this.limit=e,this.path=t}},HS=Symbol(`agui.strip.drop`);function US(e,t,n){if(e.used+=t,e.used>e.max)throw new VS(e.max,n)}function WS(e){let t=e;for(;;){if(t instanceof Bg||t instanceof Wg||t instanceof Kg||t instanceof r_||t instanceof Qg){t=t.unwrap();continue}if(t instanceof e_){t=t.def.in;continue}if(t instanceof a_){t=t.def.getter();continue}return t}}function GS(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function KS(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function qS(e){let t=WS(e);return t instanceof Lg?KS(t):void 0}function JS(e,t,n,r,i){let a=WS(t);if(a instanceof Tg){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.shape,o=e,s={},c=a.meta()?.specOpen===!0,l=Object.keys(o);US(i,l.length,n);for(let e of l){let a=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(a===void 0){if(c){s[e]=o[e];continue}r.push(`${n}/${e}`);continue}let l=r.length,u=JS(o[e],a,`${n}/${e}`,r,i);if(u===HS){if(r.length=l,a.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return HS}s[e]=u}return s}if(a instanceof Cg){if(!Array.isArray(e))return e;US(i,e.length,n);let t=a.element,o=[];return e.forEach((e,a)=>{let s=r.length,c=JS(e,t,`${n}/${a}`,r,i);if(c===HS){r.length=s,r.push(`${n}/${a}`);return}o.push(c)}),o}if(a instanceof Ng){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.def.valueType,o=e,s={},c=Object.keys(o);US(i,c.length,n);for(let e of c){let a=r.length,c=JS(o[e],t,`${n}/${e}`,r,i);if(c===HS){r.length=a,r.push(`${n}/${e}`);continue}s[e]=c}return s}if(a instanceof Dg){let t=a.options,o=GS(a);if(o!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let a=e[o];for(let s of t){let t=WS(s);if(!(t instanceof Tg))continue;let c=t.shape;if(qS(c[o])===a)return JS(e,s,n,r,i)}return HS}let s=t.filter(e=>WS(e)instanceof Tg),c=typeof e==`object`&&!!e&&!Array.isArray(e);if(s.length>1&&c)return e;for(let a of t){let t=WS(a);if(t instanceof Cg&&Array.isArray(e)||t instanceof Tg&&c)return JS(e,a,n,r,i)}return e}return e}function YS(e,t,n){let r=[],i=JS(e,t,``,r,{used:0,max:BS(n?.maxEntries)});if(i===HS)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:i,stripped:r}}var XS=new Set(Object.values(j));function ZS(e){return XS.has(e.type)}var QS=new Map(uv.options.map(e=>{let t=e.shape;return[String(KS(t.type)),e]})),$S=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function eC(e){$S()||console.warn(`[ag-ui][enforce] ${e}`)}var tC=(e,t)=>{let n=BS(t?.maxEntries);return t=>{let r=Qx(e);return t.pipe(Ss(e=>{if(!ZS(e)){eC(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`);let t={type:e.type};return r?.event(`ENFORCE`,`Unrecognised event dropped:`,t,t),zo}let t=QS.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:i,stripped:a}=YS(e,t,{maxEntries:n});for(let t of a)eC(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return _s(t.parse(i))}))}};function nC(e,t){let n=BS(t?.maxEntries),{value:r,stripped:i}=YS(Zi(e,`RunAgentInput`),W_,{maxEntries:n});for(let e of i)eC(`Removed unrecognised material at '${e}' from the outgoing input.`);return W_.parse(r)}var rC=class{runNext(e,t){return t.run(e).pipe(RS(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new Ro;return lS(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Os(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},iC=class extends rC{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function aC(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function oC(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function sC(e){let t=aC(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function cC(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function lC(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(oC(e)){let n=sC(e);return n.type!==`binary`&&t.some(t=>cC(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var uC=`THINKING_START`,dC=`THINKING_END`,fC=`THINKING_TEXT_MESSAGE_START`,pC=`THINKING_TEXT_MESSAGE_CONTENT`,mC=`THINKING_TEXT_MESSAGE_END`;function hC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var gC={event:[`rawEvent`,`subagentRunId`],[j.RUN_STARTED]:[`parentRunId`,`input`],[j.RUN_FINISHED]:[`result`,`outcome`],[j.RUN_ERROR]:[`usage`],[j.SUBAGENT_FINISHED]:[`result`],[j.TOOL_CALL_START]:[`parentMessageId`],[j.TOOL_CALL_CHUNK]:[`parentMessageId`],[j.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},_C=new Map(Object.entries(gC).filter(([e])=>Object.values(j).includes(e))),vC=e=>uS(e,`an absent field`);function yC(e,t,n,r){if(!hC(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function bC(e,t,n){if(!hC(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function xC(e,t){return bC(e,`content`,e=>{if(!hC(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return yC(e,gC[`input content`],`${e.type} input content`,t);default:return e}})}function SC(e,t=vC){let n=yC(e,gC.RunAgentInput,`RunAgentInput`,t);return n=bC(n,`tools`,e=>yC(e,gC.Tool,`Tool`,t)),n=bC(n,`resume`,e=>yC(e,gC.ResumeEntry,`ResumeEntry`,t)),bC(n,`messages`,e=>xC(e,t))}var CC=class extends rC{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),uS(e,`an absent field`))}}warn(e,t){uS(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=Gx();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(lC),t.run(e).pipe(bs(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===j.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=yC(e,gC.event,void 0,t);let n=_C.get(e.type);switch(n&&(e=yC(e,n,e.type,t)),e.type){case uC:{this.currentReasoningId=Gx();let{title:t,...n}=e;return this.warn(uC,j.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${uC}.title ${JSON.stringify(t)}: ${j.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:j.REASONING_START,messageId:this.currentReasoningId}}case fC:return this.currentMessageId=Gx(),this.warn(fC,j.REASONING_MESSAGE_START),{...e,type:j.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case pC:{let{delta:t,...n}=e;return this.warn(pC,j.REASONING_MESSAGE_CONTENT),{...n,type:j.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(pC,this.currentMessageId),delta:t}}case mC:{let t=this.mintedContinuationId(mC,this.currentMessageId);return this.currentMessageId=null,this.warn(mC,j.REASONING_MESSAGE_END),{...e,type:j.REASONING_MESSAGE_END,messageId:t}}case dC:{let t=this.mintedContinuationId(dC,this.currentReasoningId);return this.currentReasoningId=null,this.warn(dC,j.REASONING_END),{...e,type:j.REASONING_END,messageId:t}}case j.RUN_FINISHED:{let n=e,r=yC(n.outcome,gC[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return bC(r===n.outcome?n:{...n,outcome:r},`usage`,e=>yC(e,gC[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case j.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case j.RUN_STARTED:{let n=SC(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=xC(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),lC(e))}},wC=()=>e=>Ts(()=>{let t=new CC;return e.pipe(bs(e=>t.transformEvent(e)))});function TC(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function EC(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function DC(e){EC()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function OC(e){EC()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function kC(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return OC(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&DC(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var AC=class extends rC{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(kC)};return this.runNext(i,t)}},jC=`THINKING_START`,MC=`THINKING_END`,NC=`THINKING_TEXT_MESSAGE_START`,PC=`THINKING_TEXT_MESSAGE_CONTENT`,FC=`THINKING_TEXT_MESSAGE_END`,IC=class extends rC{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(bs(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case jC:{this.currentReasoningId=Gx();let{title:t,...n}=e;return this.warnAboutTransformation(jC,j.REASONING_START),{...n,type:j.REASONING_START,messageId:this.currentReasoningId}}case NC:return this.currentMessageId=Gx(),this.warnAboutTransformation(NC,j.REASONING_MESSAGE_START),{...e,type:j.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case PC:{let{delta:t,...n}=e;return this.warnAboutTransformation(PC,j.REASONING_MESSAGE_CONTENT),{...n,type:j.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Gx(),delta:t}}case FC:{let t=this.currentMessageId??Gx();return this.warnAboutTransformation(FC,j.REASONING_MESSAGE_END),{...e,type:j.REASONING_MESSAGE_END,messageId:t}}case MC:{let t=this.currentReasoningId??Gx();return this.warnAboutTransformation(MC,j.REASONING_END),{...e,type:j.REASONING_END,messageId:t}}default:return e}}},LC=`SUBAGENT_STARTED`,RC=`SUBAGENT_FINISHED`,zC=`SUBAGENT_ERROR`;function BC(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function VC(e){return e.map(e=>BC(e))}var HC=class extends rC{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>BC(e))};return this.runNext(n,t).pipe(Fs(e=>{let t=e.type;(t===LC||t===RC||t===zC)&&this.warnDroppedLifecycleEvent(t)}),Es(e=>{let t=e.type;return t!==LC&&t!==RC&&t!==zC}),bs(e=>{let t=BC(e);if(t.type===j.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:VC(e.messages)}}if(t.type===j.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>BC(e))}}}if(t.type===j.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:VC(e.input.messages)}}}return t}))}},UC=`1.0.4`,WC=!1,GC=new WeakSet,KC=(e,t)=>/^\d+\.\d+$/.test(e)?Vx(e,t)>0?`newer`:`not-newer`:`uninterpretable`,qC=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(KC(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},JC=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return UC;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return UC;let a=t===`maxProtocolVersion`?n:r;if(!a)return UC;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!WC&&(WC=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=Zx(e),this._debugLogger=eS(this._debug)}get threadId(){return this._threadId??=qi()}set threadId(e){this._threadId=e}get maxEnforcedEntries(){return this._maxEnforcedEntries}set maxEnforcedEntries(e){this._maxEnforcedEntries=BS(e)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?eS(Zx(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!Hx(e))throw new M(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a,maxEnforcedEntries:o}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this._threadId=n,this.messages=$(r??[]),this.state=$(i??{}),this._debug=Zx(a),this._debugLogger=eS(this._debug),this._maxEnforcedEntries=BS(o);let s=this.resolvedCeilingDuringConstruction();Vx(s,`0.0.39`)<=0&&this.middlewares.unshift(new AC),Vx(s,`0.0.45`)<=0&&this.middlewares.unshift(new IC),Vx(s,`0.0.57`)<=0&&this.middlewares.unshift(new HC)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new iC(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??qi();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>qC(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];GC.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new Fo;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ys(wo(()=>[...this.middlewares,new CC].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),tC(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),RS(this.debugLogger),dS(this.debugLogger),e=>e.pipe(Ps(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),Ds(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Ms(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(_s(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Qi}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??qi();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>qC(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Fo;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ys(wo(()=>Ts(()=>this.connect(n)),e=>tC(this.debugLogger,{maxEntries:this.maxEnforcedEntries})(wC()(e)),RS(this.debugLogger),dS(this.debugLogger),e=>e.pipe(Ps(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),Ds(e=>(this.isRunning=!1,e instanceof Qi?zo:this.onError(n,e,a))),Ms(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(_s(null)),{defaultValue:void 0});let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}applyBeforeSourceError(e,t,n){return Ts(()=>{let r,i=t.pipe(Ds(e=>(r={error:e},zo)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(As(Ts(()=>{let e=r;return e?F(()=>e.error):zo})))})}apply(e,t,n){return lS(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Fs(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=aS(t.filter(e=>e.role!==`activity`));return{threadId:this.threadId,runId:e?.runId||qi(),...Vx(this.maxProtocolVersion,UC)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(GC.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new M(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(TC(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new M(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await Xx(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=aS(n.messages.filter(e=>e.role!==`activity`)),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return gs(Xx(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(bs(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await Xx(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e._maxEnforcedEntries=this._maxEnforcedEntries,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??qi();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new CC].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(tC(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),RS(this.debugLogger),dS(this.debugLogger),wS(this.threadId,t.runId,this.agentId),e=>e.pipe(bs(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function YC(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var XC=class extends JC{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(YC(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yS(pS(()=>this.fetch(this.url,this.requestInit(nC(e,{maxEntries:this.maxEnforcedEntries})))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},ZC=class extends pn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:$t(t,n.data),hasPreviousPage:dn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},QC=class extends mn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||$C(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=tn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),gn.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function $C(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ew=class extends rn{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new QC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=tw(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=tw(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=tw(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=tw(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){gn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>an(t,e))}findAll(e={}){return this.getAll().filter(t=>an(e,t))}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return gn.batch(()=>Promise.all(e.map(e=>e.continue().catch(_n))))}};function tw(e){return e.options.scope?.id}var nw=class extends rn{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??on(r,t),a=this.get(i);return a||(a=new sn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){gn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Qt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Qt(e,t)):t}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rw=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new nw,this.#t=e.mutationCache||new ew,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=cn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(en(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=fn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return gn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;gn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return gn.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=gn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(_n).catch(_n)}invalidateQueries(e,t={}){return gn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=gn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(_n)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(_n)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(en(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(en(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return cn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ln(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{yn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ln(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{yn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=on(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Xt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function iw(e,t){return un(e,ZC,t)}var aw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z`}))]]),ow=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),sw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z`}))]]),cw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212ZM163.27,77l-56,24a12,12,0,0,0-6.3,6.3l-24,56A12,12,0,0,0,92.73,179l56-24a12,12,0,0,0,6.3-6.3l24-56A12,12,0,0,0,163.27,77Zm-28.41,57.89-24,10.29,10.29-24,24-10.29Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm16,112L80,176l32-64,64-32Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm51.58,57.79-32,64a4.08,4.08,0,0,1-1.79,1.79l-64,32a4,4,0,0,1-5.37-5.37l32-64a4.08,4.08,0,0,1,1.79-1.79l64-32A4,4,0,0,1,179.58,81.79Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM173.32,74.63l-64,32a6,6,0,0,0-2.69,2.69l-32,64A6,6,0,0,0,80,182a6.06,6.06,0,0,0,2.68-.63l64-32a6,6,0,0,0,2.69-2.69l32-64a6,6,0,0,0-8.05-8.05Zm-33.79,64.9L93.42,162.58l23-46.11,46.11-23Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM174.21,76.42l-64,32a4.08,4.08,0,0,0-1.79,1.79l-32,64A4,4,0,0,0,80,180a4.05,4.05,0,0,0,1.79-.42l64-32a4.08,4.08,0,0,0,1.79-1.79l32-64a4,4,0,0,0-5.37-5.37ZM141,141l-52.08,26L115,115l52.08-26Z`}))]]),lw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M207.86,123.18l16.78-21a99.14,99.14,0,0,0-10.07-24.29l-26.7-3a81,81,0,0,0-6.81-6.81l-3-26.71a99.43,99.43,0,0,0-24.3-10l-21,16.77a81.59,81.59,0,0,0-9.64,0l-21-16.78A99.14,99.14,0,0,0,77.91,41.43l-3,26.7a81,81,0,0,0-6.81,6.81l-26.71,3a99.43,99.43,0,0,0-10,24.3l16.77,21a81.59,81.59,0,0,0,0,9.64l-16.78,21a99.14,99.14,0,0,0,10.07,24.29l26.7,3a81,81,0,0,0,6.81,6.81l3,26.71a99.43,99.43,0,0,0,24.3,10l21-16.77a81.59,81.59,0,0,0,9.64,0l21,16.78a99.14,99.14,0,0,0,24.29-10.07l3-26.7a81,81,0,0,0,6.81-6.81l26.71-3a99.43,99.43,0,0,0,10-24.3l-16.77-21A81.59,81.59,0,0,0,207.86,123.18ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8.06,8.06,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8.06,8.06,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,130.16q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm83.93-32.49q.13-3.51,0-7l15.83-19.79a4,4,0,0,0,.75-3.53A103.64,103.64,0,0,0,218,75.9a4,4,0,0,0-3-2l-25.19-2.8c-1.58-1.71-3.24-3.37-4.95-4.95L182.07,41a4,4,0,0,0-2-3A104,104,0,0,0,154.82,27.5a4,4,0,0,0-3.53.74L131.51,44.07q-3.51-.14-7,0L104.7,28.24a4,4,0,0,0-3.53-.75A103.64,103.64,0,0,0,75.9,38a4,4,0,0,0-2,3l-2.8,25.19c-1.71,1.58-3.37,3.24-4.95,4.95L41,73.93a4,4,0,0,0-3,2A104,104,0,0,0,27.5,101.18a4,4,0,0,0,.74,3.53l15.83,19.78q-.14,3.51,0,7L28.24,151.3a4,4,0,0,0-.75,3.53A103.64,103.64,0,0,0,38,180.1a4,4,0,0,0,3,2l25.19,2.8c1.58,1.71,3.24,3.37,4.95,4.95l2.8,25.2a4,4,0,0,0,2,3,104,104,0,0,0,25.28,10.46,4,4,0,0,0,3.53-.74l19.78-15.83q3.51.13,7,0l19.79,15.83a4,4,0,0,0,2.5.88,4,4,0,0,0,1-.13A103.64,103.64,0,0,0,180.1,218a4,4,0,0,0,2-3l2.8-25.19c1.71-1.58,3.37-3.24,4.95-4.95l25.2-2.8a4,4,0,0,0,3-2,104,104,0,0,0,10.46-25.28,4,4,0,0,0-.74-3.53Zm.17,42.83-24.67,2.74a4,4,0,0,0-2.55,1.32,76.2,76.2,0,0,1-6.48,6.48,4,4,0,0,0-1.32,2.55l-2.74,24.66a95.45,95.45,0,0,1-19.64,8.15l-19.38-15.51a4,4,0,0,0-2.5-.87h-.24a73.67,73.67,0,0,1-9.16,0,4,4,0,0,0-2.74.87l-19.37,15.5a95.33,95.33,0,0,1-19.65-8.13l-2.74-24.67a4,4,0,0,0-1.32-2.55,76.2,76.2,0,0,1-6.48-6.48,4,4,0,0,0-2.55-1.32l-24.66-2.74a95.45,95.45,0,0,1-8.15-19.64l15.51-19.38a4,4,0,0,0,.87-2.74,77.76,77.76,0,0,1,0-9.16,4,4,0,0,0-.87-2.74l-15.5-19.37A95.33,95.33,0,0,1,43.9,81.66l24.67-2.74a4,4,0,0,0,2.55-1.32,76.2,76.2,0,0,1,6.48-6.48,4,4,0,0,0,1.32-2.55l2.74-24.66a95.45,95.45,0,0,1,19.64-8.15l19.38,15.51a4,4,0,0,0,2.74.87,73.67,73.67,0,0,1,9.16,0,4,4,0,0,0,2.74-.87l19.37-15.5a95.33,95.33,0,0,1,19.65,8.13l2.74,24.67a4,4,0,0,0,1.32,2.55,76.2,76.2,0,0,1,6.48,6.48,4,4,0,0,0,2.55,1.32l24.66,2.74a95.45,95.45,0,0,1,8.15,19.64l-15.51,19.38a4,4,0,0,0-.87,2.74,77.76,77.76,0,0,1,0,9.16,4,4,0,0,0,.87,2.74l15.5,19.37A95.33,95.33,0,0,1,212.1,174.34Z`}))]]),uw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),dw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),fw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),pw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z`}))]]),mw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),hw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),gw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),_w=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),vw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),yw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),bw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z`}))]]),xw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z`}))]]),Sw=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),Cw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:aw}));Cw.displayName=`BellIcon`;var ww=Cw,Tw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:ow}));Tw.displayName=`BookOpenIcon`;var Ew=Tw,Dw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:sw}));Dw.displayName=`ChatCircleIcon`;var Ow=Dw,kw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:cw}));kw.displayName=`CompassIcon`;var Aw=kw,jw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:lw}));jw.displayName=`GearIcon`;var Mw=jw,Nw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:uw}));Nw.displayName=`ListMagnifyingGlassIcon`;var Pw=Nw,Fw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:dw}));Fw.displayName=`MagnifyingGlassIcon`;var Iw=Fw,Lw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:fw}));Lw.displayName=`MoonIcon`;var Rw=Lw,zw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:pw}));zw.displayName=`PathIcon`;var Bw=zw,Vw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:mw}));Vw.displayName=`PlugsConnectedIcon`;var Hw=Vw,Uw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:hw}));Uw.displayName=`PlusIcon`;var Ww=Uw,Gw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:gw}));Gw.displayName=`QuestionIcon`;var Kw=Gw,qw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:_w}));qw.displayName=`SidebarSimpleIcon`;var Jw=qw,Yw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:vw}));Yw.displayName=`SignOutIcon`;var Xw=Yw,Zw=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:yw}));Zw.displayName=`SparkleIcon`;var Qw=Zw,$w=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:bw}));$w.displayName=`SquaresFourIcon`;var eT=$w,tT=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:xw}));tT.displayName=`StarIcon`;var nT=tT,rT=k.forwardRef((e,t)=>k.createElement(qe,{ref:t,...e,weights:Sw}));rT.displayName=`SunIcon`;var iT=rT,aT=[`agent-threads`];async function oT(e){let t=await Wt(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var sT=new Set([`create_dashboard`,`edit_dashboard`,`replace_dashboard`,`restore_dashboard_version`]);function cT(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function lT(e){if(typeof e==`string`)try{let t=JSON.parse(e);if(cT(t))return t}catch{}}var uT=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),dT=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function fT(e){return cT(e)&&typeof e.id==`string`&&[`ok`,`empty`,`error`,`invalid`,`not_run`,`partial`,`stale`].includes(String(e.status))&&(e.rows===void 0||dT(e.rows))&&(e.elapsed_ms===void 0||dT(e.elapsed_ms))&&(e.diagnosis===void 0||typeof e.diagnosis==`string`)&&(e.error===void 0||typeof e.error==`string`)}function pT(e){if(!cT(e)||!Number.isInteger(e.base_version)||Number(e.base_version)<0||!Number.isInteger(e.version)||Number(e.version)<1||!Array.isArray(e.changes)||typeof e.layout_changed!=`boolean`||e.dashboard_fields!==void 0&&!uT(e.dashboard_fields)||!e.changes.every(e=>cT(e)&&typeof e.panel_id==`string`&&typeof e.title==`string`&&[`added`,`changed`,`removed`].includes(String(e.kind))&&(e.fields===void 0||uT(e.fields)&&!e.fields.includes(`grid`))&&(e.position_changed===void 0||typeof e.position_changed==`boolean`)))return!1;let t=e.save_check;return cT(t)&&typeof t.checked==`boolean`&&dT(t.elapsed_ms)&&Array.isArray(t.panels)&&t.panels.every(e=>fT(e)&&Number.isInteger(e.rows)&&Number(e.rows)>=0)&&new Set(t.panels.map(e=>e.id)).size===t.panels.length&&(t.reason===void 0||typeof t.reason==`string`)&&(!t.checked||t.panels.every(e=>e.status!==`not_run`))}function mT(e,t,n){let r=-1;n.forEach((n,i)=>{n.role===`tool`&&n.toolCallId===e&&n.content===t&&(r=i)});let i=r<0?n.length:r,a=-1;if(n.slice(0,i).forEach((e,t)=>{e.role===`user`&&(a=t)}),a<0)return null;let o=n.slice(a+1,i).flatMap(e=>e.role===`assistant`?e.toolCalls??[]:[]).filter(t=>t.id===e),s=o.length===1?o[0].function.name:void 0;if(!s||!sT.has(s))return null;let c=lT(t),l=c?.dashboard,u=c?.receipt;return!c||c.error||c.isError||!cT(l)||typeof l.id!=`string`||!l.id||typeof l.name!=`string`||!l.name||!pT(u)||l.version!==u.version||r>=0&&n[r].error?null:{id:l.id,name:l.name,version:u.version,label:s===`create_dashboard`?`Created`:s===`restore_dashboard_version`?`Restored`:`Updated`,receipt:u}}var hT={viz:`chart type`,sql:`SQL`,content:`text`,x_unit:`x-axis unit`,options:`display options`,drill:`drill-down`,click:`click action`,time:`time range`,annotations:`markers`,better:`better direction`,reduce:`summary`,min:`minimum`,max:`maximum`},gT=e=>Object.hasOwn(hT,e)?hT[e]:e.replaceAll(`_`,` `),_T=e=>e.kind===`added`?`+ ${e.title}`:e.kind===`removed`?`− ${e.title}`:`~ ${e.title}${e.fields?.length?`: `+e.fields.map(gT).join(`, `):``}${e.position_changed?` · moved`:``}`;function vT(e){return[...e.changes.map(_T),...e.layout_changed?[`Layout adjusted`]:[],...e.dashboard_fields?.map(e=>`Dashboard: ${gT(e)}`)??[]]}function yT(e,t,n){return e.filter(e=>n.has(e.panel_id)&&!t.some(t=>t.panel_id===e.panel_id&&t.path===e.path))}var bT={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},xT=new Set([`get_insights`,`query_telemetry`,`get_overview`,`get_service_topology`,`get_service_dependencies`,`get_service_performance`,`inspect_trace`,`search_logs`]),ST=(e,t)=>Array.isArray(e)?e.flatMap(e=>cT(e)&&typeof e.path==`string`&&typeof e.message==`string`?[{panel_id:t,path:e.path,message:e.message}]:[]):[],CT=e=>{let t=lT(e)?.error;return cT(t)?t.code:void 0},wT=e=>e.role===`tool`&&CT(e.content)===`interrupted`,TT=e=>![`invalid`,`not_run`].includes(e.status);function ET(e,t){let n=e.findIndex(e=>e.id===t&&e.role===`user`);if(n<0)return null;let r=e.findIndex((e,t)=>t>n&&e.role===`user`),i=e.slice(n+1,r<0?void 0:r),a=new Set(i.flatMap(e=>e.role===`tool`&&CT(e.content)===`answer_only`?[e.toolCallId]:[])),o=i.flatMap((e,t)=>e.role===`assistant`?(e.toolCalls??[]).map(e=>({call:e,index:t})):[]).filter(({call:e})=>!a.has(e.id));if(!o.some(({call:e})=>sT.has(e.function.name)||e.function.name===`preview_panels`))return null;let s={schema:{state:`unobserved`},context:{state:`unobserved`},draft:{state:`unobserved`},validation:{state:`unobserved`},preview:{state:`unobserved`},save:{state:`unobserved`}},c={turn_id:t,stages:s,panel_titles:{},panels:[],problems:[],corrections:[],save_attempts:[],explanations:[],context_counts:{deploys:0,anomalies:0}},l=new Map,u=new Map;for(let{call:e}of o)l.set(e.id,(l.get(e.id)??0)+1);i.forEach((e,t)=>{if(e.role===`tool`){let n=u.get(e.toolCallId)??[];n.push({index:t,message:e}),u.set(e.toolCallId,n)}});let d=new Map,f=new Map,p=[],m,h=!1,g=!1,_=(e,t)=>{for(let n of yT(y.get(e)??[],t,new Set([e])))p.some(e=>e.panel_id===n.panel_id&&e.path===n.path)||p.push(n);y.set(e,t)},v=new Map,y=new Map,b=new Set,x=!1,ee=!1;for(let{call:t,index:n}of o){if(l.get(t.id)!==1)continue;let r=t.function.name,i=lT(t.function.arguments),a=(u.get(t.id)??[]).filter(e=>e.index>n),o=a.length===1||sT.has(r)&&a.length>1&&a.slice(0,-1).every(e=>wT(e.message))?a.at(-1).message:void 0,S=o&&lT(o.content),C=!!S&&o?.role===`tool`&&!o.error&&!S.error&&!S.isError,te=o?C?`complete`:`failed`:`incomplete`;if(r===`get_telemetry_schema`&&(s.schema={state:te}),xT.has(r)){let e=o?.role===`tool`&&!o.error&&!S?.error&&!S?.isError&&typeof o.content==`string`&&o.content.length>0;if(s.context={state:o?e?`complete`:`failed`:`incomplete`},C)for(let[e,t]of[[`deploys`,[`deploys`,`deployments`]],[`anomalies`,[`anomalies`]]])for(let n of t)Array.isArray(S[n])&&(c.context_counts[e]+=S[n].length)}if(r===`preview_panels`||r===`create_dashboard`||r===`replace_dashboard`){let e=r===`preview_panels`?i?.panels:cT(i?.dashboard)?i.dashboard.panels:void 0;if(Array.isArray(e)){c.panel_count=e.length,s.draft={state:`complete`};for(let t of e)cT(t)&&typeof t.id==`string`&&typeof t.title==`string`&&t.title.trim()&&f.set(t.id,t.title)}}if(r===`preview_panels`){x=!0;let e=Array.isArray(i?.panels)?i.panels.flatMap(e=>cT(e)&&typeof e.id==`string`?[e.id]:[]):[];for(let t of e)v.set(t,{id:t,status:`not_run`});let t=C&&Array.isArray(S.panels)&&S.panels.every(fT)?S.panels:void 0,n=typeof S?.elapsed_ms==`number`&&S.elapsed_ms>=0?S.elapsed_ms:void 0;if(s.validation={state:t?t.some(e=>e.status===`invalid`||e.status===`not_run`)||ST(S?.problems,`dashboard`).length?`failed`:`complete`:te===`complete`?`failed`:te},s.preview={state:t?t.every(TT)?`complete`:`incomplete`:te===`complete`?`failed`:te,elapsed_ms:n},!t||e.length===0||t.length!==e.length||new Set(t.map(e=>e.id)).size!==e.length||t.some(t=>!e.includes(t.id))){ee=e.length===0;for(let t of e)o&&b.add(t);continue}ee=!1;for(let t of e)b.delete(t);for(let e of t){let t=ST(e.problems,e.id);if(e.status!==`not_run`)_(e.id,t);else{let n=y.get(e.id)??[];y.set(e.id,[...n,...t.filter(e=>!n.some(t=>t.path===e.path))])}v.set(e.id,e)}c.problems=[...y.values()].flat().concat(ST(S?.problems,`dashboard`))}if(sT.has(r)){let n=o&&mT(t.id,o.content,e),r=!!o&&wT(o),i=!r&&o?.role===`tool`&&(!!o.error||!!S?.error||!!S?.isError);if(g=!!i,h=!!o&&!n&&!i&&!r,s.save={state:n?`complete`:r?`interrupted`:i?`failed`:`incomplete`},n)for(let e of c.save_attempts)e.state===`failed`&&(e.state=`retried`);if(c.save_attempts.push({call_id:t.id,state:s.save.state}),n){m?.id!==n.id&&(m=n,d.clear());for(let e of n.receipt.changes){e.title.trim()&&f.set(e.panel_id,e.title);let t=d.get(e.panel_id);if(t?.kind===`added`&&e.kind===`removed`){d.delete(e.panel_id);continue}if(t?.kind===`added`){d.set(e.panel_id,{panel_id:e.panel_id,title:e.title,kind:`added`});continue}if(e.kind===`removed`){d.set(e.panel_id,e);continue}t&&e.kind===`changed`?d.set(e.panel_id,{...e,fields:[...new Set([...t.fields??[],...e.fields??[]])].sort(),position_changed:t.position_changed||e.position_changed}):d.set(e.panel_id,t?.kind===`removed`&&e.kind===`added`?{...e,kind:`changed`}:e)}let e=S?.dashboard,t=cT(e)?e.spec:void 0;if(cT(t)&&Array.isArray(t.panels))for(let e of t.panels)cT(e)&&typeof e.id==`string`&&typeof e.title==`string`&&e.title.trim()&&f.set(e.id,e.title);let r=c.saved?.id===n.id?c.saved.receipt:void 0;c.saved={...n,label:m.label,receipt:{...n.receipt,base_version:m.receipt.base_version,changes:[...d.values()],layout_changed:m.receipt.base_version!==0&&(n.receipt.layout_changed||!!r?.layout_changed),dashboard_fields:m.receipt.base_version===0?void 0:[...new Set([...r?.dashboard_fields??[],...n.receipt.dashboard_fields??[]])].sort()}},c.panel_count=n.receipt.save_check.panels.length,s.draft={state:`complete`};let i=new Set(n.receipt.save_check.panels.map(e=>e.id));for(let e of n.receipt.save_check.panels)e.status===`invalid`?_(e.id,ST(e.problems,e.id)):TT(e)&&(_(e.id,[]),b.delete(e.id));p=p.filter(e=>i.has(e.panel_id)),c.problems=[...y.values()].flat().filter(e=>i.has(e.panel_id))}}}if(h)return null;c.panel_titles=Object.fromEntries(f),c.corrections=p.map(e=>({...e,title:f.get(e.panel_id)??e.panel_id}));let S=c.saved?new Set(c.saved.receipt.save_check.panels.map(e=>e.id)):void 0;if(c.panels=[...v.values()].filter(e=>!S||S.has(e.id)),x){let e=ee||[...b].some(e=>!S||S.has(e)),t=c.panels.some(e=>e.status===`not_run`),n=c.problems.length>0;s.validation.state=e||n?`failed`:t?`incomplete`:`complete`,s.preview.state=e?`failed`:t||n||c.panels.some(e=>e.status===`invalid`)?`incomplete`:`complete`}let C=c.saved?.receipt.save_check;C&&!C.checked&&c.explanations.push(`Save check incomplete: ${C.reason||`Panels were not checked`}`);for(let e of C?.panels??c.panels)e.status!==`ok`&&c.explanations.push(`${f.get(e.id)??e.id}: ${e.status}${e.error||e.diagnosis?` — ${e.error||e.diagnosis}`:``}`);for(let e of c.problems)c.explanations.push(`${f.get(e.panel_id)??e.panel_id}: ${e.message}`);let te=Object.entries(s).filter(([,e])=>e.state===`incomplete`||e.state===`failed`).map(([e,t])=>`${bT[e]}: ${t.state}`);return te.length&&c.explanations.push(te.join(` · `)),s.save.state===`interrupted`&&c.explanations.push(`Save interrupted · outcome unknown`),g&&c.explanations.push(c.saved?`A later change failed; v${c.saved.version} remains saved`:`Save failed · dashboard was not saved`),c}var DT=(0,k.createContext)(null);function OT(){let e=(0,k.useContext)(DT);if(!e)throw Error(`Pitot app context is unavailable`);return e}var kT=`Build me a dashboard for my services, showing request volume, latency, and errors. Ask me which services to monitor first.`,AT={query_telemetry:{activity:`Querying telemetry…`,title:`Telemetry panels`},get_overview:{activity:`Checking system health…`,title:`System health`},get_service_topology:{activity:`Mapping service dependencies…`,title:`Service map`},get_service_dependencies:{activity:`Tracing service dependencies…`,title:`Service dependencies`},list_panel_exemplars:{activity:`Finding example traces…`,title:`Example traces`},resolve_panel_variables:{activity:`Reading filter choices…`,title:`Filter choices`},query_panel_fragment:{activity:`Refreshing panels…`,title:`Panel refresh`},get_service_performance:{activity:`Reading performance signals…`,title:`Performance`},inspect_trace:{activity:`Inspecting a trace…`,title:`Trace lookup`},search_logs:{activity:`Searching logs…`,title:`Logs`},get_insights:{activity:`Reviewing detected anomalies…`,title:`Detected anomalies`},get_telemetry_schema:{activity:`Reading what telemetry exists…`,title:`Telemetry discovery`},preview_panels:{activity:`Checking dashboard panels…`,title:`Panel check`},list_dashboards:{activity:`Looking through your dashboards…`,title:`Dashboards`},get_dashboard:{activity:`Opening your dashboard…`,title:`Dashboard`},create_dashboard:{activity:`Building your dashboard…`,title:`Dashboard save`},edit_dashboard:{activity:`Updating your dashboard…`,title:`Dashboard save`},replace_dashboard:{activity:`Redesigning your dashboard…`,title:`Dashboard save`},list_dashboard_versions:{activity:`Reading your dashboard history…`,title:`Dashboard history`},restore_dashboard_version:{activity:`Restoring your dashboard…`,title:`Dashboard`}};function jT(e){return AT[e]?.activity??`Working on it…`}function MT(e){return AT[e]?.title??`Analysis step`}function NT(e){switch(e){case`provider_unavailable`:return`Pitot could not reach the model provider. Please try again.`;case`step_limit`:return`Pitot reached its step limit before finishing. Try a narrower question.`;case`time_limit`:return`Pitot reached its 5-minute time limit. Try a smaller request.`;default:return`Pitot could not complete this analysis. Please try again.`}}function PT(e){let t=(0,k.useRef)(new Map);return(0,k.useMemo)(()=>{let n=new Map,r=new Set,i=e.flatMap((e,t)=>e.role===`user`?[t]:[]);i.forEach((a,o)=>{let s=i[o+1]??e.length,c=e[a],l=e[s-1];r.add(c.id);let u=t.current.get(c.id),d=u&&u.last===l&&u.length===s-a?u.receipt:ET(e.slice(a,s),c.id);oe.msecs?(e.seq=UT(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function HT(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=UT(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function UT(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function WT(){return BT()}function GT(){let{setColorScheme:e}=ar(),t=cr(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,k.useState)(!1);return(0,A.jsx)(Bi,{label:`Switch to ${n} theme`,opened:r,children:(0,A.jsx)(Ne,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,A.jsx)(iT,{size:17,weight:`bold`}):(0,A.jsx)(Rw,{size:17,weight:`bold`})})})}function KT(){let e=(0,k.useRef)(null);return(0,k.useRef)({remember(t){e.current=t instanceof HTMLElement?t:null},restore(t){let n=e.current;requestAnimationFrame(()=>(n?.isConnected?n:t)?.focus())}}).current}var qT=`pitot:shortcuts`,JT=0,YT=new Set,XT=()=>{for(let e of YT)e()};function ZT(e){(0,k.useEffect)(()=>(window.addEventListener(qT,e),JT+=1,XT(),()=>{window.removeEventListener(qT,e),--JT,XT()}),[e])}function QT(){return(0,k.useSyncExternalStore)(e=>(YT.add(e),()=>YT.delete(e)),()=>JT>0,()=>!1)}function $T(){let e=QT(),t=(0,k.useRef)(null);return(0,A.jsxs)(Ot,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,A.jsx)(Ot.Target,{children:(0,A.jsx)(Bi,{label:`Help`,children:(0,A.jsx)(Ne,{ref:t,variant:`subtle`,color:`gray`,"aria-label":`Help`,children:(0,A.jsx)(Kw,{size:18,weight:`bold`})})})}),(0,A.jsxs)(Ot.Dropdown,{children:[(0,A.jsx)(Ot.Item,{component:`a`,href:Gt.home,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,A.jsx)(Ew,{size:15}),children:`Documentation`}),e&&(0,A.jsx)(Ot.Item,{leftSection:(0,A.jsx)(Et,{size:15}),rightSection:(0,A.jsx)(Ei,{size:`xs`,children:`?`}),onClick:()=>{t.current?.focus(),window.dispatchEvent(new Event(qT))},children:`Keyboard shortcuts`})]})]})}var eE=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),tE=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function nE(e){return Math.abs(e)<1e-4?e.toExponential(2).replace(/\.?(0+)(?=e)/,``):String(Number(e.toPrecision(3)))}function rE(e,t=tE){return e!==0&&Math.abs(e)<1?nE(e):t.format(e)}function iE(e,t){let n=t===`s`?e*1e3:t===`ns`?e/1e6:e;return e!==0&&n===0?`${nE(e)} ${t}`:n!==0&&Math.abs(n)<1?`${nE(n)} ms`:Ut(n)}var aE=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function oE(e){let t=e,n=0;for(;Math.abs(t)>=1024&&n=1e4?eE:tE);default:return rE(t,Math.abs(t)>=1e4?eE:tE)}}var cE={ms:1,s:1e3,ns:1e-6},lE=[[36e5,`h`],[6e4,`m`],[1e3,`s`],[1,`ms`]];function uE(e,t){let n=e===void 0?void 0:cE[e];if(e===`bytes`&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max)),n=[4,3,2,1].find(n=>e>=1024**n&&Math.abs(t.interval/1024**n*100-Math.round(t.interval/1024**n*100))<1e-6)??0;return e=>Number.isFinite(e)?`${rE(e/1024**n)} ${aE[n]}`:`—`}if(e===`percent`&&t&&t.interval>0){let e=[0,1,2,3,4].find(e=>{let n=t.interval*10**e;return Math.round(n)!==0&&Math.abs(n-Math.round(n))<1e-6*Math.abs(n)});if(e!==void 0){let t=new Intl.NumberFormat(`en`,{minimumFractionDigits:e,maximumFractionDigits:e});return e=>Number.isFinite(e)?`${t.format(e)}%`:`—`}}if(n!==void 0&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max))*n,r=t.interval*n,[i,a]=lE.find(([t])=>e>=t&&Math.abs(r/t*100-Math.round(r/t*100))<1e-6)??[1,`ms`];return e=>Number.isFinite(e)?`${rE(e*n/i)} ${a}`:`—`}return t=>(!e||e===`count`)&&Math.abs(t)>=1e3?rE(t,eE):e===`ms`||e===`s`||e===`ns`?sE(e,t).replace(/(\.\d*?)0+([a-z]*)$/,`$1$2`).replace(/\.([a-z]*)$/,`$1`):sE(e,t)}function dE(e){return e!==void 0&&e!==`count`&&/[^\d\s]$/.test(uE(e)(1).trim())}function fE(e,t,n){return uE(e,n)(t??NaN).replace(/(?<=\d)(ms|ns|s|m|h)\b/g,` $1`)}function pE(e){return Math.max(3,Math.min(10,Math.round(e/70)))-1}function mE(e,t){let n=t===`ms`?1:t===`s`?1e3:t===`ns`?1e-6:void 0,r=e=>{let t=10**Math.floor(Math.log10(e));return[1,2,5,10].map(e=>e*t).find(t=>t>=e)};if(t===`bytes`){let t=Math.min(4,Math.max(0,Math.floor(Math.log(e)/Math.log(1024)))),n=r(Math.max(e/1024**t,+(t===0)));return(n>=1e3&&t<4?1024:n)*1024**t}if(n===void 0)return r(e);let i=e*n,a=[1,10,100,1e3,1e4,6e4,6e5,36e5,36e6].flatMap(e=>[1,2,5].map(t=>e*t)).sort((e,t)=>e-t);return(i<1?r(i):a.find(e=>e>=i)??r(i/36e5)*36e5)/n}function hE(e,t,n,r){e=Number.isFinite(e)?Math.min(0,e):0,t=Number.isFinite(t)?Math.max(0,t):1,t===e&&(t=e+1);let i=pE(r),a=mE(Math.max(t-e,2**-52)/i,n);for(let r=0;r<64&&Math.ceil(t/a)-Math.floor(e/a)>i;r++)a=mE(a*1.01,n);return{min:Math.floor(e/a)*a,max:Math.ceil(t/a)*a,interval:a,splitNumber:i,pitot_unit:n}}function gE(e,t){if(e.type!==`value`&&e.type!==`log`)return e;if(e.type!==`value`||typeof e.min!=`number`||typeof e.max!=`number`)return{...e,splitNumber:pE(t)};let n=typeof e.pitot_unit==`string`?e.pitot_unit:void 0,r=hE(e.min,e.max,n,t);return{...e,...r,...n&&(n in cE||n===`bytes`||n===`percent`)?{axisLabel:{...e.axisLabel,formatter:uE(n,r)}}:{}}}function _E(e,t,n){let r=e=>sE(n,e),i=``;if(n===`ms`||n===`s`||n===`ns`){let a=n===`s`?1e3:n===`ns`?1e-6:1,o=Math.abs((e??t??0)*a),s=o>=6e4?6e4:o>=1e3?1e3:1;i=s===6e4?` min`:s===1e3?` s`:` ms`;let c=s===6e4?1:s===1e3?+(o<1e4):2,l=new Intl.NumberFormat(void 0,{maximumFractionDigits:c});r=e=>l.format(e*a/s)}return t===null&&e!==null?`≥${r(e)}${i}`:(e===null||e===0)&&t!==null?`<${r(t)}${i}`:`${e===null?`−∞`:r(e)}–${t===null?`∞`:r(t)}${i}`}function vE(e){let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0?t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}):t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}function yE(e,t=new Date,n){let r=new Date(e);if(!Number.isFinite(r.getTime()))return`—`;let i=new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,...r.getFullYear()===t.getFullYear()?{}:{year:`numeric`},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(r),a=i.filter(e=>[`month`,`day`,`year`].includes(e.type)).map(e=>e.value),o=i.filter(e=>[`hour`,`minute`,`second`].includes(e.type)).map(e=>e.value);return`${a.join(` `)} ${o.join(`:`)}`}var bE=[{path:`/explore`,label:`Explore`,Icon:Aw},{path:`/logs`,label:`Logs`,Icon:Pw},{path:`/traces`,label:`Traces`,Icon:Bw},{path:`/alerts`,label:`Alerts`,Icon:ww},{path:`/settings`,label:`Settings`,Icon:Mw}];async function xE(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await Wt(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function SE({collapsed:e=!1,agentAvailable:t,activeThreadID:n,activeDashboardID:r,activePath:i,autoFocusSearch:a=!1,onNewChat:o,onSelectThread:s,onDeletedThread:l,onSelectDashboard:d,onCreateDashboard:f,onNewDashboard:p,onNavigate:h,onInvestigateService:g,ref:_}){let v=Zt(),[y,b]=(0,k.useState)(``),[x]=er(y.trim(),250),[ee,S]=(0,k.useState)(null),[C,w]=(0,k.useState)(null),[ne,re]=(0,k.useState)(``),[ie,ae]=(0,k.useState)(``),[oe,se]=(0,k.useState)(!1),ce=(0,k.useRef)(null);(0,k.useImperativeHandle)(_,()=>({focusSearch:()=>ce.current?.focus()}),[]),(0,k.useEffect)(()=>{a&&requestAnimationFrame(()=>ce.current?.focus())},[a]);let le=iw({queryKey:[...aT,x],queryFn:({pageParam:e})=>xE(x,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:t}),ue=hn({queryKey:Pt,queryFn:It,refetchInterval:3e4,staleTime:Nt}),de=(0,k.useMemo)(()=>le.data?.pages.flatMap(e=>e.items)??[],[le.data]),pe=(0,k.useMemo)(()=>OE(de),[de]),T=hn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>oT(`/api/telemetry/schema?window=1h`),enabled:t&&!!x&&!!g,staleTime:6e4}),me=(0,k.useMemo)(()=>{if(!x)return[];let e=x.toLowerCase();return(T.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[T.data,x]),he=(0,k.useMemo)(()=>{let e=ue.data??[],t=x.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[ue.data,x]);function ge(e){ae(``),re(e.title),S(e)}async function _e(){if(ee&&ne.trim()){se(!0),ae(``);try{let e=await Wt(`/api/agent/threads/${encodeURIComponent(ee.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:ne.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await v.invalidateQueries({queryKey:aT}),S(null)}catch(e){ae(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{se(!1)}}}async function ve(){if(C){se(!0),ae(``);try{let e=await Wt(`/api/agent/threads/${encodeURIComponent(C.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=C.id;w(null),await v.invalidateQueries({queryKey:aT}),await v.invalidateQueries({queryKey:Pt}),l(t)}catch(e){ae(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{se(!1)}}}return e?(0,A.jsxs)(te,{gap:4,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,A.jsx)(Ne,{variant:`subtle`,color:`gray`,size:46,"aria-label":`New chat`,title:`New chat`,onClick:o,children:(0,A.jsx)(Ww,{size:18})}),t&&(0,A.jsxs)(Ot,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,A.jsx)(Ot.Target,{children:(0,A.jsx)(Ne,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Chats`,title:`Chats`,className:`rail-row`,"data-active":!!n||void 0,children:(0,A.jsx)(Ow,{size:18})})}),(0,A.jsxs)(Ot.Dropdown,{maw:280,children:[(0,A.jsx)(Ot.Label,{children:`Recent chats`}),le.isPending?(0,A.jsx)(Ot.Item,{disabled:!0,children:`Loading chats…`}):le.isError?(0,A.jsx)(Ot.Item,{onClick:()=>void le.refetch(),children:`Chats could not be loaded. Retry`}):de.length===0&&(0,A.jsx)(Ot.Item,{disabled:!0,children:`No chats yet`}),de.slice(0,10).map(e=>(0,A.jsx)(Ot.Item,{"aria-current":e.id===n?`page`:void 0,fw:e.id===n?600:void 0,onClick:()=>s(e.id),children:(0,A.jsx)(D,{size:`sm`,truncate:!0,children:e.title||`Untitled chat`})},e.id))]})]}),bE.map(({path:e,label:t,Icon:n})=>(0,A.jsx)(Ne,{component:`a`,href:e,title:t,"aria-label":t,"aria-current":i===e||i?.startsWith(`${e}/`)?`page`:void 0,className:`rail-row`,"data-active":i===e||i?.startsWith(`${e}/`)||void 0,variant:`subtle`,color:`gray`,size:46,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),h(e))},children:(0,A.jsx)(n,{size:18})},e)),(0,A.jsxs)(Ot,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,A.jsx)(Ot.Target,{children:(0,A.jsx)(Ne,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Dashboards`,title:`Dashboards`,className:`rail-row`,"data-active":!!r||void 0,children:(0,A.jsx)(eT,{size:18})})}),(0,A.jsxs)(Ot.Dropdown,{maw:280,children:[(0,A.jsx)(Ot.Label,{children:`Dashboards`}),ue.isPending&&(0,A.jsx)(Ot.Item,{disabled:!0,children:`Loading dashboards…`}),ue.isError&&(0,A.jsx)(Ot.Item,{onClick:()=>void ue.refetch(),children:`Dashboards could not be loaded. Retry`}),(ue.data??[]).map(e=>(0,A.jsx)(Ot.Item,{"aria-current":e.id===r?`page`:void 0,fw:e.id===r?600:void 0,onClick:()=>d(e.id),children:(0,A.jsx)(D,{size:`sm`,truncate:!0,children:e.name})},e.id)),ue.data?.length?(0,A.jsx)(Ot.Divider,{}):null,(0,A.jsx)(Ot.Item,{leftSection:(0,A.jsx)(Ww,{size:14}),onClick:p,children:`New dashboard`})]})]})]}):(0,A.jsxs)(te,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,A.jsx)(we,{leftSection:(0,A.jsx)(Ww,{size:16,weight:`bold`}),onClick:o,children:`New chat`}),(0,A.jsx)(O,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,A.jsxs)(te,{gap:`lg`,pb:`sm`,children:[t&&(0,A.jsxs)(te,{gap:4,children:[(0,A.jsx)(CE,{children:`Chats`}),le.isLoading&&(0,A.jsx)(fe,{state:`loading`,rows:3}),le.isError&&(0,A.jsx)(fe,{state:`error`,error:{message:`Chats could not be loaded.`,onRetry:()=>void le.refetch()}}),!le.isLoading&&!le.isError&&de.length===0&&(0,A.jsx)(D,{size:`xs`,c:`dimmed`,px:`sm`,children:x?`No matching chats. Try another name.`:`No chats yet. Start one above.`}),pe.map(e=>(0,A.jsxs)(te,{gap:2,children:[pe.length>1&&(0,A.jsx)(D,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,A.jsx)(wE,{thread:e,active:(i?i.startsWith(`/chat/`):!r)&&e.id===n,onSelect:()=>s(e.id),onRename:()=>ge(e),onDelete:()=>{ae(``),w(e)}},e.id))]},e.label)),le.hasNextPage&&(0,A.jsx)(we,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:le.isFetchingNextPage,onClick:()=>void le.fetchNextPage(),children:`See all`})]}),t&&x&&g&&T.isLoading&&(0,A.jsx)(fe,{state:`loading`,rows:3}),t&&x&&g&&(T.isSuccess||T.isError)&&(0,A.jsxs)(te,{gap:4,children:[(0,A.jsx)(CE,{children:`Services`}),T.isError&&(0,A.jsx)(D,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),T.isSuccess&&me.length===0&&(0,A.jsx)(fe,{state:`empty`,variant:`inline`,empty:{title:`No matching services`,description:`Try a different service name.`,action:(0,A.jsx)(we,{variant:`subtle`,size:`compact-xs`,onClick:()=>b(``),children:`Clear search`})}}),me.map(e=>(0,A.jsx)(Ve,{className:`rail-row`,p:`sm`,onClick:()=>g(e),children:(0,A.jsx)(D,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,A.jsx)(te,{gap:0,children:bE.map(({path:e,label:t,Icon:n})=>{let r=i===e;return(0,A.jsx)(Ve,{component:`a`,href:e,className:`rail-row`,"data-active":r||void 0,"aria-current":r?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),h(e))},children:(0,A.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,A.jsx)(n,{size:16}),(0,A.jsx)(D,{size:`sm`,fw:r?600:500,children:t})]})},e)})}),(0,A.jsxs)(te,{gap:4,children:[(0,A.jsx)(CE,{children:`Dashboards`}),ue.isLoading&&(0,A.jsx)(fe,{state:`loading`,rows:3}),ue.isError&&(0,A.jsx)(Le,{tone:`danger`,children:`Dashboards could not be loaded.`}),!ue.isLoading&&!ue.isError&&x&&he.length===0&&(0,A.jsx)(fe,{state:`empty`,variant:`inline`,empty:{title:`No matching dashboards`,description:`Try a different dashboard name.`,action:(0,A.jsx)(we,{variant:`subtle`,size:`compact-xs`,onClick:()=>b(``),children:`Clear search`})}}),he.map(e=>{let n=(!i||i.startsWith(`/dashboards`))&&e.id===r;return(0,A.jsxs)(te,{gap:0,children:[(0,A.jsx)(Ve,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":n||void 0,"aria-current":n?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),d(e.id))},children:(0,A.jsxs)(m,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,A.jsxs)(m,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,flex:1},children:[(0,A.jsx)(eT,{size:16,style:{flexShrink:0}}),(0,A.jsx)(D,{size:`sm`,fw:n?600:500,truncate:!0,title:e.name,children:e.name})]}),e.is_default&&(0,A.jsx)(Bi,{label:`Default`,children:(0,A.jsx)(c,{size:16,variant:`light`,color:`gray`,role:`img`,"aria-label":`Default`,style:{flexShrink:0},children:(0,A.jsx)(nT,{size:12,weight:`fill`,"aria-hidden":`true`})})})]})}),t&&e.origin&&(0,A.jsx)(Ve,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.origin.thread_id))},children:(0,A.jsxs)(D,{size:`xs`,c:`dimmed`,lineClamp:2,title:`Built from: ${e.origin.request_excerpt}`,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),(0,A.jsx)(we,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,A.jsx)(Ww,{size:14}),onClick:p,children:`New dashboard`}),t&&(0,A.jsx)(we,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,A.jsx)(Qw,{size:14,weight:`fill`}),onClick:f,children:`Create with AI`})]})]})}),(0,A.jsx)(Ge,{ref:ce,value:y,onChange:e=>b(e.currentTarget.value),leftSection:(0,A.jsx)(Iw,{size:15}),rightSection:(0,A.jsx)(Ei,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,A.jsx)(u,{opened:ee!==null,onClose:()=>!oe&&S(null),title:`Rename chat`,centered:!0,children:(0,A.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_e()},children:(0,A.jsxs)(te,{children:[(0,A.jsx)(Ge,{label:`Name`,value:ne,onChange:e=>re(e.currentTarget.value),maxLength:120,autoFocus:!0}),ie&&(0,A.jsx)(Le,{tone:`danger`,children:ie}),(0,A.jsxs)(m,{justify:`flex-end`,children:[(0,A.jsx)(we,{variant:`default`,onClick:()=>S(null),disabled:oe,children:`Cancel`}),(0,A.jsx)(we,{type:`submit`,loading:oe,disabled:!ne.trim(),children:`Save`})]})]})})}),(0,A.jsxs)(He,{opened:C!==null,onClose:()=>w(null),title:`Delete chat?`,confirmLabel:`Delete chat`,tone:`danger`,pending:oe?`confirm`:null,error:ie||void 0,onConfirm:()=>void ve(),children:[`This permanently removes `,(0,A.jsx)(D,{span:!0,ff:`monospace`,children:C?.title}),` and its saved messages.`]})]})}function CE({children:e}){return(0,A.jsx)(D,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function wE({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,A.jsx)(w,{"data-active":t||void 0,className:`rail-row`,children:(0,A.jsxs)(m,{gap:2,wrap:`nowrap`,children:[(0,A.jsx)(Ve,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,A.jsxs)(te,{gap:0,pl:24,style:{position:`relative`},children:[(0,A.jsx)(Ow,{size:16,style:{position:`absolute`,left:0,top:2}}),(0,A.jsx)(D,{size:`sm`,fw:t?600:500,truncate:!0,title:e.title,children:e.title}),(0,A.jsx)(D,{c:`dimmed`,size:`xs`,ff:`monospace`,children:kE(e.updated_at)})]})}),(0,A.jsxs)(Ot,{position:`bottom-end`,withinPortal:!0,children:[(0,A.jsx)(Ot.Target,{children:(0,A.jsx)(Ne,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,A.jsx)(jt,{size:18,weight:`bold`})})}),(0,A.jsxs)(Ot.Dropdown,{children:[(0,A.jsx)(Ot.Item,{leftSection:(0,A.jsx)(Ct,{size:15}),onClick:r,children:`Rename`}),(0,A.jsx)(Ot.Item,{color:`bad`,leftSection:(0,A.jsx)(ht,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function TE(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function EE(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var DE=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function OE(e){let t=EE(new Date),n=new Map;for(let r of e){let e=Math.floor((t-EE(TE(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return DE.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function kE(e){return yE(TE(e).valueOf())}var AE=(0,k.lazy)(()=>st(()=>import(`./new-dashboard-BtUyT1gT.js`).then(e=>({default:e.NewDashboard})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])));function jE({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=OT(),s=$e(),c=Qn({select:e=>e.location.pathname}),{dashboardId:l}=ut({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=tr(!1),[p,h]=(0,k.useState)(!1),[g,_]=(0,k.useState)(!1),[v,y]=(0,k.useState)(``),[b,x]=(0,k.useState)(!1),ee=(0,k.useRef)(null),S=(0,k.useRef)(null),C=KT(),te=he(`(max-width: 62em)`),ne=he(`(max-width: 48em)`),re=(0,k.useRef)(te),ie=()=>{te?(_(!0),f.open()):(h(!1),requestAnimationFrame(()=>ee.current?.focusSearch()))};re.current=te,(0,k.useEffect)(()=>{f.close()},[c]),(0,k.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),re.current?(_(!0),f.open()):(h(!1),requestAnimationFrame(()=>ee.current?.focusSearch())))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let ae={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,activePath:c,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(kT),onNewDashboard:()=>{C.remember(re.current?S.current:document.activeElement),f.close(),x(!0)},onNavigate:e=>void s({to:e}),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)},oe=()=>{x(!1),C.restore()};return(0,A.jsxs)(li,{header:{height:56},navbar:{width:p?56:248,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,A.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,A.jsx)(li.Header,{children:(0,A.jsxs)(m,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,A.jsxs)(m,{gap:`sm`,wrap:`nowrap`,children:[(0,A.jsx)(Ci,{ref:S,hiddenFrom:`md`,opened:d,"aria-expanded":d,onClick:()=>{_(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,A.jsx)(Ne,{visibleFrom:`md`,variant:`subtle`,color:`gray`,"aria-label":p?`Expand navigation`:`Collapse navigation`,"aria-expanded":!p,onClick:()=>h(e=>!e),children:(0,A.jsx)(Jw,{size:18})}),(0,A.jsx)(Be,{size:`small`})]}),ne?(0,A.jsx)(Ne,{variant:`default`,size:`lg`,"aria-label":`Search`,onClick:ie,children:(0,A.jsx)(Iw,{size:16})}):(0,A.jsx)(we,{variant:`default`,color:`gray`,leftSection:(0,A.jsx)(Iw,{size:16}),onClick:ie,children:`Search · ⌘K`}),(0,A.jsx)(w,{id:`shell-time-range`,visibleFrom:`sm`}),(0,A.jsxs)(m,{gap:`xs`,wrap:`nowrap`,children:[(0,A.jsx)($T,{}),(0,A.jsx)(GT,{}),(0,A.jsx)(ME,{onError:y})]})]})}),(0,A.jsx)(li.Navbar,{p:p?4:`sm`,children:(0,A.jsx)(SE,{ref:ee,...ae,collapsed:p})}),(0,A.jsx)(gt,{opened:d,onClose:f.close,returnFocus:!b,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,A.jsx)(Be,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,A.jsx)(SE,{...ae,autoFocusSearch:d&&g})}),(0,A.jsxs)(li.Main,{id:`main`,tabIndex:-1,children:[v&&(0,A.jsx)(Le,{tone:`danger`,onDismiss:()=>y(``),children:v}),e]}),b&&(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(AE,{onClose:oe,onCreated:e=>{x(!1),s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}})}})})]})}function ME({onError:e}){let t=$e(),n=Jt(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,A.jsxs)(Ot,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,A.jsx)(Ot.Target,{children:(0,A.jsx)(Ne,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`${r} account menu`,children:(0,A.jsx)(bi,{size:26,radius:`xl`,color:`gray`,children:r})})}),(0,A.jsxs)(Ot.Dropdown,{children:[(0,A.jsx)(Ot.Label,{children:n.email||`Signed in`}),(0,A.jsx)(Ot.Item,{leftSection:(0,A.jsx)(Hw,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,A.jsx)(Ot.Divider,{}),(0,A.jsx)(Ot.Item,{leftSection:(0,A.jsx)(Xw,{size:15}),onClick:()=>void qt().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function NE(){let{agent_available:e}=Kt(),t=$e(),n=Zt(),{threadId:r}=ut({strict:!1}),[i,a]=(0,k.useState)(WT),o=(0,k.useRef)(new Set),s=r??i,[c,l]=(0,k.useState)([]),[u,d]=(0,k.useState)({}),[f,p]=(0,k.useState)(``),[m,h]=(0,k.useState)(!1),[g,_]=(0,k.useState)(!1),[v,y]=(0,k.useState)(``),[b,x]=(0,k.useState)(!1),ee=(0,k.useRef)(!1),[S,C]=(0,k.useState)(``),[te,w]=(0,k.useState)(``),[ne,re]=(0,k.useState)(0),ie=(0,k.useRef)(null),ae=(0,k.useRef)({}),oe=(0,k.useRef)(null),se=(0,k.useRef)(new Map),ce=(0,k.useMemo)(()=>new XC({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>Wt(e,t)}),[s]),le=!e||f===s;function ue(){se.current.clear(),y(``)}function de(e){return ee.current||e instanceof Error&&e.name===`AbortError`}(0,k.useEffect)(()=>{let t=!0;if(l([]),ae.current={},d({}),p(``),h(!1),_(!1),ee.current=!1,x(!1),ue(),w(``),!e){p(s);return}!r||o.current.has(s)?(ce.setMessages([]),p(s)):Wt(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}ce.setMessages(e.messages??[]),l(e.messages??[]),p(s)}}).catch(()=>{t&&(ie.current=null,w(`This chat could not be restored. Start a new chat or try again.`))});let i=ce.subscribe({onMessagesChanged:({messages:e})=>l([...e]),onRunInitialized:()=>{ee.current=!1,x(!1),_(!0),w(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&y(``)},onToolCallStartEvent:({event:e})=>{se.current.set(e.toolCallId,jT(e.toolCallName)),y(jT(e.toolCallName))},onToolCallResultEvent:({event:e,messages:t})=>{se.current.delete(e.toolCallId),y([...se.current.values()].at(-1)??`Analyzing your system`);let r=mT(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:Pt}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||ee.current?(w(``),x(!0)):(console.warn(`Agent run error`,e.code),w(NT(e.code))),_(!1),ue()},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),ue(),o.current.delete(s),n.invalidateQueries({queryKey:aT})},onRunFailed:e=>{de(e.error)?(w(``),x(!0)):(console.error(`Agent run failed`,e),w(NT())),_(!1),ue(),o.current.delete(s),n.invalidateQueries({queryKey:aT})}});return()=>{t=!1,i.unsubscribe(),ce.abortRun()}},[ce,e,n,ne,s]),(0,k.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>oe.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>oe.current?.focus()))),e.key===`Escape`&&n===oe.current&&(C(``),oe.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function fe(){_(!0),w(``);try{let{context:e=[],...t}=ae.current;await ce.runAgent({context:e,forwardedProps:t})}catch(e){de(e)?(w(``),x(!0)):(console.error(`Agent run failed`,e),w(NT())),_(!1),ue(),o.current.delete(s)}}async function pe(n,i){let a=n.trim();if(!e||!a||g||!le||m)return;ae.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:WT(),role:`user`,content:a};ce.addMessage(c),l([...ce.messages]),d(e=>({...e,[c.id]:Date.now()})),C(``),await fe()}(0,k.useEffect)(()=>{let e=ie.current;le&&r&&e&&(ie.current=null,pe(e.text,e.options))},[le,r,s]);function T(e){e.preventDefault(),pe(S)}function me(){ee.current=!0,w(``),x(!0),ce.abortRun(),_(!1),ue(),o.current.delete(s)}function he(){!g&&ce.messages.some(e=>e.role===`user`)&&fe()}function ge(n,r){if(!e)return;let i=WT();o.current.add(i),ie.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function _e(){ce.abortRun(),ie.current=null,ae.current={},a(WT()),t({to:`/chat`})}function ve(e){ie.current=null,ae.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function ye(){re(e=>e+1)}return(0,A.jsx)(DT.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:le,running:g,activity:v,stopped:b,input:S,setInput:C,error:te,inputRef:oe,send:pe,submit:T,stop:me,retry:he,reloadThread:ye,openChat:ge,newThread:_e,selectThread:ve},children:(0,A.jsx)(jE,{children:(0,A.jsx)(Hn,{})})})}function PE(){let e=(0,k.useMemo)(()=>new rw,[]);return(0,A.jsx)(vn,{client:e,children:(0,A.jsx)(Yt,{children:(0,A.jsx)(NE,{})})})}var FE=ft({component:PE,notFoundComponent:()=>(0,A.jsx)(et,{to:`/`,replace:!0})}),IE=dt(`/`)({component:pt(()=>st(()=>import(`./routes-D2AdaqvY.js`),__vite__mapDeps([21,1,7])),`component`)}),LE=dt(`/alerts`)({component:pt(()=>st(()=>import(`./alerts-DLSFnvQQ.js`),__vite__mapDeps([22,1,2,7,3,4,5,6,17,13,14,23,8,24,18,16,20])),`component`)}),RE=dt(`/explore`)({component:pt(()=>st(()=>import(`./explore-Czjh9yv1.js`),__vite__mapDeps([25,1,7,18,3,2,4,5,6,9,10,11,12,13,14,8,15,16,17,19])),`component`),validateSearch:e=>bn(xn(e))}),zE=dt(`/logs`)({component:pt(()=>st(()=>import(`./logs-BPZsxAQ7.js`),__vite__mapDeps([26,1,7,18,3,2,4,5,6,27,10,11,12,13,14,8,15,16,17,19])),`component`),validateSearch:e=>bn(xn(e))}),BE=dt(`/settings`)({component:pt(()=>st(()=>import(`./settings-Cn0Oxbt5.js`),__vite__mapDeps([28,29,1,2,12,6,7,8,24,16])),`component`)}),VE=dt(`/traces`)({component:pt(()=>st(()=>import(`./traces-ukilTBx1.js`),__vite__mapDeps([30,1,7,18,3,2,4,5,6,27,10,11,12,13,14,8,15,16,17,19])),`component`),validateSearch:e=>bn(xn(e))}),HE=dt(`/chat/`)({component:pt(()=>st(()=>import(`./chat.index-CIa_WLtn.js`),__vite__mapDeps([31,32,1,2,33,13,5,23,15,34])),`component`)}),UE=dt(`/chat/$threadId`)({component:pt(()=>st(()=>import(`./chat._threadId-CIa_WLtn.js`),__vite__mapDeps([35,32,1,2,33,13,5,23,15,34])),`component`)}),WE=dt(`/dashboards/`)({component:pt(()=>st(()=>import(`./dashboards.index-_pF1N2fL.js`),__vite__mapDeps([36,1,7,3,2,4,5,6,37,33,11,10,12,13,14,8,15,16,24,34])),`component`),validateSearch:e=>Ft(At(e))}),GE=dt(`/dashboards/$dashboardId`)({component:pt(()=>st(()=>import(`./dashboards._dashboardId-BlV21CSC.js`),__vite__mapDeps([38,1,7,3,2,4,5,6,37,33,11,10,12,13,14,8,15,16,24,34])),`component`),validateSearch:e=>Ft(At(e))}),KE=dt(`/settings_/ingest`)({component:pt(()=>st(()=>import(`./settings_.ingest-mtGiULM6.js`),__vite__mapDeps([39,29,1,2,12,6,7,8,24,16])),`component`)}),qE=IE.update({id:`/`,path:`/`,getParentRoute:()=>FE}),JE=LE.update({id:`/alerts`,path:`/alerts`,getParentRoute:()=>FE}),YE=RE.update({id:`/explore`,path:`/explore`,getParentRoute:()=>FE}),XE=zE.update({id:`/logs`,path:`/logs`,getParentRoute:()=>FE}),ZE=BE.update({id:`/settings`,path:`/settings`,getParentRoute:()=>FE}),QE=VE.update({id:`/traces`,path:`/traces`,getParentRoute:()=>FE}),$E=HE.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>FE}),eD=UE.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>FE}),tD=WE.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>FE}),nD={IndexRoute:qE,AlertsRoute:JE,ExploreRoute:YE,LogsRoute:XE,SettingsRoute:ZE,TracesRoute:QE,ChatThreadIdRoute:eD,DashboardsDashboardIdRoute:GE.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>FE}),SettingsIngestRoute:KE.update({id:`/settings_/ingest`,path:`/settings/ingest`,getParentRoute:()=>FE}),ChatIndexRoute:$E,DashboardsIndexRoute:tD},rD=Jn({routeTree:FE._addFileChildren(nD)._addFileTypes(),parseSearch:kt,stringifySearch:Mt,defaultPreload:`intent`,scrollRestoration:!0});(0,Ji.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(k.StrictMode,{children:(0,A.jsx)(xr,{theme:Tt,defaultColorScheme:`auto`,cssVariablesResolver:St,children:(0,A.jsx)(Zn,{router:rD})})}));export{Og as $,$C as A,Ag as B,wT as C,cT as D,sT as E,_g as F,G,Mg as H,hg as I,Eg as J,Sg as K,W as L,Rh as M,lg as N,oT as O,Ig as P,H as Q,wg as R,vT as S,lT as T,o_ as U,Uh as V,K as W,d_ as X,Vg as Y,Pg as Z,KT as _,RE as a,up as at,PT as b,_E as c,Bi as ct,yE as d,bg as et,sE as f,ZT as g,pE as h,zE as i,mp as it,zh as j,Ww as k,fE as l,Ei as lt,hE as m,WE as n,Sh as nt,gE as o,lp as ot,dE as p,ug as q,VE as r,gh as rt,uE as s,Xc as st,GE as t,qh as tt,vE as u,cr as ut,kT as v,bT as w,OT as x,MT as y,pg as z};
\ No newline at end of file
diff --git a/internal/ui/dist/assets/index-E7LYuzD4.js b/internal/ui/dist/assets/index-E7LYuzD4.js
new file mode 100644
index 000000000..f24b3b5f9
--- /dev/null
+++ b/internal/ui/dist/assets/index-E7LYuzD4.js
@@ -0,0 +1,71 @@
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/new-dashboard--I0sHUH-.js","assets/useRouter-ByJ6_rwb.js","assets/brand-FnPeVDKN.js","assets/search-DLh330Kc.js","assets/format-C9yXzbCt.js","assets/auth-D1O_aBc1.js","assets/useNavigate-B1zgPEUp.js","assets/useQuery-BLTYSIvG.js","assets/page-HByU9hUk.js","assets/toolbar-BC4UFBRT.js","assets/theme-BW6QPnCv.js","assets/CopyButton-D6VmoIT9.js","assets/Table-_NbEPK46.js","assets/live-data-meta-BRzssV5d.js","assets/lib-CBjUZG8u.js","assets/loading-skeleton-CHuRqerV.js","assets/NumberInput-6XFgwKPE.js","assets/search-oiqxywL1.js","assets/save-dialog-I4f-fyeJ.js","assets/discard-oXShT7X8.js","assets/routes-D2AdaqvY.js","assets/alerts-BcjEgLfr.js","assets/Textarea-CfM32i1b.js","assets/useMutation-CjLz5_u-.js","assets/explore-CL_Rkm3h.js","assets/logs-CVD5cDcb.js","assets/search-page-BO5G9OFi.js","assets/settings-C3z8W4vW.js","assets/settings-BlDEsFhX.js","assets/traces-CU7kRfFE.js","assets/chat.index-uc4isNjE.js","assets/chat-cuoaGd6K.js","assets/preload-helper-DJZNfKNH.js","assets/dashboard-change-chips-ZUStx9I5.js","assets/chat._threadId-uc4isNjE.js","assets/dashboards.index-B9mJ88R8.js","assets/page-0HfG-8V7.js","assets/dashboards._dashboardId-CXKjgL2X.js","assets/settings_.ingest-TqgzXuQo.js"])))=>i.map(i=>d[i]);
+import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./useRouter-ByJ6_rwb.js";import{$ as s,$t as c,An as l,Bt as u,Cn as d,Ct as f,Dn as p,En as m,Et as h,F as g,Ft as _,Gt as v,Jt as y,Kt as b,L as ee,Lt as te,M as x,Mn as S,Mt as C,N as ne,Nn as re,Nt as ie,Ot as ae,Pn as oe,Pt as se,Q as ce,Qt as le,St as ue,Tt as de,Ut as fe,Vt as pe,Wt as me,Xt as he,Yt as ge,Zt as _e,_n as ve,_t as ye,an as be,at as xe,bt as Se,cn as Ce,dt as we,en as Te,fn as w,ft as T,gt as Ee,h as De,ht as Oe,it as ke,j as Ae,jn as E,k as D,kt as je,lt as Me,mn as Ne,mt as Pe,nn as Fe,on as Ie,p as Le,pn as Re,pt as ze,qt as Be,rn as Ve,sn as He,t as Ue,tn as We,tt as Ge,ut as Ke,v as qe,vn as Je,vt as Ye,wn as Xe,xn as Ze,xt as Qe,yt as $e,z as et}from"./brand-FnPeVDKN.js";import{i as tt,n as nt,t as rt}from"./useNavigate-B1zgPEUp.js";import{a as it,d as at,g as ot,i as st,m as ct,o as lt,t as ut,u as dt}from"./preload-helper-DJZNfKNH.js";import{a as ft,i as pt,n as mt,r as ht,t as gt}from"./lazyRouteComponent-CakFlXGv.js";import{_ as _t,a as vt,c as yt,d as bt,f as xt,g as St,h as Ct,m as wt,n as Tt,o as Et,p as Dt,r as Ot,s as kt,u as At}from"./theme-BW6QPnCv.js";import{A as O,c as jt,i as Mt,k as Nt,l as Pt,m as Ft,p as It,s as Lt,y as Rt}from"./search-DLh330Kc.js";import{c as zt,i as Bt,l as Vt,o as Ht,s as Ut,t as Wt}from"./format-C9yXzbCt.js";import{a as Gt,i as Kt,n as qt,o as Jt,r as Yt,t as Xt}from"./auth-D1O_aBc1.js";import{C as Zt,T as Qt,_ as $t,a as en,b as tn,c as nn,d as rn,f as an,g as on,h as sn,i as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-BLTYSIvG.js";import{i as xn,r as Sn}from"./search-oiqxywL1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Cn=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,ie());else{var t=n(l);t!==null&&se(ee,t.startTime-e)}}}var te=!1,x=-1,S=5,C=-1;function ne(){return g?!0:!(e.unstable_now()-Ct&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():te=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=re,ie=function(){oe.postMessage(null)}}else ie=function(){_(re,0)};function se(t,n){x=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(x),x=-1):h=!0,se(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,ie()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),wn=e(((e,t)=>{t.exports=Cn()})),Tn=e((e=>{var n=wn(),r=t(),i=oe();function a(e){var t=`https://react.dev/errors/`+e;if(1Oe||(e.current=De[Oe],De[Oe]=null,Oe--)}function E(e,t){Oe++,De[Oe]=e.current,e.current=t}var D=ke(null),je=ke(null),Me=ke(null),Ne=ke(null);function Pe(e,t){switch(E(Me,t),E(je,e),E(D,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sp(t),e=Cp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ae(D),E(D,e)}function Fe(){Ae(D),Ae(je),Ae(Me)}function Ie(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,E(Ne,e)),t=D.current;var n=Cp(t,e.type);t!==n&&(E(je,e),E(D,n))}function Le(e){je.current===e&&(Ae(D),Ae(je)),Ne.current===e&&(Ae(Ne),vh._currentValue=Ee)}var Re,ze;function Be(e){if(Re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Re=t&&t[1]||``,ze=-1)`:-1i||c[r]!==l[i]){var u=`
+`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Be(n):``}function Ue(e,t){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be(`Lazy`);case 13:return e.child!==t&&t!==null?Be(`Suspense Fallback`):Be(`Suspense`);case 19:return Be(`SuspenseList`);case 0:case 15:return He(e.type,!1);case 11:return He(e.type.render,!1);case 1:return He(e.type,!0);case 31:return Be(`Activity`);case 30:return Be(`ViewTransition`);default:return``}}function We(e){try{var t=``,n=null;do t+=Ue(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
+Error generating stack: `+e.message+`
+`+e.stack}}var Ge=Object.prototype.hasOwnProperty,Ke=n.unstable_scheduleCallback,qe=n.unstable_cancelCallback,Je=n.unstable_shouldYield,Ye=n.unstable_requestPaint,Xe=n.unstable_now,Ze=n.unstable_getCurrentPriorityLevel,Qe=n.unstable_ImmediatePriority,$e=n.unstable_UserBlockingPriority,et=n.unstable_NormalPriority,tt=n.unstable_LowPriority,nt=n.unstable_IdlePriority,rt=n.log,it=n.unstable_setDisableYieldValue,at=null,ot=null;function st(e){if(typeof rt==`function`&&it(e),ot&&typeof ot.setStrictMode==`function`)try{ot.setStrictMode(at,e)}catch{}}var ct=Math.clz32?Math.clz32:dt,lt=Math.log,ut=Math.LN2;function dt(e){return e>>>=0,e===0?32:31-(lt(e)/ut|0)|0}var ft=256,pt=262144,mt=4194304;function ht(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ht(n))):i=ht(o):i=ht(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ht(n))):i=ht(o)):i=ht(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function _t(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function St(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=xr),wr=` `,Tr=!1;function Er(e,t){switch(e){case`keyup`:return yr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Or=!1;function kr(e,t){switch(e){case`compositionend`:return Dr(t);case`keypress`:return t.which===32?(Tr=!0,wr):null;case`textInput`:return e=t.data,e===wr&&Tr?null:e;default:return null}}function Ar(e,t){if(Or)return e===`compositionend`||!br&&Er(e,t)?(e=Hn(),Vn=Bn=zn=null,Or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=$r(n)}}function ti(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ti(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ni(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qr(e.document)}return t}function ri(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ii=In&&`documentMode`in document&&11>=document.documentMode,ai=null,oi=null,si=null,ci=!1;function li(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ci||ai==null||ai!==Qr(r)||(r=ai,`selectionStart`in r&&ri(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&Zr(si,r)||(si=r,r=ap(oi,`onSelect`),0>=o,i-=o,ra=1<<32-ct(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),P&&aa(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),P&&aa(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return P&&aa(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),P&&aa(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ae&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case re:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ae){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),ho(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===he&&so(l)===r.type){n(e,r.sibling),c=i(r,o.props),ho(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ae?(c=j(o.props.children,e.mode,c,o.key),ho(c,o),c.return=e,e=c):(c=Gi(o.type,o.key,o.props,null,e.mode,c),ho(c,o),c.return=e,e=c)}return s(e);case ie:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ji(o,e.mode,c),c.return=e,e=c}return s(e);case he:return o=so(o),_(e,r,o,c)}if(Te(o))return h(e,r,o,c);if(Se(o)){if(l=Se(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,mo(o),c);if(o.$$typeof===ue)return _(e,r,Ma(e,o),c);go(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Ki(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{po=0;var i=_(e,t,n,r);return fo=null,i}catch(t){if(t===to||t===ro)throw t;var a=Vi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var vo=_o(!0),yo=_o(!1),bo=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function So(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ad&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ri(e),Li(e,null,n),t}return Pi(e,r,t,n),Ri(e)}function To(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tt(e,n)}}function Eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Do=!1;function Oo(){if(Do){var e=Ka;if(e!==null)throw e}}function ko(e,t,n,r){Do=!1;var i=e.updateQueue;bo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(sd&f)===f:(r&f)===f){f!==0&&f===Ga&&(Do=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:bo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),hd|=o,e.lanes=o,e.memoizedState=d}}function Ao(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function jo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=w.T,s={};s.types=o===null?null:o.types,w.T=s,hc(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?mc(e,t,Ya(c,r),Bd(e)):mc(e,t,r,Bd(e))}catch(n){mc(e,t,{then:function(){},status:`rejected`,reason:n},Bd())}finally{T.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=R(e).queue;ic(e,i,t,Ee,n===null?ac:function(){return sc(e),n(r)})}function R(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ee,baseState:Ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:Ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sc(e){var t=R(e);t.next===null&&(t=e.alternate.memoizedState),mc(e,t.next.queue,{},Bd())}function cc(){return ja(vh)}function lc(){return L().memoizedState}function uc(){return L().memoizedState}function dc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bd();e=Co(n);var r=wo(t,e,n);r!==null&&(Ud(r,t,n),To(r,t,n)),t={cache:Ra()},e.payload=t;return}t=t.return}}function fc(e,t,n){var r=Bd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gc(e)?_c(t,n):(n=Fi(e,t,n,r),n!==null&&(Ud(n,e,r),vc(n,t,r)))}function pc(e,t,n){mc(e,t,n,Bd())}function mc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gc(e))_c(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Xr(s,o))return Pi(e,t,i,0),od===null&&Ni(),!1}catch{}if(n=Fi(e,t,i,r),n!==null)return Ud(n,e,r),vc(n,t,r),!0}return!1}function hc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gc(e)){if(t)throw Error(a(479))}else t=Fi(e,n,r,2),t!==null&&Ud(t,e,2)}function gc(e){var t=e.alternate;return e===F||t!==null&&t===F}function _c(e,t){Qo=Zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tt(e,n)}}var yc={readContext:ja,use:hs,useCallback:is,useContext:is,useEffect:is,useImperativeHandle:is,useLayoutEffect:is,useInsertionEffect:is,useMemo:is,useReducer:is,useRef:is,useState:is,useDebugValue:is,useDeferredValue:is,useTransition:is,useSyncExternalStore:is,useId:is,useHostTransitionStatus:is,useFormState:is,useActionState:is,useOptimistic:is,useMemoCache:is,useCacheRefresh:is,useEffectEvent:is},bc={readContext:ja,use:hs,useCallback:function(e,t){return I().memoizedState=[e,t===void 0?null:t],e},useContext:ja,useEffect:Gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Us(4194308,4,Zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var n=I();t=t===void 0?null:t;var r=e();if($o){st(!0);try{e()}finally{st(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=I();if(n!==void 0){var i=n(t);if($o){st(!0);try{n(t)}finally{st(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=fc.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=I();return e={current:e},t.memoizedState=e},useState:function(e){e=Ds(e);var t=e.queue,n=pc.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){return nc(I(),e,t)},useTransition:function(){var e=Ds(!1);return e=ic.bind(null,F,e.queue,!0,!1),I().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,i=I();if(P){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),od===null)throw Error(a(349));sd&127||Ss(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Gs(ws.bind(null,r,o,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},Cs.bind(null,r,o,n,t),null),n},useId:function(){var e=I(),t=od.identifierPrefix;if(P){var n=ia,r=ra;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=es++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[jt]=t,o[Mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(mp(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&_l(t)}}return Sl(t),t.subtreeFlags&=-33554433,vl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Me.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ua,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[jt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||dp(e.nodeValue,n)),e||ma(t,!0)}else e=xp(e).createTextNode(r),e[jt]=t,t.stateNode=e}return Sl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=_a(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[jt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),e=!1}else n=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Uo(t),t):(Uo(t),null);if(t.flags&128)throw Error(a(558))}return Sl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=_a(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[jt]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),i=!1}else i=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Uo(t),t):(Uo(t),null)}return Uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),bl(t,t.updateQueue),Sl(t),null);case 4:return Fe(),e===null&&tp(t.stateNode.containerInfo),t.flags|=67108864,Sl(t),null;case 10:return Ta(t.type),Sl(t),null;case 19:if(Ko(t),r=t.memoizedState,r===null)return Sl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)xl(r,!1);else{if(md!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=qo(e),o!==null){for(t.flags|=128,xl(r,!1),e=o.updateQueue,t.updateQueue=e,bl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Wi(n,e),n=n.sibling;return Go(t,Wo.current&1|2),P&&aa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Xe()>Td&&(t.flags|=128,i=!0,xl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=qo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,bl(t,e),xl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!P)return Sl(t),null}else 2*Xe()-r.renderingStartTime>Td&&n!==536870912&&(t.flags|=128,i=!0,xl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Xe(),e.sibling=null,o=Wo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||P?Go(t,o):(n=o,E(Lo,t),E(Wo,n),Ro===null&&(Ro=t)),P&&aa(t,r.treeForkCount),e}return Sl(t),null;case 22:case 23:return Uo(t),Io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Sl(t),t.subtreeFlags&6&&(t.flags|=8192)):Sl(t),n=t.updateQueue,n!==null&&bl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ae(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ta(La),Sl(t),null;case 25:return null;case 30:return t.flags|=33554432,Sl(t),null}throw Error(a(156,t.tag))}function wl(e,t){switch(ca(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(La),Fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(Uo(t),t.alternate===null)throw Error(a(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ko(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Fe(),null;case 10:return Ta(t.type),null;case 22:case 23:return Uo(t),Io(),e!==null&&Ae(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ta(La),null;case 25:return null;default:return null}}function Tl(e,t){switch(ca(t),t.tag){case 3:Ta(La),Fe();break;case 26:case 27:case 5:Le(t);break;case 4:Fe();break;case 31:t.memoizedState!==null&&Uo(t);break;case 13:Uo(t);break;case 19:Ko(t);break;case 10:Ta(t.type);break;case 22:case 23:Uo(t),Io(),e!==null&&Ae(Za);break;case 24:Ta(La)}}function El(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Cf(t,t.return,e)}}function Dl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Cf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Cf(t,t.return,e)}}function Ol(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jo(t,n)}catch(t){Cf(e,e.return,t)}}}function kl(e,t,n){n.props=Dc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Cf(e,t,n)}}function Al(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ei(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Kp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new H(e);p(e.child,!1,lm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Cf(e,t,n)}}function jl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Cf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Cf(e,t,n)}else n.current=null}}function Ml(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),mp(r,t,n),r[jt]=e,Gt(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,i).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=ei(s,h),v=ei(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,w.T=null,n=Nd,Nd=null;var o=kd,s=jd;if(Od=0,Ad=kd=null,jd=0,ad&6)throw Error(a(331));var c=ad;if(ad|=4,ed(o.current),Ku(o,o.current,s,n),ad=c,Lf(0,!1),ot&&typeof ot.onPostCommitFiberRoot==`function`)try{ot.onPostCommitFiberRoot(at,o)}catch{}return!0}finally{T.p=i,w.T=r,yf(e,t)}}function Sf(e,t,n){t=Yi(n,t),t=Nc(e.stateNode,t,2),e=wo(e,t,2),e!==null&&(St(e,2),If(e))}function Cf(e,t,n){if(e.tag===3)Sf(e,e,n);else for(;t!==null;){if(t.tag===3){Sf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Dd===null||!Dd.has(r))){e=Yi(n,e),n=Pc(2),r=wo(t,n,2),r!==null&&(Fc(n,r,t,e),St(r,2),If(r));break}}t=t.return}}function wf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new id;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(fd=!0,i.add(n),e=Tf.bind(null,e,t,n),t.then(e,e))}function Tf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,od===e&&(sd&n)===n&&(md===4||md===3&&(sd&62914560)===sd&&300>Xe()-Cd?ad&2?_d|=n:Xd(e,0):_d|=n,yd===sd&&(yd=0)),If(e)}function Ef(e,t){t===0&&(t=bt()),e=Ii(e,t),e!==null&&(St(e,t),If(e))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function Of(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ef(e,n)}function kf(e,t){return Ke(e,t)}var Af=null,jf=null,Mf=!1,Nf=!1,Pf=!1,Ff=0;function If(e){e!==jf&&e.next===null&&(jf===null?Af=jf=e:jf=jf.next=e),Nf=!0,Mf||(Mf=!0,Uf())}function Lf(e,t){if(!Pf&&Nf){Pf=!0;do for(var n=!1,r=Af;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ct(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=sd,a=gt(r,r===od?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||_t(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Pf=!1}}function Rf(){zf()}function zf(){Nf=Mf=!1;var e=0;Ff!==0&&Dp()&&(e=Ff);for(var t=Xe(),n=null,r=Af;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?Af=i:n.next=i,i===null&&(jf=n)):(n=r,(e!==0||a&3)&&(Nf=!0)),r=i}Od!==0&&Od!==5||Lf(e,!1),Ff!==0&&(Ff=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&_p(d)&&(c=c.responseEnd,o+=u*(cuh){s.length=o;break}f=new Promise(Up.bind(f)),s.push(f)}}}if(0`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=pn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),mp(t,`link`,e),Gt(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+pn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+pn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+pn(n.imageSizes)+`"]`)):i+=`[href="`+pn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);mp(o,`link`,e),t===`style`&&(o[zt]=!0,o.onload=o.onerror=function(){Kt(o)}),Gt(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+pn(r)+`"][href="`+pn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=C({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),mp(r,`link`,e),Gt(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=Wt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Gt(c),mp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=Wt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=C({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Gt(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=Wt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Gt(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var i=(i=Me.current)?jm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=Wt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=Wt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=Wt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Gm(e){return`href="`+pn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[zt]){r.loading=1;return}}else t=e.createElement(`link`),t[zt]=!0,t.onload=t.onerror=Kt.bind(null,t),mp(t,`link`,n),Gt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+pn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+pn(n.href)+`"]`);if(r)return t.instance=r,Gt(r),r;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Gt(r),mp(r,`style`,i),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Gm(n.href);var o=e.querySelector(Km(i));if(o)return t.state.loading|=4,t.instance=o,Gt(o),o;r=qm(n),(i=km.get(i))&&$m(r,i),o=(e.ownerDocument||e).createElement(`link`),Gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),mp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(i=e.querySelector(Xm(o)))?(t.instance=i,Gt(i),i):(r=n,(i=km.get(o))&&(r=C({},n),eh(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Gt(i),mp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Gt(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),mp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Tn()})),k=a(t(),1),A=i(),Dn=class extends k.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?k.createElement(this.props.errorComponent??On,{error:e[0],reset:this.reset}):this.props.children}};function On({error:e}){let[t,n]=k.useState(!1);return(0,A.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,A.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,A.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,A.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,A.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,A.jsx)(`div`,{children:(0,A.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,A.jsx)(`code`,{children:e.message}):null})}):null]})}var kn=()=>!0,An=()=>!1;function jn({children:e,fallback:t=null}){return(0,A.jsx)(k.Fragment,{children:Mn()?e:t})}function Mn(e=!0){return k.useSyncExternalStore(Nn,kn,e?An:kn)}function Nn(){return()=>{}}function Pn(e){let t=o(),n=`not-found-${Ct(t.stores.location,e=>e.pathname)}-${Ct(t.stores.status)}`;return(0,A.jsx)(Dn,{getResetKey:()=>n,onCatch:(t,n)=>{if(at(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(at(t))return e.fallback?.(t);throw t},children:e.children})}function Fn(){return(0,A.jsx)(`p`,{children:`Not Found`})}function In(e,t,n){return t.options.notFoundComponent?(0,A.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,A.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,A.jsx)(Fn,{})}function Ln(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}var Rn=(e,t)=>e[0]===t[0]&&e[1]===t[1],zn=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Bn=k.memo(function({routeId:e}){let t=o(),n=t.stores.getMatchStore(e);return Vn(t,Ct(n))});function Vn(e,t){let n=e.routesById[t.routeId],r=Ln(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=zn(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,A.jsx)(Hn,{match:t});s&&(l=(0,A.jsx)(jn,{fallback:r,children:l})),o&&(l=(0,A.jsx)(Pn,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return k.createElement(o,e)},children:l})),i&&(l=(0,A.jsx)(Dn,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(at(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,A.jsx)(k.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,A.jsx)(st.Provider,{value:t.routeId,children:(0,A.jsxs)(u,{children:[l,null]})}):(0,A.jsxs)(st.Provider,{value:t.routeId,children:[l,null]})}var Hn=k.memo(function({match:e}){let t=o(),n=e.routeId,r=t.routesById[n],i=k.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=k.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,A.jsx)(e,{},i):(0,A.jsx)(Un,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!zn(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Ln(t,r)}if(e.status===`notFound`)return In(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Un=k.memo(function(){let e=o(),t=k.useContext(st),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Ct(a,e=>[!!e._notFound,e.error],{compare:Rn}),i=Ct(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return In(e,e.routesById[t],r);if(!i)return null;let a=(0,A.jsx)(Bn,{routeId:i});return t===`__root__`?(0,A.jsx)(k.Suspense,{fallback:Ln(e),children:a}):a});function Wn(e,t){let n=e[1];e.length=0,n?.(t)}function Gn({t:e}){let t=o(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Wn(n,!1),n.push(i,a),e(t),k.startTransition(r)}),tt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ct(r.publicHref)!==ct(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...lt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Kn(){let e=o(),t=e.routesById[dt],n=Ln(e,t),r=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Gn,{t:k.useState()[1]}),e.ssr?(0,A.jsx)(qn,{}):(0,A.jsx)(k.Suspense,{fallback:n,children:(0,A.jsx)(qn,{})})]});return e.options.InnerWrap?(0,A.jsx)(e.options.InnerWrap,{children:r}):r}function qn(){let e=o(),t=e._rendered,n=Ct(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;tt(()=>{t[0]===n&&Wn(t,!0)},[t,n]);let a=i?(0,A.jsx)(Bn,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,A.jsx)(Dn,{getResetKey:()=>r,onCatch:void 0,children:a})}var Jn=e=>({createMutableStore:_t,createReadonlyStore:_t,batch:St}),Yn=e=>new Xn(e),Xn=class extends it{constructor(e){super(e,Jn)}};function Zn({router:e,children:t,...r}){ot(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=(0,A.jsx)(n.Provider,{value:e,children:t});return e.options.Wrap?(0,A.jsx)(e.options.Wrap,{children:i}):i}function Qn({router:e,...t}){return(0,A.jsx)(Zn,{router:e,...t,children:(0,A.jsx)(Kn,{})})}function $n(e){let t=o({warn:e?.router===void 0}),n=e?.router||t;return Ct(n.stores.__store,ft(e,n))}function er(e,t,n={leading:!1}){let[r,i]=(0,k.useState)(e),a=(0,k.useRef)(!1),o=(0,k.useRef)(null),s=(0,k.useRef)(!1),c=(0,k.useRef)(e);c.current=e;let l=(0,k.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,k.useCallback)(()=>{l(),s.current=!1},[]),d=(0,k.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,k.useEffect)(()=>{a.current&&(l(),!s.current&&n.leading?(s.current=!0,i(e),o.current=window.setTimeout(()=>{s.current=!1},t)):o.current=window.setTimeout(()=>{s.current=!1,i(e)},t))},[e,n.leading,t]),(0,k.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function tr(e=!1,t={}){let[n,r]=(0,k.useState)(e),i=(0,k.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,k.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,k.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}function nr(e){return e===`auto`||e===`dark`||e===`light`}function rr({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return nr(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&nr(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function ir(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function ar({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,k.useRef)(null),[a,o]=(0,k.useState)(()=>e.get(t)),s=r||a,c=(0,k.useCallback)(t=>{r||(ir(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,k.useCallback)(()=>{o(t),ir(t,n),e.clear()},[e.clear,t]);return(0,k.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),ve(()=>{ir(e.get(t),n)},[]),(0,k.useEffect)(()=>{if(r)return ir(r,n),()=>{};r===void 0&&ir(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&ir(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function or(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function sr(e,t){let n=t?[t]:[`:root`,`:host`],r=or(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=or(e.dark),o=or(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function cr({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=be(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:Te(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=be(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:We(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:We(e.colors[t][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Te(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function lr(e,t,n){re(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var ur=e=>{let t=be(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:E(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":At(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":At(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};lr(r.variables,e.breakpoints,`breakpoint`),lr(r.variables,e.spacing,`spacing`),lr(r.variables,e.fontSizes,`font-size`),lr(r.variables,e.lineHeights,`line-height`),lr(r.variables,e.shadows,`shadow`),lr(r.variables,e.radius,`radius`),lr(r.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),re(e.colors).forEach(t=>{let n=e.colors[t];if(Fe(n)){Object.assign(r.light,cr({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,cr({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=bt(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=bt(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,cr({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,cr({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return re(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function dr(){let e=v(),t=c(),n=re(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=wt(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:l(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:l(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,A.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function fr({theme:e,generator:t}){let n=ur(e),r=t?.(e);return r?S(n,r):n}var pr=ur(b);function mr(e){let t={variables:{},light:{},dark:{}};return re(e.variables).forEach(n=>{pr.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),re(e.light).forEach(n=>{pr.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),re(e.dark).forEach(n=>{pr.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function hr(e){return sr({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function gr({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=v(),r=c(),i=fr({theme:n,generator:_e()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=sr(a?mr(i):i,e);return o?(0,A.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:hr(e)}`}}):null}gr.displayName=`@mantine/CssVariables`;function _r({respectReducedMotion:e,getRootElement:t}){ve(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function vr({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=rr(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h,deduplicateInlineStyles:g=!1}){let{colorScheme:_,setColorScheme:v,clearColorScheme:y}=ar({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return _r({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,A.jsx)(ge,{value:{colorScheme:_,setColorScheme:v,clearColorScheme:y,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h,deduplicateInlineStyles:g},children:(0,A.jsxs)(me,{theme:e,children:[o&&(0,A.jsx)(gr,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,A.jsx)(dr,{}),t]})})}vr.displayName=`@mantine/core/MantineProvider`;var yr={duration:100,transition:`fade`};function br(e,t){return{...yr,...t,...e}}var[xr,Sr]=p(`AppShell was not found in tree`);function Cr({size:e,min:t,max:n,viewportMax:r}){let i=Math.min(n??1/0,r);return Math.max(Math.min(t??0,i),Math.min(e,i))}function wr(e,t){return t!==void 0&&ed.axis===`horizontal`?window.innerWidth:window.innerHeight,[m,h]=(0,k.useState)(0),[g,_]=(0,k.useState)(void 0),y=()=>p()/u.scale,b=e=>{let t=e.getBoundingClientRect();return((d.axis===`horizontal`?t.width:t.height)-Or(e,d.safeAreaVariable))/u.scale},ee=t=>{let r=n.rootRef.current;if(!r)return;let i=E(t);r.style.setProperty(d.sizeVariable,i),n.resizeOffsets[e]&&r.style.setProperty(d.offsetVariable,i),n.mode===`static`&&d.gridWidthVariable&&r.style.setProperty(d.gridWidthVariable,i)},te=()=>{let e=n.rootRef.current;e&&(e.style.removeProperty(d.sizeVariable),e.style.removeProperty(d.offsetVariable),d.gridWidthVariable&&e.style.removeProperty(d.gridWidthVariable))},x=()=>{s.current?.abort(),s.current=null,o.current=null;let e=c.current;c.current=null,e&&(Nr(`user-select`,e.userSelect),Nr(`-webkit-user-select`,e.webkitUserSelect),Nr(`cursor`,e.cursor))},S=()=>{r?.reportCollapse(e,wr(a.current.startSize,f.collapseThreshold)),r?.endResize(e,null)},ne=t=>{if(t.pointerId!==o.current)return;a.current.moved=!0;let n=Dr({section:e,deltaX:t.clientX-a.current.startX,deltaY:t.clientY-a.current.startY,dir:l})/u.scale,s=a.current.startSize+n,c=Cr({size:s,min:f.min,max:f.max,viewportMax:y()});a.current.size=c,ee(c),i.current?.setAttribute(`aria-valuenow`,String(Math.round(c))),r?.previewResize(e,c),r?.reportCollapse(e,wr(s,f.collapseThreshold))},re=t=>{if(t.pointerId===o.current){if(x(),!a.current.moved){r?.endResize(e,null);return}r?.endResize(e,a.current.size)}},ae=e=>{e.pointerId===o.current&&(x(),te(),S())},oe=e=>{e.key===`Escape`&&(e.preventDefault(),x(),te(),i.current?.setAttribute(`aria-valuenow`,String(Math.round(a.current.startSize))),S())},se=()=>{let t=r?.[e].size;if(t!==void 0)return t;let n=i.current?.parentElement;return n?b(n):0},ce=t=>{r?.initCollapse(e,wr(se(),f.collapseThreshold)),r?.reportCollapse(e,wr(t,f.collapseThreshold)),r?.endResize(e,Cr({size:t,min:f.min,max:f.max,viewportMax:y()}))},le=t=>{let n=t.shiftKey?jr:Ar;if(t.key===`Home`){t.preventDefault(),ce(f.min??0);return}if(t.key===`End`){t.preventDefault(),ce(f.max??y());return}let r=Mr[t.key];if(!r)return;let i=Dr({section:e,...r,dir:l});i!==0&&(t.preventDefault(),ce(se()+i*n))},ue=()=>{te(),r?.[e].reset()},de=t=>{if(t.button!==0||s.current!==null)return;let n=i.current?.parentElement;if(!n)return;let l=b(n);a.current={startSize:l,startX:t.clientX,startY:t.clientY,size:l,moved:!1},o.current=t.pointerId,r?.initCollapse(e,wr(l,f.collapseThreshold));let u=new AbortController;s.current=u;let{signal:p}=u;c.current={userSelect:document.body.style.getPropertyValue(`user-select`),webkitUserSelect:document.body.style.getPropertyValue(`-webkit-user-select`),cursor:document.body.style.getPropertyValue(`cursor`)},document.body.style.setProperty(`user-select`,`none`),document.body.style.setProperty(`-webkit-user-select`,`none`),document.body.style.setProperty(`cursor`,d.axis===`horizontal`?`col-resize`:`row-resize`),r?.startResize(e),document.addEventListener(`pointermove`,ne,{signal:p}),document.addEventListener(`pointerup`,re,{signal:p}),document.addEventListener(`pointercancel`,ae,{signal:p}),document.addEventListener(`keydown`,oe,{signal:p})};if(ve(()=>{r&&r.activeSection!==e&&te()},[r?.activeSection,r?.[e].size]),ve(()=>{h(p());let e=()=>h(p());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[d.axis]),ve(()=>{r?.[e].size===void 0&&_(se())},[r?.[e].size,m]),ve(()=>()=>{let e=s.current!==null;x(),te(),e&&S()},[]),!r?.[e].enabled)return null;let fe=m/u.scale,pe=Math.min(f.max??fe,fe),me=r[e].size,he=me!==void 0&&m>0?Math.min(me,fe):me??g;return(0,A.jsx)(ie,{ref:i,role:`separator`,tabIndex:0,"aria-label":f.label??kr[e],"aria-controls":t,"aria-orientation":d.orientation,"aria-valuemin":f.min??0,"aria-valuemax":Math.round(pe),"aria-valuenow":he===void 0?void 0:Math.round(he),onPointerDown:de,onKeyDown:le,onDoubleClick:ue,mod:{section:e,orientation:d.orientation,active:r[e].active},...n.getStyles(`resizeHandle`)})}Pr.displayName=`@mantine/core/AppShellResizeHandle`;var Fr={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`,resizeHandle:`m_3b25945a`},Ir=_(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=fe(`AppShellAside`,null,e),d=Sr(),f=Ne(u.id);if(d.disabled)return null;let p=d.resize?.aside.enabled??!1,m=d.getStyles(`aside`,{className:Ie({[ce.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!p)return(0,A.jsx)(ie,{component:`aside`,mod:[{"with-border":s??d.withBorder},l],...m,...u,__vars:{"--app-shell-aside-z-index":`calc(${c??d.zIndex} + 1)`}});let{children:h,dangerouslySetInnerHTML:g,..._}=u;return(0,A.jsxs)(ie,{component:`aside`,mod:[{"with-border":s??d.withBorder},l],...m,..._,__vars:{"--app-shell-aside-z-index":`calc(${c??d.zIndex} + 1)`},id:f,children:[g?(0,A.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:g}):h,(0,A.jsx)(Pr,{section:`aside`,sectionId:f})]})});Ir.classes=Fr,Ir.displayName=`@mantine/core/AppShellAside`;var Lr=_(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=fe(`AppShellFooter`,null,e),d=Sr(),f=Ne(u.id);if(d.disabled)return null;let p=d.resize?.footer.enabled??!1,m=d.getStyles(`footer`,{className:Ie({[ce.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!p)return(0,A.jsx)(ie,{component:`footer`,mod:[{"with-border":s??d.withBorder},l],...m,...u,__vars:{"--app-shell-footer-z-index":(c??d.zIndex)?.toString()}});let{children:h,dangerouslySetInnerHTML:g,..._}=u;return(0,A.jsxs)(ie,{component:`footer`,mod:[{"with-border":s??d.withBorder},l],...m,..._,__vars:{"--app-shell-footer-z-index":(c??d.zIndex)?.toString()},id:f,children:[g?(0,A.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:g}):h,(0,A.jsx)(Pr,{section:`footer`,sectionId:f})]})});Lr.classes=Fr,Lr.displayName=`@mantine/core/AppShellFooter`;var Rr=_(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=fe(`AppShellHeader`,null,e),d=Sr(),f=Ne(u.id);if(d.disabled)return null;let p=d.resize?.header.enabled??!1,m=d.getStyles(`header`,{className:Ie({[ce.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!p)return(0,A.jsx)(ie,{component:`header`,mod:[{"with-border":s??d.withBorder},l],...m,...u,__vars:{"--app-shell-header-z-index":(c??d.zIndex)?.toString()}});let{children:h,dangerouslySetInnerHTML:g,..._}=u;return(0,A.jsxs)(ie,{component:`header`,mod:[{"with-border":s??d.withBorder},l],...m,..._,__vars:{"--app-shell-header-z-index":(c??d.zIndex)?.toString()},id:f,children:[g?(0,A.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:g}):h,(0,A.jsx)(Pr,{section:`header`,sectionId:f})]})});Rr.classes=Fr,Rr.displayName=`@mantine/core/AppShellHeader`;var zr=_(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=fe(`AppShellMain`,null,e),s=Sr();return(0,A.jsx)(ie,{component:`main`,...s.getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});zr.classes=Fr,zr.displayName=`@mantine/core/AppShellMain`;var Br=_(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=fe(`AppShellNavbar`,null,e),d=Sr(),f=Ne(u.id);if(d.disabled)return null;let p=d.resize?.navbar.enabled??!1,m=d.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r});if(!p)return(0,A.jsx)(ie,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...m,...u,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}});let{children:h,dangerouslySetInnerHTML:g,..._}=u;return(0,A.jsxs)(ie,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...m,..._,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`},id:f,children:[g?(0,A.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:g}):h,(0,A.jsx)(Pr,{section:`navbar`,sectionId:f})]})});Br.classes=Fr,Br.displayName=`@mantine/core/AppShellNavbar`;var Vr=se(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=fe(`AppShellSection`,null,e),l=Sr();return(0,A.jsx)(ie,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});Vr.classes=Fr,Vr.displayName=`@mantine/core/AppShellSection`;function Hr(e){return typeof e==`object`?e.base:e}function Ur(e,t){return`min(${E(e)}, ${t===`horizontal`?`100vw`:`100dvh`})`}function Wr(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function Gr(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Kr({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(var(--app-shell-aside-width))`,u=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`),s&&(n[r.breakpoint][`--app-shell-aside-resize-handle-display`]=`none`)),o!==void 0){let t=Ur(o,`horizontal`);e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t,a===`static`&&(e[`--app-shell-aside-grid-width`]=t)}else{if(Wr(c)){let t=E(Hr(c));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}Gr(c)&&(c.base!==void 0&&(e[`--app-shell-aside-width`]=E(c.base),e[`--app-shell-aside-offset`]=E(c.base)),re(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=E(c[e]),t[e][`--app-shell-aside-offset`]=E(c[e]))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=l,t[e][`--app-shell-aside-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(t[e][`--app-shell-aside-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=Dt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=l,n[e][`--app-shell-aside-transform-rtl`]=u,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(n[e][`--app-shell-aside-resize-handle-display`]=`none`)}}function qr({baseStyles:e,minMediaStyles:t,footer:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),i!==void 0){let t=Ur(i,`vertical`);e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}else{if(Wr(o)){let t=E(Hr(o));e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}Gr(o)&&(o.base!==void 0&&(e[`--app-shell-footer-height`]=E(o.base),s&&(e[`--app-shell-footer-offset`]=E(o.base))),re(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=E(o[e]),s&&(t[e][`--app-shell-footer-offset`]=E(o[e])))}))}n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`),a&&(e[`--app-shell-footer-resize-handle-display`]=`none`))}function Jr({baseStyles:e,minMediaStyles:t,header:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),i!==void 0){let t=Ur(i,`vertical`);e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}else{if(Wr(o)){let t=E(Hr(o));e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}Gr(o)&&(o.base!==void 0&&(e[`--app-shell-header-height`]=E(o.base),s&&(e[`--app-shell-header-offset`]=E(o.base))),re(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=E(o[e]),s&&(t[e][`--app-shell-header-offset`]=E(o[e])))}))}n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`),a&&(e[`--app-shell-header-resize-handle-display`]=`none`))}function Yr({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(calc(var(--app-shell-navbar-width) * -1))`,u=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`),s&&(n[r.breakpoint][`--app-shell-navbar-resize-handle-display`]=`none`)),o!==void 0){let t=Ur(o,`horizontal`);e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}else{if(Wr(c)){let t=E(Hr(c));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}Gr(c)&&(c.base!==void 0&&(e[`--app-shell-navbar-width`]=E(c.base),e[`--app-shell-navbar-offset`]=E(c.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=E(c.base))),re(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=E(c[e]),t[e][`--app-shell-navbar-offset`]=E(c[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=E(c[e])))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=l,t[e][`--app-shell-navbar-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`),s&&(t[e][`--app-shell-navbar-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=Dt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=l,n[e][`--app-shell-navbar-transform-rtl`]=u,s&&(n[e][`--app-shell-navbar-resize-handle-display`]=`none`)}}function Xr(e){return Number(e)===0?`0px`:Xe(e)}function Zr({padding:e,baseStyles:t,minMediaStyles:n}){Wr(e)&&(t[`--app-shell-padding`]=Xr(Hr(e))),Gr(e)&&(e.base&&(t[`--app-shell-padding`]=Xr(e.base)),re(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=Xr(e[t]))}))}function Qr({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o,resize:s}){let c={},u={},d={};o===`static`&&(d[`--app-shell-main-grid-column`]=`1 / -1`,d[`--app-shell-main-grid-row`]=`2`),Yr({baseStyles:d,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:a,mode:o,resizedSize:s?.sizes.navbar,resizable:s?.enabled.navbar}),Kr({baseStyles:d,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:a,mode:o,resizedSize:s?.sizes.aside,resizable:s?.enabled.aside}),Jr({baseStyles:d,minMediaStyles:c,header:t,mode:o,resizedSize:s?.sizes.header,resizable:s?.enabled.header}),qr({baseStyles:d,minMediaStyles:c,footer:n,mode:o,resizedSize:s?.sizes.footer,resizable:s?.enabled.footer}),Zr({baseStyles:d,minMediaStyles:c,padding:i});let f=xt(re(c),a.breakpoints).map(e=>({query:`(min-width: ${l(e.px)})`,styles:c[e.value]})),p=xt(re(u),a.breakpoints).map(e=>({query:`(max-width: ${l(e.px)})`,styles:u[e.value]}));return{baseStyles:d,media:[...f,...p]}}function $r({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o,resize:s}){let c=v(),l=he(),{media:d,baseStyles:f}=Qr({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a,resize:s});return(0,A.jsx)(u,{media:d,styles:f,selector:o||l.cssVariablesSelector})}function ei(e){return e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function ti(e){return e>=48&&e<=57}function ni(e){let t=``;for(let n=0;n=1&&r<=31||r===127||n===0&&ti(r)||n===1&&ti(r)&&e.charCodeAt(0)===45?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===45?t+=`\\${i}`:ei(r)?t+=i:t+=`\\${i}`}return t}function ri({transitionDuration:e,disabled:t,resizeKey:n}){let[r,i]=(0,k.useState)(!0),[a,o]=(0,k.useState)({key:n,active:!1}),s=(0,k.useRef)(-1),c=(0,k.useRef)(-1);return a.key!==n&&o({key:n,active:!0}),(0,k.useEffect)(()=>{if(!a.active)return;let t=window.setTimeout(()=>(0,k.startTransition)(()=>{o(e=>({...e,active:!1}))}),e||0);return()=>window.clearTimeout(t)},[a,e]),Re(`resize`,()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>(0,k.startTransition)(()=>{i(!1)}),200)}),ve(()=>{i(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>(0,k.startTransition)(()=>{i(!1)}),e||0)},[t,e]),r||a.active}var ii={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:m(`app`),mode:`fixed`},ai=He((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n,"--app-shell-resize-handle-size":void 0}})),oi=_(e=>{let t=fe(`AppShell`,ii,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,navbar:c,withBorder:l,padding:u,transitionDuration:d,transitionTimingFunction:f,header:p,zIndex:m,layout:h,disabled:g,aside:_,footer:v,offsetScrollbars:y=!0,mode:b,mod:ee,attributes:te,id:x,resize:S,ref:C,...ne}=t,re=pe({name:`AppShell`,classes:Fr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:te,vars:s,varsResolver:ai}),ae=ri({disabled:g,transitionDuration:d,resizeKey:S?Er.map(e=>S.sizes[e]).join(`|`):void 0}),oe=Ne(x),se=(0,k.useRef)(null),ce=S?{sizes:S.sizes,enabled:{navbar:S.navbar.enabled,aside:S.aside.enabled,header:S.header.enabled,footer:S.footer.enabled}}:void 0,le={navbar:!0,aside:!0,header:b===`static`?!0:p?.offset??!0,footer:b===`static`?!0:v?.offset??!0};return(0,A.jsxs)(xr,{value:{getStyles:re,withBorder:l,zIndex:m,disabled:g,offsetScrollbars:y,mode:b,resize:S,rootRef:se,resizeOffsets:le},children:[(0,A.jsx)($r,{navbar:c,header:p,aside:_,footer:v,padding:u,mode:b,resize:ce,selector:S||b===`static`?`#${ni(oe)}`:void 0}),(0,A.jsx)(ie,{...re(`root`),id:oe,ref:w(C,se),mod:[{resizing:ae||S?.activeSection!=null,layout:h,disabled:g,mode:b},ee],...ne})]})});oi.classes=Fr,oi.varsResolver=ai,oi.displayName=`@mantine/core/AppShell`,oi.Navbar=Br,oi.Header=Rr,oi.Main=zr,oi.Aside=Ir,oi.Footer=Lr,oi.Section=Vr;var si={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},ci=(0,k.createContext)({withinGroup:!1}),li=He((e,{spacing:t})=>({group:{"--ag-spacing":Xe(t)}})),ui=_(e=>{let t=fe(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=pe({name:`AvatarGroup`,classes:si,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:li,rootSelector:`group`});return(0,A.jsx)(ci,{value:{withinGroup:!0},children:(0,A.jsx)(ie,{...d(`group`),...u})})});ui.classes=si,ui.varsResolver=li,ui.displayName=`@mantine/core/AvatarGroup`;function di(e){return(0,A.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,A.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function fi(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var gi=He((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?mi(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":d(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:Ze(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),_i=se(e=>{let t=fe(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:_,allowedInitialsColors:v,attributes:y,...b}=t,ee=(0,k.use)(ci),[te,x]=(0,k.useState)(!c),S=pe({name:`Avatar`,props:t,classes:si,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:gi});return(0,k.useEffect)(()=>x(!c),[c]),(0,A.jsx)(ie,{...S(`root`),mod:[{"within-group":ee.withinGroup},g],...b,children:te||!c?(0,A.jsx)(`span`,{...S(`placeholder`),title:l,children:m||typeof _==`string`&&hi(_)||(0,A.jsx)(di,{})}):(0,A.jsx)(`img`,{...p,...S(`image`),src:c,alt:l,onError:e=>{x(!0),p?.onError?.(e)}})})});_i.classes=si,_i.varsResolver=gi,_i.displayName=`@mantine/core/Avatar`,_i.Group=ui;var vi={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},yi=He((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:a})=>({root:{"--burger-color":t?Ve(t,e):void 0,"--burger-size":d(n,`burger-size`),"--burger-line-size":r?E(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":a}})),bi=_(e=>{let t=fe(`Burger`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,opened:c,children:l,transitionDuration:u,transitionTimingFunction:d,lineSize:f,attributes:p,...m}=t,h=pe({name:`Burger`,classes:vi,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:yi});return(0,A.jsxs)(Me,{...h(`root`),...m,children:[(0,A.jsx)(ie,{mod:[`reduce-motion`,{opened:c}],...h(`burger`)}),l]})});bi.classes=vi,bi.varsResolver=yi,bi.displayName=`@mantine/core/Burger`;var xi={root:`m_dc6f14e2`},Si=He((e,{size:t})=>({root:{"--kbd-fz":d(t,`kbd-fz`)}})),Ci=_(e=>{let t=fe(`Kbd`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t,u=pe({name:`Kbd`,classes:xi,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c,vars:s,varsResolver:Si});return(0,A.jsx)(ie,{component:`kbd`,...u(`root`),...l})});Ci.classes=xi,Ci.varsResolver=Si,Ci.displayName=`@mantine/core/Kbd`;function wi({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,k.useState)(n),a=(0,k.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Oe({placement:t,middleware:[h({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,k.useCallback)(({clientX:e,clientY:t})=>{Number.isFinite(e)&&Number.isFinite(t)&&l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,k.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=je(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var Ti={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},Ei={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:m(`popover`)},Di=He((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ze(t),"--tooltip-bg":n?Ve(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),Oi=_(e=>{let t=fe(`TooltipFloating`,Ei,e),{children:n,refProp:r,withinPortal:i,style:a,className:o,classNames:s,styles:c,unstyled:l,radius:u,color:d,label:f,offset:p,position:m,multiline:h,zIndex:g,disabled:_,defaultOpened:y,variant:b,vars:ee,portalProps:x,attributes:S,ref:C,...ne}=t,re=v(),ae=pe({name:`TooltipFloating`,props:t,classes:Ti,className:o,style:a,classNames:s,styles:c,unstyled:l,attributes:S,rootSelector:`tooltip`,vars:ee,varsResolver:Di}),{handleMouseMove:oe,x:se,y:ce,opened:le,boundaryRef:ue,floating:de,setOpened:me}=wi({offset:p,position:m,defaultOpened:y}),he=Ce(n);if(!he)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let ge=w(ue,Vt(he),C),_e=he.props,ve=e=>{_e.onMouseEnter?.(e),oe(e),me(!0)},ye=e=>{_e.onMouseLeave?.(e),me(!1)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(xe,{...x,withinPortal:i,children:(0,A.jsx)(ie,{...ne,...ae(`tooltip`,{style:{...te(a,re),zIndex:g,display:!_&&le?`block`:`none`,top:Number.isFinite(ce)?Math.round(ce):``,left:Number.isFinite(se)?Math.round(se):``}}),variant:b,ref:de,mod:{multiline:h},children:f})}),(0,k.cloneElement)(he,{..._e,[r]:ge,onMouseEnter:ve,onMouseLeave:ye})]})});Oi.classes=Ti,Oi.varsResolver=Di,Oi.displayName=`@mantine/core/TooltipFloating`;var ki=(0,k.createContext)({withinGroup:!1}),Ai={openDelay:0,closeDelay:0};function ji(e){let{openDelay:t,closeDelay:n,children:r}=fe(`TooltipGroup`,Ai,e);return(0,A.jsx)(ki,{value:{withinGroup:!0},children:(0,A.jsx)(we,{delay:{open:t,close:n},children:r})})}ji.displayName=`@mantine/core/TooltipGroup`,ji.extend=e=>e;function Mi(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Ni(e){let t=Mi(e.middlewares),n=[de(e.offset),ue()];return t.shift&&n.push(h(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?Qe():Qe(t.flip)),n.push(Se({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?f():f(t.inline)):e.inline&&n.push(f()),n}function Pi(e){let[t,n]=(0,k.useState)(e.defaultOpened),r=typeof e.opened==`boolean`,i=!e.disabled&&(r?e.opened:t);(0,k.useEffect)(()=>{e.disabled&&n(!1)},[e.disabled]);let a=(0,k.use)(ki).withinGroup,o=Ne(),s=le(),c=(0,k.useCallback)(e=>{n(e),e&&y(o)},[o]),{x:l,y:u,context:d,refs:f,placement:p,middlewareData:{arrow:{x:m,y:h}={},hide:g}}=Oe({strategy:e.strategy,placement:e.position,open:i,onOpenChange:c,middleware:Ni(e),whileElementsMounted:ae}),{delay:_,currentId:v,setCurrentId:y}=ze(d,{id:o}),{getReferenceProps:b,getFloatingProps:ee}=Ye([ye(d,{enabled:!e.disabled&&e.events?.hover,delay:a?_:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch,handleClose:e.interactive?T():null}),Ee(d,{enabled:!e.disabled&&e.events?.focus,visibleOnly:!0}),$e(d,{role:`tooltip`}),Pe(d,{enabled:e.opened===void 0})]),te=(0,k.useRef)(p);ve(()=>{te.current!==p&&(te.current=p,e.onPositionChange?.(p))},[p]);let x=i&&v&&v!==o;return{x:l,y:u,arrowX:m,arrowY:h,reference:f.setReference,floating:f.setFloating,getFloatingProps:ee,getReferenceProps:b,isGroupPhase:x,opened:i,placement:p,referenceHidden:e.hideDetached&&s!==`test`?g?.referenceHidden:!1}}var Fi={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:m(`popover`),middlewares:{flip:!0,shift:!0,inline:!1},hideDetached:!0},Ii=He((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Ze(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),Li=_(e=>{let t=fe(`Tooltip`,Fi,e),{children:n,position:r,refProp:i,label:a,openDelay:o,closeDelay:s,onPositionChange:c,opened:l,defaultOpened:u,withinPortal:d,radius:f,color:p,classNames:m,styles:h,unstyled:g,style:_,className:v,withArrow:y,arrowSize:b,arrowOffset:ee,arrowRadius:te,arrowPosition:x,offset:S,transitionProps:ne,multiline:re,events:ae,interactive:oe,zIndex:se,disabled:ce,onClick:le,onMouseEnter:ue,onMouseLeave:de,inline:me,variant:he,keepMounted:ge,vars:_e,portalProps:ve,mod:ye,floatingStrategy:be,middlewares:Se,autoContrast:we,attributes:Te,target:T,hideDetached:Ee,ref:De,...Oe}=t,{dir:Ae}=C(),E=(0,k.useRef)(null),D=Pi({position:Ht(Ae,r),closeDelay:s,openDelay:o,onPositionChange:c,opened:l,defaultOpened:u,disabled:ce,events:ae,interactive:oe,arrowRef:E,arrowOffset:ee,offset:typeof S==`number`?S+(y?b/2:0):S,inline:me,strategy:be,middlewares:Se,hideDetached:Ee});(0,k.useEffect)(()=>{let e=T instanceof HTMLElement?T:typeof T==`string`?document.querySelector(T):T?.current||null;e&&D.reference(e)},[T,D]);let je=pe({name:`Tooltip`,props:t,classes:Ti,className:v,style:_,classNames:m,styles:h,unstyled:g,attributes:Te,rootSelector:`tooltip`,vars:_e,varsResolver:Ii}),Me=Ce(n);if(!T&&!Me)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let Ne=je(`tooltip`),Pe=oe&&!ce&&!!D.opened,Fe=x===`merge`&&y?zt({position:D.placement,dir:Ae}):void 0;if(T){let e=br(ne,{duration:100,transition:`fade`});return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(xe,{...ve,withinPortal:d,children:(0,A.jsx)(ke,{...e,keepMounted:ge,mounted:!ce&&!!D.opened,duration:D.isGroupPhase?10:e.duration,children:e=>(0,A.jsxs)(ie,{...Oe,"data-fixed":be===`fixed`||void 0,variant:he,mod:[{multiline:re,interactive:Pe},ye],...Ne,...D.getFloatingProps({ref:D.floating,className:Ne.className,style:{...Ne.style,...e,...Fe,zIndex:se,top:D.y??0,left:D.x??0,...D.referenceHidden?{display:`none`}:null}}),children:[a,(0,A.jsx)(Ut,{ref:E,arrowX:D.arrowX,arrowY:D.arrowY,visible:y,position:D.placement,arrowSize:b,arrowOffset:ee,arrowRadius:te,arrowPosition:x,...je(`arrow`)})]})})})})}let Le=Me.props,Re=w(D.reference,Vt(Me),De),ze=br(ne,{duration:100,transition:`fade`});return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(xe,{...ve,withinPortal:d,children:(0,A.jsx)(ke,{...ze,keepMounted:ge,mounted:!ce&&!!D.opened,duration:D.isGroupPhase?10:ze.duration,children:e=>(0,A.jsxs)(ie,{...Oe,"data-fixed":be===`fixed`||void 0,variant:he,mod:[{multiline:re,interactive:Pe},ye],...D.getFloatingProps({ref:D.floating,className:je(`tooltip`).className,style:{...je(`tooltip`).style,...e,...Fe,zIndex:se,top:D.y??0,left:D.x??0,...D.referenceHidden?{display:`none`}:null}}),children:[a,(0,A.jsx)(Ut,{ref:E,arrowX:D.arrowX,arrowY:D.arrowY,visible:y,position:D.placement,arrowSize:b,arrowOffset:ee,arrowRadius:te,arrowPosition:x,...je(`arrow`)})]})})}),(0,k.cloneElement)(Me,D.getReferenceProps({onClick:le,onMouseEnter:ue,onMouseLeave:de,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...Le,className:Ie(v,Le.className),[i]:Re}))]})});Li.classes=Ti,Li.varsResolver=Ii,Li.displayName=`@mantine/core/Tooltip`,Li.Floating=Oi,Li.Group=ji;var Ri=[];for(let e=0;e<256;++e)Ri.push((e+256).toString(16).slice(1));function zi(e,t=0){return(Ri[e[t+0]]+Ri[e[t+1]]+Ri[e[t+2]]+Ri[e[t+3]]+`-`+Ri[e[t+4]]+Ri[e[t+5]]+`-`+Ri[e[t+6]]+Ri[e[t+7]]+`-`+Ri[e[t+8]]+Ri[e[t+9]]+`-`+Ri[e[t+10]]+Ri[e[t+11]]+Ri[e[t+12]]+Ri[e[t+13]]+Ri[e[t+14]]+Ri[e[t+15]]).toLowerCase()}var Bi,Vi=new Uint8Array(16);function Hi(){if(!Bi){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Bi=crypto.getRandomValues.bind(crypto)}return Bi(Vi)}var Ui={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Wi(e,t,n){if(Ui.randomUUID&&!t&&!e)return Ui.randomUUID();e||={};let r=e.random??e.rng?.()??Hi();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return zi(r)}var Gi=En(),j=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({}),Ki={TextMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`,`name`],fields:{}},TextMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`role`,`delta`,`name`],fields:{}},ToolCallStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`parentMessageId`],fields:{}},ToolCallArgsEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`toolCallId`,`toolCallName`,`parentMessageId`,`delta`],fields:{}},TextPart:{optional:[`id`,`metadata`],fields:{}},DataSource:{optional:[],fields:{}},UrlSource:{optional:[`mimeType`],fields:{}},FileSource:{optional:[`provider`,`mimeType`],fields:{}},PartSource:{discriminator:`type`,variants:{data:`DataSource`,url:`UrlSource`,file:`FileSource`}},ImagePart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},AudioPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},VideoPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},DocumentPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},ContentPart:{discriminator:`type`,variants:{text:`TextPart`,image:`ImagePart`,audio:`AudioPart`,video:`VideoPart`,document:`DocumentPart`}},ToolCallResultEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`],fields:{content:{array:`ContentPart`}}},StateSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},AddOperation:{optional:[],fields:{}},RemoveOperation:{optional:[],fields:{}},ReplaceOperation:{optional:[],fields:{}},MoveOperation:{optional:[],fields:{}},CopyOperation:{optional:[],fields:{}},TestOperation:{optional:[],fields:{}},JsonPatchOperation:{discriminator:`op`,variants:{add:`AddOperation`,remove:`RemoveOperation`,replace:`ReplaceOperation`,move:`MoveOperation`,copy:`CopyOperation`,test:`TestOperation`}},StateDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{delta:{array:`JsonPatchOperation`}}},DeveloperMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},SystemMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},FunctionCall:{optional:[],fields:{}},ToolCall:{optional:[`encryptedValue`,`metadata`],fields:{function:`FunctionCall`}},AssistantMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`,`content`,`toolCalls`],fields:{toolCalls:{array:`ToolCall`}}},UserMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ToolMessage:{optional:[`subagentRunId`,`error`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ActivityMessage:{optional:[`subagentRunId`,`metadata`],fields:{}},ReasoningMessage:{optional:[`subagentRunId`,`encryptedValue`,`metadata`],fields:{}},Message:{discriminator:`role`,variants:{developer:`DeveloperMessage`,system:`SystemMessage`,assistant:`AssistantMessage`,user:`UserMessage`,tool:`ToolMessage`,activity:`ActivityMessage`,reasoning:`ReasoningMessage`}},MessagesSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`],fields:{messages:{array:`Message`}}},ActivitySnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`replace`],fields:{}},ActivityDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{patch:{array:`JsonPatchOperation`}}},RawEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`source`],fields:{}},CustomEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},Tool:{optional:[`parameters`,`metadata`],fields:{}},Context:{optional:[],fields:{}},ResumeEntry:{optional:[`payload`,`metadata`],fields:{}},RunAgentInput:{optional:[`protocolVersion`,`parentRunId`,`state`,`tools`,`context`,`forwardedProps`,`resume`],fields:{messages:{array:`Message`},tools:{array:`Tool`},context:{array:`Context`},resume:{array:`ResumeEntry`}}},RunStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`protocolVersion`,`parentRunId`,`input`],fields:{input:`RunAgentInput`}},RunFinishedSuccessOutcome:{optional:[`pendingToolCallIds`],fields:{}},Interrupt:{optional:[`subagentRunId`,`message`,`toolCallId`,`responseSchema`,`expiresAt`,`metadata`],fields:{}},RunFinishedInterruptOutcome:{optional:[],fields:{interrupts:{array:`Interrupt`}}},RunFinishedCancelledOutcome:{optional:[],fields:{}},RunFinishedOutcome:{discriminator:`type`,variants:{success:`RunFinishedSuccessOutcome`,interrupt:`RunFinishedInterruptOutcome`,cancelled:`RunFinishedCancelledOutcome`}},TokenUsage:{optional:[`provider`,`model`,`inputTokens`,`outputTokens`,`totalTokens`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],fields:{}},RunFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`,`usage`],fields:{outcome:`RunFinishedOutcome`,usage:{array:`TokenUsage`}}},RunErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`,`usage`],fields:{usage:{array:`TokenUsage`}}},StepStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},StepFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`delta`],fields:{}},ReasoningEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningEncryptedValueEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},SubagentStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`],fields:{}},SubagentFinishedSuccessOutcome:{optional:[],fields:{}},SubagentFinishedSuspendedOutcome:{optional:[`interruptIds`],fields:{}},SubagentFinishedOutcome:{discriminator:`type`,variants:{success:`SubagentFinishedSuccessOutcome`,suspended:`SubagentFinishedSuspendedOutcome`}},SubagentFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`],fields:{outcome:`SubagentFinishedOutcome`}},SubagentErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`],fields:{}},Event:{discriminator:`type`,variants:{TEXT_MESSAGE_START:`TextMessageStartEvent`,TEXT_MESSAGE_CONTENT:`TextMessageContentEvent`,TEXT_MESSAGE_END:`TextMessageEndEvent`,TEXT_MESSAGE_CHUNK:`TextMessageChunkEvent`,TOOL_CALL_START:`ToolCallStartEvent`,TOOL_CALL_ARGS:`ToolCallArgsEvent`,TOOL_CALL_END:`ToolCallEndEvent`,TOOL_CALL_CHUNK:`ToolCallChunkEvent`,TOOL_CALL_RESULT:`ToolCallResultEvent`,STATE_SNAPSHOT:`StateSnapshotEvent`,STATE_DELTA:`StateDeltaEvent`,MESSAGES_SNAPSHOT:`MessagesSnapshotEvent`,ACTIVITY_SNAPSHOT:`ActivitySnapshotEvent`,ACTIVITY_DELTA:`ActivityDeltaEvent`,RAW:`RawEvent`,CUSTOM:`CustomEvent`,RUN_STARTED:`RunStartedEvent`,RUN_FINISHED:`RunFinishedEvent`,RUN_ERROR:`RunErrorEvent`,STEP_STARTED:`StepStartedEvent`,STEP_FINISHED:`StepFinishedEvent`,REASONING_START:`ReasoningStartEvent`,REASONING_MESSAGE_START:`ReasoningMessageStartEvent`,REASONING_MESSAGE_CONTENT:`ReasoningMessageContentEvent`,REASONING_MESSAGE_END:`ReasoningMessageEndEvent`,REASONING_MESSAGE_CHUNK:`ReasoningMessageChunkEvent`,REASONING_END:`ReasoningEndEvent`,REASONING_ENCRYPTED_VALUE:`ReasoningEncryptedValueEvent`,SUBAGENT_STARTED:`SubagentStartedEvent`,SUBAGENT_FINISHED:`SubagentFinishedEvent`,SUBAGENT_ERROR:`SubagentErrorEvent`}},SubagentInfo:{optional:[`description`],fields:{}},IdentityCapabilities:{optional:[`name`,`type`,`description`,`version`,`provider`,`documentationUrl`,`metadata`],fields:{}},TransportCapabilities:{optional:[`streaming`,`websocket`,`httpBinary`,`pushNotifications`,`resumable`],fields:{}},ToolsCapabilities:{optional:[`supported`,`items`,`parallelCalls`,`clientProvided`],fields:{items:{array:`Tool`}}},OutputCapabilities:{optional:[`structuredOutput`,`supportedMimeTypes`],fields:{}},StateCapabilities:{optional:[`snapshots`,`deltas`,`memory`,`persistentState`],fields:{}},MultiAgentCapabilities:{optional:[`supported`,`delegation`,`handoffs`,`subagents`],fields:{subagents:{array:`SubagentInfo`}}},ReasoningCapabilities:{optional:[`supported`,`streaming`,`encrypted`],fields:{}},MultimodalInputCapabilities:{optional:[`image`,`audio`,`video`,`pdf`,`file`],fields:{}},MultimodalOutputCapabilities:{optional:[`image`,`audio`],fields:{}},MultimodalCapabilities:{optional:[`input`,`output`],fields:{input:`MultimodalInputCapabilities`,output:`MultimodalOutputCapabilities`}},ExecutionCapabilities:{optional:[`codeExecution`,`sandboxed`,`maxIterations`,`maxExecutionTime`],fields:{}},HumanInTheLoopCapabilities:{optional:[`supported`,`approvals`,`interventions`,`feedback`,`interrupts`,`approveWithEdits`],fields:{}},AgentCapabilities:{optional:[`identity`,`transport`,`tools`,`output`,`state`,`multiAgent`,`reasoning`,`multimodal`,`execution`,`humanInTheLoop`,`custom`],fields:{identity:`IdentityCapabilities`,transport:`TransportCapabilities`,tools:`ToolsCapabilities`,output:`OutputCapabilities`,state:`StateCapabilities`,multiAgent:`MultiAgentCapabilities`,reasoning:`ReasoningCapabilities`,multimodal:`MultimodalCapabilities`,execution:`ExecutionCapabilities`,humanInTheLoop:`HumanInTheLoopCapabilities`}}};function qi(e,t){if(typeof t==`string`)return qi(e,Ki[t]);if(`array`in t){if(!Array.isArray(e))return e;let n=e.map(e=>qi(e,t.array));return n.every((t,n)=>t===e[n])?e:n}if(typeof e!=`object`||!e||Array.isArray(e))return e;let n=e;if(`discriminator`in t){let r=n[t.discriminator];return typeof r==`string`&&Object.prototype.hasOwnProperty.call(t.variants,r)?qi(e,t.variants[r]):e}let r=n;for(let e of t.optional)Object.prototype.hasOwnProperty.call(n,e)&&n[e]===null&&(r===n&&(r={...n}),delete r[e]);for(let[e,i]of Object.entries(t.fields)){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=qi(r[e],i);t!==r[e]&&(r===n&&(r={...n}),r[e]=t)}return r}function Ji(e,t){return qi(e,t)}var M=class extends Error{constructor(e){super(e)}},Yi=class extends M{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}};function Xi(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}function Zi(e){return e===void 0?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Qi(e){return Array.isArray(e)&&e.some(e=>e.type!==`text`)}var $i=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ea=Object.prototype.hasOwnProperty;function ta(e,t){return ea.call(e,t)}function na(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function aa(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function oa(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function sa(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tN,_areEquals:()=>ya,applyOperation:()=>ma,applyPatch:()=>ha,applyReducer:()=>ga,deepClone:()=>P,getValueByPointer:()=>pa,validate:()=>va,validator:()=>_a}),N=la,P=ra,da={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=pa(n,this.path);r&&=ra(r);var i=ma(n,{op:`remove`,path:this.from}).removed;return ma(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=pa(n,this.from);return ma(n,{op:`add`,path:this.path,value:ra(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:ya(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},fa={add:function(e,t,n){return ia(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:da.move,copy:da.copy,test:da.test,_get:da._get};function pa(e,t){if(t==``)return e;var n={op:`_get`,path:t};return ma(e,n),n.value}function ma(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):_a(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=pa(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=ya(e,t.value),o.test===!1)throw new N(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new N("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=ra(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:_a;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=oa(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!ia(f))throw new N(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else ia(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new N(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=fa[t.op].call(t,c,f,e);if(o.test===!1)throw new N(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=da[t.op].call(t,c,f,e);if(o.test===!1)throw new N(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new N('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new N("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&sa(e.value))throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new N("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new N(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=va([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new N(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function va(e,t,n){try{if(!Array.isArray(e))throw new N(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)ha(ra(t),ra(e),n||!0);else{n||=_a;for(var r=0;rja,generate:()=>ka,observe:()=>Oa,unobserve:()=>Da}),xa=new WeakMap,Sa=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),Ca=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function wa(e){return xa.get(e)}function Ta(e,t){return e.observers.get(t)}function Ea(e,t){e.observers.delete(t.callback)}function Da(e,t){t.unobserve()}function Oa(e,t){var n=[],r,i=wa(e);if(!i)i=new Sa(e),xa.set(e,i);else{var a=Ta(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=ra(e),t){r.callback=t,r.next=null;var o=function(){ka(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){ka(r),clearTimeout(r.next),Ea(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new Ca(t,r)),r}function ka(e,t){t===void 0&&(t=!1);var n=xa.get(e.object);Aa(n.value,e.object,e.patches,``,t),e.patches.length&&ha(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Aa(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=na(t),o=na(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(ta(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?Aa(u,d,n,r+`/`+aa(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+aa(l),value:ra(u)}),n.push({op:`replace`,path:r+`/`+aa(l),value:ra(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+aa(l),value:ra(u)}),n.push({op:`remove`,path:r+`/`+aa(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(s||a.length!=o.length)for(var c=0;c0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Ra(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function za(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Ba?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ha(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof La==`function`?La(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Ua(e){return typeof e==`function`}function Wa(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ga=Wa(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
+`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Ka(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var qa=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=La(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Ua(c))try{c()}catch(e){i=e instanceof Ga?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=La(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Xa(f)}catch(e){i??=[],e instanceof Ga?i=za(za([],Ra(i)),Ra(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Ga(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Xa(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ka(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ka(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),Ja=qa.EMPTY;function Ya(e){return e instanceof qa||e&&`closed`in e&&Ua(e.remove)&&Ua(e.add)&&Ua(e.unsubscribe)}function Xa(e){Ua(e)?e():e.unsubscribe()}var Za={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qa={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Qa.delegate;return r?.setTimeout?r.setTimeout.apply(r,za([e,t],Ra(n))):setTimeout.apply(void 0,za([e,t],Ra(n)))},clearTimeout:function(e){return(Qa.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function $a(e){Qa.setTimeout(function(){var t=Za.onUnhandledError;if(t)t(e);else throw e})}function eo(){}var to=(function(){return io(`C`,void 0,void 0)})();function no(e){return io(`E`,void 0,e)}function ro(e){return io(`N`,e,void 0)}function io(e,t,n){return{kind:e,value:t,error:n}}var ao=null;function oo(e){if(Za.useDeprecatedSynchronousErrorHandling){var t=!ao;if(t&&(ao={errorThrown:!1,error:null}),e(),t){var n=ao,r=n.errorThrown,i=n.error;if(ao=null,r)throw i}}else e()}function so(e){Za.useDeprecatedSynchronousErrorHandling&&ao&&(ao.errorThrown=!0,ao.error=e)}var co=function(e){Pa(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ya(t)&&t.add(n)):n.destination=_o,n}return t.create=function(e,t,n){return new po(e,t,n)},t.prototype.next=function(e){this.isStopped?go(ro(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?go(no(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?go(to,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(qa),lo=Function.prototype.bind;function uo(e,t){return lo.call(e,t)}var fo=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){mo(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){mo(e)}else mo(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){mo(e)}},e}(),po=function(e){Pa(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Ua(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Za.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&uo(t.next,o),error:t.error&&uo(t.error,o),complete:t.complete&&uo(t.complete,o)}):a=t}return i.destination=new fo(a),i}return t}(co);function mo(e){Za.useDeprecatedSynchronousErrorHandling?so(e):$a(e)}function ho(e){throw e}function go(e,t){var n=Za.onStoppedNotification;n&&Qa.setTimeout(function(){return n(e,t)})}var _o={closed:!0,next:eo,error:ho,complete:eo},vo=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function yo(e){return e}function bo(){return xo([...arguments])}function xo(e){return e.length===0?yo:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var So=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=To(e)?e:new po(e,t,n);return oo(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Co(t),new t(function(t,r){var i=new po({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[vo]=function(){return this},e.prototype.pipe=function(){return xo([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Co(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Co(e){return e??Za.Promise??Promise}function wo(e){return e&&Ua(e.next)&&Ua(e.error)&&Ua(e.complete)}function To(e){return e&&e instanceof co||wo(e)&&Ya(e)}function Eo(e){return Ua(e?.lift)}function Do(e){return function(t){if(Eo(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Oo(e,t,n,r,i){return new ko(e,t,n,r,i)}var ko=function(e){Pa(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(co),Ao=Wa(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),jo=function(e){Pa(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Mo(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ao},t.prototype.next=function(e){var t=this;oo(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=La(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;oo(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;oo(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?Ja:(this.currentObservers=null,a.push(e),new qa(function(){t.currentObservers=null,Ka(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new So;return e.source=this,e},t.create=function(e,t){return new Mo(e,t)},t}(So),Mo=function(e){Pa(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??Ja},t}(jo),No={now:function(){return(No.delegate||Date).now()},delegate:void 0},Po=function(e){Pa(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=No);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a