@theopenapps/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/openapps.js +15 -15
- package/package.json +32 -8
package/dist/openapps.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Ob=Object.defineProperty;var qe=(e,r)=>{for(var i in r)Ob(e,i,{get:r[i],enumerable:!0})};import{parseArgs as AS}from"node:util";var s={};qe(s,{$brand:()=>Ua,$input:()=>su,$output:()=>au,INVALID:()=>be,NEVER:()=>Ca,TimePrecision:()=>bu,ZodAny:()=>od,ZodArray:()=>ud,ZodBase64:()=>qo,ZodBase64URL:()=>Ho,ZodBigInt:()=>zr,ZodBigIntFormat:()=>Qo,ZodBoolean:()=>Ir,ZodCIDRv4:()=>Jo,ZodCIDRv6:()=>Wo,ZodCUID:()=>Lo,ZodCUID2:()=>Mo,ZodCatch:()=>jd,ZodCodec:()=>Nn,ZodCompileAsyncError:()=>Re,ZodCompileUnsupportedError:()=>M,ZodCreditCard:()=>Xl,ZodCustom:()=>Cn,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Pn,ZodDefault:()=>xd,ZodDiscriminatedUnion:()=>dd,ZodE164:()=>Xo,ZodEmail:()=>Uo,ZodEmoji:()=>Ro,ZodEnum:()=>wr,ZodError:()=>Kk,ZodExactOptional:()=>na,ZodFile:()=>_d,ZodFirstPartyTypeKind:()=>Bd,ZodFunction:()=>Ld,ZodGUID:()=>Eo,ZodIBAN:()=>Yl,ZodIPv4:()=>Ko,ZodIPv6:()=>Go,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>Fd,ZodIntersection:()=>pd,ZodIssueCode:()=>Wk,ZodJWT:()=>Yo,ZodKSUID:()=>Bo,ZodLazy:()=>Ed,ZodLiteral:()=>yd,ZodMAC:()=>Hl,ZodMap:()=>vd,ZodNaN:()=>Td,ZodNanoID:()=>Zo,ZodNever:()=>sd,ZodNonOptional:()=>ia,ZodNull:()=>nd,ZodNullable:()=>wd,ZodNumber:()=>Sr,ZodNumberFormat:()=>Lt,ZodObject:()=>jn,ZodOptional:()=>Tn,ZodPipe:()=>Dn,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Zd,ZodReadonly:()=>Nd,ZodRealError:()=>Ie,ZodRecord:()=>kr,ZodSet:()=>bd,ZodString:()=>xr,ZodStringFormat:()=>H,ZodSuccess:()=>Od,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ud,ZodTransform:()=>$d,ZodTuple:()=>fd,ZodType:()=>R,ZodULID:()=>Vo,ZodURL:()=>zn,ZodUUID:()=>Ge,ZodUndefined:()=>rd,ZodUnion:()=>An,ZodUnknown:()=>ad,ZodVoid:()=>cd,ZodXID:()=>Fo,ZodXor:()=>ld,_ZodString:()=>Co,_default:()=>Sd,_function:()=>ih,any:()=>Cg,array:()=>On,base64:()=>gg,base64url:()=>hg,bigint:()=>jg,boolean:()=>ed,catch:()=>Ad,check:()=>oh,cidrv4:()=>mg,cidrv6:()=>fg,clone:()=>G,codec:()=>eh,coerce:()=>Gd,compile:()=>du,config:()=>re,core:()=>et,creditCard:()=>bg,cuid:()=>og,cuid2:()=>ag,currencyCode:()=>xg,custom:()=>ah,date:()=>Eg,decode:()=>Fl,decodeAsync:()=>Kl,deepPartial:()=>yh,describe:()=>sh,discriminatedUnion:()=>Fg,e164:()=>vg,email:()=>qf,emoji:()=>ng,encode:()=>Vl,encodeAsync:()=>Bl,endsWith:()=>dr,enum:()=>ta,exactOptional:()=>kd,file:()=>Hg,flattenError:()=>qr,float32:()=>Ig,float64:()=>zg,formatError:()=>Hr,fromJSONSchema:()=>vh,function:()=>ih,getDiscriminatedOption:()=>Nc,getErrorMap:()=>Hk,globalRegistry:()=>le,gt:()=>Be,gte:()=>Ae,guid:()=>Hf,hash:()=>Sg,hex:()=>wg,hostname:()=>kg,httpUrl:()=>rg,iban:()=>yg,includes:()=>ur,input:()=>$h,instanceof:()=>uh,int:()=>Do,int32:()=>Pg,int64:()=>Ag,intersection:()=>md,invertCodec:()=>th,ipv4:()=>lg,ipv6:()=>pg,iso:()=>Un,json:()=>dh,jwt:()=>_g,keyof:()=>Rg,ksuid:()=>ug,lazy:()=>Rd,length:()=>Nt,literal:()=>qg,locales:()=>vn,looseObject:()=>Mg,looseRecord:()=>Kg,lowercase:()=>sr,lt:()=>Fe,lte:()=>je,mac:()=>dg,map:()=>Gg,maxLength:()=>Dt,maxSize:()=>lt,memoizer:()=>gn,meta:()=>ch,mime:()=>mr,minLength:()=>Qe,minSize:()=>Ke,multipleOf:()=>ut,nan:()=>Qg,nanoid:()=>ig,nativeEnum:()=>Wg,negative:()=>ko,never:()=>ea,nonnegative:()=>xo,nonoptional:()=>Pd,nonpositive:()=>wo,normalize:()=>fr,null:()=>id,nullable:()=>In,nullish:()=>Xg,number:()=>Ql,object:()=>Zg,optional:()=>Et,output:()=>kh,overwrite:()=>Ze,parse:()=>Rl,parseAsync:()=>Zl,partialRecord:()=>Bg,pipe:()=>No,positive:()=>$o,prefault:()=>zd,preprocess:()=>ph,prettifyError:()=>Ma,promise:()=>nh,properties:()=>pr,property:()=>So,readonly:()=>Cd,record:()=>hd,refine:()=>Md,regex:()=>ar,regexes:()=>Ce,registry:()=>qi,safeDecode:()=>Jl,safeDecodeAsync:()=>ql,safeEncode:()=>Gl,safeEncodeAsync:()=>Wl,safeParse:()=>Ll,safeParseAsync:()=>Ml,set:()=>Jg,setErrorMap:()=>qk,size:()=>Tt,slugify:()=>br,startsWith:()=>lr,strictObject:()=>Lg,string:()=>Sn,stringFormat:()=>$g,stringbool:()=>lh,success:()=>Yg,superRefine:()=>Vd,symbol:()=>Dg,templateLiteral:()=>rh,toJSONSchema:()=>Oo,toLowerCase:()=>hr,toUpperCase:()=>vr,toZod:()=>Lr,transform:()=>ra,treeifyError:()=>La,trim:()=>gr,tuple:()=>gd,uint32:()=>Og,uint64:()=>Tg,ulid:()=>sg,undefined:()=>Ng,union:()=>Pr,unknown:()=>Ut,uppercase:()=>cr,url:()=>tg,util:()=>y,uuid:()=>Xf,uuidv4:()=>Yf,uuidv6:()=>Qf,uuidv7:()=>eg,validate:()=>Xr,validateAsync:()=>Yr,void:()=>Ug,withParser:()=>Hi,xid:()=>cg,xor:()=>Vg});var et={};qe(et,{$ZodAny:()=>Ic,$ZodArray:()=>Ac,$ZodAsyncError:()=>xe,$ZodBase64:()=>fc,$ZodBase64URL:()=>gc,$ZodBigInt:()=>Ci,$ZodBigIntFormat:()=>kc,$ZodBoolean:()=>un,$ZodCIDRv4:()=>pc,$ZodCIDRv6:()=>mc,$ZodCUID:()=>ec,$ZodCUID2:()=>tc,$ZodCatch:()=>Hc,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>zs,$ZodCheckEndsWith:()=>Zs,$ZodCheckGreaterThan:()=>yi,$ZodCheckIncludes:()=>Es,$ZodCheckLengthEquals:()=>Ds,$ZodCheckLessThan:()=>bi,$ZodCheckLowerCase:()=>Cs,$ZodCheckMaxLength:()=>As,$ZodCheckMaxSize:()=>Ps,$ZodCheckMimeType:()=>Vs,$ZodCheckMinLength:()=>Ts,$ZodCheckMinSize:()=>Os,$ZodCheckMultipleOf:()=>Ss,$ZodCheckNumberFormat:()=>Is,$ZodCheckOverwrite:()=>Fs,$ZodCheckProperties:()=>Ms,$ZodCheckProperty:()=>Ls,$ZodCheckRegex:()=>Ns,$ZodCheckSizeEquals:()=>js,$ZodCheckStartsWith:()=>Rs,$ZodCheckStringFormat:()=>tr,$ZodCheckUpperCase:()=>Us,$ZodCodec:()=>dn,$ZodCreditCard:()=>vc,$ZodCustom:()=>nu,$ZodCustomStringFormat:()=>_c,$ZodCyclicError:()=>Vi,$ZodDate:()=>jc,$ZodDefault:()=>Gc,$ZodDiscriminatedUnion:()=>Cc,$ZodE164:()=>hc,$ZodEmail:()=>Ws,$ZodEmoji:()=>Ys,$ZodEncodeError:()=>ct,$ZodEnum:()=>Lc,$ZodError:()=>Za,$ZodExactOptional:()=>Bc,$ZodFile:()=>Vc,$ZodFunction:()=>tu,$ZodGUID:()=>Gs,$ZodIBAN:()=>bc,$ZodIPv4:()=>uc,$ZodIPv6:()=>lc,$ZodISODate:()=>ac,$ZodISODateTime:()=>oc,$ZodISODuration:()=>cc,$ZodISOTime:()=>sc,$ZodIntersection:()=>Uc,$ZodJWT:()=>yc,$ZodKSUID:()=>ic,$ZodLazy:()=>pn,$ZodLiteral:()=>Mc,$ZodMAC:()=>dc,$ZodMap:()=>Rc,$ZodNaN:()=>Xc,$ZodNanoID:()=>Qs,$ZodNever:()=>Pc,$ZodNonOptional:()=>Wc,$ZodNull:()=>Sc,$ZodNullable:()=>Kc,$ZodNumber:()=>Ni,$ZodNumberFormat:()=>$c,$ZodObject:()=>im,$ZodObjectJIT:()=>Tc,$ZodOptional:()=>Ei,$ZodPipe:()=>Ri,$ZodPrefault:()=>Jc,$ZodPreprocess:()=>Yc,$ZodPromise:()=>ru,$ZodReadonly:()=>Qc,$ZodRealError:()=>Se,$ZodRecord:()=>Ec,$ZodRegistry:()=>Wi,$ZodSet:()=>Zc,$ZodString:()=>zt,$ZodStringFormat:()=>J,$ZodSuccess:()=>qc,$ZodSymbol:()=>wc,$ZodTemplateLiteral:()=>eu,$ZodTransform:()=>Fc,$ZodTuple:()=>Ui,$ZodType:()=>U,$ZodULID:()=>rc,$ZodURL:()=>Xs,$ZodUUID:()=>Js,$ZodUndefined:()=>xc,$ZodUnion:()=>ln,$ZodUnknown:()=>zc,$ZodVoid:()=>Oc,$ZodXID:()=>nc,$ZodXor:()=>Dc,$brand:()=>Ua,$constructor:()=>g,$input:()=>su,$output:()=>au,Doc:()=>It,INVALID:()=>be,JSONSchema:()=>Gf,JSONSchemaGenerator:()=>jo,NEVER:()=>Ca,TimePrecision:()=>bu,URL_BAD_FORMAT:()=>qs,URL_UNPARSEABLE:()=>nn,ZodCompileAsyncError:()=>Re,ZodCompileUnsupportedError:()=>M,_any:()=>Cu,_array:()=>Vu,_base64:()=>vo,_base64url:()=>bo,_bigint:()=>Pu,_boolean:()=>Iu,_catch:()=>Dk,_check:()=>jf,_cidrv4:()=>go,_cidrv6:()=>ho,_coercedBigint:()=>Ou,_coercedBoolean:()=>zu,_coercedDate:()=>Lu,_coercedNumber:()=>_u,_coercedString:()=>fu,_creditCard:()=>hu,_cuid:()=>so,_cuid2:()=>co,_custom:()=>Bu,_date:()=>Zu,_decode:()=>si,_decodeAsync:()=>ui,_default:()=>jk,_discriminatedUnion:()=>bk,_e164:()=>yo,_email:()=>Qi,_emoji:()=>oo,_encode:()=>ai,_encodeAsync:()=>ci,_endsWith:()=>dr,_enum:()=>xk,_file:()=>Fu,_float32:()=>ku,_float64:()=>wu,_gt:()=>Be,_gte:()=>Ae,_guid:()=>eo,_iban:()=>vu,_includes:()=>ur,_int:()=>$u,_int32:()=>xu,_int64:()=>ju,_intersection:()=>yk,_ipv4:()=>mo,_ipv6:()=>fo,_isoDate:()=>_n,_isoDateTime:()=>yn,_isoDuration:()=>kn,_isoTime:()=>$n,_jwt:()=>_o,_ksuid:()=>po,_lazy:()=>Ek,_length:()=>Nt,_literal:()=>Ik,_lowercase:()=>sr,_lt:()=>Fe,_lte:()=>je,_mac:()=>gu,_map:()=>kk,_max:()=>je,_maxLength:()=>Dt,_maxSize:()=>lt,_mime:()=>mr,_min:()=>Ae,_minLength:()=>Qe,_minSize:()=>Ke,_multipleOf:()=>ut,_nan:()=>Mu,_nanoid:()=>ao,_nativeEnum:()=>Sk,_negative:()=>ko,_never:()=>Eu,_nonnegative:()=>xo,_nonoptional:()=>Ak,_nonpositive:()=>wo,_normalize:()=>fr,_null:()=>Nu,_nullable:()=>Ok,_number:()=>yu,_optional:()=>Pk,_overwrite:()=>Ze,_parse:()=>Xt,_parseAsync:()=>Yt,_pipe:()=>Nk,_positive:()=>$o,_promise:()=>Rk,_properties:()=>pr,_property:()=>So,_readonly:()=>Ck,_record:()=>$k,_refine:()=>Ku,_regex:()=>ar,_safeDecode:()=>di,_safeDecodeAsync:()=>mi,_safeEncode:()=>li,_safeEncodeAsync:()=>pi,_safeParse:()=>Qt,_safeParseAsync:()=>er,_set:()=>wk,_size:()=>Tt,_slugify:()=>br,_startsWith:()=>lr,_string:()=>mu,_stringFormat:()=>Ct,_stringbool:()=>qu,_success:()=>Tk,_superRefine:()=>Gu,_symbol:()=>Tu,_templateLiteral:()=>Uk,_toLowerCase:()=>hr,_toUpperCase:()=>vr,_transform:()=>zk,_trim:()=>gr,_tuple:()=>_k,_uint32:()=>Su,_uint64:()=>Au,_ulid:()=>uo,_undefined:()=>Du,_union:()=>hk,_unknown:()=>Uu,_uppercase:()=>cr,_url:()=>bn,_uuid:()=>to,_uuidv4:()=>ro,_uuidv6:()=>no,_uuidv7:()=>io,_void:()=>Ru,_xid:()=>lo,_xor:()=>vk,base64Charset:()=>Oi,base64urlCharset:()=>cn,canParseURL:()=>Hs,clone:()=>G,compile:()=>du,compileFn:()=>Xi,config:()=>re,createStandardJSONSchemaMethod:()=>yr,createToJSONSchemaMethod:()=>Xu,decode:()=>_y,decodeAsync:()=>ky,describe:()=>Ju,encode:()=>yy,encodeAsync:()=>$y,extractDefs:()=>pt,finalize:()=>mt,flattenError:()=>qr,formatError:()=>Hr,getDiscriminatedOption:()=>Nc,globalConfig:()=>ae,globalRegistry:()=>le,handleUnrepresentable:()=>ie,initializeContext:()=>dt,isBackEdge:()=>Bi,isRecursiveSchema:()=>Fi,isValidBase64:()=>sn,isValidBase64URL:()=>ji,isValidCIDRv6:()=>Pi,isValidCreditCard:()=>Ai,isValidIBAN:()=>Ti,isValidIPv6:()=>an,isValidJWT:()=>Di,locales:()=>vn,memoizer:()=>gn,mergeValues:()=>rr,meta:()=>Wu,parse:()=>ii,parseAsync:()=>oi,parseURLObject:()=>tm,prettifyError:()=>Ma,process:()=>W,processSchema:()=>W,regexes:()=>Ce,registry:()=>qi,safeDecode:()=>xy,safeDecodeAsync:()=>Iy,safeEncode:()=>wy,safeEncodeAsync:()=>Sy,safeParse:()=>fy,safeParseAsync:()=>gy,standardProps:()=>xi,stripTabAndNewline:()=>on,toDotPath:()=>Np,toJSONSchema:()=>Oo,toZod:()=>Lr,treeifyError:()=>La,urlHostnameOk:()=>Ii,urlProtocolOk:()=>zi,util:()=>y,validate:()=>Xr,validateAsync:()=>Yr,validateURL:()=>Si,version:()=>Bs,withParser:()=>Hi});var y={};qe(y,{BIGINT_FORMAT_RANGES:()=>Kr,CONSTANT_CATCH:()=>ri,Class:()=>Sa,NUMBER_FORMAT_RANGES:()=>Br,aborted:()=>ve,allowsEval:()=>Pa,assert:()=>Nb,assertEqual:()=>jb,assertIs:()=>Tb,assertNever:()=>Db,assertNotEqual:()=>Ab,assignProp:()=>ue,attachSchema:()=>ti,base64ToUint8Array:()=>Pp,base64urlToUint8Array:()=>Qb,cached:()=>Wt,captureStackTrace:()=>Qn,cleanEnum:()=>Yb,cleanRegex:()=>Xe,clone:()=>G,cloneDef:()=>Eb,codePointLength:()=>xt,constantCatch:()=>Da,createTransparentProxy:()=>Fb,defineLazy:()=>Ia,defineLazyInternal:()=>Z,derived:()=>ny,esc:()=>he,escapeRegex:()=>Ne,explicitlyAborted:()=>Aa,extend:()=>Gb,finalizeIssue:()=>we,floatSafeRemainder:()=>Mr,getElementAtPath:()=>Rb,getEnumValues:()=>Gt,getLengthableOrigin:()=>Jr,getParsedType:()=>Vb,getSizableOrigin:()=>Gr,hexToUint8Array:()=>ty,hide:()=>Wr,installLazyProp:()=>sy,isObject:()=>wt,isPlainObject:()=>De,issue:()=>Ht,joinValues:()=>h,jsonStringifyReplacer:()=>Jt,members:()=>Ta,merge:()=>Wb,mergeDefs:()=>Ee,normalizeParams:()=>I,nullish:()=>Yn,numKeys:()=>Mb,objectClone:()=>Cb,omit:()=>Kb,optionalKeys:()=>ja,own:()=>st,parsedType:()=>$,partial:()=>qb,pick:()=>Bb,prefixIssues:()=>ke,primitiveTypes:()=>Oa,promiseAllObject:()=>Zb,propertyKeyTypes:()=>Fr,randomString:()=>Lb,rawShape:()=>qt,required:()=>Hb,safeExtend:()=>Jb,shallowClone:()=>Vr,slugify:()=>za,stringifyPrimitive:()=>_,toZod:()=>Lr,uint8ArrayToBase64:()=>Op,uint8ArrayToBase64url:()=>ey,uint8ArrayToHex:()=>ry,unwrapMessage:()=>Kt});function jb(e){return e}function Ab(e){return e}function Lr(){return e=>e}function Tb(e){}function Db(e){throw new Error("Unexpected value in exhaustive check")}function Nb(e){}function Gt(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function h(e,r="|"){return e.map(i=>_(i)).join(r)}function Jt(e,r){return typeof r=="bigint"?r.toString():r}var xa=class{constructor(r){this._getter=r,this._value=void 0}get value(){let r=this._getter;return r!==void 0&&(this._value=r(),this._getter=void 0),this._value}};function Wt(e){return new xa(e)}function Yn(e){return e==null}function Xe(e){let r=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(r,i)}function Mr(e,r){let i=e/r,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var xp=Symbol("evaluating");function Ia(e,r,i){let o;Object.defineProperty(e,r,{get(){if(o!==xp)return o===void 0&&(o=xp,o=i()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Cb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ue(e,r,i){Object.defineProperty(e,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function qt(e){let r=Object.getOwnPropertyDescriptor(e,"shape");return r?.get?r.get.raw:r?.value}function He(e){return qt(e._zod.def)??e._zod.def.shape}function Sp(e,r,i){Object.defineProperty(e,r,{get(){let o=i();return ue(this,r,o),o},enumerable:!0,configurable:!0})}function Ip(e,r,i){r in e?ue(e,r,i):e[r]=i}function kt(e,r,i,o){let t=He(r);for(let n of i){let a=Object.getOwnPropertyDescriptor(t,n);a.enumerable&&(a.get?Sp(e,n,()=>{let c=r._zod.def.shape[n];return o?o(c,n):c}):Ip(e,n,o?o(a.value,n):a.value))}}function Ub(e,r){for(let i of Reflect.ownKeys(r)){let o=Object.getOwnPropertyDescriptor(r,i);o.enumerable&&(o.get?Sp(e,i,()=>r[i]):Ip(e,i,o.value))}}function Ee(...e){let r={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Eb(e){return Ee(e._zod.def)}function Rb(e,r){return r?r.reduce((i,o)=>i?.[o],e):e}function Zb(e){let r=Object.keys(e),i=r.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let n=0;n<r.length;n++)t[r[n]]=o[n];return t})}function Lb(e=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function he(e){return JSON.stringify(e)}function za(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pa=Wt(()=>{if(ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function De(e){if(wt(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(wt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Vr(e){return De(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Mb(e){let r=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r++;return r}var Vb=e=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Fr=new Set(["string","number","symbol"]),Oa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,r,i){let o=new e._zod.constr(r??e._zod.def);return(!r||i?.parent)&&(o._zod.parent=e),o}function I(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Fb(e){let r;return new Proxy({},{get(i,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(i,o,t,n){return r??(r=e()),Reflect.set(r,o,t,n)},has(i,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function _(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ja(e){return Object.keys(e).filter(r=>e[r]._zod.optin!==void 0&&e[r]._zod.optout==="optional")}var Br={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Bb(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n={};return kt(n,e,ei(e,r)),G(e,Ee(i,{shape:n,checks:[]}))}function ei(e,r){let i=He(e),o=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(i,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);r[t]&&o.push(t)}return o}function Kb(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=new Set(ei(e,r)),a={};return kt(a,e,Reflect.ownKeys(He(e)).filter(c=>!n.has(c))),G(e,Ee(i,{shape:a,checks:[]}))}function Gb(e,r){if(!De(r))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let t=He(e);for(let n of Reflect.ownKeys(r))if(Object.getOwnPropertyDescriptor(t,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return G(e,Ee(e._zod.def,{shape:zp(e,r)}))}function zp(e,r){let i={};return kt(i,e,Reflect.ownKeys(He(e))),Ub(i,r),i}function Jb(e,r){if(!De(r))throw new Error("Invalid input to safeExtend: expected a plain object");return G(e,Ee(e._zod.def,{shape:zp(e,r)}))}function Wb(e,r){if(!r?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let i={};kt(i,e,Reflect.ownKeys(He(e))),kt(i,r,Reflect.ownKeys(He(r)));let o=Ee(e._zod.def,{shape:i,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return G(e,o)}function qb(e,r,i,o="partial"){let n=r._zod.def.checks;if(n&&n.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=i?new Set(ei(r,i)):void 0,u={};return kt(u,r,Reflect.ownKeys(He(r)),e&&((l,d)=>c&&!c.has(d)?l:new e({type:"optional",innerType:l}))),G(r,Ee(r._zod.def,{shape:u,checks:[]}))}function Hb(e,r,i){let o=i?new Set(ei(r,i)):void 0,t={};return kt(t,r,Reflect.ownKeys(He(r)),(n,a)=>o&&!o.has(a)?n:new e({type:"nonoptional",innerType:n})),G(r,Ee(r._zod.def,{shape:t}))}function ve(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Aa(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function ke(e,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Kt(e){return typeof e=="string"?e:e?.message}function ti(e,r,i){var o;for(let t=r;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function we(e,r,i){var o;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let n=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Kt(e.inst?._zod.def?.error?.(e))??Kt(n?.(e))??Kt(r?.error?.(e))??Kt(i.customError?.(e))??Kt(i.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,r?.reportInput&&(c.input=e.input),c}function Gr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Xb=/[\uD800-\uDBFF]/;function xt(e){let r=e.length;if(!Xb.test(e))return r;let i=r;for(let o=0;o<r-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function Jr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function Ht(...e){let[r,i,o]=e;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function Yb(e){return Object.entries(e).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Pp(e){let r=atob(e),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function Op(e){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}function Qb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Pp(r+i)}function ey(e){return Op(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ty(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function ry(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var Sa=class{constructor(...r){}};function Ta(e,r){for(let i in r){let o=Object.getOwnPropertyDescriptor(r,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):iy(e,i,o.value)}}function st(e,r,i,o=!0){return Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function Wr(e,r,i){return st(e,r,i,!1)}function ny(e,r){for(let i in e){let o=e[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!0,get(){return st(this,i,o(this))},set(t){st(this,i,t)}})}return r}function iy(e,r,i){Object.defineProperty(e,r,{configurable:!0,get(){return this==null?i:st(this,r,i.bind(this))},set(o){st(this,r,o)}})}function oy(e,r){let i=Object.getPrototypeOf(e);return r in i?void 0:i}var wa,at=!1,ay={configurable:!0,get(){at=!0}};function Z(e,r,i){let o=Object.getPrototypeOf(e._zod);if(r in o&&wa!==e._zod){wa=void 0;return}wa=e._zod,Object.defineProperty(o,r,{configurable:!0,get(){Object.defineProperty(this,r,ay);let t=at;at=!1;try{let n=i(this);return at?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),at=at||t,n}catch(n){throw delete this[r],at=at||t,n}},set(t){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t})}})}function sy(e,r,i,o){let t=oy(e,r);t&&Object.defineProperty(t,r,{configurable:!0,get(){let n={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,r,n),n.value=i(this),Object.defineProperty(this,r,n),n.value},set(n){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:o,value:n})}})}var ri="~constantCatch";function Da(e){let r=()=>e;return r[ri]=!0,r}var jp,Ca=Object.freeze({status:"aborted"}),Na={value:void 0,enumerable:!1},Ap="captureStackTrace"in Error?Error:null;function cy(e){let r=Ap;if(r){let i=r.stackTraceLimit;if(typeof i=="number"){try{r.stackTraceLimit=0}catch{return Ap=null,new e}try{return new e}finally{r.stackTraceLimit=i}}}return new e}function g(e,r,i,o){let t={};function n(m){this.def=m,this.constr=p,this.traits=new Set}n.prototype=t;let a=i,c=a&&new WeakSet;function u(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{Na.value=new n(f);try{Object.defineProperty(m,"_zod",Na)}finally{Na.value=void 0}}if(m._zod.traits.add(e),r(m,f),c){let k=Object.getPrototypeOf(m),x=m._zod.constr.prototype,j=k;for(;j&&j!==x;)j=Object.getPrototypeOf(j);let P=j??k;c.has(P)||(c.add(P),Ta(P,a))}let v=p.prototype;for(let k in v)Object.prototype.hasOwnProperty.call(v,k)&&(k in m||(m[k]=v[k].bind(m)))}let l=o?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(m){let f=o?.Parent?cy(d):this;u(f,m);let v=f._zod.deferred;if(v){for(let x of v)x();f._zod.deferred=void 0}let k=globalThis.__zod_globalConfig?.postProcessor;return k&&k(f),f}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>o?.Parent&&m instanceof o.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var Ua=Symbol("zod_brand"),xe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ct=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(jp=globalThis).__zod_globalConfig??(jp.__zod_globalConfig={});var ae=globalThis.__zod_globalConfig;function re(e){return e&&Object.assign(ae,e),ae}function uy(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Jt,2)),e.message}function ly(e){this._zod.message=e}var dy={get:uy,set:ly,enumerable:!0,configurable:!0},Ra={value:void 0,enumerable:!1},Tp=new WeakSet([Object.prototype,Error.prototype]),Dp=(e,r)=>{e.name="$ZodError",Ra.value=r,Object.defineProperty(e,"issues",Ra),Ra.value=void 0,Object.defineProperty(e,"message",dy);let i=Object.getPrototypeOf(e);Tp.has(i)||(Tp.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Za=g("$ZodError",Dp),Se=g("$ZodError",Dp,void 0,{Parent:Error});function py(e,r,i){return Object.prototype.hasOwnProperty.call(e,r)||(r==="__proto__"?Object.defineProperty(e,r,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[r]=i()),e[r]}function qr(e,r=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?py(i,t.path[0],()=>[]).push(r(t)):o.push(r(t));return{formErrors:o,fieldErrors:i}}function Hr(e,r=i=>i.message){let i={_errors:[]},o=(t,n=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let c=[...n,...a.path];if(c.length===0)i._errors.push(r(a));else{let u=i,l=0;for(;l<c.length;){let d=c[l],p=l===c.length-1;if(d==="_errors"){p&&u._errors.push(r(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,d)||Object.defineProperty(u,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=u[d];p&&m._errors.push(r(a)),u=m,l++}}}};return o(e),i}function La(e,r=i=>i.message){let i={errors:[]},o=(t,n=[])=>{var a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...n,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...n,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...n,...c.path]);else{let u=[...n,...c.path];if(u.length===0){i.errors.push(r(c));continue}let l=i,d=0;for(;d<u.length;){let p=u[d],m=d===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(r(c)),d++}}};return o(e),i}function Np(e){let r=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Ma(e){let r=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Np(o.path)}`);return r.join(`
|
|
2
|
+
var Ob=Object.defineProperty;var qe=(e,r)=>{for(var i in r)Ob(e,i,{get:r[i],enumerable:!0})};import{parseArgs as TS}from"node:util";var s={};qe(s,{$brand:()=>Ua,$input:()=>su,$output:()=>au,INVALID:()=>be,NEVER:()=>Ca,TimePrecision:()=>bu,ZodAny:()=>od,ZodArray:()=>ud,ZodBase64:()=>qo,ZodBase64URL:()=>Ho,ZodBigInt:()=>zr,ZodBigIntFormat:()=>Qo,ZodBoolean:()=>Ir,ZodCIDRv4:()=>Jo,ZodCIDRv6:()=>Wo,ZodCUID:()=>Lo,ZodCUID2:()=>Mo,ZodCatch:()=>jd,ZodCodec:()=>Nn,ZodCompileAsyncError:()=>Re,ZodCompileUnsupportedError:()=>M,ZodCreditCard:()=>Xl,ZodCustom:()=>Cn,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Pn,ZodDefault:()=>xd,ZodDiscriminatedUnion:()=>dd,ZodE164:()=>Xo,ZodEmail:()=>Uo,ZodEmoji:()=>Ro,ZodEnum:()=>wr,ZodError:()=>Kk,ZodExactOptional:()=>na,ZodFile:()=>_d,ZodFirstPartyTypeKind:()=>Bd,ZodFunction:()=>Ld,ZodGUID:()=>Eo,ZodIBAN:()=>Yl,ZodIPv4:()=>Ko,ZodIPv6:()=>Go,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>Fd,ZodIntersection:()=>pd,ZodIssueCode:()=>Wk,ZodJWT:()=>Yo,ZodKSUID:()=>Bo,ZodLazy:()=>Ed,ZodLiteral:()=>yd,ZodMAC:()=>Hl,ZodMap:()=>vd,ZodNaN:()=>Td,ZodNanoID:()=>Zo,ZodNever:()=>sd,ZodNonOptional:()=>ia,ZodNull:()=>nd,ZodNullable:()=>wd,ZodNumber:()=>Sr,ZodNumberFormat:()=>Lt,ZodObject:()=>jn,ZodOptional:()=>Tn,ZodPipe:()=>Dn,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Zd,ZodReadonly:()=>Nd,ZodRealError:()=>Ie,ZodRecord:()=>kr,ZodSet:()=>bd,ZodString:()=>xr,ZodStringFormat:()=>H,ZodSuccess:()=>Od,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ud,ZodTransform:()=>$d,ZodTuple:()=>fd,ZodType:()=>R,ZodULID:()=>Vo,ZodURL:()=>zn,ZodUUID:()=>Ge,ZodUndefined:()=>rd,ZodUnion:()=>An,ZodUnknown:()=>ad,ZodVoid:()=>cd,ZodXID:()=>Fo,ZodXor:()=>ld,_ZodString:()=>Co,_default:()=>Sd,_function:()=>ih,any:()=>Cg,array:()=>On,base64:()=>gg,base64url:()=>hg,bigint:()=>jg,boolean:()=>ed,catch:()=>Ad,check:()=>oh,cidrv4:()=>mg,cidrv6:()=>fg,clone:()=>G,codec:()=>eh,coerce:()=>Gd,compile:()=>du,config:()=>re,core:()=>et,creditCard:()=>bg,cuid:()=>og,cuid2:()=>ag,currencyCode:()=>xg,custom:()=>ah,date:()=>Eg,decode:()=>Fl,decodeAsync:()=>Kl,deepPartial:()=>yh,describe:()=>sh,discriminatedUnion:()=>Fg,e164:()=>vg,email:()=>qf,emoji:()=>ng,encode:()=>Vl,encodeAsync:()=>Bl,endsWith:()=>dr,enum:()=>ta,exactOptional:()=>kd,file:()=>Hg,flattenError:()=>qr,float32:()=>Ig,float64:()=>zg,formatError:()=>Hr,fromJSONSchema:()=>vh,function:()=>ih,getDiscriminatedOption:()=>Nc,getErrorMap:()=>Hk,globalRegistry:()=>le,gt:()=>Be,gte:()=>Ae,guid:()=>Hf,hash:()=>Sg,hex:()=>wg,hostname:()=>kg,httpUrl:()=>rg,iban:()=>yg,includes:()=>ur,input:()=>$h,instanceof:()=>uh,int:()=>Do,int32:()=>Pg,int64:()=>Ag,intersection:()=>md,invertCodec:()=>th,ipv4:()=>lg,ipv6:()=>pg,iso:()=>Un,json:()=>dh,jwt:()=>_g,keyof:()=>Rg,ksuid:()=>ug,lazy:()=>Rd,length:()=>Nt,literal:()=>qg,locales:()=>vn,looseObject:()=>Mg,looseRecord:()=>Kg,lowercase:()=>sr,lt:()=>Fe,lte:()=>je,mac:()=>dg,map:()=>Gg,maxLength:()=>Dt,maxSize:()=>lt,memoizer:()=>gn,meta:()=>ch,mime:()=>mr,minLength:()=>Qe,minSize:()=>Ke,multipleOf:()=>ut,nan:()=>Qg,nanoid:()=>ig,nativeEnum:()=>Wg,negative:()=>ko,never:()=>ea,nonnegative:()=>xo,nonoptional:()=>Pd,nonpositive:()=>wo,normalize:()=>fr,null:()=>id,nullable:()=>In,nullish:()=>Xg,number:()=>Ql,object:()=>Zg,optional:()=>Et,output:()=>kh,overwrite:()=>Ze,parse:()=>Rl,parseAsync:()=>Zl,partialRecord:()=>Bg,pipe:()=>No,positive:()=>$o,prefault:()=>zd,preprocess:()=>ph,prettifyError:()=>Ma,promise:()=>nh,properties:()=>pr,property:()=>So,readonly:()=>Cd,record:()=>hd,refine:()=>Md,regex:()=>ar,regexes:()=>Ce,registry:()=>qi,safeDecode:()=>Jl,safeDecodeAsync:()=>ql,safeEncode:()=>Gl,safeEncodeAsync:()=>Wl,safeParse:()=>Ll,safeParseAsync:()=>Ml,set:()=>Jg,setErrorMap:()=>qk,size:()=>Tt,slugify:()=>br,startsWith:()=>lr,strictObject:()=>Lg,string:()=>Sn,stringFormat:()=>$g,stringbool:()=>lh,success:()=>Yg,superRefine:()=>Vd,symbol:()=>Dg,templateLiteral:()=>rh,toJSONSchema:()=>Oo,toLowerCase:()=>hr,toUpperCase:()=>vr,toZod:()=>Lr,transform:()=>ra,treeifyError:()=>La,trim:()=>gr,tuple:()=>gd,uint32:()=>Og,uint64:()=>Tg,ulid:()=>sg,undefined:()=>Ng,union:()=>Pr,unknown:()=>Ut,uppercase:()=>cr,url:()=>tg,util:()=>y,uuid:()=>Xf,uuidv4:()=>Yf,uuidv6:()=>Qf,uuidv7:()=>eg,validate:()=>Xr,validateAsync:()=>Yr,void:()=>Ug,withParser:()=>Hi,xid:()=>cg,xor:()=>Vg});var et={};qe(et,{$ZodAny:()=>Ic,$ZodArray:()=>Ac,$ZodAsyncError:()=>xe,$ZodBase64:()=>fc,$ZodBase64URL:()=>gc,$ZodBigInt:()=>Ci,$ZodBigIntFormat:()=>kc,$ZodBoolean:()=>un,$ZodCIDRv4:()=>pc,$ZodCIDRv6:()=>mc,$ZodCUID:()=>ec,$ZodCUID2:()=>tc,$ZodCatch:()=>Hc,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>zs,$ZodCheckEndsWith:()=>Zs,$ZodCheckGreaterThan:()=>yi,$ZodCheckIncludes:()=>Es,$ZodCheckLengthEquals:()=>Ds,$ZodCheckLessThan:()=>bi,$ZodCheckLowerCase:()=>Cs,$ZodCheckMaxLength:()=>As,$ZodCheckMaxSize:()=>Ps,$ZodCheckMimeType:()=>Vs,$ZodCheckMinLength:()=>Ts,$ZodCheckMinSize:()=>Os,$ZodCheckMultipleOf:()=>Ss,$ZodCheckNumberFormat:()=>Is,$ZodCheckOverwrite:()=>Fs,$ZodCheckProperties:()=>Ms,$ZodCheckProperty:()=>Ls,$ZodCheckRegex:()=>Ns,$ZodCheckSizeEquals:()=>js,$ZodCheckStartsWith:()=>Rs,$ZodCheckStringFormat:()=>tr,$ZodCheckUpperCase:()=>Us,$ZodCodec:()=>dn,$ZodCreditCard:()=>vc,$ZodCustom:()=>nu,$ZodCustomStringFormat:()=>_c,$ZodCyclicError:()=>Vi,$ZodDate:()=>jc,$ZodDefault:()=>Gc,$ZodDiscriminatedUnion:()=>Cc,$ZodE164:()=>hc,$ZodEmail:()=>Ws,$ZodEmoji:()=>Ys,$ZodEncodeError:()=>ct,$ZodEnum:()=>Lc,$ZodError:()=>Za,$ZodExactOptional:()=>Bc,$ZodFile:()=>Vc,$ZodFunction:()=>tu,$ZodGUID:()=>Gs,$ZodIBAN:()=>bc,$ZodIPv4:()=>uc,$ZodIPv6:()=>lc,$ZodISODate:()=>ac,$ZodISODateTime:()=>oc,$ZodISODuration:()=>cc,$ZodISOTime:()=>sc,$ZodIntersection:()=>Uc,$ZodJWT:()=>yc,$ZodKSUID:()=>ic,$ZodLazy:()=>pn,$ZodLiteral:()=>Mc,$ZodMAC:()=>dc,$ZodMap:()=>Rc,$ZodNaN:()=>Xc,$ZodNanoID:()=>Qs,$ZodNever:()=>Pc,$ZodNonOptional:()=>Wc,$ZodNull:()=>Sc,$ZodNullable:()=>Kc,$ZodNumber:()=>Ni,$ZodNumberFormat:()=>$c,$ZodObject:()=>im,$ZodObjectJIT:()=>Tc,$ZodOptional:()=>Ei,$ZodPipe:()=>Ri,$ZodPrefault:()=>Jc,$ZodPreprocess:()=>Yc,$ZodPromise:()=>ru,$ZodReadonly:()=>Qc,$ZodRealError:()=>Se,$ZodRecord:()=>Ec,$ZodRegistry:()=>Wi,$ZodSet:()=>Zc,$ZodString:()=>zt,$ZodStringFormat:()=>J,$ZodSuccess:()=>qc,$ZodSymbol:()=>wc,$ZodTemplateLiteral:()=>eu,$ZodTransform:()=>Fc,$ZodTuple:()=>Ui,$ZodType:()=>U,$ZodULID:()=>rc,$ZodURL:()=>Xs,$ZodUUID:()=>Js,$ZodUndefined:()=>xc,$ZodUnion:()=>ln,$ZodUnknown:()=>zc,$ZodVoid:()=>Oc,$ZodXID:()=>nc,$ZodXor:()=>Dc,$brand:()=>Ua,$constructor:()=>g,$input:()=>su,$output:()=>au,Doc:()=>It,INVALID:()=>be,JSONSchema:()=>Gf,JSONSchemaGenerator:()=>jo,NEVER:()=>Ca,TimePrecision:()=>bu,URL_BAD_FORMAT:()=>qs,URL_UNPARSEABLE:()=>nn,ZodCompileAsyncError:()=>Re,ZodCompileUnsupportedError:()=>M,_any:()=>Cu,_array:()=>Vu,_base64:()=>vo,_base64url:()=>bo,_bigint:()=>Pu,_boolean:()=>Iu,_catch:()=>Dk,_check:()=>jf,_cidrv4:()=>go,_cidrv6:()=>ho,_coercedBigint:()=>Ou,_coercedBoolean:()=>zu,_coercedDate:()=>Lu,_coercedNumber:()=>_u,_coercedString:()=>fu,_creditCard:()=>hu,_cuid:()=>so,_cuid2:()=>co,_custom:()=>Bu,_date:()=>Zu,_decode:()=>si,_decodeAsync:()=>ui,_default:()=>jk,_discriminatedUnion:()=>bk,_e164:()=>yo,_email:()=>Qi,_emoji:()=>oo,_encode:()=>ai,_encodeAsync:()=>ci,_endsWith:()=>dr,_enum:()=>xk,_file:()=>Fu,_float32:()=>ku,_float64:()=>wu,_gt:()=>Be,_gte:()=>Ae,_guid:()=>eo,_iban:()=>vu,_includes:()=>ur,_int:()=>$u,_int32:()=>xu,_int64:()=>ju,_intersection:()=>yk,_ipv4:()=>mo,_ipv6:()=>fo,_isoDate:()=>_n,_isoDateTime:()=>yn,_isoDuration:()=>kn,_isoTime:()=>$n,_jwt:()=>_o,_ksuid:()=>po,_lazy:()=>Ek,_length:()=>Nt,_literal:()=>Ik,_lowercase:()=>sr,_lt:()=>Fe,_lte:()=>je,_mac:()=>gu,_map:()=>kk,_max:()=>je,_maxLength:()=>Dt,_maxSize:()=>lt,_mime:()=>mr,_min:()=>Ae,_minLength:()=>Qe,_minSize:()=>Ke,_multipleOf:()=>ut,_nan:()=>Mu,_nanoid:()=>ao,_nativeEnum:()=>Sk,_negative:()=>ko,_never:()=>Eu,_nonnegative:()=>xo,_nonoptional:()=>Ak,_nonpositive:()=>wo,_normalize:()=>fr,_null:()=>Nu,_nullable:()=>Ok,_number:()=>yu,_optional:()=>Pk,_overwrite:()=>Ze,_parse:()=>Xt,_parseAsync:()=>Yt,_pipe:()=>Nk,_positive:()=>$o,_promise:()=>Rk,_properties:()=>pr,_property:()=>So,_readonly:()=>Ck,_record:()=>$k,_refine:()=>Ku,_regex:()=>ar,_safeDecode:()=>di,_safeDecodeAsync:()=>mi,_safeEncode:()=>li,_safeEncodeAsync:()=>pi,_safeParse:()=>Qt,_safeParseAsync:()=>er,_set:()=>wk,_size:()=>Tt,_slugify:()=>br,_startsWith:()=>lr,_string:()=>mu,_stringFormat:()=>Ct,_stringbool:()=>qu,_success:()=>Tk,_superRefine:()=>Gu,_symbol:()=>Tu,_templateLiteral:()=>Uk,_toLowerCase:()=>hr,_toUpperCase:()=>vr,_transform:()=>zk,_trim:()=>gr,_tuple:()=>_k,_uint32:()=>Su,_uint64:()=>Au,_ulid:()=>uo,_undefined:()=>Du,_union:()=>hk,_unknown:()=>Uu,_uppercase:()=>cr,_url:()=>bn,_uuid:()=>to,_uuidv4:()=>ro,_uuidv6:()=>no,_uuidv7:()=>io,_void:()=>Ru,_xid:()=>lo,_xor:()=>vk,base64Charset:()=>Oi,base64urlCharset:()=>cn,canParseURL:()=>Hs,clone:()=>G,compile:()=>du,compileFn:()=>Xi,config:()=>re,createStandardJSONSchemaMethod:()=>yr,createToJSONSchemaMethod:()=>Xu,decode:()=>_y,decodeAsync:()=>ky,describe:()=>Ju,encode:()=>yy,encodeAsync:()=>$y,extractDefs:()=>pt,finalize:()=>mt,flattenError:()=>qr,formatError:()=>Hr,getDiscriminatedOption:()=>Nc,globalConfig:()=>ae,globalRegistry:()=>le,handleUnrepresentable:()=>ie,initializeContext:()=>dt,isBackEdge:()=>Bi,isRecursiveSchema:()=>Fi,isValidBase64:()=>sn,isValidBase64URL:()=>ji,isValidCIDRv6:()=>Pi,isValidCreditCard:()=>Ai,isValidIBAN:()=>Ti,isValidIPv6:()=>an,isValidJWT:()=>Di,locales:()=>vn,memoizer:()=>gn,mergeValues:()=>rr,meta:()=>Wu,parse:()=>ii,parseAsync:()=>oi,parseURLObject:()=>tm,prettifyError:()=>Ma,process:()=>W,processSchema:()=>W,regexes:()=>Ce,registry:()=>qi,safeDecode:()=>xy,safeDecodeAsync:()=>Iy,safeEncode:()=>wy,safeEncodeAsync:()=>Sy,safeParse:()=>fy,safeParseAsync:()=>gy,standardProps:()=>xi,stripTabAndNewline:()=>on,toDotPath:()=>Np,toJSONSchema:()=>Oo,toZod:()=>Lr,treeifyError:()=>La,urlHostnameOk:()=>Ii,urlProtocolOk:()=>zi,util:()=>y,validate:()=>Xr,validateAsync:()=>Yr,validateURL:()=>Si,version:()=>Bs,withParser:()=>Hi});var y={};qe(y,{BIGINT_FORMAT_RANGES:()=>Kr,CONSTANT_CATCH:()=>ri,Class:()=>Sa,NUMBER_FORMAT_RANGES:()=>Br,aborted:()=>ve,allowsEval:()=>Pa,assert:()=>Nb,assertEqual:()=>jb,assertIs:()=>Tb,assertNever:()=>Db,assertNotEqual:()=>Ab,assignProp:()=>ue,attachSchema:()=>ti,base64ToUint8Array:()=>Pp,base64urlToUint8Array:()=>Qb,cached:()=>Wt,captureStackTrace:()=>Qn,cleanEnum:()=>Yb,cleanRegex:()=>Xe,clone:()=>G,cloneDef:()=>Eb,codePointLength:()=>xt,constantCatch:()=>Da,createTransparentProxy:()=>Fb,defineLazy:()=>Ia,defineLazyInternal:()=>Z,derived:()=>ny,esc:()=>he,escapeRegex:()=>Ne,explicitlyAborted:()=>Aa,extend:()=>Gb,finalizeIssue:()=>we,floatSafeRemainder:()=>Mr,getElementAtPath:()=>Rb,getEnumValues:()=>Gt,getLengthableOrigin:()=>Jr,getParsedType:()=>Vb,getSizableOrigin:()=>Gr,hexToUint8Array:()=>ty,hide:()=>Wr,installLazyProp:()=>sy,isObject:()=>wt,isPlainObject:()=>De,issue:()=>Ht,joinValues:()=>h,jsonStringifyReplacer:()=>Jt,members:()=>Ta,merge:()=>Wb,mergeDefs:()=>Ee,normalizeParams:()=>I,nullish:()=>Yn,numKeys:()=>Mb,objectClone:()=>Cb,omit:()=>Kb,optionalKeys:()=>ja,own:()=>st,parsedType:()=>$,partial:()=>qb,pick:()=>Bb,prefixIssues:()=>ke,primitiveTypes:()=>Oa,promiseAllObject:()=>Zb,propertyKeyTypes:()=>Fr,randomString:()=>Lb,rawShape:()=>qt,required:()=>Hb,safeExtend:()=>Jb,shallowClone:()=>Vr,slugify:()=>za,stringifyPrimitive:()=>_,toZod:()=>Lr,uint8ArrayToBase64:()=>Op,uint8ArrayToBase64url:()=>ey,uint8ArrayToHex:()=>ry,unwrapMessage:()=>Kt});function jb(e){return e}function Ab(e){return e}function Lr(){return e=>e}function Tb(e){}function Db(e){throw new Error("Unexpected value in exhaustive check")}function Nb(e){}function Gt(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function h(e,r="|"){return e.map(i=>_(i)).join(r)}function Jt(e,r){return typeof r=="bigint"?r.toString():r}var xa=class{constructor(r){this._getter=r,this._value=void 0}get value(){let r=this._getter;return r!==void 0&&(this._value=r(),this._getter=void 0),this._value}};function Wt(e){return new xa(e)}function Yn(e){return e==null}function Xe(e){let r=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(r,i)}function Mr(e,r){let i=e/r,o=Math.round(i),t=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<t?0:i-o}var xp=Symbol("evaluating");function Ia(e,r,i){let o;Object.defineProperty(e,r,{get(){if(o!==xp)return o===void 0&&(o=xp,o=i()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Cb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ue(e,r,i){Object.defineProperty(e,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function qt(e){let r=Object.getOwnPropertyDescriptor(e,"shape");return r?.get?r.get.raw:r?.value}function He(e){return qt(e._zod.def)??e._zod.def.shape}function Sp(e,r,i){Object.defineProperty(e,r,{get(){let o=i();return ue(this,r,o),o},enumerable:!0,configurable:!0})}function Ip(e,r,i){r in e?ue(e,r,i):e[r]=i}function kt(e,r,i,o){let t=He(r);for(let n of i){let a=Object.getOwnPropertyDescriptor(t,n);a.enumerable&&(a.get?Sp(e,n,()=>{let c=r._zod.def.shape[n];return o?o(c,n):c}):Ip(e,n,o?o(a.value,n):a.value))}}function Ub(e,r){for(let i of Reflect.ownKeys(r)){let o=Object.getOwnPropertyDescriptor(r,i);o.enumerable&&(o.get?Sp(e,i,()=>r[i]):Ip(e,i,o.value))}}function Ee(...e){let r={};for(let i of e){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Eb(e){return Ee(e._zod.def)}function Rb(e,r){return r?r.reduce((i,o)=>i?.[o],e):e}function Zb(e){let r=Object.keys(e),i=r.map(o=>e[o]);return Promise.all(i).then(o=>{let t={};for(let n=0;n<r.length;n++)t[r[n]]=o[n];return t})}function Lb(e=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<e;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function he(e){return JSON.stringify(e)}function za(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pa=Wt(()=>{if(ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function De(e){if(wt(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(wt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Vr(e){return De(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Mb(e){let r=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&r++;return r}var Vb=e=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},Fr=new Set(["string","number","symbol"]),Oa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,r,i){let o=new e._zod.constr(r??e._zod.def);return(!r||i?.parent)&&(o._zod.parent=e),o}function I(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Fb(e){let r;return new Proxy({},{get(i,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(i,o,t,n){return r??(r=e()),Reflect.set(r,o,t,n)},has(i,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function _(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ja(e){return Object.keys(e).filter(r=>e[r]._zod.optin!==void 0&&e[r]._zod.optout==="optional")}var Br={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Bb(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n={};return kt(n,e,ei(e,r)),G(e,Ee(i,{shape:n,checks:[]}))}function ei(e,r){let i=He(e),o=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(i,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);r[t]&&o.push(t)}return o}function Kb(e,r){let i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=new Set(ei(e,r)),a={};return kt(a,e,Reflect.ownKeys(He(e)).filter(c=>!n.has(c))),G(e,Ee(i,{shape:a,checks:[]}))}function Gb(e,r){if(!De(r))throw new Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let t=He(e);for(let n of Reflect.ownKeys(r))if(Object.getOwnPropertyDescriptor(t,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return G(e,Ee(e._zod.def,{shape:zp(e,r)}))}function zp(e,r){let i={};return kt(i,e,Reflect.ownKeys(He(e))),Ub(i,r),i}function Jb(e,r){if(!De(r))throw new Error("Invalid input to safeExtend: expected a plain object");return G(e,Ee(e._zod.def,{shape:zp(e,r)}))}function Wb(e,r){if(!r?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let i={};kt(i,e,Reflect.ownKeys(He(e))),kt(i,r,Reflect.ownKeys(He(r)));let o=Ee(e._zod.def,{shape:i,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return G(e,o)}function qb(e,r,i,o="partial"){let n=r._zod.def.checks;if(n&&n.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=i?new Set(ei(r,i)):void 0,u={};return kt(u,r,Reflect.ownKeys(He(r)),e&&((l,d)=>c&&!c.has(d)?l:new e({type:"optional",innerType:l}))),G(r,Ee(r._zod.def,{shape:u,checks:[]}))}function Hb(e,r,i){let o=i?new Set(ei(r,i)):void 0,t={};return kt(t,r,Reflect.ownKeys(He(r)),(n,a)=>o&&!o.has(a)?n:new e({type:"nonoptional",innerType:n})),G(r,Ee(r._zod.def,{shape:t}))}function ve(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Aa(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}function ke(e,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Kt(e){return typeof e=="string"?e:e?.message}function ti(e,r,i){var o;for(let t=r;t<e.length;t++)(o=e[t]).schema??(o.schema=i)}function we(e,r,i){var o;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let n=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Kt(e.inst?._zod.def?.error?.(e))??Kt(n?.(e))??Kt(r?.error?.(e))??Kt(i.customError?.(e))??Kt(i.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,r?.reportInput&&(c.input=e.input),c}function Gr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Xb=/[\uD800-\uDBFF]/;function xt(e){let r=e.length;if(!Xb.test(e))return r;let i=r;for(let o=0;o<r-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(i--,o++);return i}function Jr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function Ht(...e){let[r,i,o]=e;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function Yb(e){return Object.entries(e).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Pp(e){let r=atob(e),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function Op(e){let r="";for(let i=0;i<e.length;i++)r+=String.fromCharCode(e[i]);return btoa(r)}function Qb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Pp(r+i)}function ey(e){return Op(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ty(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function ry(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var Sa=class{constructor(...r){}};function Ta(e,r){for(let i in r){let o=Object.getOwnPropertyDescriptor(r,i);o.get?Object.defineProperty(e,i,{...o,enumerable:!1}):iy(e,i,o.value)}}function st(e,r,i,o=!0){return Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:o,value:i}),i}function Wr(e,r,i){return st(e,r,i,!1)}function ny(e,r){for(let i in e){let o=e[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!0,get(){return st(this,i,o(this))},set(t){st(this,i,t)}})}return r}function iy(e,r,i){Object.defineProperty(e,r,{configurable:!0,get(){return this==null?i:st(this,r,i.bind(this))},set(o){st(this,r,o)}})}function oy(e,r){let i=Object.getPrototypeOf(e);return r in i?void 0:i}var wa,at=!1,ay={configurable:!0,get(){at=!0}};function Z(e,r,i){let o=Object.getPrototypeOf(e._zod);if(r in o&&wa!==e._zod){wa=void 0;return}wa=e._zod,Object.defineProperty(o,r,{configurable:!0,get(){Object.defineProperty(this,r,ay);let t=at;at=!1;try{let n=i(this);return at?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),at=at||t,n}catch(n){throw delete this[r],at=at||t,n}},set(t){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t})}})}function sy(e,r,i,o){let t=oy(e,r);t&&Object.defineProperty(t,r,{configurable:!0,get(){let n={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,r,n),n.value=i(this),Object.defineProperty(this,r,n),n.value},set(n){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:o,value:n})}})}var ri="~constantCatch";function Da(e){let r=()=>e;return r[ri]=!0,r}var jp,Ca=Object.freeze({status:"aborted"}),Na={value:void 0,enumerable:!1},Ap="captureStackTrace"in Error?Error:null;function cy(e){let r=Ap;if(r){let i=r.stackTraceLimit;if(typeof i=="number"){try{r.stackTraceLimit=0}catch{return Ap=null,new e}try{return new e}finally{r.stackTraceLimit=i}}}return new e}function g(e,r,i,o){let t={};function n(m){this.def=m,this.constr=p,this.traits=new Set}n.prototype=t;let a=i,c=a&&new WeakSet;function u(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{Na.value=new n(f);try{Object.defineProperty(m,"_zod",Na)}finally{Na.value=void 0}}if(m._zod.traits.add(e),r(m,f),c){let k=Object.getPrototypeOf(m),x=m._zod.constr.prototype,j=k;for(;j&&j!==x;)j=Object.getPrototypeOf(j);let P=j??k;c.has(P)||(c.add(P),Ta(P,a))}let v=p.prototype;for(let k in v)Object.prototype.hasOwnProperty.call(v,k)&&(k in m||(m[k]=v[k].bind(m)))}let l=o?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(m){let f=o?.Parent?cy(d):this;u(f,m);let v=f._zod.deferred;if(v){for(let x of v)x();f._zod.deferred=void 0}let k=globalThis.__zod_globalConfig?.postProcessor;return k&&k(f),f}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>o?.Parent&&m instanceof o.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var Ua=Symbol("zod_brand"),xe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ct=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(jp=globalThis).__zod_globalConfig??(jp.__zod_globalConfig={});var ae=globalThis.__zod_globalConfig;function re(e){return e&&Object.assign(ae,e),ae}function uy(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Jt,2)),e.message}function ly(e){this._zod.message=e}var dy={get:uy,set:ly,enumerable:!0,configurable:!0},Ra={value:void 0,enumerable:!1},Tp=new WeakSet([Object.prototype,Error.prototype]),Dp=(e,r)=>{e.name="$ZodError",Ra.value=r,Object.defineProperty(e,"issues",Ra),Ra.value=void 0,Object.defineProperty(e,"message",dy);let i=Object.getPrototypeOf(e);Tp.has(i)||(Tp.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Za=g("$ZodError",Dp),Se=g("$ZodError",Dp,void 0,{Parent:Error});function py(e,r,i){return Object.prototype.hasOwnProperty.call(e,r)||(r==="__proto__"?Object.defineProperty(e,r,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[r]=i()),e[r]}function qr(e,r=i=>i.message){let i={},o=[];for(let t of e.issues)t.path.length>0?py(i,t.path[0],()=>[]).push(r(t)):o.push(r(t));return{formErrors:o,fieldErrors:i}}function Hr(e,r=i=>i.message){let i={_errors:[]},o=(t,n=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let c=[...n,...a.path];if(c.length===0)i._errors.push(r(a));else{let u=i,l=0;for(;l<c.length;){let d=c[l],p=l===c.length-1;if(d==="_errors"){p&&u._errors.push(r(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,d)||Object.defineProperty(u,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=u[d];p&&m._errors.push(r(a)),u=m,l++}}}};return o(e),i}function La(e,r=i=>i.message){let i={errors:[]},o=(t,n=[])=>{var a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...n,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...n,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...n,...c.path]);else{let u=[...n,...c.path];if(u.length===0){i.errors.push(r(c));continue}let l=i,d=0;for(;d<u.length;){let p=u[d],m=d===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(r(c)),d++}}};return o(e),i}function Np(e){let r=[],i=e.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Ma(e){let r=[],i=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Np(o.path)}`);return r.join(`
|
|
3
3
|
`)}function ni(e,r){return{callee:r?.callee??e,Err:r?.Err}}var Xt=e=>{let r=(i,o,t,n)=>{let a=t?{...t,async:!1}:{async:!1},c=i._zod.run({value:o,issues:[]},a);if(c instanceof Promise)throw new xe;if(c.issues.length){let u=new(n?.Err??e)(c.issues.map(l=>we(l,a,re())));throw Qn(u,n?.callee??r),u}return c.value};return r},ii=Xt(Se),Yt=e=>{let r=async(i,o,t,n)=>{let a=t?{...t,async:!0}:{async:!0},c=i._zod.run({value:o,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(n?.Err??e)(c.issues.map(l=>we(l,a,re())));throw Qn(u,n?.callee??r),u}return c.value};return r},oi=Yt(Se),Qt=e=>(r,i,o)=>{let t=o?{...o,async:!1}:{async:!1},n=r._zod.run({value:i,issues:[]},t);if(n instanceof Promise)throw new xe;return n.issues.length?Cp(e,n.issues,t):{success:!0,data:n.value}},fy=Qt(Se);function Cp(e,r,i){let o;return{success:!1,get error(){return o||(o=new e(r.map(t=>we(t,i,re()))),r=void 0,i=void 0),o},set error(t){o=t,r=void 0,i=void 0}}}var er=e=>async(r,i,o)=>{let t=o?{...o,async:!0}:{async:!0},n=r._zod.run({value:i,issues:[]},t);return n instanceof Promise&&(n=await n),n.issues.length?Cp(e,n.issues,t):{success:!0,data:n.value}},gy=er(Se),hy=Symbol.for("zod.compile.invalid"),vy=Symbol.for("zod.compile.fallback"),Xr=((e,r,i)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(r)!==hy)return!0;if(o.definite===!0&&i===void 0)return!1}return by(e,r,i)});function by(e,r,i){let o=i?{...i,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},t=e._zod.bag.fallbackRun,n;if(t?(o[vy]=!0,n=t({value:r,issues:[]},o)):n=e._zod.run({value:r,issues:[]},o),n instanceof Promise)throw new xe;return n.issues.length===0}var Yr=async(e,r,i)=>{let o=i?{...i,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},t=e._zod.run({value:r,issues:[]},o);return t instanceof Promise&&(t=await t),t.issues.length===0},ai=e=>{let r=Xt(e),i=(o,t,n,a)=>{let c=n?{...n,direction:"backward"}:{direction:"backward"};return r(o,t,c,ni(i,a))};return i},yy=ai(Se),si=e=>{let r=Xt(e),i=(o,t,n,a)=>r(o,t,n,ni(i,a));return i},_y=si(Se),ci=e=>{let r=Yt(e),i=async(o,t,n,a)=>{let c=n?{...n,direction:"backward"}:{direction:"backward"};return await r(o,t,c,ni(i,a))};return i},$y=ci(Se),ui=e=>{let r=Yt(e),i=async(o,t,n,a)=>await r(o,t,n,ni(i,a));return i},ky=ui(Se),li=e=>(r,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return Qt(e)(r,i,t)},wy=li(Se),di=e=>(r,i,o)=>Qt(e)(r,i,o),xy=di(Se),pi=e=>async(r,i,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return er(e)(r,i,t)},Sy=pi(Se),mi=e=>async(r,i,o)=>er(e)(r,i,o),Iy=mi(Se);var Ce={};qe(Ce,{anyString:()=>fs,base64:()=>os,base64url:()=>as,bigint:()=>hs,boolean:()=>vs,browserEmail:()=>Ny,cidrv4:()=>ns,cidrv6:()=>is,creditCard:()=>fi,cuid:()=>Fa,cuid2:()=>Ba,currencyCode:()=>ls,date:()=>ds,datetime:()=>ms,domain:()=>cs,duration:()=>Ha,e164:()=>us,email:()=>Ya,emoji:()=>Qa,extendedDuration:()=>zy,guid:()=>Xa,hex:()=>ks,hostname:()=>ss,html5Email:()=>Ay,httpProtocol:()=>Qr,iban:()=>gi,idnEmail:()=>Dy,integer:()=>en,ipv4:()=>es,ipv6:()=>ts,ksuid:()=>Ja,lowercase:()=>_s,mac:()=>rs,md5_base64:()=>Ry,md5_base64url:()=>Zy,md5_hex:()=>Ey,nanoid:()=>Wa,nanoidOfLength:()=>qa,null:()=>bs,number:()=>Ye,rfc5322Email:()=>Ty,sha1_base64:()=>My,sha1_base64url:()=>Vy,sha1_hex:()=>Ly,sha256_base64:()=>By,sha256_base64url:()=>Ky,sha256_hex:()=>Fy,sha384_base64:()=>Jy,sha384_base64url:()=>Wy,sha384_hex:()=>Gy,sha512_base64:()=>Hy,sha512_base64url:()=>Xy,sha512_hex:()=>qy,string:()=>gs,time:()=>ps,ulid:()=>Ka,undefined:()=>ys,unicodeEmail:()=>Up,uppercase:()=>$s,uuid:()=>St,uuid4:()=>Py,uuid6:()=>Oy,uuid7:()=>jy,xid:()=>Ga});var Fa=/^[cC][0-9a-z]{6,}$/,Ba=/^[0-9a-z]+$/,Ka=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ga=/^[0-9a-vA-V]{20}$/,Ja=/^[A-Za-z0-9]{27}$/,Wa=/^[a-zA-Z0-9_-]{21}$/;function qa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ha=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zy=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xa=/^([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})$/,St=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Py=St(4),Oy=St(6),jy=St(7),Ya=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ay=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ty=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Up=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Dy=Up,Ny=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Cy="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Qa(){return new RegExp(Cy,"u")}var es=/^(?:(?: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])$/,ts=/^(([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}|:))$/,rs=e=>{let r=Ne(e??":");return new RegExp(`^(?:[0-9A-F]{2}${r}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${r}){5}[0-9a-f]{2}$`)},ns=/^((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])$/,is=/^(([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])$/,os=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,as=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ss=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,cs=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Qr=/^https?$/,us=/^\+[1-9]\d{6,14}$/,fi=/^\d(?:[ -]?\d){11,18}$/,ls=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,gi=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Ep="(?:(?:\\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 Uy(e){return new RegExp(`^${e}$`)}var ds=Uy(Ep);function Va(e){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${r}:[0-5]\\d(?:\\.\\d+)?`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ps(e){return new RegExp(`^${Va(e)}$`)}function ms(e){let r=["Z"];e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${Va({precision:e.precision,seconds:!0})}(?:${r.join("|")})`,o=e.local?`${i}|${Va({precision:e.precision})}`:i;return new RegExp(`^${Ep}T(?:${o})$`)}var fs=/^[\s\S]{0,}$/,gs=e=>{let r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},hs=/^-?\d+n?$/,en=/^-?\d+$/,Ye=/^-?\d+(?:\.\d+)?$/,vs=/^(?:true|false)$/i,bs=/^null$/i;var ys=/^undefined$/i;var _s=/^[^A-Z]*$/,$s=/^[^a-z]*$/,ks=/^[0-9a-fA-F]*$/;function tn(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function rn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ey=/^[0-9a-fA-F]{32}$/,Ry=tn(22,"=="),Zy=rn(22),Ly=/^[0-9a-fA-F]{40}$/,My=tn(27,"="),Vy=rn(27),Fy=/^[0-9a-fA-F]{64}$/,By=tn(43,"="),Ky=rn(43),Gy=/^[0-9a-fA-F]{96}$/,Jy=tn(64,""),Wy=rn(64),qy=/^[0-9a-fA-F]{128}$/,Hy=tn(86,"=="),Xy=rn(86);var X=g("$ZodCheck",(e,r)=>{var i;e._zod??(e._zod={}),e._zod.def=r,(i=e._zod).onattach??(i.onattach=[])}),ws=e=>{let r=e.value;return!Yn(r)&&r.size!==void 0},xs=e=>{let r=e.value;return!Yn(r)&&r.length!==void 0},hi={number:"number",bigint:"bigint",object:"date"},bi=g("$ZodCheckLessThan",(e,r)=>{X.init(e,r);let i=hi[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:hi[typeof o.value]??i,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),yi=g("$ZodCheckGreaterThan",(e,r)=>{X.init(e,r);let i=hi[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:hi[typeof o.value]??i,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Ss=g("$ZodCheckMultipleOf",(e,r)=>{X.init(e,r),e._zod.check=i=>{if(typeof i.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?r.value!==BigInt(0)&&i.value%r.value===BigInt(0):Mr(i.value,r.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:r.value,input:i.value,inst:e,continue:!r.abort})}}),Is=g("$ZodCheckNumberFormat",(e,r)=>{X.init(e,r),r.format=r.format||"float64";let i=r.format?.includes("int"),o=i?"int":"number",[t,n]=Br[r.format];e._zod.check=a=>{let c=a.value;if(i){if(!Number.isInteger(c)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort});return}}c<t&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),c>n&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!r.abort})}}),zs=g("$ZodCheckBigIntFormat",(e,r)=>{X.init(e,r);let[i,o]=Kr[r.format];e._zod.check=t=>{let n=t.value;n<i&&t.issues.push({origin:"bigint",input:n,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!r.abort}),n>o&&t.issues.push({origin:"bigint",input:n,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!r.abort})}}),Ps=g("$ZodCheckMaxSize",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=ws),e._zod.check=o=>{let t=o.value;t.size<=r.maximum||o.issues.push({origin:Gr(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Os=g("$ZodCheckMinSize",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=ws),e._zod.check=o=>{let t=o.value;t.size>=r.minimum||o.issues.push({origin:Gr(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),js=g("$ZodCheckSizeEquals",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=ws),e._zod.check=o=>{let t=o.value,n=t.size;if(n===r.size)return;let a=n>r.size;o.issues.push({origin:Gr(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),As=g("$ZodCheckMaxLength",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=xs),e._zod.check=o=>{let t=o.value,n=t.length;if((typeof t=="string"&&n>r.maximum?xt(t):n)<=r.maximum)return;let c=Jr(t);o.issues.push({origin:c,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ts=g("$ZodCheckMinLength",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=xs),e._zod.check=o=>{let t=o.value,n=t.length;if((typeof t=="string"&&n>=r.minimum&&n<r.minimum*2?xt(t):n)>=r.minimum)return;let c=Jr(t);o.issues.push({origin:c,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ds=g("$ZodCheckLengthEquals",(e,r)=>{var i;X.init(e,r),(i=e._zod.def).when??(i.when=xs),e._zod.check=o=>{let t=o.value,n=t.length,a=typeof t=="string"&&n>=r.length&&n<=r.length*2?xt(t):n;if(a===r.length)return;let c=Jr(t),u=a>r.length;o.issues.push({origin:c,...u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),tr=g("$ZodCheckStringFormat",(e,r)=>{var i,o;X.init(e,r),r.pattern?(i=e._zod).check??(i.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ns=g("$ZodCheckRegex",(e,r)=>{tr.init(e,r),e._zod.check=i=>{r.pattern.lastIndex=0,!r.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),Cs=g("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=_s),tr.init(e,r)}),Us=g("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=$s),tr.init(e,r)}),Es=g("$ZodCheckIncludes",(e,r)=>{X.init(e,r);let i=Ne(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position},}${i}`:i);r.pattern=o,e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Rs=g("$ZodCheckStartsWith",(e,r)=>{X.init(e,r);let i=new RegExp(`^${Ne(r.prefix)}.*`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),Zs=g("$ZodCheckEndsWith",(e,r)=>{X.init(e,r);let i=new RegExp(`.*${Ne(r.suffix)}$`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}});function vi(e,r,i){e.issues.length&&r.issues.push(...ke(i,e.issues))}var Ls=g("$ZodCheckProperty",(e,r)=>{X.init(e,r),e._zod.check=i=>{let o=r.schema._zod.run({value:i.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then(t=>vi(t,i,r.property));vi(o,i,r.property)}}),Ms=g("$ZodCheckProperties",(e,r)=>{X.init(e,r),Wr(e,Symbol.iterator,function*(){yield e});let i;e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}i??(i=Reflect.ownKeys(r.shape).map(a=>[a,r.shape[a]]));let t=o.value,n;for(let[a,c]of i){let u=c._zod.run({value:t[a],issues:[]},{});u instanceof Promise?(n??(n=[]),n.push(u.then(l=>vi(l,o,a)))):vi(u,o,a)}if(n)return Promise.all(n).then(()=>{})}}),Vs=g("$ZodCheckMimeType",(e,r)=>{X.init(e,r);let i=new Set(r.mime);e._zod.check=o=>{i.has(o.value.type)||o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:e,continue:!r.abort})}}),Fs=g("$ZodCheckOverwrite",(e,r)=>{X.init(e,r),e._zod.check=i=>{i.value=r.tx(i.value)}});var It=class{constructor(r=[],i={}){this.content=[],this.indent=0,this.args=r,this.closed=i}indented(r){this.indent+=1;try{r(this)}finally{this.indent-=1}}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let o=r.split(`
|
|
4
4
|
`).filter(a=>a),t=Math.min(...o.map(a=>a.length-a.trimStart().length)),n=o.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of n)this.content.push(a)}compile(){let r=Function,i=this?.content??[""];return new r(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${i.join(`
|
|
@@ -60,17 +60,17 @@ ${u}`:u:"",d=Function,p=`return (input) => {
|
|
|
60
60
|
${u}
|
|
61
61
|
}`,m;try{m=new d(...a,p)(...c)}catch(f){throw new M(`this schema (generated code failed to evaluate: ${f.message})`)}return r?.debug&&(m.code=l),m.definite=o.definite,m}function N(e,r){for(let[o,t]of e.constants)if(t===r)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,r),i}function jt(e,r){return e.definite=!1,N(e,r)}function T(e){return`v${e.varCounter++}`}function y$(e,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return be;let o=i;return o.issues.length===0?o.value:be}function fe(e,r,i,o,t=!0){let n=e.content.length,a=r.constants.size,c=r.constantCounter,u=r.varCounter;try{return ee(e,r,i,o,t)}catch(l){if(!(l instanceof M)||!l.islandable)throw l;if(e.content.length=n,r.constants.size>a){let d=Array.from(r.constants.keys()).slice(a);for(let p of d)r.constants.delete(p)}return r.constantCounter=c,r.varCounter=u,_$(e,r,i,o)}}function _$(e,r,i,o){r.definite=!1;let t=N(r,i),n=N(r,y$),a=T(r);return e.write(`const ${a} = ${n}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var $$=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function k$(e,r,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let n=o;for(let a of t){let c=a._zod.def;if(c.when&&!$$.has(c.check))throw new M('check with a custom "when" condition');switch(c.check){case"greater_than":w$(e,r,c,n);break;case"less_than":x$(e,r,c,n);break;case"multiple_of":S$(e,r,c,n);break;case"number_format":Pf(e,c,n);break;case"min_length":{let u=Pt(c.minimum,"min_length"),l=cu(e,r,n,`${n}.length >= ${u} && ${n}.length < ${c.minimum*2}`);e.write(`if (${l} < ${u}) return INVALID;`);break}case"max_length":{let u=Pt(c.maximum,"max_length"),l=cu(e,r,n,`${n}.length > ${u}`);e.write(`if (${l} > ${u}) return INVALID;`);break}case"length_equals":{let u=Pt(c.length,"length_equals"),l=cu(e,r,n,`${n}.length >= ${u} && ${n}.length <= ${c.length*2}`);e.write(`if (${l} !== ${u}) return INVALID;`);break}case"min_size":e.write(`if (${n}.size < ${Pt(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${n}.size > ${Pt(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${n}.size !== ${Pt(c.size,"size_equals")}) return INVALID;`);break;case"string_format":n=Of(e,r,c,n);break;case"custom":n=A$(e,r,a,n);break;case"bigint_format":I$(e,c,n);break;case"mime_type":z$(e,r,c,n);break;case"property":O$(e,r,c,n);break;case"properties":P$(e,r,c,n);break;case"overwrite":{let u=T(r);j$(e,r,a,n,u),n=u;break}default:throw new M(`check type ${c.check}`)}}return n}function cu(e,r,i,o){let t=N(r,xt),n=T(r);return e.write(`const ${n} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),n}function Pt(e,r){if(typeof e!="number"||!Number.isFinite(e))throw new M(`${r} bound of type ${typeof e}`);return`${e}`}function zf(e,r){if(typeof r=="bigint")return`${r}n`;if(typeof r=="number"){if(Number.isNaN(r))throw new M("comparison check with NaN bound");return`${r}`}if(r instanceof Date){if(Number.isNaN(r.getTime()))throw new M("comparison check with Invalid Date bound");return N(e,r)}throw new M(`comparison check bound of type ${typeof r}`)}function w$(e,r,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function x$(e,r,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function S$(e,r,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new M("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=N(r,Mr);e.write(`if (${t}(${o}, ${Pt(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function Pf(e,r,i){let o=r.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${i})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${i}) || ${i} < -2147483648 || ${i} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${i}) || ${i} < 0 || ${i} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${i}) || ${i} < -3.4028234663852886e38 || ${i} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${i})) return INVALID;`);break;default:throw new M(`number format ${o}`)}}function I$(e,r,i){let o=r.format;if(o)switch(o){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break;default:throw new M(`bigint format ${o}`)}}function z$(e,r,i,o){let t=i.mime;if(t&&t.length>0){let n=N(r,new Set(t));e.write(`if (!${n}.has(${o}.type)) return INVALID;`)}}function P$(e,r,i,o){if(i.when)throw new M('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let t=i.shape;for(let n of Reflect.ownKeys(t)){let a=typeof n=="symbol"?N(r,n):he(n),c=T(r);e.write(`const ${c} = ${o}[${a}];`),fe(e,r,t[n],c,!1)}}function O$(e,r,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;ee(e,r,i.schema,t)}function j$(e,r,i,o,t){let n=i._zod.def.tx;if(!n)throw new M("overwrite check without a transform function");if(At(n))throw new Re("z.compile: async overwrite transforms are not supported");let a=N(r,n);e.write(`const ${t} = ${a}(${o});`)}function uu(){throw new xe}function pu(e){this.issues.push(e)}function A$(e,r,i,o){let t=i._zod.def;if(t.fn){if(At(t.fn))throw new Re("z.compile: async .refine() predicates are not supported");let n=jt(r,t.fn),a=N(r,uu),c=T(r);return e.write(`const ${c} = ${n}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`),o}if(i._zod.check){if(At(i._zod.check))throw new Re("z.compile: async .superRefine() / check functions are not supported");let n=i._zod.check,c=jt(r,l=>{let d={value:l,issues:[],addIssue:pu};return n(d)instanceof Promise&&uu(),d.issues.length===0?d.value:be}),u=T(r);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}throw new M("custom check without a predicate or check function")}var T$=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Of(e,r,i,o,t=!0){let n=i.format;if(n==="base64"){let l=N(r,sn);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="base64url"){let l=N(r,ji);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="jwt"){let l=N(r,Di),d=N(r,i.alg??null);return e.write(`if (!${l}(${o}, ${d})) return INVALID;`),o}if(n==="ipv6"){let l=N(r,an);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="cidrv6"){let l=N(r,Pi);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="credit_card"){let l=N(r,Ai);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="iban"){let l=N(r,Ti);return e.write(`if (!${l}(${o})) return INVALID;`),o}let a=i;if(n==="url"||n==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let l=N(r,Si),d=N(r,i),p=T(r),m=T(r);if(e.write(`const ${p} = ${o}.trim();`),e.write(`const ${m} = ${l}(${p}, ${d});`),e.write(`if (typeof ${m} === "number") return INVALID;`),a.hostname!==void 0){let k=N(r,Ii);e.write(`if (!${k}(${m}, ${d}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let k=N(r,zi);e.write(`if (!${k}(${m}, ${d}.protocol)) return INVALID;`)}if(!t)return null;let f=T(r),v=a.normalize?`${m}.href`:`${N(r,on)}(${p})`;return e.write(`const ${f} = ${v};`),f}let c=i.fn;if(c){if(At(c))throw new M(`async string format ${n}`);let l=N(r,c);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(T$.has(n)&&i.pattern){let l=N(r,i.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${o})) return INVALID;`),o}let u=i.format;switch(u){case"regex":throw new M("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${he(i.includes)})) return INVALID;`);break;case"starts_with":{let l=i.prefix;e.write(`if (${o}.slice(0, ${l.length}) !== ${he(l)}) return INVALID;`);break}case"ends_with":{let l=i.suffix;e.write(`if (${o}.slice(-${l.length}) !== ${he(l)}) return INVALID;`);break}default:throw new M(`string format ${u}`)}return o}function ee(e,r,i,o,t=!0){let n=i._zod.def,a=n.type;if(n.coerce)throw new M(`coercion (z.coerce.${a}())`);let c=t||!!n.checks?.length,u;switch(a){case"string":u=D$(e,r,i,o,c);break;case"number":u=N$(e,i,o);break;case"boolean":u=C$(e,o);break;case"bigint":u=U$(e,i,o);break;case"symbol":u=E$(e,o);break;case"undefined":u=R$(e,o);break;case"null":u=Z$(e,o);break;case"any":case"unknown":u=o;break;case"never":e.write("return INVALID;"),u=o;break;case"void":u=L$(e,o);break;case"nan":u=M$(e,o);break;case"date":u=V$(e,o);break;case"object":u=F$(e,r,i,o,c);break;case"optional":u=B$(e,r,i,o,c);break;case"nullable":u=J$(e,r,i,o,c);break;case"array":u=W$(e,r,i,o,c);break;case"literal":u=q$(e,r,i,o);break;case"enum":u=H$(e,r,i,o);break;case"readonly":{let l=xf(e,r,i,o),d=T(r);e.write(`const ${d} = Object.freeze(${l});`),u=d;break}case"success":xf(e,r,i,o),u="true";break;case"default":case"prefault":u=X$(e,r,i,o);break;case"nonoptional":u=Y$(e,r,i,o);break;case"tuple":u=Q$(e,r,i,o);break;case"union":u=ek(e,r,i,o);break;case"intersection":u=nk(e,r,i,o);break;case"record":u=ik(e,r,i,o);break;case"map":u=ak(e,r,i,o);break;case"set":u=sk(e,r,i,o);break;case"file":u=ck(e,o);break;case"template_literal":u=uk(e,r,i,o);break;case"lazy":u=lk(e,r,i,o);break;case"pipe":u=dk(e,r,i,o);break;case"custom":u=pk(e,r,i,o);break;case"transform":u=gk(e,r,i,o);break;case"catch":u=fk(e,r,i,o);break;default:throw new M(`schema type ${a}`)}return u===null?null:k$(e,r,i,u)}function D$(e,r,i,o,t=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let n=i._zod.def;return n.format===void 0?o:Of(e,r,n,o,t)}function N$(e,r,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=r._zod.def;return o.check==="number_format"&&o.format&&Pf(e,{format:o.format},i),i}function C$(e,r){return e.write(`if (typeof ${r} !== "boolean") return INVALID;`),r}function U$(e,r,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=r._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break}return i}function E$(e,r){return e.write(`if (typeof ${r} !== "symbol") return INVALID;`),r}function R$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function Z$(e,r){return e.write(`if (${r} !== null) return INVALID;`),r}function L$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function M$(e,r){return e.write(`if (typeof ${r} !== "number" || !Number.isNaN(${r})) return INVALID;`),r}function V$(e,r){return e.write(`if (!(${r} instanceof Date) || Number.isNaN(${r}.getTime())) return INVALID;`),r}function F$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=n.shape,c=Object.keys(a),u=Object.getOwnPropertySymbols(a),l=u.length?[...c,...u]:c,d=P=>typeof P=="symbol"?N(r,P):he(P),p=P=>typeof P=="symbol"?`[${d(P)}]`:he(P),m=a;if(c.includes("__proto__"))throw new M('object shape key "__proto__"');let f=new Map;for(let P of l){let D=m[P],L=d(P),q=T(r);if(e.write(`const ${q} = ${o}[${L}];`),D._zod.optin!==void 0){let B=T(r);e.write(`let ${B} = (() => {`),e.indented(me=>{let Zr=fe(me,r,D,q);me.write(`return ${Zr};`)}),e.write("})();"),D._zod.optout==="optional"?(e.write(`if (${B} === INVALID) {`),e.indented(me=>{me.write(`if (${L} in ${o}) return INVALID;`),me.write(`${B} = undefined;`)}),e.write("}")):e.write(`if (${B} === INVALID) return INVALID;`),f.set(P,B)}else{G$(D)&&e.write(`if (!(${L} in ${o})) return INVALID;`);let B=fe(e,r,D,q,t);B!==null&&f.set(P,B)}}let v=n.catchall,k="none";if(v){let P=v._zod.def.type;if(P==="never"){let D=c.map(L=>`k !== ${he(L)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(L=>{L.write(`if (${D}) return INVALID;`)}),e.write("}")}else(P==="unknown"||P==="any")&&!v._zod.def.checks?.length?k="passthrough":k="schema"}let x=T(r),j=l.some(P=>wf(m[P])||lu(m[P]));if(!t){if(k==="schema"){let P=c.length>0?N(r,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{D.write('if (k === "__proto__") continue;'),P&&D.write(`if (${P}.has(k)) continue;`);let L=T(r);D.write(`const ${L} = ${o}[k];`),fe(D,r,v,L,!1)}),e.write("}")}return null}if(j){e.write(`const ${x} = {};`);for(let P of l){let D=d(P),L=f.get(P);lu(m[P])?e.write(`if (${D} in ${o}) ${x}[${D}] = ${L};`):wf(m[P])?e.write(`if (${L} !== undefined || ${D} in ${o}) ${x}[${D}] = ${L};`):e.write(`${x}[${D}] = ${L};`)}}else{let P=l.map(D=>`${p(D)}: ${f.get(D)}`).join(", ");e.write(`const ${x} = { ${P} };`)}if(k!=="none"){let P=c.length>0?N(r,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{if(D.write('if (k === "__proto__") continue;'),P&&D.write(`if (${P}.has(k)) continue;`),k==="passthrough")D.write(`${x}[k] = ${o}[k];`);else{let L=T(r);D.write(`const ${L} = ${o}[k];`);let q=fe(D,r,v,L);D.write(`${x}[k] = ${q};`)}}),e.write("}")}return x}function B$(e,r,i,o,t=!0){let n=i._zod.def;if(K$(i))return ee(e,r,n.innerType,o,t);if(n.innerType._zod.optin==="defaulted"){let c=T(r),u=T(r);return e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`const ${u} = (() => {`),l.indented(d=>{let p=ee(d,r,n.innerType,o);d.write(`return ${p};`)}),l.write("})();"),l.write(`if (${u} !== INVALID) ${c} = ${u};`)}),e.write("} else {"),e.indented(l=>{let d=ee(l,r,n.innerType,o);l.write(`${c} = ${d};`)}),e.write("}"),c}let a=t?T(r):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(c=>{let u=ee(c,r,n.innerType,o,t);a&&u!==null&&c.write(`${a} = ${u};`)}),e.write("}"),a}function K$(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function G$(e){return e._zod.optin===void 0&&Ot(e)}function Ot(e){if(e._zod.def.coerce)return!0;let r=e._zod.def;switch(r.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return r.innerType?Ot(r.innerType):!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return r.innerType?Ot(r.innerType):!0;case"catch":return!0;case"union":return r.options?r.options.some(Ot):!0;case"intersection":return!r.left||!r.right?!0:Ot(r.left)&&Ot(r.right);case"pipe":return r.in?Ot(r.in):!0;default:return!0}}function lu(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function wf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&or(e)}function or(e){let r=e._zod.def;switch(r.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return r.innerType?or(r.innerType):!0;case"union":return r.options?r.options.some(or):!0;case"intersection":return!r.left||!r.right||or(r.left)||or(r.right);case"pipe":return r.out?or(r.out):!0;default:return!0}}function J$(e,r,i,o,t=!0){let n=i._zod.def,a=t?T(r):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(c=>{let u=ee(c,r,n.innerType,o,t);a&&u!==null&&c.write(`${a} = ${u};`)}),e.write("}"),a}function W$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`);let a=t?T(r):null,c=T(r),u=T(r);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${c} = 0; ${c} < ${o}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${u} = ${o}[${c}];`);let d=fe(l,r,n.element,u,t);a&&d!==null&&l.write(`${a}[${c}] = ${d};`)}),e.write("}"),a}function q$(e,r,i,o){let n=i._zod.def.values;if(n.length!==1){let c=N(r,new Set(n));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let a=n[0];if(typeof a=="number"&&Number.isNaN(a)){let c=N(r,new Set(n));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${he(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new M(`literal type ${typeof a}`);return o}function H$(e,r,i,o){let t=i._zod.values;if(!t)throw new M("enum schema without enumerated values");let n=N(r,t);return e.write(`if (!${n}.has(${o})) return INVALID;`),o}function xf(e,r,i,o){let t=i._zod.def;return ee(e,r,t.innerType,o)}function X$(e,r,i,o){let t=i._zod.def,a=Object.getOwnPropertyDescriptor(i._zod.def,"defaultValue")?()=>i._zod.def.defaultValue:void 0;if(i._zod.def.type==="prefault"){if(!a)return ee(e,r,t.innerType,o);let u=N(r,a),l=T(r);return e.write(`let ${l} = ${o};`),e.write(`if (${o} === undefined) ${l} = ${u}();`),ee(e,r,t.innerType,l)}let c=T(r);if(a){let u=N(r,a),l=N(r,Vr);e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(d=>{d.write(`${c} = ${l}(${u}());`)}),e.write("} else {"),e.indented(d=>{let p=ee(d,r,t.innerType,o);d.write(`${c} = ${p} === undefined ? ${l}(${u}()) : ${p};`)}),e.write("}")}else e.write(`let ${c};`),e.write(`if (${o} !== undefined) {`),e.indented(u=>{let l=ee(u,r,t.innerType,o);u.write(`${c} = ${l};`)}),e.write("}");return c}function Y$(e,r,i,o){let t=i._zod.def,n=ee(e,r,t.innerType,o),a=T(r);return e.write(`const ${a} = ${n};`),e.write(`if (${a} === undefined) return INVALID;`),a}function Q$(e,r,i,o){let t=i._zod.def,n=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let c=Sf(n,"optin"),u=Sf(n,"optout");a?e.write(`if (${o}.length < ${c}) return INVALID;`):e.write(`if (${o}.length < ${c} || ${o}.length > ${n.length}) return INVALID;`);let l=T(r);e.write(`const ${l} = [];`);for(let d=0;d<n.length;d++){let p=n[d];if(d>=u)e.write(`if (${l}.length === ${d}) {`),e.indented(m=>{m.write(`if (${d} < ${o}.length) {`),m.indented(f=>{let v=T(r);f.write(`const ${v} = ${o}[${d}];`);let k=fe(f,r,p,v);f.write(`${l}[${d}] = ${k};`)}),m.write("} else {"),m.indented(f=>{if(lu(p)){f.write(`${l}.length = ${d};`);return}let v=T(r),k=T(r);f.write(`const ${v} = undefined;`),f.write(`const ${k} = (() => {`),f.indented(x=>{let j=fe(x,r,p,v);x.write(`return ${j};`)}),f.write("})();"),f.write(`if (${k} === INVALID || ${k} === undefined) ${l}.length = ${d};`),f.write(`else ${l}[${d}] = ${k};`)}),m.write("}")}),e.write("}");else{let m=T(r);e.write(`const ${m} = ${o}[${d}];`);let f=fe(e,r,p,m);e.write(`${l}[${d}] = ${f};`)}}if(a){let d=T(r),p=T(r);e.write(`for (let ${d} = ${n.length}; ${d} < ${o}.length; ${d}++) {`),e.indented(m=>{m.write(`const ${p} = ${o}[${d}];`);let f=fe(m,r,a,p);m.write(`${l}[${d}] = ${f};`)}),e.write("}")}return l}function Sf(e,r){for(let i=e.length-1;i>=0;i--)if(!(r==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function ek(e,r,i,o){let t=i._zod.def,n=t.options;if(t.discriminator)return tk(e,r,t,o);if(t.inclusive===!1)throw new M("exclusive unions (z.xor)");if(n.length===0)return e.write("return INVALID;"),o;if(n.length===1)return ee(e,r,n[0],o);if(n.every(u=>u._zod.def.type==="literal"&&!u._zod.def.checks?.length)){let u=new Set(n.flatMap(d=>d._zod.def.values)),l=N(r,u);return e.write(`if (!${l}.has(${o})) return INVALID;`),o}let c=T(r);e.write(`let ${c};`);for(let u=0;u<n.length;u++){let l=n[u];u===0?e.write(`${c} = (() => {`):e.write(`if (${c} === INVALID) ${c} = (() => {`),e.indented(d=>{let p=ee(d,r,l,o);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${c} === INVALID) return INVALID;`),c}function tk(e,r,i,o){if(i.unionFallback)throw new M("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=T(r),n=T(r);e.write(`const ${t} = ${o}?.[${he(i.discriminator)}];`),e.write(`let ${n};`);let a=!0,c=new Set;for(let u of i.options){let l=u._zod.propValues?.[i.discriminator];if(!l||l.size===0)throw new M("discriminated union option without static discriminator values");for(let m of l){if(c.has(m))throw new M(`duplicate discriminator value ${String(m)}`);c.add(m)}let d=Array.from(l,m=>rk(r,t,m)),p=a?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(m=>{let f=ee(m,r,u,o);m.write(`${n} = ${f};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),n}function rk(e,r,i){if(typeof i=="string")return`${r} === ${he(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${r})`:`${r} === ${i}`;if(typeof i=="boolean")return`${r} === ${i}`;if(i===null)return`${r} === null`;if(i===void 0)return`${r} === undefined`;if(typeof i=="bigint")return`${r} === ${i}n`;if(typeof i=="symbol"){let o=N(e,i);return`${r} === ${o}`}throw new M(`literal discriminator value ${String(i)}`)}function nk(e,r,i,o){let t=i._zod.def;r.definite=!1;let n=fe(e,r,t.left,o),a=fe(e,r,t.right,o),c=N(r,rr),u=T(r);return e.write(`const ${u} = ${c}(${n}, ${a});`),e.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}function ik(e,r,i,o){let t=i._zod.def,n=N(r,De);e.write(`if (!${n}(${o})) return INVALID;`);let a=T(r),c=T(r),u=T(r);e.write(`const ${a} = {};`);let l=t,d=l.partial?void 0:t.keyType._zod.values;if(d){let f=[];for(let k of d){if(!(typeof k=="string"||typeof k=="number"||typeof k=="symbol"))throw new M(`record key value ${String(k)}`);let x=typeof k=="number"?k.toString():k;if(x==="__proto__")throw new M('record key "__proto__"');f.push(x);let j=N(r,k),P=ee(e,r,t.keyType,j),D=T(r);e.write(`const ${D} = ${o}[${ok(r,x)}];`);let L=fe(e,r,t.valueType,D);e.write(`${a}[${P}] = ${L};`)}let v=N(r,new Set(f));return e.write(`for (const ${c} in ${o}) {`),e.indented(k=>{k.write(`if (${v}.has(${c})) continue;`),l.mode==="loose"?k.write(`if (${c} !== "__proto__") ${a}[${c}] = ${o}[${c}];`):k.write("return INVALID;")}),e.write("}"),a}let p=t.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=t.mode==="loose",v=Xi(t.keyType);v.definite===!1&&(r.definite=!1);let k=N(r,v),x=N(r,Ye),j=T(r);return If(e,r,o,c,P=>{P.write(`let ${j} = ${k}(${c});`),P.write(`if (${j} === INVALID && typeof ${c} === "string" && ${x}.test(${c})) ${j} = ${k}(Number(${c}));`),f?P.write(`if (${j} === INVALID) { ${a}[${c}] = ${o}[${c}]; continue; }`):P.write(`if (${j} === INVALID) return INVALID;`),P.write(`if (${j} === "__proto__") continue;`);let D=T(r);P.write(`const ${D} = ${o}[${c}];`);let L=fe(P,r,t.valueType,D);P.write(`${a}[${j}] = ${L};`)}),a}return If(e,r,o,c,f=>{f.write(`const ${u} = ${o}[${c}];`);let v=fe(f,r,t.valueType,u);f.write(`${a}[${c}] = ${v};`)},"return INVALID;"),a}function If(e,r,i,o,t,n){let a=N(r,Object.prototype.propertyIsEnumerable),c=T(r),u=T(r),l=T(r);e.write(`const ${c} = Object.getOwnPropertySymbols(${i});`),e.write(`const ${u} = Object.getOwnPropertyNames(${i});`),e.write(`for (let ${l} = 0; ${l} < ${u}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${o} = ${u}[${l}];`),d.write(`if (${o} === "__proto__" || !${a}.call(${i}, ${o})) continue;`),t(d)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${o} = ${c}[${l}];`),d.write(`if (!${a}.call(${i}, ${o})) continue;`),n?d.write(n):t(d)}),e.write("}")}function ok(e,r){return typeof r=="string"?he(r):N(e,r)}function ak(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`);let n=T(r),a=T(r),c=T(r);return e.write(`const ${n} = new Map();`),e.write(`for (const [${a}, ${c}] of ${o}) {`),e.indented(u=>{let l=ee(u,r,t.keyType,a),d=ee(u,r,t.valueType,c);u.write(`${n}.set(${l}, ${d});`)}),e.write("}"),n}function sk(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`);let n=T(r),a=T(r);return e.write(`const ${n} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(c=>{let u=ee(c,r,t.valueType,a);c.write(`${n}.add(${u});`)}),e.write("}"),n}function ck(e,r){return e.write(`if (!(${r} instanceof File)) return INVALID;`),r}function uk(e,r,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let n=N(r,t);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${o})) return INVALID;`)}return o}function lk(e,r,i,o){let t=i._zod.def,n=jt(r,t.getter),a=N(r,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(u=>{u.write(`const inner = ${n}();`),u.write(`${a}.parser = function(input) {`),u.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),u.write("};")}),e.write("}");let c=T(r);return e.write(`const ${c} = ${a}.parser(${o});`),e.write(`if (${c} === INVALID) return INVALID;`),c}function dk(e,r,i,o){let t=i._zod.def,n=ee(e,r,t.in,o);if(t.transform){if(At(t.transform))throw new Re("z.compile: async transforms in pipes are not supported");let a=t.transform,u=jt(r,d=>{let p={value:d,issues:[],addIssue:pu},m=a(d,p);return m instanceof Promise?be:p.issues.length===0?m:be}),l=T(r);return e.write(`const ${l} = ${u}(${n});`),e.write(`if (${l} === INVALID) return INVALID;`),ee(e,r,t.out,l)}else return ee(e,r,t.out,n)}function At(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function pk(e,r,i,o){let t=i._zod.def;if(t.fn){if(At(t.fn))throw new Re("z.compile: async custom predicates are not supported");let n=jt(r,t.fn),a=N(r,uu),c=T(r);e.write(`const ${c} = ${n}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`)}else throw new M("custom schema without a predicate function");return o}function mk(e,r,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return be;let t=o;return t.issues.length===0?t.value:r()}function fk(e,r,i,o){let t=i._zod.def;if(!t.catchValue[ri])throw new M("catch with a callback (only a constant catch value compiles)",!1);let n=T(r);e.write(`let ${n} = (() => {`),e.indented(l=>{let d=fe(l,r,t.innerType,o);l.write(`return ${d};`)}),e.write("})();");let a=N(r,t.innerType),c=jt(r,t.catchValue),u=N(r,mk);return e.write(`if (${n} === INVALID) {`),e.indented(l=>{l.write(`${n} = ${u}(${a}, ${c}, ${o});`),l.write(`if (${n} === INVALID) return INVALID;`)}),e.write("}"),n}function gk(e,r,i,o){let t=i._zod.def;if(t.transform){if(At(t.transform))throw new Re("z.compile: async transforms are not supported");let n=t.transform,c=jt(r,l=>{let d={value:l,issues:[],addIssue:pu},p=n(l,d);return p instanceof Promise?be:d.issues.length===0?p:be}),u=T(r);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}return o}function Yi(e){return e.checks&&(e.checks=[...e.checks]),e}function mu(e,r){return new e(Yi({type:"string",...I(r)}))}function fu(e,r){return new e(Yi({type:"string",coerce:!0,...I(r)}))}function Qi(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(r)})}function eo(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(r)})}function to(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(r)})}function ro(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(r)})}function no(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(r)})}function io(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(r)})}function bn(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(r)})}function oo(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(r)})}function ao(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(r)})}function so(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(r)})}function co(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(r)})}function uo(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(r)})}function lo(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(r)})}function po(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(r)})}function mo(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(r)})}function fo(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(r)})}function gu(e,r){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(r)})}function go(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(r)})}function ho(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(r)})}function vo(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(r)})}function bo(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(r)})}function yo(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(r)})}function hu(e,r){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...I(r)})}function vu(e,r){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...I(r)})}function _o(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(r)})}var bu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function yn(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(r)})}function _n(e,r){return new e({type:"string",format:"date",check:"string_format",...I(r)})}function $n(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(r)})}function kn(e,r){return new e({type:"string",format:"duration",check:"string_format",...I(r)})}function yu(e,r){return new e(Yi({type:"number",checks:[],...I(r)}))}function _u(e,r){return new e(Yi({type:"number",coerce:!0,checks:[],...I(r)}))}function $u(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(r)})}function ku(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(r)})}function wu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(r)})}function xu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(r)})}function Su(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(r)})}function Iu(e,r){return new e({type:"boolean",...I(r)})}function zu(e,r){return new e({type:"boolean",coerce:!0,...I(r)})}function Pu(e,r){return new e({type:"bigint",...I(r)})}function Ou(e,r){return new e({type:"bigint",coerce:!0,...I(r)})}function ju(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(r)})}function Au(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(r)})}function Tu(e,r){return new e({type:"symbol",...I(r)})}function Du(e,r){return new e({type:"undefined",...I(r)})}function Nu(e,r){return new e({type:"null",...I(r)})}function Cu(e){return new e({type:"any"})}function Uu(e){return new e({type:"unknown"})}function Eu(e,r){return new e({type:"never",...I(r)})}function Ru(e,r){return new e({type:"void",...I(r)})}function Zu(e,r){return new e({type:"date",...I(r)})}function Lu(e,r){return new e({type:"date",coerce:!0,...I(r)})}function Mu(e,r){return new e({type:"nan",...I(r)})}function Fe(e,r){return new bi({check:"less_than",...I(r),value:e,inclusive:!1})}function je(e,r){return new bi({check:"less_than",...I(r),value:e,inclusive:!0})}function Be(e,r){return new yi({check:"greater_than",...I(r),value:e,inclusive:!1})}function Ae(e,r){return new yi({check:"greater_than",...I(r),value:e,inclusive:!0})}function $o(e){return Be(0,e)}function ko(e){return Fe(0,e)}function wo(e){return je(0,e)}function xo(e){return Ae(0,e)}function ut(e,r){return new Ss({check:"multiple_of",...I(r),value:e})}function lt(e,r){return new Ps({check:"max_size",...I(r),maximum:e})}function Ke(e,r){return new Os({check:"min_size",...I(r),minimum:e})}function Tt(e,r){return new js({check:"size_equals",...I(r),size:e})}function Dt(e,r){return new As({check:"max_length",...I(r),maximum:e})}function Qe(e,r){return new Ts({check:"min_length",...I(r),minimum:e})}function Nt(e,r){return new Ds({check:"length_equals",...I(r),length:e})}function ar(e,r){return new Ns({check:"string_format",format:"regex",...I(r),pattern:e})}function sr(e){return new Cs({check:"string_format",format:"lowercase",...I(e)})}function cr(e){return new Us({check:"string_format",format:"uppercase",...I(e)})}function ur(e,r){return new Es({check:"string_format",format:"includes",...I(r),includes:e})}function lr(e,r){return new Rs({check:"string_format",format:"starts_with",...I(r),prefix:e})}function dr(e,r){return new Zs({check:"string_format",format:"ends_with",...I(r),suffix:e})}function So(e,r,i){return new Ls({check:"property",property:e,schema:r,...I(i)})}function pr(e,r){return new Ms({check:"properties",shape:e,...I(r)})}function mr(e,r){return new Vs({check:"mime_type",mime:e,...I(r)})}function Ze(e){return new Fs({check:"overwrite",tx:e})}function fr(e){return Ze(r=>r.normalize(e))}function gr(){return Ze(e=>e.trim())}function hr(){return Ze(e=>e.toLowerCase())}function vr(){return Ze(e=>e.toUpperCase())}function br(){return Ze(e=>za(e))}function Vu(e,r,i){return new e({type:"array",element:r,...I(i)})}function hk(e,r,i){return new e({type:"union",options:r,...I(i)})}function vk(e,r,i){return new e({type:"union",options:r,inclusive:!1,...I(i)})}function bk(e,r,i,o){return new e({type:"union",options:i,discriminator:r,...I(o)})}function yk(e,r,i){return new e({type:"intersection",left:r,right:i})}function _k(e,r,i,o){let t=i instanceof U,n=t?o:i,a=t?i:null;return new e({type:"tuple",items:r,rest:a,...I(n)})}function $k(e,r,i,o){return new e({type:"record",keyType:r,valueType:i,...I(o)})}function kk(e,r,i,o){return new e({type:"map",keyType:r,valueType:i,...I(o)})}function wk(e,r,i){return new e({type:"set",valueType:r,...I(i)})}function xk(e,r,i){let o=Array.isArray(r)?Object.fromEntries(r.map(t=>[t,t])):r;return new e({type:"enum",entries:o,...I(i)})}function Sk(e,r,i){return new e({type:"enum",entries:r,...I(i)})}function Ik(e,r,i){return new e({type:"literal",values:Array.isArray(r)?r:[r],...I(i)})}function Fu(e,r){return new e({type:"file",...I(r)})}function zk(e,r){return new e({type:"transform",transform:r})}function Pk(e,r){return new e({type:"optional",innerType:r})}function Ok(e,r){return new e({type:"nullable",innerType:r})}function jk(e,r,i){return new e({type:"default",innerType:r,get defaultValue(){return typeof i=="function"?i():Vr(i)}})}function Ak(e,r,i){return new e({type:"nonoptional",innerType:r,...I(i)})}function Tk(e,r){return new e({type:"success",innerType:r})}function Dk(e,r,i){return new e({type:"catch",innerType:r,catchValue:typeof i=="function"?i:Da(i)})}function Nk(e,r,i){return new e({type:"pipe",in:r,out:i})}function Ck(e,r){return new e({type:"readonly",innerType:r})}function Uk(e,r,i){return new e({type:"template_literal",parts:r,...I(i)})}function Ek(e,r){return new e({type:"lazy",getter:r})}function Rk(e,r){return new e({type:"promise",innerType:r})}function Bu(e,r,i){let o=I(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function Ku(e,r,i){return new e({type:"custom",check:"custom",fn:r,...I(i)})}function Gu(e,r){let i=jf(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(Ht(t,o.value,i._zod.def));else{let n=t;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=o.value),n.inst??(n.inst=i),n.continue??(n.continue=!i._zod.def.abort),o.issues.push(Ht(n))}},e(o.value,o)),r);return i}function jf(e,r){let i=new X({check:"custom",...I(r)});return i._zod.check=e,i}function Ju(e){let r=new X({check:"describe"});return r._zod.onattach=[i=>{let o=le.get(i)??{};le.add(i,{...o,description:e})}],r._zod.check=()=>{},r}function Wu(e){let r=new X({check:"meta"});return r._zod.onattach=[i=>{let o=le.get(i)??{};le.add(i,{...o,...e})}],r._zod.check=()=>{},r}function qu(e,r){let i=I(r),o=i.truthy??["true","1","yes","on","y","enabled"],t=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),t=t.map(f=>typeof f=="string"?f.toLowerCase():f));let n=new Set(o),a=new Set(t),c=e.Codec??dn,u=e.Boolean??un,l=e.String??zt,d=new l({type:"string",error:i.error}),p=new u({type:"boolean",error:i.error}),m=new c({type:"pipe",in:d,out:p,transform:((f,v)=>{let k=f;return i.case!=="sensitive"&&(k=k.toLowerCase()),n.has(k)?!0:a.has(k)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:v.value,inst:m,continue:!1}),{})}),reverseTransform:((f,v)=>f===!0?o[0]||"true":t[0]||"false"),error:i.error});return m._zod.bag.truthy=o,m._zod.bag.falsy=t,m._zod.bag.case=i.case??"insensitive",m}function Ct(e,r,i,o={}){let t=I(o),n={check:"string_format",type:"string",format:r,fn:typeof i=="function"?i:c=>i.test(c),...t};return i instanceof RegExp&&(n.pattern=i),new e(n)}function wn(e,...r){for(let i of r)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&ue(e,o,i[o]);return e}function dt(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??le,target:r,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 ie(e,r,i,o,t){let n=typeof r.unrepresentable=="function"?r.unrepresentable({zodSchema:e,path:o.path,message:t}):r.unrepresentable;if(n==="any")return!1;if(n===void 0||n==="throw")throw new Error(t);return Object.assign(i,n),!0}function W(e,r,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,n=r.seen.get(e);if(n)return n.count++,i.schemaPath.includes(e)&&(n.cycle=i.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};r.seen.set(e,a),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,a.schema,d);else{let m=a.schema,f=r.processors[t.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);f(e,r,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),W(p,r,d),r.seen.get(p).isParent=!0)}let u=r.metadataRegistry.get(e);return u&&wn(a.schema,u),r.io==="input"&&ye(e)&&(delete a.schema.examples,delete a.schema.default),r.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,r.seen.get(e).schema}function Af(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pt(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let u=o.get(c);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,a[0])}}let t=a=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(v=>v);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${Af(f)}`}}let u="#",l=`${u}/${c}/`;if(a[1]===i&&!a[1].schema.id)return{ref:u};let d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+Af(d)}},n=a=>{if(a[1].schema.$ref)return;let c=a[1],{ref:u,defId:l}=t(a);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let p in d)delete d[p];d.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
62
62
|
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(r===a[0]){n(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(r!==a[0]&&l){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(c.cycle){n(a);continue}c.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Nf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;Nf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Cf=new Set(["type","properties","required","additionalProperties"]),Tf=["oneOf","anyOf"];function Df(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function Hu(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Cf.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let c=[];for(let l of r){let d=l.properties?.[a]??Df(l);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:Hu(c)??{allOf:c};ue(i,a,u)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let c=Df(a);c&&!n.some(u=>JSON.stringify(u)===JSON.stringify(c))&&n.push(c)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Zk(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Cf)if(t in e)return;let i=r.filter(t=>Tf.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=Hu(r);else{let t=i[0],n=Tf.find(u=>Array.isArray(t[u]));if(Object.keys(t).length!==1)return;let a=r.filter(u=>u!==t),c=t[n].map(u=>Hu([...a,u]));if(c.some(u=>!u))return;o={[n]:c}}o&&(delete e.allOf,wn(e,o))}function mt(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},p=u.ref;if(u.ref=null,p){o(p);let f=e.seen.get(p),v=f.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(v)):wn(l,v),wn(l,d),c._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in d||delete l[x];if(v.$ref&&f.def)for(let x in l)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(l[x])===JSON.stringify(f.def[x])&&delete l[x]}let m=c._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Nf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let p=c.get(d);p?p.push(l):c.set(d,[l])}for(let u of e.intersections)for(let l of c.get(u)??[])Zk(l)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(r)?.id;if(!c)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(c)}wn(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,ue(a,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let c=JSON.parse(JSON.stringify(t));return Object.defineProperty(c,"~standard",{value:{...r["~standard"],jsonSchema:{input:yr(r,"input",e.processors),output:yr(r,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ye(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ye(o.element,i);if(o.type==="set")return ye(o.valueType,i);if(o.type==="lazy")return ye(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return ye(o.innerType,i);if(o.type==="intersection")return ye(o.left,i)||ye(o.right,i);if(o.type==="record"||o.type==="map")return ye(o.keyType,i)||ye(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ye(o.in,i)||ye(o.out,i);if(o.type==="object"){for(let t in o.shape)if(ye(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(ye(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(ye(t,i))return!0;return!!(o.rest&&ye(o.rest,i))}return!1}var Xu=(e,r={})=>i=>{let o=dt({...i,processors:r});return W(e,o),pt(o,e),mt(o,e)},yr=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=dt({...t??{},target:n,io:r,processors:i});return W(e,a),pt(a,e),mt(a,e)};var _r=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},$r=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Uf=(e,r)=>{_r(e,"minimum",r),$r(e,"maximum",r)},Lf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Mf=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Vf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Ff=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Ef=(e,r)=>_r(e,"minimum",r.minimum),Rf=(e,r)=>$r(e,"maximum",r.maximum),Zf=e=>(r,i)=>{Ff(r,i.format);let[o,t]=e[i.format];_r(r,"minimum",o),$r(r,"maximum",t)},Lk={greater_than:(e,r)=>_r(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>$r(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Lf(e,r.value),number_format:Zf(Br),bigint_format:Zf(Kr),min_length:Ef,max_length:Rf,length_equals:(e,r)=>Uf(e,r.length),min_size:Ef,max_size:Rf,size_equals:(e,r)=>Uf(e,r.size),string_format:(e,r)=>{Ff(e,r.format),r.pattern&&Mf(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Vf(e,r.mime)};function oe(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Lk[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&_r(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&_r(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&$r(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&$r(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Lf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Vf(r,t.mime);for(let n of t.patterns??[])Mf(r,n);return r}var Mk={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Vk=new Map([[Oi,os],[cn,as]]),Bf=e=>Vk.get(e)??e,el=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:c,patterns:u,contentEncoding:l,laxFormat:d}=oe(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),c&&(t.format=Mk[c]??c,t.format===""&&delete t.format,(c==="time"||d)&&delete t.format),l&&(t.contentEncoding=l),u&&u.size>0){let p=[...u].map(Bf);p.length===1?t.pattern=p[0].source:p.length>1&&(t.allOf=[...p.map(m=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},tl=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=oe(e);t.type=d?"integer":"number";let p=typeof l=="number"&&l>=(n??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=r.target==="draft-04"||r.target==="openapi-3.0";if(p?f?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof n=="number"&&(t.minimum=n),m?f?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),c){let v=new Set;for(let j of c)Number.isFinite(j)&&j!==0?v.add(Math.abs(j)):ie(e,r,t,o,`A multipleOf divisor of ${j} cannot be represented in JSON Schema`);let[k,...x]=v;k!==void 0&&(t.multipleOf=k),x.length&&(t.allOf=[...t.allOf??[],...x.map(j=>({multipleOf:j}))])}},rl=(e,r,i,o)=>{i.type="boolean"},nl=(e,r,i,o)=>{ie(e,r,i,o,"BigInt cannot be represented in JSON Schema")},il=(e,r,i,o)=>{ie(e,r,i,o,"Symbols cannot be represented in JSON Schema")},ol=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},al=(e,r,i,o)=>{ie(e,r,i,o,"Undefined cannot be represented in JSON Schema")},sl=(e,r,i,o)=>{ie(e,r,i,o,"Void cannot be represented in JSON Schema")},cl=(e,r,i,o)=>{i.not={}},ul=(e,r,i,o)=>{},ll=(e,r,i,o)=>{},dl=(e,r,i,o)=>{ie(e,r,i,o,"Date cannot be represented in JSON Schema")},pl=(e,r,i,o)=>{let t=e._zod.def,n=Gt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},ml=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(ie(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},fl=(e,r,i,o)=>{ie(e,r,i,o,"NaN cannot be represented in JSON Schema")},gl=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},hl=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:c}=oe(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),c&&(c.length===0?t.not={}:c.length===1?t.contentMediaType=c[0]:t.anyOf=c.map(u=>({contentMediaType:u})))},vl=(e,r,i,o)=>{i.type="boolean"},bl=(e,r,i,o)=>{ie(e,r,i,o,"Custom types cannot be represented in JSON Schema")},yl=(e,r,i,o)=>{ie(e,r,i,o,"Function types cannot be represented in JSON Schema")},_l=(e,r,i,o)=>{ie(e,r,i,o,"Transforms cannot be represented in JSON Schema")},$l=(e,r,i,o)=>{ie(e,r,i,o,"Map cannot be represented in JSON Schema")},kl=(e,r,i,o)=>{ie(e,r,i,o,"Set cannot be represented in JSON Schema")},wl=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:c}=oe(e);typeof a=="number"&&(t.minItems=a),typeof c=="number"&&(t.maxItems=c),t.type="array",t.items=W(n.element,r,{...o,path:[...o.path,"items"]})};function xn(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?xn(r.out):r.type==="catch"?xn(r.innerType):e._zod.optin}var xl=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&ie(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ue(t.properties,l,W(a[l],r,{...o,path:[...o.path,"properties",l]}));let u=[];for(let l of Object.keys(a)){let d=n.shape[l];(r.io==="input"?xn(d)===void 0:d._zod.optout===void 0)&&u.push(l)}u.length>0&&(t.required=u),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=W(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},zo=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((c,u)=>W(c,r,{...o,path:[...o.path,n?"oneOf":"anyOf",u]}));n?i.oneOf=a:i.anyOf=a},Sl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=W(t.right,r,{...o,path:[...o.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(n)?n.allOf:[n],...c(a)?a.allOf:[a]];i.allOf=u,r.intersections.push(u)},Il=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",c=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",u=n.items.map((k,x)=>W(k,r,{...o,path:[...o.path,a,x]})),l=n.rest?W(n.rest,r,{...o,path:[...o.path,c,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,d=n.items.length;for(;d>0;){let k=n.items[d-1];if(!(r.io==="input"?xn(k)!==void 0:k._zod.optout==="optional"))break;d--}let p=n.items.length,m=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=u,m?t.items=!1:l&&(t.items=l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):r.target==="openapi-3.0"?(t.items={anyOf:u},l&&t.items.anyOf.push(l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):(t.items=u,m?t.additionalItems=!1:l&&(t.additionalItems=l),d>0&&(t.minItems=d),m&&(t.maxItems=p));let{minimum:f,maximum:v}=oe(e);typeof f=="number"&&(t.minItems=f),typeof v=="number"&&(t.maxItems=v)};function Yu(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let k=Yu(e,v,i);return k===v?r:k}for(let v of["anyOf","oneOf"]){let k=r[v];if(!Array.isArray(k))continue;let x=k.map(j=>Yu(e,j,i));x.some((j,P)=>j!==k[P])&&(r={...r,[v]:x})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:d,format:p,id:m,...f}=r;return f.enum?f.enum=f.enum.map(v=>typeof v=="number"?String(v):v):typeof f.const=="number"&&(f.const=String(f.const)),t&&(f.type="string",n||(f.pattern=(o.includes("number")?Ye:en).source)),f}var Qu=new WeakMap;function Fk(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Qu.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=Yu(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var zl=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,c=oe(a).patterns;if(n.mode==="loose"&&c&&c.size>0){let d=W(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)ue(t.patternProperties,Bf(p).source,d)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=W(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let d=Qu.get(r);d||(d=[],Qu.set(r,d),r.deferred.push(()=>Fk(r))),d.push(e)}t.additionalProperties=W(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,l=r.io==="input"&&xn(n.valueType)!==void 0;if(u&&!n.partial&&!l){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(t.required=d.map(String))}},Pl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},Ol=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},jl=Symbol();function Kf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(n=!0,null));return n?(ie(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),jl):JSON.parse(a)}var Al=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Kf(t.defaultValue,e,r,i,o);a!==jl&&(i.default=a)},Tl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Kf(t.defaultValue,e,r,i,o);a!==jl&&(i._prefault=a)},Dl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{ie(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},Nl=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;W(a,r,o);let c=r.seen.get(e);c.ref=a},Cl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},Ul=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},Po=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},El=(e,r,i,o)=>{let t=e._zod.innerType;W(t,r,o);let n=r.seen.get(e);n.ref=t},Io={string:el,number:tl,boolean:rl,bigint:nl,symbol:il,null:ol,undefined:al,void:sl,never:cl,any:ul,unknown:ll,date:dl,enum:pl,literal:ml,nan:fl,template_literal:gl,file:hl,success:vl,custom:bl,function:yl,transform:_l,map:$l,set:kl,array:wl,object:xl,union:zo,intersection:Sl,tuple:Il,record:zl,nullable:Pl,nonoptional:Ol,default:Al,prefault:Tl,catch:Dl,pipe:Nl,readonly:Cl,promise:Ul,optional:Po,lazy:El};function Oo(e,r){if("_idmap"in e){let o=e,t=dt({...r,processors:Io}),n={};for(let u of o._idmap.entries()){let[l,d]=u;W(d,t)}let a={},c={registry:o,uri:r?.uri,defs:n};t.external=c;for(let u of o._idmap.entries()){let[l,d]=u;pt(t,d),ue(a,l,mt(t,d))}if(Object.keys(n).length>0){let u=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:n}}return{schemas:a}}let i=dt({...r,processors:Io});return W(e,i),pt(i,e),mt(i,e)}var jo=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=dt({processors:Io,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return W(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pt(this.ctx,r);let o=mt(this.ctx,r),{"~standard":t,...n}=o;return n}};var Gf={};var Or={};qe(Or,{ZodAny:()=>od,ZodArray:()=>ud,ZodBase64:()=>qo,ZodBase64URL:()=>Ho,ZodBigInt:()=>zr,ZodBigIntFormat:()=>Qo,ZodBoolean:()=>Ir,ZodCIDRv4:()=>Jo,ZodCIDRv6:()=>Wo,ZodCUID:()=>Lo,ZodCUID2:()=>Mo,ZodCatch:()=>jd,ZodCodec:()=>Nn,ZodCreditCard:()=>Xl,ZodCustom:()=>Cn,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Pn,ZodDefault:()=>xd,ZodDiscriminatedUnion:()=>dd,ZodE164:()=>Xo,ZodEmail:()=>Uo,ZodEmoji:()=>Ro,ZodEnum:()=>wr,ZodExactOptional:()=>na,ZodFile:()=>_d,ZodFunction:()=>Ld,ZodGUID:()=>Eo,ZodIBAN:()=>Yl,ZodIPv4:()=>Ko,ZodIPv6:()=>Go,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>Fd,ZodIntersection:()=>pd,ZodJWT:()=>Yo,ZodKSUID:()=>Bo,ZodLazy:()=>Ed,ZodLiteral:()=>yd,ZodMAC:()=>Hl,ZodMap:()=>vd,ZodNaN:()=>Td,ZodNanoID:()=>Zo,ZodNever:()=>sd,ZodNonOptional:()=>ia,ZodNull:()=>nd,ZodNullable:()=>wd,ZodNumber:()=>Sr,ZodNumberFormat:()=>Lt,ZodObject:()=>jn,ZodOptional:()=>Tn,ZodPipe:()=>Dn,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Zd,ZodReadonly:()=>Nd,ZodRecord:()=>kr,ZodSet:()=>bd,ZodString:()=>xr,ZodStringFormat:()=>H,ZodSuccess:()=>Od,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ud,ZodTransform:()=>$d,ZodTuple:()=>fd,ZodType:()=>R,ZodULID:()=>Vo,ZodURL:()=>zn,ZodUUID:()=>Ge,ZodUndefined:()=>rd,ZodUnion:()=>An,ZodUnknown:()=>ad,ZodVoid:()=>cd,ZodXID:()=>Fo,ZodXor:()=>ld,_ZodString:()=>Co,_default:()=>Sd,_function:()=>ih,any:()=>Cg,array:()=>On,base64:()=>gg,base64url:()=>hg,bigint:()=>jg,boolean:()=>ed,catch:()=>Ad,check:()=>oh,cidrv4:()=>mg,cidrv6:()=>fg,codec:()=>eh,creditCard:()=>bg,cuid:()=>og,cuid2:()=>ag,currencyCode:()=>xg,custom:()=>ah,date:()=>Eg,describe:()=>sh,discriminatedUnion:()=>Fg,e164:()=>vg,email:()=>qf,emoji:()=>ng,enum:()=>ta,exactOptional:()=>kd,file:()=>Hg,float32:()=>Ig,float64:()=>zg,function:()=>ih,guid:()=>Hf,hash:()=>Sg,hex:()=>wg,hostname:()=>kg,httpUrl:()=>rg,iban:()=>yg,instanceof:()=>uh,int:()=>Do,int32:()=>Pg,int64:()=>Ag,intersection:()=>md,invertCodec:()=>th,ipv4:()=>lg,ipv6:()=>pg,json:()=>dh,jwt:()=>_g,keyof:()=>Rg,ksuid:()=>ug,lazy:()=>Rd,literal:()=>qg,looseObject:()=>Mg,looseRecord:()=>Kg,mac:()=>dg,map:()=>Gg,meta:()=>ch,nan:()=>Qg,nanoid:()=>ig,nativeEnum:()=>Wg,never:()=>ea,nonoptional:()=>Pd,null:()=>id,nullable:()=>In,nullish:()=>Xg,number:()=>Ql,object:()=>Zg,optional:()=>Et,partialRecord:()=>Bg,pipe:()=>No,prefault:()=>zd,preprocess:()=>ph,promise:()=>nh,readonly:()=>Cd,record:()=>hd,refine:()=>Md,set:()=>Jg,strictObject:()=>Lg,string:()=>Sn,stringFormat:()=>$g,stringbool:()=>lh,success:()=>Yg,superRefine:()=>Vd,symbol:()=>Dg,templateLiteral:()=>rh,transform:()=>ra,tuple:()=>gd,uint32:()=>Og,uint64:()=>Tg,ulid:()=>sg,undefined:()=>Ng,union:()=>Pr,unknown:()=>Ut,url:()=>tg,uuid:()=>Xf,uuidv4:()=>Yf,uuidv6:()=>Qf,uuidv7:()=>eg,void:()=>Ug,xid:()=>cg,xor:()=>Vg});var Ao={};qe(Ao,{endsWith:()=>dr,gt:()=>Be,gte:()=>Ae,includes:()=>ur,length:()=>Nt,lowercase:()=>sr,lt:()=>Fe,lte:()=>je,maxLength:()=>Dt,maxSize:()=>lt,mime:()=>mr,minLength:()=>Qe,minSize:()=>Ke,multipleOf:()=>ut,negative:()=>ko,nonnegative:()=>xo,nonpositive:()=>wo,normalize:()=>fr,overwrite:()=>Ze,positive:()=>$o,properties:()=>pr,property:()=>So,regex:()=>ar,size:()=>Tt,slugify:()=>br,startsWith:()=>lr,toLowerCase:()=>hr,toUpperCase:()=>vr,trim:()=>gr,uppercase:()=>cr});var Jf=new WeakSet([Object.prototype,Error.prototype]);function To(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Wf=(e,r)=>{Za.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Jf.has(i)||(Jf.add(i),To(i,"format",o=>t=>Hr(o,t)),To(i,"flatten",o=>t=>qr(o,t)),To(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Jt,2)}),To(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,Jt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Kk=g("ZodError",Wf),Ie=g("ZodError",Wf,void 0,{Parent:Error});var Rl=Xt(Ie),Zl=Yt(Ie),Ll=Qt(Ie),Ml=er(Ie),Vl=ai(Ie),Fl=si(Ie),Bl=ci(Ie),Kl=ui(Ie),Gl=li(Ie),Jl=di(Ie),Wl=pi(Ie),ql=mi(Ie);function Jk(){ae.localeError||re(Ki())}function Rt(){ae.memoizer||re({memoizer:gn()})}var R=g("ZodType",(e,r)=>(Jk(),U.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone(y.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return G(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(Md(e,r))},superRefine(e,r){return this.check(Vd(e,r))},overwrite(e){return this.check(Ze(e))},optional(){return Et(this)},exactOptional(){return kd(this)},nullable(){return In(this)},nullish(){return Et(In(this))},nonoptional(e){return Pd(this,e)},array(){return On(this)},or(e){return Pr([this,e])},and(e){return md(this,e)},transform(e){return No(this,ra(e))},default(e){return Sd(this,e)},prefault(e){return zd(this,e)},catch(e){return Ad(this,e)},pipe(e){return No(this,e)},readonly(){return Cd(this)},describe(e){let r=this.clone();return le.add(r,{description:e}),r},meta(...e){if(e.length===0)return le.get(this);let r=this.clone();return le.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return y.hide(this,"~standard",{...xi(this),jsonSchema:{input:yr(this,"input"),output:yr(this,"output")}})},set"~standard"(e){y.own(this,"~standard",e)},parse:function e(r,i){return Rl(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await Zl(this,r,i,{callee:e})},safeParse(e,r){return Ll(this,e,r)},async safeParseAsync(e,r){return Ml(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){y.own(this,"spa",e)},validate(e,r){return Xr(this,e,r)},validateAsync(e,r){return Yr(this,e,r)},encode:function e(r,i){return Vl(this,r,i,{callee:e})},decode:function e(r,i){return Fl(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await Bl(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await Kl(this,r,i,{callee:e})},safeEncode(e,r){return Gl(this,e,r)},safeDecode(e,r){return Jl(this,e,r)},async safeEncodeAsync(e,r){return Wl(this,e,r)},async safeDecodeAsync(e,r){return ql(this,e,r)},toJSONSchema(e){return Xu(this,{})(e)},get description(){return le.get(this)?.description},get _def(){return this._zod.def}}),Co=g("_ZodString",(e,r)=>{zt.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>el(e,i,o,t)},y.derived({format:e=>oe(e).format??null,minLength:e=>oe(e).minimum??null,maxLength:e=>oe(e).maximum??null},{regex(...e){return this.check(ar(...e))},includes(...e){return this.check(ur(...e))},startsWith(...e){return this.check(lr(...e))},endsWith(...e){return this.check(dr(...e))},min(...e){return this.check(Qe(...e))},max(...e){return this.check(Dt(...e))},length(...e){return this.check(Nt(...e))},nonempty(...e){return this.check(Qe(1,...e))},lowercase(e){return this.check(sr(e))},uppercase(e){return this.check(cr(e))},trim(){return this.check(gr())},normalize(...e){return this.check(fr(...e))},toLowerCase(){return this.check(hr())},toUpperCase(){return this.check(vr())},slugify(){return this.check(br())}})),xr=g("ZodString",(e,r)=>{zt.init(e,r),Co.init(e,r)},{email(e){return this.check(Qi(Uo,e))},url(e){return this.check(bn(zn,e))},jwt(e){return this.check(_o(Yo,e))},emoji(e){return this.check(oo(Ro,e))},guid(e){return this.check(eo(Eo,e))},uuid(e){return this.check(to(Ge,e))},uuidv4(e){return this.check(ro(Ge,e))},uuidv6(e){return this.check(no(Ge,e))},uuidv7(e){return this.check(io(Ge,e))},nanoid(e){return this.check(ao(Zo,e))},cuid(e){return this.check(so(Lo,e))},cuid2(e){return this.check(co(Mo,e))},ulid(e){return this.check(uo(Vo,e))},base64(e){return this.check(vo(qo,e))},base64url(e){return this.check(bo(Ho,e))},xid(e){return this.check(lo(Fo,e))},ksuid(e){return this.check(po(Bo,e))},ipv4(e){return this.check(mo(Ko,e))},ipv6(e){return this.check(fo(Go,e))},cidrv4(e){return this.check(go(Jo,e))},cidrv6(e){return this.check(ho(Wo,e))},e164(e){return this.check(yo(Xo,e))},datetime(e){return this.check(yn(ft,e))},date(e){return this.check(_n(gt,e))},time(e){return this.check($n(ht,e))},duration(e){return this.check(kn(vt,e))}});function Sn(e){return mu(xr,e)}var H=g("ZodStringFormat",(e,r)=>{J.init(e,r),Co.init(e,r)}),ft=g("ZodISODateTime",(e,r)=>{oc.init(e,r),H.init(e,r)}),gt=g("ZodISODate",(e,r)=>{ac.init(e,r),H.init(e,r)}),ht=g("ZodISOTime",(e,r)=>{sc.init(e,r),H.init(e,r)}),vt=g("ZodISODuration",(e,r)=>{cc.init(e,r),H.init(e,r)}),Uo=g("ZodEmail",(e,r)=>{Ws.init(e,r),H.init(e,r)});function qf(e){return Qi(Uo,e)}var Eo=g("ZodGUID",(e,r)=>{Gs.init(e,r),H.init(e,r)});function Hf(e){return eo(Eo,e)}var Ge=g("ZodUUID",(e,r)=>{Js.init(e,r),H.init(e,r)});function Xf(e){return to(Ge,e)}function Yf(e){return ro(Ge,e)}function Qf(e){return no(Ge,e)}function eg(e){return io(Ge,e)}var zn=g("ZodURL",(e,r)=>{Xs.init(e,r),H.init(e,r)});function tg(e){return bn(zn,e)}function rg(e){return bn(zn,{protocol:Qr,hostname:cs,...y.normalizeParams(e)})}var Ro=g("ZodEmoji",(e,r)=>{Ys.init(e,r),H.init(e,r)});function ng(e){return oo(Ro,e)}var Zo=g("ZodNanoID",(e,r)=>{Qs.init(e,r),H.init(e,r)});function ig(e){return ao(Zo,e)}var Lo=g("ZodCUID",(e,r)=>{ec.init(e,r),H.init(e,r)});function og(e){return so(Lo,e)}var Mo=g("ZodCUID2",(e,r)=>{tc.init(e,r),H.init(e,r)});function ag(e){return co(Mo,e)}var Vo=g("ZodULID",(e,r)=>{rc.init(e,r),H.init(e,r)});function sg(e){return uo(Vo,e)}var Fo=g("ZodXID",(e,r)=>{nc.init(e,r),H.init(e,r)});function cg(e){return lo(Fo,e)}var Bo=g("ZodKSUID",(e,r)=>{ic.init(e,r),H.init(e,r)});function ug(e){return po(Bo,e)}var Ko=g("ZodIPv4",(e,r)=>{uc.init(e,r),H.init(e,r)});function lg(e){return mo(Ko,e)}var Hl=g("ZodMAC",(e,r)=>{dc.init(e,r),H.init(e,r)});function dg(e){return gu(Hl,e)}var Go=g("ZodIPv6",(e,r)=>{lc.init(e,r),H.init(e,r)});function pg(e){return fo(Go,e)}var Jo=g("ZodCIDRv4",(e,r)=>{pc.init(e,r),H.init(e,r)});function mg(e){return go(Jo,e)}var Wo=g("ZodCIDRv6",(e,r)=>{mc.init(e,r),H.init(e,r)});function fg(e){return ho(Wo,e)}var qo=g("ZodBase64",(e,r)=>{fc.init(e,r),H.init(e,r)});function gg(e){return vo(qo,e)}var Ho=g("ZodBase64URL",(e,r)=>{gc.init(e,r),H.init(e,r)});function hg(e){return bo(Ho,e)}var Xo=g("ZodE164",(e,r)=>{hc.init(e,r),H.init(e,r)});function vg(e){return yo(Xo,e)}var Xl=g("ZodCreditCard",(e,r)=>{vc.init(e,r),H.init(e,r)});function bg(e){return hu(Xl,e)}var Yl=g("ZodIBAN",(e,r)=>{bc.init(e,r),H.init(e,r)});function yg(e){return vu(Yl,e)}var Yo=g("ZodJWT",(e,r)=>{yc.init(e,r),H.init(e,r)});function _g(e){return _o(Yo,e)}var Zt=g("ZodCustomStringFormat",(e,r)=>{_c.init(e,r),H.init(e,r)});function $g(e,r,i={}){return Ct(Zt,e,r,i)}function kg(e){return Ct(Zt,"hostname",ss,e)}function wg(e){return Ct(Zt,"hex",ks,e)}function xg(e){return Ct(Zt,"currency_code",ls,e)}function Sg(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=Ce[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Ct(Zt,o,t,r)}var Sr=g("ZodNumber",(e,r)=>{Ni.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>tl(e,i,o,t),e.isFinite=!0},y.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=oe(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=oe(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=oe(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>oe(e).format??null},{gt(e,r){return this.check(Be(e,r))},gte(e,r){return this.check(Ae(e,r))},min(e,r){return this.check(Ae(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(je(e,r))},max(e,r){return this.check(je(e,r))},int(e){return this.check(Do(e))},safe(e){return this.check(Do(e))},positive(e){return this.check(Be(0,e))},nonnegative(e){return this.check(Ae(0,e))},negative(e){return this.check(Fe(0,e))},nonpositive(e){return this.check(je(0,e))},multipleOf(e,r){return this.check(ut(e,r))},step(e,r){return this.check(ut(e,r))},finite(){return this}}));function Ql(e){return yu(Sr,e)}var Lt=g("ZodNumberFormat",(e,r)=>{$c.init(e,r),Sr.init(e,r)});function Do(e){return $u(Lt,e)}function Ig(e){return ku(Lt,e)}function zg(e){return wu(Lt,e)}function Pg(e){return xu(Lt,e)}function Og(e){return Su(Lt,e)}var Ir=g("ZodBoolean",(e,r)=>{un.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rl(e,i,o,t)});function ed(e){return Iu(Ir,e)}var zr=g("ZodBigInt",(e,r)=>{Ci.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>nl(e,i,o,t)},y.derived({minValue:e=>oe(e).minimum??null,maxValue:e=>oe(e).maximum??null,format:e=>oe(e).format??null},{gte(e,r){return this.check(Ae(e,r))},min(e,r){return this.check(Ae(e,r))},gt(e,r){return this.check(Be(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(je(e,r))},max(e,r){return this.check(je(e,r))},positive(e){return this.check(Be(BigInt(0),e))},negative(e){return this.check(Fe(BigInt(0),e))},nonpositive(e){return this.check(je(BigInt(0),e))},nonnegative(e){return this.check(Ae(BigInt(0),e))},multipleOf(e,r){return this.check(ut(e,r))}}));function jg(e){return Pu(zr,e)}var Qo=g("ZodBigIntFormat",(e,r)=>{kc.init(e,r),zr.init(e,r)});function Ag(e){return ju(Qo,e)}function Tg(e){return Au(Qo,e)}var td=g("ZodSymbol",(e,r)=>{wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>il(e,i,o,t)});function Dg(e){return Tu(td,e)}var rd=g("ZodUndefined",(e,r)=>{xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>al(e,i,o,t)});function Ng(e){return Du(rd,e)}var nd=g("ZodNull",(e,r)=>{Sc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ol(e,i,o,t)});function id(e){return Nu(nd,e)}var od=g("ZodAny",(e,r)=>{Ic.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ul(e,i,o,t)});function Cg(){return Cu(od)}var ad=g("ZodUnknown",(e,r)=>{zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ll(e,i,o,t)});function Ut(){return Uu(ad)}var sd=g("ZodNever",(e,r)=>{Pc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cl(e,i,o,t)});function ea(e){return Eu(sd,e)}var cd=g("ZodVoid",(e,r)=>{Oc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>sl(e,i,o,t)});function Ug(e){return Ru(cd,e)}var Pn=g("ZodDate",(e,r)=>{jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>dl(e,i,o,t),e.min=(i,o)=>e.check(Ae(i,o)),e.max=(i,o)=>e.check(je(i,o))},y.derived({minDate:e=>{let{minimum:r}=oe(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=oe(e);return r?new Date(r):null}},{}));function Eg(e){return Zu(Pn,e)}var ud=g("ZodArray",(e,r)=>{Rt(),Ac.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>wl(e,i,o,t),e.element=r.element},{min(e,r){return this.check(Qe(e,r))},nonempty(e){return this.check(Qe(1,e))},max(e,r){return this.check(Dt(e,r))},length(e,r){return this.check(Nt(e,r))},unwrap(){return this.element}});function On(e,r){return Vu(ud,e,r)}function Rg(e){let r=e._zod.def.shape;return ta(Object.keys(r))}var jn=g("ZodObject",(e,r)=>{Rt(),Tc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>xl(e,i,o,t),y.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return ta(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},loose(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},strict(){return this.clone(y.mergeDefs(this._zod.def,{catchall:ea()}))},strip(){return this.clone(y.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return y.extend(this,e)},safeExtend(e){return y.safeExtend(this,e)},merge(e){return y.merge(this,e)},pick(e){return y.pick(this,e)},omit(e){return y.omit(this,e)},partial(...e){return y.partial(Tn,this,e[0])},exactPartial(...e){return y.partial(na,this,e[0],"exactPartial")},required(...e){return y.required(ia,this,e[0])}});function Zg(e,r){let i={type:"object",shape:e??{},...y.normalizeParams(r)};return new jn(i)}function Lg(e,r){return new jn({type:"object",shape:e,catchall:ea(),...y.normalizeParams(r)})}function Mg(e,r){return new jn({type:"object",shape:e,catchall:Ut(),...y.normalizeParams(r)})}var An=g("ZodUnion",(e,r)=>{ln.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Pr(e,r){return new An({type:"union",options:e,...y.normalizeParams(r)})}var ld=g("ZodXor",(e,r)=>{An.init(e,r),Dc.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Vg(e,r){return new ld({type:"union",options:e,inclusive:!1,...y.normalizeParams(r)})}var dd=g("ZodDiscriminatedUnion",(e,r)=>{An.init(e,r),Cc.init(e,r)});function Fg(e,r,i){return new dd({type:"union",options:r,discriminator:e,...y.normalizeParams(i)})}var pd=g("ZodIntersection",(e,r)=>{Uc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Sl(e,i,o,t)});function md(e,r){return new pd({type:"intersection",left:e,right:r})}var fd=g("ZodTuple",(e,r)=>{Rt(),Ui.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Il(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Tn({type:"optional",innerType:r}))})}});function gd(e,r,i){let o=r instanceof U,t=o?i:r,n=o?r:null;return new fd({type:"tuple",items:e,rest:n,...y.normalizeParams(t)})}var kr=g("ZodRecord",(e,r)=>{Rt(),Ec.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zl(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function hd(e,r,i){return!r||!r._zod?new kr({type:"record",keyType:Sn(),valueType:e,...y.normalizeParams(r)}):new kr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i)})}function Bg(e,r,i){return new kr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i),partial:!0})}function Kg(e,r,i){return new kr({type:"record",keyType:e,valueType:r,mode:"loose",...y.normalizeParams(i)})}var vd=g("ZodMap",(e,r)=>{Rt(),Rc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(Ke(...i)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Gg(e,r,i){return new vd({type:"map",keyType:e,valueType:r,...y.normalizeParams(i)})}var bd=g("ZodSet",(e,r)=>{Rt(),Zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>kl(e,i,o,t),e.min=(...i)=>e.check(Ke(...i)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Jg(e,r){return new bd({type:"set",valueType:e,...y.normalizeParams(r)})}var wr=g("ZodEnum",(e,r)=>{Lc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(o,t,n)=>pl(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new wr({...r,checks:[],...y.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new wr({...r,checks:[],...y.normalizeParams(t),entries:n})}});function ta(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new wr({type:"enum",entries:i,...y.normalizeParams(r)})}function Wg(e,r){return new wr({type:"enum",entries:e,...y.normalizeParams(r)})}var yd=g("ZodLiteral",(e,r)=>{Mc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ml(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function qg(e,r){return new yd({type:"literal",values:Array.isArray(e)?e:[e],...y.normalizeParams(r)})}var _d=g("ZodFile",(e,r)=>{Vc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.min=(i,o)=>e.check(Ke(i,o)),e.max=(i,o)=>e.check(lt(i,o)),e.mime=(i,o)=>e.check(mr(Array.isArray(i)?i:[i],o))});function Hg(e){return Fu(_d,e)}var $d=g("ZodTransform",(e,r)=>{Rt(),Fc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>_l(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ct(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push(y.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push(y.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function ra(e){return new $d({type:"transform",transform:e})}var Tn=g("ZodOptional",(e,r)=>{Ei.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Et(e){return new Tn({type:"optional",innerType:e})}var na=g("ZodExactOptional",(e,r)=>{Bc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function kd(e){return new na({type:"optional",innerType:e})}var wd=g("ZodNullable",(e,r)=>{Kc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function In(e){return new wd({type:"nullable",innerType:e})}function Xg(e){return Et(In(e))}var xd=g("ZodDefault",(e,r)=>{Gc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Al(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sd(e,r){return new xd({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var Id=g("ZodPrefault",(e,r)=>{Jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zd(e,r){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var ia=g("ZodNonOptional",(e,r)=>{Wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ol(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Pd(e,r){return new ia({type:"nonoptional",innerType:e,...y.normalizeParams(r)})}var Od=g("ZodSuccess",(e,r)=>{qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Yg(e){return new Od({type:"success",innerType:e})}var jd=g("ZodCatch",(e,r)=>{Hc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ad(e,r){return new jd({type:"catch",innerType:e,catchValue:typeof r=="function"?r:y.constantCatch(r)})}var Td=g("ZodNaN",(e,r)=>{Xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>fl(e,i,o,t)});function Qg(e){return Mu(Td,e)}var Dn=g("ZodPipe",(e,r)=>{Ri.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nl(e,i,o,t),e.in=r.in,e.out=r.out});function No(e,r){return new Dn({type:"pipe",in:e,out:r})}var Nn=g("ZodCodec",(e,r)=>{Dn.init(e,r),dn.init(e,r)});function eh(e,r,i){return new Nn({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function th(e){let r=e._zod.def;return new Nn({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var Dd=g("ZodPreprocess",(e,r)=>{Dn.init(e,r),Yc.init(e,r)}),Nd=g("ZodReadonly",(e,r)=>{Qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Cd(e){return new Nd({type:"readonly",innerType:e})}var Ud=g("ZodTemplateLiteral",(e,r)=>{eu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t)});function rh(e,r){return new Ud({type:"template_literal",parts:e,...y.normalizeParams(r)})}var Ed=g("ZodLazy",(e,r)=>{pn.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>El(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function Rd(e){return new Ed({type:"lazy",getter:e})}var Zd=g("ZodPromise",(e,r)=>{ru.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ul(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function nh(e){return new Zd({type:"promise",innerType:e})}var Ld=g("ZodFunction",(e,r)=>{tu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t)});function ih(e){return new Ld({type:"function",input:Array.isArray(e?.input)?gd(e?.input):e?.input??On(Ut()),output:e?.output??Ut()})}var Cn=g("ZodCustom",(e,r)=>{nu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t)});function oh(e){let r=new X({check:"custom"});return r._zod.check=e,r}function ah(e,r){return Bu(Cn,e??(()=>!0),r)}function Md(e,r={}){return Ku(Cn,e,r)}function Vd(e,r){return Gu(e,r)}var sh=Ju,ch=Wu,Fd=g("ZodInstanceOf",(e,r)=>{Cn.init(e,r)},{properties(e,r){return this.check(pr(e,r))}});function uh(e,r={}){let i=new Fd({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...y.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var lh=(...e)=>qu({Codec:Nn,Boolean:Ir,String:xr},...e);function dh(e){let r=Rd(()=>Pr([Sn(e),Ql(),ed(),id(),On(r),hd(Sn(),r)]));return r}function ph(e,r){return new Dd({type:"pipe",in:ra(e),out:r})}var Wk={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function qk(e){re({customError:e})}function Hk(){return re().customError}var Bd;Bd||(Bd={});var Un={};qe(Un,{ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,date:()=>Yk,datetime:()=>Xk,duration:()=>ew,time:()=>Qk});function Xk(e){return yn(ft,e)}function Yk(e){return _n(gt,e)}function Qk(e){return $n(ht,e)}function ew(e){return kn(vt,e)}var z={...Or,...Ao,iso:Un},tw=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function rw(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function mh(e,r){return e.map((i,o)=>o<r?i:i.optional())}function nw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function iw(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:nw(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function ow(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let c=r.keySchema.safeParse(a);c.success||o.issues.push({code:"invalid_key",origin:"record",issues:c.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function Kd(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let c=Kd(a,r);if(c===null)return null;n.push(c)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=Kd(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var aw=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),sw=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function En(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(En):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>aw.has(r)?En(i):!sw.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(En))}function fh(e){return e===1?"element":"elements"}function cw(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let c=Kd(t[a],new Set);if(c===null)continue;let u=n.get(c);if(u===void 0){n.set(c,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${u}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,c=0;for(let u of t)if(r.containsSchema.safeParse(u).success&&++c>=a)break;c<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${fh(n)}; found ${c}`,input:t,continue:!0}),r.maxContains!==void 0&&c>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${fh(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function gh(e,r){if(e!==!1)return e===void 0||e===!0?z.any():_e(e,r)}var uw=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function hh(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return z.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=iw(t,r),a=_e(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return z.null();if(t.length===0)return z.never();if(t.length===1)return z.literal(t[0]);if(t.every(a=>typeof a=="string"))return z.enum(t);let n=t.map(a=>z.literal(a));return n.length<2?n[0]:z.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return z.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return hh(a,r)});return t.length===0?z.never():t.length===1?t[0]:z.union(t)}if(!i)return z.any();let o;switch(i){case"string":{let t=z.string();if(e.format){let n=e.format;n==="email"?t=t.check(z.email()):n==="uri"||n==="uri-reference"?t=t.check(z.url()):n==="uuid"||n==="guid"?t=t.check(z.uuid()):n==="date-time"?t=t.check(z.iso.datetime({offset:!0})):n==="date"?t=t.check(z.iso.date()):n==="time"?t=t.check(z.regex(uw)):n==="duration"?t=t.check(z.iso.duration()):n==="hostname"?t=t.check(z.hostname()):n==="ipv4"?t=t.check(z.ipv4()):n==="ipv6"?t=t.check(z.ipv6()):n==="mac"?t=t.check(z.mac()):n==="cidr"?t=t.check(z.cidrv4()):n==="cidr-v6"?t=t.check(z.cidrv6()):n==="base64"?t=t.check(z.base64()):n==="base64url"?t=t.check(z.base64url()):n==="e164"?t=t.check(z.e164()):n==="credit_card"?t=t.check(z.creditCard()):n==="iban"?t=t.check(z.iban()):n==="jwt"?t=t.check(z.jwt()):n==="emoji"?t=t.check(z.emoji()):n==="nanoid"?t=t.check(z.nanoid()):n==="cuid"?t=t.check(z.cuid()):n==="cuid2"?t=t.check(z.cuid2()):n==="ulid"?t=t.check(z.ulid()):n==="xid"?t=t.check(z.xid()):n==="ksuid"&&(t=t.check(z.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?z.number().int():z.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=z.boolean();break}case"null":{o=z.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?_e(e.additionalProperties,r):void 0;for(let[p,m]of Object.entries(n)){let f=_e(m,r);ue(t,p,a.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let k of m){let x=_e(p[k],r),j=z.string().regex(new RegExp(k));f.push(z.looseRecord(j,x))}let v=[];if(Object.keys(t).length>0&&v.push(z.object(t).passthrough()),v.push(...f),v.length===0)o=z.object({}).passthrough();else if(v.length===1)o=v[0];else{let k=z.intersection(v[0],v[1]);for(let x=2;x<v.length;x++)k=z.intersection(k,v[x]);o=k}if(e.additionalProperties===!1){let k=Object.keys(t),x=m.map(P=>new RegExp(P)),j=o;o=o.check(P=>{if(!De(P.value))return;let D=[];for(let L of Object.keys(P.value))k.includes(L)||x.some(q=>q.test(L))||D.push(L);D.length&&P.issues.push({code:"unrecognized_keys",keys:D,input:P.value,inst:j})})}}else{let p=z.object(t);e.additionalProperties===!1?o=p.strict():c?o=p.catchall(c):o=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||l!==void 0||d!==void 0){let p;if(u){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=_e(m,r)}o=ow(o,{keySchema:p,minProperties:l,maxProperties:d})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,c=t.map(p=>_e(p,r)),u=mh(c,a),l=Array.isArray(n)?void 0:gh(n,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,c=n.map(p=>_e(p,r)),u=mh(c,a),l=gh(e.additionalItems,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(n!==void 0){let a=_e(n,r),c=z.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=z.array(z.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=cw(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?_e(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function _e(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i=hh(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>_e(l,r)),u=z.union(c);i=o?z.intersection(i,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>_e(l,r)),u=z.xor(c);i=o?z.intersection(i,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:z.any();else{let c=o?i:_e(e.allOf[0],r),u=o?0:1;for(let l=u;l<e.allOf.length;l++)c=z.intersection(c,_e(e.allOf[l],r));i=c}e.nullable===!0&&r.version==="openapi-3.0"&&(i=z.nullable(i)),e.readOnly===!0&&(i=z.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of n)c in e&&(t[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(t[c]=e[c]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!En(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let c of["minProperties","maxProperties"])e[c]!==void 0&&(t[c]=e[c])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!En(e.contains)&&(t.contains=e.contains);for(let c of["uniqueItems","minContains","maxContains"])e[c]!==void 0&&(t[c]=e[c])}for(let c of Object.keys(e))tw.has(c)||ue(t,c,e[c]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function vh(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=rw(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??le};return _e(i,n)}var bh=Symbol("z.visit/resolving");function Rn(e,r){let i=typeof r=="function"?r:(a,c)=>{let u=r[a._zod.def.type];return u?u(a,c):a},o=new Map;function t(a){let c=o.get(a);if(c===bh)return new pn({type:"lazy",getter:()=>o.get(a)});if(c!==void 0)return c;o.set(a,bh);let u=n(a),l=i(u,u!==a);return o.set(a,l),l}function n(a){let c=a._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,d=Object.keys(l),p=!1,m={};for(let v of d){let k=t(l[v]);k!==l[v]&&(p=!0),m[v]=k}let f=c.catchall;return c.catchall&&(f=t(c.catchall),f!==c.catchall&&(p=!0)),p?G(a,{...c,shape:m,catchall:f}):a}case"array":{let l=t(c.element);return l===c.element?a:G(a,{...c,element:l})}case"tuple":{let l=c.items,d=!1,p=[];for(let f of l){let v=t(f);v!==f&&(d=!0),p.push(v)}let m=c.rest;return c.rest&&(m=t(c.rest),m!==c.rest&&(d=!0)),d?G(a,{...c,items:p,rest:m}):a}case"record":case"map":{let l=t(c.keyType),d=t(c.valueType);return l===c.keyType&&d===c.valueType?a:G(a,{...c,keyType:l,valueType:d})}case"set":{let l=t(c.valueType);return l===c.valueType?a:G(a,{...c,valueType:l})}case"union":{let l=c.options,d=!1,p=[];for(let m of l){let f=t(m);f!==m&&(d=!0),p.push(f)}return d?G(a,{...c,options:p}):a}case"intersection":{let l=t(c.left),d=t(c.right);return l===c.left&&d===c.right?a:G(a,{...c,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=t(c.innerType);return l===c.innerType?a:G(a,{...c,innerType:l})}case"pipe":{let l=t(c.in),d=t(c.out);return l===c.in&&d===c.out?a:G(a,{...c,in:l,out:d})}case"function":{let l=t(c.input),d=t(c.output);return l===c.input&&d===c.output?a:G(a,{...c,input:l,output:d})}case"lazy":{let l=c.getter,{_cachedInner:d,...p}=c;return G(a,{...p,getter:()=>t(l())})}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":return a;default:return a}}return t(e)}function yh(e){return Rn(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Pr(i.options)}})}function lw(e,r){if(!r?.length)return e;let i=e._zod.def;return G(e,Ee(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function _h(e){return lw(e.out,e.checks)}function dw(e){return e.in._zod.traits.has("$ZodTransform")?_h(e):e.in}function $h(e){return Rn(e,{pipe:r=>dw(r._zod.def),default:(r,i)=>i?Et(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function kh(e){return Rn(e,{pipe:r=>_h(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var Gd={};qe(Gd,{bigint:()=>gw,boolean:()=>fw,date:()=>hw,number:()=>mw,string:()=>pw});function pw(e){return fu(xr,e)}function mw(e){return _u(Sr,e)}function fw(e){return zu(Ir,e)}function gw(e){return Ou(zr,e)}function hw(e){return Lu(Pn,e)}var Mt=class extends Error{code;detail;constructor(r,i,o={}){super(i),this.code=r,this.detail=o}};var vw=["bad_request","not_found","plan_required","method_not_allowed","gone","rate_limited","internal"],PO=s.object({error:s.object({code:s.enum(vw),message:s.string(),param:s.string().optional().describe("The input the error is about"),allowed:s.array(s.string()).optional().describe("Values the input takes"),nearest:s.array(s.string()).optional().describe("Known values closest to the one given"),need:s.enum(["free","plus"]).optional().describe("plan_required: the plan that opens it"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")})});var oa=(e,r="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${r} ${e[e.length-1]}`;var Jd={name:"$.name",description:"$.summary",icon:"$.media.icons[0].url",category:"$.taxonomy",publisher:"$.publisher.name",url:"$.publisher.url",release:"$.release.version",reviewed_commit:"$.source.repository.reviewed_commit"},wh={name:"$.displayName",description:"$.description",icon:"$.logoUrl",category:"$.curatedCategoryKeys",publisher:"$.publisher.displayName",url:"$.repositoryUrl",release:"$.gitRef"},xh={name:"$.name",description:"$.description",icon:"$.logo",publisher:"$.author",url:"$.authorUrl"},sa={"chatgpt:app":{label:["App","apps"],form:"integration",tag:"kind-chatgpt-app",paths:{name:"$.display_name",description:"$.short_description",icon:"$.icon_url",keywords:"$.keywords"}},"claude:connector":{label:["Connector","connectors"],form:"integration",tag:"kind-claude-connector",paths:Jd},"claude:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-claude-plugin",paths:Jd},"claude:desktop_extension":{label:["Desktop extension","desktop extensions"],form:"integration",tag:"kind-claude-extension",paths:Jd},"cursor:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-cursor-plugin",paths:wh},"cursor:directory_plugin":{label:["Rule","rules"],form:"parts",tag:"kind-rule",hidden:!0,paths:xh},"cursor:directory_mcp":{label:["MCP server","MCP servers"],form:"integration",tag:"kind-mcp-server",paths:xh},"grokbot:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-grokbot-plugin",paths:wh},"grokbot:bot":{label:["Bot","bots"],form:"agent",tag:"kind-grokbot-bot",hidden:!0,late:!0,charts:"grokbot:bots:",paths:{name:"$.name",description:"$.description",icon:"$.imageUrl",category:"$.categories",publisher:"$.creatorName",release:"$.updatedAt"}},"perplexity:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.display_name",description:"$.description",icon:"$.icon_url",category:"$.display_categories",publisher:"$.source_details.developer",url:"$.source_details.website_url"}},"muse:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon",category:"$.categories",url:"$.links.terms"}},"muse:unlisted":{label:["Unlisted connector","unlisted connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon"}}},Zn=Object.entries(sa),ca=e=>e.slice(e.indexOf(":")+1),Q=[...new Set(Zn.map(([e])=>ca(e)))],Sh=(e,r)=>sa[`${e}:${r??""}`],aa={directory_rule:"directory_plugin","cursor:directory_rule":"cursor:directory_plugin"},Ih=e=>typeof e=="string"&&Object.hasOwn(aa,e)?aa[e]:e,zh=e=>Zn.filter(([r])=>r.startsWith(`${e}:`)).map(([r])=>ca(r)),Ph=e=>Zn.filter(([,r])=>r[e]).map(([r])=>ca(r)),bw=new Set(Ph("hidden").flatMap(e=>[e,...Object.keys(aa).filter(r=>aa[r]===e)])),CO=Ph("late"),UO=Zn.flatMap(([,e])=>e.hidden&&e.charts?[e.charts]:[]);var EO=new Map(Zn.map(([e,r])=>[ca(e),r.label]));var A=["chatgpt","claude","cursor","grokbot","perplexity","muse"],Oh={chatgpt:"ChatGPT",claude:"Claude",cursor:"Cursor",grokbot:"Grok Bot",perplexity:"Perplexity",muse:"Muse"},Ln=e=>typeof e=="string"&&A.includes(e),yw=["chatgpt","claude","cursor","grokbot","perplexity","muse"];var MO=oa(yw.map(e=>Oh[e]));var VO=new Intl.DisplayNames(["en"],{type:"region"});var jh=["anon","account","agent","render"],_w={crawl:{pool:"anon",schedule:"sweep-per-region",run:{store:"chatgpt",region:"job"},settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},details:{pool:"anon",schedule:"with-primary-crawl",run:null,settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},claude:{pool:"anon",schedule:"sweep",run:{store:"claude",region:"global"},settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"global"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor_directory:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"directory"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"clearance",relays:["us","de"]}},grokbot:{pool:"anon",schedule:"sweep",run:{store:"grokbot",region:"global"},settles:["grokbot"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},perplexity:{pool:"anon",schedule:"sweep",run:{store:"perplexity",region:"global"},settles:["perplexity"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},muse:{pool:"anon",schedule:"sweep",run:{store:"muse",region:"global"},settles:["muse"],concurrency:"one-per-pool",lease:20,exit:{via:"region"}},github:{pool:"anon",schedule:"sweep",run:null,settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},mcp:{pool:"anon",schedule:"sweep",run:null,settles:A,concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},chatgpt_connectors:{pool:"account",schedule:"sweep-with-account",run:null,settles:["chatgpt"],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}},search_chatgpt:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"region"}},search_claude:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"direct"}},widget_shots:{pool:"render",schedule:"hourly",run:null,settles:[],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}}},Wd=Object.keys(_w),Ah=e=>Wd.includes(e);var Th=24;var FO=(Th+3)*36e5;var jr=["open","auth","blocked","dead","error"];var Dh=["active","challenged","disabled"];var Nh=["out","free","plus"];var $w={compare:"Compare","rank-history":"Rank history","listing-changelog":"Change history","live-clock":"Launch lag"},JO=oa(Object.values($w));var Mn={out:{rows:200,countries:"us",movers:{perChart:20,perStore:20},publishers:50,explorerRows:3,tagRows:200,changesTopRank:100,compareApps:0,rankHistoryApps:0,history:{ranks:30,featured:7,movers:7,launches:30,changes:7,pulse:7},api:{perMinute:60,rowsPerDay:3e5}},free:{rows:1e3,countries:"all",movers:{perChart:100,perStore:1/0},publishers:500,explorerRows:100,tagRows:1e3,changesTopRank:1/0,compareApps:0,rankHistoryApps:0,history:{ranks:30,featured:30,movers:30,launches:30,changes:30,pulse:30},api:{perMinute:600,rowsPerDay:6e5}},plus:{rows:1/0,countries:"all",movers:{perChart:1/0,perStore:1/0},publishers:1/0,explorerRows:1/0,tagRows:1/0,changesTopRank:1/0,compareApps:5,rankHistoryApps:10,history:{ranks:1/0,featured:1/0,movers:1/0,launches:1/0,changes:1/0,pulse:1/0},api:{perMinute:600,rowsPerDay:12e5}}};var tt=s.enum(A),V=s.string().nullish(),$e=s.string(),Dr=e=>s.preprocess(Ih,e),Ch=s.object({p:s.string(),k:Dr(s.enum(Q)).nullish(),c:V,f:V,l:V,n:V,d:V,i:V,pub:V,v:V,r:V}),kw=["home","category","top","new"],ww=s.object({slug:s.string(),kind:s.enum(kw),title:s.string(),description:V,items:s.array(Ch)}),xw=s.object({store:tt,region:s.string(),relay:V,egress_country:V,started_at:$e,finished_at:$e,requests:s.number().int(),catalog_complete:s.boolean().optional()}),Uh=s.object({p:s.string(),h:s.string(),d:s.string()}),Sw=s.object({p:s.string(),h:s.string()}),Iw=s.object({store:tt,at:$e,details:s.array(Uh),missing:s.array(s.string()).default([])}),zw=s.object({p:s.string(),n:s.string(),v:s.number(),t:s.string().optional()}),Pw=s.object({store:tt,at:$e,metrics:s.array(zw)}),Ow=s.object({s:tt,p:s.string(),url:s.string()}),jw=s.object({hash:s.string(),server_name:V,server_version:V,protocol_version:V,tools:s.array(s.unknown()),prompts:s.array(s.unknown()).nullish(),resources:s.array(s.unknown()).nullish()}),Aw=["streamable-http","sse"],Tw=s.object({url:s.string(),transport:s.enum(Aw).nullish(),status:s.enum(jr),auth_hint:V,error:V,snapshot:jw.optional()}),Dw=s.object({at:$e,links:s.array(Ow).default([]),probes:s.array(Tw).default([])});var Nw=s.object({url:s.string(),uri:s.string(),hash:s.string(),mime:V,meta:s.record(s.string(),s.unknown()).nullish(),html:V,bytes:s.number().int().nonnegative()}),Cw=s.object({at:$e,templates:s.array(Nw)});var Uw={light:{theme:"light",width:720},dark:{theme:"dark",width:720},mobile:{theme:"light",width:390}},Ew=["content","blank","loading","empty","failed"],Rw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),uri:s.string(),mime:V,input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),Zw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),variant:s.enum(Object.keys(Uw)),outcome:s.enum(Ew),width:s.number().int().nonnegative(),height:s.number().int().nonnegative(),png:V,detail:V}),Lw=s.object({at:$e,renderer:s.string(),shots:s.array(Zw)}),Mw=50,Vw=s.object({q:s.string().min(1).max(100),ids:s.array(s.string()).max(Mw)}),Fw=s.object({store:tt,region:s.string(),at:$e,results:s.array(Vw)}),Bw=s.object({p:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string(),version:s.string().nullable()}).nullable()}),Kw=s.object({p:s.string(),n:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string()}).nullable()}),Gw=s.object({at:$e,connectors:s.array(Bw).default([]),skills:s.array(Kw).default([])}),Jw=s.object({state:s.literal("challenged"),until:$e,error:s.string()}),Ww=s.object({store:tt,kind:Dr(s.enum(Q)).nullish(),categories:s.array(s.string()).default([]),text:s.string().default("")}),YO=s.object({id:s.number().int(),name:s.string(),listings:s.array(Ww)}),QO=s.object({version:s.string(),domains:s.array(s.object({id:s.string(),uses:s.array(s.string())})),audiences:s.array(s.string()),synonyms:s.record(s.string(),s.string()).default({})}),Hd=s.object({id:s.number().int(),store:tt,kind:Dr(s.enum(Q)).nullish(),name:V,publisher:V,publisher_key:V,website:V,repo:V,source:V,servers:s.array(s.string()).default([]),description:s.string().default("")}),ej=s.object({id:s.number().int(),app:s.string().nullable(),listings:s.array(Hd),scouted:s.literal(!0).optional()}),qw=["wrapper","third_party","sub_product","same_maker","unrelated"],tj=s.object({verdict:s.enum(["same","not_same","unsure"]),outliers:s.array(s.object({id:s.number().int(),relation:s.enum(qw),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),Hw=Hd.extend({app:s.string().nullable(),via:s.array(s.string())}),rj=s.object({listing:Hd,suggestions:s.array(Hw)}),Xw=["same","sub_product","same_maker","wrapper","third_party"],Yw=["agency_studio","startup","indie","smb","midmarket","enterprise","platform","unknown"],Qw=["solo","2-10","11-50","51-200","201+","unknown"],ex=["bootstrapped","vc_funded","public_or_large","unknown"],tx=["high","medium","low"],nj=s.object({website:s.string(),email:s.string(),linkedin:s.string(),x:s.string(),contact_name:s.string(),confidence:s.enum(tx),sources:s.array(s.string()).max(5),notes:s.string(),segment:s.enum(Yw),segment_why:s.string(),size:s.enum(Qw),funding:s.enum(ex)}),ij=s.object({related:s.array(s.object({id:s.number().int(),relation:s.enum(Xw),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),rx=s.object({server:s.number().int(),app:s.string(),tool:s.string(),title:V,description:V,params:s.unknown(),returns:s.unknown(),widget:V,template:s.string(),excerpt:V,views:s.record(s.string(),s.array(s.string())).default({}),about:V,publisher:V,prompts:s.array(s.string()).default([]),domain:V}),oj=rx.extend({profile:s.string()}),aj=s.object({input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),sj=s.object({domain:s.string(),secondary_domain:s.string().nullable(),uses:s.array(s.string()),audiences:s.array(s.string()),suggested:s.string().nullable(),confidence:s.number().min(0).max(1)}),cj=s.object({kind:s.enum(Wd).exclude(["crawl"])}),nx=["ok","blocked","challenged","error"],ix=s.object({t:$e,relay:s.string().nullable(),provider:s.string().nullable(),outcome:s.enum(nx),status:s.number().int().nullable(),error:s.string().nullable()}),ze=s.object({lease_token:s.string(),lease_expires_at:s.string(),id:s.number().int(),region:s.string().nullable(),priority:s.number().int(),attempts:s.number().int(),error:s.string().nullable(),created_at:$e,not_before:$e,claimed_at:s.string().nullable()}),Vt={versions:s.record(s.string(),s.string()).default({})},qd={undetailed:s.array(s.string()).default([])},ox=s.discriminatedUnion("kind",[ze.extend({kind:s.literal("crawl"),region:s.string(),...Vt,...qd}),ze.extend({kind:s.literal("details"),plugin_ids:s.array(s.string())}),ze.extend({kind:s.literal("claude"),...Vt,...qd}),ze.extend({kind:s.literal("cursor"),known_refs:s.record(s.string(),s.string()),...Vt}),ze.extend({kind:s.literal("grokbot"),known_refs:s.record(s.string(),s.string()),...Vt,...qd}),ze.extend({kind:s.literal("cursor_directory"),detail_ids:s.array(s.string()),...Vt}),ze.extend({kind:s.literal("perplexity"),detail_ids:s.array(s.string()),...Vt}),ze.extend({kind:s.literal("muse"),...Vt}),ze.extend({kind:s.literal("github"),backfill_installs:s.boolean()}),ze.extend({kind:s.literal("mcp"),servers:s.array(s.object({id:s.number().int(),url:s.string(),known:s.array(s.string()).default([]),uris:s.array(s.string()).default([])}))}),ze.extend({kind:s.literal("chatgpt_connectors"),account:s.object({id:s.number().int(),label:s.string()}),connectors:s.array(s.object({p:s.string(),c:s.string(),release:s.string().nullable()})),skills:s.array(s.object({p:s.string(),n:s.string(),release:s.string().nullable()}))}),ze.extend({kind:s.literal("search_chatgpt"),queries:s.array(s.string())}),ze.extend({kind:s.literal("search_claude"),queries:s.array(s.string())}),ze.extend({kind:s.literal("widget_shots"),renderer:s.string(),templates:s.record(s.string(),s.string()),subjects:s.array(Rw)})]),uj=s.object({protocol:s.literal("attempt-v1"),pool:s.enum(jh).default("anon"),kinds:s.array(s.string()).transform(e=>e.filter(Ah)).optional()}),lj=s.object({protocol:s.literal("attempt-v1").optional(),job:ox.nullable(),retry_at:s.string().nullable()});var Eh=800,Ar=s.string().min(1).max(200),Tr=s.number().int().nonnegative(),ax=s.object({job:s.number().int(),lease_token:Ar,request_id:Ar}),de={attempt:ax},dj=s.object({...de,store:tt,at:$e,listings:s.array(Uh),seen:s.array(Sw).default([])}),pj=Iw.extend(de),mj=Pw.extend(de),fj=Dw.extend(de),gj=Cw.extend(de),hj=Lw.extend(de),vj=Fw.extend(de),bj=Gw.extend(de),yj=s.object({...de,account:s.number().int(),report:Jw}),_j=s.object({...de,tries:s.array(ix)}),$j=s.object(de),kj=s.object({...de,error:s.string()}),wj=s.object(de),sx=ww.omit({items:!0}).extend({item_parts:Tr,item_count:Tr}),xj=s.object({...de,publication_id:Ar,run:xw,app_parts:Tr,apps_count:Tr,charts:s.array(sx).max(500)}).superRefine((e,r)=>{e.app_parts===0!=(e.apps_count===0)&&r.addIssue({code:"custom",message:"app parts and count disagree"}),new Set(e.charts.map(i=>i.slug)).size!==e.charts.length&&r.addIssue({code:"custom",message:"duplicate chart slug"});for(let i of e.charts)i.item_parts===0!=(i.item_count===0)&&r.addIssue({code:"custom",message:"chart parts and count disagree"})}),Sj=s.object({...de,publication_id:Ar,part:Tr,apps:s.array(Ch).min(1).max(Eh)}),Ij=s.object({...de,publication_id:Ar,slug:s.string(),part:Tr,plugin_ids:s.array(s.string()).min(1).max(Eh)}),zj=s.object({...de,publication_id:Ar}),Pj=s.discriminatedUnion("action",[s.object({action:s.literal("add"),label:s.string().min(1).max(100)}),s.object({action:s.literal("disable"),label:s.string().min(1)}),s.object({action:s.literal("list")})]),Oj=s.object({label:s.string(),store:tt,status:s.enum(Dh),paused_until:s.string().nullable(),last_used_at:s.string().nullable(),last_error:s.string().nullable(),created_at:$e});var Rh=["bug","wrong_data","missing_capability","confusing","other"],Zh=["user","model"],Lh=["app","listing","binding","publisher","tag","chart","server"];var Nr={summary:200,details:4e3,tool:64,subject_id:200,request_id:64};var cx=["apps","connectors","plugins","extensions","mcp","rules"],ux=e=>cx.includes(e),lx=e=>e.length<=100&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e);function Mh(e){let[,r,i,o,...t]=e.split("/");return t.length||!o||!lx(o)?null:(r==="chatgpt"||r==="claude")&&i&&ux(i)?{store:r,slug:o}:null}var dx={chatgpt:"category:featured",claude:"claude:popularity",cursor:"cursor:directory:top",grokbot:"grokbot:popular",perplexity:"perplexity:popular",muse:"muse:all"},Uj={...dx,muse:"muse:featured"};var Fh=(e,r)=>`${e}:${r}`,Vh=[[/(^|\.)chatgpt\.com$/,"chatgpt"],[/(^|\.)claude\.(ai|com)$/,"claude"],[/(^|\.)cursor\.(com|sh)$/,"cursor"]];function bt(e){let r=e.trim(),i=r.indexOf(":");if(i>0&&Ln(r.slice(0,i)))return{store:r.slice(0,i),plugin_id:r.slice(i+1)};let o;try{o=new URL(r)}catch{return{store:null,plugin_id:r}}let t=Vh.some(([c])=>c.test(o.hostname))?null:Mh(o.pathname);if(t)return{store:t.store,plugin_id:t.slug};let n=/^#?\/app\/(?:([a-z]+)\/)?([^/?]+)/.exec(o.hash||o.pathname);if(n)return{store:Ln(n[1])?n[1]:"chatgpt",plugin_id:decodeURIComponent(n[2])};let a=decodeURIComponent(o.pathname.split("/").filter(Boolean).at(-1)??"");return/(^|\.)cursor\.directory$/.test(o.hostname)?{store:"cursor",plugin_id:`dir:${a}`}:{store:Vh.find(([c])=>c.test(o.hostname))?.[1]??null,plugin_id:a}}function Xd(e){let r=bt(e);return r.store?{store:r.store,plugin_id:r.plugin_id}:void 0}var px=e=>Array.isArray(e)?e.join(","):String(e);function Bh(e,r,i){let o=new Set(e.flatMap(a=>"param"in a?[a.param]:[])),t=e.map(a=>{if("literal"in a)return a.literal;let c=r[a.param];if(c===void 0)return i(a.param,`${a.param} is required.`);if(!a.part)return encodeURIComponent(String(c));let u=Xd(String(c));return u?encodeURIComponent(u[a.part]):i(a.param,`${a.param}: expected '{store}:{plugin_id}', got '${c}'.`)}),n=new URLSearchParams(Object.entries(r).flatMap(([a,c])=>o.has(a)||c===void 0?[]:[[a,px(c)]]));return`/${t.join("/")}${n.size?`?${n}`:""}`}var Pe=["observed","store_reported","derived","proxy","estimate"];var mx=["ranks","metrics","tools"],Fn=["rank_move","chart_enter","chart_exit","featuring_enter","featuring_exit","launch","toolset_change","listing_change","release_change","mcp_status_change","delisted","metric_change"],iA=Fn.filter(e=>e!=="release_change"),Jh=30,fx=["released_at","first_seen_at"],gx=["apps","rank"],hx=["1d","7d"],vx=["rank","new","name"],bx=["all","any"],yx=["chatgpt:apps_sdk","chatgpt:connector","chatgpt:plugin","chatgpt:curated","chatgpt:other"],_x=[...yx,...Object.keys(sa).filter(e=>!e.startsWith("chatgpt:"))],$x=["all","missing"],kx=["tags"],wx=["app"],xx=["weekly_brief","competitor_watch","audit_my_server"],Wh=["store_reported","derived","observed"],Sx=/^-(\d{1,4})([hdw])$/,Vn=e=>Sx.test(e)||!Number.isNaN(Date.parse(e));var Gh=s.string().min(1).max(300),Yd=s.string().min(1).max(60),b={store:s.enum(A).describe("App store."),region:s.string().regex(/^([a-z]{2}|global|directory)$/).describe("ChatGPT country code (us, de\u2026), global, or directory (Cursor). Default: main catalog."),at:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("A past time (ISO-8601, -24h, -7d): the latest data at that time. Default: now."),app:Gh.describe("Listing ref '{store}:{plugin_id|slug}' (e.g. chatgpt:figma) or its OpenApps URL."),apps:s.array(Gh).min(1).max(10).describe("1 to 10 listing refs or OpenApps URLs."),chart:s.string().min(1).max(120).describe("Chart name as stores lists it, e.g. category:productivity, popularity, directory:top."),query:s.string().min(1).max(200).describe("Words to find in app names, descriptions and publishers."),publisher:s.string().min(1).max(200).describe("Only apps by this publisher, named in any form (Figma, Inc. or figma)."),category:s.string().min(1).max(120).describe("Category title as rows show it, e.g. Productivity (new_list: ChatGPT only)."),kind:Dr(s.enum(Q)).describe("App kind; stores lists each store's kinds."),limit:s.coerce.number().int().min(1).max(1e4).describe("Rows per page."),cursor:s.string().max(200).describe("The previous page's meta.next_cursor."),include:s.array(s.enum(mx)).describe("Sections per profile: ranks now, metrics, MCP tools."),response_format:s.enum(["concise","detailed"]).describe("detailed adds fields."),since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Start of the window: ISO-8601, or relative to the latest data (-24h, -7d)."),types:s.array(s.enum(Fn)).min(1).describe("Event types to keep. Default: all but release_change."),sort:s.enum(fx).describe("Newest first by this time; since bounds it."),id:s.string().min(1).max(600).describe("A search result id: listing:{store}:{plugin_id}, app:{slug}, tag:{id}, chart:{store}:{chart} or server:{url}."),server:s.string().min(1).max(500).describe("MCP server URL as a listing's tools list it, or its OpenApps id."),metric:s.string().min(1).max(40).describe("Metric name as the stores resource lists it, e.g. installs (Claude), dir_installs (Cursor)."),status:s.enum(jr).describe("MCP server status: open (lists its tools without a sign-in), auth, blocked, dead or error."),diff_from:s.string().min(1).max(80).describe("An earlier toolset to diff against: snapshot hash or time (ISO-8601, -7d)."),context:s.string().max(500).describe("User's goal, briefly; nothing personal."),guide:s.enum(xx).describe("A playbook: the tool calls for a multi-step task, in order."),order:s.enum(gx).describe("apps: most apps first; rank: best chart position first."),window:s.enum(hx).describe("Movement against the previous day (1d) or a week earlier (7d)."),max_position:s.coerce.number().int().min(1).max(1e4).describe("Only rows at or above this position now (1-based)."),slug:s.string().min(1).max(300).describe("An app's slug (e.g. context7), or one of its listings' refs."),key:s.string().min(1).max(200).describe("Publisher key from publishers_list (e.g. figma), or a name it lists under (Figma, Inc.)."),tag:Yd.describe("Tag id from tags_tree, e.g. gmail."),tags:s.array(Yd).min(1).max(20).describe("Tag ids from tags_tree."),exclude:s.array(Yd).min(1).max(20).describe("Tag ids to leave out."),match:s.enum(bx).describe("all: every tag in tags; any: at least one."),linked:s.array(s.enum(A)).min(1).max(A.length).describe("Other stores its app is in."),stores:s.array(s.enum(A)).min(1).max(A.length).describe("App stores."),kinds:s.array(Dr(s.enum([...Q,..._x]))).min(1).max(20).describe("App kinds, bare (connector) or store-qualified (claude:connector, chatgpt:apps_sdk); a value qualified by another store is ignored."),families:s.array(s.string().min(1).max(80)).min(1).max(20).describe("ChatGPT app families, e.g. plugin_asdk_app."),categories:s.array(s.string().min(1).max(120)).min(1).max(20).describe("Category titles as rows show them."),publishers:s.array(s.string().min(1).max(200)).min(1).max(20).describe("Publisher keys (publishers_list) or names."),statuses:s.array(s.enum(jr)).min(1).max(jr.length).describe("MCP server statuses: open, auth, blocked, dead or error."),sort_by:s.enum(vx).describe("rank: best chart place; new: newest release; name: A to Z."),availability:s.enum($x).describe("ChatGPT: all, listed in every country with data; missing, absent from some."),scope:s.enum(kx).describe("tags: browsing by tag."),group:s.enum(wx).describe("app: one row per app, its best listing, by OpenApps Rank across stores; total and facets count apps."),released_since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Only apps released since: ISO-8601, or relative to the latest data (-30d)."),from:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range start: ISO-8601, or relative to to (-30d)."),to:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range end, a past time. Default: the latest data."),issue:s.enum(Rh).describe("What the report is: a bug, wrong data, a missing capability, something confusing, or other."),summary:s.string().min(1).max(Nr.summary).describe("One line: what is wrong or missing."),details:s.string().max(Nr.details).describe("What the user tried, what happened and what was expected, paraphrased."),initiator:s.enum(Zh).describe("user when the user asked to send the report, model otherwise."),tool:s.string().min(1).max(Nr.tool).describe("The OpenApps tool the report is about."),subject_type:s.enum(Lh).describe("What the report is about."),subject_id:s.string().min(1).max(Nr.subject_id).describe("Its ref, slug or URL as these tools give it."),request_id:s.string().min(1).max(Nr.request_id).describe("The request id an OpenApps error answer ended with, when the report is about that call.")},qh={app:{parts:{store:b.store,plugin_id:s.string().min(1).max(280).describe("The listing's id in its store, e.g. plugin_01abc; {store}:{plugin_id} is its ref.")},split:Xd,join:e=>Fh(e.store,e.plugin_id)}};var Hh=["response_format","context"],Xh={store:null,limit:null,kind:null,response_format:null,sort:null,region:"ChatGPT country code (default us).",at:"Past time: ISO-8601 or -24h, -7d.",since:"Window start: ISO-8601 or -24h, -7d.",app:"Listing ref or OpenApps URL.",apps:"Listing refs or OpenApps URLs.",chart:"Chart name; stores_get lists them.",query:"Words in app names, descriptions or publishers.",publisher:"Publisher name, in any form.",category:"Category title (ChatGPT).",cursor:null,include:"Sections per profile.",types:"Default: all but release_change.",metric:"Metric name; stores_get lists each store's.",server:"MCP server URL.",diff_from:"Earlier toolset: snapshot hash or time.",context:"The user's goal, briefly.",guide:null,kinds:"e.g. claude:connector; stores_get lists them.",issue:null,details:null,tool:null,subject_type:null,summary:"One line.",initiator:"user if the user asked for it, else model.",subject_id:"Ref, slug or URL.",request_id:"From an error answer."},Yh=["kinds"],Qh=["limit"],ev={country:["region"],country_code:["region"],market:["region"],app_id:["app","apps"],plugin_id:["app","apps"],id:["app","apps"],ids:["apps"],app:["apps","slug"],app_ids:["apps"],refs:["apps"],product:["slug"],listing:["app","slug"],listings:["apps"],q:["query"],search:["query"],term:["query"],keyword:["query"],keywords:["query"],slug:["chart"],chart_id:["chart"],list:["chart"],category:["chart","categories"],platform:["store","stores"],marketplace:["store","stores"],store:["stores"],kind:["kinds","issue"],family:["families"],publisher:["publishers"],status:["statuses"],page_size:["limit"],max_results:["limit"],top:["limit"],count:["limit"],date:["at"],as_of:["at"],time:["at"],url:["server"],server_url:["server"],mcp_server:["server"],from:["diff_from","since","released_since"],after:["since","released_since"],type:["types"],event_types:["types"],compare_to:["diff_from"],since:["diff_from","released_since","from"],until:["to"],end:["to"],format:["response_format"],detail:["response_format"],verbosity:["response_format"],sections:["include"],fields:["include"],description:["details"],message:["summary"],sort:["order","sort_by"],publisher_key:["key","publisher"],product_id:["slug"],max_rank:["max_position"],period:["window"],order:["sort_by"],tag:["tags"],tags:["tag"],tag_id:["tag"],without:["exclude"],exclude_tags:["exclude"],mode:["match"],also_on:["linked"],mcp:["status","statuses"],mcp_status:["status","statuses"],released:["released_since"],launched_since:["released_since"]};var yt=s.string().nullable(),Qd=["current","stale","unavailable","none"],ep=s.object({store:s.enum(A),region:s.string(),as_of:yt.describe("When the region's latest data is from"),status:s.enum(Qd),dark_since:yt.describe("unavailable only: refused since")}),Ix=s.object({tier:s.enum(Nh).describe("out (no account), free or plus (Pro)"),need:s.enum(["free","plus"]).describe("The plan that shows the rest"),cap:s.number().int().nullable().describe("Rows shown"),total:s.number().int().nullable().describe("Rows in full"),since:yt.describe("Earliest time shown"),regions:s.array(s.string()).nullable().describe("Countries shown"),rank:s.number().int().nullable().describe("Only apps ranked this high"),by:s.object({up:s.number().int(),down:s.number().int(),new:s.number().int()}).partial().optional().describe("movers_list: climbers, fallers and new entries in full, each cut to cap apart"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")}),zx=s.object({as_of:yt,run:s.object({store:s.enum(A),region:s.string(),started_at:s.string()}).nullable(),compared_to:s.object({prev:yt,day:yt,week:yt.optional().describe("charts_get on the latest run: the run prev_week is from")}).nullable(),freshness:s.object({cadence:s.string(),next_expected_at:yt,stale:s.boolean().describe("Any region older than expected")}).nullable(),basis:s.record(s.string(),s.enum(Pe)),coverage:s.object({notes:s.array(s.string()),regions:s.array(ep).describe("Each region the answer speaks for")}),next_cursor:s.string().nullable(),truncated:s.boolean(),truncation_reason:s.string().nullable(),plan:Ix.optional().describe("What the caller's plan left out (truncation_reason plan)")}),tv=e=>s.object({data:e,meta:zx});function C(e){let r={...e,path:e.path??`/v1/${e.resource}`,output:tv(e.data)},i=[.../^[a-z]+(_[a-z]+){1,2}$/.test(r.name)&&r.name.startsWith(`${r.resource}_`)?[]:[`${r.name}: an operation is named <resource>_<verb> in lowercase, starting with its resource '${r.resource}'`],...Ox(r.name,r.input,{toolOnly:!1}),...jx(r.name,r.path,r.input),...Tx(r.name,r.data,r.basis),...r.examples.length?[]:[`${r.name}: give at least one example; tests run every example`],...r.examples.flatMap(o=>r.input.safeParse(o.input).success?[]:[`${r.name}: example '${o.title}' does not parse against the input`])];if(i.length)throw new Error(i.join(`
|
|
64
|
-
`));return r}var Px=new Set(["optional","default","nullable","prefault"]);function rt(e){let r=e;for(;Px.has(r._zod.def.type)&&r._zod.def.innerType;)r=r._zod.def.innerType;return r}function Ox(e,r,{toolOnly:i}){return Object.entries(r.shape).flatMap(([o,t])=>{if(!Object.hasOwn(b,o)){let a=ev[o]?.[0];return[`${e}: input '${o}' is not in vocab.ts; ${a?`use '${a}', not '${o}'`:"add it to P there, or use a name P already has"}`]}let n=o;return!i&&Hh.includes(n)?[`${e}: '${o}' is a tool-only parameter; operations never take it`]:rt(t)!==b[n]?[`${e}: input '${o}' must be P.${o} from vocab.ts (wrapped only in .optional() or .default()), not a schema of its own`]:[]})}function jx(e,r,i){return/^\/v1(\/([a-z]+|\{[a-z_]+\}))+$/.test(r)?[...r.matchAll(/\{([a-z_]+)\}/g)].flatMap(([,o])=>Object.hasOwn(i.shape,o)?i.shape[o].safeParse(void 0).success?[`${e}: path placeholder {${o}} must be a required input`]:[]:[`${e}: path placeholder {${o}} is not an input`]):[`${e}: path '${r}' must be /v1 followed by lowercase segments and {input} placeholders`]}function Ax(e,r){let i=e;for(let o of r.split(".")){let[,t,n]=/^([a-z_0-9]+)(\[\])?$/.exec(o)??[],a=i&&rt(i);if(!t||!(a instanceof s.ZodObject)||!Object.hasOwn(a.shape,t))return;if(i=a.shape[t],n){let c=rt(i);if(!(c instanceof s.ZodArray))return;i=c.element}}return i}var Tx=(e,r,i)=>Object.keys(i).flatMap(o=>Ax(r,o)?[]:[`${e}: basis path '${o}' names no field of the output`]);var O=e=>e.optional().meta({detailed:!0});var ge=(e,r,i,o)=>({facet:"domain",value:e,title:r,description:i,synonyms:o,parent:null}),w=(e,r,i,o,t)=>({facet:"use",value:e,title:i,description:o,synonyms:t,parent:r}),se=(e,r,i,o)=>({facet:"audience",value:e,title:r,description:i,synonyms:o,parent:null}),S=(e,r,i,o)=>({facet:"connects",value:e,title:r,description:`Works with ${r}.`,synonyms:[i],parent:null,site:o}),Bn=[ge("design-media","Design & media","Make or edit images, video, audio, slides, graphics, 3D models and websites.",[]),w("image-generation","design-media","Images & photos","Generate, edit or enhance images, photos, logos and illustrations.",[]),w("video","design-media","Video","Make, edit or publish video.",["Video generation & avatars","Video editing & publishing"]),w("audio-music","design-media","Audio, voice & music","Work with audio, voice and music.",["Music","Voice & speech","Transcription","Podcasts & audiobooks"]),w("presentations","design-media","Presentations & slides","Build slide decks and presentations.",[]),w("graphic-design","design-media","Graphic & UI design","Graphics, branding, mockups, UI design and design systems.",[]),w("3d-cad","design-media","3D & CAD","3D models, CAD and 3D printing.",[]),w("websites","design-media","Websites & landing pages","Build, generate or publish websites and landing pages.",[]),ge("developer-tools","Developer tools & IT","Write, test, ship, run and secure software.",["Security & IT"]),w("code-review","developer-tools","Code review & quality","Review pull requests, lint, refactor and track code quality.",[]),w("testing-qa","developer-tools","Testing & QA","Write and run unit, end-to-end and regression tests.",[]),w("deploy-cloud","developer-tools","Deploy, hosting & infra","Deploy and run software on cloud infrastructure.",["Hosting & deploys","Containers & Kubernetes","IaC & CI/CD","Cloud cost & FinOps"]),w("databases","developer-tools","Databases","Query, manage and migrate databases, including vector stores.",[]),w("apis-sdks","developer-tools","APIs & SDKs","Design, document, test and call APIs; SDKs and webhooks.",[]),w("observability","developer-tools","Debugging & monitoring","Debug errors, read logs and traces, handle incidents.",[]),w("git","developer-tools","Git & version control","Repositories, commits, branches and merge requests.",[]),w("codebase-docs","developer-tools","Code search & docs","Search codebases and read current developer docs.",[]),w("agent-building","developer-tools","Agent building & orchestration","Build, run and evaluate AI agents.",["Multi-agent orchestration","Memory & context","MCP gateways & tooling","Evals & LLM ops"]),w("harness-addons","developer-tools","Coding agent add-ons","Hooks, status lines, commands and session tools for coding agents.",[]),w("coding-conventions","developer-tools","Coding rules & conventions","Rules, style guides and best practices for writing code.",[]),w("mobile-dev","developer-tools","Mobile & Apple platforms","Build iOS, Android and macOS apps.",[]),w("domains-dns","developer-tools","Domains & DNS","Search, register and configure domains and DNS.",[]),w("appsec","developer-tools","AppSec & vulnerabilities","Vulnerabilities, security scans and threat intelligence.",[]),w("identity-access","developer-tools","Identity & access","Identity, single sign-on, passwords and access control.",[]),w("it-ops","developer-tools","IT ops & devices","IT support, device management and networks.",[]),w("agent-guardrails","developer-tools","Agent guardrails & safety","Guardrails, sandboxes and redaction for AI agents.",[]),ge("data-analytics","Data & analytics","Query, analyze and chart data.",[]),w("bi-dashboards","data-analytics","BI & dashboards","Dashboards, KPIs, reporting and business intelligence.",[]),w("warehouses-pipelines","data-analytics","Warehouses & pipelines","Data warehouses, lakes, catalogs and ETL pipelines.",[]),w("spreadsheets","data-analytics","Spreadsheets & CSV","Work with spreadsheets and CSV files.",[]),w("product-analytics","data-analytics","Product & web analytics","Funnels, experiments, feature flags and web traffic.",[]),w("web-data-extraction","data-analytics","Web data extraction","Pull structured data out of web pages and documents.",[]),w("charts-viz","data-analytics","Charts & visualization","Charts, diagrams, flowcharts and whiteboards.",[]),ge("productivity","Productivity & docs","Writing, notes, documents, files, calendars and meetings.",[]),w("writing","productivity","Writing & editing","Write, rewrite, proofread and edit text.",[]),w("notes-knowledge","productivity","Notes & knowledge base","Notes, wikis, bookmarks and team knowledge.",[]),w("documents-pdfs","productivity","Documents & PDFs","Create, edit, sign and manage documents and PDFs.",[]),w("forms-surveys","productivity","Forms & surveys","Build forms, surveys and questionnaires.",[]),w("calendar-scheduling","productivity","Calendar & scheduling","Calendars, appointments and meeting booking.",[]),w("meetings","productivity","Meeting notes & transcripts","Record, transcribe and summarize meetings.",[]),w("files-storage","productivity","Files & storage","Store, share and search files.",[]),w("translation","productivity","Translation","Translate and localize text.",[]),w("ai-assistant-tools","productivity","AI assistant tools","Memory, chat history and export, prompts, skills and usage for the AI assistant you use.",["Chat export","Prompt library","Skills"]),w("personal-assistant","productivity","Personal assistant & memory","Plan the day, remember things and handle life admin.",[]),ge("project-management","Projects & workflows","Plan work, track tasks and automate workflows.",[]),w("tasks","project-management","Tasks & to-dos","To-do lists, checklists and task tracking.",[]),w("issues-sprints","project-management","Issues & sprints","Issue tracking, backlogs, sprints and roadmaps.",[]),w("product-specs","project-management","Product specs & PRDs","Product requirements, specs and user stories.",[]),w("automation","project-management","Automation & workflows","Automate repetitive work across apps.",[]),w("time-tracking","project-management","Time tracking","Track hours and timesheets.",[]),ge("communication","Communication","Email, chat, messaging and calls.",[]),w("email","communication","Email","Read, sort, write and send email.",[]),w("team-chat","communication","Team chat & messaging","Team chat, direct messages and text messages.",[]),w("calls","communication","Calls & video meetings","Phone calls, video calls and dialers.",[]),ge("sales-crm","Sales & customers","Find leads, close deals and support customers.",["Customer support"]),w("crm","sales-crm","CRM","Contacts, accounts and deal pipelines.",[]),w("prospecting","sales-crm","Prospecting & leads","Find, enrich and contact leads.",[]),w("sales-enablement","sales-crm","Sales enablement","Sales calls, coaching, proposals and RFPs.",[]),w("partnerships","sales-crm","Partnerships & affiliates","Partner, affiliate and referral programs.",[]),w("helpdesk","sales-crm","Helpdesk & tickets","Support tickets, live chat and customer conversations.",[]),w("feedback-reviews","sales-crm","Feedback & reviews","Collect and analyze customer feedback and reviews.",[]),w("help-center","sales-crm","Help center & FAQs","Help articles and FAQs.",[]),ge("marketing","Marketing & SEO","Search, ads, social, content, email and brand.",[]),w("seo","marketing","SEO & AI search","Keyword research, search rankings and visibility in AI answers.",[]),w("ads","marketing","Ads & paid media","Plan, run and report on ad campaigns.",[]),w("social-media","marketing","Social media","Post to, schedule and track social media.",[]),w("content-marketing","marketing","Content & copy","Blog posts, content plans and marketing copy.",[]),w("email-marketing","marketing","Email marketing","Newsletters, email campaigns and subscriber lists.",[]),w("brand-intel","marketing","Brand & competitor intel","Track brand mentions, competitors and sentiment.",[]),w("marketing-analytics","marketing","Marketing analytics & attribution","Campaign performance, attribution and marketing data.",[]),w("app-marketing","marketing","App store & product marketing","App store optimization, app rankings and product launches.",[]),ge("finance","Finance & payments","Payments, accounting, tax, investing, banking and insurance.",[]),w("payments-billing","finance","Payments & billing","Take payments, send invoices and manage billing.",[]),w("accounting","finance","Accounting & bookkeeping","Books, expenses, receipts and reconciliation.",[]),w("tax","finance","Tax","Tax returns, VAT and tax filings.",[]),w("investing","finance","Investing & market data","Stocks, market data, filings, portfolios and trading.",[]),w("deals-vc","finance","Deals, M&A & VC","Fundraising, due diligence, data rooms and deal flow.",[]),w("crypto","finance","Crypto & web3","Tokens, wallets, chains and exchanges.",[]),w("banking","finance","Banking & personal finance","Bank accounts, budgets, cards, loans and mortgages.",[]),w("insurance","finance","Insurance","Insurance quotes, policies and underwriting.",[]),w("fpa","finance","FP&A & finance ops","Financial planning, forecasts, cash flow and spend.",[]),ge("commerce","Commerce & shopping","Shopping, online stores and real estate.",[]),w("shopping","commerce","Shopping & deals","Find products, compare prices and get deals.",[]),w("ecommerce-ops","commerce","E-commerce operations","Run online stores: listings, inventory and orders.",[]),w("real-estate","commerce","Real estate","Homes, rentals and property data.",[]),ge("research","Research & search","Search the web, papers, companies and news.",[]),w("web-search","research","Web search","Search the web.",[]),w("academic","research","Academic & scientific","Papers, preprints, clinical trials and scientific data.",[]),w("company-research","research","Company & market research","Company profiles, industries and markets.",[]),w("news","research","News & media","News, headlines and press releases.",[]),w("deep-research","research","Deep research & reports","Long research reports with sources.",[]),ge("travel-places","Travel & places","Flights, stays, transport, trips, maps, weather and events.",[]),w("flights","travel-places","Flights","Search and book flights.",[]),w("hotels","travel-places","Hotels & stays","Hotels, rentals and other places to stay.",[]),w("ground-transport","travel-places","Trains, transit & cars","Trains, buses, transit, car rentals and rides.",[]),w("trip-planning","travel-places","Trip planning & guides","Itineraries, destinations and things to do.",[]),w("maps-local","travel-places","Maps & local","Maps, directions and local places.",[]),w("weather","travel-places","Weather","Weather forecasts and climate data.",[]),w("events-tickets","travel-places","Events & tickets","Concerts, festivals, venues and event tickets.",[]),ge("education","Education & learning","Studying, language learning and teaching.",[]),w("tutoring","education","Students & tutoring","Homework help, tutoring, quizzes and flashcards.",[]),w("language-learning","education","Language learning","Learn a language: vocabulary and pronunciation.",[]),w("teaching","education","Teaching & courses","Lesson plans, courses and classroom tools.",[]),ge("health","Health & wellness","Fitness, nutrition, medicine and mental health.",[]),w("fitness","health","Fitness & running","Workouts, running, cycling and training plans.",[]),w("nutrition","health","Nutrition & diet","Calories, diets and meal plans.",[]),w("medical","health","Medical & clinical","Clinical care, patients, drugs and health records.",[]),w("mental-health","health","Mental health & sleep","Therapy, meditation, journaling and sleep.",["Meditation","Mindfulness"]),ge("lifestyle","Entertainment & lifestyle","Games, entertainment, food, home, sports and relationships.",[]),w("games","lifestyle","Games & puzzles","Games, puzzles and trivia.",[]),w("movies-books","lifestyle","Movies, TV & books","Movies, TV shows, books and reading lists.",[]),w("food-recipes","lifestyle","Food & recipes","Recipes, cooking, restaurants and drinks.",[]),w("home-family","lifestyle","Home, family & pets","Home, family, kids and pets.",[]),w("spirituality","lifestyle","Astrology & spirituality","Astrology, tarot and religion.",[]),w("sports","lifestyle","Sports & betting","Sports scores, fantasy leagues and betting.",[]),w("dating","lifestyle","Dating & relationships","Dating and relationship advice.",[]),ge("business-ops","Business operations","Hiring, legal, logistics, ERP, procurement and small business tools.",["HR & recruiting","Legal & compliance"]),w("recruiting","business-ops","Recruiting & hiring","Source, screen and hire candidates.",[]),w("careers","business-ops","Careers & job search","Resumes, cover letters, job search and interview prep.",[]),w("people-ops","business-ops","People ops & payroll","Payroll, employee records, time off and reviews.",[]),w("contracts","business-ops","Contracts","Draft, review and redline contracts.",[]),w("compliance","business-ops","Compliance & privacy","Regulation, privacy, risk and governance.",[]),w("legal-research","business-ops","Legal research","Case law, statutes, patents and trademarks.",[]),w("logistics","business-ops","Logistics & shipping","Shipping, freight, fleets and supply chains.",[]),w("erp-procurement","business-ops","ERP & procurement","ERP, purchase orders and suppliers.",[]),w("small-business-ops","business-ops","Small business tools","Tools for small businesses, freelancers and field services.",[]),se("for-developers","Developers","Software developers and engineering teams.",[]),se("for-designers","Designers & creators","Designers, artists and content creators.",[]),se("for-marketers","Marketers","Marketers, growth teams and agencies.",[]),se("for-sales","Sales teams","Sales reps and sales teams.",[]),se("for-support","Support teams","Customer support teams.",[]),se("for-product","Product managers","Product managers and product teams.",[]),se("for-data","Data teams & analysts","Data teams, analysts and data scientists.",[]),se("for-finance","Finance teams & accountants","Finance teams, accountants and bookkeepers.",[]),se("for-hr","HR & recruiters","Recruiters, hiring managers and HR teams.",[]),se("for-legal","Legal teams","Lawyers, paralegals and legal teams.",[]),se("for-it-security","IT & security teams","IT admins, security teams and SREs.",[]),se("for-researchers","Researchers & scientists","Researchers, scientists and academics.",[]),se("for-students","Students & educators","Students, learners and educators.",["Teachers","Learners"]),se("for-clinicians","Clinicians & health pros","Doctors, nurses, pharmacists and other health professionals.",[]),se("for-investors","Investors & traders","Investors, traders and portfolio managers.",[]),se("for-small-business","Small business & freelancers","Small businesses, freelancers and founders.",[]),se("for-consumers","Consumers","People using it in their personal life: travel, shopping, health, money and entertainment.",[]),se("for-enterprise","Enterprise","Large organizations.",[]),S("gmail","Gmail","Google Workspace","mail.google.com"),S("google-drive","Google Drive","Google Workspace","drive.google.com"),S("google-calendar","Google Calendar","Google Workspace","calendar.google.com"),S("google-docs","Google Docs","Google Workspace","docs.google.com"),S("google-sheets","Google Sheets","Google Workspace","sheets.google.com"),S("google-slides","Google Slides","Google Workspace","slides.google.com"),S("google-meet","Google Meet","Google Workspace","meet.google.com"),S("google-ads","Google Ads","Google marketing","ads.google.com"),S("google-analytics","Google Analytics","Google marketing","analytics.google.com"),S("search-console","Search Console","Google marketing","search.google.com"),S("youtube","YouTube","Google marketing","youtube.com"),S("google-maps","Google Maps","Google marketing","maps.google.com"),S("outlook","Outlook","Microsoft 365","outlook.live.com"),S("microsoft-teams","Teams","Microsoft 365","teams.microsoft.com"),S("excel","Excel","Microsoft 365","excel.cloud.microsoft"),S("word","Word","Microsoft 365","word.cloud.microsoft"),S("powerpoint","PowerPoint","Microsoft 365","powerpoint.cloud.microsoft"),S("sharepoint-onedrive","SharePoint & OneDrive","Microsoft 365","onedrive.live.com"),S("power-bi","Power BI","Microsoft 365","powerbi.com"),S("dynamics","Dynamics 365","Microsoft 365","dynamics.microsoft.com"),S("jira","Jira","Atlassian","jira.atlassian.com"),S("confluence","Confluence","Atlassian","confluence.atlassian.com"),S("bitbucket","Bitbucket","Atlassian","bitbucket.org"),S("trello","Trello","Atlassian","trello.com"),S("github","GitHub","Code hosting","github.com"),S("gitlab","GitLab","Code hosting","gitlab.com"),S("aws","AWS","Cloud & hosting","aws.amazon.com"),S("google-cloud","Google Cloud","Cloud & hosting","cloud.google.com"),S("azure","Azure","Cloud & hosting","azure.microsoft.com"),S("cloudflare","Cloudflare","Cloud & hosting","cloudflare.com"),S("vercel","Vercel","Cloud & hosting","vercel.com"),S("netlify","Netlify","Cloud & hosting","netlify.com"),S("firebase","Firebase","Cloud & hosting","firebase.google.com"),S("supabase","Supabase","Cloud & hosting","supabase.com"),S("docker-k8s","Docker & Kubernetes","Cloud & hosting","docker.com"),S("postgres","Postgres","Databases & warehouses","postgresql.org"),S("mysql","MySQL","Databases & warehouses","mysql.com"),S("mongodb","MongoDB","Databases & warehouses","mongodb.com"),S("redis","Redis","Databases & warehouses","redis.io"),S("snowflake","Snowflake","Databases & warehouses","snowflake.com"),S("databricks","Databricks","Databases & warehouses","databricks.com"),S("elasticsearch","Elasticsearch","Databases & warehouses","elastic.co"),S("sqlite","SQLite","Databases & warehouses","sqlite.org"),S("sentry","Sentry","Developer services","sentry.io"),S("datadog","Datadog","Developer services","datadoghq.com"),S("postman","Postman","Developer services","postman.com"),S("twilio","Twilio","Developer services","twilio.com"),S("slack","Slack","Chat & meetings","slack.com"),S("discord","Discord","Chat & meetings","discord.com"),S("zoom","Zoom","Chat & meetings","zoom.us"),S("whatsapp","WhatsApp","Chat & meetings","whatsapp.com"),S("telegram","Telegram","Chat & meetings","telegram.org"),S("notion","Notion","Work management","notion.so"),S("linear","Linear","Work management","linear.app"),S("asana","Asana","Work management","asana.com"),S("clickup","ClickUp","Work management","clickup.com"),S("monday","monday.com","Work management","monday.com"),S("airtable","Airtable","Work management","airtable.com"),S("todoist","Todoist","Work management","todoist.com"),S("obsidian","Obsidian","Work management","obsidian.md"),S("dropbox","Dropbox","Work management","dropbox.com"),S("box","Box","Work management","box.com"),S("zapier","Zapier","Work management","zapier.com"),S("calendly","Calendly","Work management","calendly.com"),S("salesforce","Salesforce","CRM & sales tools","salesforce.com"),S("hubspot","HubSpot","CRM & sales tools","hubspot.com"),S("pipedrive","Pipedrive","CRM & sales tools","pipedrive.com"),S("attio","Attio","CRM & sales tools","attio.com"),S("zoho","Zoho","CRM & sales tools","zoho.com"),S("apollo","Apollo","CRM & sales tools","apollo.io"),S("stripe","Stripe","Commerce & payments","stripe.com"),S("shopify","Shopify","Commerce & payments","shopify.com"),S("paypal","PayPal","Commerce & payments","paypal.com"),S("square","Square","Commerce & payments","squareup.com"),S("woocommerce","WooCommerce","Commerce & payments","woocommerce.com"),S("amazon","Amazon","Commerce & payments","amazon.com"),S("quickbooks","QuickBooks","Commerce & payments","quickbooks.intuit.com"),S("xero","Xero","Commerce & payments","xero.com"),S("figma","Figma","Design & web","figma.com"),S("canva","Canva","Design & web","canva.com"),S("adobe","Adobe","Design & web","adobe.com"),S("webflow","Webflow","Design & web","webflow.com"),S("framer","Framer","Design & web","framer.com"),S("wordpress","WordPress","Design & web","wordpress.org"),S("instagram","Instagram","Social networks","instagram.com"),S("tiktok","TikTok","Social networks","tiktok.com"),S("x-twitter","X / Twitter","Social networks","x.com"),S("facebook","Facebook & Meta","Social networks","facebook.com"),S("reddit","Reddit","Social networks","reddit.com"),S("linkedin","LinkedIn","Social networks","linkedin.com"),S("zendesk","Zendesk","Support tools","zendesk.com"),S("intercom","Intercom","Support tools","intercom.com"),S("freshdesk","Freshdesk","Support tools","freshdesk.com"),S("openai-api","OpenAI API","AI models & media APIs","openai.com"),S("gemini","Gemini","AI models & media APIs","gemini.google.com"),S("hugging-face","Hugging Face","AI models & media APIs","huggingface.co"),S("elevenlabs","ElevenLabs","AI models & media APIs","elevenlabs.io"),S("replicate","Replicate","AI models & media APIs","replicate.com")];var av=[{id:"job",label:"Use case",hint:"What it does"},{id:"works",label:"Works with",hint:"Products and platforms it connects to"},{id:"for",label:"Audience",hint:"Who it is for"},{id:"cap",label:"Capabilities",hint:"Read from listing data, not text"}],E=(e,r,i,o=[])=>({id:e,label:r,description:i,kids:o}),rv=e=>({...e,api:!0});function sv(e,r,i=null,o=!1){return r.flatMap(t=>{let n=o||!!t.api;return[{id:t.id,label:t.label,description:t.description,facet:e,parent:i,other:!1,...n?{api:!0}:{}},...sv(e,t.kids,t.id,n)]})}function Dx(e){let r=[],i=new Map;for(let n of e){let a=n.parent===null?void 0:i.get(n.parent);if(i.has(n.id))throw new Error(`duplicate tag id ${n.id}`);if(n.parent!==null&&!a)throw new Error(`tag ${n.id} comes before its parent ${n.parent}`);let c={...n,depth:a?a.depth+1:1,kids:[]};r.push(c),i.set(n.id,c),a?.kids.push(n.id)}let o=new Map(r.map((n,a)=>[n.id,a])),t=n=>{let a=[];for(let c=i.get(n)?.parent??null;c;c=i.get(c)?.parent??null)a.push(c);return a};return{tags:r,node:n=>i.get(n),ancestors:t,withAncestors:n=>{let a=new Set;for(let c of n)if(i.has(c)){a.add(c);for(let u of t(c))a.add(u)}return[...a].sort((c,u)=>o.get(c)-o.get(u))}}}var Nx=[E("cap-kind","Listing type","What the listing is in its store.",[E("kind-chatgpt-app","ChatGPT app","An app in ChatGPT."),E("kind-claude-connector","Claude connector","A connector in Claude."),E("kind-claude-plugin","Claude plugin","A plugin in Claude."),E("kind-cursor-plugin","Cursor plugin","A plugin in the Cursor marketplace."),E("kind-mcp-server","MCP server (cursor.directory)","An MCP server listed on cursor.directory."),E("kind-rule","Rule (cursor.directory)","A rule listed on cursor.directory."),E("kind-claude-extension","Claude desktop extension","A desktop extension in Claude."),E("kind-grokbot-plugin","Grok Bot plugin","A plugin in Grok Bot."),E("kind-grokbot-bot","Grok Bot template","A bot template in Grok Bot's marketplace.")]),E("cap-ui","ChatGPT surface","Whether a ChatGPT app can show its own interface.",[E("apps-sdk","Apps SDK app (can show UI)","Built with the Apps SDK, so it can show its own interface in the chat."),E("connector-only","Connector (no UI)","A connector that returns data to the chat and shows no interface of its own.")]),E("cap-access","Sign-in","Whether it needs you to sign in, and how.",[E("signin-oauth","OAuth sign-in","Asks you to sign in with your account."),E("signin-key","API key or token","Needs an API key or token."),E("signin-open","Open, no sign-in","Its MCP server works without signing in.")]),E("cap-mcp","MCP server","What its MCP server reports.",[E("mcp-remote","Remote MCP (streamable HTTP)","A remote MCP server over streamable HTTP."),E("mcp-sse","SSE transport","A remote MCP server over the older SSE transport."),E("mcp-down","Server down or erroring","Its MCP server is down, blocked or returning errors.")]),E("cap-actions","Tool actions","What its tools do, read from their names and annotations.",[E("writes-data","Writes data (create/update/send)","Has tools that create, change, send or delete things."),E("read-only","Read-only tools","Every tool only reads.")]),E("cap-reach","Reach","Where the listing is available and promoted.",[E("multi-store","On 2+ stores","The same product is listed in two or more stores."),E("all-stores","On 3+ stores","The same product is listed in three or more stores."),E("geo-restricted","Missing in some countries","Missing from the ChatGPT directory in some countries."),E("worldwide","Listed in every country","Listed in the ChatGPT directory in every country we cover."),E("on-shelf","On a home shelf now","On one of its store's home shelves now.")]),E("cap-age","Age","When the listing was created.",[E("new-30d","Created in the last 30 days","Created in the last 30 days, by the listing's own creation date."),E("new-7d","Created in the last 7 days","Created in the last 7 days, by the listing's own creation date.")]),rv(E("cap-form","Form","What the listing is across stores, read from what it holds (an MCP server makes it an integration).",[E("form-integration","Integration","Reaches a service through a server it runs: an MCP server, an LSP server or a CLI."),E("form-instruction","Instruction","Text the assistant follows: rules, skills, commands, subagents or hooks, and no server."),E("form-agent","Agent","A ready-made assistant: a Grok Bot template.")])),rv(E("cap-parts","Parts","What the listing holds, as its store's records list it.",[E("has-skills","Skills","Holds one or more skills."),E("has-rules","Rules","Holds one or more rules."),E("has-commands","Commands","Holds one or more commands."),E("has-agents","Subagents","Holds one or more subagents."),E("has-hooks","Hooks","Holds one or more hooks.")])),E("cap-review","Store review","How its store vetted the listing.",[E("community","Community listing","In the community tier of Claude's directory, which records no review of the listing by Anthropic or a partner.")])],cv={"Google Workspace":"google-workspace","Google marketing":"google-marketing","Microsoft 365":"microsoft-365",Atlassian:"atlassian","Code hosting":"code-hosts","Cloud & hosting":"clouds","Databases & warehouses":"data-stores","Developer services":"dev-services","Chat & meetings":"chat-apps","Work management":"work-apps","CRM & sales tools":"crm-tools","Commerce & payments":"commerce-tools","Design & web":"design-tools","Social networks":"social-networks","Support tools":"support-tools","AI models & media APIs":"ai-models"},Cx={domain:"job",use:"job",connects:"works",audience:"for"},nv=Bn.filter(e=>e.facet==="connects"),iv=e=>{let r=cv[e.synonyms[0]];if(!r)throw new Error(`brand ${e.value} names no known group`);return r},Ux=[...new Set(nv.map(iv))].flatMap(e=>{let r=nv.filter(o=>iv(o)===e),i=r[0].synonyms[0];return[{id:e,label:i,description:`Works with ${r.slice(0,-1).map(o=>o.title).join(", ")} or ${r.at(-1).title}.`,facet:"works",parent:null,other:!1},...r.map(o=>({id:o.value,label:o.title,description:o.description,facet:"works",parent:e,other:!1,site:o.site}))]}),ov=Bn.filter(e=>e.facet!=="connects").map(e=>({id:e.value,label:e.title,description:e.description,facet:Cx[e.facet],parent:e.parent,other:!1})),tp=Dx([...ov.filter(e=>e.facet==="job"),...Ux,...ov.filter(e=>e.facet==="for"),...sv("cap",Nx)]),rp=tp.tags,kA=rp.map(e=>e.id),wA=new Map(rp.map(e=>[e.id,e])),xA=new Map(rp.map((e,r)=>[e.id,r])),SA=new Map([...Bn.map(e=>[e.value,e.facet]),...Object.values(cv).map(e=>[e,"connects"])]);var IA=new Map(Bn.filter(e=>e.facet!=="connects").map(e=>[e.value,e.synonyms]));var zA=tp.ancestors;var PA=tp.withAncestors;var Y=s.number().int(),ne=s.string(),F=s.string().nullable(),Ft=s.record(s.string(),s.unknown()),ip=O(F.describe("The app's icon on the OpenApps site")),Me=s.string().nullable().describe("Unique in its store; listings_get takes it"),Ex=F.describe("The app's page in the store"),pe=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),store:s.enum(A),url:s.string(),short_description:F,publisher:O(F),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer"))}),_t=F.describe("The app's store category, e.g. Productivity"),np=s.string().nullable(),Cr=s.array(s.object({store:s.enum(A),app:s.string(),slug:np,kind:s.enum(Q),url:s.string()})).describe("The product's apps in other stores"),Ve=s.object({chart:s.string(),title:F,position:Y.describe("1-based; among the app's kind when kind is set"),kind:s.string().nullable()}).describe("Best place now: the main ranking if it lists the app, else the best other"),nt=s.array(s.string()).describe("Tag ids it carries now, ancestors included, in tags_tree order"),uv=Y.nullable().optional(),Le=Y.nullable().optional(),la=pe.extend({best:Ve.nullable(),category:_t,tags:nt,linked:Cr,prev_day:uv.describe("best.position ~24h earlier; null: not listed then"),prev_week:uv.describe("As prev_day, ~7 days earlier"),day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier"),countries:s.object({listed:Y,of:Y}).optional().describe("ChatGPT: countries whose directory lists it, of those with complete data"),launched_at:O(ne.nullable()),first_seen_at:O(ne),mcp_status:O(F.describe("Status of the first MCP server it links"))}),Ur=s.object({position:Y,app:s.string(),slug:Me,name:F,url:s.string(),prev:Y.nullable(),prev_day:Y.nullable(),is_new:s.boolean(),kind:O(s.enum(Q)),publisher:O(F),short_description:O(F),launched_at:O(ne.nullable()),listing:O(Ft.describe("Store-specific listing fields, e.g. Claude tier and surfaces")),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer")),category:_t,linked:Cr,prev_week:O(Y.nullable().describe("Position ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),day_change:Le.describe("Cohort change since ~24h earlier: what the site's change pill shows"),week_change:O(Le.describe("As day_change, since ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),first_seen_at:O(ne),kind_position:O(Y.nullable().describe("Position among the list's apps of the same kind, in lists that join kinds (Claude's Most popular); else null")),tags:O(nt)}),Rx=s.partialRecord(s.enum(A),Y).describe("Apps carrying it per store"),da=s.enum(av.map(e=>e.id)),Kn=s.object({id:s.string(),label:s.string(),facet:da,parent:F.describe("The tag one level up; null for a top tag"),depth:Y.describe("1 for a top tag"),other:s.boolean().describe("An 'X: Other' tag: in its parent, in none of the parent's narrower tags"),n:Y.describe("Apps carrying it, in the stores asked for"),stores:Rx,description:O(s.string()),icon:s.string().optional().describe("A brand's mark on the OpenApps site: its website's favicon")}),op=s.object({key:s.string().describe("Publisher key: publishers_get takes it"),name:s.string().describe("The name most of its apps carry"),stores:s.array(s.object({store:s.enum(A),apps:Y})).describe("Every store it has apps in"),apps:Y,best:Ve.extend({app:s.string()}).nullable().describe("Its app with the best place now"),icon:ip}),ap=s.object({chart:s.string(),slug:s.string(),store:s.enum(A),kind:s.string(),title:F,description:O(F),url:s.string()}),Zx=s.object({region:s.string(),status:s.enum(["listed","not_listed","unknown"]),as_of:ne.nullable(),reason:s.enum(["complete","incomplete","missing","stale","unavailable","none"])}),pa=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),publisher:F,short_description:F,launched_at:ne.nullable(),first_seen_at:ne,url:s.string(),store_url:Ex,availability:s.array(Zx),also:s.array(s.object({app:s.string(),slug:np.optional(),kind:s.enum(Q),url:s.string()})).describe("The app's other listings in this store"),linked:s.array(s.object({app:s.string(),slug:np,name:F,short_description:F,kind:s.enum(Q),url:s.string(),evidence:s.array(s.string())})).describe("The app's listings in other stores, with what binds each: server (same MCP server), owner_domain, publisher, store_name, admin, or an agent check"),part_of:s.object({slug:s.string(),name:F,url:s.string()}).nullable().describe("The app this listing belongs to (apps_get); null until binding gives it one"),store:O(s.enum(A)),plugin_id:O(s.string()),version:O(F),last_seen_at:O(ne),icon:O(F),listing:O(Ft),tags:O(nt)}),lv=s.object({region:s.string(),position:Y,as_of:ne.describe("When the position is from")}),dv=Y.nullable().optional(),sp=s.object({chart:s.string(),title:F,kind:s.string(),url:s.string(),regions:Y,best:lv,primary:Y.nullable().describe("Position in the store's main region"),kind_position:Y.nullable().describe("primary among its own kind, in lists that join kinds; else null"),prev_day:dv.describe("kind_position (on lists that join kinds) or primary ~24h earlier; null: not listed then"),prev_week:dv.describe("As prev_day, ~7 days earlier"),day_change:Le.describe("Cohort change in the main region since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier"),positions:O(s.array(lv))}),cp=s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),reported_at:ne.describe("Latest reported period, including unchanged values"),cadence:s.string(),next_expected_at:ne,stale:s.boolean(),value:s.number().nullable(),t:ne,prev:s.number().nullable(),prev_t:ne.nullable(),points:O(s.array(s.object({t:ne,value:s.number().nullable()})))}),ua=s.object({name:s.string(),title:s.string().optional(),description:s.string(),params:s.array(s.string()),annotations:Ft.optional(),input_schema:O(Ft),output_schema:O(Ft)}),Lx=s.object({name:s.string(),fields:s.array(s.string()).describe("title, description, inputSchema, annotations or outputSchema"),before:O(Ft),after:O(Ft)}),ma=s.object({hash:s.string(),server_version:F,seen_since:ne,seen_until:ne,tool_count:Y}),pv=Y.describe("The server's OpenApps id: /v1/mcp/servers/{id}"),up=s.string().nullable().describe("The OpenApps page of the first app that links this server; null when none does"),lp=s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.describe("When this toolset first appeared"),seen_until:ne.describe("When it last appeared"),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua).optional().describe("Left out when diff_from is given")}),mv=s.object({id:pv,url:s.string(),page:up,status:F,transport:F,checked_at:ne.nullable(),apps:s.array(s.string()).describe("Refs of the apps that link to it, across stores"),snapshot:lp.nullable().describe("The toolset at `at` (latest if omitted); null if never seen without sign-in by then"),diff:s.object({from:s.object({hash:s.string(),seen_since:ne}).nullable().describe("In force at diff_from, else the earliest one (see notes)"),added:s.array(ua),removed:s.array(ua),changed:s.array(Lx)}).nullable().describe("Only with diff_from"),history:O(s.array(ma))}),dp=s.object({id:pv,url:s.string(),status:F,transport:F,auth_hint:F,checked_at:ne.nullable(),snapshot:s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.nullable(),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua)}).nullable().describe("Latest toolset; null if never seen without sign-in"),history:O(s.array(ma))}),CA=s.object({profiles:s.array(s.object({app:pa,ranks:s.array(sp).optional(),metrics:s.array(cp).optional(),tools:s.array(dp).optional()})),not_found:s.array(s.object({app:s.string(),nearest:s.array(s.string())}))});var it=s.string().nullable(),Je=s.number().int(),Mx=["mcp_host","developer","website","name"],fv=C({name:"apps_get",resource:"apps",path:"/v1/apps/{slug}",summary:"One app across stores: each of its listings' name, kind, publisher, category and best chart place now.",description:"Use for where one app is listed. slug is the app's (apps_list, publishers_get and listing rows' product give it), or a listing ref of one of its listings, which finds the app it is in now. match: how sure the binding between its listings is. tools: each tool or skill name across its listings.",input:s.object({slug:b.slug}),data:s.object({slug:s.string().describe("The app's slug, as its listings' rows carry it in product"),name:it.describe("The name most of its listings carry"),listings:s.array(s.object({store:s.enum(A),app:s.string(),slug:Me,name:it,kind:s.enum(Q),publisher:it,category:_t,best:Ve.nullable(),launched_at:s.string().nullable(),first_seen_at:s.string(),url:s.string(),icon:O(it),charts:Je.describe("Ranked charts that list it now"),countries:s.object({listed:Je,of:Je,missing:s.array(s.string()).optional().describe("The countries that don't list it, by region code; with an account only")}).nullable().describe("ChatGPT: of the countries with current data, how many list it; null elsewhere"),tools:Je.describe("Tools its MCP server lists, else the tool or skill names its listing gives"),mcp:it.describe("Its MCP server's host"),website:it.describe("The website its listing names"),prompts:Je.describe("Starter prompts its listing gives"),changes:Je.describe("Listing changes in the last 30 days"),oa_rank:Je.nullable().describe("Its store's OpenApps Rank; null: uncharted")})).describe("By store, then name"),rank:s.object({method:s.string(),day:s.string(),score:s.number(),rank:Je.describe("Among apps across every store, 1 first"),tier:Je.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window")}).nullable().describe("OpenApps Rank across stores (oa_app@2); null when no listing is charted"),match:s.object({confidence:s.enum(["high","medium","low"]).describe("high: three or more signals agree; medium: two; low: one"),evidence:s.array(s.object({kind:s.enum(Mx),value:it.describe("What was compared"),ok:s.boolean().describe("Whether the listings agree on it")})),pairs:O(s.array(s.object({a:s.string(),b:s.string(),state:s.enum(["suggested","bound","rejected"]).describe("bound: strong evidence or a reviewer's yes; rejected: a reviewer's no"),evidence:s.array(s.object({source:s.string(),strong:s.boolean().describe("Binds the pair on its own"),detail:it}))})).describe("Each pair of its listings, by listing ref, that evidence or a review names"))}),tools:s.array(s.object({name:s.string().describe("Lower case, separators as spaces, without the app's name"),apps:s.array(s.string()).describe("The listings that name it, by listing ref"),names:s.array(s.string()).describe("The name each of those listings gives it, in apps' order")})).describe("Most listings first, then A to Z")}),examples:[{title:"Context7 by slug",input:{slug:"context7"}},{title:"The app a listing is in",input:{slug:"claude:notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{name:"derived",slug:"derived","listings[].category":"observed","listings[].best":"derived","listings[].launched_at":"derived","listings[].first_seen_at":"observed","listings[].charts":"observed","listings[].countries":"observed","listings[].tools":"observed","listings[].changes":"observed","listings[].oa_rank":"derived","rank.score":"derived","rank.rank":"derived","rank.momentum":"derived","match.confidence":"derived","tools[].name":"derived"}}),gv=C({name:"apps_list",resource:"apps",summary:"Apps listed in more than one store or kind, by name: each one's slug and stores.",description:"Use to find an app's slug for apps_get. query: words in the app's name or slug; without it, the apps listed in most stores first.",input:s.object({query:b.query.optional(),limit:b.limit.default(20)}),data:s.object({total:Je.describe("Apps that match"),rows:s.array(s.object({slug:s.string(),name:it,stores:s.array(s.enum(A)).describe("In store order")}))}),examples:[{title:"Apps named like Notion",input:{query:"notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed"}});var hv=["name","description","icon","category","publisher","url","keywords"],vv=["release","reviewed_commit"];var GA=Object.fromEntries(A.map(e=>[e,Object.fromEntries(zh(e).flatMap(r=>{let i=Sh(e,r)?.paths;return i?[[r,i]]:[]}))]));var bv=s.union([s.number(),s.string(),s.array(s.unknown()),s.record(s.string(),s.unknown())]).nullable(),Vx=s.object({chart:s.string(),title:s.string().nullable(),before:s.number().int().nullable().describe("1-based position at the change; null when the chart didn't list the app then"),after:s.number().int().nullable().describe("1-based position 7 days after the change; null when the chart didn't list the app then")}).describe("Positions count within the app's kind on a list that joins kinds, as best does"),Fx=s.object({type:s.enum(Fn),t:s.string().describe("When it happened: the data run that recorded it, the release time, or when the new toolset was first recorded"),basis:s.enum(Pe).optional().describe("launch: how t is known: store_reported (the store's launch date), derived (decoded from the ChatGPT app id) or observed (the day the app went live); metric_change: how the metric is known"),app:s.string(),slug:Me,name:s.string().nullable(),store:s.enum(A),kind:O(s.enum(Q).nullable()),publisher:O(s.string().nullable()),tags:O(nt),best:Ve.nullable().describe("The app's best place now, as listings_search gives it"),icon:O(s.string().nullable().describe("The app's icon on the OpenApps site")),region:s.string().nullable().describe("null for store-wide events (launch, toolset_change, listing_change, release_change, mcp_status_change, delisted, metric_change)"),field:s.enum([...hv,...vv]).optional().describe("The listing field that changed; release for a build version or gitRef, reviewed_commit for a reviewed repository commit"),prev_t:s.string().nullable().optional().describe("listing_change and release_change: when the version this one replaced was first recorded; null when that isn't known, as for a listing already live when its history began"),rank_impact:Vx.nullable().optional().describe("listing_change and release_change, for Pro: the rank at the change and 7 days later on the app's best chart; null for a change under 7 days old or one that chart didn't list the app around"),metric:s.string().optional(),unit:s.string().optional(),chart:s.string().optional(),server:s.string().optional(),before:bv.describe("Earlier position, toolset, listing field value, release or MCP status; null when absent"),after:bv.describe("New position, toolset, listing value (lists for keywords/category), release, or MCP status (open/auth/dead)"),url:s.string()}),yv=C({name:"changes_list",resource:"changes",summary:"A store's changes: ranks, featuring, launches, listings, releases, MCP tools and status, delistings, metrics.",description:`Up to ${Jh} days. listing_change: dated field values; release_change: builds or reviewed commits; mcp_status_change: servers down, needing sign-in or back; delisted: needs complete current catalogs in every reachable region; metric_change: clears per-metric floors, never rank proxies.`,input:s.object({store:b.store,region:b.region.optional(),since:b.since.default("-24h"),apps:b.apps.optional(),types:b.types.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),regions:s.array(s.string()),since:s.string(),until:s.string().describe("The newest data in the window"),total:s.number().int(),counts:s.partialRecord(s.enum(Fn),s.number().int()).describe("Events per type over the whole window"),held:s.number().int().optional().describe("Changes in the window the caller's plan holds back, of apps ranked below meta.plan.rank; a listing or release version (the fields one app changed at one time) counts once"),events:s.array(Fx)}),examples:[{title:"ChatGPT US in the last day",input:{store:"chatgpt"}},{title:"Claude moves and toolset changes this week",input:{store:"claude",since:"-7d",types:["rank_move","chart_enter","toolset_change"]}},{title:"Claude listing and server status",input:{store:"claude",types:["listing_change","mcp_status_change","release_change"]}},{title:"One Cursor app",input:{store:"cursor",apps:["cursor:406"],since:"-7d"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??(e.store==="chatgpt"?"us":null),toolsets:!e.types||e.types.includes("toolset_change")||e.types.includes("mcp_status_change"),countries:"status"})},basis:{"events[].type":"derived","events[].field":"observed","events[].t":"observed","events[].before":"observed","events[].after":"observed",counts:"derived","events[].best":"derived","events[].prev_t":"observed","events[].rank_impact":"derived"}});var _v=C({name:"charts_get",resource:"charts",path:"/v1/charts/{store}/{chart}",summary:"One store chart now or at a past time, with each app's previous position and its position a day earlier.",description:"Use for who ranks where in a store list and who moved, entered or dropped. Positions are 1-based. Not a history: one snapshot, compared with two earlier ones. kinds: only those kinds, ranked among themselves (positions, movement and total count them alone).",input:s.object({store:b.store,chart:b.chart,region:b.region.optional(),at:b.at.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({chart:ap,region:s.string(),total:s.number().int().describe("Apps in the list (of the kinds asked)"),dropped:s.number().int().describe("Apps gone since the previous list"),rows:s.array(Ur)}),examples:[{title:"Claude's popularity chart now",input:{store:"claude",chart:"popularity"}},{title:"ChatGPT productivity in the US a day ago",input:{store:"chatgpt",chart:"category:productivity",region:"us",at:"-24h"}},{title:"ChatGPT productivity in Germany",input:{store:"chatgpt",chart:"category:productivity",region:"de"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"rows[].position":"observed","rows[].prev":"observed","rows[].prev_day":"observed","rows[].is_new":"derived","rows[].launched_at":"derived",dropped:"derived","rows[].category":"observed","rows[].linked":"derived","rows[].first_seen_at":"observed","rows[].kind_position":"derived"}}),$v=C({name:"charts_regions_get",resource:"charts",path:"/v1/charts/{store}/{chart}/regions",summary:"One ChatGPT chart in every country at once: the top apps of the US list with each app's position per country.",description:"Use to compare where a chart differs by country. ChatGPT only (the other stores are one worldwide catalog). Positions are 1-based; null means not in that country's list. Countries the store refuses are left out and named in meta.coverage.",input:s.object({store:b.store,chart:b.chart,limit:b.limit.default(20)}),data:s.object({chart:ap,regions:s.array(s.object({region:s.string(),as_of:s.string().describe("The time of that region's latest list, which its positions come from")})),total:s.number().int().describe("Apps in the list the rows follow"),region_count:s.number().int().describe("Countries with a current list, which listed_in counts against"),rows:s.array(s.object({app:s.string(),slug:Me,name:s.string().nullable(),url:s.string(),icon:O(s.string().nullable()),positions:s.record(s.string(),s.number().int().nullable()),listed_in:s.number().int().describe("How many of those countries list the app")}))}),examples:[{title:"ChatGPT productivity by country",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:()=>({store:"chatgpt",region:null,countries:"unavailable"})},basis:{"rows[].positions":"observed"}});var kv=C({name:"featuring_get",resource:"featuring",path:"/v1/featuring/{store}",summary:"Every section of a store's home page now, each with its apps and their recent movement.",description:"Use for what a store features on its home page. Positions are 1-based within each section. Claude's one section is its directory's Trending strip.",input:s.object({store:b.store,region:b.region.optional()}),data:s.object({store:s.enum(A),region:s.string(),sections:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),rows:s.array(Ur)}))}),examples:[{title:"ChatGPT's home page in the US",input:{store:"chatgpt"}},{title:"ChatGPT in Germany",input:{store:"chatgpt",region:"de"}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"sections[].rows[].position":"observed","sections[].rows[].prev":"observed","sections[].rows[].is_new":"derived"}}),wv=C({name:"featuring_history",resource:"featuring",path:"/v1/featuring/{store}/history",summary:"Featuring intervals per app or shelf, including apps that have left, over a bounded window.",description:"Filter app, shelf or country. Default 24h; max 30 days. baseline: on the shelf when the window starts; first_observed: its earliest entry on record, which may not be its first ever. left=null: no exit on record. A region without data cannot show an exit.",input:s.object({store:b.store,app:b.app.optional(),chart:b.chart.optional(),region:b.region.optional(),since:b.since.default("-24h"),at:b.at.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),since:s.string(),until:s.string(),total:s.number().int(),rows:s.array(s.object({app:s.string(),name:s.string().nullable(),chart:s.string(),title:s.string().nullable(),region:s.string(),entered:s.string().nullable(),entered_before_window:s.boolean(),entry_kind:s.enum(["baseline","first_observed","observed_enter"]),left:s.string().nullable(),observed_at:s.string(),url:s.string(),days:O(s.array(s.object({day:s.string().describe("YYYY-MM-DD (UTC)"),position:s.number().int().nullable().describe("The app's slot on the shelf at the day's end; null: not on it")})).describe("Each day of the window with data in the shelf's country, oldest first; a day without data is left out"))}))}),examples:[{title:"ChatGPT featured shelf history",input:{store:"chatgpt",chart:"home:featured",region:"us"}},{title:"One app's featuring history",input:{store:"chatgpt",app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Cursor featuring",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"rows[].entered":"observed","rows[].left":"observed","rows[].observed_at":"observed","rows[].entered_before_window":"derived","rows[].days":"observed"}});var fa=s.number().int(),Er=s.string(),xv=C({name:"freshness_get",resource:"freshness",summary:"Our own service monitoring: each store's data status and open issues. It may change.",description:"Use to judge how fresh the data is or why a region is missing. Measured when asked, never cached. With region, adds that region's latest job.",input:s.object({region:b.region.optional()}),data:s.object({status:s.enum(["ok","degraded"]),issues:s.array(s.string()),checked_at:Er,collector_seen:Er.nullable().describe("The collector's last poll"),cron:s.object({t:Er,probe:s.string().nullable()}).nullable(),refused_regions:s.array(s.string()).describe("ChatGPT regions the store refused through every relay in the last day: their catalog data is unavailable"),regions:s.array(ep).describe("Every store and region with data: its latest snapshot and whether it is current, stale or unavailable"),exits_24h:s.array(s.object({provider:s.string().nullable(),tries:fa,blocked:fa,regions:s.array(s.string())})).describe("Tries per relay provider in the last day"),stores:s.array(s.object({store:s.enum(A),runs:fa.describe("Successful runs ever"),last_run:Er.nullable()})),slots:s.array(s.object({region:s.string(),slot:s.string().describe("UTC date and hour the slot starts, e.g. 2026-10-13T09"),ok:s.boolean(),failed:fa,error:s.string().nullable()})).describe("ChatGPT runs in the last 24 hours, per region and slot"),crawl:s.object({region:s.string(),status:s.string(),requested_at:Er,claimed_at:Er.nullable(),error:s.string().nullable()}).nullable().describe("With region: its latest job")}),examples:[{title:"Service status",input:{}},{title:"Germany's latest job",input:{region:"de"}}],cache:{kind:"none"},basis:{status:"derived",issues:"derived","stores[].runs":"observed","slots[].ok":"observed","regions[].as_of":"observed","regions[].status":"derived"}});var Sv=C({name:"leaderboards_get",resource:"leaderboards",path:"/v1/leaderboards/{store}/{metric}",summary:"A store's apps ranked by one metric, labelled by its source basis, such as installs, with the value each replaced.",description:"Use for who leads on installs, popularity score or stars. The metrics a store ranks by are in the stores resource; ChatGPT publishes none. kinds: only apps of these kinds, ranked among themselves; a value qualified by another store is ignored.",input:s.object({store:b.store,metric:b.metric,kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),metric:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string(),total:s.number().int().describe("Apps with a value (of the kinds asked)"),rows:s.array(pe.extend({position:s.number().int(),value:s.number(),prev:s.number().nullable(),t:s.string().describe("When the value last changed"),reported_at:s.string(),cadence:s.string(),next_expected_at:s.string(),stale:s.boolean(),prev_t:s.string().nullable()}))}),examples:[{title:"Top 10 Claude plugins by installs",input:{store:"claude",metric:"installs",limit:10}},{title:"cursor.directory by installs",input:{store:"cursor",metric:"dir_installs"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].position":"derived","rows[].value":"store_reported","rows[].prev":"store_reported"}});var K=s.number().int(),$t=K.nullable(),ga=s.object({name:s.string(),tools:K,servers:K}),Bx=s.object({n:K,of:K}),Iv=C({name:"market_get",resource:"market",summary:"Each store's size and shape: apps per kind, weekly launches over a year, list sizes, and open MCP toolset statistics.",description:"Use for market-level questions: how big a store is, how fast it grows, how MCP servers are built. Not per app; use listings_profile.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(A),label:s.string(),url:s.string(),apps:K,kinds:s.partialRecord(s.enum(Q),K),last_run:s.string().nullable(),launches:s.object({basis:s.enum(Pe).describe("derived on ChatGPT (decoded from app ids), store_reported on Claude and Cursor"),last_7d:K,weeks:s.array(s.object({week:s.string().describe("Monday the week starts"),n:K})),weekdays:s.array(s.object({day:K.min(0).max(6).describe("0 Monday to 6 Sunday"),n:K})).describe("Every app with a launch date by its weekday: the day its id was created on ChatGPT, the store's launch date elsewhere")}),top10:s.object({frozen:K,of:K}).nullable().describe("Category lists (ChatGPT categories, Claude departments of 10 or more) whose top 10 held the same apps in the same order as the previous day; null on Cursor and Grok Bot"),lists:O(s.array(s.object({chart:s.string(),title:s.string().nullable(),apps:K,collection:s.boolean().describe("A curated collection rather than a category")})).describe("Category lists in the main region, largest first"))})),mcp:s.object({servers:K.describe("MCP servers linked from any store"),by_status:s.array(s.object({status:s.string().nullable(),n:K})),snapshots:K,cross_store:K.describe("Servers linked from apps in more than one store"),url:s.string().describe("The Market pulse page"),open:s.object({servers:K,tools:K,tools_per_server:s.object({median:$t,p90:$t,max:$t,histogram:O(s.array(s.object({bucket:s.string(),n:K})))}),annotations:s.array(ga.extend({tools_true:$t.optional()})).describe("Tools and servers that set each annotation; tools_true: tools setting the hint to true"),output_schema:ga.omit({name:!0}),meta:O(ga.omit({name:!0})),params:s.array(ga).describe("Most common input parameter names"),params_per_tool:s.object({median:$t,p90:$t,none_pct:s.number().nullable(),required_pct:s.number().nullable()}),description_len:s.object({median:$t,p90:$t}),protocols:s.array(s.object({version:s.string(),n:K}))}).describe("Across every open server's latest toolset")}),facts:O(s.object({chatgpt:s.object({apps_sdk:K.describe("Apps SDK apps (family plugin_asdk_app)"),top100:s.object({every:K.describe("Listed in every country with data"),only_us:K.describe("Listed in the United States only"),of:K.describe("Apps in a US top 100 of any category list, collections included"),countries:K.describe("Countries with data")}),shelves_in_order:Bx.describe("US home shelves that are an unbroken run of their category list, of every shelf")}).nullable().describe("null unless ChatGPT is asked for"),claude:s.object({in_most_popular:K.describe("Listings Most popular ranks"),mcp_auth:K.describe("Listings whose MCP server asks for a sign-in (mcp_status auth)"),mcp_status:s.array(s.object({status:s.string(),n:K})).describe("Listings that link an MCP server, by its latest status (the best of several)")}).nullable().describe("null unless Claude is asked for"),products:s.object({n:K.describe("Apps listed in more than one store"),top:s.array(s.string()).describe("The first names, most stores first")})}).describe("Headline numbers for the Stats pages"))}),examples:[{title:"Every store",input:{}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:()=>({daily:!0})},basis:{"stores[].apps":"observed","stores[].launches.weeks[].n":"derived","stores[].launches.weekdays[].n":"derived","stores[].top10":"derived","mcp.by_status":"observed","mcp.cross_store":"derived","mcp.open":"observed",facts:"derived"}});var zv=C({name:"mcp_toolset_get",resource:"mcp",path:"/v1/mcp/toolsets",summary:"An MCP server's tools at a time, or what changed between two of its toolset versions: tools added, removed and changed.",description:"Use for an app's or a server's toolset now, at a past time, or against an earlier version. Reads OpenApps' stored toolsets, the tools each server lists without a sign-in; it never calls the server.",input:s.object({app:b.app.optional(),server:b.server.optional(),at:b.at.optional(),diff_from:b.diff_from.optional()}),data:s.object({servers:s.array(mv)}),examples:[{title:"Context7's server now",input:{server:"https://mcp.context7.com/mcp"}},{title:"What changed in Context7's tools this week",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ",diff_from:"-7d"}},{title:"Context7's tools on 1 January 2099",input:{server:"https://mcp.context7.com/mcp",at:"2099-01-01T12:00:00Z"}}],cache:{kind:"snapshot",scope:e=>({store:e.app?bt(e.app).store:null,region:null,toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed","servers[].diff":"derived","servers[].apps":"observed"}}),ha=s.number().int(),Bt=s.string().nullable(),Pv=s.object({id:ha,url:s.string(),page:up,host:Bt,status:Bt,transport:Bt,auth_hint:Bt,checked_at:Bt}),Ov=C({name:"mcp_servers_list",resource:"mcp",path:"/v1/mcp/servers",summary:"The remote MCP servers that store listings link to, open ones first, with tool counts and the apps that link each.",description:"Use to browse or count MCP servers by status or store. For one server's tools, use mcp_servers_get or mcp_toolset_get.",input:s.object({status:b.status.optional(),store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:ha,rows:s.array(Pv.extend({tool_count:ha.nullable().describe("Tools in its latest toolset; null if never seen without sign-in"),snapshots:ha.describe("Toolset versions seen"),stores:s.array(s.enum(A)),apps:s.array(s.object({app:s.string(),name:Bt,url:s.string()}))}))}),examples:[{title:"Open servers",input:{status:"open"}},{title:"Servers Claude links to",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"rows[].status":"observed","rows[].tool_count":"observed","rows[].stores":"observed"}}),jv=C({name:"mcp_servers_get",resource:"mcp",path:"/v1/mcp/servers/{server}",summary:"One MCP server: its status, the apps that link to it, its latest toolset with every tool, and its toolset history.",description:"Use for everything about one server by id or URL. For its tools at a past time or a diff between versions, use mcp_toolset_get.",input:s.object({server:b.server}),data:s.object({server:Pv.extend({error:Bt.describe("The last check's error")}),apps:s.array(pe),toolset:lp.nullable().describe("Latest toolset; null if never seen without sign-in"),history:s.array(ma)}),examples:[{title:"Context7's server",input:{server:"https://mcp.context7.com/mcp"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null,toolsets:!0})},basis:{"server.status":"observed","toolset.tools":"observed",apps:"observed"}});var Gn=s.string(),Av=C({name:"movers_list",resource:"movers",path:"/v1/movers/{store}",summary:"What moved in a store's latest data: rank movers in its lead charts, featured-list entries and exits, metric changes.",description:"Use for a store's headlines: who climbed, fell or entered its charts, joined or left a featured list, or changed installs or scores. By default every ranking chart, each product once where it moved most; chart: one chart, every mover. For a span of time, use changes_list.",input:s.object({store:b.store,chart:b.chart.optional(),window:b.window.optional(),max_position:b.max_position.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(A),region:s.string().describe("The store's main region, which movement is measured in"),charts:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),region:s.string(),url:s.string(),week:O(Gn.nullable().describe("window=7d only: the time, ~7 days earlier, of the data the rows are compared with")),rows:s.array(Ur).describe("Rows that moved, biggest move up or down first, at most 8 a chart; a product shows once across the charts (with chart: every row)")})),featuring:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),entered:s.array(pe),left:s.array(pe)})).describe("Entries and exits of the store's featured lists in the latest data"),metrics:s.array(s.object({metric:s.string(),title:s.string(),unit:s.string(),basis:s.enum(Pe),rows:s.array(pe.extend({value:s.number(),prev:s.number(),change:s.number(),t:Gn,prev_t:Gn.nullable(),reported_at:Gn,cadence:s.string(),next_expected_at:Gn,stale:s.boolean()})).describe("Apps whose value moved past the noise floor since a week before the metric's latest update, biggest change first; prev 0: new")}))}),examples:[{title:"ChatGPT",input:{store:"chatgpt"}},{title:"Claude",input:{store:"claude"}},{title:"Cursor",input:{store:"cursor"}},{title:"Claude's Most popular over a week, top 50",input:{store:"claude",chart:"popularity",window:"7d",max_position:50}},{title:"Every Claude ranking's top 100",input:{store:"claude",max_position:100}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"charts[].rows[].position":"observed","charts[].rows[].prev":"observed","charts[].rows[].is_new":"derived","featuring[].entered":"derived","metrics[].rows[].change":"derived","charts[].rows[].prev_week":"observed","charts[].rows[].linked":"derived","charts[].rows[].kind_position":"derived"}});var Kx=365,Tv=C({name:"new_list",resource:"new",summary:"A store's apps launched since a time, newest first, by launch date (on ChatGPT, when the app's ID was created).",description:`Use for new releases. A ChatGPT app goes live days after its ID is created: sort=first_seen_at orders by go-live day, as the site does. since reaches back at most ${Kx} days. ChatGPT rows carry the app's category. kinds: only those kinds, counted among themselves (total and facets too).`,input:s.object({store:b.store,since:b.since.default("-24h"),sort:b.sort.default("released_at"),limit:b.limit.default(20),cursor:b.cursor.optional(),category:b.category.optional(),kind:b.kind.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(A),since:s.string(),until:s.string().describe("When the newest data is from"),total:s.number().int(),category_observation:s.enum(["available","unavailable","not_applicable"]),unfiltered_total:s.number().int(),rows:s.array(pe.extend({launched_at:O(s.string().nullable()),first_seen_at:s.string(),released_at:s.string().describe("launched_at, or first_seen_at without one"),release_basis:s.enum(Wh).describe("derived: decoded from the ChatGPT app id; observed: the day the app went live"),category:s.string().nullable().describe("First category list it is in (ChatGPT)"),linked:Cr,tags:O(nt),lag_days:s.number().int().nullable().describe("ChatGPT, with Pro (Launch lag): whole days from the app's ID being created to the day it went live; null on other plans, elsewhere or when unknown")})),facets:s.array(s.object({value:s.string(),total:s.number().int()})).describe("Release-window category or kind counts, before selection and pagination.")}),examples:[{title:"ChatGPT this week",input:{store:"chatgpt",since:"-7d"}},{title:"Claude in the last day",input:{store:"claude"}},{title:"ChatGPT apps that went live today",input:{store:"chatgpt",sort:"first_seen_at",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].category":"observed","rows[].lag_days":"derived","rows[].linked":"derived","rows[].tags":"derived"}});var Rr=e=>({store:bt(e.app).store,region:null}),Nv=C({name:"listings_search",resource:"listings",summary:"Apps matching the query by name, publisher, brand, tag or what they do, one row per app, exact names first.",description:`Use to find an app's ref from its name, a brand it works with or what it does ("send invoices"). One row per app: its listing that best matches, with its other stores in linked. Ties go to OpenApps Rank.`,input:s.object({query:b.query,publisher:b.publisher.optional(),store:b.store.optional(),kind:b.kind.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({rows:s.array(pe.extend({publisher:s.string().nullable(),best:Ve.nullable(),category:_t,tags:nt,linked:Cr}))}),examples:[{title:"Notion anywhere",input:{query:"notion"}},{title:"Context7 in Cursor",input:{query:"context7",store:"cursor"}},{title:"Linear by its publisher",input:{query:"linear",publisher:"Linear"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"observed","rows[].publisher":"observed","rows[].best":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived"}}),ot=s.array(s.object({value:s.string(),n:s.number().int()})),Cv=C({name:"listings_list",resource:"listings",path:"/v1/listings/list",summary:"Listings by store, kind, category, publisher, tags, MCP status, other stores and release; ranked, newest or A to Z.",description:"Use to browse the catalog by filters, e.g. Claude connectors tagged gmail. Each list filter keeps a listing with any of its values. tags: ids from tags_tree, match all or any; exclude leaves tags out. facets count each filter's values under the others. For a name, listings_search.",input:s.object({stores:b.stores.optional(),kinds:b.kinds.optional(),families:b.families.optional(),categories:b.categories.optional(),publishers:b.publishers.optional(),tags:b.tags.optional(),exclude:b.exclude.optional(),match:b.match.default("all"),linked:b.linked.optional(),statuses:b.statuses.optional(),availability:b.availability.optional(),released_since:b.released_since.optional(),query:b.query.optional(),scope:b.scope.optional(),group:b.group.optional(),sort_by:b.sort_by.default("rank"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:s.number().int().describe("Listings every filter keeps; with group=app, apps with one or more of them"),rows:s.array(la.extend({app_rank:s.number().int().nullable().optional().describe("group=app: the app's OpenApps Rank across stores; null: on no counted chart"),ranks:s.array(s.object({store:s.enum(A),rank:s.number().int()})).optional().describe("group=app: its rank in each store's OpenApps Rank, in store order")}).describe("A listing; with group=app, the app's best listing, carrying every tag of its listings")),facets:O(s.object({store:ot,kind:ot.describe("Store-qualified, e.g. claude:connector or chatgpt:apps_sdk"),family:ot,category:ot,publisher:s.array(s.object({value:s.string().describe("Publisher key"),name:s.string(),n:s.number().int()})).describe("The 100 with most listings, then any asked for"),status:ot,linked:ot,availability:ot,released:ot.describe("Listings released in the last 7 and 30 days before the newest data; value is a released_since"),tags:ot.describe("Listings with each tag among those the other filters keep, after exclude and, with match all, every tag asked for")}).describe("Per filter, how many listings each value has among those the other filters keep"))}),examples:[{title:"Every listing, best ranked first",input:{}},{title:"Claude connectors that work with Notion",input:{stores:["claude"],kinds:["connector"],tags:["notion"]}},{title:"Listings of apps on two or more stores, newest first",input:{tags:["multi-store"],sort_by:"new"}}],cache:{kind:"snapshot",scope:e=>({store:e.stores?.length===1?e.stores[0]:null,region:null,toolsets:!0})},basis:{"rows[].best":"derived","rows[].prev_day":"derived","rows[].prev_week":"derived","rows[].countries":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived","rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].mcp_status":"observed",facets:"derived"}}),Uv=e=>e.apps?.length?{store:null,region:null}:Rr(e),Ev=C({name:"listings_get",resource:"listings",path:"/v1/listings/{app}",summary:"One listing: name, kind, publisher, description, launch and go-live dates, and its app with the app's other listings.",description:`Use for what a listing is; part_of names its app, linked the app's listings in other stores. The ref may hold the slug. apps: up to ${Mn.plus.compareApps-1} more listings to compare, with Pro. For ranks, metrics or tools, use listings_ranks_current, listings_metrics or listings_tools.`,input:s.object({app:b.app,apps:b.apps.optional()}),data:s.object({app:pa,apps:s.record(s.string(),pa).optional().describe("With apps: each of those listings by its ref, in the order asked, as app is given")}),examples:[{title:"A Claude connector",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}},{title:"A listing whose app is in two stores",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}},{title:"A Claude connector by its slug",input:{app:"claude:notion"}}],cache:{kind:"snapshot",scope:e=>({...Uv(e),countries:"status"})},basis:{"app.name":"observed","app.publisher":"observed","app.availability[].status":"derived","app.availability[].as_of":"observed","app.launched_at":"derived","app.first_seen_at":"observed","app.linked":"derived","app.tags":"derived"}}),Rv=C({name:"listings_ranks_current",resource:"listings",path:"/v1/listings/{app}/ranks/current",summary:"Every chart a listing is in now: best position and region, position in the main region, and how many regions list it.",description:"Use for where a listing ranks today. Positions are 1-based, each from its region's latest data (as_of). Countries the store refuses are left out and named in meta.coverage.",input:s.object({app:b.app}),data:s.object({app:s.string(),charts:s.array(sp)}),examples:[{title:"Where a ChatGPT listing ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:e=>({...Rr(e),countries:"unavailable"})},basis:{"charts[].positions[].position":"observed","charts[].positions[].as_of":"observed","charts[].best":"derived","charts[].primary":"observed","charts[].regions":"derived","charts[].kind_position":"derived","charts[].prev_day":"derived","charts[].prev_week":"derived"}}),Zv=C({name:"listings_metrics",resource:"listings",path:"/v1/listings/{app}/metrics",summary:"A listing's latest value of each metric its store publishes, with the value it replaced; each carries its basis.",description:"Use for installs, popularity scores and GitHub stars. Series change-only: t is when the value last changed.",input:s.object({app:b.app}),data:s.object({app:s.string(),metrics:s.array(cp)}),examples:[{title:"Claude installs",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:Rr},basis:{"metrics[].t":"observed","metrics[].prev":"observed"}}),Lv=C({name:"listings_tools",resource:"listings",path:"/v1/listings/{app}/tools",summary:"The MCP servers a listing links to, each with its latest tool list.",description:"Use for what a listing's MCP server exposes. Servers that need sign-in have status auth and no snapshot.",input:s.object({app:b.app}),data:s.object({app:s.string(),servers:s.array(dp)}),examples:[{title:"Context7's tools via Claude",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}}],cache:{kind:"snapshot",scope:e=>({...Rr(e),toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed"}}),pp=s.object({url:s.string(),width:s.number().int(),height:s.number().int()}),Mv=C({name:"listings_widgets",resource:"listings",path:"/v1/listings/{app}/widgets",summary:"The widgets a ChatGPT listing's tools show, as images rendered with OpenApps' sample account.",description:"Use for what an app looks like inside ChatGPT. Each widget is one tool's current template, rendered in a browser with input and output a model wrote for a fictional OpenApps account, never a user's data. Images are 720 px wide (mobile 390 px); empty for listings without rendered widgets.",input:s.object({app:b.app}),data:s.object({app:s.string(),widgets:s.array(s.object({tool:s.string(),title:s.string().nullable(),description:s.string().nullable(),template:s.string().describe("The template's resource URI"),since:s.string().describe("Since when the app has used this version of the template"),images:s.object({light:pp,dark:pp,mobile:pp.nullable()})})).describe("In the order the app lists its tools")}),examples:[{title:"Alpha Docs's widgets",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Rr},basis:{"widgets[].tool":"observed","widgets[].template":"observed","widgets[].images":"derived"}}),Vv=C({name:"listings_ranks_history",resource:"listings",path:"/v1/listings/{app}/ranks",summary:"Rank series of every chart a listing is in now: 14 days or from-to in the chart's home region, the latest elsewhere.",description:`Use for how positions moved. A point is a change (lists are stored on change); a series' last point is carried to its region's latest data, marked carried. apps adds up to ${Mn.plus.rankHistoryApps-1} listings beside app; more than one listing, or over ${Mn.free.history.ranks} days back, needs Pro.`,input:s.object({app:b.app,apps:b.apps.optional(),from:b.from.optional(),to:b.to.optional()}),data:s.object({app:s.string(),since:s.string().describe("Start of the home-region window"),until:s.string().nullable().describe("End of the window: to, else the latest data"),series:s.array(s.object({app:s.string().describe("The listing the series is of"),chart:s.string(),title:s.string().nullable(),kind:s.string(),region:s.string(),url:s.string(),points:s.array(s.object({t:s.string().describe("When the position was recorded; a carried point's is the time of the latest data, the list unchanged"),position:s.number().int(),kind_position:s.number().int().nullable().describe("Among its own kind, in lists that join kinds; else null"),carried:s.boolean()}))}))}),examples:[{title:"A ChatGPT listing's ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Two Claude listings over a week",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae",apps:["claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"],from:"-7d"}}],cache:{kind:"snapshot",scope:e=>({...Uv(e),countries:"unavailable"})},basis:{"series[].points[].position":"observed","series[].points[].kind_position":"derived","series[].points[].t":"observed","series[].points[].carried":"derived"}}),Dv=s.object({hash:s.string(),seen_since:s.string(),seen_until:s.string(),data:O(s.record(s.string(),s.unknown()).describe("The record as the store returned it"))}),Fv=C({name:"listings_versions",resource:"listings",path:"/v1/listings/{app}/versions",summary:"Every version of a store listing and of its detail record, oldest first, each with its date.",description:`Use for when a listing changed and what it said. A version is recorded only when the store's record changes. Detail records are tracked for ChatGPT, Perplexity and Muse (their tool lists). Versions last seen over ${Mn.free.history.ranks} days ago need Pro; each record's latest always shows.`,input:s.object({app:b.app}),data:s.object({app:s.string(),listing:s.array(Dv),detail:s.array(Dv)}),examples:[{title:"A ChatGPT listing's versions",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Rr},basis:{"listing[].data":"observed","detail[].data":"observed","listing[].seen_since":"observed"}});var We=s.number().int(),Jn=We.nullable().optional().describe("Position on the row's best chart then (best.chart); null: not listed then");var Bv=C({name:"tags_tree",resource:"tags",summary:"Every tag with its facet, parent and app count per store.",description:"Use to find tag ids for listings_list and tags_get. A tag counts every app with a narrower tag too. Use-case (job), works and for tags are per app, cap tags per listing. kinds: count only these kinds, as listings_list filters them.",input:s.object({store:b.store.optional(),kinds:b.kinds.optional()}),data:s.object({version:s.string().describe("The tag vocabulary's version"),tagger:s.string().describe("Methods that assign tags"),tags:s.array(Kn.extend({synonyms:s.array(s.string()).describe("Other names it answers to")})).describe("Vocabulary order: each facet's tree, a tag before the tags under it"),facets:s.array(s.object({facet:da,label:s.string(),hint:s.string(),apps:We.describe("Apps with at least one of its tags")})),stores:s.array(s.object({store:s.enum(A),apps:We.describe("Apps tagged: every app OpenApps has seen in the store, of the kinds asked")}))}),examples:[{title:"Every tag",input:{}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tags[].n":"derived","tags[].stores":"derived","facets[].apps":"derived","stores[].apps":"observed"}}),Kv=C({name:"tags_get",resource:"tags",path:"/v1/tags/{tag}",summary:"One tag: path, narrower tags, counts, top apps per store, related tags.",description:"Use for one tag's apps and neighbours. Old ids answer their successor, else gone. top: per store, best chart place first, limit each. related: tags its apps carry more often than apps at large. kinds: count and list these kinds only.",input:s.object({tag:b.tag,store:b.store.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20)}),data:s.object({tag:Kn,url:s.string().describe("Its page"),top:s.array(la).describe("By store: apps with the tag, best chart place first, at most limit"),kpis:s.object({new_30d:We.describe("Apps with the tag created (ChatGPT: the app's id) or launched in the last 30 days"),with_mcp:s.object({n:We.describe("Claude apps with the tag whose MCP server has a status (listings_list mcp_status)"),of_claude:We.describe("Claude apps with the tag")}),on_both:We.describe("Apps with the tag whose product is listed in another store too")}),weeks:s.array(s.object({week:s.string().describe("The week's Monday, YYYY-MM-DD"),n:We.describe("Apps with the tag created (ChatGPT) or launched that week")})).describe("Every week of the window to the newest data's, oldest first"),path:s.array(s.object({id:s.string(),label:s.string()})).describe("From its top tag down to it"),parent:Kn.nullable(),children:s.array(Kn).describe("Its narrower tags"),siblings:s.array(s.object({id:s.string(),label:s.string(),n:We.describe("Apps carrying it, in the stores asked for")})).describe("Other tags under its parent, in vocabulary order; none for a top tag"),related:s.array(s.object({id:s.string(),label:s.string(),facet:da,n:We.describe("Apps with both tags"),lift:s.number().describe("How many times more often the tag's apps carry it than apps at large")})).describe("At most 10, strongest first, without its ancestors and narrower tags")}),examples:[{title:"Apps that work with Notion",input:{tag:"notion"}},{title:"Developer tools in Claude",input:{tag:"developer-tools",store:"claude",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tag.n":"derived","top[].best":"derived","top[].tags":"derived","top[].category":"observed","top[].linked":"derived","top[].prev_day":"observed","top[].prev_week":"observed","kpis.new_30d":"derived","kpis.with_mcp.n":"derived","kpis.on_both":"derived","weeks[].n":"derived","children[].n":"derived","siblings[].n":"derived","related[].n":"derived","related[].lift":"derived"}});var Gv=s.string(),Ue=s.number().int(),Jv=s.number().describe("Percent, one decimal"),Gx=s.object({app:s.string(),slug:Me,kind:s.enum(Q),name:s.string().nullable(),icon:O(s.string().nullable().describe("The listing's icon on the OpenApps site")),best:Ve,prev_day:Jn,prev_week:Jn,day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier")}).nullable().describe("Its listing with the best place now, in the stores asked; null when none ranks"),Wv=C({name:"publishers_list",resource:"publishers",summary:"Publishers across stores, one per publisher key: apps per store, and their app with the best chart place now.",description:"Use to rank developers by how many apps they list or by their best chart position. With store, only publishers with apps there, counted, ranked and pictured by those apps; stores still lists every store. summary: the selection's figures, and how many apps name a publisher.",input:s.object({store:b.store.optional(),publisher:b.publisher.optional(),order:b.order.default("apps"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:Ue.describe("Publishers in the selection"),rows:s.array(op.extend({top:Gx,tags:s.array(s.string()).describe("The two tags that describe its listings most often")})),summary:s.object({publishers:Ue.describe("Publishers in the selection"),on_both:Ue.describe("Of them, those with apps in more than one store"),chatgpt_with_developer_pct:Jv.describe("ChatGPT apps whose listing names a developer, percent"),chatgpt_with_developer:Ue,claude_with_publisher_pct:Jv.describe("Claude apps that name a publisher, percent"),claude_with_publisher:Ue})}),examples:[{title:"Publishers with the most apps",input:{}},{title:"Claude publishers by best rank",input:{store:"claude",order:"rank"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed","rows[].apps":"observed","rows[].best":"derived","rows[].top":"derived","rows[].tags":"derived","summary.on_both":"derived","summary.chatgpt_with_developer_pct":"derived","summary.claude_with_publisher_pct":"derived"}}),qv=C({name:"publishers_get",resource:"publishers",path:"/v1/publishers/{key}",summary:"One publisher's listings in every store, each with its category and best chart place now, and the apps they belong to.",description:"Use for everything one developer lists. key is the publisher key from publishers_list, or any name the publisher lists under (Figma, Inc. or figma); another legal name has its own key. identities: the websites and MCP hosts its listings name, the values with OpenApps Pro, the count with every plan.",input:s.object({key:b.key}),data:s.object({publisher:op,apps:s.array(pe.extend({best:Ve.nullable(),category:_t,launched_at:Gv.nullable(),first_seen_at:Gv,prev_day:Jn,prev_week:Jn,day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier")})).describe("Best place first, then by store and name"),products:s.array(s.object({product:s.string().describe("Same value: same app, within one answer"),slug:s.string().describe("apps_get takes it"),name:s.string().nullable(),listings:s.array(s.object({store:s.enum(A),app:s.string(),url:s.string()}))})).describe("Apps one of its listings belongs to, with every listing of each"),countries:s.object({listed:Ue,of:Ue}).nullable().describe("Its ChatGPT app listed in the most countries: in how many of the countries with current data; null without a ChatGPT app"),shelves:s.object({n:Ue,names:s.array(s.string())}).describe("Its ChatGPT apps on a ChatGPT home shelf now, and their names"),with_mcp:s.object({n:Ue.describe("Claude apps whose MCP server has a status (listings_list mcp_status)"),of_claude:Ue.describe("Its Claude apps")}),identities:s.object({n:Ue.describe("Distinct websites and MCP hosts its listings name"),websites:s.array(s.string()).optional().describe("Website domains; OpenApps Pro only"),hosts:s.array(s.string()).optional().describe("MCP server hosts; OpenApps Pro only")}),others_on_both:s.array(s.object({key:s.string(),name:s.string(),listings:Ue})).describe("Up to 8 other publishers with apps in more than one store, most apps first")}),examples:[{title:"A publisher by key",input:{key:"context7"}},{title:"A publisher by name",input:{key:"Upstash"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"publisher.name":"derived","publisher.best":"derived","apps[].best":"derived","apps[].category":"observed","apps[].launched_at":"derived","apps[].first_seen_at":"observed","apps[].prev_day":"observed","apps[].prev_week":"observed","products[].listings":"derived","countries.listed":"observed","shelves.n":"observed","with_mcp.n":"observed","identities.n":"observed","others_on_both[].listings":"observed"}});var ce=s.number().int(),Hv={score:s.number().describe("Mean daily points over the window: 1/position on each counted chart, weighted"),rank:ce.describe("By score among the store's apps, 1 first"),tier:ce.describe("3: top 10 on a counted chart today, 2: top 50, 1: charted within the window"),tier_title:s.string(),days_charted:ce,peak:ce.describe("Best position on a counted chart in the window"),momentum:s.number().nullable().describe("Score minus the previous window's; null until that window has enough days")},Jx=pe.extend({...Hv,chart_rank:ce.nullable().describe("Rank by score among the apps on the chart asked for"),kind_peak:ce.describe("peak counted among the listing's own kind on a chart that joins kinds (Claude's Most popular and its tag lists, cursor.directory), as chart pages number it; else peak")}),Wx=s.object({store:s.enum(A),target:s.string(),day:s.string(),n:ce,rho:s.number().nullable(),half:s.number().nullable()}),qx=s.object({method:s.string(),title:s.string(),window_days:ce,published:s.boolean(),figures:s.record(s.string(),s.string()),validation:s.array(Wx).describe("Newest check against each published count: Spearman rho, share on the same side of the median")}),Xv=C({name:"scores_list",resource:"scores",path:"/v1/scores/{store}",summary:"A store's apps by OpenApps Rank: a 28-day aggregate of every chart that orders by popularity, with tier and momentum.",description:"Use for who is popular in a store over the last month, not one day's chart. chart narrows to the apps on one chart, ranked among themselves. Derived from store charts, not a usage count.",input:s.object({store:b.store,chart:b.chart.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(Jx)}),examples:[{title:"Top ChatGPT apps by OpenApps Rank",input:{store:"chatgpt",limit:10}},{title:"Within one chart",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].chart_rank":"derived","rows[].kind_peak":"derived"}}),Yv=C({name:"scores_get",resource:"scores",path:"/v1/scores/{app}",summary:"One app's OpenApps Rank figures, its OpenApps Rank within each chart, and daily score and rank series.",description:"Use for how an app has been doing over the last month and whether it is rising. Apps off every counted chart have no figures (charted: false).",input:s.object({app:b.app}),data:s.object({app:s.string(),method:s.string(),charted:s.boolean(),day:s.string().nullable(),figures:s.object(Hv).nullable(),chart_ranks:s.array(s.object({chart:s.string(),rank:ce})).describe("Its OpenApps Rank among the apps scored on each chart, not its position in the chart (listings_ranks_current has those)"),series:O(s.array(s.object({day:s.string(),score:s.number(),rank:ce})))}),examples:[{title:"A Claude connector's rank over time",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:e=>({store:bt(e.app).store,region:null})},basis:{"figures.score":"derived","figures.rank":"derived","figures.momentum":"derived","chart_ranks[].rank":"derived","series[].score":"derived"}}),Qv=C({name:"scores_methods",resource:"scores",summary:"How OpenApps Rank is computed, which version is published, and how well each version agrees with published counts.",description:"Use to explain or judge the score. Validation pairs a method's scores with counts stores publish (Claude installs and popularity, cursor.directory installs).",input:s.object({}),data:s.object({published:s.string(),methods:s.array(qx)}),examples:[{title:"Methods and their validation",input:{}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"methods[].validation[].rho":"derived","methods[].validation[].half":"derived"}}),eb=s.object({slug:s.string().describe("The app's slug (apps_get)"),name:s.string().nullable(),icon:s.string().nullable().describe("Its best-ranked listing's icon"),score:s.number().describe("Its score under method"),tier:ce.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window"),rank:ce.describe("Among apps across every store, 1 first"),listings:s.array(s.object({store:s.enum(A),app:s.string().describe("Listing ref"),rank:ce.describe("The listing's OpenApps Rank in its store")})).describe("Its charted listings")}),Hx=eb.extend({rank:ce.describe("Among the apps with the tag"),overall_rank:ce.describe("Rank before the tag filter")}),tb=C({name:"scores_apps",resource:"scores",path:"/v1/scores/apps",summary:"Apps across every store by OpenApps Rank: the sum over stores of 1/rank of each app's best listing there.",description:"Use for who is popular across stores, not in one. By oa_app@2 (scores_methods). kinds keeps only listings of those kinds and ranks each store's kept listings among themselves; without it, every charted listing counts, Cursor's rules included.",input:s.object({kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(eb)}),examples:[{title:"Top apps across stores",input:{limit:10}},{title:"Apps only, no Claude plugins or Cursor rules",input:{kinds:["app","claude:connector","cursor:plugin","cursor:directory_mcp","grokbot:plugin"],limit:10}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}}),rb=C({name:"scores_tag",resource:"scores",path:"/v1/scores/tags/{tag}",summary:"Apps with one tag by OpenApps Rank, in one store or all.",description:"Use for the top apps in a category. With store, by the best listing's OpenApps Rank there; without, by oa_app@2 (scores_methods). tag: a v1 domain, use or audience value; a domain counts only as an app's primary.",input:s.object({tag:b.tag,store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({tag:s.object({facet:s.string(),value:s.string(),title:s.string()}),store:s.enum(A).nullable(),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(Hx)}),examples:[{title:"Video apps",input:{tag:"video"}},{title:"Developer tools on Claude",input:{tag:"developer-tools",store:"claude",limit:10}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].overall_rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}});var nb=C({name:"stores_get",resource:"stores",summary:"The app stores OpenApps tracks: listings per kind, regions, charts and metrics.",description:"Use for which stores, regions, charts and metrics exist and how fresh each region is. Chart names here are what charts_get takes.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(A),label:s.string(),apps:s.number().int().describe("Listings that are apps: every kind but cursor.directory rules, which kinds still counts"),kinds:s.partialRecord(s.enum(Q),s.number().int()),url:s.string(),last_run:s.string().nullable(),regions:s.array(s.object({region:s.string(),last_run:s.string(),status:s.enum(Qd).describe("Whether the region's latest data can stand for now; unavailable: the store gives no data there now")})),charts:s.array(s.object({chart:s.string(),kind:O(s.string()),title:s.string().nullable(),url:O(s.string()),size:O(s.number().int().nullable().describe("Apps in its latest list in its home region; null before the first"))})).optional(),metrics:s.array(s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string().describe("How often it is read: daily or weekly")}))}))}),examples:[{title:"Every store",input:{}},{title:"Claude only",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,countries:"status"})},basis:{"stores[].apps":"observed","stores[].regions[].last_run":"observed","stores[].charts[].size":"observed"}});var mp={changes_list:yv,movers_list:Av,stores_get:nb,freshness_get:xv,charts_get:_v,charts_regions_get:$v,featuring_get:kv,featuring_history:wv,leaderboards_get:Sv,new_list:Tv,listings_search:Nv,listings_list:Cv,listings_get:Ev,listings_ranks_current:Rv,listings_ranks_history:Vv,listings_metrics:Zv,listings_tools:Lv,listings_widgets:Mv,listings_versions:Fv,apps_get:fv,apps_list:gv,publishers_list:Wv,publishers_get:qv,tags_tree:Bv,tags_get:Kv,market_get:Iv,mcp_toolset_get:zv,mcp_servers_list:Ov,mcp_servers_get:jv,scores_apps:tb,scores_list:Xv,scores_tag:rb,scores_get:Yv,scores_methods:Qv};function ib(e,r=e.path){let i=r.split("/").filter(Boolean).flatMap(o=>{let t=/^\{([a-z_]+)\}$/.exec(o)?.[1];if(!t)return[{literal:o}];let n=qh[t];return n?Object.keys(n.parts).map(a=>({param:t,part:a})):[{param:t}]});return{op:e,segments:i,template:`/${i.map(o=>"literal"in o?o.literal:`{${o.part??o.param}}`).join("/")}`}}var ob=Object.values(mp).map(e=>ib(e));var Xx=[["/v1/apps/list","listings_list"],["/v1/apps/{app}","listings_get"],["/v1/apps/{app}/ranks/current","listings_ranks_current"],["/v1/apps/{app}/ranks","listings_ranks_history"],["/v1/apps/{app}/metrics","listings_metrics"],["/v1/apps/{app}/tools","listings_tools"],["/v1/apps/{app}/versions","listings_versions"],["/v1/products","apps_list"],["/v1/products/{slug}","apps_get"]],iN=Xx.map(([e,r])=>ib(mp[r],e));var ab=(e,r)=>Bh(e.segments,r,(i,o)=>{throw new Mt("bad_request",o,{param:i})}),fp="OpenApps-Contract";var Yx=new Set(["$schema","$id","detailed"]),Qx=new Set(["additionalProperties","propertyNames","enum","required"]),eS=new Set(["maxLength","minLength","minItems","maxItems","minimum","maximum","pattern"]),tS=e=>e.detailed===!0,rS=e=>!!e&&typeof e=="object"&&Object.keys(e).length>0;function va(e,r,i){if(Array.isArray(e))return e.map(c=>va(c,r,i));if(!e||typeof e!="object")return e;let o=e,t=r==="output"&&i==="mcp",n=r==="input"&&i==="mcp",a=Object.fromEntries(Object.entries(o).flatMap(([c,u])=>c==="properties"&&u&&typeof u=="object"?[[c,Object.fromEntries(Object.entries(u).flatMap(([l,d])=>t&&tS(d)?[]:[[l,va(d,r,i)]]))]]:Yx.has(c)?[]:t&&Qx.has(c)&&!(c==="additionalProperties"&&rS(u))?[]:n&&eS.has(c)?[]:r==="output"&&c==="additionalProperties"&&u===!1?[]:c==="propertyNames"&&JSON.stringify(u)==='{"type":"string"}'?[]:c==="pattern"&&"format"in o?[]:c==="maximum"&&u===Number.MAX_SAFE_INTEGER||c==="minimum"&&u===Number.MIN_SAFE_INTEGER?[]:[[c,va(u,r,i)]]));return i==="rest"&&Array.isArray(a.anyOf)?nS(a):a}function nS(e){let{anyOf:r,...i}=e,o=r,t=o.flatMap(a=>[a.type].flat());if(o.some(a=>"$ref"in a||"anyOf"in a||!a.type)||t.some(a=>typeof a!="string")||new Set(t).size!==t.length)return e;let n={};for(let{type:a,...c}of o)for(let[u,l]of Object.entries(c)){if(u in n&&JSON.stringify(n[u])!==JSON.stringify(l))return e;n[u]=l}if(n.enum){if(t.length!==2||!t.includes("null"))return e;n.enum=[...n.enum,null]}return{...i,...n,type:t}}function sb(e,r,i){let o=va(s.toJSONSchema(e,{io:r,target:"draft-2020-12"}),r,i);return r==="input"&&i==="mcp"?iS(o):o}function iS(e){let r=e.properties;if(!r)return e;let i=(o,t)=>Object.fromEntries(Object.entries(o).filter(([n])=>n!==t));return{...e,properties:Object.fromEntries(Object.entries(r).map(([o,t])=>{let n=Xh[o],a=n===void 0?t.description:n,c=t.items,u=Yh.includes(o)?i({...t,...c&&{items:i(c,"enum")}},"enum"):t,l=Qh.includes(o)?i(u,"default"):u;return[o,{...i(l,"description"),...a!=null&&{description:a}}]}))}}var Wn=e=>e.replaceAll("_","-");function oS(e){let r=sb(e.input,"input","rest");return Object.entries(r.properties).map(([i,o])=>({key:i,flag:Wn(i),array:o.type==="array",description:o.description??"",...(o.enum??o.items?.enum)&&{allowed:o.enum??o.items.enum},...o.default!==void 0&&{fallback:o.default}}))}var aS=[s.ZodString,s.ZodNumber,s.ZodBoolean,s.ZodEnum],sS=e=>s.globalRegistry.get(e)?.detailed===!0;function cS(e){let r=Object.entries(e.shape).map(([o,t])=>[o,rt(t)]);for(let[o,t]of r)if(t instanceof s.ZodArray&&rt(t.element)instanceof s.ZodObject)return{rows:o,element:rt(t.element)};let i=r.find(([,o])=>o instanceof s.ZodObject);return i?{rows:i[0],element:i[1]}:{rows:null,element:e}}var uS=e=>Object.entries(e.shape).filter(([r,i],o)=>(r!=="url"||o===0)&&!sS(i)&&(aS.some(t=>rt(i)instanceof t)||r==="before"||r==="after")).map(([r])=>r);function lS(e){let r=e.op,{rows:i,element:o}=cS(r.data),t=Object.entries(r.input.shape).filter(([,n])=>!n.safeParse(void 0).success).map(([n])=>n);return{resource:r.resource,verb:Wn(r.name.slice(r.resource.length+1)),op:r,route:e,positionals:t,params:oS(r),rows:i,fields:Object.keys(o.shape),columns:uS(o)}}var qn=ob.map(lS),cb=(e,r)=>qn.find(i=>i.resource===e&&i.verb===r);function ub(e,r){let i=t=>{let n=Array.isArray(t)?t.join(","):String(t);return/^[\w:.,/@-]+$/.test(n)?n:`'${n.replaceAll("'","'\\''")}'`},o=Object.entries(r).filter(([t])=>!e.positionals.includes(t)).map(([t,n])=>`--${Wn(t)}${i(n).startsWith("-")?"=":" "}${i(n)}`);return["openapps",e.resource,e.verb,...e.positionals.map(t=>i(r[t])),...o].join(" ")}var ba=["json","table","csv","md"];function lb(e,r){let i=e.rows===null?r.data:r.data[e.rows];return(Array.isArray(i)?i:[i]).filter(o=>!!o&&typeof o=="object")}var dS=e=>e==null?"":typeof e=="object"?JSON.stringify(e):String(e),pS=e=>e.length>60?`${e.slice(0,59)}\u2026`:e,mS=e=>/[",\n\r]/.test(e)?`"${e.replaceAll('"','""')}"`:e,fS=e=>e.replaceAll("|","\\|").replaceAll(`
|
|
65
|
-
`," ");function db(e,r,i,o,t){if(e==="json"){let l=o?lb(r,i).map(d=>Object.fromEntries(o.map(p=>[p,d[p]??null]))):i;return JSON.stringify(l,null,t?2:void 0)}let n=o??r.columns,a=lb(r,i).map(l=>n.map(d=>
|
|
66
|
-
`);if(e==="md")return[n,n.map(()=>"---"),...a].map(l=>`| ${l.map(
|
|
67
|
-
`);let c=[n,...a].map(l=>l.map(
|
|
68
|
-
`)}function pb(e){let{as_of:r,next_cursor:i,truncated:o}=e.meta;return[r&&`data from ${r}`,i&&`next page: --cursor ${i}`,o&&"truncated"].filter(Boolean).join("; ")}var
|
|
69
|
-
`,{mode:384}),await
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(r===a[0]){n(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(r!==a[0]&&l){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(c.cycle){n(a);continue}c.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Nf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;Nf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Cf=new Set(["type","properties","required","additionalProperties"]),Tf=["oneOf","anyOf"];function Df(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function Hu(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Cf.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let c=[];for(let l of r){let d=l.properties?.[a]??Df(l);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:Hu(c)??{allOf:c};ue(i,a,u)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let c=Df(a);c&&!n.some(u=>JSON.stringify(u)===JSON.stringify(c))&&n.push(c)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Zk(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Cf)if(t in e)return;let i=r.filter(t=>Tf.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=Hu(r);else{let t=i[0],n=Tf.find(u=>Array.isArray(t[u]));if(Object.keys(t).length!==1)return;let a=r.filter(u=>u!==t),c=t[n].map(u=>Hu([...a,u]));if(c.some(u=>!u))return;o={[n]:c}}o&&(delete e.allOf,wn(e,o))}function mt(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},p=u.ref;if(u.ref=null,p){o(p);let f=e.seen.get(p),v=f.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(v)):wn(l,v),wn(l,d),c._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in d||delete l[x];if(v.$ref&&f.def)for(let x in l)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(l[x])===JSON.stringify(f.def[x])&&delete l[x]}let m=c._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Nf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let p=c.get(d);p?p.push(l):c.set(d,[l])}for(let u of e.intersections)for(let l of c.get(u)??[])Zk(l)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(r)?.id;if(!c)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(c)}wn(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,ue(a,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let c=JSON.parse(JSON.stringify(t));return Object.defineProperty(c,"~standard",{value:{...r["~standard"],jsonSchema:{input:yr(r,"input",e.processors),output:yr(r,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ye(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ye(o.element,i);if(o.type==="set")return ye(o.valueType,i);if(o.type==="lazy")return ye(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return ye(o.innerType,i);if(o.type==="intersection")return ye(o.left,i)||ye(o.right,i);if(o.type==="record"||o.type==="map")return ye(o.keyType,i)||ye(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ye(o.in,i)||ye(o.out,i);if(o.type==="object"){for(let t in o.shape)if(ye(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(ye(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(ye(t,i))return!0;return!!(o.rest&&ye(o.rest,i))}return!1}var Xu=(e,r={})=>i=>{let o=dt({...i,processors:r});return W(e,o),pt(o,e),mt(o,e)},yr=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=dt({...t??{},target:n,io:r,processors:i});return W(e,a),pt(a,e),mt(a,e)};var _r=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},$r=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Uf=(e,r)=>{_r(e,"minimum",r),$r(e,"maximum",r)},Lf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Mf=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Vf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Ff=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Ef=(e,r)=>_r(e,"minimum",r.minimum),Rf=(e,r)=>$r(e,"maximum",r.maximum),Zf=e=>(r,i)=>{Ff(r,i.format);let[o,t]=e[i.format];_r(r,"minimum",o),$r(r,"maximum",t)},Lk={greater_than:(e,r)=>_r(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>$r(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Lf(e,r.value),number_format:Zf(Br),bigint_format:Zf(Kr),min_length:Ef,max_length:Rf,length_equals:(e,r)=>Uf(e,r.length),min_size:Ef,max_size:Rf,size_equals:(e,r)=>Uf(e,r.size),string_format:(e,r)=>{Ff(e,r.format),r.pattern&&Mf(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Vf(e,r.mime)};function oe(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Lk[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&_r(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&_r(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&$r(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&$r(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Lf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Vf(r,t.mime);for(let n of t.patterns??[])Mf(r,n);return r}var Mk={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Vk=new Map([[Oi,os],[cn,as]]),Bf=e=>Vk.get(e)??e,el=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:c,patterns:u,contentEncoding:l,laxFormat:d}=oe(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),c&&(t.format=Mk[c]??c,t.format===""&&delete t.format,(c==="time"||d)&&delete t.format),l&&(t.contentEncoding=l),u&&u.size>0){let p=[...u].map(Bf);p.length===1?t.pattern=p[0].source:p.length>1&&(t.allOf=[...p.map(m=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},tl=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=oe(e);t.type=d?"integer":"number";let p=typeof l=="number"&&l>=(n??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=r.target==="draft-04"||r.target==="openapi-3.0";if(p?f?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof n=="number"&&(t.minimum=n),m?f?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),c){let v=new Set;for(let j of c)Number.isFinite(j)&&j!==0?v.add(Math.abs(j)):ie(e,r,t,o,`A multipleOf divisor of ${j} cannot be represented in JSON Schema`);let[k,...x]=v;k!==void 0&&(t.multipleOf=k),x.length&&(t.allOf=[...t.allOf??[],...x.map(j=>({multipleOf:j}))])}},rl=(e,r,i,o)=>{i.type="boolean"},nl=(e,r,i,o)=>{ie(e,r,i,o,"BigInt cannot be represented in JSON Schema")},il=(e,r,i,o)=>{ie(e,r,i,o,"Symbols cannot be represented in JSON Schema")},ol=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},al=(e,r,i,o)=>{ie(e,r,i,o,"Undefined cannot be represented in JSON Schema")},sl=(e,r,i,o)=>{ie(e,r,i,o,"Void cannot be represented in JSON Schema")},cl=(e,r,i,o)=>{i.not={}},ul=(e,r,i,o)=>{},ll=(e,r,i,o)=>{},dl=(e,r,i,o)=>{ie(e,r,i,o,"Date cannot be represented in JSON Schema")},pl=(e,r,i,o)=>{let t=e._zod.def,n=Gt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},ml=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(ie(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},fl=(e,r,i,o)=>{ie(e,r,i,o,"NaN cannot be represented in JSON Schema")},gl=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},hl=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:c}=oe(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),c&&(c.length===0?t.not={}:c.length===1?t.contentMediaType=c[0]:t.anyOf=c.map(u=>({contentMediaType:u})))},vl=(e,r,i,o)=>{i.type="boolean"},bl=(e,r,i,o)=>{ie(e,r,i,o,"Custom types cannot be represented in JSON Schema")},yl=(e,r,i,o)=>{ie(e,r,i,o,"Function types cannot be represented in JSON Schema")},_l=(e,r,i,o)=>{ie(e,r,i,o,"Transforms cannot be represented in JSON Schema")},$l=(e,r,i,o)=>{ie(e,r,i,o,"Map cannot be represented in JSON Schema")},kl=(e,r,i,o)=>{ie(e,r,i,o,"Set cannot be represented in JSON Schema")},wl=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:c}=oe(e);typeof a=="number"&&(t.minItems=a),typeof c=="number"&&(t.maxItems=c),t.type="array",t.items=W(n.element,r,{...o,path:[...o.path,"items"]})};function xn(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?xn(r.out):r.type==="catch"?xn(r.innerType):e._zod.optin}var xl=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&ie(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ue(t.properties,l,W(a[l],r,{...o,path:[...o.path,"properties",l]}));let u=[];for(let l of Object.keys(a)){let d=n.shape[l];(r.io==="input"?xn(d)===void 0:d._zod.optout===void 0)&&u.push(l)}u.length>0&&(t.required=u),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=W(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},zo=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((c,u)=>W(c,r,{...o,path:[...o.path,n?"oneOf":"anyOf",u]}));n?i.oneOf=a:i.anyOf=a},Sl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=W(t.right,r,{...o,path:[...o.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(n)?n.allOf:[n],...c(a)?a.allOf:[a]];i.allOf=u,r.intersections.push(u)},Il=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",c=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",u=n.items.map((k,x)=>W(k,r,{...o,path:[...o.path,a,x]})),l=n.rest?W(n.rest,r,{...o,path:[...o.path,c,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,d=n.items.length;for(;d>0;){let k=n.items[d-1];if(!(r.io==="input"?xn(k)!==void 0:k._zod.optout==="optional"))break;d--}let p=n.items.length,m=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=u,m?t.items=!1:l&&(t.items=l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):r.target==="openapi-3.0"?(t.items={anyOf:u},l&&t.items.anyOf.push(l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):(t.items=u,m?t.additionalItems=!1:l&&(t.additionalItems=l),d>0&&(t.minItems=d),m&&(t.maxItems=p));let{minimum:f,maximum:v}=oe(e);typeof f=="number"&&(t.minItems=f),typeof v=="number"&&(t.maxItems=v)};function Yu(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let k=Yu(e,v,i);return k===v?r:k}for(let v of["anyOf","oneOf"]){let k=r[v];if(!Array.isArray(k))continue;let x=k.map(j=>Yu(e,j,i));x.some((j,P)=>j!==k[P])&&(r={...r,[v]:x})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:d,format:p,id:m,...f}=r;return f.enum?f.enum=f.enum.map(v=>typeof v=="number"?String(v):v):typeof f.const=="number"&&(f.const=String(f.const)),t&&(f.type="string",n||(f.pattern=(o.includes("number")?Ye:en).source)),f}var Qu=new WeakMap;function Fk(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Qu.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=Yu(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var zl=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,c=oe(a).patterns;if(n.mode==="loose"&&c&&c.size>0){let d=W(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)ue(t.patternProperties,Bf(p).source,d)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=W(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let d=Qu.get(r);d||(d=[],Qu.set(r,d),r.deferred.push(()=>Fk(r))),d.push(e)}t.additionalProperties=W(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,l=r.io==="input"&&xn(n.valueType)!==void 0;if(u&&!n.partial&&!l){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(t.required=d.map(String))}},Pl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},Ol=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},jl=Symbol();function Kf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(n=!0,null));return n?(ie(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),jl):JSON.parse(a)}var Al=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Kf(t.defaultValue,e,r,i,o);a!==jl&&(i.default=a)},Tl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Kf(t.defaultValue,e,r,i,o);a!==jl&&(i._prefault=a)},Dl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{ie(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},Nl=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;W(a,r,o);let c=r.seen.get(e);c.ref=a},Cl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},Ul=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},Po=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},El=(e,r,i,o)=>{let t=e._zod.innerType;W(t,r,o);let n=r.seen.get(e);n.ref=t},Io={string:el,number:tl,boolean:rl,bigint:nl,symbol:il,null:ol,undefined:al,void:sl,never:cl,any:ul,unknown:ll,date:dl,enum:pl,literal:ml,nan:fl,template_literal:gl,file:hl,success:vl,custom:bl,function:yl,transform:_l,map:$l,set:kl,array:wl,object:xl,union:zo,intersection:Sl,tuple:Il,record:zl,nullable:Pl,nonoptional:Ol,default:Al,prefault:Tl,catch:Dl,pipe:Nl,readonly:Cl,promise:Ul,optional:Po,lazy:El};function Oo(e,r){if("_idmap"in e){let o=e,t=dt({...r,processors:Io}),n={};for(let u of o._idmap.entries()){let[l,d]=u;W(d,t)}let a={},c={registry:o,uri:r?.uri,defs:n};t.external=c;for(let u of o._idmap.entries()){let[l,d]=u;pt(t,d),ue(a,l,mt(t,d))}if(Object.keys(n).length>0){let u=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:n}}return{schemas:a}}let i=dt({...r,processors:Io});return W(e,i),pt(i,e),mt(i,e)}var jo=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=dt({processors:Io,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return W(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pt(this.ctx,r);let o=mt(this.ctx,r),{"~standard":t,...n}=o;return n}};var Gf={};var Or={};qe(Or,{ZodAny:()=>od,ZodArray:()=>ud,ZodBase64:()=>qo,ZodBase64URL:()=>Ho,ZodBigInt:()=>zr,ZodBigIntFormat:()=>Qo,ZodBoolean:()=>Ir,ZodCIDRv4:()=>Jo,ZodCIDRv6:()=>Wo,ZodCUID:()=>Lo,ZodCUID2:()=>Mo,ZodCatch:()=>jd,ZodCodec:()=>Nn,ZodCreditCard:()=>Xl,ZodCustom:()=>Cn,ZodCustomStringFormat:()=>Zt,ZodDate:()=>Pn,ZodDefault:()=>xd,ZodDiscriminatedUnion:()=>dd,ZodE164:()=>Xo,ZodEmail:()=>Uo,ZodEmoji:()=>Ro,ZodEnum:()=>wr,ZodExactOptional:()=>na,ZodFile:()=>_d,ZodFunction:()=>Ld,ZodGUID:()=>Eo,ZodIBAN:()=>Yl,ZodIPv4:()=>Ko,ZodIPv6:()=>Go,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>Fd,ZodIntersection:()=>pd,ZodJWT:()=>Yo,ZodKSUID:()=>Bo,ZodLazy:()=>Ed,ZodLiteral:()=>yd,ZodMAC:()=>Hl,ZodMap:()=>vd,ZodNaN:()=>Td,ZodNanoID:()=>Zo,ZodNever:()=>sd,ZodNonOptional:()=>ia,ZodNull:()=>nd,ZodNullable:()=>wd,ZodNumber:()=>Sr,ZodNumberFormat:()=>Lt,ZodObject:()=>jn,ZodOptional:()=>Tn,ZodPipe:()=>Dn,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Zd,ZodReadonly:()=>Nd,ZodRecord:()=>kr,ZodSet:()=>bd,ZodString:()=>xr,ZodStringFormat:()=>H,ZodSuccess:()=>Od,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ud,ZodTransform:()=>$d,ZodTuple:()=>fd,ZodType:()=>R,ZodULID:()=>Vo,ZodURL:()=>zn,ZodUUID:()=>Ge,ZodUndefined:()=>rd,ZodUnion:()=>An,ZodUnknown:()=>ad,ZodVoid:()=>cd,ZodXID:()=>Fo,ZodXor:()=>ld,_ZodString:()=>Co,_default:()=>Sd,_function:()=>ih,any:()=>Cg,array:()=>On,base64:()=>gg,base64url:()=>hg,bigint:()=>jg,boolean:()=>ed,catch:()=>Ad,check:()=>oh,cidrv4:()=>mg,cidrv6:()=>fg,codec:()=>eh,creditCard:()=>bg,cuid:()=>og,cuid2:()=>ag,currencyCode:()=>xg,custom:()=>ah,date:()=>Eg,describe:()=>sh,discriminatedUnion:()=>Fg,e164:()=>vg,email:()=>qf,emoji:()=>ng,enum:()=>ta,exactOptional:()=>kd,file:()=>Hg,float32:()=>Ig,float64:()=>zg,function:()=>ih,guid:()=>Hf,hash:()=>Sg,hex:()=>wg,hostname:()=>kg,httpUrl:()=>rg,iban:()=>yg,instanceof:()=>uh,int:()=>Do,int32:()=>Pg,int64:()=>Ag,intersection:()=>md,invertCodec:()=>th,ipv4:()=>lg,ipv6:()=>pg,json:()=>dh,jwt:()=>_g,keyof:()=>Rg,ksuid:()=>ug,lazy:()=>Rd,literal:()=>qg,looseObject:()=>Mg,looseRecord:()=>Kg,mac:()=>dg,map:()=>Gg,meta:()=>ch,nan:()=>Qg,nanoid:()=>ig,nativeEnum:()=>Wg,never:()=>ea,nonoptional:()=>Pd,null:()=>id,nullable:()=>In,nullish:()=>Xg,number:()=>Ql,object:()=>Zg,optional:()=>Et,partialRecord:()=>Bg,pipe:()=>No,prefault:()=>zd,preprocess:()=>ph,promise:()=>nh,readonly:()=>Cd,record:()=>hd,refine:()=>Md,set:()=>Jg,strictObject:()=>Lg,string:()=>Sn,stringFormat:()=>$g,stringbool:()=>lh,success:()=>Yg,superRefine:()=>Vd,symbol:()=>Dg,templateLiteral:()=>rh,transform:()=>ra,tuple:()=>gd,uint32:()=>Og,uint64:()=>Tg,ulid:()=>sg,undefined:()=>Ng,union:()=>Pr,unknown:()=>Ut,url:()=>tg,uuid:()=>Xf,uuidv4:()=>Yf,uuidv6:()=>Qf,uuidv7:()=>eg,void:()=>Ug,xid:()=>cg,xor:()=>Vg});var Ao={};qe(Ao,{endsWith:()=>dr,gt:()=>Be,gte:()=>Ae,includes:()=>ur,length:()=>Nt,lowercase:()=>sr,lt:()=>Fe,lte:()=>je,maxLength:()=>Dt,maxSize:()=>lt,mime:()=>mr,minLength:()=>Qe,minSize:()=>Ke,multipleOf:()=>ut,negative:()=>ko,nonnegative:()=>xo,nonpositive:()=>wo,normalize:()=>fr,overwrite:()=>Ze,positive:()=>$o,properties:()=>pr,property:()=>So,regex:()=>ar,size:()=>Tt,slugify:()=>br,startsWith:()=>lr,toLowerCase:()=>hr,toUpperCase:()=>vr,trim:()=>gr,uppercase:()=>cr});var Jf=new WeakSet([Object.prototype,Error.prototype]);function To(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Wf=(e,r)=>{Za.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Jf.has(i)||(Jf.add(i),To(i,"format",o=>t=>Hr(o,t)),To(i,"flatten",o=>t=>qr(o,t)),To(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Jt,2)}),To(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,Jt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Kk=g("ZodError",Wf),Ie=g("ZodError",Wf,void 0,{Parent:Error});var Rl=Xt(Ie),Zl=Yt(Ie),Ll=Qt(Ie),Ml=er(Ie),Vl=ai(Ie),Fl=si(Ie),Bl=ci(Ie),Kl=ui(Ie),Gl=li(Ie),Jl=di(Ie),Wl=pi(Ie),ql=mi(Ie);function Jk(){ae.localeError||re(Ki())}function Rt(){ae.memoizer||re({memoizer:gn()})}var R=g("ZodType",(e,r)=>(Jk(),U.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone(y.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return G(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(Md(e,r))},superRefine(e,r){return this.check(Vd(e,r))},overwrite(e){return this.check(Ze(e))},optional(){return Et(this)},exactOptional(){return kd(this)},nullable(){return In(this)},nullish(){return Et(In(this))},nonoptional(e){return Pd(this,e)},array(){return On(this)},or(e){return Pr([this,e])},and(e){return md(this,e)},transform(e){return No(this,ra(e))},default(e){return Sd(this,e)},prefault(e){return zd(this,e)},catch(e){return Ad(this,e)},pipe(e){return No(this,e)},readonly(){return Cd(this)},describe(e){let r=this.clone();return le.add(r,{description:e}),r},meta(...e){if(e.length===0)return le.get(this);let r=this.clone();return le.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return y.hide(this,"~standard",{...xi(this),jsonSchema:{input:yr(this,"input"),output:yr(this,"output")}})},set"~standard"(e){y.own(this,"~standard",e)},parse:function e(r,i){return Rl(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await Zl(this,r,i,{callee:e})},safeParse(e,r){return Ll(this,e,r)},async safeParseAsync(e,r){return Ml(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){y.own(this,"spa",e)},validate(e,r){return Xr(this,e,r)},validateAsync(e,r){return Yr(this,e,r)},encode:function e(r,i){return Vl(this,r,i,{callee:e})},decode:function e(r,i){return Fl(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await Bl(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await Kl(this,r,i,{callee:e})},safeEncode(e,r){return Gl(this,e,r)},safeDecode(e,r){return Jl(this,e,r)},async safeEncodeAsync(e,r){return Wl(this,e,r)},async safeDecodeAsync(e,r){return ql(this,e,r)},toJSONSchema(e){return Xu(this,{})(e)},get description(){return le.get(this)?.description},get _def(){return this._zod.def}}),Co=g("_ZodString",(e,r)=>{zt.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>el(e,i,o,t)},y.derived({format:e=>oe(e).format??null,minLength:e=>oe(e).minimum??null,maxLength:e=>oe(e).maximum??null},{regex(...e){return this.check(ar(...e))},includes(...e){return this.check(ur(...e))},startsWith(...e){return this.check(lr(...e))},endsWith(...e){return this.check(dr(...e))},min(...e){return this.check(Qe(...e))},max(...e){return this.check(Dt(...e))},length(...e){return this.check(Nt(...e))},nonempty(...e){return this.check(Qe(1,...e))},lowercase(e){return this.check(sr(e))},uppercase(e){return this.check(cr(e))},trim(){return this.check(gr())},normalize(...e){return this.check(fr(...e))},toLowerCase(){return this.check(hr())},toUpperCase(){return this.check(vr())},slugify(){return this.check(br())}})),xr=g("ZodString",(e,r)=>{zt.init(e,r),Co.init(e,r)},{email(e){return this.check(Qi(Uo,e))},url(e){return this.check(bn(zn,e))},jwt(e){return this.check(_o(Yo,e))},emoji(e){return this.check(oo(Ro,e))},guid(e){return this.check(eo(Eo,e))},uuid(e){return this.check(to(Ge,e))},uuidv4(e){return this.check(ro(Ge,e))},uuidv6(e){return this.check(no(Ge,e))},uuidv7(e){return this.check(io(Ge,e))},nanoid(e){return this.check(ao(Zo,e))},cuid(e){return this.check(so(Lo,e))},cuid2(e){return this.check(co(Mo,e))},ulid(e){return this.check(uo(Vo,e))},base64(e){return this.check(vo(qo,e))},base64url(e){return this.check(bo(Ho,e))},xid(e){return this.check(lo(Fo,e))},ksuid(e){return this.check(po(Bo,e))},ipv4(e){return this.check(mo(Ko,e))},ipv6(e){return this.check(fo(Go,e))},cidrv4(e){return this.check(go(Jo,e))},cidrv6(e){return this.check(ho(Wo,e))},e164(e){return this.check(yo(Xo,e))},datetime(e){return this.check(yn(ft,e))},date(e){return this.check(_n(gt,e))},time(e){return this.check($n(ht,e))},duration(e){return this.check(kn(vt,e))}});function Sn(e){return mu(xr,e)}var H=g("ZodStringFormat",(e,r)=>{J.init(e,r),Co.init(e,r)}),ft=g("ZodISODateTime",(e,r)=>{oc.init(e,r),H.init(e,r)}),gt=g("ZodISODate",(e,r)=>{ac.init(e,r),H.init(e,r)}),ht=g("ZodISOTime",(e,r)=>{sc.init(e,r),H.init(e,r)}),vt=g("ZodISODuration",(e,r)=>{cc.init(e,r),H.init(e,r)}),Uo=g("ZodEmail",(e,r)=>{Ws.init(e,r),H.init(e,r)});function qf(e){return Qi(Uo,e)}var Eo=g("ZodGUID",(e,r)=>{Gs.init(e,r),H.init(e,r)});function Hf(e){return eo(Eo,e)}var Ge=g("ZodUUID",(e,r)=>{Js.init(e,r),H.init(e,r)});function Xf(e){return to(Ge,e)}function Yf(e){return ro(Ge,e)}function Qf(e){return no(Ge,e)}function eg(e){return io(Ge,e)}var zn=g("ZodURL",(e,r)=>{Xs.init(e,r),H.init(e,r)});function tg(e){return bn(zn,e)}function rg(e){return bn(zn,{protocol:Qr,hostname:cs,...y.normalizeParams(e)})}var Ro=g("ZodEmoji",(e,r)=>{Ys.init(e,r),H.init(e,r)});function ng(e){return oo(Ro,e)}var Zo=g("ZodNanoID",(e,r)=>{Qs.init(e,r),H.init(e,r)});function ig(e){return ao(Zo,e)}var Lo=g("ZodCUID",(e,r)=>{ec.init(e,r),H.init(e,r)});function og(e){return so(Lo,e)}var Mo=g("ZodCUID2",(e,r)=>{tc.init(e,r),H.init(e,r)});function ag(e){return co(Mo,e)}var Vo=g("ZodULID",(e,r)=>{rc.init(e,r),H.init(e,r)});function sg(e){return uo(Vo,e)}var Fo=g("ZodXID",(e,r)=>{nc.init(e,r),H.init(e,r)});function cg(e){return lo(Fo,e)}var Bo=g("ZodKSUID",(e,r)=>{ic.init(e,r),H.init(e,r)});function ug(e){return po(Bo,e)}var Ko=g("ZodIPv4",(e,r)=>{uc.init(e,r),H.init(e,r)});function lg(e){return mo(Ko,e)}var Hl=g("ZodMAC",(e,r)=>{dc.init(e,r),H.init(e,r)});function dg(e){return gu(Hl,e)}var Go=g("ZodIPv6",(e,r)=>{lc.init(e,r),H.init(e,r)});function pg(e){return fo(Go,e)}var Jo=g("ZodCIDRv4",(e,r)=>{pc.init(e,r),H.init(e,r)});function mg(e){return go(Jo,e)}var Wo=g("ZodCIDRv6",(e,r)=>{mc.init(e,r),H.init(e,r)});function fg(e){return ho(Wo,e)}var qo=g("ZodBase64",(e,r)=>{fc.init(e,r),H.init(e,r)});function gg(e){return vo(qo,e)}var Ho=g("ZodBase64URL",(e,r)=>{gc.init(e,r),H.init(e,r)});function hg(e){return bo(Ho,e)}var Xo=g("ZodE164",(e,r)=>{hc.init(e,r),H.init(e,r)});function vg(e){return yo(Xo,e)}var Xl=g("ZodCreditCard",(e,r)=>{vc.init(e,r),H.init(e,r)});function bg(e){return hu(Xl,e)}var Yl=g("ZodIBAN",(e,r)=>{bc.init(e,r),H.init(e,r)});function yg(e){return vu(Yl,e)}var Yo=g("ZodJWT",(e,r)=>{yc.init(e,r),H.init(e,r)});function _g(e){return _o(Yo,e)}var Zt=g("ZodCustomStringFormat",(e,r)=>{_c.init(e,r),H.init(e,r)});function $g(e,r,i={}){return Ct(Zt,e,r,i)}function kg(e){return Ct(Zt,"hostname",ss,e)}function wg(e){return Ct(Zt,"hex",ks,e)}function xg(e){return Ct(Zt,"currency_code",ls,e)}function Sg(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=Ce[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Ct(Zt,o,t,r)}var Sr=g("ZodNumber",(e,r)=>{Ni.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>tl(e,i,o,t),e.isFinite=!0},y.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=oe(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=oe(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=oe(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>oe(e).format??null},{gt(e,r){return this.check(Be(e,r))},gte(e,r){return this.check(Ae(e,r))},min(e,r){return this.check(Ae(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(je(e,r))},max(e,r){return this.check(je(e,r))},int(e){return this.check(Do(e))},safe(e){return this.check(Do(e))},positive(e){return this.check(Be(0,e))},nonnegative(e){return this.check(Ae(0,e))},negative(e){return this.check(Fe(0,e))},nonpositive(e){return this.check(je(0,e))},multipleOf(e,r){return this.check(ut(e,r))},step(e,r){return this.check(ut(e,r))},finite(){return this}}));function Ql(e){return yu(Sr,e)}var Lt=g("ZodNumberFormat",(e,r)=>{$c.init(e,r),Sr.init(e,r)});function Do(e){return $u(Lt,e)}function Ig(e){return ku(Lt,e)}function zg(e){return wu(Lt,e)}function Pg(e){return xu(Lt,e)}function Og(e){return Su(Lt,e)}var Ir=g("ZodBoolean",(e,r)=>{un.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rl(e,i,o,t)});function ed(e){return Iu(Ir,e)}var zr=g("ZodBigInt",(e,r)=>{Ci.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>nl(e,i,o,t)},y.derived({minValue:e=>oe(e).minimum??null,maxValue:e=>oe(e).maximum??null,format:e=>oe(e).format??null},{gte(e,r){return this.check(Ae(e,r))},min(e,r){return this.check(Ae(e,r))},gt(e,r){return this.check(Be(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(je(e,r))},max(e,r){return this.check(je(e,r))},positive(e){return this.check(Be(BigInt(0),e))},negative(e){return this.check(Fe(BigInt(0),e))},nonpositive(e){return this.check(je(BigInt(0),e))},nonnegative(e){return this.check(Ae(BigInt(0),e))},multipleOf(e,r){return this.check(ut(e,r))}}));function jg(e){return Pu(zr,e)}var Qo=g("ZodBigIntFormat",(e,r)=>{kc.init(e,r),zr.init(e,r)});function Ag(e){return ju(Qo,e)}function Tg(e){return Au(Qo,e)}var td=g("ZodSymbol",(e,r)=>{wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>il(e,i,o,t)});function Dg(e){return Tu(td,e)}var rd=g("ZodUndefined",(e,r)=>{xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>al(e,i,o,t)});function Ng(e){return Du(rd,e)}var nd=g("ZodNull",(e,r)=>{Sc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ol(e,i,o,t)});function id(e){return Nu(nd,e)}var od=g("ZodAny",(e,r)=>{Ic.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ul(e,i,o,t)});function Cg(){return Cu(od)}var ad=g("ZodUnknown",(e,r)=>{zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ll(e,i,o,t)});function Ut(){return Uu(ad)}var sd=g("ZodNever",(e,r)=>{Pc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cl(e,i,o,t)});function ea(e){return Eu(sd,e)}var cd=g("ZodVoid",(e,r)=>{Oc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>sl(e,i,o,t)});function Ug(e){return Ru(cd,e)}var Pn=g("ZodDate",(e,r)=>{jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>dl(e,i,o,t),e.min=(i,o)=>e.check(Ae(i,o)),e.max=(i,o)=>e.check(je(i,o))},y.derived({minDate:e=>{let{minimum:r}=oe(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=oe(e);return r?new Date(r):null}},{}));function Eg(e){return Zu(Pn,e)}var ud=g("ZodArray",(e,r)=>{Rt(),Ac.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>wl(e,i,o,t),e.element=r.element},{min(e,r){return this.check(Qe(e,r))},nonempty(e){return this.check(Qe(1,e))},max(e,r){return this.check(Dt(e,r))},length(e,r){return this.check(Nt(e,r))},unwrap(){return this.element}});function On(e,r){return Vu(ud,e,r)}function Rg(e){let r=e._zod.def.shape;return ta(Object.keys(r))}var jn=g("ZodObject",(e,r)=>{Rt(),Tc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>xl(e,i,o,t),y.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return ta(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},loose(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},strict(){return this.clone(y.mergeDefs(this._zod.def,{catchall:ea()}))},strip(){return this.clone(y.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return y.extend(this,e)},safeExtend(e){return y.safeExtend(this,e)},merge(e){return y.merge(this,e)},pick(e){return y.pick(this,e)},omit(e){return y.omit(this,e)},partial(...e){return y.partial(Tn,this,e[0])},exactPartial(...e){return y.partial(na,this,e[0],"exactPartial")},required(...e){return y.required(ia,this,e[0])}});function Zg(e,r){let i={type:"object",shape:e??{},...y.normalizeParams(r)};return new jn(i)}function Lg(e,r){return new jn({type:"object",shape:e,catchall:ea(),...y.normalizeParams(r)})}function Mg(e,r){return new jn({type:"object",shape:e,catchall:Ut(),...y.normalizeParams(r)})}var An=g("ZodUnion",(e,r)=>{ln.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Pr(e,r){return new An({type:"union",options:e,...y.normalizeParams(r)})}var ld=g("ZodXor",(e,r)=>{An.init(e,r),Dc.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Vg(e,r){return new ld({type:"union",options:e,inclusive:!1,...y.normalizeParams(r)})}var dd=g("ZodDiscriminatedUnion",(e,r)=>{An.init(e,r),Cc.init(e,r)});function Fg(e,r,i){return new dd({type:"union",options:r,discriminator:e,...y.normalizeParams(i)})}var pd=g("ZodIntersection",(e,r)=>{Uc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Sl(e,i,o,t)});function md(e,r){return new pd({type:"intersection",left:e,right:r})}var fd=g("ZodTuple",(e,r)=>{Rt(),Ui.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Il(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Tn({type:"optional",innerType:r}))})}});function gd(e,r,i){let o=r instanceof U,t=o?i:r,n=o?r:null;return new fd({type:"tuple",items:e,rest:n,...y.normalizeParams(t)})}var kr=g("ZodRecord",(e,r)=>{Rt(),Ec.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zl(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function hd(e,r,i){return!r||!r._zod?new kr({type:"record",keyType:Sn(),valueType:e,...y.normalizeParams(r)}):new kr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i)})}function Bg(e,r,i){return new kr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i),partial:!0})}function Kg(e,r,i){return new kr({type:"record",keyType:e,valueType:r,mode:"loose",...y.normalizeParams(i)})}var vd=g("ZodMap",(e,r)=>{Rt(),Rc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(Ke(...i)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Gg(e,r,i){return new vd({type:"map",keyType:e,valueType:r,...y.normalizeParams(i)})}var bd=g("ZodSet",(e,r)=>{Rt(),Zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>kl(e,i,o,t),e.min=(...i)=>e.check(Ke(...i)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Jg(e,r){return new bd({type:"set",valueType:e,...y.normalizeParams(r)})}var wr=g("ZodEnum",(e,r)=>{Lc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(o,t,n)=>pl(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new wr({...r,checks:[],...y.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new wr({...r,checks:[],...y.normalizeParams(t),entries:n})}});function ta(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new wr({type:"enum",entries:i,...y.normalizeParams(r)})}function Wg(e,r){return new wr({type:"enum",entries:e,...y.normalizeParams(r)})}var yd=g("ZodLiteral",(e,r)=>{Mc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ml(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function qg(e,r){return new yd({type:"literal",values:Array.isArray(e)?e:[e],...y.normalizeParams(r)})}var _d=g("ZodFile",(e,r)=>{Vc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.min=(i,o)=>e.check(Ke(i,o)),e.max=(i,o)=>e.check(lt(i,o)),e.mime=(i,o)=>e.check(mr(Array.isArray(i)?i:[i],o))});function Hg(e){return Fu(_d,e)}var $d=g("ZodTransform",(e,r)=>{Rt(),Fc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>_l(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ct(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push(y.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push(y.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function ra(e){return new $d({type:"transform",transform:e})}var Tn=g("ZodOptional",(e,r)=>{Ei.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Et(e){return new Tn({type:"optional",innerType:e})}var na=g("ZodExactOptional",(e,r)=>{Bc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function kd(e){return new na({type:"optional",innerType:e})}var wd=g("ZodNullable",(e,r)=>{Kc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function In(e){return new wd({type:"nullable",innerType:e})}function Xg(e){return Et(In(e))}var xd=g("ZodDefault",(e,r)=>{Gc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Al(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sd(e,r){return new xd({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var Id=g("ZodPrefault",(e,r)=>{Jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zd(e,r){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var ia=g("ZodNonOptional",(e,r)=>{Wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ol(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Pd(e,r){return new ia({type:"nonoptional",innerType:e,...y.normalizeParams(r)})}var Od=g("ZodSuccess",(e,r)=>{qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Yg(e){return new Od({type:"success",innerType:e})}var jd=g("ZodCatch",(e,r)=>{Hc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ad(e,r){return new jd({type:"catch",innerType:e,catchValue:typeof r=="function"?r:y.constantCatch(r)})}var Td=g("ZodNaN",(e,r)=>{Xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>fl(e,i,o,t)});function Qg(e){return Mu(Td,e)}var Dn=g("ZodPipe",(e,r)=>{Ri.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nl(e,i,o,t),e.in=r.in,e.out=r.out});function No(e,r){return new Dn({type:"pipe",in:e,out:r})}var Nn=g("ZodCodec",(e,r)=>{Dn.init(e,r),dn.init(e,r)});function eh(e,r,i){return new Nn({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function th(e){let r=e._zod.def;return new Nn({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var Dd=g("ZodPreprocess",(e,r)=>{Dn.init(e,r),Yc.init(e,r)}),Nd=g("ZodReadonly",(e,r)=>{Qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Cd(e){return new Nd({type:"readonly",innerType:e})}var Ud=g("ZodTemplateLiteral",(e,r)=>{eu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t)});function rh(e,r){return new Ud({type:"template_literal",parts:e,...y.normalizeParams(r)})}var Ed=g("ZodLazy",(e,r)=>{pn.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>El(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function Rd(e){return new Ed({type:"lazy",getter:e})}var Zd=g("ZodPromise",(e,r)=>{ru.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ul(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function nh(e){return new Zd({type:"promise",innerType:e})}var Ld=g("ZodFunction",(e,r)=>{tu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t)});function ih(e){return new Ld({type:"function",input:Array.isArray(e?.input)?gd(e?.input):e?.input??On(Ut()),output:e?.output??Ut()})}var Cn=g("ZodCustom",(e,r)=>{nu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t)});function oh(e){let r=new X({check:"custom"});return r._zod.check=e,r}function ah(e,r){return Bu(Cn,e??(()=>!0),r)}function Md(e,r={}){return Ku(Cn,e,r)}function Vd(e,r){return Gu(e,r)}var sh=Ju,ch=Wu,Fd=g("ZodInstanceOf",(e,r)=>{Cn.init(e,r)},{properties(e,r){return this.check(pr(e,r))}});function uh(e,r={}){let i=new Fd({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...y.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var lh=(...e)=>qu({Codec:Nn,Boolean:Ir,String:xr},...e);function dh(e){let r=Rd(()=>Pr([Sn(e),Ql(),ed(),id(),On(r),hd(Sn(),r)]));return r}function ph(e,r){return new Dd({type:"pipe",in:ra(e),out:r})}var Wk={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function qk(e){re({customError:e})}function Hk(){return re().customError}var Bd;Bd||(Bd={});var Un={};qe(Un,{ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,date:()=>Yk,datetime:()=>Xk,duration:()=>ew,time:()=>Qk});function Xk(e){return yn(ft,e)}function Yk(e){return _n(gt,e)}function Qk(e){return $n(ht,e)}function ew(e){return kn(vt,e)}var z={...Or,...Ao,iso:Un},tw=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function rw(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function mh(e,r){return e.map((i,o)=>o<r?i:i.optional())}function nw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function iw(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:nw(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function ow(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let c=r.keySchema.safeParse(a);c.success||o.issues.push({code:"invalid_key",origin:"record",issues:c.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function Kd(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let c=Kd(a,r);if(c===null)return null;n.push(c)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=Kd(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var aw=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),sw=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function En(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(En):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>aw.has(r)?En(i):!sw.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(En))}function fh(e){return e===1?"element":"elements"}function cw(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let c=Kd(t[a],new Set);if(c===null)continue;let u=n.get(c);if(u===void 0){n.set(c,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${u}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,c=0;for(let u of t)if(r.containsSchema.safeParse(u).success&&++c>=a)break;c<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${fh(n)}; found ${c}`,input:t,continue:!0}),r.maxContains!==void 0&&c>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${fh(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function gh(e,r){if(e!==!1)return e===void 0||e===!0?z.any():_e(e,r)}var uw=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function hh(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return z.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=iw(t,r),a=_e(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return z.null();if(t.length===0)return z.never();if(t.length===1)return z.literal(t[0]);if(t.every(a=>typeof a=="string"))return z.enum(t);let n=t.map(a=>z.literal(a));return n.length<2?n[0]:z.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return z.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return hh(a,r)});return t.length===0?z.never():t.length===1?t[0]:z.union(t)}if(!i)return z.any();let o;switch(i){case"string":{let t=z.string();if(e.format){let n=e.format;n==="email"?t=t.check(z.email()):n==="uri"||n==="uri-reference"?t=t.check(z.url()):n==="uuid"||n==="guid"?t=t.check(z.uuid()):n==="date-time"?t=t.check(z.iso.datetime({offset:!0})):n==="date"?t=t.check(z.iso.date()):n==="time"?t=t.check(z.regex(uw)):n==="duration"?t=t.check(z.iso.duration()):n==="hostname"?t=t.check(z.hostname()):n==="ipv4"?t=t.check(z.ipv4()):n==="ipv6"?t=t.check(z.ipv6()):n==="mac"?t=t.check(z.mac()):n==="cidr"?t=t.check(z.cidrv4()):n==="cidr-v6"?t=t.check(z.cidrv6()):n==="base64"?t=t.check(z.base64()):n==="base64url"?t=t.check(z.base64url()):n==="e164"?t=t.check(z.e164()):n==="credit_card"?t=t.check(z.creditCard()):n==="iban"?t=t.check(z.iban()):n==="jwt"?t=t.check(z.jwt()):n==="emoji"?t=t.check(z.emoji()):n==="nanoid"?t=t.check(z.nanoid()):n==="cuid"?t=t.check(z.cuid()):n==="cuid2"?t=t.check(z.cuid2()):n==="ulid"?t=t.check(z.ulid()):n==="xid"?t=t.check(z.xid()):n==="ksuid"&&(t=t.check(z.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?z.number().int():z.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=z.boolean();break}case"null":{o=z.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?_e(e.additionalProperties,r):void 0;for(let[p,m]of Object.entries(n)){let f=_e(m,r);ue(t,p,a.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let k of m){let x=_e(p[k],r),j=z.string().regex(new RegExp(k));f.push(z.looseRecord(j,x))}let v=[];if(Object.keys(t).length>0&&v.push(z.object(t).passthrough()),v.push(...f),v.length===0)o=z.object({}).passthrough();else if(v.length===1)o=v[0];else{let k=z.intersection(v[0],v[1]);for(let x=2;x<v.length;x++)k=z.intersection(k,v[x]);o=k}if(e.additionalProperties===!1){let k=Object.keys(t),x=m.map(P=>new RegExp(P)),j=o;o=o.check(P=>{if(!De(P.value))return;let D=[];for(let L of Object.keys(P.value))k.includes(L)||x.some(q=>q.test(L))||D.push(L);D.length&&P.issues.push({code:"unrecognized_keys",keys:D,input:P.value,inst:j})})}}else{let p=z.object(t);e.additionalProperties===!1?o=p.strict():c?o=p.catchall(c):o=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||l!==void 0||d!==void 0){let p;if(u){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=_e(m,r)}o=ow(o,{keySchema:p,minProperties:l,maxProperties:d})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,c=t.map(p=>_e(p,r)),u=mh(c,a),l=Array.isArray(n)?void 0:gh(n,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,c=n.map(p=>_e(p,r)),u=mh(c,a),l=gh(e.additionalItems,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(n!==void 0){let a=_e(n,r),c=z.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=z.array(z.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=cw(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?_e(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function _e(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i=hh(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>_e(l,r)),u=z.union(c);i=o?z.intersection(i,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>_e(l,r)),u=z.xor(c);i=o?z.intersection(i,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:z.any();else{let c=o?i:_e(e.allOf[0],r),u=o?0:1;for(let l=u;l<e.allOf.length;l++)c=z.intersection(c,_e(e.allOf[l],r));i=c}e.nullable===!0&&r.version==="openapi-3.0"&&(i=z.nullable(i)),e.readOnly===!0&&(i=z.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of n)c in e&&(t[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(t[c]=e[c]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!En(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let c of["minProperties","maxProperties"])e[c]!==void 0&&(t[c]=e[c])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!En(e.contains)&&(t.contains=e.contains);for(let c of["uniqueItems","minContains","maxContains"])e[c]!==void 0&&(t[c]=e[c])}for(let c of Object.keys(e))tw.has(c)||ue(t,c,e[c]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function vh(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=rw(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??le};return _e(i,n)}var bh=Symbol("z.visit/resolving");function Rn(e,r){let i=typeof r=="function"?r:(a,c)=>{let u=r[a._zod.def.type];return u?u(a,c):a},o=new Map;function t(a){let c=o.get(a);if(c===bh)return new pn({type:"lazy",getter:()=>o.get(a)});if(c!==void 0)return c;o.set(a,bh);let u=n(a),l=i(u,u!==a);return o.set(a,l),l}function n(a){let c=a._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,d=Object.keys(l),p=!1,m={};for(let v of d){let k=t(l[v]);k!==l[v]&&(p=!0),m[v]=k}let f=c.catchall;return c.catchall&&(f=t(c.catchall),f!==c.catchall&&(p=!0)),p?G(a,{...c,shape:m,catchall:f}):a}case"array":{let l=t(c.element);return l===c.element?a:G(a,{...c,element:l})}case"tuple":{let l=c.items,d=!1,p=[];for(let f of l){let v=t(f);v!==f&&(d=!0),p.push(v)}let m=c.rest;return c.rest&&(m=t(c.rest),m!==c.rest&&(d=!0)),d?G(a,{...c,items:p,rest:m}):a}case"record":case"map":{let l=t(c.keyType),d=t(c.valueType);return l===c.keyType&&d===c.valueType?a:G(a,{...c,keyType:l,valueType:d})}case"set":{let l=t(c.valueType);return l===c.valueType?a:G(a,{...c,valueType:l})}case"union":{let l=c.options,d=!1,p=[];for(let m of l){let f=t(m);f!==m&&(d=!0),p.push(f)}return d?G(a,{...c,options:p}):a}case"intersection":{let l=t(c.left),d=t(c.right);return l===c.left&&d===c.right?a:G(a,{...c,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=t(c.innerType);return l===c.innerType?a:G(a,{...c,innerType:l})}case"pipe":{let l=t(c.in),d=t(c.out);return l===c.in&&d===c.out?a:G(a,{...c,in:l,out:d})}case"function":{let l=t(c.input),d=t(c.output);return l===c.input&&d===c.output?a:G(a,{...c,input:l,output:d})}case"lazy":{let l=c.getter,{_cachedInner:d,...p}=c;return G(a,{...p,getter:()=>t(l())})}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":return a;default:return a}}return t(e)}function yh(e){return Rn(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Pr(i.options)}})}function lw(e,r){if(!r?.length)return e;let i=e._zod.def;return G(e,Ee(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function _h(e){return lw(e.out,e.checks)}function dw(e){return e.in._zod.traits.has("$ZodTransform")?_h(e):e.in}function $h(e){return Rn(e,{pipe:r=>dw(r._zod.def),default:(r,i)=>i?Et(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function kh(e){return Rn(e,{pipe:r=>_h(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var Gd={};qe(Gd,{bigint:()=>gw,boolean:()=>fw,date:()=>hw,number:()=>mw,string:()=>pw});function pw(e){return fu(xr,e)}function mw(e){return _u(Sr,e)}function fw(e){return zu(Ir,e)}function gw(e){return Ou(zr,e)}function hw(e){return Lu(Pn,e)}var Mt=class extends Error{code;detail;constructor(r,i,o={}){super(i),this.code=r,this.detail=o}};var vw=["bad_request","not_found","plan_required","method_not_allowed","gone","rate_limited","internal"],OO=s.object({error:s.object({code:s.enum(vw),message:s.string(),param:s.string().optional().describe("The input the error is about"),allowed:s.array(s.string()).optional().describe("Values the input takes"),nearest:s.array(s.string()).optional().describe("Known values closest to the one given"),need:s.enum(["free","plus"]).optional().describe("plan_required: the plan that opens it"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")})});var oa=(e,r="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${r} ${e[e.length-1]}`;var Jd={name:"$.name",description:"$.summary",icon:"$.media.icons[0].url",category:"$.taxonomy",publisher:"$.publisher.name",url:"$.publisher.url",release:"$.release.version",reviewed_commit:"$.source.repository.reviewed_commit"},wh={name:"$.displayName",description:"$.description",icon:"$.logoUrl",category:"$.curatedCategoryKeys",publisher:"$.publisher.displayName",url:"$.repositoryUrl",release:"$.gitRef"},xh={name:"$.name",description:"$.description",icon:"$.logo",publisher:"$.author",url:"$.authorUrl"},sa={"chatgpt:app":{label:["App","apps"],form:"integration",tag:"kind-chatgpt-app",paths:{name:"$.display_name",description:"$.short_description",icon:"$.icon_url",keywords:"$.keywords"}},"claude:connector":{label:["Connector","connectors"],form:"integration",tag:"kind-claude-connector",paths:Jd},"claude:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-claude-plugin",paths:Jd},"claude:desktop_extension":{label:["Desktop extension","desktop extensions"],form:"integration",tag:"kind-claude-extension",paths:Jd},"cursor:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-cursor-plugin",paths:wh},"cursor:directory_plugin":{label:["Rule","rules"],form:"parts",tag:"kind-rule",hidden:!0,paths:xh},"cursor:directory_mcp":{label:["MCP server","MCP servers"],form:"integration",tag:"kind-mcp-server",paths:xh},"grokbot:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-grokbot-plugin",paths:wh},"grokbot:bot":{label:["Bot","bots"],form:"agent",tag:"kind-grokbot-bot",hidden:!0,late:!0,charts:"grokbot:bots:",paths:{name:"$.name",description:"$.description",icon:"$.imageUrl",category:"$.categories",publisher:"$.creatorName",release:"$.updatedAt"}},"perplexity:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.display_name",description:"$.description",icon:"$.icon_url",category:"$.display_categories",publisher:"$.source_details.developer",url:"$.source_details.website_url"}},"muse:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon",category:"$.categories",url:"$.links.terms"}},"muse:unlisted":{label:["Unlisted connector","unlisted connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon"}}},Zn=Object.entries(sa),ca=e=>e.slice(e.indexOf(":")+1),Q=[...new Set(Zn.map(([e])=>ca(e)))],Sh=(e,r)=>sa[`${e}:${r??""}`],aa={directory_rule:"directory_plugin","cursor:directory_rule":"cursor:directory_plugin"},Ih=e=>typeof e=="string"&&Object.hasOwn(aa,e)?aa[e]:e,zh=e=>Zn.filter(([r])=>r.startsWith(`${e}:`)).map(([r])=>ca(r)),Ph=e=>Zn.filter(([,r])=>r[e]).map(([r])=>ca(r)),bw=new Set(Ph("hidden").flatMap(e=>[e,...Object.keys(aa).filter(r=>aa[r]===e)])),UO=Ph("late"),EO=Zn.flatMap(([,e])=>e.hidden&&e.charts?[e.charts]:[]);var RO=new Map(Zn.map(([e,r])=>[ca(e),r.label]));var A=["chatgpt","claude","cursor","grokbot","perplexity","muse"],Oh={chatgpt:"ChatGPT",claude:"Claude",cursor:"Cursor",grokbot:"Grok Bot",perplexity:"Perplexity",muse:"Muse"},Ln=e=>typeof e=="string"&&A.includes(e),yw=["chatgpt","claude","cursor","grokbot","perplexity","muse"];var VO=oa(yw.map(e=>Oh[e]));var FO=new Intl.DisplayNames(["en"],{type:"region"});var jh=["anon","account","agent","render"],_w={crawl:{pool:"anon",schedule:"sweep-per-region",run:{store:"chatgpt",region:"job"},settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},details:{pool:"anon",schedule:"with-primary-crawl",run:null,settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},claude:{pool:"anon",schedule:"sweep",run:{store:"claude",region:"global"},settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"global"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor_directory:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"directory"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"clearance",relays:["us","de"]}},grokbot:{pool:"anon",schedule:"sweep",run:{store:"grokbot",region:"global"},settles:["grokbot"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},perplexity:{pool:"anon",schedule:"sweep",run:{store:"perplexity",region:"global"},settles:["perplexity"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},muse:{pool:"anon",schedule:"sweep",run:{store:"muse",region:"global"},settles:["muse"],concurrency:"one-per-pool",lease:20,exit:{via:"region"}},github:{pool:"anon",schedule:"sweep",run:null,settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},mcp:{pool:"anon",schedule:"sweep",run:null,settles:A,concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},chatgpt_connectors:{pool:"account",schedule:"sweep-with-account",run:null,settles:["chatgpt"],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}},search_chatgpt:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"region"}},search_claude:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"direct"}},widget_shots:{pool:"render",schedule:"hourly",run:null,settles:[],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}}},Wd=Object.keys(_w),Ah=e=>Wd.includes(e);var Th=24;var BO=(Th+3)*36e5;var jr=["open","auth","blocked","dead","error"];var Dh=["active","challenged","disabled"];var Nh=["out","free","plus"];var $w={compare:"Compare","rank-history":"Rank history","listing-changelog":"Change history","live-clock":"Launch lag"},WO=oa(Object.values($w));var Mn={out:{rows:200,countries:"us",movers:{perChart:20,perStore:20},publishers:50,explorerRows:3,tagRows:200,changesTopRank:100,compareApps:0,rankHistoryApps:0,history:{ranks:30,featured:7,movers:7,launches:30,changes:7,pulse:7},api:{perMinute:60,rowsPerDay:3e5}},free:{rows:1e3,countries:"all",movers:{perChart:100,perStore:1/0},publishers:500,explorerRows:100,tagRows:1e3,changesTopRank:1/0,compareApps:0,rankHistoryApps:0,history:{ranks:30,featured:30,movers:30,launches:30,changes:30,pulse:30},api:{perMinute:600,rowsPerDay:6e5}},plus:{rows:1/0,countries:"all",movers:{perChart:1/0,perStore:1/0},publishers:1/0,explorerRows:1/0,tagRows:1/0,changesTopRank:1/0,compareApps:5,rankHistoryApps:10,history:{ranks:1/0,featured:1/0,movers:1/0,launches:1/0,changes:1/0,pulse:1/0},api:{perMinute:600,rowsPerDay:12e5}}};var tt=s.enum(A),V=s.string().nullish(),$e=s.string(),Dr=e=>s.preprocess(Ih,e),Ch=s.object({p:s.string(),k:Dr(s.enum(Q)).nullish(),c:V,f:V,l:V,n:V,d:V,i:V,pub:V,v:V,r:V}),kw=["home","category","top","new"],ww=s.object({slug:s.string(),kind:s.enum(kw),title:s.string(),description:V,items:s.array(Ch)}),xw=s.object({store:tt,region:s.string(),relay:V,egress_country:V,started_at:$e,finished_at:$e,requests:s.number().int(),catalog_complete:s.boolean().optional()}),Uh=s.object({p:s.string(),h:s.string(),d:s.string()}),Sw=s.object({p:s.string(),h:s.string()}),Iw=s.object({store:tt,at:$e,details:s.array(Uh),missing:s.array(s.string()).default([])}),zw=s.object({p:s.string(),n:s.string(),v:s.number(),t:s.string().optional()}),Pw=s.object({store:tt,at:$e,metrics:s.array(zw)}),Ow=s.object({s:tt,p:s.string(),url:s.string()}),jw=s.object({hash:s.string(),server_name:V,server_version:V,protocol_version:V,tools:s.array(s.unknown()),prompts:s.array(s.unknown()).nullish(),resources:s.array(s.unknown()).nullish()}),Aw=["streamable-http","sse"],Tw=s.object({url:s.string(),transport:s.enum(Aw).nullish(),status:s.enum(jr),auth_hint:V,error:V,snapshot:jw.optional()}),Dw=s.object({at:$e,links:s.array(Ow).default([]),probes:s.array(Tw).default([])});var Nw=s.object({url:s.string(),uri:s.string(),hash:s.string(),mime:V,meta:s.record(s.string(),s.unknown()).nullish(),html:V,bytes:s.number().int().nonnegative()}),Cw=s.object({at:$e,templates:s.array(Nw)});var Uw={light:{theme:"light",width:720},dark:{theme:"dark",width:720},mobile:{theme:"light",width:390}},Ew=["content","blank","loading","empty","failed"],Rw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),uri:s.string(),mime:V,input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),Zw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),variant:s.enum(Object.keys(Uw)),outcome:s.enum(Ew),width:s.number().int().nonnegative(),height:s.number().int().nonnegative(),png:V,detail:V}),Lw=s.object({at:$e,renderer:s.string(),shots:s.array(Zw)}),Mw=50,Vw=s.object({q:s.string().min(1).max(100),ids:s.array(s.string()).max(Mw)}),Fw=s.object({store:tt,region:s.string(),at:$e,results:s.array(Vw)}),Bw=s.object({p:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string(),version:s.string().nullable()}).nullable()}),Kw=s.object({p:s.string(),n:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string()}).nullable()}),Gw=s.object({at:$e,connectors:s.array(Bw).default([]),skills:s.array(Kw).default([])}),Jw=s.object({state:s.literal("challenged"),until:$e,error:s.string()}),Ww=s.object({store:tt,kind:Dr(s.enum(Q)).nullish(),categories:s.array(s.string()).default([]),text:s.string().default("")}),QO=s.object({id:s.number().int(),name:s.string(),listings:s.array(Ww)}),ej=s.object({version:s.string(),domains:s.array(s.object({id:s.string(),uses:s.array(s.string())})),audiences:s.array(s.string()),synonyms:s.record(s.string(),s.string()).default({})}),Hd=s.object({id:s.number().int(),store:tt,kind:Dr(s.enum(Q)).nullish(),name:V,publisher:V,publisher_key:V,website:V,repo:V,source:V,servers:s.array(s.string()).default([]),description:s.string().default("")}),tj=s.object({id:s.number().int(),app:s.string().nullable(),listings:s.array(Hd),scouted:s.literal(!0).optional()}),qw=["wrapper","third_party","sub_product","same_maker","unrelated"],rj=s.object({verdict:s.enum(["same","not_same","unsure"]),outliers:s.array(s.object({id:s.number().int(),relation:s.enum(qw),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),Hw=Hd.extend({app:s.string().nullable(),via:s.array(s.string())}),nj=s.object({listing:Hd,suggestions:s.array(Hw)}),Xw=["same","sub_product","same_maker","wrapper","third_party"],Yw=["agency_studio","startup","indie","smb","midmarket","enterprise","platform","unknown"],Qw=["solo","2-10","11-50","51-200","201+","unknown"],ex=["bootstrapped","vc_funded","public_or_large","unknown"],tx=["high","medium","low"],ij=s.object({website:s.string(),email:s.string(),linkedin:s.string(),x:s.string(),contact_name:s.string(),confidence:s.enum(tx),sources:s.array(s.string()).max(5),notes:s.string(),segment:s.enum(Yw),segment_why:s.string(),size:s.enum(Qw),funding:s.enum(ex)}),oj=s.object({related:s.array(s.object({id:s.number().int(),relation:s.enum(Xw),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),rx=s.object({server:s.number().int(),app:s.string(),tool:s.string(),title:V,description:V,params:s.unknown(),returns:s.unknown(),widget:V,template:s.string(),excerpt:V,views:s.record(s.string(),s.array(s.string())).default({}),about:V,publisher:V,prompts:s.array(s.string()).default([]),domain:V}),aj=rx.extend({profile:s.string()}),sj=s.object({input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),cj=s.object({domain:s.string(),secondary_domain:s.string().nullable(),uses:s.array(s.string()),audiences:s.array(s.string()),suggested:s.string().nullable(),confidence:s.number().min(0).max(1)}),uj=s.object({kind:s.enum(Wd).exclude(["crawl"])}),nx=["ok","blocked","challenged","error"],ix=s.object({t:$e,relay:s.string().nullable(),provider:s.string().nullable(),outcome:s.enum(nx),status:s.number().int().nullable(),error:s.string().nullable()}),ze=s.object({lease_token:s.string(),lease_expires_at:s.string(),id:s.number().int(),region:s.string().nullable(),priority:s.number().int(),attempts:s.number().int(),error:s.string().nullable(),created_at:$e,not_before:$e,claimed_at:s.string().nullable()}),Vt={versions:s.record(s.string(),s.string()).default({})},qd={undetailed:s.array(s.string()).default([])},ox=s.discriminatedUnion("kind",[ze.extend({kind:s.literal("crawl"),region:s.string(),...Vt,...qd}),ze.extend({kind:s.literal("details"),plugin_ids:s.array(s.string())}),ze.extend({kind:s.literal("claude"),...Vt,...qd}),ze.extend({kind:s.literal("cursor"),known_refs:s.record(s.string(),s.string()),...Vt}),ze.extend({kind:s.literal("grokbot"),known_refs:s.record(s.string(),s.string()),...Vt,...qd}),ze.extend({kind:s.literal("cursor_directory"),detail_ids:s.array(s.string()),...Vt}),ze.extend({kind:s.literal("perplexity"),detail_ids:s.array(s.string()),...Vt}),ze.extend({kind:s.literal("muse"),...Vt}),ze.extend({kind:s.literal("github"),backfill_installs:s.boolean()}),ze.extend({kind:s.literal("mcp"),servers:s.array(s.object({id:s.number().int(),url:s.string(),known:s.array(s.string()).default([]),uris:s.array(s.string()).default([])}))}),ze.extend({kind:s.literal("chatgpt_connectors"),account:s.object({id:s.number().int(),label:s.string()}),connectors:s.array(s.object({p:s.string(),c:s.string(),release:s.string().nullable()})),skills:s.array(s.object({p:s.string(),n:s.string(),release:s.string().nullable()}))}),ze.extend({kind:s.literal("search_chatgpt"),queries:s.array(s.string())}),ze.extend({kind:s.literal("search_claude"),queries:s.array(s.string())}),ze.extend({kind:s.literal("widget_shots"),renderer:s.string(),templates:s.record(s.string(),s.string()),subjects:s.array(Rw)})]),lj=s.object({protocol:s.literal("attempt-v1"),pool:s.enum(jh).default("anon"),kinds:s.array(s.string()).transform(e=>e.filter(Ah)).optional()}),dj=s.object({protocol:s.literal("attempt-v1").optional(),job:ox.nullable(),retry_at:s.string().nullable()});var Eh=800,Ar=s.string().min(1).max(200),Tr=s.number().int().nonnegative(),ax=s.object({job:s.number().int(),lease_token:Ar,request_id:Ar}),de={attempt:ax},pj=s.object({...de,store:tt,at:$e,listings:s.array(Uh),seen:s.array(Sw).default([])}),mj=Iw.extend(de),fj=Pw.extend(de),gj=Dw.extend(de),hj=Cw.extend(de),vj=Lw.extend(de),bj=Fw.extend(de),yj=Gw.extend(de),_j=s.object({...de,account:s.number().int(),report:Jw}),$j=s.object({...de,tries:s.array(ix)}),kj=s.object(de),wj=s.object({...de,error:s.string()}),xj=s.object(de),sx=ww.omit({items:!0}).extend({item_parts:Tr,item_count:Tr}),Sj=s.object({...de,publication_id:Ar,run:xw,app_parts:Tr,apps_count:Tr,charts:s.array(sx).max(500)}).superRefine((e,r)=>{e.app_parts===0!=(e.apps_count===0)&&r.addIssue({code:"custom",message:"app parts and count disagree"}),new Set(e.charts.map(i=>i.slug)).size!==e.charts.length&&r.addIssue({code:"custom",message:"duplicate chart slug"});for(let i of e.charts)i.item_parts===0!=(i.item_count===0)&&r.addIssue({code:"custom",message:"chart parts and count disagree"})}),Ij=s.object({...de,publication_id:Ar,part:Tr,apps:s.array(Ch).min(1).max(Eh)}),zj=s.object({...de,publication_id:Ar,slug:s.string(),part:Tr,plugin_ids:s.array(s.string()).min(1).max(Eh)}),Pj=s.object({...de,publication_id:Ar}),Oj=s.discriminatedUnion("action",[s.object({action:s.literal("add"),label:s.string().min(1).max(100)}),s.object({action:s.literal("disable"),label:s.string().min(1)}),s.object({action:s.literal("list")})]),jj=s.object({label:s.string(),store:tt,status:s.enum(Dh),paused_until:s.string().nullable(),last_used_at:s.string().nullable(),last_error:s.string().nullable(),created_at:$e});var Rh=["bug","wrong_data","missing_capability","confusing","other"],Zh=["user","model"],Lh=["app","listing","binding","publisher","tag","chart","server"];var Nr={summary:200,details:4e3,tool:64,subject_id:200,request_id:64};var cx=["chatgpt","claude","cursor","grokbot"];var ux=["apps","connectors","plugins","extensions","mcp","rules"],lx=e=>ux.includes(e),dx=e=>e.length<=100&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e);function Mh(e){let[,r,i,o,...t]=e.split("/");if(t.length||!o||!dx(o))return null;let n=cx.find(a=>a===r);return n&&i&&lx(i)?{store:n,slug:o}:null}var px={chatgpt:"category:featured",claude:"claude:popularity",cursor:"cursor:directory:top",grokbot:"grokbot:popular",perplexity:"perplexity:popular",muse:"muse:all"},Ej={...px,muse:"muse:featured"};var Fh=(e,r)=>`${e}:${r}`,Vh=[[/(^|\.)chatgpt\.com$/,"chatgpt"],[/(^|\.)claude\.(ai|com)$/,"claude"],[/(^|\.)cursor\.(com|sh)$/,"cursor"]];function bt(e){let r=e.trim(),i=r.indexOf(":");if(i>0&&Ln(r.slice(0,i)))return{store:r.slice(0,i),plugin_id:r.slice(i+1)};let o;try{o=new URL(r)}catch{return{store:null,plugin_id:r}}let t=Vh.some(([c])=>c.test(o.hostname))?null:Mh(o.pathname);if(t)return{store:t.store,plugin_id:t.slug};let n=/^#?\/app\/(?:([a-z]+)\/)?([^/?]+)/.exec(o.hash||o.pathname);if(n)return{store:Ln(n[1])?n[1]:"chatgpt",plugin_id:decodeURIComponent(n[2])};let a=decodeURIComponent(o.pathname.split("/").filter(Boolean).at(-1)??"");return/(^|\.)cursor\.directory$/.test(o.hostname)?{store:"cursor",plugin_id:`dir:${a}`}:{store:Vh.find(([c])=>c.test(o.hostname))?.[1]??null,plugin_id:a}}function Xd(e){let r=bt(e);return r.store?{store:r.store,plugin_id:r.plugin_id}:void 0}var mx=e=>Array.isArray(e)?e.join(","):String(e);function Bh(e,r,i){let o=new Set(e.flatMap(a=>"param"in a?[a.param]:[])),t=e.map(a=>{if("literal"in a)return a.literal;let c=r[a.param];if(c===void 0)return i(a.param,`${a.param} is required.`);if(!a.part)return encodeURIComponent(String(c));let u=Xd(String(c));return u?encodeURIComponent(u[a.part]):i(a.param,`${a.param}: expected '{store}:{plugin_id}', got '${c}'.`)}),n=new URLSearchParams(Object.entries(r).flatMap(([a,c])=>o.has(a)||c===void 0?[]:[[a,mx(c)]]));return`/${t.join("/")}${n.size?`?${n}`:""}`}var Pe=["observed","store_reported","derived","proxy","estimate"];var fx=["ranks","metrics","tools"],Fn=["rank_move","chart_enter","chart_exit","featuring_enter","featuring_exit","launch","toolset_change","listing_change","release_change","mcp_status_change","delisted","metric_change"],oA=Fn.filter(e=>e!=="release_change"),Jh=30,gx=["released_at","first_seen_at"],hx=["apps","rank"],vx=["1d","7d"],bx=["rank","new","name"],yx=["all","any"],_x=["chatgpt:apps_sdk","chatgpt:connector","chatgpt:plugin","chatgpt:curated","chatgpt:other"],$x=[..._x,...Object.keys(sa).filter(e=>!e.startsWith("chatgpt:"))],kx=["all","missing"],wx=["tags"],xx=["app"],Sx=["weekly_brief","competitor_watch","audit_my_server"],Wh=["store_reported","derived","observed"],Ix=/^-(\d{1,4})([hdw])$/,Vn=e=>Ix.test(e)||!Number.isNaN(Date.parse(e));var Gh=s.string().min(1).max(300),Yd=s.string().min(1).max(60),b={store:s.enum(A).describe("App store."),region:s.string().regex(/^([a-z]{2}|global|directory)$/).describe("ChatGPT country code (us, de\u2026), global, or directory (Cursor). Default: main catalog."),at:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("A past time (ISO-8601, -24h, -7d): the latest data at that time. Default: now."),app:Gh.describe("Listing ref '{store}:{plugin_id|slug}' (e.g. chatgpt:figma) or its OpenApps URL."),apps:s.array(Gh).min(1).max(10).describe("1 to 10 listing refs or OpenApps URLs."),chart:s.string().min(1).max(120).describe("Chart name as stores lists it, e.g. category:productivity, popularity, directory:top."),query:s.string().min(1).max(200).describe("Words to find in app names, descriptions and publishers."),publisher:s.string().min(1).max(200).describe("Only apps by this publisher, named in any form (Figma, Inc. or figma)."),category:s.string().min(1).max(120).describe("Category title as rows show it, e.g. Productivity (new_list: ChatGPT only)."),kind:Dr(s.enum(Q)).describe("App kind; stores lists each store's kinds."),limit:s.coerce.number().int().min(1).max(1e4).describe("Rows per page."),cursor:s.string().max(200).describe("The previous page's meta.next_cursor."),include:s.array(s.enum(fx)).describe("Sections per profile: ranks now, metrics, MCP tools."),response_format:s.enum(["concise","detailed"]).describe("detailed adds fields."),since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Start of the window: ISO-8601, or relative to the latest data (-24h, -7d)."),types:s.array(s.enum(Fn)).min(1).describe("Event types to keep. Default: all but release_change."),sort:s.enum(gx).describe("Newest first by this time; since bounds it."),id:s.string().min(1).max(600).describe("A search result id: listing:{store}:{plugin_id}, app:{slug}, tag:{id}, chart:{store}:{chart} or server:{url}."),server:s.string().min(1).max(500).describe("MCP server URL as a listing's tools list it, or its OpenApps id."),metric:s.string().min(1).max(40).describe("Metric name as the stores resource lists it, e.g. installs (Claude), dir_installs (Cursor)."),status:s.enum(jr).describe("MCP server status: open (lists its tools without a sign-in), auth, blocked, dead or error."),diff_from:s.string().min(1).max(80).describe("An earlier toolset to diff against: snapshot hash or time (ISO-8601, -7d)."),context:s.string().max(500).describe("User's goal, briefly; nothing personal."),guide:s.enum(Sx).describe("A playbook: the tool calls for a multi-step task, in order."),order:s.enum(hx).describe("apps: most apps first; rank: best chart position first."),window:s.enum(vx).describe("Movement against the previous day (1d) or a week earlier (7d)."),max_position:s.coerce.number().int().min(1).max(1e4).describe("Only rows at or above this position now (1-based)."),slug:s.string().min(1).max(300).describe("An app's slug (e.g. context7), or one of its listings' refs."),key:s.string().min(1).max(200).describe("Publisher key from publishers_list (e.g. figma), or a name it lists under (Figma, Inc.)."),tag:Yd.describe("Tag id from tags_tree, e.g. gmail."),tags:s.array(Yd).min(1).max(20).describe("Tag ids from tags_tree."),exclude:s.array(Yd).min(1).max(20).describe("Tag ids to leave out."),match:s.enum(yx).describe("all: every tag in tags; any: at least one."),linked:s.array(s.enum(A)).min(1).max(A.length).describe("Other stores its app is in."),stores:s.array(s.enum(A)).min(1).max(A.length).describe("App stores."),kinds:s.array(Dr(s.enum([...Q,...$x]))).min(1).max(20).describe("App kinds, bare (connector) or store-qualified (claude:connector, chatgpt:apps_sdk); a value qualified by another store is ignored."),families:s.array(s.string().min(1).max(80)).min(1).max(20).describe("ChatGPT app families, e.g. plugin_asdk_app."),categories:s.array(s.string().min(1).max(120)).min(1).max(20).describe("Category titles as rows show them."),publishers:s.array(s.string().min(1).max(200)).min(1).max(20).describe("Publisher keys (publishers_list) or names."),statuses:s.array(s.enum(jr)).min(1).max(jr.length).describe("MCP server statuses: open, auth, blocked, dead or error."),sort_by:s.enum(bx).describe("rank: best chart place; new: newest release; name: A to Z."),availability:s.enum(kx).describe("ChatGPT: all, listed in every country with data; missing, absent from some."),scope:s.enum(wx).describe("tags: browsing by tag."),group:s.enum(xx).describe("app: one row per app, its best listing, by OpenApps Rank across stores; total and facets count apps."),released_since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Only apps released since: ISO-8601, or relative to the latest data (-30d)."),from:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range start: ISO-8601, or relative to to (-30d)."),to:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range end, a past time. Default: the latest data."),issue:s.enum(Rh).describe("What the report is: a bug, wrong data, a missing capability, something confusing, or other."),summary:s.string().min(1).max(Nr.summary).describe("One line: what is wrong or missing."),details:s.string().max(Nr.details).describe("What the user tried, what happened and what was expected, paraphrased."),initiator:s.enum(Zh).describe("user when the user asked to send the report, model otherwise."),tool:s.string().min(1).max(Nr.tool).describe("The OpenApps tool the report is about."),subject_type:s.enum(Lh).describe("What the report is about."),subject_id:s.string().min(1).max(Nr.subject_id).describe("Its ref, slug or URL as these tools give it."),request_id:s.string().min(1).max(Nr.request_id).describe("The request id an OpenApps error answer ended with, when the report is about that call.")},qh={app:{parts:{store:b.store,plugin_id:s.string().min(1).max(280).describe("The listing's id in its store, e.g. plugin_01abc; {store}:{plugin_id} is its ref.")},split:Xd,join:e=>Fh(e.store,e.plugin_id)}};var Hh=["response_format","context"],Xh={store:null,limit:null,kind:null,response_format:null,sort:null,region:"ChatGPT country code (default us).",at:"Past time: ISO-8601 or -24h, -7d.",since:"Window start: ISO-8601 or -24h, -7d.",app:"Listing ref or OpenApps URL.",apps:"Listing refs or OpenApps URLs.",chart:"Chart name; stores_get lists them.",query:"Words in app names, descriptions or publishers.",publisher:"Publisher name, in any form.",category:"Category title (ChatGPT).",cursor:null,include:"Sections per profile.",types:"Default: all but release_change.",metric:"Metric name; stores_get lists each store's.",server:"MCP server URL.",diff_from:"Earlier toolset: snapshot hash or time.",context:"The user's goal, briefly.",guide:null,kinds:"e.g. claude:connector; stores_get lists them.",issue:null,details:null,tool:null,subject_type:null,summary:"One line.",initiator:"user if the user asked for it, else model.",subject_id:"Ref, slug or URL.",request_id:"From an error answer."},Yh=["kinds"],Qh=["limit"],ev={country:["region"],country_code:["region"],market:["region"],app_id:["app","apps"],plugin_id:["app","apps"],id:["app","apps"],ids:["apps"],app:["apps","slug"],app_ids:["apps"],refs:["apps"],product:["slug"],listing:["app","slug"],listings:["apps"],q:["query"],search:["query"],term:["query"],keyword:["query"],keywords:["query"],slug:["chart"],chart_id:["chart"],list:["chart"],category:["chart","categories"],platform:["store","stores"],marketplace:["store","stores"],store:["stores"],kind:["kinds","issue"],family:["families"],publisher:["publishers"],status:["statuses"],page_size:["limit"],max_results:["limit"],top:["limit"],count:["limit"],date:["at"],as_of:["at"],time:["at"],url:["server"],server_url:["server"],mcp_server:["server"],from:["diff_from","since","released_since"],after:["since","released_since"],type:["types"],event_types:["types"],compare_to:["diff_from"],since:["diff_from","released_since","from"],until:["to"],end:["to"],format:["response_format"],detail:["response_format"],verbosity:["response_format"],sections:["include"],fields:["include"],description:["details"],message:["summary"],sort:["order","sort_by"],publisher_key:["key","publisher"],product_id:["slug"],max_rank:["max_position"],period:["window"],order:["sort_by"],tag:["tags"],tags:["tag"],tag_id:["tag"],without:["exclude"],exclude_tags:["exclude"],mode:["match"],also_on:["linked"],mcp:["status","statuses"],mcp_status:["status","statuses"],released:["released_since"],launched_since:["released_since"]};var yt=s.string().nullable(),Qd=["current","stale","unavailable","none"],ep=s.object({store:s.enum(A),region:s.string(),as_of:yt.describe("When the region's latest data is from"),status:s.enum(Qd),dark_since:yt.describe("unavailable only: refused since")}),zx=s.object({tier:s.enum(Nh).describe("out (no account), free or plus (Pro)"),need:s.enum(["free","plus"]).describe("The plan that shows the rest"),cap:s.number().int().nullable().describe("Rows shown"),total:s.number().int().nullable().describe("Rows in full"),since:yt.describe("Earliest time shown"),regions:s.array(s.string()).nullable().describe("Countries shown"),rank:s.number().int().nullable().describe("Only apps ranked this high"),by:s.object({up:s.number().int(),down:s.number().int(),new:s.number().int()}).partial().optional().describe("movers_list: climbers, fallers and new entries in full, each cut to cap apart"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")}),Px=s.object({as_of:yt,run:s.object({store:s.enum(A),region:s.string(),started_at:s.string()}).nullable(),compared_to:s.object({prev:yt,day:yt,week:yt.optional().describe("charts_get on the latest run: the run prev_week is from")}).nullable(),freshness:s.object({cadence:s.string(),next_expected_at:yt,stale:s.boolean().describe("Any region older than expected")}).nullable(),basis:s.record(s.string(),s.enum(Pe)),coverage:s.object({notes:s.array(s.string()),regions:s.array(ep).describe("Each region the answer speaks for")}),next_cursor:s.string().nullable(),truncated:s.boolean(),truncation_reason:s.string().nullable(),plan:zx.optional().describe("What the caller's plan left out (truncation_reason plan)")}),tv=e=>s.object({data:e,meta:Px});function C(e){let r={...e,path:e.path??`/v1/${e.resource}`,output:tv(e.data)},i=[.../^[a-z]+(_[a-z]+){1,2}$/.test(r.name)&&r.name.startsWith(`${r.resource}_`)?[]:[`${r.name}: an operation is named <resource>_<verb> in lowercase, starting with its resource '${r.resource}'`],...jx(r.name,r.input,{toolOnly:!1}),...Ax(r.name,r.path,r.input),...Dx(r.name,r.data,r.basis),...r.examples.length?[]:[`${r.name}: give at least one example; tests run every example`],...r.examples.flatMap(o=>r.input.safeParse(o.input).success?[]:[`${r.name}: example '${o.title}' does not parse against the input`])];if(i.length)throw new Error(i.join(`
|
|
64
|
+
`));return r}var Ox=new Set(["optional","default","nullable","prefault"]);function rt(e){let r=e;for(;Ox.has(r._zod.def.type)&&r._zod.def.innerType;)r=r._zod.def.innerType;return r}function jx(e,r,{toolOnly:i}){return Object.entries(r.shape).flatMap(([o,t])=>{if(!Object.hasOwn(b,o)){let a=ev[o]?.[0];return[`${e}: input '${o}' is not in vocab.ts; ${a?`use '${a}', not '${o}'`:"add it to P there, or use a name P already has"}`]}let n=o;return!i&&Hh.includes(n)?[`${e}: '${o}' is a tool-only parameter; operations never take it`]:rt(t)!==b[n]?[`${e}: input '${o}' must be P.${o} from vocab.ts (wrapped only in .optional() or .default()), not a schema of its own`]:[]})}function Ax(e,r,i){return/^\/v1(\/([a-z]+|\{[a-z_]+\}))+$/.test(r)?[...r.matchAll(/\{([a-z_]+)\}/g)].flatMap(([,o])=>Object.hasOwn(i.shape,o)?i.shape[o].safeParse(void 0).success?[`${e}: path placeholder {${o}} must be a required input`]:[]:[`${e}: path placeholder {${o}} is not an input`]):[`${e}: path '${r}' must be /v1 followed by lowercase segments and {input} placeholders`]}function Tx(e,r){let i=e;for(let o of r.split(".")){let[,t,n]=/^([a-z_0-9]+)(\[\])?$/.exec(o)??[],a=i&&rt(i);if(!t||!(a instanceof s.ZodObject)||!Object.hasOwn(a.shape,t))return;if(i=a.shape[t],n){let c=rt(i);if(!(c instanceof s.ZodArray))return;i=c.element}}return i}var Dx=(e,r,i)=>Object.keys(i).flatMap(o=>Tx(r,o)?[]:[`${e}: basis path '${o}' names no field of the output`]);var O=e=>e.optional().meta({detailed:!0});var ge=(e,r,i,o)=>({facet:"domain",value:e,title:r,description:i,synonyms:o,parent:null}),w=(e,r,i,o,t)=>({facet:"use",value:e,title:i,description:o,synonyms:t,parent:r}),se=(e,r,i,o)=>({facet:"audience",value:e,title:r,description:i,synonyms:o,parent:null}),S=(e,r,i,o)=>({facet:"connects",value:e,title:r,description:`Works with ${r}.`,synonyms:[i],parent:null,site:o}),Bn=[ge("design-media","Design & media","Make or edit images, video, audio, slides, graphics, 3D models and websites.",[]),w("image-generation","design-media","Images & photos","Generate, edit or enhance images, photos, logos and illustrations.",[]),w("video","design-media","Video","Make, edit or publish video.",["Video generation & avatars","Video editing & publishing"]),w("audio-music","design-media","Audio, voice & music","Work with audio, voice and music.",["Music","Voice & speech","Transcription","Podcasts & audiobooks"]),w("presentations","design-media","Presentations & slides","Build slide decks and presentations.",[]),w("graphic-design","design-media","Graphic & UI design","Graphics, branding, mockups, UI design and design systems.",[]),w("3d-cad","design-media","3D & CAD","3D models, CAD and 3D printing.",[]),w("websites","design-media","Websites & landing pages","Build, generate or publish websites and landing pages.",[]),ge("developer-tools","Developer tools & IT","Write, test, ship, run and secure software.",["Security & IT"]),w("code-review","developer-tools","Code review & quality","Review pull requests, lint, refactor and track code quality.",[]),w("testing-qa","developer-tools","Testing & QA","Write and run unit, end-to-end and regression tests.",[]),w("deploy-cloud","developer-tools","Deploy, hosting & infra","Deploy and run software on cloud infrastructure.",["Hosting & deploys","Containers & Kubernetes","IaC & CI/CD","Cloud cost & FinOps"]),w("databases","developer-tools","Databases","Query, manage and migrate databases, including vector stores.",[]),w("apis-sdks","developer-tools","APIs & SDKs","Design, document, test and call APIs; SDKs and webhooks.",[]),w("observability","developer-tools","Debugging & monitoring","Debug errors, read logs and traces, handle incidents.",[]),w("git","developer-tools","Git & version control","Repositories, commits, branches and merge requests.",[]),w("codebase-docs","developer-tools","Code search & docs","Search codebases and read current developer docs.",[]),w("agent-building","developer-tools","Agent building & orchestration","Build, run and evaluate AI agents.",["Multi-agent orchestration","Memory & context","MCP gateways & tooling","Evals & LLM ops"]),w("harness-addons","developer-tools","Coding agent add-ons","Hooks, status lines, commands and session tools for coding agents.",[]),w("coding-conventions","developer-tools","Coding rules & conventions","Rules, style guides and best practices for writing code.",[]),w("mobile-dev","developer-tools","Mobile & Apple platforms","Build iOS, Android and macOS apps.",[]),w("domains-dns","developer-tools","Domains & DNS","Search, register and configure domains and DNS.",[]),w("appsec","developer-tools","AppSec & vulnerabilities","Vulnerabilities, security scans and threat intelligence.",[]),w("identity-access","developer-tools","Identity & access","Identity, single sign-on, passwords and access control.",[]),w("it-ops","developer-tools","IT ops & devices","IT support, device management and networks.",[]),w("agent-guardrails","developer-tools","Agent guardrails & safety","Guardrails, sandboxes and redaction for AI agents.",[]),ge("data-analytics","Data & analytics","Query, analyze and chart data.",[]),w("bi-dashboards","data-analytics","BI & dashboards","Dashboards, KPIs, reporting and business intelligence.",[]),w("warehouses-pipelines","data-analytics","Warehouses & pipelines","Data warehouses, lakes, catalogs and ETL pipelines.",[]),w("spreadsheets","data-analytics","Spreadsheets & CSV","Work with spreadsheets and CSV files.",[]),w("product-analytics","data-analytics","Product & web analytics","Funnels, experiments, feature flags and web traffic.",[]),w("web-data-extraction","data-analytics","Web data extraction","Pull structured data out of web pages and documents.",[]),w("charts-viz","data-analytics","Charts & visualization","Charts, diagrams, flowcharts and whiteboards.",[]),ge("productivity","Productivity & docs","Writing, notes, documents, files, calendars and meetings.",[]),w("writing","productivity","Writing & editing","Write, rewrite, proofread and edit text.",[]),w("notes-knowledge","productivity","Notes & knowledge base","Notes, wikis, bookmarks and team knowledge.",[]),w("documents-pdfs","productivity","Documents & PDFs","Create, edit, sign and manage documents and PDFs.",[]),w("forms-surveys","productivity","Forms & surveys","Build forms, surveys and questionnaires.",[]),w("calendar-scheduling","productivity","Calendar & scheduling","Calendars, appointments and meeting booking.",[]),w("meetings","productivity","Meeting notes & transcripts","Record, transcribe and summarize meetings.",[]),w("files-storage","productivity","Files & storage","Store, share and search files.",[]),w("translation","productivity","Translation","Translate and localize text.",[]),w("ai-assistant-tools","productivity","AI assistant tools","Memory, chat history and export, prompts, skills and usage for the AI assistant you use.",["Chat export","Prompt library","Skills"]),w("personal-assistant","productivity","Personal assistant & memory","Plan the day, remember things and handle life admin.",[]),ge("project-management","Projects & workflows","Plan work, track tasks and automate workflows.",[]),w("tasks","project-management","Tasks & to-dos","To-do lists, checklists and task tracking.",[]),w("issues-sprints","project-management","Issues & sprints","Issue tracking, backlogs, sprints and roadmaps.",[]),w("product-specs","project-management","Product specs & PRDs","Product requirements, specs and user stories.",[]),w("automation","project-management","Automation & workflows","Automate repetitive work across apps.",[]),w("time-tracking","project-management","Time tracking","Track hours and timesheets.",[]),ge("communication","Communication","Email, chat, messaging and calls.",[]),w("email","communication","Email","Read, sort, write and send email.",[]),w("team-chat","communication","Team chat & messaging","Team chat, direct messages and text messages.",[]),w("calls","communication","Calls & video meetings","Phone calls, video calls and dialers.",[]),ge("sales-crm","Sales & customers","Find leads, close deals and support customers.",["Customer support"]),w("crm","sales-crm","CRM","Contacts, accounts and deal pipelines.",[]),w("prospecting","sales-crm","Prospecting & leads","Find, enrich and contact leads.",[]),w("sales-enablement","sales-crm","Sales enablement","Sales calls, coaching, proposals and RFPs.",[]),w("partnerships","sales-crm","Partnerships & affiliates","Partner, affiliate and referral programs.",[]),w("helpdesk","sales-crm","Helpdesk & tickets","Support tickets, live chat and customer conversations.",[]),w("feedback-reviews","sales-crm","Feedback & reviews","Collect and analyze customer feedback and reviews.",[]),w("help-center","sales-crm","Help center & FAQs","Help articles and FAQs.",[]),ge("marketing","Marketing & SEO","Search, ads, social, content, email and brand.",[]),w("seo","marketing","SEO & AI search","Keyword research, search rankings and visibility in AI answers.",[]),w("ads","marketing","Ads & paid media","Plan, run and report on ad campaigns.",[]),w("social-media","marketing","Social media","Post to, schedule and track social media.",[]),w("content-marketing","marketing","Content & copy","Blog posts, content plans and marketing copy.",[]),w("email-marketing","marketing","Email marketing","Newsletters, email campaigns and subscriber lists.",[]),w("brand-intel","marketing","Brand & competitor intel","Track brand mentions, competitors and sentiment.",[]),w("marketing-analytics","marketing","Marketing analytics & attribution","Campaign performance, attribution and marketing data.",[]),w("app-marketing","marketing","App store & product marketing","App store optimization, app rankings and product launches.",[]),ge("finance","Finance & payments","Payments, accounting, tax, investing, banking and insurance.",[]),w("payments-billing","finance","Payments & billing","Take payments, send invoices and manage billing.",[]),w("accounting","finance","Accounting & bookkeeping","Books, expenses, receipts and reconciliation.",[]),w("tax","finance","Tax","Tax returns, VAT and tax filings.",[]),w("investing","finance","Investing & market data","Stocks, market data, filings, portfolios and trading.",[]),w("deals-vc","finance","Deals, M&A & VC","Fundraising, due diligence, data rooms and deal flow.",[]),w("crypto","finance","Crypto & web3","Tokens, wallets, chains and exchanges.",[]),w("banking","finance","Banking & personal finance","Bank accounts, budgets, cards, loans and mortgages.",[]),w("insurance","finance","Insurance","Insurance quotes, policies and underwriting.",[]),w("fpa","finance","FP&A & finance ops","Financial planning, forecasts, cash flow and spend.",[]),ge("commerce","Commerce & shopping","Shopping, online stores and real estate.",[]),w("shopping","commerce","Shopping & deals","Find products, compare prices and get deals.",[]),w("ecommerce-ops","commerce","E-commerce operations","Run online stores: listings, inventory and orders.",[]),w("real-estate","commerce","Real estate","Homes, rentals and property data.",[]),ge("research","Research & search","Search the web, papers, companies and news.",[]),w("web-search","research","Web search","Search the web.",[]),w("academic","research","Academic & scientific","Papers, preprints, clinical trials and scientific data.",[]),w("company-research","research","Company & market research","Company profiles, industries and markets.",[]),w("news","research","News & media","News, headlines and press releases.",[]),w("deep-research","research","Deep research & reports","Long research reports with sources.",[]),ge("travel-places","Travel & places","Flights, stays, transport, trips, maps, weather and events.",[]),w("flights","travel-places","Flights","Search and book flights.",[]),w("hotels","travel-places","Hotels & stays","Hotels, rentals and other places to stay.",[]),w("ground-transport","travel-places","Trains, transit & cars","Trains, buses, transit, car rentals and rides.",[]),w("trip-planning","travel-places","Trip planning & guides","Itineraries, destinations and things to do.",[]),w("maps-local","travel-places","Maps & local","Maps, directions and local places.",[]),w("weather","travel-places","Weather","Weather forecasts and climate data.",[]),w("events-tickets","travel-places","Events & tickets","Concerts, festivals, venues and event tickets.",[]),ge("education","Education & learning","Studying, language learning and teaching.",[]),w("tutoring","education","Students & tutoring","Homework help, tutoring, quizzes and flashcards.",[]),w("language-learning","education","Language learning","Learn a language: vocabulary and pronunciation.",[]),w("teaching","education","Teaching & courses","Lesson plans, courses and classroom tools.",[]),ge("health","Health & wellness","Fitness, nutrition, medicine and mental health.",[]),w("fitness","health","Fitness & running","Workouts, running, cycling and training plans.",[]),w("nutrition","health","Nutrition & diet","Calories, diets and meal plans.",[]),w("medical","health","Medical & clinical","Clinical care, patients, drugs and health records.",[]),w("mental-health","health","Mental health & sleep","Therapy, meditation, journaling and sleep.",["Meditation","Mindfulness"]),ge("lifestyle","Entertainment & lifestyle","Games, entertainment, food, home, sports and relationships.",[]),w("games","lifestyle","Games & puzzles","Games, puzzles and trivia.",[]),w("movies-books","lifestyle","Movies, TV & books","Movies, TV shows, books and reading lists.",[]),w("food-recipes","lifestyle","Food & recipes","Recipes, cooking, restaurants and drinks.",[]),w("home-family","lifestyle","Home, family & pets","Home, family, kids and pets.",[]),w("spirituality","lifestyle","Astrology & spirituality","Astrology, tarot and religion.",[]),w("sports","lifestyle","Sports & betting","Sports scores, fantasy leagues and betting.",[]),w("dating","lifestyle","Dating & relationships","Dating and relationship advice.",[]),ge("business-ops","Business operations","Hiring, legal, logistics, ERP, procurement and small business tools.",["HR & recruiting","Legal & compliance"]),w("recruiting","business-ops","Recruiting & hiring","Source, screen and hire candidates.",[]),w("careers","business-ops","Careers & job search","Resumes, cover letters, job search and interview prep.",[]),w("people-ops","business-ops","People ops & payroll","Payroll, employee records, time off and reviews.",[]),w("contracts","business-ops","Contracts","Draft, review and redline contracts.",[]),w("compliance","business-ops","Compliance & privacy","Regulation, privacy, risk and governance.",[]),w("legal-research","business-ops","Legal research","Case law, statutes, patents and trademarks.",[]),w("logistics","business-ops","Logistics & shipping","Shipping, freight, fleets and supply chains.",[]),w("erp-procurement","business-ops","ERP & procurement","ERP, purchase orders and suppliers.",[]),w("small-business-ops","business-ops","Small business tools","Tools for small businesses, freelancers and field services.",[]),se("for-developers","Developers","Software developers and engineering teams.",[]),se("for-designers","Designers & creators","Designers, artists and content creators.",[]),se("for-marketers","Marketers","Marketers, growth teams and agencies.",[]),se("for-sales","Sales teams","Sales reps and sales teams.",[]),se("for-support","Support teams","Customer support teams.",[]),se("for-product","Product managers","Product managers and product teams.",[]),se("for-data","Data teams & analysts","Data teams, analysts and data scientists.",[]),se("for-finance","Finance teams & accountants","Finance teams, accountants and bookkeepers.",[]),se("for-hr","HR & recruiters","Recruiters, hiring managers and HR teams.",[]),se("for-legal","Legal teams","Lawyers, paralegals and legal teams.",[]),se("for-it-security","IT & security teams","IT admins, security teams and SREs.",[]),se("for-researchers","Researchers & scientists","Researchers, scientists and academics.",[]),se("for-students","Students & educators","Students, learners and educators.",["Teachers","Learners"]),se("for-clinicians","Clinicians & health pros","Doctors, nurses, pharmacists and other health professionals.",[]),se("for-investors","Investors & traders","Investors, traders and portfolio managers.",[]),se("for-small-business","Small business & freelancers","Small businesses, freelancers and founders.",[]),se("for-consumers","Consumers","People using it in their personal life: travel, shopping, health, money and entertainment.",[]),se("for-enterprise","Enterprise","Large organizations.",[]),S("gmail","Gmail","Google Workspace","mail.google.com"),S("google-drive","Google Drive","Google Workspace","drive.google.com"),S("google-calendar","Google Calendar","Google Workspace","calendar.google.com"),S("google-docs","Google Docs","Google Workspace","docs.google.com"),S("google-sheets","Google Sheets","Google Workspace","sheets.google.com"),S("google-slides","Google Slides","Google Workspace","slides.google.com"),S("google-meet","Google Meet","Google Workspace","meet.google.com"),S("google-ads","Google Ads","Google marketing","ads.google.com"),S("google-analytics","Google Analytics","Google marketing","analytics.google.com"),S("search-console","Search Console","Google marketing","search.google.com"),S("youtube","YouTube","Google marketing","youtube.com"),S("google-maps","Google Maps","Google marketing","maps.google.com"),S("outlook","Outlook","Microsoft 365","outlook.live.com"),S("microsoft-teams","Teams","Microsoft 365","teams.microsoft.com"),S("excel","Excel","Microsoft 365","excel.cloud.microsoft"),S("word","Word","Microsoft 365","word.cloud.microsoft"),S("powerpoint","PowerPoint","Microsoft 365","powerpoint.cloud.microsoft"),S("sharepoint-onedrive","SharePoint & OneDrive","Microsoft 365","onedrive.live.com"),S("power-bi","Power BI","Microsoft 365","powerbi.com"),S("dynamics","Dynamics 365","Microsoft 365","dynamics.microsoft.com"),S("jira","Jira","Atlassian","jira.atlassian.com"),S("confluence","Confluence","Atlassian","confluence.atlassian.com"),S("bitbucket","Bitbucket","Atlassian","bitbucket.org"),S("trello","Trello","Atlassian","trello.com"),S("github","GitHub","Code hosting","github.com"),S("gitlab","GitLab","Code hosting","gitlab.com"),S("aws","AWS","Cloud & hosting","aws.amazon.com"),S("google-cloud","Google Cloud","Cloud & hosting","cloud.google.com"),S("azure","Azure","Cloud & hosting","azure.microsoft.com"),S("cloudflare","Cloudflare","Cloud & hosting","cloudflare.com"),S("vercel","Vercel","Cloud & hosting","vercel.com"),S("netlify","Netlify","Cloud & hosting","netlify.com"),S("firebase","Firebase","Cloud & hosting","firebase.google.com"),S("supabase","Supabase","Cloud & hosting","supabase.com"),S("docker-k8s","Docker & Kubernetes","Cloud & hosting","docker.com"),S("postgres","Postgres","Databases & warehouses","postgresql.org"),S("mysql","MySQL","Databases & warehouses","mysql.com"),S("mongodb","MongoDB","Databases & warehouses","mongodb.com"),S("redis","Redis","Databases & warehouses","redis.io"),S("snowflake","Snowflake","Databases & warehouses","snowflake.com"),S("databricks","Databricks","Databases & warehouses","databricks.com"),S("elasticsearch","Elasticsearch","Databases & warehouses","elastic.co"),S("sqlite","SQLite","Databases & warehouses","sqlite.org"),S("sentry","Sentry","Developer services","sentry.io"),S("datadog","Datadog","Developer services","datadoghq.com"),S("postman","Postman","Developer services","postman.com"),S("twilio","Twilio","Developer services","twilio.com"),S("slack","Slack","Chat & meetings","slack.com"),S("discord","Discord","Chat & meetings","discord.com"),S("zoom","Zoom","Chat & meetings","zoom.us"),S("whatsapp","WhatsApp","Chat & meetings","whatsapp.com"),S("telegram","Telegram","Chat & meetings","telegram.org"),S("notion","Notion","Work management","notion.so"),S("linear","Linear","Work management","linear.app"),S("asana","Asana","Work management","asana.com"),S("clickup","ClickUp","Work management","clickup.com"),S("monday","monday.com","Work management","monday.com"),S("airtable","Airtable","Work management","airtable.com"),S("todoist","Todoist","Work management","todoist.com"),S("obsidian","Obsidian","Work management","obsidian.md"),S("dropbox","Dropbox","Work management","dropbox.com"),S("box","Box","Work management","box.com"),S("zapier","Zapier","Work management","zapier.com"),S("calendly","Calendly","Work management","calendly.com"),S("salesforce","Salesforce","CRM & sales tools","salesforce.com"),S("hubspot","HubSpot","CRM & sales tools","hubspot.com"),S("pipedrive","Pipedrive","CRM & sales tools","pipedrive.com"),S("attio","Attio","CRM & sales tools","attio.com"),S("zoho","Zoho","CRM & sales tools","zoho.com"),S("apollo","Apollo","CRM & sales tools","apollo.io"),S("stripe","Stripe","Commerce & payments","stripe.com"),S("shopify","Shopify","Commerce & payments","shopify.com"),S("paypal","PayPal","Commerce & payments","paypal.com"),S("square","Square","Commerce & payments","squareup.com"),S("woocommerce","WooCommerce","Commerce & payments","woocommerce.com"),S("amazon","Amazon","Commerce & payments","amazon.com"),S("quickbooks","QuickBooks","Commerce & payments","quickbooks.intuit.com"),S("xero","Xero","Commerce & payments","xero.com"),S("figma","Figma","Design & web","figma.com"),S("canva","Canva","Design & web","canva.com"),S("adobe","Adobe","Design & web","adobe.com"),S("webflow","Webflow","Design & web","webflow.com"),S("framer","Framer","Design & web","framer.com"),S("wordpress","WordPress","Design & web","wordpress.org"),S("instagram","Instagram","Social networks","instagram.com"),S("tiktok","TikTok","Social networks","tiktok.com"),S("x-twitter","X / Twitter","Social networks","x.com"),S("facebook","Facebook & Meta","Social networks","facebook.com"),S("reddit","Reddit","Social networks","reddit.com"),S("linkedin","LinkedIn","Social networks","linkedin.com"),S("zendesk","Zendesk","Support tools","zendesk.com"),S("intercom","Intercom","Support tools","intercom.com"),S("freshdesk","Freshdesk","Support tools","freshdesk.com"),S("openai-api","OpenAI API","AI models & media APIs","openai.com"),S("gemini","Gemini","AI models & media APIs","gemini.google.com"),S("hugging-face","Hugging Face","AI models & media APIs","huggingface.co"),S("elevenlabs","ElevenLabs","AI models & media APIs","elevenlabs.io"),S("replicate","Replicate","AI models & media APIs","replicate.com")];var av=[{id:"job",label:"Use case",hint:"What it does"},{id:"works",label:"Works with",hint:"Products and platforms it connects to"},{id:"for",label:"Audience",hint:"Who it is for"},{id:"cap",label:"Capabilities",hint:"Read from listing data, not text"}],E=(e,r,i,o=[])=>({id:e,label:r,description:i,kids:o}),rv=e=>({...e,api:!0});function sv(e,r,i=null,o=!1){return r.flatMap(t=>{let n=o||!!t.api;return[{id:t.id,label:t.label,description:t.description,facet:e,parent:i,other:!1,...n?{api:!0}:{}},...sv(e,t.kids,t.id,n)]})}function Nx(e){let r=[],i=new Map;for(let n of e){let a=n.parent===null?void 0:i.get(n.parent);if(i.has(n.id))throw new Error(`duplicate tag id ${n.id}`);if(n.parent!==null&&!a)throw new Error(`tag ${n.id} comes before its parent ${n.parent}`);let c={...n,depth:a?a.depth+1:1,kids:[]};r.push(c),i.set(n.id,c),a?.kids.push(n.id)}let o=new Map(r.map((n,a)=>[n.id,a])),t=n=>{let a=[];for(let c=i.get(n)?.parent??null;c;c=i.get(c)?.parent??null)a.push(c);return a};return{tags:r,node:n=>i.get(n),ancestors:t,withAncestors:n=>{let a=new Set;for(let c of n)if(i.has(c)){a.add(c);for(let u of t(c))a.add(u)}return[...a].sort((c,u)=>o.get(c)-o.get(u))}}}var Cx=[E("cap-kind","Listing type","What the listing is in its store.",[E("kind-chatgpt-app","ChatGPT app","An app in ChatGPT."),E("kind-claude-connector","Claude connector","A connector in Claude."),E("kind-claude-plugin","Claude plugin","A plugin in Claude."),E("kind-cursor-plugin","Cursor plugin","A plugin in the Cursor marketplace."),E("kind-mcp-server","MCP server (cursor.directory)","An MCP server listed on cursor.directory."),E("kind-rule","Rule (cursor.directory)","A rule listed on cursor.directory."),E("kind-claude-extension","Claude desktop extension","A desktop extension in Claude."),E("kind-grokbot-plugin","Grok Bot plugin","A plugin in Grok Bot."),E("kind-grokbot-bot","Grok Bot template","A bot template in Grok Bot's marketplace.")]),E("cap-ui","ChatGPT surface","Whether a ChatGPT app can show its own interface.",[E("apps-sdk","Apps SDK app (can show UI)","Built with the Apps SDK, so it can show its own interface in the chat."),E("connector-only","Connector (no UI)","A connector that returns data to the chat and shows no interface of its own.")]),E("cap-access","Sign-in","Whether it needs you to sign in, and how.",[E("signin-oauth","OAuth sign-in","Asks you to sign in with your account."),E("signin-key","API key or token","Needs an API key or token."),E("signin-open","Open, no sign-in","Its MCP server works without signing in.")]),E("cap-mcp","MCP server","What its MCP server reports.",[E("mcp-remote","Remote MCP (streamable HTTP)","A remote MCP server over streamable HTTP."),E("mcp-sse","SSE transport","A remote MCP server over the older SSE transport."),E("mcp-down","Server down or erroring","Its MCP server is down, blocked or returning errors.")]),E("cap-actions","Tool actions","What its tools do, read from their names and annotations.",[E("writes-data","Writes data (create/update/send)","Has tools that create, change, send or delete things."),E("read-only","Read-only tools","Every tool only reads.")]),E("cap-reach","Reach","Where the listing is available and promoted.",[E("multi-store","On 2+ stores","The same product is listed in two or more stores."),E("all-stores","On 3+ stores","The same product is listed in three or more stores."),E("geo-restricted","Missing in some countries","Missing from the ChatGPT directory in some countries."),E("worldwide","Listed in every country","Listed in the ChatGPT directory in every country we cover."),E("on-shelf","On a home shelf now","On one of its store's home shelves now.")]),E("cap-age","Age","When the listing was created.",[E("new-30d","Created in the last 30 days","Created in the last 30 days, by the listing's own creation date."),E("new-7d","Created in the last 7 days","Created in the last 7 days, by the listing's own creation date.")]),rv(E("cap-form","Form","What the listing is across stores, read from what it holds (an MCP server makes it an integration).",[E("form-integration","Integration","Reaches a service through a server it runs: an MCP server, an LSP server or a CLI."),E("form-instruction","Instruction","Text the assistant follows: rules, skills, commands, subagents or hooks, and no server."),E("form-agent","Agent","A ready-made assistant: a Grok Bot template.")])),rv(E("cap-parts","Parts","What the listing holds, as its store's records list it.",[E("has-skills","Skills","Holds one or more skills."),E("has-rules","Rules","Holds one or more rules."),E("has-commands","Commands","Holds one or more commands."),E("has-agents","Subagents","Holds one or more subagents."),E("has-hooks","Hooks","Holds one or more hooks.")])),E("cap-review","Store review","How its store vetted the listing.",[E("community","Community listing","In the community tier of Claude's directory, which records no review of the listing by Anthropic or a partner.")])],cv={"Google Workspace":"google-workspace","Google marketing":"google-marketing","Microsoft 365":"microsoft-365",Atlassian:"atlassian","Code hosting":"code-hosts","Cloud & hosting":"clouds","Databases & warehouses":"data-stores","Developer services":"dev-services","Chat & meetings":"chat-apps","Work management":"work-apps","CRM & sales tools":"crm-tools","Commerce & payments":"commerce-tools","Design & web":"design-tools","Social networks":"social-networks","Support tools":"support-tools","AI models & media APIs":"ai-models"},Ux={domain:"job",use:"job",connects:"works",audience:"for"},nv=Bn.filter(e=>e.facet==="connects"),iv=e=>{let r=cv[e.synonyms[0]];if(!r)throw new Error(`brand ${e.value} names no known group`);return r},Ex=[...new Set(nv.map(iv))].flatMap(e=>{let r=nv.filter(o=>iv(o)===e),i=r[0].synonyms[0];return[{id:e,label:i,description:`Works with ${r.slice(0,-1).map(o=>o.title).join(", ")} or ${r.at(-1).title}.`,facet:"works",parent:null,other:!1},...r.map(o=>({id:o.value,label:o.title,description:o.description,facet:"works",parent:e,other:!1,site:o.site}))]}),ov=Bn.filter(e=>e.facet!=="connects").map(e=>({id:e.value,label:e.title,description:e.description,facet:Ux[e.facet],parent:e.parent,other:!1})),tp=Nx([...ov.filter(e=>e.facet==="job"),...Ex,...ov.filter(e=>e.facet==="for"),...sv("cap",Cx)]),rp=tp.tags,wA=rp.map(e=>e.id),xA=new Map(rp.map(e=>[e.id,e])),SA=new Map(rp.map((e,r)=>[e.id,r])),IA=new Map([...Bn.map(e=>[e.value,e.facet]),...Object.values(cv).map(e=>[e,"connects"])]);var zA=new Map(Bn.filter(e=>e.facet!=="connects").map(e=>[e.value,e.synonyms]));var PA=tp.ancestors;var OA=tp.withAncestors;var Y=s.number().int(),ne=s.string(),F=s.string().nullable(),Ft=s.record(s.string(),s.unknown()),ip=O(F.describe("The app's icon on the OpenApps site")),Me=s.string().nullable().describe("Unique in its store; listings_get takes it"),Rx=F.describe("The app's page in the store"),pe=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),store:s.enum(A),url:s.string(),short_description:F,publisher:O(F),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer"))}),_t=F.describe("The app's store category, e.g. Productivity"),np=s.string().nullable(),Cr=s.array(s.object({store:s.enum(A),app:s.string(),slug:np,kind:s.enum(Q),url:s.string()})).describe("The product's apps in other stores"),Ve=s.object({chart:s.string(),title:F,position:Y.describe("1-based; among the app's kind when kind is set"),kind:s.string().nullable()}).describe("Best place now: the main ranking if it lists the app, else the best other"),nt=s.array(s.string()).describe("Tag ids it carries now, ancestors included, in tags_tree order"),uv=Y.nullable().optional(),Le=Y.nullable().optional(),la=pe.extend({best:Ve.nullable(),category:_t,tags:nt,linked:Cr,prev_day:uv.describe("best.position ~24h earlier; null: not listed then"),prev_week:uv.describe("As prev_day, ~7 days earlier"),day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier"),countries:s.object({listed:Y,of:Y}).optional().describe("ChatGPT: countries whose directory lists it, of those with complete data"),launched_at:O(ne.nullable()),first_seen_at:O(ne),mcp_status:O(F.describe("Status of the first MCP server it links"))}),Ur=s.object({position:Y,app:s.string(),slug:Me,name:F,url:s.string(),prev:Y.nullable(),prev_day:Y.nullable(),is_new:s.boolean(),kind:O(s.enum(Q)),publisher:O(F),short_description:O(F),launched_at:O(ne.nullable()),listing:O(Ft.describe("Store-specific listing fields, e.g. Claude tier and surfaces")),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer")),category:_t,linked:Cr,prev_week:O(Y.nullable().describe("Position ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),day_change:Le.describe("Cohort change since ~24h earlier: what the site's change pill shows"),week_change:O(Le.describe("As day_change, since ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),first_seen_at:O(ne),kind_position:O(Y.nullable().describe("Position among the list's apps of the same kind, in lists that join kinds (Claude's Most popular); else null")),tags:O(nt)}),Zx=s.partialRecord(s.enum(A),Y).describe("Apps carrying it per store"),da=s.enum(av.map(e=>e.id)),Kn=s.object({id:s.string(),label:s.string(),facet:da,parent:F.describe("The tag one level up; null for a top tag"),depth:Y.describe("1 for a top tag"),other:s.boolean().describe("An 'X: Other' tag: in its parent, in none of the parent's narrower tags"),n:Y.describe("Apps carrying it, in the stores asked for"),stores:Zx,description:O(s.string()),icon:s.string().optional().describe("A brand's mark on the OpenApps site: its website's favicon")}),op=s.object({key:s.string().describe("Publisher key: publishers_get takes it"),name:s.string().describe("The name most of its apps carry"),stores:s.array(s.object({store:s.enum(A),apps:Y})).describe("Every store it has apps in"),apps:Y,best:Ve.extend({app:s.string()}).nullable().describe("Its app with the best place now"),icon:ip}),ap=s.object({chart:s.string(),slug:s.string(),store:s.enum(A),kind:s.string(),title:F,description:O(F),url:s.string()}),Lx=s.object({region:s.string(),status:s.enum(["listed","not_listed","unknown"]),as_of:ne.nullable(),reason:s.enum(["complete","incomplete","missing","stale","unavailable","none"])}),pa=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),publisher:F,short_description:F,launched_at:ne.nullable(),first_seen_at:ne,url:s.string(),store_url:Rx,availability:s.array(Lx),also:s.array(s.object({app:s.string(),slug:np.optional(),kind:s.enum(Q),url:s.string()})).describe("The app's other listings in this store"),linked:s.array(s.object({app:s.string(),slug:np,name:F,short_description:F,kind:s.enum(Q),url:s.string(),evidence:s.array(s.string())})).describe("The app's listings in other stores, with what binds each: server (same MCP server), owner_domain, publisher, store_name, admin, or an agent check"),part_of:s.object({slug:s.string(),name:F,url:s.string()}).nullable().describe("The app this listing belongs to (apps_get); null until binding gives it one"),store:O(s.enum(A)),plugin_id:O(s.string()),version:O(F),last_seen_at:O(ne),icon:O(F),listing:O(Ft),tags:O(nt)}),lv=s.object({region:s.string(),position:Y,as_of:ne.describe("When the position is from")}),dv=Y.nullable().optional(),sp=s.object({chart:s.string(),title:F,kind:s.string(),url:s.string(),regions:Y,best:lv,primary:Y.nullable().describe("Position in the store's main region"),kind_position:Y.nullable().describe("primary among its own kind, in lists that join kinds; else null"),prev_day:dv.describe("kind_position (on lists that join kinds) or primary ~24h earlier; null: not listed then"),prev_week:dv.describe("As prev_day, ~7 days earlier"),day_change:Le.describe("Cohort change in the main region since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier"),positions:O(s.array(lv))}),cp=s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),reported_at:ne.describe("Latest reported period, including unchanged values"),cadence:s.string(),next_expected_at:ne,stale:s.boolean(),value:s.number().nullable(),t:ne,prev:s.number().nullable(),prev_t:ne.nullable(),points:O(s.array(s.object({t:ne,value:s.number().nullable()})))}),ua=s.object({name:s.string(),title:s.string().optional(),description:s.string(),params:s.array(s.string()),annotations:Ft.optional(),input_schema:O(Ft),output_schema:O(Ft)}),Mx=s.object({name:s.string(),fields:s.array(s.string()).describe("title, description, inputSchema, annotations or outputSchema"),before:O(Ft),after:O(Ft)}),ma=s.object({hash:s.string(),server_version:F,seen_since:ne,seen_until:ne,tool_count:Y}),pv=Y.describe("The server's OpenApps id: /v1/mcp/servers/{id}"),up=s.string().nullable().describe("The OpenApps page of the first app that links this server; null when none does"),lp=s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.describe("When this toolset first appeared"),seen_until:ne.describe("When it last appeared"),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua).optional().describe("Left out when diff_from is given")}),mv=s.object({id:pv,url:s.string(),page:up,status:F,transport:F,checked_at:ne.nullable(),apps:s.array(s.string()).describe("Refs of the apps that link to it, across stores"),snapshot:lp.nullable().describe("The toolset at `at` (latest if omitted); null if never seen without sign-in by then"),diff:s.object({from:s.object({hash:s.string(),seen_since:ne}).nullable().describe("In force at diff_from, else the earliest one (see notes)"),added:s.array(ua),removed:s.array(ua),changed:s.array(Mx)}).nullable().describe("Only with diff_from"),history:O(s.array(ma))}),dp=s.object({id:pv,url:s.string(),status:F,transport:F,auth_hint:F,checked_at:ne.nullable(),snapshot:s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.nullable(),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua)}).nullable().describe("Latest toolset; null if never seen without sign-in"),history:O(s.array(ma))}),UA=s.object({profiles:s.array(s.object({app:pa,ranks:s.array(sp).optional(),metrics:s.array(cp).optional(),tools:s.array(dp).optional()})),not_found:s.array(s.object({app:s.string(),nearest:s.array(s.string())}))});var it=s.string().nullable(),Je=s.number().int(),Vx=["mcp_host","developer","website","name"],fv=C({name:"apps_get",resource:"apps",path:"/v1/apps/{slug}",summary:"One app across stores: each of its listings' name, kind, publisher, category and best chart place now.",description:"Use for where one app is listed. slug is the app's (apps_list, publishers_get and listing rows' product give it), or a listing ref of one of its listings, which finds the app it is in now. match: how sure the binding between its listings is. tools: each tool or skill name across its listings.",input:s.object({slug:b.slug}),data:s.object({slug:s.string().describe("The app's slug, as its listings' rows carry it in product"),name:it.describe("The name most of its listings carry"),listings:s.array(s.object({store:s.enum(A),app:s.string(),slug:Me,name:it,kind:s.enum(Q),publisher:it,category:_t,best:Ve.nullable(),launched_at:s.string().nullable(),first_seen_at:s.string(),url:s.string(),icon:O(it),charts:Je.describe("Ranked charts that list it now"),countries:s.object({listed:Je,of:Je,missing:s.array(s.string()).optional().describe("The countries that don't list it, by region code; with an account only")}).nullable().describe("ChatGPT: of the countries with current data, how many list it; null elsewhere"),tools:Je.describe("Tools its MCP server lists, else the tool or skill names its listing gives"),mcp:it.describe("Its MCP server's host"),website:it.describe("The website its listing names"),prompts:Je.describe("Starter prompts its listing gives"),changes:Je.describe("Listing changes in the last 30 days"),oa_rank:Je.nullable().describe("Its store's OpenApps Rank; null: uncharted")})).describe("By store, then name"),rank:s.object({method:s.string(),day:s.string(),score:s.number(),rank:Je.describe("Among apps across every store, 1 first"),tier:Je.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window")}).nullable().describe("OpenApps Rank across stores (oa_app@2); null when no listing is charted"),match:s.object({confidence:s.enum(["high","medium","low"]).describe("high: three or more signals agree; medium: two; low: one"),evidence:s.array(s.object({kind:s.enum(Vx),value:it.describe("What was compared"),ok:s.boolean().describe("Whether the listings agree on it")})),pairs:O(s.array(s.object({a:s.string(),b:s.string(),state:s.enum(["suggested","bound","rejected"]).describe("bound: strong evidence or a reviewer's yes; rejected: a reviewer's no"),evidence:s.array(s.object({source:s.string(),strong:s.boolean().describe("Binds the pair on its own"),detail:it}))})).describe("Each pair of its listings, by listing ref, that evidence or a review names"))}),tools:s.array(s.object({name:s.string().describe("Lower case, separators as spaces, without the app's name"),apps:s.array(s.string()).describe("The listings that name it, by listing ref"),names:s.array(s.string()).describe("The name each of those listings gives it, in apps' order")})).describe("Most listings first, then A to Z")}),examples:[{title:"Context7 by slug",input:{slug:"context7"}},{title:"The app a listing is in",input:{slug:"claude:notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{name:"derived",slug:"derived","listings[].category":"observed","listings[].best":"derived","listings[].launched_at":"derived","listings[].first_seen_at":"observed","listings[].charts":"observed","listings[].countries":"observed","listings[].tools":"observed","listings[].changes":"observed","listings[].oa_rank":"derived","rank.score":"derived","rank.rank":"derived","rank.momentum":"derived","match.confidence":"derived","tools[].name":"derived"}}),gv=C({name:"apps_list",resource:"apps",summary:"Apps listed in more than one store or kind, by name: each one's slug and stores.",description:"Use to find an app's slug for apps_get. query: words in the app's name or slug; without it, the apps listed in most stores first.",input:s.object({query:b.query.optional(),limit:b.limit.default(20)}),data:s.object({total:Je.describe("Apps that match"),rows:s.array(s.object({slug:s.string(),name:it,stores:s.array(s.enum(A)).describe("In store order")}))}),examples:[{title:"Apps named like Notion",input:{query:"notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed"}});var hv=["name","description","icon","category","publisher","url","keywords"],vv=["release","reviewed_commit"];var JA=Object.fromEntries(A.map(e=>[e,Object.fromEntries(zh(e).flatMap(r=>{let i=Sh(e,r)?.paths;return i?[[r,i]]:[]}))]));var bv=s.union([s.number(),s.string(),s.array(s.unknown()),s.record(s.string(),s.unknown())]).nullable(),Fx=s.object({chart:s.string(),title:s.string().nullable(),before:s.number().int().nullable().describe("1-based position at the change; null when the chart didn't list the app then"),after:s.number().int().nullable().describe("1-based position 7 days after the change; null when the chart didn't list the app then")}).describe("Positions count within the app's kind on a list that joins kinds, as best does"),Bx=s.object({type:s.enum(Fn),t:s.string().describe("When it happened: the data run that recorded it, the release time, or when the new toolset was first recorded"),basis:s.enum(Pe).optional().describe("launch: how t is known: store_reported (the store's launch date), derived (decoded from the ChatGPT app id) or observed (the day the app went live); metric_change: how the metric is known"),app:s.string(),slug:Me,name:s.string().nullable(),store:s.enum(A),kind:O(s.enum(Q).nullable()),publisher:O(s.string().nullable()),tags:O(nt),best:Ve.nullable().describe("The app's best place now, as listings_search gives it"),icon:O(s.string().nullable().describe("The app's icon on the OpenApps site")),region:s.string().nullable().describe("null for store-wide events (launch, toolset_change, listing_change, release_change, mcp_status_change, delisted, metric_change)"),field:s.enum([...hv,...vv]).optional().describe("The listing field that changed; release for a build version or gitRef, reviewed_commit for a reviewed repository commit"),prev_t:s.string().nullable().optional().describe("listing_change and release_change: when the version this one replaced was first recorded; null when that isn't known, as for a listing already live when its history began"),rank_impact:Fx.nullable().optional().describe("listing_change and release_change, for Pro: the rank at the change and 7 days later on the app's best chart; null for a change under 7 days old or one that chart didn't list the app around"),metric:s.string().optional(),unit:s.string().optional(),chart:s.string().optional(),server:s.string().optional(),before:bv.describe("Earlier position, toolset, listing field value, release or MCP status; null when absent"),after:bv.describe("New position, toolset, listing value (lists for keywords/category), release, or MCP status (open/auth/dead)"),url:s.string()}),yv=C({name:"changes_list",resource:"changes",summary:"A store's changes: ranks, featuring, launches, listings, releases, MCP tools and status, delistings, metrics.",description:`Up to ${Jh} days. listing_change: dated field values; release_change: builds or reviewed commits; mcp_status_change: servers down, needing sign-in or back; delisted: needs complete current catalogs in every reachable region; metric_change: clears per-metric floors, never rank proxies.`,input:s.object({store:b.store,region:b.region.optional(),since:b.since.default("-24h"),apps:b.apps.optional(),types:b.types.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),regions:s.array(s.string()),since:s.string(),until:s.string().describe("The newest data in the window"),total:s.number().int(),counts:s.partialRecord(s.enum(Fn),s.number().int()).describe("Events per type over the whole window"),held:s.number().int().optional().describe("Changes in the window the caller's plan holds back, of apps ranked below meta.plan.rank; a listing or release version (the fields one app changed at one time) counts once"),events:s.array(Bx)}),examples:[{title:"ChatGPT US in the last day",input:{store:"chatgpt"}},{title:"Claude moves and toolset changes this week",input:{store:"claude",since:"-7d",types:["rank_move","chart_enter","toolset_change"]}},{title:"Claude listing and server status",input:{store:"claude",types:["listing_change","mcp_status_change","release_change"]}},{title:"One Cursor app",input:{store:"cursor",apps:["cursor:406"],since:"-7d"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??(e.store==="chatgpt"?"us":null),toolsets:!e.types||e.types.includes("toolset_change")||e.types.includes("mcp_status_change"),countries:"status"})},basis:{"events[].type":"derived","events[].field":"observed","events[].t":"observed","events[].before":"observed","events[].after":"observed",counts:"derived","events[].best":"derived","events[].prev_t":"observed","events[].rank_impact":"derived"}});var _v=C({name:"charts_get",resource:"charts",path:"/v1/charts/{store}/{chart}",summary:"One store chart now or at a past time, with each app's previous position and its position a day earlier.",description:"Use for who ranks where in a store list and who moved, entered or dropped. Positions are 1-based. Not a history: one snapshot, compared with two earlier ones. kinds: only those kinds, ranked among themselves (positions, movement and total count them alone).",input:s.object({store:b.store,chart:b.chart,region:b.region.optional(),at:b.at.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({chart:ap,region:s.string(),total:s.number().int().describe("Apps in the list (of the kinds asked)"),dropped:s.number().int().describe("Apps gone since the previous list"),rows:s.array(Ur)}),examples:[{title:"Claude's popularity chart now",input:{store:"claude",chart:"popularity"}},{title:"ChatGPT productivity in the US a day ago",input:{store:"chatgpt",chart:"category:productivity",region:"us",at:"-24h"}},{title:"ChatGPT productivity in Germany",input:{store:"chatgpt",chart:"category:productivity",region:"de"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"rows[].position":"observed","rows[].prev":"observed","rows[].prev_day":"observed","rows[].is_new":"derived","rows[].launched_at":"derived",dropped:"derived","rows[].category":"observed","rows[].linked":"derived","rows[].first_seen_at":"observed","rows[].kind_position":"derived"}}),$v=C({name:"charts_regions_get",resource:"charts",path:"/v1/charts/{store}/{chart}/regions",summary:"One ChatGPT chart in every country at once: the top apps of the US list with each app's position per country.",description:"Use to compare where a chart differs by country. ChatGPT only (the other stores are one worldwide catalog). Positions are 1-based; null means not in that country's list. Countries the store refuses are left out and named in meta.coverage.",input:s.object({store:b.store,chart:b.chart,limit:b.limit.default(20)}),data:s.object({chart:ap,regions:s.array(s.object({region:s.string(),as_of:s.string().describe("The time of that region's latest list, which its positions come from")})),total:s.number().int().describe("Apps in the list the rows follow"),region_count:s.number().int().describe("Countries with a current list, which listed_in counts against"),rows:s.array(s.object({app:s.string(),slug:Me,name:s.string().nullable(),url:s.string(),icon:O(s.string().nullable()),positions:s.record(s.string(),s.number().int().nullable()),listed_in:s.number().int().describe("How many of those countries list the app")}))}),examples:[{title:"ChatGPT productivity by country",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:()=>({store:"chatgpt",region:null,countries:"unavailable"})},basis:{"rows[].positions":"observed"}});var kv=C({name:"featuring_get",resource:"featuring",path:"/v1/featuring/{store}",summary:"Every section of a store's home page now, each with its apps and their recent movement.",description:"Use for what a store features on its home page. Positions are 1-based within each section. Claude's one section is its directory's Trending strip.",input:s.object({store:b.store,region:b.region.optional()}),data:s.object({store:s.enum(A),region:s.string(),sections:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),rows:s.array(Ur)}))}),examples:[{title:"ChatGPT's home page in the US",input:{store:"chatgpt"}},{title:"ChatGPT in Germany",input:{store:"chatgpt",region:"de"}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"sections[].rows[].position":"observed","sections[].rows[].prev":"observed","sections[].rows[].is_new":"derived"}}),wv=C({name:"featuring_history",resource:"featuring",path:"/v1/featuring/{store}/history",summary:"Featuring intervals per app or shelf, including apps that have left, over a bounded window.",description:"Filter app, shelf or country. Default 24h; max 30 days. baseline: on the shelf when the window starts; first_observed: its earliest entry on record, which may not be its first ever. left=null: no exit on record. A region without data cannot show an exit.",input:s.object({store:b.store,app:b.app.optional(),chart:b.chart.optional(),region:b.region.optional(),since:b.since.default("-24h"),at:b.at.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),since:s.string(),until:s.string(),total:s.number().int(),rows:s.array(s.object({app:s.string(),name:s.string().nullable(),chart:s.string(),title:s.string().nullable(),region:s.string(),entered:s.string().nullable(),entered_before_window:s.boolean(),entry_kind:s.enum(["baseline","first_observed","observed_enter"]),left:s.string().nullable(),observed_at:s.string(),url:s.string(),days:O(s.array(s.object({day:s.string().describe("YYYY-MM-DD (UTC)"),position:s.number().int().nullable().describe("The app's slot on the shelf at the day's end; null: not on it")})).describe("Each day of the window with data in the shelf's country, oldest first; a day without data is left out"))}))}),examples:[{title:"ChatGPT featured shelf history",input:{store:"chatgpt",chart:"home:featured",region:"us"}},{title:"One app's featuring history",input:{store:"chatgpt",app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Cursor featuring",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"rows[].entered":"observed","rows[].left":"observed","rows[].observed_at":"observed","rows[].entered_before_window":"derived","rows[].days":"observed"}});var fa=s.number().int(),Er=s.string(),xv=C({name:"freshness_get",resource:"freshness",summary:"Our own service monitoring: each store's data status and open issues. It may change.",description:"Use to judge how fresh the data is or why a region is missing. Measured when asked, never cached. With region, adds that region's latest job.",input:s.object({region:b.region.optional()}),data:s.object({status:s.enum(["ok","degraded"]),issues:s.array(s.string()),checked_at:Er,collector_seen:Er.nullable().describe("The collector's last poll"),cron:s.object({t:Er,probe:s.string().nullable()}).nullable(),refused_regions:s.array(s.string()).describe("ChatGPT regions the store refused through every relay in the last day: their catalog data is unavailable"),regions:s.array(ep).describe("Every store and region with data: its latest snapshot and whether it is current, stale or unavailable"),exits_24h:s.array(s.object({provider:s.string().nullable(),tries:fa,blocked:fa,regions:s.array(s.string())})).describe("Tries per relay provider in the last day"),stores:s.array(s.object({store:s.enum(A),runs:fa.describe("Successful runs ever"),last_run:Er.nullable()})),slots:s.array(s.object({region:s.string(),slot:s.string().describe("UTC date and hour the slot starts, e.g. 2026-10-13T09"),ok:s.boolean(),failed:fa,error:s.string().nullable()})).describe("ChatGPT runs in the last 24 hours, per region and slot"),crawl:s.object({region:s.string(),status:s.string(),requested_at:Er,claimed_at:Er.nullable(),error:s.string().nullable()}).nullable().describe("With region: its latest job")}),examples:[{title:"Service status",input:{}},{title:"Germany's latest job",input:{region:"de"}}],cache:{kind:"none"},basis:{status:"derived",issues:"derived","stores[].runs":"observed","slots[].ok":"observed","regions[].as_of":"observed","regions[].status":"derived"}});var Sv=C({name:"leaderboards_get",resource:"leaderboards",path:"/v1/leaderboards/{store}/{metric}",summary:"A store's apps ranked by one metric, labelled by its source basis, such as installs, with the value each replaced.",description:"Use for who leads on installs, popularity score or stars. The metrics a store ranks by are in the stores resource; ChatGPT publishes none. kinds: only apps of these kinds, ranked among themselves; a value qualified by another store is ignored.",input:s.object({store:b.store,metric:b.metric,kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),metric:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string(),total:s.number().int().describe("Apps with a value (of the kinds asked)"),rows:s.array(pe.extend({position:s.number().int(),value:s.number(),prev:s.number().nullable(),t:s.string().describe("When the value last changed"),reported_at:s.string(),cadence:s.string(),next_expected_at:s.string(),stale:s.boolean(),prev_t:s.string().nullable()}))}),examples:[{title:"Top 10 Claude plugins by installs",input:{store:"claude",metric:"installs",limit:10}},{title:"cursor.directory by installs",input:{store:"cursor",metric:"dir_installs"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].position":"derived","rows[].value":"store_reported","rows[].prev":"store_reported"}});var K=s.number().int(),$t=K.nullable(),ga=s.object({name:s.string(),tools:K,servers:K}),Kx=s.object({n:K,of:K}),Iv=C({name:"market_get",resource:"market",summary:"Each store's size and shape: apps per kind, weekly launches over a year, list sizes, and open MCP toolset statistics.",description:"Use for market-level questions: how big a store is, how fast it grows, how MCP servers are built. Not per app; use listings_profile.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(A),label:s.string(),url:s.string(),apps:K,kinds:s.partialRecord(s.enum(Q),K),last_run:s.string().nullable(),launches:s.object({basis:s.enum(Pe).describe("derived on ChatGPT (decoded from app ids), store_reported on Claude and Cursor"),last_7d:K,weeks:s.array(s.object({week:s.string().describe("Monday the week starts"),n:K})),weekdays:s.array(s.object({day:K.min(0).max(6).describe("0 Monday to 6 Sunday"),n:K})).describe("Every app with a launch date by its weekday: the day its id was created on ChatGPT, the store's launch date elsewhere")}),top10:s.object({frozen:K,of:K}).nullable().describe("Category lists (ChatGPT categories, Claude departments of 10 or more) whose top 10 held the same apps in the same order as the previous day; null on Cursor and Grok Bot"),lists:O(s.array(s.object({chart:s.string(),title:s.string().nullable(),apps:K,collection:s.boolean().describe("A curated collection rather than a category")})).describe("Category lists in the main region, largest first"))})),mcp:s.object({servers:K.describe("MCP servers linked from any store"),by_status:s.array(s.object({status:s.string().nullable(),n:K})),snapshots:K,cross_store:K.describe("Servers linked from apps in more than one store"),url:s.string().describe("The Market pulse page"),open:s.object({servers:K,tools:K,tools_per_server:s.object({median:$t,p90:$t,max:$t,histogram:O(s.array(s.object({bucket:s.string(),n:K})))}),annotations:s.array(ga.extend({tools_true:$t.optional()})).describe("Tools and servers that set each annotation; tools_true: tools setting the hint to true"),output_schema:ga.omit({name:!0}),meta:O(ga.omit({name:!0})),params:s.array(ga).describe("Most common input parameter names"),params_per_tool:s.object({median:$t,p90:$t,none_pct:s.number().nullable(),required_pct:s.number().nullable()}),description_len:s.object({median:$t,p90:$t}),protocols:s.array(s.object({version:s.string(),n:K}))}).describe("Across every open server's latest toolset")}),facts:O(s.object({chatgpt:s.object({apps_sdk:K.describe("Apps SDK apps (family plugin_asdk_app)"),top100:s.object({every:K.describe("Listed in every country with data"),only_us:K.describe("Listed in the United States only"),of:K.describe("Apps in a US top 100 of any category list, collections included"),countries:K.describe("Countries with data")}),shelves_in_order:Kx.describe("US home shelves that are an unbroken run of their category list, of every shelf")}).nullable().describe("null unless ChatGPT is asked for"),claude:s.object({in_most_popular:K.describe("Listings Most popular ranks"),mcp_auth:K.describe("Listings whose MCP server asks for a sign-in (mcp_status auth)"),mcp_status:s.array(s.object({status:s.string(),n:K})).describe("Listings that link an MCP server, by its latest status (the best of several)")}).nullable().describe("null unless Claude is asked for"),products:s.object({n:K.describe("Apps listed in more than one store"),top:s.array(s.string()).describe("The first names, most stores first")})}).describe("Headline numbers for the Stats pages"))}),examples:[{title:"Every store",input:{}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:()=>({daily:!0})},basis:{"stores[].apps":"observed","stores[].launches.weeks[].n":"derived","stores[].launches.weekdays[].n":"derived","stores[].top10":"derived","mcp.by_status":"observed","mcp.cross_store":"derived","mcp.open":"observed",facts:"derived"}});var zv=C({name:"mcp_toolset_get",resource:"mcp",path:"/v1/mcp/toolsets",summary:"An MCP server's tools at a time, or what changed between two of its toolset versions: tools added, removed and changed.",description:"Use for an app's or a server's toolset now, at a past time, or against an earlier version. Reads OpenApps' stored toolsets, the tools each server lists without a sign-in; it never calls the server.",input:s.object({app:b.app.optional(),server:b.server.optional(),at:b.at.optional(),diff_from:b.diff_from.optional()}),data:s.object({servers:s.array(mv)}),examples:[{title:"Context7's server now",input:{server:"https://mcp.context7.com/mcp"}},{title:"What changed in Context7's tools this week",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ",diff_from:"-7d"}},{title:"Context7's tools on 1 January 2099",input:{server:"https://mcp.context7.com/mcp",at:"2099-01-01T12:00:00Z"}}],cache:{kind:"snapshot",scope:e=>({store:e.app?bt(e.app).store:null,region:null,toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed","servers[].diff":"derived","servers[].apps":"observed"}}),ha=s.number().int(),Bt=s.string().nullable(),Pv=s.object({id:ha,url:s.string(),page:up,host:Bt,status:Bt,transport:Bt,auth_hint:Bt,checked_at:Bt}),Ov=C({name:"mcp_servers_list",resource:"mcp",path:"/v1/mcp/servers",summary:"The remote MCP servers that store listings link to, open ones first, with tool counts and the apps that link each.",description:"Use to browse or count MCP servers by status or store. For one server's tools, use mcp_servers_get or mcp_toolset_get.",input:s.object({status:b.status.optional(),store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:ha,rows:s.array(Pv.extend({tool_count:ha.nullable().describe("Tools in its latest toolset; null if never seen without sign-in"),snapshots:ha.describe("Toolset versions seen"),stores:s.array(s.enum(A)),apps:s.array(s.object({app:s.string(),name:Bt,url:s.string()}))}))}),examples:[{title:"Open servers",input:{status:"open"}},{title:"Servers Claude links to",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"rows[].status":"observed","rows[].tool_count":"observed","rows[].stores":"observed"}}),jv=C({name:"mcp_servers_get",resource:"mcp",path:"/v1/mcp/servers/{server}",summary:"One MCP server: its status, the apps that link to it, its latest toolset with every tool, and its toolset history.",description:"Use for everything about one server by id or URL. For its tools at a past time or a diff between versions, use mcp_toolset_get.",input:s.object({server:b.server}),data:s.object({server:Pv.extend({error:Bt.describe("The last check's error")}),apps:s.array(pe),toolset:lp.nullable().describe("Latest toolset; null if never seen without sign-in"),history:s.array(ma)}),examples:[{title:"Context7's server",input:{server:"https://mcp.context7.com/mcp"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null,toolsets:!0})},basis:{"server.status":"observed","toolset.tools":"observed",apps:"observed"}});var Gn=s.string(),Av=C({name:"movers_list",resource:"movers",path:"/v1/movers/{store}",summary:"What moved in a store's latest data: rank movers in its lead charts, featured-list entries and exits, metric changes.",description:"Use for a store's headlines: who climbed, fell or entered its charts, joined or left a featured list, or changed installs or scores. By default every ranking chart, each product once where it moved most; chart: one chart, every mover. For a span of time, use changes_list.",input:s.object({store:b.store,chart:b.chart.optional(),window:b.window.optional(),max_position:b.max_position.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(A),region:s.string().describe("The store's main region, which movement is measured in"),charts:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),region:s.string(),url:s.string(),week:O(Gn.nullable().describe("window=7d only: the time, ~7 days earlier, of the data the rows are compared with")),rows:s.array(Ur).describe("Rows that moved, biggest move up or down first, at most 8 a chart; a product shows once across the charts (with chart: every row)")})),featuring:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),entered:s.array(pe),left:s.array(pe)})).describe("Entries and exits of the store's featured lists in the latest data"),metrics:s.array(s.object({metric:s.string(),title:s.string(),unit:s.string(),basis:s.enum(Pe),rows:s.array(pe.extend({value:s.number(),prev:s.number(),change:s.number(),t:Gn,prev_t:Gn.nullable(),reported_at:Gn,cadence:s.string(),next_expected_at:Gn,stale:s.boolean()})).describe("Apps whose value moved past the noise floor since a week before the metric's latest update, biggest change first; prev 0: new")}))}),examples:[{title:"ChatGPT",input:{store:"chatgpt"}},{title:"Claude",input:{store:"claude"}},{title:"Cursor",input:{store:"cursor"}},{title:"Claude's Most popular over a week, top 50",input:{store:"claude",chart:"popularity",window:"7d",max_position:50}},{title:"Every Claude ranking's top 100",input:{store:"claude",max_position:100}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"charts[].rows[].position":"observed","charts[].rows[].prev":"observed","charts[].rows[].is_new":"derived","featuring[].entered":"derived","metrics[].rows[].change":"derived","charts[].rows[].prev_week":"observed","charts[].rows[].linked":"derived","charts[].rows[].kind_position":"derived"}});var Gx=365,Tv=C({name:"new_list",resource:"new",summary:"A store's apps launched since a time, newest first, by launch date (on ChatGPT, when the app's ID was created).",description:`Use for new releases. A ChatGPT app goes live days after its ID is created: sort=first_seen_at orders by go-live day, as the site does. since reaches back at most ${Gx} days. ChatGPT rows carry the app's category. kinds: only those kinds, counted among themselves (total and facets too).`,input:s.object({store:b.store,since:b.since.default("-24h"),sort:b.sort.default("released_at"),limit:b.limit.default(20),cursor:b.cursor.optional(),category:b.category.optional(),kind:b.kind.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(A),since:s.string(),until:s.string().describe("When the newest data is from"),total:s.number().int(),category_observation:s.enum(["available","unavailable","not_applicable"]),unfiltered_total:s.number().int(),rows:s.array(pe.extend({launched_at:O(s.string().nullable()),first_seen_at:s.string(),released_at:s.string().describe("launched_at, or first_seen_at without one"),release_basis:s.enum(Wh).describe("derived: decoded from the ChatGPT app id; observed: the day the app went live"),category:s.string().nullable().describe("First category list it is in (ChatGPT)"),linked:Cr,tags:O(nt),lag_days:s.number().int().nullable().describe("ChatGPT, with Pro (Launch lag): whole days from the app's ID being created to the day it went live; null on other plans, elsewhere or when unknown")})),facets:s.array(s.object({value:s.string(),total:s.number().int()})).describe("Release-window category or kind counts, before selection and pagination.")}),examples:[{title:"ChatGPT this week",input:{store:"chatgpt",since:"-7d"}},{title:"Claude in the last day",input:{store:"claude"}},{title:"ChatGPT apps that went live today",input:{store:"chatgpt",sort:"first_seen_at",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].category":"observed","rows[].lag_days":"derived","rows[].linked":"derived","rows[].tags":"derived"}});var Rr=e=>({store:bt(e.app).store,region:null}),Nv=C({name:"listings_search",resource:"listings",summary:"Apps matching the query by name, publisher, brand, tag or what they do, one row per app, exact names first.",description:`Use to find an app's ref from its name, a brand it works with or what it does ("send invoices"). One row per app: its listing that best matches, with its other stores in linked. Ties go to OpenApps Rank.`,input:s.object({query:b.query,publisher:b.publisher.optional(),store:b.store.optional(),kind:b.kind.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({rows:s.array(pe.extend({publisher:s.string().nullable(),best:Ve.nullable(),category:_t,tags:nt,linked:Cr}))}),examples:[{title:"Notion anywhere",input:{query:"notion"}},{title:"Context7 in Cursor",input:{query:"context7",store:"cursor"}},{title:"Linear by its publisher",input:{query:"linear",publisher:"Linear"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"observed","rows[].publisher":"observed","rows[].best":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived"}}),ot=s.array(s.object({value:s.string(),n:s.number().int()})),Cv=C({name:"listings_list",resource:"listings",path:"/v1/listings/list",summary:"Listings by store, kind, category, publisher, tags, MCP status, other stores and release; ranked, newest or A to Z.",description:"Use to browse the catalog by filters, e.g. Claude connectors tagged gmail. Each list filter keeps a listing with any of its values. tags: ids from tags_tree, match all or any; exclude leaves tags out. facets count each filter's values under the others. For a name, listings_search.",input:s.object({stores:b.stores.optional(),kinds:b.kinds.optional(),families:b.families.optional(),categories:b.categories.optional(),publishers:b.publishers.optional(),tags:b.tags.optional(),exclude:b.exclude.optional(),match:b.match.default("all"),linked:b.linked.optional(),statuses:b.statuses.optional(),availability:b.availability.optional(),released_since:b.released_since.optional(),query:b.query.optional(),scope:b.scope.optional(),group:b.group.optional(),sort_by:b.sort_by.default("rank"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:s.number().int().describe("Listings every filter keeps; with group=app, apps with one or more of them"),rows:s.array(la.extend({app_rank:s.number().int().nullable().optional().describe("group=app: the app's OpenApps Rank across stores; null: on no counted chart"),ranks:s.array(s.object({store:s.enum(A),rank:s.number().int()})).optional().describe("group=app: its rank in each store's OpenApps Rank, in store order")}).describe("A listing; with group=app, the app's best listing, carrying every tag of its listings")),facets:O(s.object({store:ot,kind:ot.describe("Store-qualified, e.g. claude:connector or chatgpt:apps_sdk"),family:ot,category:ot,publisher:s.array(s.object({value:s.string().describe("Publisher key"),name:s.string(),n:s.number().int()})).describe("The 100 with most listings, then any asked for"),status:ot,linked:ot,availability:ot,released:ot.describe("Listings released in the last 7 and 30 days before the newest data; value is a released_since"),tags:ot.describe("Listings with each tag among those the other filters keep, after exclude and, with match all, every tag asked for")}).describe("Per filter, how many listings each value has among those the other filters keep"))}),examples:[{title:"Every listing, best ranked first",input:{}},{title:"Claude connectors that work with Notion",input:{stores:["claude"],kinds:["connector"],tags:["notion"]}},{title:"Listings of apps on two or more stores, newest first",input:{tags:["multi-store"],sort_by:"new"}}],cache:{kind:"snapshot",scope:e=>({store:e.stores?.length===1?e.stores[0]:null,region:null,toolsets:!0})},basis:{"rows[].best":"derived","rows[].prev_day":"derived","rows[].prev_week":"derived","rows[].countries":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived","rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].mcp_status":"observed",facets:"derived"}}),Uv=e=>e.apps?.length?{store:null,region:null}:Rr(e),Ev=C({name:"listings_get",resource:"listings",path:"/v1/listings/{app}",summary:"One listing: name, kind, publisher, description, launch and go-live dates, and its app with the app's other listings.",description:`Use for what a listing is; part_of names its app, linked the app's listings in other stores. The ref may hold the slug. apps: up to ${Mn.plus.compareApps-1} more listings to compare, with Pro. For ranks, metrics or tools, use listings_ranks_current, listings_metrics or listings_tools.`,input:s.object({app:b.app,apps:b.apps.optional()}),data:s.object({app:pa,apps:s.record(s.string(),pa).optional().describe("With apps: each of those listings by its ref, in the order asked, as app is given")}),examples:[{title:"A Claude connector",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}},{title:"A listing whose app is in two stores",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}},{title:"A Claude connector by its slug",input:{app:"claude:notion"}}],cache:{kind:"snapshot",scope:e=>({...Uv(e),countries:"status"})},basis:{"app.name":"observed","app.publisher":"observed","app.availability[].status":"derived","app.availability[].as_of":"observed","app.launched_at":"derived","app.first_seen_at":"observed","app.linked":"derived","app.tags":"derived"}}),Rv=C({name:"listings_ranks_current",resource:"listings",path:"/v1/listings/{app}/ranks/current",summary:"Every chart a listing is in now: best position and region, position in the main region, and how many regions list it.",description:"Use for where a listing ranks today. Positions are 1-based, each from its region's latest data (as_of). Countries the store refuses are left out and named in meta.coverage.",input:s.object({app:b.app}),data:s.object({app:s.string(),charts:s.array(sp)}),examples:[{title:"Where a ChatGPT listing ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:e=>({...Rr(e),countries:"unavailable"})},basis:{"charts[].positions[].position":"observed","charts[].positions[].as_of":"observed","charts[].best":"derived","charts[].primary":"observed","charts[].regions":"derived","charts[].kind_position":"derived","charts[].prev_day":"derived","charts[].prev_week":"derived"}}),Zv=C({name:"listings_metrics",resource:"listings",path:"/v1/listings/{app}/metrics",summary:"A listing's latest value of each metric its store publishes, with the value it replaced; each carries its basis.",description:"Use for installs, popularity scores and GitHub stars. Series change-only: t is when the value last changed.",input:s.object({app:b.app}),data:s.object({app:s.string(),metrics:s.array(cp)}),examples:[{title:"Claude installs",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:Rr},basis:{"metrics[].t":"observed","metrics[].prev":"observed"}}),Lv=C({name:"listings_tools",resource:"listings",path:"/v1/listings/{app}/tools",summary:"The MCP servers a listing links to, each with its latest tool list.",description:"Use for what a listing's MCP server exposes. Servers that need sign-in have status auth and no snapshot.",input:s.object({app:b.app}),data:s.object({app:s.string(),servers:s.array(dp)}),examples:[{title:"Context7's tools via Claude",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}}],cache:{kind:"snapshot",scope:e=>({...Rr(e),toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed"}}),pp=s.object({url:s.string(),width:s.number().int(),height:s.number().int()}),Mv=C({name:"listings_widgets",resource:"listings",path:"/v1/listings/{app}/widgets",summary:"The widgets a ChatGPT listing's tools show, as images rendered with OpenApps' sample account.",description:"Use for what an app looks like inside ChatGPT. Each widget is one tool's current template, rendered in a browser with input and output a model wrote for a fictional OpenApps account, never a user's data. Images are 720 px wide (mobile 390 px); empty for listings without rendered widgets.",input:s.object({app:b.app}),data:s.object({app:s.string(),widgets:s.array(s.object({tool:s.string(),title:s.string().nullable(),description:s.string().nullable(),template:s.string().describe("The template's resource URI"),since:s.string().describe("Since when the app has used this version of the template"),images:s.object({light:pp,dark:pp,mobile:pp.nullable()})})).describe("In the order the app lists its tools")}),examples:[{title:"Alpha Docs's widgets",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Rr},basis:{"widgets[].tool":"observed","widgets[].template":"observed","widgets[].images":"derived"}}),Vv=C({name:"listings_ranks_history",resource:"listings",path:"/v1/listings/{app}/ranks",summary:"Rank series of every chart a listing is in now: 14 days or from-to in the chart's home region, the latest elsewhere.",description:`Use for how positions moved. A point is a change (lists are stored on change); a series' last point is carried to its region's latest data, marked carried. apps adds up to ${Mn.plus.rankHistoryApps-1} listings beside app; more than one listing, or over ${Mn.free.history.ranks} days back, needs Pro.`,input:s.object({app:b.app,apps:b.apps.optional(),from:b.from.optional(),to:b.to.optional()}),data:s.object({app:s.string(),since:s.string().describe("Start of the home-region window"),until:s.string().nullable().describe("End of the window: to, else the latest data"),series:s.array(s.object({app:s.string().describe("The listing the series is of"),chart:s.string(),title:s.string().nullable(),kind:s.string(),region:s.string(),url:s.string(),points:s.array(s.object({t:s.string().describe("When the position was recorded; a carried point's is the time of the latest data, the list unchanged"),position:s.number().int(),kind_position:s.number().int().nullable().describe("Among its own kind, in lists that join kinds; else null"),carried:s.boolean()}))}))}),examples:[{title:"A ChatGPT listing's ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Two Claude listings over a week",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae",apps:["claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"],from:"-7d"}}],cache:{kind:"snapshot",scope:e=>({...Uv(e),countries:"unavailable"})},basis:{"series[].points[].position":"observed","series[].points[].kind_position":"derived","series[].points[].t":"observed","series[].points[].carried":"derived"}}),Dv=s.object({hash:s.string(),seen_since:s.string(),seen_until:s.string(),data:O(s.record(s.string(),s.unknown()).describe("The record as the store returned it"))}),Fv=C({name:"listings_versions",resource:"listings",path:"/v1/listings/{app}/versions",summary:"Every version of a store listing and of its detail record, oldest first, each with its date.",description:`Use for when a listing changed and what it said. A version is recorded only when the store's record changes. Detail records are tracked for ChatGPT, Perplexity and Muse (their tool lists). Versions last seen over ${Mn.free.history.ranks} days ago need Pro; each record's latest always shows.`,input:s.object({app:b.app}),data:s.object({app:s.string(),listing:s.array(Dv),detail:s.array(Dv)}),examples:[{title:"A ChatGPT listing's versions",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Rr},basis:{"listing[].data":"observed","detail[].data":"observed","listing[].seen_since":"observed"}});var We=s.number().int(),Jn=We.nullable().optional().describe("Position on the row's best chart then (best.chart); null: not listed then");var Bv=C({name:"tags_tree",resource:"tags",summary:"Every tag with its facet, parent and app count per store.",description:"Use to find tag ids for listings_list and tags_get. A tag counts every app with a narrower tag too. Use-case (job), works and for tags are per app, cap tags per listing. kinds: count only these kinds, as listings_list filters them.",input:s.object({store:b.store.optional(),kinds:b.kinds.optional()}),data:s.object({version:s.string().describe("The tag vocabulary's version"),tagger:s.string().describe("Methods that assign tags"),tags:s.array(Kn.extend({synonyms:s.array(s.string()).describe("Other names it answers to")})).describe("Vocabulary order: each facet's tree, a tag before the tags under it"),facets:s.array(s.object({facet:da,label:s.string(),hint:s.string(),apps:We.describe("Apps with at least one of its tags")})),stores:s.array(s.object({store:s.enum(A),apps:We.describe("Apps tagged: every app OpenApps has seen in the store, of the kinds asked")}))}),examples:[{title:"Every tag",input:{}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tags[].n":"derived","tags[].stores":"derived","facets[].apps":"derived","stores[].apps":"observed"}}),Kv=C({name:"tags_get",resource:"tags",path:"/v1/tags/{tag}",summary:"One tag: path, narrower tags, counts, top apps per store, related tags.",description:"Use for one tag's apps and neighbours. Old ids answer their successor, else gone. top: per store, best chart place first, limit each. related: tags its apps carry more often than apps at large. kinds: count and list these kinds only.",input:s.object({tag:b.tag,store:b.store.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20)}),data:s.object({tag:Kn,url:s.string().describe("Its page"),top:s.array(la).describe("By store: apps with the tag, best chart place first, at most limit"),kpis:s.object({new_30d:We.describe("Apps with the tag created (ChatGPT: the app's id) or launched in the last 30 days"),with_mcp:s.object({n:We.describe("Claude apps with the tag whose MCP server has a status (listings_list mcp_status)"),of_claude:We.describe("Claude apps with the tag")}),on_both:We.describe("Apps with the tag whose product is listed in another store too")}),weeks:s.array(s.object({week:s.string().describe("The week's Monday, YYYY-MM-DD"),n:We.describe("Apps with the tag created (ChatGPT) or launched that week")})).describe("Every week of the window to the newest data's, oldest first"),path:s.array(s.object({id:s.string(),label:s.string()})).describe("From its top tag down to it"),parent:Kn.nullable(),children:s.array(Kn).describe("Its narrower tags"),siblings:s.array(s.object({id:s.string(),label:s.string(),n:We.describe("Apps carrying it, in the stores asked for")})).describe("Other tags under its parent, in vocabulary order; none for a top tag"),related:s.array(s.object({id:s.string(),label:s.string(),facet:da,n:We.describe("Apps with both tags"),lift:s.number().describe("How many times more often the tag's apps carry it than apps at large")})).describe("At most 10, strongest first, without its ancestors and narrower tags")}),examples:[{title:"Apps that work with Notion",input:{tag:"notion"}},{title:"Developer tools in Claude",input:{tag:"developer-tools",store:"claude",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tag.n":"derived","top[].best":"derived","top[].tags":"derived","top[].category":"observed","top[].linked":"derived","top[].prev_day":"observed","top[].prev_week":"observed","kpis.new_30d":"derived","kpis.with_mcp.n":"derived","kpis.on_both":"derived","weeks[].n":"derived","children[].n":"derived","siblings[].n":"derived","related[].n":"derived","related[].lift":"derived"}});var Gv=s.string(),Ue=s.number().int(),Jv=s.number().describe("Percent, one decimal"),Jx=s.object({app:s.string(),slug:Me,kind:s.enum(Q),name:s.string().nullable(),icon:O(s.string().nullable().describe("The listing's icon on the OpenApps site")),best:Ve,prev_day:Jn,prev_week:Jn,day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier")}).nullable().describe("Its listing with the best place now, in the stores asked; null when none ranks"),Wv=C({name:"publishers_list",resource:"publishers",summary:"Publishers across stores, one per publisher key: apps per store, and their app with the best chart place now.",description:"Use to rank developers by how many apps they list or by their best chart position. With store, only publishers with apps there, counted, ranked and pictured by those apps; stores still lists every store. summary: the selection's figures, and how many apps name a publisher.",input:s.object({store:b.store.optional(),publisher:b.publisher.optional(),order:b.order.default("apps"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:Ue.describe("Publishers in the selection"),rows:s.array(op.extend({top:Jx,tags:s.array(s.string()).describe("The two tags that describe its listings most often")})),summary:s.object({publishers:Ue.describe("Publishers in the selection"),on_both:Ue.describe("Of them, those with apps in more than one store"),chatgpt_with_developer_pct:Jv.describe("ChatGPT apps whose listing names a developer, percent"),chatgpt_with_developer:Ue,claude_with_publisher_pct:Jv.describe("Claude apps that name a publisher, percent"),claude_with_publisher:Ue})}),examples:[{title:"Publishers with the most apps",input:{}},{title:"Claude publishers by best rank",input:{store:"claude",order:"rank"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed","rows[].apps":"observed","rows[].best":"derived","rows[].top":"derived","rows[].tags":"derived","summary.on_both":"derived","summary.chatgpt_with_developer_pct":"derived","summary.claude_with_publisher_pct":"derived"}}),qv=C({name:"publishers_get",resource:"publishers",path:"/v1/publishers/{key}",summary:"One publisher's listings in every store, each with its category and best chart place now, and the apps they belong to.",description:"Use for everything one developer lists. key is the publisher key from publishers_list, or any name the publisher lists under (Figma, Inc. or figma); another legal name has its own key. identities: the websites and MCP hosts its listings name, the values with OpenApps Pro, the count with every plan.",input:s.object({key:b.key}),data:s.object({publisher:op,apps:s.array(pe.extend({best:Ve.nullable(),category:_t,launched_at:Gv.nullable(),first_seen_at:Gv,prev_day:Jn,prev_week:Jn,day_change:Le.describe("Cohort change on best.chart since ~24h earlier"),week_change:Le.describe("As day_change, since ~7 days earlier")})).describe("Best place first, then by store and name"),products:s.array(s.object({product:s.string().describe("Same value: same app, within one answer"),slug:s.string().describe("apps_get takes it"),name:s.string().nullable(),listings:s.array(s.object({store:s.enum(A),app:s.string(),url:s.string()}))})).describe("Apps one of its listings belongs to, with every listing of each"),countries:s.object({listed:Ue,of:Ue}).nullable().describe("Its ChatGPT app listed in the most countries: in how many of the countries with current data; null without a ChatGPT app"),shelves:s.object({n:Ue,names:s.array(s.string())}).describe("Its ChatGPT apps on a ChatGPT home shelf now, and their names"),with_mcp:s.object({n:Ue.describe("Claude apps whose MCP server has a status (listings_list mcp_status)"),of_claude:Ue.describe("Its Claude apps")}),identities:s.object({n:Ue.describe("Distinct websites and MCP hosts its listings name"),websites:s.array(s.string()).optional().describe("Website domains; OpenApps Pro only"),hosts:s.array(s.string()).optional().describe("MCP server hosts; OpenApps Pro only")}),others_on_both:s.array(s.object({key:s.string(),name:s.string(),listings:Ue})).describe("Up to 8 other publishers with apps in more than one store, most apps first")}),examples:[{title:"A publisher by key",input:{key:"context7"}},{title:"A publisher by name",input:{key:"Upstash"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"publisher.name":"derived","publisher.best":"derived","apps[].best":"derived","apps[].category":"observed","apps[].launched_at":"derived","apps[].first_seen_at":"observed","apps[].prev_day":"observed","apps[].prev_week":"observed","products[].listings":"derived","countries.listed":"observed","shelves.n":"observed","with_mcp.n":"observed","identities.n":"observed","others_on_both[].listings":"observed"}});var ce=s.number().int(),Hv={score:s.number().describe("Mean daily points over the window: 1/position on each counted chart, weighted"),rank:ce.describe("By score among the store's apps, 1 first"),tier:ce.describe("3: top 10 on a counted chart today, 2: top 50, 1: charted within the window"),tier_title:s.string(),days_charted:ce,peak:ce.describe("Best position on a counted chart in the window"),momentum:s.number().nullable().describe("Score minus the previous window's; null until that window has enough days")},Wx=pe.extend({...Hv,chart_rank:ce.nullable().describe("Rank by score among the apps on the chart asked for"),kind_peak:ce.describe("peak counted among the listing's own kind on a chart that joins kinds (Claude's Most popular and its tag lists, cursor.directory), as chart pages number it; else peak")}),qx=s.object({store:s.enum(A),target:s.string(),day:s.string(),n:ce,rho:s.number().nullable(),half:s.number().nullable()}),Hx=s.object({method:s.string(),title:s.string(),window_days:ce,published:s.boolean(),figures:s.record(s.string(),s.string()),validation:s.array(qx).describe("Newest check against each published count: Spearman rho, share on the same side of the median")}),Xv=C({name:"scores_list",resource:"scores",path:"/v1/scores/{store}",summary:"A store's apps by OpenApps Rank: a 28-day aggregate of every chart that orders by popularity, with tier and momentum.",description:"Use for who is popular in a store over the last month, not one day's chart. chart narrows to the apps on one chart, ranked among themselves. Derived from store charts, not a usage count.",input:s.object({store:b.store,chart:b.chart.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(A),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(Wx)}),examples:[{title:"Top ChatGPT apps by OpenApps Rank",input:{store:"chatgpt",limit:10}},{title:"Within one chart",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].chart_rank":"derived","rows[].kind_peak":"derived"}}),Yv=C({name:"scores_get",resource:"scores",path:"/v1/scores/{app}",summary:"One app's OpenApps Rank figures, its OpenApps Rank within each chart, and daily score and rank series.",description:"Use for how an app has been doing over the last month and whether it is rising. Apps off every counted chart have no figures (charted: false).",input:s.object({app:b.app}),data:s.object({app:s.string(),method:s.string(),charted:s.boolean(),day:s.string().nullable(),figures:s.object(Hv).nullable(),chart_ranks:s.array(s.object({chart:s.string(),rank:ce})).describe("Its OpenApps Rank among the apps scored on each chart, not its position in the chart (listings_ranks_current has those)"),series:O(s.array(s.object({day:s.string(),score:s.number(),rank:ce})))}),examples:[{title:"A Claude connector's rank over time",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:e=>({store:bt(e.app).store,region:null})},basis:{"figures.score":"derived","figures.rank":"derived","figures.momentum":"derived","chart_ranks[].rank":"derived","series[].score":"derived"}}),Qv=C({name:"scores_methods",resource:"scores",summary:"How OpenApps Rank is computed, which version is published, and how well each version agrees with published counts.",description:"Use to explain or judge the score. Validation pairs a method's scores with counts stores publish (Claude installs and popularity, cursor.directory installs).",input:s.object({}),data:s.object({published:s.string(),methods:s.array(Hx)}),examples:[{title:"Methods and their validation",input:{}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"methods[].validation[].rho":"derived","methods[].validation[].half":"derived"}}),eb=s.object({slug:s.string().describe("The app's slug (apps_get)"),name:s.string().nullable(),icon:s.string().nullable().describe("Its best-ranked listing's icon"),score:s.number().describe("Its score under method"),tier:ce.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window"),rank:ce.describe("Among apps across every store, 1 first"),listings:s.array(s.object({store:s.enum(A),app:s.string().describe("Listing ref"),rank:ce.describe("The listing's OpenApps Rank in its store")})).describe("Its charted listings")}),Xx=eb.extend({rank:ce.describe("Among the apps with the tag"),overall_rank:ce.describe("Rank before the tag filter")}),tb=C({name:"scores_apps",resource:"scores",path:"/v1/scores/apps",summary:"Apps across every store by OpenApps Rank: the sum over stores of 1/rank of each app's best listing there.",description:"Use for who is popular across stores, not in one. By oa_app@2 (scores_methods). kinds keeps only listings of those kinds and ranks each store's kept listings among themselves; without it, every charted listing counts, Cursor's rules included.",input:s.object({kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(eb)}),examples:[{title:"Top apps across stores",input:{limit:10}},{title:"Apps only, no Claude plugins or Cursor rules",input:{kinds:["app","claude:connector","cursor:plugin","cursor:directory_mcp","grokbot:plugin"],limit:10}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}}),rb=C({name:"scores_tag",resource:"scores",path:"/v1/scores/tags/{tag}",summary:"Apps with one tag by OpenApps Rank, in one store or all.",description:"Use for the top apps in a category. With store, by the best listing's OpenApps Rank there; without, by oa_app@2 (scores_methods). tag: a v1 domain, use or audience value; a domain counts only as an app's primary.",input:s.object({tag:b.tag,store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({tag:s.object({facet:s.string(),value:s.string(),title:s.string()}),store:s.enum(A).nullable(),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(Xx)}),examples:[{title:"Video apps",input:{tag:"video"}},{title:"Developer tools on Claude",input:{tag:"developer-tools",store:"claude",limit:10}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].overall_rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}});var nb=C({name:"stores_get",resource:"stores",summary:"The app stores OpenApps tracks: listings per kind, regions, charts and metrics.",description:"Use for which stores, regions, charts and metrics exist and how fresh each region is. Chart names here are what charts_get takes.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(A),label:s.string(),apps:s.number().int().describe("Listings that are apps: every kind but cursor.directory rules, which kinds still counts"),kinds:s.partialRecord(s.enum(Q),s.number().int()),url:s.string(),last_run:s.string().nullable(),regions:s.array(s.object({region:s.string(),last_run:s.string(),status:s.enum(Qd).describe("Whether the region's latest data can stand for now; unavailable: the store gives no data there now")})),charts:s.array(s.object({chart:s.string(),kind:O(s.string()),title:s.string().nullable(),url:O(s.string()),size:O(s.number().int().nullable().describe("Apps in its latest list in its home region; null before the first"))})).optional(),metrics:s.array(s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string().describe("How often it is read: daily or weekly")}))}))}),examples:[{title:"Every store",input:{}},{title:"Claude only",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,countries:"status"})},basis:{"stores[].apps":"observed","stores[].regions[].last_run":"observed","stores[].charts[].size":"observed"}});var mp={changes_list:yv,movers_list:Av,stores_get:nb,freshness_get:xv,charts_get:_v,charts_regions_get:$v,featuring_get:kv,featuring_history:wv,leaderboards_get:Sv,new_list:Tv,listings_search:Nv,listings_list:Cv,listings_get:Ev,listings_ranks_current:Rv,listings_ranks_history:Vv,listings_metrics:Zv,listings_tools:Lv,listings_widgets:Mv,listings_versions:Fv,apps_get:fv,apps_list:gv,publishers_list:Wv,publishers_get:qv,tags_tree:Bv,tags_get:Kv,market_get:Iv,mcp_toolset_get:zv,mcp_servers_list:Ov,mcp_servers_get:jv,scores_apps:tb,scores_list:Xv,scores_tag:rb,scores_get:Yv,scores_methods:Qv};function ib(e,r=e.path){let i=r.split("/").filter(Boolean).flatMap(o=>{let t=/^\{([a-z_]+)\}$/.exec(o)?.[1];if(!t)return[{literal:o}];let n=qh[t];return n?Object.keys(n.parts).map(a=>({param:t,part:a})):[{param:t}]});return{op:e,segments:i,template:`/${i.map(o=>"literal"in o?o.literal:`{${o.part??o.param}}`).join("/")}`}}var ob=Object.values(mp).map(e=>ib(e));var Yx=[["/v1/apps/list","listings_list"],["/v1/apps/{app}","listings_get"],["/v1/apps/{app}/ranks/current","listings_ranks_current"],["/v1/apps/{app}/ranks","listings_ranks_history"],["/v1/apps/{app}/metrics","listings_metrics"],["/v1/apps/{app}/tools","listings_tools"],["/v1/apps/{app}/versions","listings_versions"],["/v1/products","apps_list"],["/v1/products/{slug}","apps_get"]],oN=Yx.map(([e,r])=>ib(mp[r],e));var ab=(e,r)=>Bh(e.segments,r,(i,o)=>{throw new Mt("bad_request",o,{param:i})}),fp="OpenApps-Contract";var Qx=new Set(["$schema","$id","detailed"]),eS=new Set(["additionalProperties","propertyNames","enum","required"]),tS=new Set(["maxLength","minLength","minItems","maxItems","minimum","maximum","pattern"]),rS=e=>e.detailed===!0,nS=e=>!!e&&typeof e=="object"&&Object.keys(e).length>0;function va(e,r,i){if(Array.isArray(e))return e.map(c=>va(c,r,i));if(!e||typeof e!="object")return e;let o=e,t=r==="output"&&i==="mcp",n=r==="input"&&i==="mcp",a=Object.fromEntries(Object.entries(o).flatMap(([c,u])=>c==="properties"&&u&&typeof u=="object"?[[c,Object.fromEntries(Object.entries(u).flatMap(([l,d])=>t&&rS(d)?[]:[[l,va(d,r,i)]]))]]:Qx.has(c)?[]:t&&eS.has(c)&&!(c==="additionalProperties"&&nS(u))?[]:n&&tS.has(c)?[]:r==="output"&&c==="additionalProperties"&&u===!1?[]:c==="propertyNames"&&JSON.stringify(u)==='{"type":"string"}'?[]:c==="pattern"&&"format"in o?[]:c==="maximum"&&u===Number.MAX_SAFE_INTEGER||c==="minimum"&&u===Number.MIN_SAFE_INTEGER?[]:[[c,va(u,r,i)]]));return i==="rest"&&Array.isArray(a.anyOf)?iS(a):a}function iS(e){let{anyOf:r,...i}=e,o=r,t=o.flatMap(a=>[a.type].flat());if(o.some(a=>"$ref"in a||"anyOf"in a||!a.type)||t.some(a=>typeof a!="string")||new Set(t).size!==t.length)return e;let n={};for(let{type:a,...c}of o)for(let[u,l]of Object.entries(c)){if(u in n&&JSON.stringify(n[u])!==JSON.stringify(l))return e;n[u]=l}if(n.enum){if(t.length!==2||!t.includes("null"))return e;n.enum=[...n.enum,null]}return{...i,...n,type:t}}function sb(e,r,i){let o=va(s.toJSONSchema(e,{io:r,target:"draft-2020-12"}),r,i);return r==="input"&&i==="mcp"?oS(o):o}function oS(e){let r=e.properties;if(!r)return e;let i=(o,t)=>Object.fromEntries(Object.entries(o).filter(([n])=>n!==t));return{...e,properties:Object.fromEntries(Object.entries(r).map(([o,t])=>{let n=Xh[o],a=n===void 0?t.description:n,c=t.items,u=Yh.includes(o)?i({...t,...c&&{items:i(c,"enum")}},"enum"):t,l=Qh.includes(o)?i(u,"default"):u;return[o,{...i(l,"description"),...a!=null&&{description:a}}]}))}}var Wn=e=>e.replaceAll("_","-");function aS(e){let r=sb(e.input,"input","rest");return Object.entries(r.properties).map(([i,o])=>({key:i,flag:Wn(i),array:o.type==="array",description:o.description??"",...(o.enum??o.items?.enum)&&{allowed:o.enum??o.items.enum},...o.default!==void 0&&{fallback:o.default}}))}var sS=[s.ZodString,s.ZodNumber,s.ZodBoolean,s.ZodEnum],cS=e=>s.globalRegistry.get(e)?.detailed===!0;function uS(e){let r=Object.entries(e.shape).map(([o,t])=>[o,rt(t)]);for(let[o,t]of r)if(t instanceof s.ZodArray&&rt(t.element)instanceof s.ZodObject)return{rows:o,element:rt(t.element)};let i=r.find(([,o])=>o instanceof s.ZodObject);return i?{rows:i[0],element:i[1]}:{rows:null,element:e}}var lS=e=>Object.entries(e.shape).filter(([r,i],o)=>(r!=="url"||o===0)&&!cS(i)&&(sS.some(t=>rt(i)instanceof t)||r==="before"||r==="after")).map(([r])=>r);function dS(e){let r=e.op,{rows:i,element:o}=uS(r.data),t=Object.entries(r.input.shape).filter(([,n])=>!n.safeParse(void 0).success).map(([n])=>n);return{resource:r.resource,verb:Wn(r.name.slice(r.resource.length+1)),op:r,route:e,positionals:t,params:aS(r),rows:i,fields:Object.keys(o.shape),columns:lS(o)}}var qn=ob.map(dS),cb=(e,r)=>qn.find(i=>i.resource===e&&i.verb===r);function ub(e,r){let i=t=>{let n=Array.isArray(t)?t.join(","):String(t);return/^[\w:.,/@-]+$/.test(n)?n:`'${n.replaceAll("'","'\\''")}'`},o=Object.entries(r).filter(([t])=>!e.positionals.includes(t)).map(([t,n])=>`--${Wn(t)}${i(n).startsWith("-")?"=":" "}${i(n)}`);return["openapps",e.resource,e.verb,...e.positionals.map(t=>i(r[t])),...o].join(" ")}var ba=["json","table","csv","md"];function lb(e,r){let i=e.rows===null?r.data:r.data[e.rows];return(Array.isArray(i)?i:[i]).filter(o=>!!o&&typeof o=="object")}var pS=e=>e==null?"":typeof e=="object"?JSON.stringify(e):String(e),mS=e=>e.length>60?`${e.slice(0,59)}\u2026`:e,fS=e=>/[",\n\r]/.test(e)?`"${e.replaceAll('"','""')}"`:e,gS=e=>e.replaceAll("|","\\|").replaceAll(`
|
|
65
|
+
`," ");function db(e,r,i,o,t){if(e==="json"){let l=o?lb(r,i).map(d=>Object.fromEntries(o.map(p=>[p,d[p]??null]))):i;return JSON.stringify(l,null,t?2:void 0)}let n=o??r.columns,a=lb(r,i).map(l=>n.map(d=>pS(l[d])));if(e==="csv")return[n,...a].map(l=>l.map(fS).join(",")).join(`
|
|
66
|
+
`);if(e==="md")return[n,n.map(()=>"---"),...a].map(l=>`| ${l.map(gS).join(" | ")} |`).join(`
|
|
67
|
+
`);let c=[n,...a].map(l=>l.map(mS)),u=n.map((l,d)=>Math.max(...c.map(p=>p[d].length)));return c.map(l=>l.map((d,p)=>d.padEnd(u[p])).join(" ").trimEnd()).join(`
|
|
68
|
+
`)}function pb(e){let{as_of:r,next_cursor:i,truncated:o}=e.meta;return[r&&`data from ${r}`,i&&`next page: --cursor ${i}`,o&&"truncated"].filter(Boolean).join("; ")}var hS="theopenapps.com",mb=`https://${hS}`,hN=`${mb}/v1`,vN=`${mb}/mcp`,fb="/oauth/cli";import{spawn as vS}from"node:child_process";import{createHash as bS,randomBytes as gb}from"node:crypto";import{chmod as yS,mkdir as _S,readFile as $S,rm as kS,writeFile as wS}from"node:fs/promises";import{createServer as xS}from"node:http";import{homedir as SS}from"node:os";import{join as Hn}from"node:path";var te={ok:0,other:1,usage:2,not_found:3,rate_limited:4},Oe=class extends Error{code;constructor(r,i){super(i),this.code=r}},Te=e=>new Oe(te.usage,e);var IS="catalog:read offline_access",hb="/callback",zS=5*6e4,PS=6e4,vb=e=>Hn(e.OPENAPPS_CONFIG_DIR??(e.XDG_CONFIG_HOME?Hn(e.XDG_CONFIG_HOME,"openapps"):process.platform==="win32"&&e.APPDATA?Hn(e.APPDATA,"openapps"):Hn(SS(),".config","openapps")),"auth.json");async function _a(e){try{return JSON.parse(await $S(vb(e),"utf8"))}catch{return{}}}async function hp(e,r){let i=vb(e);if(!Object.keys(r).length)return void await kS(i,{force:!0});await _S(Hn(i,".."),{recursive:!0,mode:448}),await wS(i,`${JSON.stringify(r,null,2)}
|
|
69
|
+
`,{mode:384}),await yS(i,384)}var gp=e=>e.toString("base64url");async function vp(e,r){let i=await e.json().catch(()=>null);if(e.ok&&i)return i;throw new Oe(te.other,`${r} failed: ${String(i?.error_description??i?.error??`HTTP ${e.status}`)}`)}async function OS(e){let r=await vp(await fetch(`${e}/.well-known/oauth-authorization-server`,{redirect:"error"}),`Reading ${e}'s sign-in settings`),i=o=>{let t=r[o];if(!(t===void 0&&o==="revocation_endpoint")){if(typeof t!="string"||new URL(t).origin!==e)throw new Oe(te.other,`${e} names no usable ${o}.`);return t}};return{authorization_endpoint:i("authorization_endpoint"),token_endpoint:i("token_endpoint"),revocation_endpoint:i("revocation_endpoint")}}var bp=(e,r)=>fetch(e,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(r)}),bb=(e,r)=>{if(typeof e.access_token!="string")throw new Oe(te.other,"The sign-in answer had no access token.");return{...r,access_token:e.access_token,expires_at:Date.now()+Number(e.expires_in??3600)*1e3,...typeof e.refresh_token=="string"&&{refresh_token:e.refresh_token}}};function jS(e){let[r,i]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];try{vS(r,i,{detached:!0,stdio:"ignore"}).on("error",()=>{}).unref()}catch{}}function AS(e){return new Promise(r=>{let i,o,t=new Promise((c,u)=>{i=c,o=u}),n=xS((c,u)=>{let l=new URL(c.url??"/","http://127.0.0.1");if(l.pathname!==hb)return void u.writeHead(404).end();let d=l.searchParams.get("error"),p=l.searchParams.get("code"),m=!d&&p&&l.searchParams.get("state")===e;u.writeHead(m?200:400,{"content-type":"text/html; charset=utf-8"}).end(`<!doctype html><meta charset="utf-8"><title>OpenApps CLI</title><p>${m?"Signed in. You can close this tab and go back to your terminal.":"Signing in did not finish. Go back to your terminal."}</p>`),n.close(),clearTimeout(a),m?i(p):o(new Oe(te.other,d==="access_denied"?"Signing in was cancelled.":`Signing in failed: ${d??"the answer did not match this request"}.`))}),a=setTimeout(()=>{n.close(),o(new Oe(te.other,"Signing in timed out after 5 minutes. Run openapps auth login again."))},zS);n.listen(0,"127.0.0.1",()=>r({port:n.address().port,code:t}))})}async function yb(e,r,i,o){let t=await OS(e),n=gp(gb(16)),a=gp(gb(32)),{port:c,code:u}=await AS(n),l=`http://127.0.0.1:${c}${hb}`,d=`${e}/v1`,p=new URL(t.authorization_endpoint);p.search=new URLSearchParams({response_type:"code",client_id:r,redirect_uri:l,scope:IS,state:n,resource:d,code_challenge:gp(bS("sha256").update(a).digest()),code_challenge_method:"S256"}).toString(),i.err(`Open this link to sign in to ${e}${o?" (it opens in your browser)":""}:
|
|
70
70
|
|
|
71
71
|
${p}
|
|
72
|
-
`),o&&
|
|
73
|
-
`)};function
|
|
72
|
+
`),o&&jS(p.href);let m=await vp(await bp(t.token_endpoint,{grant_type:"authorization_code",code:await u,redirect_uri:l,client_id:r,code_verifier:a,resource:d}),"Signing in"),f=await _a(i.env);f[e]=bb(m,{client_id:r,token_endpoint:t.token_endpoint,...t.revocation_endpoint&&{revocation_endpoint:t.revocation_endpoint}}),await hp(i.env,f),i.out(`Signed in to ${e}. Calls from this computer now read at your account's plan.`)}async function _b(e,r){let i=await _a(r.env),o=i[e];if(!o){r.out(`Not signed in to ${e}.`);return}let t=o.refresh_token??o.access_token;o.revocation_endpoint&&await bp(o.revocation_endpoint,{token:t,client_id:o.client_id}).catch(()=>{}),delete i[e],await hp(r.env,i),r.out(`Signed out of ${e}.`)}async function $b(e,r,i){let o=i.env.OPENAPPS_API_KEY,t=(await _a(i.env))[e];o&&e!==r?i.out(`OPENAPPS_API_KEY goes only to ${r}; set OPENAPPS_AUTH_ORIGIN=${e} to send it to ${e}.`):o?i.out(`Using OPENAPPS_API_KEY (${o.slice(0,11)}\u2026) for ${e}.`):t?i.out(`Signed in to ${e} with openapps auth login${t.refresh_token?"; access renews itself":`; access ends ${new Date(t.expires_at).toISOString()}`}.`):i.out(`Signed out of ${e}: public reads at the no-account depth. openapps auth login signs in.`)}async function kb(e,r){let i=await _a(r.env),o=i[e];if(!o)return;if(o.expires_at-PS>Date.now())return o.access_token;if(!o.refresh_token)throw ya(e);let t=await bp(o.token_endpoint,{grant_type:"refresh_token",refresh_token:o.refresh_token,client_id:o.client_id,resource:`${e}/v1`});if(t.status===400||t.status===401)throw ya(e);let{access_token:n,expires_at:a,...c}=o;return i[e]=bb(await vp(t,"Renewing your sign-in"),c),await hp(r.env,i),i[e].access_token}var ya=e=>new Oe(te.other,`Your sign-in to ${e} has ended. Run openapps auth login to sign in again, or openapps auth logout to read signed out.`);var DS={400:te.usage,404:te.not_found,429:te.rate_limited},yp={json:{type:"boolean"},format:{type:"string"},fields:{type:"string"},"base-url":{type:"string"},help:{type:"boolean",short:"h"}},$a=[["auth login","Sign in to your OpenApps account in the browser, so calls read at your plan"],["auth status","Say which credential calls use: OPENAPPS_API_KEY, a sign-in, or none"],["auth logout","Sign out and revoke this computer's sign-in"],["agent-context","Print what an agent needs to use OpenApps (stores, metrics, parameters, operations, limits) as JSON"],["mcp-url","Print the URL of the OpenApps MCP server, for an MCP client's config"]],Xn=e=>{let r=Math.max(...e.map(i=>i[0].length));return e.map(([i,o])=>` ${i.padEnd(r)} ${o}`).join(`
|
|
73
|
+
`)};function NS(){return`openapps: what is listed, ranked, featured and launched in the ChatGPT, Claude and Cursor app stores, from OpenApps (https://theopenapps.com).
|
|
74
74
|
|
|
75
75
|
Usage: openapps <resource> <verb> [arguments] [flags]
|
|
76
76
|
|
|
@@ -99,16 +99,16 @@ ${e.op.examples.map(n=>` ${ub(e,n.input)}`).join(`
|
|
|
99
99
|
`)}
|
|
100
100
|
|
|
101
101
|
API: GET ${e.route.template}
|
|
102
|
-
`}function
|
|
103
|
-
Allowed: ${c.values.join(", ")}`)}return o}var xb=e=>["openapps",e.resource,e.verb,...e.positionals.map(r=>`<${r}>`),"[flags]"].join(" ");function
|
|
104
|
-
Allowed: ${e.fields.join(", ")}`);return i}function
|
|
105
|
-
`))}function $p(e,r){try{return
|
|
102
|
+
`}function CS(e,r,i){let o={};for(let c of e.params){let u=r[c.flag];u!==void 0&&(o[c.key]=c.array?[u].flat().flatMap(l=>String(l).split(",")).map(l=>l.trim()).filter(Boolean):u)}let t=e.positionals.filter(c=>!(c in o));if(i.length>t.length)throw Te(`Unexpected argument '${i[t.length]}'. Usage: ${xb(e)}`);t.forEach((c,u)=>{i[u]!==void 0&&(o[c]=i[u])});let n=t.slice(i.length);if(n.length)throw Te(`Missing ${n.map(c=>`<${c}>`).join(" ")}. Usage: ${xb(e)}`);let a=e.op.input.safeParse(o);if(!a.success){let c=a.error.issues[0],u=String(c.path[0]??""),l=e.positionals.includes(u)?`<${u}>`:`--${Wn(u)}`;if(c.code!=="invalid_value")throw Te(`${l}: ${c.message}`);let d=c.path.reduce((p,m)=>p?.[m],o);throw Te(`${l}: '${String(d)}' is not one of the allowed values.
|
|
103
|
+
Allowed: ${c.values.join(", ")}`)}return o}var xb=e=>["openapps",e.resource,e.verb,...e.positionals.map(r=>`<${r}>`),"[flags]"].join(" ");function US(e,r){if(r===void 0)return;let i=r.split(",").map(t=>t.trim()).filter(Boolean),o=i.filter(t=>!e.fields.includes(t));if(o.length)throw Te(`--fields: no field ${o.join(", ")} in the rows.
|
|
104
|
+
Allowed: ${e.fields.join(", ")}`);return i}function ES(e,r){if(e.json)return"json";if(e.format===void 0)return r?"table":"json";if(!ba.includes(e.format))throw Te(`--format: expected one of ${ba.join(", ")}, got '${e.format}'.`);return e.format}function _p(e,r){let i=(e["base-url"]??r.env.OPENAPPS_BASE_URL??"https://theopenapps.com/v1").replace(/\/+$/,"");return/^[a-z]+:\/\/[^/]+$/i.test(i)?`${i}/v1`:i}var Ib=e=>new URL(e.env.OPENAPPS_AUTH_ORIGIN??"https://theopenapps.com").origin;async function RS(e,r){let i=r.env.OPENAPPS_API_KEY,o=Ib(r);if(i&&e.origin!==o)throw Te(`Refusing to send OPENAPPS_API_KEY to ${e.origin}. Set OPENAPPS_AUTH_ORIGIN explicitly for a trusted server.`);if(i)return{token:i,login:!1};let t=await kb(e.origin,r);return t?{token:t,login:!0}:void 0}async function Sb(e,r,i){let o=new URL(`${e}${r}`),t=await RS(o,i),n;try{n=await fetch(o,{redirect:"error",headers:{accept:"application/json",[fp]:"8d7a7c7e","user-agent":"openapps-cli/0.1.1",...t&&{authorization:`Bearer ${t.token}`}}})}catch(d){let p=d.cause;throw new Oe(te.other,`Cannot reach ${e}: ${p?.code??p?.message??d.message}`)}if(n.status===401&&t?.login)throw ya(o.origin);let a=n.headers.get(fp);a&&a!=="8d7a7c7e"&&i.err(`openapps: the API's contract (${a}) differs from this CLI's (8d7a7c7e); npm i -g @theopenapps/cli for the current one.`);let c=await n.json().catch(()=>null);if(n.ok&&c)return c;let u=c?.error,l=[u?.message??`HTTP ${n.status}`,u?.allowed?.length&&`Allowed: ${u.allowed.join(", ")}`,u?.nearest?.length&&`Closest: ${u.nearest.join(", ")}`].filter(Boolean);throw new Oe(DS[n.status]??te.other,l.join(`
|
|
105
|
+
`))}function $p(e,r){try{return TS({args:e,options:r,allowPositionals:!0,strict:!0})}catch(i){throw Te(i.message)}}async function ZS(e,r){try{let[i,o]=e;if(!i||i==="--help"||i==="-h")return r.out(NS()),te.ok;if(i==="--version")return r.out("0.1.1"),te.ok;if(i==="auth"){let{values:x}=$p(e.slice(2),{...yp,"no-browser":{type:"boolean"}}),j=x,P=$a.find(([L])=>L===`auth ${o}`);if(!P||j.help){if(!P&&o&&o!=="--help"&&o!=="-h")throw Te(`Unknown verb '${o}' for auth: openapps auth login, openapps auth status, openapps auth logout.`);return r.out(`Usage: openapps auth <login|status|logout> [--base-url <url>]
|
|
106
106
|
|
|
107
107
|
${Xn($a.filter(([L])=>L.startsWith("auth ")).map(([L,q])=>[L,q]))}
|
|
108
108
|
|
|
109
109
|
login opens your browser; --no-browser only prints the link. On a computer without a browser, set OPENAPPS_API_KEY to a key from https://theopenapps.com/account/keys instead.`),te.ok}let D=new URL(_p(j,r)).origin;return o==="login"?await yb(D,`https://theopenapps.com${fb}`,r,!j["no-browser"]):o==="logout"?await _b(D,r):await $b(D,Ib(r),r),te.ok}if(i==="agent-context"||i==="mcp-url"){let{values:x}=$p(e.slice(1),yp),j=x,P=_p(j,r);return j.help?(r.out(`Usage: openapps ${i} [--base-url <url>]
|
|
110
110
|
|
|
111
111
|
${$a.find(([D])=>D===i)[1]}.`),te.ok):(i==="mcp-url"?r.out(`${P.replace(/\/v1$/,"")}/mcp`):r.out(JSON.stringify(await Sb(P,"/agent-context",r),null,r.tty?2:void 0)),te.ok)}let t=qn.filter(x=>x.resource===i);if(!t.length)throw Te(`Unknown command '${i}'. Resources: ${[...new Set(qn.map(x=>x.resource))].join(", ")}; also auth, agent-context, mcp-url. openapps --help lists them.`);let n=o&&!o.startsWith("-")?cb(i,o):void 0;if(!n){if(o==="--help"||o==="-h")return r.out(t.map(x=>wb(x)).join(`
|
|
112
|
-
`)),te.ok;throw Te(`${o?`Unknown verb '${o}' for ${i}`:`${i} needs a verb`}: ${t.map(x=>`openapps ${i} ${x.verb}`).join(", ")}.`)}let a={...yp,...Object.fromEntries(n.params.map(x=>[x.flag,{type:"string",multiple:x.array}]))},{values:c,positionals:u}=$p(e.slice(2),a),l=c;if(l.help)return r.out(wb(n)),te.ok;let d=
|
|
112
|
+
`)),te.ok;throw Te(`${o?`Unknown verb '${o}' for ${i}`:`${i} needs a verb`}: ${t.map(x=>`openapps ${i} ${x.verb}`).join(", ")}.`)}let a={...yp,...Object.fromEntries(n.params.map(x=>[x.flag,{type:"string",multiple:x.array}]))},{values:c,positionals:u}=$p(e.slice(2),a),l=c;if(l.help)return r.out(wb(n)),te.ok;let d=CS(n,c,u),p=ES(l,r.tty),m=US(n,l.fields),f;try{f=ab(n.route,d).replace(/^\/v1/,"")}catch(x){throw x instanceof Mt?Te(x.message):x}let v=await Sb(_p(l,r),f,r);r.out(db(p,n,v,m,r.tty));let k=p==="json"?"":pb(v);return k&&r.err(k),te.ok}catch(i){if(!(i instanceof Oe))throw i;return r.err(`openapps: ${i.message}`),i.code}}process.exitCode=await ZS(process.argv.slice(2),{out:e=>process.stdout.write(`${e}
|
|
113
113
|
`),err:e=>process.stderr.write(`${e}
|
|
114
114
|
`),tty:!!process.stdout.isTTY,env:process.env});
|