souverain/commentairespublic Fork
⑂ v0.2.1
Commits
⬇ Clone ▾
git clone https://git.rickub.com/souverain/commentaires.git
git clone ssh://git@rickub.com/souverain/commentaires.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
Initial release v0.2.1 98f39dd · on v0.2.1 · Souverain · Oct 7, 2026
atproto-oauth.js · 8 lines · 875.0 KBJavaScript Blame HistoryRaw
/* Souverain.ovh */
(()=>{var L_=Object.create;var vn=Object.defineProperty;var $_=Object.getOwnPropertyDescriptor;var M_=Object.getOwnPropertyNames;var V_=Object.getPrototypeOf,O_=Object.prototype.hasOwnProperty;var E=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ct=(t,e)=>{for(var r in e)vn(t,r,{get:e[r],enumerable:!0})},z_=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of M_(e))!O_.call(t,i)&&i!==r&&vn(t,i,{get:()=>e[i],enumerable:!(o=$_(e,i))||o.enumerable});return t};var or=(t,e,r)=>(r=t!=null?L_(V_(t)):{},z_(e||!t||!t.__esModule?vn(r,"default",{value:t,enumerable:!0}):r,t));var be=E((xn,qh)=>{"use strict";var Jr=function(t){return t&&t.Math===Math&&t};qh.exports=Jr(typeof globalThis=="object"&&globalThis)||Jr(typeof window=="object"&&window)||Jr(typeof self=="object"&&self)||Jr(typeof global=="object"&&global)||Jr(typeof xn=="object"&&xn)||(function(){return this})()||Function("return this")()});var Lh=E((hV,Bh)=>{"use strict";var U_=be();Bh.exports=U_});var _t=E((yV,$h)=>{"use strict";$h.exports=function(t){try{return!!t()}catch{return!0}}});var wn=E((gV,Mh)=>{"use strict";var G_=_t();Mh.exports=!G_(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var ir=E((bV,zh)=>{"use strict";var Vh=wn(),Oh=Function.prototype,kn=Oh.call,F_=Vh&&Oh.bind.bind(kn,kn);zh.exports=Vh?F_:function(t){return function(){return kn.apply(t,arguments)}}});var An=E((vV,Uh)=>{"use strict";Uh.exports=function(t){return t==null}});var Sn=E((xV,Gh)=>{"use strict";var N_=An(),K_=TypeError;Gh.exports=function(t){if(N_(t))throw new K_("Can't call method on "+t);return t}});var Nh=E((wV,Fh)=>{"use strict";var H_=Sn(),J_=Object;Fh.exports=function(t){return J_(H_(t))}});var Zo=E((kV,Kh)=>{"use strict";var W_=ir(),X_=Nh(),Q_=W_({}.hasOwnProperty);Kh.exports=Object.hasOwn||function(e,r){return Q_(X_(e),r)}});var Jh=E((AV,Hh)=>{"use strict";Hh.exports=!1});var Qh=E((SV,Xh)=>{"use strict";var Wh=be(),Z_=Object.defineProperty;Xh.exports=function(t,e){try{Z_(Wh,t,{value:e,configurable:!0,writable:!0})}catch{Wh[t]=e}return e}});var ty=E((RV,ey)=>{"use strict";var Y_=Jh(),eE=be(),tE=Qh(),Zh="__core-js_shared__",Yh=ey.exports=eE[Zh]||tE(Zh,{});(Yh.versions||(Yh.versions=[])).push({version:"3.50.0",mode:Y_?"pure":"global",copyright:"\xA9 2013\u20132025 Denis Pushkarev (zloirock.ru), 2025\u20132026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var iy=E((CV,oy)=>{"use strict";var ry=ty(),rE=Object.create||Object;oy.exports=function(t,e){return ry[t]||(ry[t]=e||rE(null))}});var ny=E((_V,sy)=>{"use strict";var oE=ir(),iE=0,sE=Math.random(),nE=oE(1.1.toString);sy.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+nE(++iE+sE,36)}});var dy=E((EV,cy)=>{"use strict";var aE=be(),ay=aE.navigator,py=ay&&ay.userAgent;cy.exports=py?String(py):""});var gy=E((IV,yy)=>{"use strict";var hy=be(),Rn=dy(),ly=hy.process,uy=hy.Deno,fy=ly&&ly.versions||uy&&uy.version,my=fy&&fy.v8,Ee,Yo;my&&(Ee=my.split("."),Yo=Ee[0]>0&&Ee[0]<4?1:+(Ee[0]+Ee[1]));!Yo&&Rn&&(Ee=Rn.match(/Edge\/(\d+)/),(!Ee||Ee[1]>=74)&&(Ee=Rn.match(/Chrome\/(\d+)/),Ee&&(Yo=+Ee[1])));yy.exports=Yo});var Cn=E((DV,vy)=>{"use strict";var by=gy(),pE=_t(),cE=be(),dE=cE.String;vy.exports=!!Object.getOwnPropertySymbols&&!pE(function(){var t=Symbol("symbol detection");return!dE(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&by&&by<41})});var _n=E((TV,xy)=>{"use strict";var lE=Cn();xy.exports=lE&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var In=E((PV,ky)=>{"use strict";var uE=be(),fE=iy(),wy=Zo(),mE=ny(),hE=Cn(),yE=_n(),sr=uE.Symbol,En=fE("wks"),gE=yE?sr.for||sr:sr&&sr.withoutSetter||mE;ky.exports=function(t){return wy(En,t)||(En[t]=hE&&wy(sr,t)?sr[t]:gE("Symbol."+t)),En[t]}});var ei=E(Ay=>{"use strict";var bE=In();Ay.f=bE});var Wr=E((qV,Sy)=>{"use strict";var vE=_t();Sy.exports=!vE(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var nr=E((BV,Ry)=>{"use strict";var Dn=typeof document=="object"&&document.all;Ry.exports=typeof Dn>"u"&&Dn!==void 0?function(t){return typeof t=="function"||t===Dn}:function(t){return typeof t=="function"}});var Xr=E((LV,Cy)=>{"use strict";var xE=nr();Cy.exports=function(t){return typeof t=="object"?t!==null:xE(t)}});var Iy=E(($V,Ey)=>{"use strict";var wE=be(),_y=Xr(),Tn=wE.document,kE=_y(Tn)&&_y(Tn.createElement);Ey.exports=function(t){return kE?Tn.createElement(t):{}}});var Pn=E((MV,Dy)=>{"use strict";var AE=Wr(),SE=_t(),RE=Iy();Dy.exports=!AE&&!SE(function(){return Object.defineProperty(RE("div"),"a",{get:function(){return 7}}).a!==7})});var Py=E((VV,Ty)=>{"use strict";var CE=Wr(),_E=_t();Ty.exports=CE&&_E(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var qy=E((OV,jy)=>{"use strict";var EE=Xr(),IE=String,DE=TypeError;jy.exports=function(t){if(EE(t))return t;throw new DE(IE(t)+" is not an object")}});var ri=E((zV,By)=>{"use strict";var TE=wn(),ti=Function.prototype.call;By.exports=TE?ti.bind(ti):function(){return ti.apply(ti,arguments)}});var $y=E((UV,Ly)=>{"use strict";var jn=be(),PE=nr(),jE=function(t){return PE(t)?t:void 0};Ly.exports=function(t,e){return arguments.length<2?jE(jn[t]):jn[t]&&jn[t][e]}});var Vy=E((GV,My)=>{"use strict";var qE=ir();My.exports=qE({}.isPrototypeOf)});var qn=E((FV,Oy)=>{"use strict";var BE=$y(),LE=nr(),$E=Vy(),ME=_n(),VE=Object;Oy.exports=ME?function(t){return typeof t=="symbol"}:function(t){var e=BE("Symbol");return LE(e)&&$E(e.prototype,VE(t))}});var Uy=E((NV,zy)=>{"use strict";var OE=String;zy.exports=function(t){try{return OE(t)}catch{return"Object"}}});var Fy=E((KV,Gy)=>{"use strict";var zE=nr(),UE=Uy(),GE=TypeError;Gy.exports=function(t){if(zE(t))return t;throw new GE(UE(t)+" is not a function")}});var Ky=E((HV,Ny)=>{"use strict";var FE=Fy(),NE=An();Ny.exports=function(t,e){var r=t[e];return NE(r)?void 0:FE(r)}});var Jy=E((JV,Hy)=>{"use strict";var Bn=ri(),Ln=nr(),$n=Xr(),KE=TypeError;Hy.exports=function(t,e){var r,o;if(e==="string"&&Ln(r=t.toString)&&!$n(o=Bn(r,t))||Ln(r=t.valueOf)&&!$n(o=Bn(r,t))||e!=="string"&&Ln(r=t.toString)&&!$n(o=Bn(r,t)))return o;throw new KE("Can't convert object to primitive value")}});var Zy=E((WV,Qy)=>{"use strict";var HE=ri(),Wy=Xr(),Xy=qn(),JE=Ky(),WE=Jy(),XE=In(),QE=TypeError,ZE=XE("toPrimitive");Qy.exports=function(t,e){if(!Wy(t)||Xy(t))return t;var r=JE(t,ZE),o;if(r){if(e===void 0&&(e="default"),o=HE(r,t,e),!Wy(o)||Xy(o))return o;throw new QE("Can't convert object to primitive value")}return e===void 0&&(e="number"),WE(t,e)}});var Mn=E((XV,Yy)=>{"use strict";var YE=Zy(),eI=qn();Yy.exports=function(t){var e=YE(t,"string");return eI(e)?e:e+""}});var ii=E(tg=>{"use strict";var tI=Wr(),rI=Pn(),oI=Py(),oi=qy(),eg=Mn(),iI=TypeError,Vn=Object.defineProperty,sI=Object.getOwnPropertyDescriptor,On="enumerable",zn="configurable",Un="writable";tg.f=tI?oI?function(e,r,o){if(oi(e),r=eg(r),oi(o),typeof e=="function"&&r==="prototype"&&"value"in o&&Un in o&&!o[Un]){var i=sI(e,r);i&&i[Un]&&(e[r]=o.value,o={configurable:zn in o?o[zn]:i[zn],enumerable:On in o?o[On]:i[On],writable:!1})}return Vn(e,r,o)}:Vn:function(e,r,o){if(oi(e),r=eg(r),oi(o),rI)try{return Vn(e,r,o)}catch{}if("get"in o||"set"in o)throw new iI("Accessors not supported");return"value"in o&&(e[r]=o.value),e}});var Gn=E((ZV,og)=>{"use strict";var rg=Lh(),nI=Zo(),aI=ei(),pI=ii().f;og.exports=function(t){var e=rg.Symbol||(rg.Symbol={});nI(e,t)||pI(e,t,{value:aI.f(t)})}});var ag=E(ng=>{"use strict";var ig={}.propertyIsEnumerable,sg=Object.getOwnPropertyDescriptor,cI=sg&&!ig.call({1:2},1);ng.f=cI?function(e){var r=sg(this,e);return!!r&&r.enumerable}:ig});var cg=E((eO,pg)=>{"use strict";pg.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var ug=E((tO,lg)=>{"use strict";var dg=ir(),dI=dg({}.toString),lI=dg("".slice);lg.exports=function(t){return lI(dI(t),8,-1)}});var mg=E((rO,fg)=>{"use strict";var uI=ir(),fI=_t(),mI=ug(),Fn=Object,hI=uI("".split);fg.exports=fI(function(){return!Fn("z").propertyIsEnumerable(0)})?function(t){return mI(t)==="String"?hI(t,""):Fn(t)}:Fn});var yg=E((oO,hg)=>{"use strict";var yI=mg(),gI=Sn();hg.exports=function(t){return yI(gI(t))}});var Nn=E(bg=>{"use strict";var bI=Wr(),vI=ri(),xI=ag(),wI=cg(),kI=yg(),AI=Mn(),SI=Zo(),RI=Pn(),gg=Object.getOwnPropertyDescriptor;bg.f=bI?gg:function(e,r){if(e=kI(e),r=AI(r),RI)try{return gg(e,r)}catch{}if(SI(e,r))return wI(!vI(xI.f,e,r),e[r])}});var vg=E(()=>{"use strict";var CI=be(),_I=Gn(),EI=ii().f,II=Nn().f,Kn=CI.Symbol;_I("asyncDispose");Kn&&(Qr=II(Kn,"asyncDispose"),Qr.enumerable&&Qr.configurable&&Qr.writable&&EI(Kn,"asyncDispose",{value:Qr.value,enumerable:!1,configurable:!1,writable:!1}));var Qr});var wg=E((aO,xg)=>{"use strict";vg();var DI=ei();xg.exports=DI.f("asyncDispose")});var kg=E(()=>{"use strict";var TI=be(),PI=Gn(),jI=ii().f,qI=Nn().f,Hn=TI.Symbol;PI("dispose");Hn&&(Zr=qI(Hn,"dispose"),Zr.enumerable&&Zr.configurable&&Zr.writable&&jI(Hn,"dispose",{value:Zr.value,enumerable:!1,configurable:!1,writable:!1}));var Zr});var Yr=E((dO,Ag)=>{"use strict";kg();var BI=ei();Ag.exports=BI.f("dispose")});var cw=E(pw=>{(()=>{"use strict";var t={d:(f,m)=>{for(var h in m)t.o(m,h)&&!t.o(f,h)&&Object.defineProperty(f,h,{enumerable:!0,get:m[h]})},o:(f,m)=>Object.prototype.hasOwnProperty.call(f,m),r:f=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})}},e={};function r(f,m){return m===void 0&&(m="-"),new RegExp("^(?!0{4}"+m+"0{2}"+m+"0{2})((?=[0-9]{4}"+m+"(((0[^2])|1[0-2])|02(?="+m+"(([0-1][0-9])|2[0-8])))"+m+"[0-9]{2})|(?=((([13579][26])|([2468][048])|(0[48]))0{2})|([0-9]{2}((((0|[2468])[48])|[2468][048])|([13579][26])))"+m+"02"+m+"29))([0-9]{4})"+m+"(?!((0[469])|11)"+m+"31)((0[1,3-9]|1[0-2])|(02(?!"+m+"3)))"+m+"(0[1-9]|[1-2][0-9]|3[0-1])$").test(f)}function o(f){var m=/\D/.exec(f);return m?m[0]:""}function i(f,m,h){m===void 0&&(m=":"),h===void 0&&(h=!1);var g=new RegExp("^([0-1]|2(?=([0-3])|4"+m+"00))[0-9]"+m+"[0-5][0-9]("+m+"([0-5]|6(?=0))[0-9])?(.[0-9]{1,9})?$");if(!h||!/[Z+\-]/.test(f))return g.test(f);if(/Z$/.test(f))return g.test(f.replace("Z",""));var b=f.includes("+"),v=f.split(/[+-]/),x=v[0],I=v[1];return g.test(x)&&(function(k,B,L){return L===void 0&&(L=":"),new RegExp(B?"^(0(?!(2"+L+"4)|0"+L+"3)|1(?=([0-1]|2(?="+L+"[04])|[34](?="+L+"0))))([03469](?="+L+"[03])|[17](?="+L+"0)|2(?="+L+"[04])|5(?="+L+"[034])|8(?="+L+"[04]))"+L+"([03](?=0)|4(?=5))[05]$":"^(0(?=[^0])|1(?=[0-2]))([39](?="+L+"[03])|[0-24-8](?="+L+"00))"+L+"[03]0$").test(k)})(I,b,o(I))}function s(f){var m=f.split("T"),h=m[0],g=m[1],b=r(h,o(h));if(!g)return!1;var v,x=(v=g.match(/([^Z+\-\d])(?=\d+\1)/),Array.isArray(v)?v[0]:"");return b&&i(g,x,!0)}function a(f,m){return m===void 0&&(m="-"),new RegExp("^[0-9]{4}"+m+"(0(?=[^0])|1(?=[0-2]))[0-9]$").test(f)}t.r(e),t.d(e,{isValidDate:()=>r,isValidISODateString:()=>s,isValidTime:()=>i,isValidYearMonth:()=>a});var c=pw;for(var u in e)c[u]=e[u];e.__esModule&&Object.defineProperty(c,"__esModule",{value:!0})})()});var w6=or(wg(),1),k6=or(Yr(),1);var n={};Ct(n,{BRAND:()=>aD,DIRTY:()=>Et,EMPTY_PATH:()=>VI,INVALID:()=>_,NEVER:()=>ND,OK:()=>oe,ParseStatus:()=>re,Schema:()=>j,ZodAny:()=>ct,ZodArray:()=>Ye,ZodBigInt:()=>Dt,ZodBoolean:()=>Tt,ZodBranded:()=>to,ZodCatch:()=>Ut,ZodDate:()=>Pt,ZodDefault:()=>zt,ZodDiscriminatedUnion:()=>ai,ZodEffects:()=>we,ZodEnum:()=>Vt,ZodError:()=>Y,ZodFirstPartyTypeKind:()=>D,ZodFunction:()=>ci,ZodIntersection:()=>Lt,ZodIssueCode:()=>y,ZodLazy:()=>$t,ZodLiteral:()=>Mt,ZodMap:()=>ur,ZodNaN:()=>mr,ZodNativeEnum:()=>Ot,ZodNever:()=>Ie,ZodNull:()=>qt,ZodNullable:()=>$e,ZodNumber:()=>It,ZodObject:()=>le,ZodOptional:()=>ve,ZodParsedType:()=>A,ZodPipeline:()=>ro,ZodPromise:()=>dt,ZodReadonly:()=>Gt,ZodRecord:()=>pi,ZodSchema:()=>j,ZodSet:()=>fr,ZodString:()=>pt,ZodSymbol:()=>dr,ZodTransformer:()=>we,ZodTuple:()=>Le,ZodType:()=>j,ZodUndefined:()=>jt,ZodUnion:()=>Bt,ZodUnknown:()=>Ze,ZodVoid:()=>lr,addIssueToContext:()=>w,any:()=>yD,array:()=>xD,bigint:()=>lD,boolean:()=>qg,coerce:()=>FD,custom:()=>Tg,date:()=>uD,datetimeRegex:()=>Ig,defaultErrorMap:()=>Xe,discriminatedUnion:()=>SD,effect:()=>LD,enum:()=>jD,function:()=>DD,getErrorMap:()=>ar,getParsedType:()=>Be,instanceof:()=>cD,intersection:()=>RD,isAborted:()=>si,isAsync:()=>pr,isDirty:()=>ni,isValid:()=>at,late:()=>pD,lazy:()=>TD,literal:()=>PD,makeIssue:()=>eo,map:()=>ED,nan:()=>dD,nativeEnum:()=>qD,never:()=>bD,null:()=>hD,nullable:()=>MD,number:()=>jg,object:()=>wD,objectUtil:()=>Jn,oboolean:()=>GD,onumber:()=>UD,optional:()=>$D,ostring:()=>zD,pipeline:()=>OD,preprocess:()=>VD,promise:()=>BD,quotelessJson:()=>LI,record:()=>_D,set:()=>ID,setErrorMap:()=>MI,strictObject:()=>kD,string:()=>Pg,symbol:()=>fD,transformer:()=>LD,tuple:()=>CD,undefined:()=>mD,union:()=>AD,unknown:()=>gD,util:()=>$,void:()=>vD});var $;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let a of i)s[a]=a;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),a={};for(let c of s)a[c]=i[c];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(let a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function o(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=o,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})($||($={}));var Jn;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Jn||(Jn={}));var A=$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Be=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}};var y=$.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),LI=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Y=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},o={_errors:[]},i=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)o._errors.push(r(a));else{let c=o,u=0;for(;u<a.path.length;){let f=a.path[u];u===a.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(r(a))):c[f]=c[f]||{_errors:[]},c=c[f],u++}}};return i(this),o}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},o=[];for(let i of this.issues)if(i.path.length>0){let s=i.path[0];r[s]=r[s]||[],r[s].push(e(i))}else o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};Y.create=t=>new Y(t);var $I=(t,e)=>{let r;switch(t.code){case y.invalid_type:t.received===A.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,$.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${$.joinValues(t.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$.joinValues(t.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;break;case y.invalid_arguments:r="Invalid function arguments";break;case y.invalid_return_type:r="Invalid function return type";break;case y.invalid_date:r="Invalid date";break;case y.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:$.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case y.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case y.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case y.custom:r="Invalid input";break;case y.invalid_intersection_types:r="Intersection results could not be merged";break;case y.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case y.not_finite:r="Number must be finite";break;default:r=e.defaultError,$.assertNever(t)}return{message:r}},Xe=$I;var Sg=Xe;function MI(t){Sg=t}function ar(){return Sg}var eo=t=>{let{data:e,path:r,errorMaps:o,issueData:i}=t,s=[...r,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let c="",u=o.filter(f=>!!f).slice().reverse();for(let f of u)c=f(a,{data:e,defaultError:c}).message;return{...i,path:s,message:c}},VI=[];function w(t,e){let r=ar(),o=eo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Xe?void 0:Xe].filter(i=>!!i)});t.common.issues.push(o)}var re=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let o=[];for(let i of r){if(i.status==="aborted")return _;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){let o=[];for(let i of r){let s=await i.key,a=await i.value;o.push({key:s,value:a})}return t.mergeObjectSync(e,o)}static mergeObjectSync(e,r){let o={};for(let i of r){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return _;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(o[s.value]=a.value)}return{status:e.value,value:o}}},_=Object.freeze({status:"aborted"}),Et=t=>({status:"dirty",value:t}),oe=t=>({status:"valid",value:t}),si=t=>t.status==="aborted",ni=t=>t.status==="dirty",at=t=>t.status==="valid",pr=t=>typeof Promise<"u"&&t instanceof Promise;var R;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(R||(R={}));var xe=class{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Rg=(t,e)=>{if(at(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Y(t.common.issues);return this._error=r,this._error}}};function P(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,c)=>{let{message:u}=t;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??o??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??r??c.defaultError}},description:i}}var j=class{get description(){return this._def.description}_getType(e){return Be(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new re,ctx:{common:e.parent.common,data:e.data,parsedType:Be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(pr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){let o={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Be(e)},i=this._parseSync({data:e,path:o.path,parent:o});return Rg(o,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Be(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:r});return at(o)?{value:o.value}:{issues:r.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(o=>at(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(e,r){let o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Be(e)},i=this._parse({data:e,path:o.path,parent:o}),s=await(pr(i)?i:Promise.resolve(i));return Rg(o,s)}refine(e,r){let o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let a=e(i),c=()=>s.addIssue({code:y.custom,...o(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new we({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ve.create(this,this._def)}nullable(){return $e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ye.create(this)}promise(){return dt.create(this,this._def)}or(e){return Bt.create([this,e],this._def)}and(e){return Lt.create(this,e,this._def)}transform(e){return new we({...P(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new zt({...P(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new to({typeName:D.ZodBranded,type:this,...P(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ut({...P(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ro.create(this,e)}readonly(){return Gt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},OI=/^c[^\s-]{8,}$/i,zI=/^[0-9a-z]+$/,UI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,FI=/^[a-z0-9_-]{21}$/i,NI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KI=/^[-+]?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)?)??$/,HI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Wn,WI=/^(?:(?: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])$/,XI=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,QI=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZI=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_g="((\\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])))",tD=new RegExp(`^${_g}$`);function Eg(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function rD(t){return new RegExp(`^${Eg(t)}$`)}function Ig(t){let e=`${_g}T${Eg(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function oD(t,e){return!!((e==="v4"||!e)&&WI.test(t)||(e==="v6"||!e)&&QI.test(t))}function iD(t,e){if(!NI.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(o));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function sD(t,e){return!!((e==="v4"||!e)&&XI.test(t)||(e==="v6"||!e)&&ZI.test(t))}var pt=class t extends j{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){let s=this._getOrReturnCtx(e);return w(s,{code:y.invalid_type,expected:A.string,received:s.parsedType}),_}let o=new re,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),o.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),o.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,c=e.data.length<s.value;(a||c)&&(i=this._getOrReturnCtx(e,i),a?w(i,{code:y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&w(i,{code:y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),o.dirty())}else if(s.kind==="email")HI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"email",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="emoji")Wn||(Wn=new RegExp(JI,"u")),Wn.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"emoji",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="uuid")GI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"uuid",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="nanoid")FI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"nanoid",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="cuid")OI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="cuid2")zI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cuid2",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="ulid")UI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ulid",code:y.invalid_string,message:s.message}),o.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),w(i,{validation:"url",code:y.invalid_string,message:s.message}),o.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"regex",code:y.invalid_string,message:s.message}),o.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),o.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:{startsWith:s.value},message:s.message}),o.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:{endsWith:s.value},message:s.message}),o.dirty()):s.kind==="datetime"?Ig(s).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:"datetime",message:s.message}),o.dirty()):s.kind==="date"?tD.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:"date",message:s.message}),o.dirty()):s.kind==="time"?rD(s).test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{code:y.invalid_string,validation:"time",message:s.message}),o.dirty()):s.kind==="duration"?KI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"duration",code:y.invalid_string,message:s.message}),o.dirty()):s.kind==="ip"?oD(e.data,s.version)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"ip",code:y.invalid_string,message:s.message}),o.dirty()):s.kind==="jwt"?iD(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"jwt",code:y.invalid_string,message:s.message}),o.dirty()):s.kind==="cidr"?sD(e.data,s.version)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"cidr",code:y.invalid_string,message:s.message}),o.dirty()):s.kind==="base64"?YI.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"base64",code:y.invalid_string,message:s.message}),o.dirty()):s.kind==="base64url"?eD.test(e.data)||(i=this._getOrReturnCtx(e,i),w(i,{validation:"base64url",code:y.invalid_string,message:s.message}),o.dirty()):$.assertNever(s);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:y.invalid_string,...R.errToObj(o)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...R.errToObj(e)})}url(e){return this._addCheck({kind:"url",...R.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...R.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...R.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...R.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...R.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...R.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...R.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...R.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...R.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...R.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...R.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...R.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...R.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...R.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...R.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...R.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...R.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...R.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...R.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...R.errToObj(r)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};pt.create=t=>new pt({checks:[],typeName:D.ZodString,coerce:t?.coerce??!1,...P(t)});function nD(t,e){let r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}var It=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){let s=this._getOrReturnCtx(e);return w(s,{code:y.invalid_type,expected:A.number,received:s.parsedType}),_}let o,i=new re;for(let s of this._def.checks)s.kind==="int"?$.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:y.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?nD(e.data,s.value)!==0&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:y.not_finite,message:s.message}),i.dirty()):$.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,R.toString(r))}gt(e,r){return this.setLimit("min",e,!1,R.toString(r))}lte(e,r){return this.setLimit("max",e,!0,R.toString(r))}lt(e,r){return this.setLimit("max",e,!1,R.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:R.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:R.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:R.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&$.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}};It.create=t=>new It({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...P(t)});var Dt=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let o,i=new re;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),w(o,{code:y.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):$.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:A.bigint,received:r.parsedType}),_}gte(e,r){return this.setLimit("min",e,!0,R.toString(r))}gt(e,r){return this.setLimit("min",e,!1,R.toString(r))}lte(e,r){return this.setLimit("max",e,!0,R.toString(r))}lt(e,r){return this.setLimit("max",e,!1,R.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:R.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Dt.create=t=>new Dt({checks:[],typeName:D.ZodBigInt,coerce:t?.coerce??!1,...P(t)});var Tt=class extends j{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.boolean,received:o.parsedType}),_}return oe(e.data)}};Tt.create=t=>new Tt({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...P(t)});var Pt=class t extends j{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){let s=this._getOrReturnCtx(e);return w(s,{code:y.invalid_type,expected:A.date,received:s.parsedType}),_}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return w(s,{code:y.invalid_date}),_}let o=new re,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),o.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),w(i,{code:y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),o.dirty()):$.assertNever(s);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:R.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:R.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Pt.create=t=>new Pt({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...P(t)});var dr=class extends j{_parse(e){if(this._getType(e)!==A.symbol){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.symbol,received:o.parsedType}),_}return oe(e.data)}};dr.create=t=>new dr({typeName:D.ZodSymbol,...P(t)});var jt=class extends j{_parse(e){if(this._getType(e)!==A.undefined){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.undefined,received:o.parsedType}),_}return oe(e.data)}};jt.create=t=>new jt({typeName:D.ZodUndefined,...P(t)});var qt=class extends j{_parse(e){if(this._getType(e)!==A.null){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.null,received:o.parsedType}),_}return oe(e.data)}};qt.create=t=>new qt({typeName:D.ZodNull,...P(t)});var ct=class extends j{constructor(){super(...arguments),this._any=!0}_parse(e){return oe(e.data)}};ct.create=t=>new ct({typeName:D.ZodAny,...P(t)});var Ze=class extends j{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oe(e.data)}};Ze.create=t=>new Ze({typeName:D.ZodUnknown,...P(t)});var Ie=class extends j{_parse(e){let r=this._getOrReturnCtx(e);return w(r,{code:y.invalid_type,expected:A.never,received:r.parsedType}),_}};Ie.create=t=>new Ie({typeName:D.ZodNever,...P(t)});var lr=class extends j{_parse(e){if(this._getType(e)!==A.undefined){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.void,received:o.parsedType}),_}return oe(e.data)}};lr.create=t=>new lr({typeName:D.ZodVoid,...P(t)});var Ye=class t extends j{_parse(e){let{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==A.array)return w(r,{code:y.invalid_type,expected:A.array,received:r.parsedType}),_;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(a||c)&&(w(r,{code:a?y.too_big:y.too_small,minimum:c?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(w(r,{code:y.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(w(r,{code:y.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((a,c)=>i.type._parseAsync(new xe(r,a,r.path,c)))).then(a=>re.mergeArray(o,a));let s=[...r.data].map((a,c)=>i.type._parseSync(new xe(r,a,r.path,c)));return re.mergeArray(o,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:R.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:R.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:R.toString(r)}})}nonempty(e){return this.min(1,e)}};Ye.create=(t,e)=>new Ye({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...P(e)});function cr(t){if(t instanceof le){let e={};for(let r in t.shape){let o=t.shape[r];e[r]=ve.create(cr(o))}return new le({...t._def,shape:()=>e})}else return t instanceof Ye?new Ye({...t._def,type:cr(t.element)}):t instanceof ve?ve.create(cr(t.unwrap())):t instanceof $e?$e.create(cr(t.unwrap())):t instanceof Le?Le.create(t.items.map(e=>cr(e))):t}var le=class t extends j{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=$.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==A.object){let f=this._getOrReturnCtx(e);return w(f,{code:y.invalid_type,expected:A.object,received:f.parsedType}),_}let{status:o,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ie&&this._def.unknownKeys==="strip"))for(let f in i.data)a.includes(f)||c.push(f);let u=[];for(let f of a){let m=s[f],h=i.data[f];u.push({key:{status:"valid",value:f},value:m._parse(new xe(i,h,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof Ie){let f=this._def.unknownKeys;if(f==="passthrough")for(let m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(f==="strict")c.length>0&&(w(i,{code:y.unrecognized_keys,keys:c}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let m of c){let h=i.data[m];u.push({key:{status:"valid",value:m},value:f._parse(new xe(i,h,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let f=[];for(let m of u){let h=await m.key,g=await m.value;f.push({key:h,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>re.mergeObjectSync(o,f)):re.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(e){return R.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{let i=this._def.errorMap?.(r,o).message??o.defaultError;return r.code==="unrecognized_keys"?{message:R.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let o of $.objectKeys(e))e[o]&&this.shape[o]&&(r[o]=this.shape[o]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let o of $.objectKeys(this.shape))e[o]||(r[o]=this.shape[o]);return new t({...this._def,shape:()=>r})}deepPartial(){return cr(this)}partial(e){let r={};for(let o of $.objectKeys(this.shape)){let i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let o of $.objectKeys(this.shape))if(e&&!e[o])r[o]=this.shape[o];else{let s=this.shape[o];for(;s instanceof ve;)s=s._def.innerType;r[o]=s}return new t({...this._def,shape:()=>r})}keyof(){return Dg($.objectKeys(this.shape))}};le.create=(t,e)=>new le({shape:()=>t,unknownKeys:"strip",catchall:Ie.create(),typeName:D.ZodObject,...P(e)});le.strictCreate=(t,e)=>new le({shape:()=>t,unknownKeys:"strict",catchall:Ie.create(),typeName:D.ZodObject,...P(e)});le.lazycreate=(t,e)=>new le({shape:t,unknownKeys:"strip",catchall:Ie.create(),typeName:D.ZodObject,...P(e)});var Bt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),o=this._def.options;function i(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Y(c.ctx.common.issues));return w(r,{code:y.invalid_union,unionErrors:a}),_}if(r.common.async)return Promise.all(o.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let s,a=[];for(let u of o){let f={...r,common:{...r.common,issues:[]},parent:null},m=u._parseSync({data:r.data,path:r.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Y(u));return w(r,{code:y.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}};Bt.create=(t,e)=>new Bt({options:t,typeName:D.ZodUnion,...P(e)});var Qe=t=>t instanceof $t?Qe(t.schema):t instanceof we?Qe(t.innerType()):t instanceof Mt?[t.value]:t instanceof Vt?t.options:t instanceof Ot?$.objectValues(t.enum):t instanceof zt?Qe(t._def.innerType):t instanceof jt?[void 0]:t instanceof qt?[null]:t instanceof ve?[void 0,...Qe(t.unwrap())]:t instanceof $e?[null,...Qe(t.unwrap())]:t instanceof to||t instanceof Gt?Qe(t.unwrap()):t instanceof Ut?Qe(t._def.innerType):[],ai=class t extends j{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.object)return w(r,{code:y.invalid_type,expected:A.object,received:r.parsedType}),_;let o=this.discriminator,i=r.data[o],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(w(r,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){let i=new Map;for(let s of r){let a=Qe(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of a){if(i.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);i.set(c,s)}}return new t({typeName:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...P(o)})}};function Xn(t,e){let r=Be(t),o=Be(e);if(t===e)return{valid:!0,data:t};if(r===A.object&&o===A.object){let i=$.objectKeys(e),s=$.objectKeys(t).filter(c=>i.indexOf(c)!==-1),a={...t,...e};for(let c of s){let u=Xn(t[c],e[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(r===A.array&&o===A.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let a=t[s],c=e[s],u=Xn(a,c);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===A.date&&o===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Lt=class extends j{_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=(s,a)=>{if(si(s)||si(a))return _;let c=Xn(s.value,a.value);return c.valid?((ni(s)||ni(a))&&r.dirty(),{status:r.value,value:c.data}):(w(o,{code:y.invalid_intersection_types}),_)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Lt.create=(t,e,r)=>new Lt({left:t,right:e,typeName:D.ZodIntersection,...P(r)});var Le=class t extends j{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==A.array)return w(o,{code:y.invalid_type,expected:A.array,received:o.parsedType}),_;if(o.data.length<this._def.items.length)return w(o,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&o.data.length>this._def.items.length&&(w(o,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...o.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new xe(o,a,o.path,c)):null}).filter(a=>!!a);return o.common.async?Promise.all(s).then(a=>re.mergeArray(r,a)):re.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Le.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Le({items:t,typeName:D.ZodTuple,rest:null,...P(e)})};var pi=class t extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==A.object)return w(o,{code:y.invalid_type,expected:A.object,received:o.parsedType}),_;let i=[],s=this._def.keyType,a=this._def.valueType;for(let c in o.data)i.push({key:s._parse(new xe(o,c,o.path,c)),value:a._parse(new xe(o,o.data[c],o.path,c)),alwaysSet:c in o.data});return o.common.async?re.mergeObjectAsync(r,i):re.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof j?new t({keyType:e,valueType:r,typeName:D.ZodRecord,...P(o)}):new t({keyType:pt.create(),valueType:e,typeName:D.ZodRecord,...P(r)})}},ur=class extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==A.map)return w(o,{code:y.invalid_type,expected:A.map,received:o.parsedType}),_;let i=this._def.keyType,s=this._def.valueType,a=[...o.data.entries()].map(([c,u],f)=>({key:i._parse(new xe(o,c,o.path,[f,"key"])),value:s._parse(new xe(o,u,o.path,[f,"value"]))}));if(o.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let f=await u.key,m=await u.value;if(f.status==="aborted"||m.status==="aborted")return _;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let u of a){let f=u.key,m=u.value;if(f.status==="aborted"||m.status==="aborted")return _;(f.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(f.value,m.value)}return{status:r.value,value:c}}}};ur.create=(t,e,r)=>new ur({valueType:e,keyType:t,typeName:D.ZodMap,...P(r)});var fr=class t extends j{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==A.set)return w(o,{code:y.invalid_type,expected:A.set,received:o.parsedType}),_;let i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(w(o,{code:y.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(w(o,{code:y.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function a(u){let f=new Set;for(let m of u){if(m.status==="aborted")return _;m.status==="dirty"&&r.dirty(),f.add(m.value)}return{status:r.value,value:f}}let c=[...o.data.values()].map((u,f)=>s._parse(new xe(o,u,o.path,f)));return o.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(e,r){return new t({...this._def,minSize:{value:e,message:R.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:R.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};fr.create=(t,e)=>new fr({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...P(e)});var ci=class t extends j{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.function)return w(r,{code:y.invalid_type,expected:A.function,received:r.parsedType}),_;function o(c,u){return eo({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ar(),Xe].filter(f=>!!f),issueData:{code:y.invalid_arguments,argumentsError:u}})}function i(c,u){return eo({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ar(),Xe].filter(f=>!!f),issueData:{code:y.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof dt){let c=this;return oe(async function(...u){let f=new Y([]),m=await c._def.args.parseAsync(u,s).catch(b=>{throw f.addIssue(o(u,b)),f}),h=await Reflect.apply(a,this,m);return await c._def.returns._def.type.parseAsync(h,s).catch(b=>{throw f.addIssue(i(h,b)),f})})}else{let c=this;return oe(function(...u){let f=c._def.args.safeParse(u,s);if(!f.success)throw new Y([o(u,f.error)]);let m=Reflect.apply(a,this,f.data),h=c._def.returns.safeParse(m,s);if(!h.success)throw new Y([i(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Le.create(e).rest(Ze.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new t({args:e||Le.create([]).rest(Ze.create()),returns:r||Ze.create(),typeName:D.ZodFunction,...P(o)})}},$t=class extends j{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};$t.create=(t,e)=>new $t({getter:t,typeName:D.ZodLazy,...P(e)});var Mt=class extends j{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return w(r,{received:r.data,code:y.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}};Mt.create=(t,e)=>new Mt({value:t,typeName:D.ZodLiteral,...P(e)});function Dg(t,e){return new Vt({values:t,typeName:D.ZodEnum,...P(e)})}var Vt=class t extends j{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),o=this._def.values;return w(r,{expected:$.joinValues(o),received:r.parsedType,code:y.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),o=this._def.values;return w(r,{received:r.data,code:y.invalid_enum_value,options:o}),_}return oe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}};Vt.create=Dg;var Ot=class extends j{_parse(e){let r=$.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==A.string&&o.parsedType!==A.number){let i=$.objectValues(r);return w(o,{expected:$.joinValues(i),received:o.parsedType,code:y.invalid_type}),_}if(this._cache||(this._cache=new Set($.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=$.objectValues(r);return w(o,{received:o.data,code:y.invalid_enum_value,options:i}),_}return oe(e.data)}get enum(){return this._def.values}};Ot.create=(t,e)=>new Ot({values:t,typeName:D.ZodNativeEnum,...P(e)});var dt=class extends j{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.promise&&r.common.async===!1)return w(r,{code:y.invalid_type,expected:A.promise,received:r.parsedType}),_;let o=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return oe(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dt.create=(t,e)=>new dt({type:t,typeName:D.ZodPromise,...P(e)});var we=class extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{w(o,a),a.fatal?r.abort():r.dirty()},get path(){return o.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let a=i.transform(o.data,s);if(o.common.async)return Promise.resolve(a).then(async c=>{if(r.value==="aborted")return _;let u=await this._def.schema._parseAsync({data:c,path:o.path,parent:o});return u.status==="aborted"?_:u.status==="dirty"?Et(u.value):r.value==="dirty"?Et(u.value):u});{if(r.value==="aborted")return _;let c=this._def.schema._parseSync({data:a,path:o.path,parent:o});return c.status==="aborted"?_:c.status==="dirty"?Et(c.value):r.value==="dirty"?Et(c.value):c}}if(i.type==="refinement"){let a=c=>{let u=i.refinement(c,s);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(o.common.async===!1){let c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?_:(c.status==="dirty"&&r.dirty(),a(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&r.dirty(),a(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!at(a))return _;let c=i.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>at(a)?Promise.resolve(i.transform(a.value,s)).then(c=>({status:r.value,value:c})):_);$.assertNever(i)}};we.create=(t,e,r)=>new we({schema:t,typeName:D.ZodEffects,effect:e,...P(r)});we.createWithPreprocess=(t,e,r)=>new we({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...P(r)});var ve=class extends j{_parse(e){return this._getType(e)===A.undefined?oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ve.create=(t,e)=>new ve({innerType:t,typeName:D.ZodOptional,...P(e)});var $e=class extends j{_parse(e){return this._getType(e)===A.null?oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$e.create=(t,e)=>new $e({innerType:t,typeName:D.ZodNullable,...P(e)});var zt=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return r.parsedType===A.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};zt.create=(t,e)=>new zt({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...P(e)});var Ut=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return pr(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Y(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Y(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...P(e)});var mr=class extends j{_parse(e){if(this._getType(e)!==A.nan){let o=this._getOrReturnCtx(e);return w(o,{code:y.invalid_type,expected:A.nan,received:o.parsedType}),_}return{status:"valid",value:e.data}}};mr.create=t=>new mr({typeName:D.ZodNaN,...P(t)});var aD=Symbol("zod_brand"),to=class extends j{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},ro=class t extends j{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?_:s.status==="dirty"?(r.dirty(),Et(s.value)):this._def.out._parseAsync({data:s.value,path:o.path,parent:o})})();{let i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?_:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new t({in:e,out:r,typeName:D.ZodPipeline})}},Gt=class extends j{_parse(e){let r=this._def.innerType._parse(e),o=i=>(at(i)&&(i.value=Object.freeze(i.value)),i);return pr(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}};Gt.create=(t,e)=>new Gt({innerType:t,typeName:D.ZodReadonly,...P(e)});function Cg(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Tg(t,e={},r){return t?ct.create().superRefine((o,i)=>{let s=t(o);if(s instanceof Promise)return s.then(a=>{if(!a){let c=Cg(e,o),u=c.fatal??r??!0;i.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=Cg(e,o),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}}):ct.create()}var pD={object:le.lazycreate},D;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(D||(D={}));var cD=(t,e={message:`Input not instance of ${t.name}`})=>Tg(r=>r instanceof t,e),Pg=pt.create,jg=It.create,dD=mr.create,lD=Dt.create,qg=Tt.create,uD=Pt.create,fD=dr.create,mD=jt.create,hD=qt.create,yD=ct.create,gD=Ze.create,bD=Ie.create,vD=lr.create,xD=Ye.create,wD=le.create,kD=le.strictCreate,AD=Bt.create,SD=ai.create,RD=Lt.create,CD=Le.create,_D=pi.create,ED=ur.create,ID=fr.create,DD=ci.create,TD=$t.create,PD=Mt.create,jD=Vt.create,qD=Ot.create,BD=dt.create,LD=we.create,$D=ve.create,MD=$e.create,VD=we.createWithPreprocess,OD=ro.create,zD=()=>Pg().optional(),UD=()=>jg().optional(),GD=()=>qg().optional(),FD={string:(t=>pt.create({...t,coerce:!0})),number:(t=>It.create({...t,coerce:!0})),boolean:(t=>Tt.create({...t,coerce:!0})),bigint:(t=>Dt.create({...t,coerce:!0})),date:(t=>Pt.create({...t,coerce:!0}))};var ND=_;var Bg="ERR_JWKS_NO_MATCHING_KEY",KD="ERR_JWK_INVALID",Qn="ERR_JWK_NOT_FOUND",hr="ERR_JWT_INVALID",HD="ERR_JWT_CREATE",JD="ERR_JWT_VERIFY",J=class extends TypeError{constructor(e="JWK error",r=KD,o){super(e,o),this.code=r}},et=class t extends Error{constructor(e="Unable to create JWT",r=HD,o){super(e,o),this.code=r}static from(e,r,o){return e instanceof t?e:e instanceof J?new t(o,e.code,{cause:e}):new t(o,r,{cause:e})}},ue=class t extends Error{constructor(e="Invalid JWT",r=JD,o){super(e,o),this.code=r}static from(e,r,o){return e instanceof t?e:e instanceof J?new t(o,e.code,{cause:e}):new t(o,r,{cause:e})}};var MO=new Uint8Array(0);function Lg(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function yr(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}function WD(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),o=0;o<r.length;o++)r[o]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var c=t.length,u=t.charAt(0),f=Math.log(c)/Math.log(256),m=Math.log(256)/Math.log(c);function h(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";for(var x=0,I=0,k=0,B=v.length;k!==B&&v[k]===0;)k++,x++;for(var L=(B-k)*m+1>>>0,z=new Uint8Array(L);k!==B;){for(var N=v[k],Z=0,H=L-1;(N!==0||Z<I)&&H!==-1;H--,Z++)N+=256*z[H]>>>0,z[H]=N%c>>>0,N=N/c>>>0;if(N!==0)throw new Error("Non-zero carry");I=Z,k++}for(var de=L-I;de!==L&&z[de]===0;)de++;for(var nt=u.repeat(x);de<L;++de)nt+=t.charAt(z[de]);return nt}function g(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;var x=0;if(v[x]!==" "){for(var I=0,k=0;v[x]===u;)I++,x++;for(var B=(v.length-x)*f+1>>>0,L=new Uint8Array(B);v[x];){var z=r[v.charCodeAt(x)];if(z===255)return;for(var N=0,Z=B-1;(z!==0||N<k)&&Z!==-1;Z--,N++)z+=c*L[Z]>>>0,L[Z]=z%256>>>0,z=z/256>>>0;if(z!==0)throw new Error("Non-zero carry");k=N,x++}if(v[x]!==" "){for(var H=B-k;H!==B&&L[H]===0;)H++;for(var de=new Uint8Array(I+(B-H)),nt=I;H!==B;)de[nt++]=L[H++];return de}}}function b(v){var x=g(v);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:g,decode:b}}var XD=WD,QD=XD,$g=QD;var Zn=class{name;prefix;baseEncode;constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Yn=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,o){this.name=e,this.prefix=r;let i=r.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mg(this,e)}},ea=class{decoders;constructor(e){this.decoders=e}or(e){return Mg(this,e)}decode(e){let r=e[0],o=this.decoders[r];if(o!=null)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Mg(t,e){return new ea({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var ta=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,o,i){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=i,this.encoder=new Zn(e,r,o),this.decoder=new Yn(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Vg({name:t,prefix:e,encode:r,decode:o}){return new ta(t,e,r,o)}function gr({name:t,prefix:e,alphabet:r}){let{encode:o,decode:i}=$g(r,t);return Vg({prefix:e,name:t,encode:o,decode:s=>yr(i(s))})}function ZD(t,e,r,o){let i=t.length;for(;t[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),a=0,c=0,u=0;for(let f=0;f<i;++f){let m=e[t[f]];if(m===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|m,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||(255&c<<8-a)!==0)throw new SyntaxError("Unexpected end of data");return s}function YD(t,e,r){let o=e[e.length-1]==="=",i=(1<<r)-1,s="",a=0,c=0;for(let u=0;u<t.length;++u)for(c=c<<8|t[u],a+=8;a>r;)a-=r,s+=e[i&c>>a];if(a!==0&&(s+=e[i&c<<r-a]),o)for(;(s.length*r&7)!==0;)s+="=";return s}function eT(t){let e={};for(let r=0;r<t.length;++r)e[t[r]]=r;return e}function se({name:t,prefix:e,bitsPerChar:r,alphabet:o}){let i=eT(o);return Vg({prefix:e,name:t,encode(s){return YD(s,o,r)},decode(s){return ZD(s,i,r,t)}})}var di=se({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Og=se({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ke=se({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),zg=se({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ra=t=>t!==void 0,Ug=t=>(e,r)=>{let o=t.indexOf(e),i=t.indexOf(r);return o===i?0:o===-1?1:i===-1?-1:o-i};function Gg(t){return t==null?e=>!0:Array.isArray(t)?e=>t.includes(e):e=>e===t}var Me=(t,e)=>function(){let r=t.call(this);return Object.defineProperty(this,t.name,{get:()=>r,enumerable:!0,configurable:!0}),r},tT=new TextDecoder;function oa(t){let e=ke.baseDecode(t),r=tT.decode(e);return JSON.parse(r)}var ia=(t,e)=>{let r;for(let o=0;o<t.length;o++)if(r=t.charCodeAt(o),!(65<=r&&r<=90||97<=r&&r<=122||48<=r&&r<=57||r===45||r===95||r===46)){let i=String.fromCodePoint(t.codePointAt(o));return e.addIssue({code:y.custom,message:`Invalid character "${i}" in JWT at position ${o}`})}},sa=(t,e=2)=>{if(!Number.isFinite(t)||t<1||(t|0)!==t)throw new TypeError(`Count must be a natural number (got ${t})`);let r=t*e+(t-1),o="Invalid JWT format";return(i,s)=>{if(i.length<r)return s.addIssue({code:y.custom,message:`${o}: too short`}),!1;let a=0;for(let c=0;c<t-1;c++){let u=i.indexOf(".",a);if(u===-1)return s.addIssue({code:y.custom,message:`${o}: expected ${t} segments, got ${c+1}`}),!1;if(u-a<e)return s.addIssue({code:y.custom,message:`${o}: segment ${c+1} is too short`}),!1;a=u+1}return i.indexOf(".",a)!==-1?(s.addIssue({code:y.custom,message:`${o}: too many segments`}),!1):i.length-a<e?(s.addIssue({code:y.custom,message:`${o}: last segment is too short`}),!1):!0}};function Fg(t,e,r){return r.indexOf(t,e+1)===-1}var oo=["verify","encrypt","wrapKey"],QO=n.enum(oo);function li(t){return oo.includes(t)}function io(t){return t==="verify"}function so(t){return t==="encrypt"||t==="wrapKey"}var na=["sign","decrypt","unwrapKey","deriveKey","deriveBits"],ZO=n.enum(na);function rT(t){return na.includes(t)}var oT=[...na,...oo],iT=n.enum(oT),no=n.object({kty:n.string().min(1),alg:n.string().min(1).optional(),kid:n.string().min(1).optional(),use:n.enum(["sig","enc"]).optional(),key_ops:n.array(iT).min(1,{message:"At least one key usage must be specified"}).refine(t=>t.every(Fg),{message:"key_ops must not contain duplicates"}).optional(),x5c:n.array(n.string()).optional(),x5t:n.string().min(1).optional(),"x5t#S256":n.string().min(1).optional(),x5u:n.string().url().optional(),ext:n.boolean().optional(),iat:n.number().int().optional(),exp:n.number().int().optional(),nbf:n.number().int().optional(),revoked:n.object({revoked_at:n.number().int(),reason:n.string().optional()}).optional()}),sT=no.extend({kty:n.literal("RSA"),alg:n.enum(["RS256","RS384","RS512","PS256","PS384","PS512"]).optional(),n:n.string().min(1),e:n.string().min(1),d:n.string().min(1).optional(),p:n.string().min(1).optional(),q:n.string().min(1).optional(),dp:n.string().min(1).optional(),dq:n.string().min(1).optional(),qi:n.string().min(1).optional(),oth:n.array(n.object({r:n.string().optional(),d:n.string().optional(),t:n.string().optional()})).min(1).optional()}),nT=no.extend({kty:n.literal("EC"),alg:n.enum(["ES256","ES384","ES512"]).optional(),crv:n.enum(["P-256","P-384","P-521"]),x:n.string().min(1),y:n.string().min(1),d:n.string().min(1).optional()}),aT=no.extend({kty:n.literal("EC"),alg:n.enum(["ES256K"]).optional(),crv:n.enum(["secp256k1"]),x:n.string().min(1),y:n.string().min(1),d:n.string().min(1).optional()}),pT=no.extend({kty:n.literal("OKP"),alg:n.enum(["EdDSA"]).optional(),crv:n.enum(["Ed25519","Ed448"]),x:n.string().min(1),d:n.string().min(1).optional()}),cT=no.extend({kty:n.literal("oct"),alg:n.enum(["HS256","HS384","HS512"]).optional(),k:n.string()}),Ve=n.union([sT,nT,aT,pT,cT]).refine(t=>t.use==null||Kg(t),{message:'"use" can only be used with public keys',path:["use"]}).refine(t=>!t.key_ops?.some(rT)||vr(t),{message:"private key usage not allowed for public keys",path:["key_ops"]}).refine(t=>t.use==null||t.key_ops==null||t.use==="sig"&&t.key_ops.every(io)||t.use==="enc"&&t.key_ops.every(so),{message:'"key_ops" must be consistent with "use"',path:["key_ops"]});var br=Ve.refine(dT,{message:'"kid" is required',path:["kid"]}).refine(Kg,{message:"private key not allowed"}).refine(t=>!t.key_ops||t.key_ops.every(li),{message:'"key_ops" must not contain private key usage for public keys',path:["key_ops"]}),YO=Ve.refine(vr,{message:"private key required"});function dT(t){return"kid"in t&&t.kid!=null}function ui(t){return"k"in t&&t.k!=null}function Ng(t){return"d"in t&&t.d!=null}function vr(t){return Ng(t)||ui(t)}function Kg(t){return!Ng(t)&&!ui(t)}var{process:Hg}=globalThis,Jg=typeof Hg<"u"&&typeof Hg?.versions?.node=="string";function*Wg(t){if(typeof t.alg=="string"){yield t.alg;return}switch(t.kty){case"EC":{if(aa(t)&&(yield"ECDH-ES",yield"ECDH-ES+A128KW",yield"ECDH-ES+A192KW",yield"ECDH-ES+A256KW"),pa(t)){let e="crv"in t?t.crv:void 0;switch(e){case"P-256":case"P-384":yield`ES${e.slice(-3)}`;break;case"P-521":yield"ES512";break;case"secp256k1":Jg&&(yield"ES256K");break;default:throw new J(`Unsupported crv "${e}"`)}}return}case"OKP":{if(!t.use)throw new J('Missing "use" Parameter value');yield"ECDH-ES",yield"ECDH-ES+A128KW",yield"ECDH-ES+A192KW",yield"ECDH-ES+A256KW";return}case"RSA":{aa(t)&&(yield"RSA-OAEP",yield"RSA-OAEP-256",yield"RSA-OAEP-384",yield"RSA-OAEP-512",Jg&&(yield"RSA1_5")),pa(t)&&(yield"PS256",yield"PS384",yield"PS512",yield"RS256",yield"RS384",yield"RS512");return}case"oct":{aa(t)&&(yield"A128GCMKW",yield"A192GCMKW",yield"A256GCMKW",yield"A128KW",yield"A192KW",yield"A256KW"),pa(t)&&(yield"HS256",yield"HS384",yield"HS512");return}default:throw new J(`Unsupported kty "${t.kty}"`)}}function aa(t){return t.key_ops?.some(so)??(t.use==null||t.use==="enc")}function pa(t){return t.key_ops?.some(io)??(t.use==null||t.use==="sig")}var nz=n.object({keys:n.array(n.unknown()).transform(t=>t.map(e=>Ve.safeParse(e)).filter(e=>e.success).map(e=>e.data))}),Xg=n.object({keys:n.array(n.unknown()).transform(t=>t.map(e=>br.safeParse(e)).filter(e=>e.success).map(e=>e.data))});var lt=n.string().superRefine(ia).superRefine(sa(3));var Qg=n.string().superRefine(ia).superRefine(sa(2));var fi=n.object({alg:n.string(),jku:n.string().url().optional(),jwk:n.object({kty:n.string(),crv:n.string().optional(),x:n.string().optional(),y:n.string().optional(),e:n.string().optional(),n:n.string().optional()}).optional(),kid:n.string().optional(),x5u:n.string().optional(),x5c:n.array(n.string()).optional(),x5t:n.string().optional(),"x5t#S256":n.string().optional(),typ:n.string().optional(),cty:n.string().optional(),crit:n.array(n.string()).optional()}).passthrough(),lT=n.string().superRefine((t,e)=>{try{let r=new URL(t);r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:n.ZodIssueCode.custom,message:"Only http: and https: protocols are allowed"}),(r.username||r.password)&&e.addIssue({code:n.ZodIssueCode.custom,message:"Credentials not allowed"}),r.search&&e.addIssue({code:n.ZodIssueCode.custom,message:"Query string not allowed"}),r.hash&&e.addIssue({code:n.ZodIssueCode.custom,message:"Fragment not allowed"})}catch{e.addIssue({code:n.ZodIssueCode.invalid_string,validation:"url"})}return t}),mi=n.object({iss:n.string().optional(),aud:n.union([n.string(),n.array(n.string()).nonempty()]).optional(),sub:n.string().optional(),exp:n.number().int().optional(),nbf:n.number().int().optional(),iat:n.number().int().optional(),jti:n.string().optional(),htm:n.string().optional(),htu:lT.optional(),ath:n.string().optional(),acr:n.string().optional(),azp:n.string().optional(),amr:n.array(n.string()).optional(),cnf:n.object({kid:n.string().optional(),jwk:br.optional(),jwe:n.string().optional(),jku:n.string().url().optional(),jkt:n.string().optional(),"x5t#S256":n.string().optional(),osc:n.string().optional()}).optional(),client_id:n.string().optional(),scope:n.string().optional(),nonce:n.string().optional(),at_hash:n.string().optional(),c_hash:n.string().optional(),s_hash:n.string().optional(),auth_time:n.number().int().optional(),name:n.string().optional(),family_name:n.string().optional(),given_name:n.string().optional(),middle_name:n.string().optional(),nickname:n.string().optional(),preferred_username:n.string().optional(),gender:n.string().optional(),picture:n.string().url().optional(),profile:n.string().url().optional(),website:n.string().url().optional(),birthdate:n.string().regex(/\d{4}-\d{2}-\d{2}/).optional(),zoneinfo:n.string().regex(/^[A-Za-z0-9_/]+$/).optional(),locale:n.string().regex(/^[a-z]{2,3}(-[A-Z]{2})?$/).optional(),updated_at:n.number().int().optional(),email:n.string().optional(),email_verified:n.boolean().optional(),phone_number:n.string().optional(),phone_number_verified:n.boolean().optional(),address:n.object({formatted:n.string().optional(),street_address:n.string().optional(),locality:n.string().optional(),region:n.string().optional(),postal_code:n.string().optional(),country:n.string().optional()}).optional(),authorization_details:n.array(n.object({type:n.string(),locations:n.array(n.string()).optional(),actions:n.array(n.string()).optional(),datatypes:n.array(n.string()).optional(),identifier:n.string().optional(),privileges:n.array(n.string()).optional()}).passthrough()).optional()}).passthrough();function Zg(t){let{0:e,1:r,length:o}=t.split(".");if(o>3||o<2)throw new ue(void 0,hr);let i=fi.parse(oa(e));if(o===2&&i?.alg!=="none")throw new ue(void 0,hr);let s=mi.parse(oa(r));return{header:i,payload:s}}var uT=function(t,e,r){for(var o=arguments.length>2,i=0;i<e.length;i++)r=o?e[i].call(t,r):e[i].call(t);return o?r:void 0},ao=function(t,e,r,o,i,s){function a(k){if(k!==void 0&&typeof k!="function")throw new TypeError("Function expected");return k}for(var c=o.kind,u=c==="getter"?"get":c==="setter"?"set":"value",f=!e&&t?o.static?t:t.prototype:null,m=e||(f?Object.getOwnPropertyDescriptor(f,o.name):{}),h,g=!1,b=r.length-1;b>=0;b--){var v={};for(var x in o)v[x]=x==="access"?{}:o[x];for(var x in o.access)v.access[x]=o.access[x];v.addInitializer=function(k){if(g)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(k||null))};var I=(0,r[b])(c==="accessor"?{get:m.get,set:m.set}:m[u],v);if(c==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(h=a(I.get))&&(m.get=h),(h=a(I.set))&&(m.set=h),(h=a(I.init))&&i.unshift(h)}else(h=a(I))&&(c==="field"?i.unshift(h):m[u]=h)}f&&Object.defineProperty(f,o.name,m),g=!0},ca=(()=>{let t=[],e,r,o,i,s;return class{static{let c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Me],r=[Me],o=[Me],i=[Me],s=[Me],ao(this,null,e,{kind:"getter",name:"isPrivate",static:!1,private:!1,access:{has:u=>"isPrivate"in u,get:u=>u.isPrivate},metadata:c},null,t),ao(this,null,r,{kind:"getter",name:"isSymetric",static:!1,private:!1,access:{has:u=>"isSymetric"in u,get:u=>u.isSymetric},metadata:c},null,t),ao(this,null,o,{kind:"getter",name:"publicJwk",static:!1,private:!1,access:{has:u=>"publicJwk"in u,get:u=>u.publicJwk},metadata:c},null,t),ao(this,null,i,{kind:"getter",name:"bareJwk",static:!1,private:!1,access:{has:u=>"bareJwk"in u,get:u=>u.bareJwk},metadata:c},null,t),ao(this,null,s,{kind:"getter",name:"algorithms",static:!1,private:!1,access:{has:u=>"algorithms"in u,get:u=>u.algorithms},metadata:c},null,t),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}constructor(c){this.jwk=(uT(this,t),c)}get isPrivate(){return vr(this.jwk)}get isSymetric(){return ui(this.jwk)}get privateJwk(){if(this.isPrivate)return this.jwk}get publicJwk(){if(this.isSymetric)return;if(!this.isPrivate)return this.jwk;let c=br.safeParse({...this.jwk,d:void 0,k:void 0,use:void 0,key_ops:fT(this.keyOps)??oo});if(c.success)return Object.freeze(c.data)}get bareJwk(){if(this.isSymetric)return;let{kty:c,crv:u,e:f,n:m,x:h,y:g}=this.jwk;return Object.freeze(Ve.parse({crv:u,e:f,kty:c,n:m,x:h,y:g}))}get use(){return this.jwk.use}get keyOps(){return this.jwk.key_ops}get alg(){return this.jwk.alg}get kid(){return this.jwk.kid}get crv(){return this.jwk.crv}get algorithms(){return Object.freeze(Array.from(Wg(this.jwk)))}get isRevoked(){return this.jwk.revoked!=null}isActive(c){if(!c?.allowRevoked&&this.isRevoked)return!1;let u=c?.clockTolerance??0;if(u!==1/0){let f=c?.currentDate?.getTime()??Date.now(),{exp:m,nbf:h}=this.jwk;if(h!=null&&!(f>=h*1e3-u)||m!=null&&!(f<m*1e3+u))return!1}return!0}matches(c){return!(c.kid!=null&&!(Array.isArray(c.kid)?this.kid!=null&&c.kid.includes(this.kid):this.kid===c.kid)||c.alg!=null&&!(Array.isArray(c.alg)?c.alg.some(f=>this.algorithms.includes(f)):this.algorithms.includes(c.alg))||c.usage!=null&&(!(this.keyOps==null||this.keyOps.includes(c.usage)||c.usage==="verify"&&this.keyOps.includes("sign")||c.usage==="encrypt"&&this.keyOps.includes("decrypt")||c.usage==="wrapKey"&&this.keyOps.includes("unwrapKey"))||!(this.use==null||this.use==="sig"&&io(c.usage)||this.use==="enc"&&so(c.usage))||!(this.isPrivate||li(c.usage))))}}})();function fT(t){if(t==null)return;let e=new Set(t.filter(li));return t.includes("sign")&&e.add("verify"),t.includes("decrypt")&&e.add("encrypt"),t.includes("unwrapKey")&&e.add("wrapKey"),Array.from(e)}var mT=function(t,e,r){for(var o=arguments.length>2,i=0;i<e.length;i++)r=o?e[i].call(t,r):e[i].call(t);return o?r:void 0},da=function(t,e,r,o,i,s){function a(k){if(k!==void 0&&typeof k!="function")throw new TypeError("Function expected");return k}for(var c=o.kind,u=c==="getter"?"get":c==="setter"?"set":"value",f=!e&&t?o.static?t:t.prototype:null,m=e||(f?Object.getOwnPropertyDescriptor(f,o.name):{}),h,g=!1,b=r.length-1;b>=0;b--){var v={};for(var x in o)v[x]=x==="access"?{}:o[x];for(var x in o.access)v.access[x]=o.access[x];v.addInitializer=function(k){if(g)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(k||null))};var I=(0,r[b])(c==="accessor"?{get:m.get,set:m.set}:m[u],v);if(c==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(h=a(I.get))&&(m.get=h),(h=a(I.set))&&(m.set=h),(h=a(I.init))&&i.unshift(h)}else(h=a(I))&&(c==="field"?i.unshift(h):m[u]=h)}f&&Object.defineProperty(f,o.name,m),g=!0},hT=t=>t.privateJwk,yT=t=>t.publicJwk,la=(()=>{let t=[],e,r,o;return class Yg{static{let s=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;da(this,null,e,{kind:"getter",name:"signAlgorithms",static:!1,private:!1,access:{has:a=>"signAlgorithms"in a,get:a=>a.signAlgorithms},metadata:s},null,t),da(this,null,r,{kind:"getter",name:"publicJwks",static:!1,private:!1,access:{has:a=>"publicJwks"in a,get:a=>a.publicJwks},metadata:s},null,t),da(this,null,o,{kind:"getter",name:"privateJwks",static:!1,private:!1,access:{has:a=>"privateJwks"in a,get:a=>a.privateJwks},metadata:s},null,t),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}constructor(s,a=s instanceof Yg?[...s.preferredSigningAlgorithms]:["EdDSA","ES256K","ES256","PS256","PS384","PS512","HS256","HS384","HS512"]){this.preferredSigningAlgorithms=(mT(this,t),a);let c=[],u=new Set;for(let f of s)if(f&&(c.push(f),f.kid)){if(u.has(f.kid))throw new J(`Duplicate key: ${f.kid}`);u.add(f.kid)}this.keys=Object.freeze(c)}get size(){return this.keys.length}get signAlgorithms(){let s=new Set;for(let a of this)if(a.use==="sig")for(let c of a.algorithms)s.add(c);return Object.freeze([...s].sort(Ug(this.preferredSigningAlgorithms)))}get publicJwks(){return Object.freeze({keys:Object.freeze(Array.from(this,yT).filter(ra))})}get privateJwks(){return Object.freeze({keys:Object.freeze(Array.from(this,hT).filter(ra))})}has(s){return this.keys.some(a=>a.kid===s)}get(s){let a=this.find(s);if(a)return a;throw new J(`Key not found ${s.kid??s.alg??s.usage??"<unknown>"}`,Qn)}find(s){for(let a of this.list(s))return a}*list(s){for(let a of this)a.isActive(s)&&a.matches(s)&&(yield a)}findPrivateKey({kid:s,alg:a,usage:c,...u}){let f=[];Array.isArray(a)&&a.length===1&&(a=a[0]);for(let g of this.list({...u,kid:s,alg:a,usage:c})){if(typeof a=="string")return{key:g,alg:a};f.push(g)}let m=Gg(a),h=f.map(g=>[g,g.algorithms.filter(m)]);for(let g of this.preferredSigningAlgorithms)for(let[b,v]of h)if(v.includes(g))return{key:b,alg:g};for(let[g,b]of h)for(let v of b)return{key:g,alg:v};throw new J(`No private key found for ${s||a||c}`,Qn)}[(e=[Me],r=[Me],o=[Me],Symbol.iterator)](){return this.keys.values()}async createJwt({alg:s,kid:a,...c},u){try{let{key:f,alg:m}=this.findPrivateKey({alg:s,kid:a,usage:"sign",allowRevoked:!1}),h={...c,alg:m,kid:f.kid};return typeof u=="function"&&(u=await u(h,f)),await f.createJwt(h,u)}catch(f){throw et.from(f)}}async verifyJwt(s,a){let{header:c}=Zg(s),{kid:u,alg:f}=c,m=[];for(let h of this.list({...a,kid:u,alg:f,usage:"verify"}))try{return{...await h.verifyJwt(s,a),key:h}}catch(g){m.push(g)}switch(m.length){case 0:throw new ue("No key matched",Bg);case 1:throw ue.from(m[0],hr);default:throw ue.from(m,hr)}}toJSON(){return structuredClone(this.publicJwks)}}})();var fe=crypto,Ft=t=>t instanceof CryptoKey;var me=new TextEncoder,De=new TextDecoder,Lz=2**32;function hi(...t){let e=t.reduce((i,{length:s})=>i+s,0),r=new Uint8Array(e),o=0;for(let i of t)r.set(i,o),o+=i.length;return r}var gT=t=>{let e=t;typeof e=="string"&&(e=me.encode(e));let r=32768,o=[];for(let i=0;i<e.length;i+=r)o.push(String.fromCharCode.apply(null,e.subarray(i,i+r)));return btoa(o.join(""))},xr=t=>gT(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),bT=t=>{let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r},Oe=t=>{let e=t;e instanceof Uint8Array&&(e=De.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return bT(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var Ai={};Ct(Ai,{JOSEAlgNotAllowed:()=>wr,JOSEError:()=>ee,JOSENotSupported:()=>W,JWEDecryptionFailed:()=>yi,JWEInvalid:()=>gi,JWKInvalid:()=>bi,JWKSInvalid:()=>vi,JWKSMultipleMatchingKeys:()=>wi,JWKSNoMatchingKey:()=>xi,JWKSTimeout:()=>ki,JWSInvalid:()=>G,JWSSignatureVerificationFailed:()=>kr,JWTClaimValidationFailed:()=>ne,JWTExpired:()=>Nt,JWTInvalid:()=>ze});var ee=class extends Error{constructor(e,r){super(e,r),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};ee.code="ERR_JOSE_GENERIC";var ne=class extends ee{constructor(e,r,o="unspecified",i="unspecified"){super(e,{cause:{claim:o,reason:i,payload:r}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=o,this.reason=i,this.payload=r}};ne.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var Nt=class extends ee{constructor(e,r,o="unspecified",i="unspecified"){super(e,{cause:{claim:o,reason:i,payload:r}}),this.code="ERR_JWT_EXPIRED",this.claim=o,this.reason=i,this.payload=r}};Nt.code="ERR_JWT_EXPIRED";var wr=class extends ee{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};wr.code="ERR_JOSE_ALG_NOT_ALLOWED";var W=class extends ee{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};W.code="ERR_JOSE_NOT_SUPPORTED";var yi=class extends ee{constructor(e="decryption operation failed",r){super(e,r),this.code="ERR_JWE_DECRYPTION_FAILED"}};yi.code="ERR_JWE_DECRYPTION_FAILED";var gi=class extends ee{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};gi.code="ERR_JWE_INVALID";var G=class extends ee{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};G.code="ERR_JWS_INVALID";var ze=class extends ee{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};ze.code="ERR_JWT_INVALID";var bi=class extends ee{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};bi.code="ERR_JWK_INVALID";var vi=class extends ee{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};vi.code="ERR_JWKS_INVALID";var xi=class extends ee{constructor(e="no applicable key found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_NO_MATCHING_KEY"}};xi.code="ERR_JWKS_NO_MATCHING_KEY";var wi=class extends ee{constructor(e="multiple matching keys found in the JSON Web Key Set",r){super(e,r),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};wi.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var ki=class extends ee{constructor(e="request timed out",r){super(e,r),this.code="ERR_JWKS_TIMEOUT"}};ki.code="ERR_JWKS_TIMEOUT";var kr=class extends ee{constructor(e="signature verification failed",r){super(e,r),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};kr.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function Ue(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function po(t,e){return t.name===e}function ua(t){return parseInt(t.name.slice(4),10)}function vT(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function xT(t,e){if(e.length&&!e.some(r=>t.usages.includes(r))){let r="CryptoKey does not support this operation, its usages must include ";if(e.length>2){let o=e.pop();r+=`one of ${e.join(", ")}, or ${o}.`}else e.length===2?r+=`one of ${e[0]} or ${e[1]}.`:r+=`${e[0]}.`;throw new TypeError(r)}}function eb(t,e,...r){switch(e){case"HS256":case"HS384":case"HS512":{if(!po(t.algorithm,"HMAC"))throw Ue("HMAC");let o=parseInt(e.slice(2),10);if(ua(t.algorithm.hash)!==o)throw Ue(`SHA-${o}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!po(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Ue("RSASSA-PKCS1-v1_5");let o=parseInt(e.slice(2),10);if(ua(t.algorithm.hash)!==o)throw Ue(`SHA-${o}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!po(t.algorithm,"RSA-PSS"))throw Ue("RSA-PSS");let o=parseInt(e.slice(2),10);if(ua(t.algorithm.hash)!==o)throw Ue(`SHA-${o}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448")throw Ue("Ed25519 or Ed448");break}case"Ed25519":{if(!po(t.algorithm,"Ed25519"))throw Ue("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!po(t.algorithm,"ECDSA"))throw Ue("ECDSA");let o=vT(e);if(t.algorithm.namedCurve!==o)throw Ue(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}xT(t,r)}function tb(t,e,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();t+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?t+=`one of type ${r[0]} or ${r[1]}.`:t+=`of type ${r[0]}.`;return e==null?t+=` Received ${e}`:typeof e=="function"&&e.name?t+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(t+=` Received an instance of ${e.constructor.name}`),t}var co=(t,...e)=>tb("Key must be ",t,...e);function fa(t,e,...r){return tb(`Key for the ${t} algorithm must be `,e,...r)}var ma=t=>Ft(t)?!0:t?.[Symbol.toStringTag]==="KeyObject",ut=["CryptoKey"];var wT=(...t)=>{let e=t.filter(Boolean);if(e.length===0||e.length===1)return!0;let r;for(let o of e){let i=Object.keys(o);if(!r||r.size===0){r=new Set(i);continue}for(let s of i){if(r.has(s))return!1;r.add(s)}}return!0},Si=wT;function kT(t){return typeof t=="object"&&t!==null}function Ae(t){if(!kT(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var Ri=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){let{modulusLength:r}=e.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}};function tt(t){return Ae(t)&&typeof t.kty=="string"}function rb(t){return t.kty!=="oct"&&typeof t.d=="string"}function ob(t){return t.kty!=="oct"&&typeof t.d>"u"}function ib(t){return tt(t)&&t.kty==="oct"&&typeof t.k=="string"}function ST(t){let e,r;switch(t.kty){case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},r=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},r=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},r=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},r=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},r=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":e={name:"Ed25519"},r=t.d?["sign"]:["verify"];break;case"EdDSA":e={name:t.crv},r=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},r=t.d?["deriveBits"]:[];break;default:throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new W('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:r}}var RT=async t=>{if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:e,keyUsages:r}=ST(t),o=[e,t.ext??!1,t.key_ops??r],i={...t};return delete i.alg,delete i.use,fe.subtle.importKey("jwk",i,...o)},Ci=RT;var sb=t=>Oe(t),Ar,Sr,nb=t=>t?.[Symbol.toStringTag]==="KeyObject",_i=async(t,e,r,o,i=!1)=>{let s=t.get(e);if(s?.[o])return s[o];let a=await Ci({...r,alg:o});return i&&Object.freeze(e),s?s[o]=a:t.set(e,{[o]:a}),a},CT=(t,e)=>{if(nb(t)){let r=t.export({format:"jwk"});return delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k?sb(r.k):(Sr||(Sr=new WeakMap),_i(Sr,t,r,e))}return tt(t)?t.k?Oe(t.k):(Sr||(Sr=new WeakMap),_i(Sr,t,t,e,!0)):t},_T=(t,e)=>{if(nb(t)){let r=t.export({format:"jwk"});return r.k?sb(r.k):(Ar||(Ar=new WeakMap),_i(Ar,t,r,e))}return tt(t)?t.k?Oe(t.k):(Ar||(Ar=new WeakMap),_i(Ar,t,t,e,!0)):t},ha={normalizePublicKey:CT,normalizePrivateKey:_T};var ft=(t,e,r=0)=>{r===0&&(e.unshift(e.length),e.unshift(6));let o=t.indexOf(e[0],r);if(o===-1)return!1;let i=t.subarray(o,o+e.length);return i.length!==e.length?!1:i.every((s,a)=>s===e[a])||ft(t,e,o+1)},ab=t=>{switch(!0){case ft(t,[42,134,72,206,61,3,1,7]):return"P-256";case ft(t,[43,129,4,0,34]):return"P-384";case ft(t,[43,129,4,0,35]):return"P-521";case ft(t,[43,101,110]):return"X25519";case ft(t,[43,101,111]):return"X448";case ft(t,[43,101,112]):return"Ed25519";case ft(t,[43,101,113]):return"Ed448";default:throw new W("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},ET=async(t,e,r,o,i)=>{let s,a,c=new Uint8Array(atob(r.replace(t,"")).split("").map(f=>f.charCodeAt(0))),u=e==="spki";switch(o){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${o.slice(-3)}`},a=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${o.slice(-3)}`},a=u?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(o.slice(-3),10)||1}`},a=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=u?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=u?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let f=ab(c);s=f.startsWith("P-")?{name:"ECDH",namedCurve:f}:{name:f},a=u?[]:["deriveBits"];break}case"Ed25519":s={name:"Ed25519"},a=u?["verify"]:["sign"];break;case"EdDSA":s={name:ab(c)},a=u?["verify"]:["sign"];break;default:throw new W('Invalid or unsupported "alg" (Algorithm) value')}return fe.subtle.importKey(e,c,s,i?.extractable??!1,a)},pb=(t,e,r)=>ET(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",t,e,r);async function ya(t,e,r){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return pb(t,e,r)}async function lo(t,e){if(!Ae(t))throw new TypeError("JWK must be an object");switch(e||(e=t.alg),t.kty){case"oct":if(typeof t.k!="string"||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Oe(t.k);case"RSA":if("oth"in t&&t.oth!==void 0)throw new W('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Ci({...t,alg:e});default:throw new W('Unsupported "kty" (Key Type) Parameter value')}}var Rr=t=>t?.[Symbol.toStringTag],ga=(t,e,r)=>{if(e.use!==void 0&&e.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(e.key_ops!==void 0&&e.key_ops.includes?.(r)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(e.alg!==void 0&&e.alg!==t)throw new TypeError(`Invalid key for this operation, when present its alg must be ${t}`);return!0},IT=(t,e,r,o)=>{if(!(e instanceof Uint8Array)){if(o&&tt(e)){if(ib(e)&&ga(t,e,r))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ma(e))throw new TypeError(fa(t,e,...ut,"Uint8Array",o?"JSON Web Key":null));if(e.type!=="secret")throw new TypeError(`${Rr(e)} instances for symmetric algorithms must be of type "secret"`)}},DT=(t,e,r,o)=>{if(o&&tt(e))switch(r){case"sign":if(rb(e)&&ga(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(ob(e)&&ga(t,e,r))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!ma(e))throw new TypeError(fa(t,e,...ut,o?"JSON Web Key":null));if(e.type==="secret")throw new TypeError(`${Rr(e)} instances for asymmetric algorithms must not be of type "secret"`);if(r==="sign"&&e.type==="public")throw new TypeError(`${Rr(e)} instances for asymmetric algorithm signing must be of type "private"`);if(r==="decrypt"&&e.type==="public")throw new TypeError(`${Rr(e)} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&r==="verify"&&e.type==="private")throw new TypeError(`${Rr(e)} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&r==="encrypt"&&e.type==="private")throw new TypeError(`${Rr(e)} instances for asymmetric algorithm encryption must be of type "public"`)};function cb(t,e,r,o){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?IT(e,r,o,t):DT(e,r,o,t)}var mU=cb.bind(void 0,!1),uo=cb.bind(void 0,!0);function TT(t,e,r,o,i){if(i.crit!==void 0&&o?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;r!==void 0?s=new Map([...Object.entries(r),...e.entries()]):s=e;for(let a of o.crit){if(!s.has(a))throw new W(`Extension Header Parameter "${a}" is not recognized`);if(i[a]===void 0)throw new t(`Extension Header Parameter "${a}" is missing`);if(s.get(a)&&o[a]===void 0)throw new t(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var Ei=TT;var PT=(t,e)=>{if(e!==void 0&&(!Array.isArray(e)||e.some(r=>typeof r!="string")))throw new TypeError(`"${t}" option must be an array of strings`);if(e)return new Set(e)},db=PT;var jT=async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:xr(t)};if(!Ft(t))throw new TypeError(co(t,...ut,"Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:e,key_ops:r,alg:o,use:i,...s}=await fe.subtle.exportKey("jwk",t);return s},lb=jT;async function ba(t){return lb(t)}function fo(t,e){let r=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new W(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}async function mo(t,e,r){if(r==="sign"&&(e=await ha.normalizePrivateKey(e,t)),r==="verify"&&(e=await ha.normalizePublicKey(e,t)),Ft(e))return eb(e,t,r),e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(co(e,...ut));return fe.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(co(e,...ut,"Uint8Array","JSON Web Key"))}var qT=async(t,e,r,o)=>{let i=await mo(t,e,"verify");Ri(t,i);let s=fo(t,i.algorithm);try{return await fe.subtle.verify(s,i,r,o)}catch{return!1}},ub=qT;async function fb(t,e,r){if(!Ae(t))throw new G("Flattened JWS must be an object");if(t.protected===void 0&&t.header===void 0)throw new G('Flattened JWS must have either of the "protected" or "header" members');if(t.protected!==void 0&&typeof t.protected!="string")throw new G("JWS Protected Header incorrect type");if(t.payload===void 0)throw new G("JWS Payload missing");if(typeof t.signature!="string")throw new G("JWS Signature missing or incorrect type");if(t.header!==void 0&&!Ae(t.header))throw new G("JWS Unprotected Header incorrect type");let o={};if(t.protected)try{let x=Oe(t.protected);o=JSON.parse(De.decode(x))}catch{throw new G("JWS Protected Header is invalid")}if(!Si(o,t.header))throw new G("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...o,...t.header},s=Ei(G,new Map([["b64",!0]]),r?.crit,o,i),a=!0;if(s.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new G('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:c}=i;if(typeof c!="string"||!c)throw new G('JWS "alg" (Algorithm) Header Parameter missing or invalid');let u=r&&db("algorithms",r.algorithms);if(u&&!u.has(c))throw new wr('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof t.payload!="string")throw new G("JWS Payload must be a string")}else if(typeof t.payload!="string"&&!(t.payload instanceof Uint8Array))throw new G("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof e=="function"?(e=await e(o,t),f=!0,uo(c,e,"verify"),tt(e)&&(e=await lo(e,c))):uo(c,e,"verify");let m=hi(me.encode(t.protected??""),me.encode("."),typeof t.payload=="string"?me.encode(t.payload):t.payload),h;try{h=Oe(t.signature)}catch{throw new G("Failed to base64url decode the signature")}if(!await ub(c,e,h,m))throw new kr;let b;if(a)try{b=Oe(t.payload)}catch{throw new G("Failed to base64url decode the payload")}else typeof t.payload=="string"?b=me.encode(t.payload):b=t.payload;let v={payload:b};return t.protected!==void 0&&(v.protectedHeader=o),t.header!==void 0&&(v.unprotectedHeader=t.header),f?{...v,key:e}:v}async function mb(t,e,r){if(t instanceof Uint8Array&&(t=De.decode(t)),typeof t!="string")throw new G("Compact JWS must be a string or Uint8Array");let{0:o,1:i,2:s,length:a}=t.split(".");if(a!==3)throw new G("Invalid Compact JWS");let c=await fb({payload:i,protected:o,signature:s},e,r),u={payload:c.payload,protectedHeader:c.protectedHeader};return typeof e=="function"?{...u,key:c.key}:u}var Ge=t=>Math.floor(t.getTime()/1e3);var BT=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Kt=t=>{let e=BT.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");let r=parseFloat(e[2]),o=e[3].toLowerCase(),i;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(r*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(r*3600);break;case"day":case"days":case"d":i=Math.round(r*86400);break;case"week":case"weeks":case"w":i=Math.round(r*604800);break;default:i=Math.round(r*31557600);break}return e[1]==="-"||e[4]==="ago"?-i:i};var hb=t=>t.toLowerCase().replace(/^application\//,""),LT=(t,e)=>typeof t=="string"?e.includes(t):Array.isArray(t)?e.some(Set.prototype.has.bind(new Set(t))):!1,yb=(t,e,r={})=>{let o;try{o=JSON.parse(De.decode(e))}catch{}if(!Ae(o))throw new ze("JWT Claims Set must be a top-level JSON object");let{typ:i}=r;if(i&&(typeof t.typ!="string"||hb(t.typ)!==hb(i)))throw new ne('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:s=[],issuer:a,subject:c,audience:u,maxTokenAge:f}=r,m=[...s];f!==void 0&&m.push("iat"),u!==void 0&&m.push("aud"),c!==void 0&&m.push("sub"),a!==void 0&&m.push("iss");for(let v of new Set(m.reverse()))if(!(v in o))throw new ne(`missing required "${v}" claim`,o,v,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new ne('unexpected "iss" claim value',o,"iss","check_failed");if(c&&o.sub!==c)throw new ne('unexpected "sub" claim value',o,"sub","check_failed");if(u&&!LT(o.aud,typeof u=="string"?[u]:u))throw new ne('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=Kt(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:g}=r,b=Ge(g||new Date);if((o.iat!==void 0||f)&&typeof o.iat!="number")throw new ne('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new ne('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>b+h)throw new ne('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new ne('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=b-h)throw new Nt('"exp" claim timestamp check failed',o,"exp","check_failed")}if(f){let v=b-o.iat,x=typeof f=="number"?f:Kt(f);if(v-h>x)throw new Nt('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(v<0-h)throw new ne('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o};async function va(t,e,r){let o=await mb(t,e,r);if(o.protectedHeader.crit?.includes("b64")&&o.protectedHeader.b64===!1)throw new ze("JWTs MUST NOT use unencoded payload");let s={payload:yb(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return typeof e=="function"?{...s,key:o.key}:s}var $T=async(t,e,r)=>{let o=await mo(t,e,"sign");Ri(t,o);let i=await fe.subtle.sign(fo(t,o.algorithm),o,r);return new Uint8Array(i)},gb=$T;var Ii=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,r){if(!this._protectedHeader&&!this._unprotectedHeader)throw new G("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Si(this._protectedHeader,this._unprotectedHeader))throw new G("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...this._protectedHeader,...this._unprotectedHeader},i=Ei(G,new Map([["b64",!0]]),r?.crit,this._protectedHeader,o),s=!0;if(i.has("b64")&&(s=this._protectedHeader.b64,typeof s!="boolean"))throw new G('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=o;if(typeof a!="string"||!a)throw new G('JWS "alg" (Algorithm) Header Parameter missing or invalid');uo(a,e,"sign");let c=this._payload;s&&(c=me.encode(xr(c)));let u;this._protectedHeader?u=me.encode(xr(JSON.stringify(this._protectedHeader))):u=me.encode("");let f=hi(u,me.encode("."),c),m=await gb(a,e,f),h={signature:xr(m),payload:""};return s&&(h.payload=De.decode(c)),this._unprotectedHeader&&(h.header=this._unprotectedHeader),this._protectedHeader&&(h.protected=De.decode(u)),h}};var Di=class{constructor(e){this._flattened=new Ii(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,r){let o=await this._flattened.sign(e,r);if(o.payload===void 0)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${o.protected}.${o.payload}.${o.signature}`}};function Ht(t,e){if(!Number.isFinite(e))throw new TypeError(`Invalid ${t} input`);return e}var Ti=class{constructor(e={}){if(!Ae(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e=="number"?this._payload={...this._payload,nbf:Ht("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:Ht("setNotBefore",Ge(e))}:this._payload={...this._payload,nbf:Ge(new Date)+Kt(e)},this}setExpirationTime(e){return typeof e=="number"?this._payload={...this._payload,exp:Ht("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:Ht("setExpirationTime",Ge(e))}:this._payload={...this._payload,exp:Ge(new Date)+Kt(e)},this}setIssuedAt(e){return typeof e>"u"?this._payload={...this._payload,iat:Ge(new Date)}:e instanceof Date?this._payload={...this._payload,iat:Ht("setIssuedAt",Ge(e))}:typeof e=="string"?this._payload={...this._payload,iat:Ht("setIssuedAt",Ge(new Date)+Kt(e))}:this._payload={...this._payload,iat:Ht("setIssuedAt",e)},this}};var ho=class extends Ti{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,r){let o=new Di(me.encode(JSON.stringify(this._payload)));if(o.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&this._protectedHeader.b64===!1)throw new ze("JWTs MUST NOT use unencoded payload");return o.sign(e,r)}};function xa(t){let e=t?.modulusLength??2048;if(typeof e!="number"||e<2048)throw new W("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return e}async function bb(t,e){let r,o;switch(t){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:xa(e)},o=["sign","verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:xa(e)},o=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:`SHA-${parseInt(t.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:xa(e)},o=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":r={name:"ECDSA",namedCurve:"P-256"},o=["sign","verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},o=["sign","verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},o=["sign","verify"];break;case"Ed25519":r={name:"Ed25519"},o=["sign","verify"];break;case"EdDSA":{o=["sign","verify"];let i=e?.crv??"Ed25519";switch(i){case"Ed25519":case"Ed448":r={name:i};break;default:throw new W("Invalid or unsupported crv option provided")}break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{o=["deriveKey","deriveBits"];let i=e?.crv??"P-256";switch(i){case"P-256":case"P-384":case"P-521":{r={name:"ECDH",namedCurve:i};break}case"X25519":case"X448":r={name:i};break;default:throw new W("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new W('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return fe.subtle.generateKey(r,e?.extractable??!1,o)}async function wa(t,e){return bb(t,e)}function vb(t,e){if(t!=null&&e!=null&&t!==e)throw new TypeError(`Expected "${e}", got "${t}"`);return t??e??void 0}var{JOSEError:xb}=Ai;var Pi=class t extends ca{async getKeyObj(e){if(!this.algorithms.includes(e))throw new J(`Key cannot be used with algorithm "${e}"`);try{return await lo(this.jwk,e)}catch(r){throw new J("Failed to import JWK",void 0,{cause:r})}}async createJwt(e,r){try{let{kid:o}=e;if(o&&o!==this.kid)throw new et(`Invalid "kid" (${o}) used to sign with key "${this.kid}"`);let{alg:i}=e;if(!i)throw new et('Missing "alg" in JWT header');let s=await this.getKeyObj(i);return await new ho(r).setProtectedHeader({...e,alg:i,kid:this.kid}).sign(s)}catch(o){throw o instanceof xb?new et(o.message,o.code,{cause:o}):et.from(o)}}async verifyJwt(e,r){try{let o=await va(e,async({alg:a})=>this.getKeyObj(a),{...r,algorithms:this.algorithms}),i=fi.safeParse(o.protectedHeader);if(!i.success)throw new ue("Invalid JWT header",void 0,{cause:i.error});let s=mi.safeParse(o.payload);if(!s.success)throw new ue("Invalid JWT payload",void 0,{cause:s.error});return{protectedHeader:i.data,payload:s.data}}catch(o){throw o instanceof xb?new ue(o.message,o.code,{cause:o}):ue.from(o)}}static async generateKeyPair(e=["ES256"],r){if(!e.length)throw new J("No algorithms provided for key generation");let o=[];for(let i of e)try{return await wa(i,r)}catch(s){o.push(s)}throw new J("Failed to generate key pair",void 0,{cause:new AggregateError(o,"None of the algorithms worked")})}static async generate(e=["ES256"],r,o){let i=await this.generateKeyPair(e,{...o,extractable:!0});return this.fromKeyLike(i.privateKey,r)}static async fromImportable(e,r){if(typeof e=="string"){if(e.startsWith("-----"))return this.fromPKCS8(e,"",r);if(e.startsWith("{"))return this.fromJWK(e,r);throw new J("Invalid input")}if(typeof e=="object")return"kty"in e||"alg"in e?this.fromJWK(e,r):this.fromKeyLike(e,r);throw new J("Invalid input")}static async fromKeyLike(e,r,o){let i=await ba(e);if(o){if(!i.alg)i.alg=o;else if(i.alg!==o)throw new J('Invalid "alg" in JWK')}return this.fromJWK(i,r)}static async fromPKCS8(e,r,o){let i=await ya(e,r,{extractable:!0});return this.fromKeyLike(i,o)}static async fromJWK(e,r){let o=typeof e=="string"?JSON.parse(e):e;if(!o||typeof o!="object")throw new J("Invalid JWK");let i=vb(o.kid,r);return o.use!=null&&vr(o)&&(console.warn('Deprecation warning: Private JWK with a "use" property will be rejected in the future. Please remove replace "use" with (valid) "key_ops".'),o.key_ops??=o.use==="sig"?["sign"]:["encrypt"],delete o.use),new t(Ve.parse({...o,kid:i}))}};function wb(t){switch(t.name){case"RSA-PSS":case"RSASSA-PKCS1-v1_5":{let e=t.hash.name;switch(e){case"SHA-256":case"SHA-384":case"SHA-512":return`${t.name==="RSA-PSS"?"PS":"RS"}${e.slice(-3)}`;default:throw new TypeError("unsupported RsaHashedKeyAlgorithm hash")}}case"ECDSA":{let e=t.namedCurve;switch(e){case"P-256":case"P-384":case"P-512":return`ES${e.slice(-3)}`;case"P-521":return"ES512";default:throw new TypeError("unsupported EcKeyAlgorithm namedCurve")}}case"Ed448":case"Ed25519":return"EdDSA";default:throw new TypeError(`Unexpected algorithm "${t.name}"`)}}function kb(t,e){return typeof t=="object"&&t!==null&&"privateKey"in t&&t.privateKey instanceof CryptoKey&&t.privateKey.type==="private"&&(e==null||t.privateKey.extractable===e)&&t.privateKey.usages.includes("sign")&&"publicKey"in t&&t.publicKey instanceof CryptoKey&&t.publicKey.type==="public"&&t.publicKey.extractable===!0&&t.publicKey.usages.includes("verify")}var Jt=class t extends Pi{static async generate(e=["ES256"],r=crypto.randomUUID(),o){let i=await this.generateKeyPair(e,o);if(!kb(i))throw new TypeError("Invalid CryptoKeyPair");return this.fromKeypair(i,r)}static async fromKeypair(e,r){let{alg:o=wb(e.privateKey.algorithm),...i}=await crypto.subtle.exportKey("jwk",e.privateKey.extractable?e.privateKey:e.publicKey);return new t(Ve.parse({...i,kid:r,alg:o}),e)}constructor(e,r){if(!e.alg)throw new J('JWK "alg" is required for Webcrypto keys');super(e),this.cryptoKeyPair=r}get isPrivate(){return!0}async getKeyObj(e){if(this.jwk.alg!==e)throw new J(`Key cannot be used with algorithm "${e}"`);return this.cryptoKeyPair.privateKey}};var bW=or(Yr(),1);var ka=t=>typeof t=="number"?t:void 0;var ae=class t extends Error{constructor(e,r,o,i=400,s){super(r,{cause:s}),this.did=e,this.code=o,this.status=i}get statusCode(){return this.status}toString(){return`${this.constructor.name} ${this.code} (${this.did}): ${this.message}`}static from(e,r){if(e instanceof t)return e;let o=e instanceof Error?e.message:typeof e=="string"?e:"An unknown error occurred",i=typeof e=="object"&&e!=null?("statusCode"in e?ka(e.statusCode):void 0)??("status"in e?ka(e.status):void 0):void 0;return new t(r,o,"did-unknown-error",i,e)}},U=class extends ae{constructor(e,r,o){super(e,r,"did-invalid",400,o)}};var Aa="did:",ji=Aa.length;function MT(t,e=0,r=t.length){if(!Number.isFinite(r)||!Number.isFinite(e)||r<e||r>t.length)throw new TypeError("Invalid start or end position");if(r===e)throw new U(t,"Empty method name");let o;for(let i=e;i<r;i++)if(o=t.charCodeAt(i),(o<97||o>122)&&(o<48||o>57))throw new U(t,`Invalid character at position ${i} in DID method name`)}function Ab(t){let e=t.indexOf(":",ji);return t.slice(ji,e)}function qi(t,e=0,r=t.length){if(!Number.isFinite(r)||!Number.isFinite(e)||r<e||r>t.length)throw new TypeError("Invalid start or end position");if(r===e)throw new U(t,"DID method-specific id must not be empty");let o;for(let i=e;i<r;i++)if(o=t.charCodeAt(i),(o<97||o>122)&&(o<65||o>90)&&(o<48||o>57)&&o!==46&&o!==45&&o!==95){if(o===58){if(i===r-1)throw new U(t,'DID cannot end with ":"');continue}if(o===37){if(o=t.charCodeAt(++i),(o<48||o>57)&&(o<65||o>70))throw new U(t,`Invalid pct-encoded character at position ${i}`);if(o=t.charCodeAt(++i),(o<48||o>57)&&(o<65||o>70))throw new U(t,`Invalid pct-encoded character at position ${i}`);if(i>=r)throw new U(t,`Incomplete pct-encoded character at position ${i-2}`);continue}throw new U(t,`Disallowed character in DID at position ${i}`)}}function VT(t){if(typeof t!="string")throw new U(typeof t,"DID must be a string");let{length:e}=t;if(e>2048)throw new U(t,"DID is too long (2048 chars max)");if(!t.startsWith(Aa))throw new U(t,`DID requires "${Aa}" prefix`);let r=t.indexOf(":",ji);if(r===-1)throw new U(t,"Missing colon after method name");MT(t,ji,r),qi(t,r+1,e)}var Bi=n.string().superRefine((t,e)=>{try{return VT(t),!0}catch(r){return e.addIssue({code:n.ZodIssueCode.custom,message:r instanceof Error?r.message:"Unexpected error"}),!1}});function Li(t,e=0,r=t.length){let o;for(let i=e;i<r;i++)if(o=t.charCodeAt(i),!(o>=65&&o<=90||o>=97&&o<=122||o>=48&&o<=57||o===45||o===46||o===95||o===126)){if(!(o===33||o===36||o===38||o===39||o===40||o===41||o===42||o===43||o===44||o===59||o===61)){if(!(o===58||o===64)){if(!(o===47||o===63))if(o===37){if(i+2>=r||!Sb(t.charCodeAt(i+1))||!Sb(t.charCodeAt(i+2)))return!1;i+=2}else return!1}}}return!0}function Sb(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}var yo=URL.canParse?.bind(URL)??((t,e)=>{try{return new URL(t,e),!0}catch{return!1}});var bo="did:plc:",Rb=bo.length,go=32;function Cb(t){if(typeof t!="string"||t.length!==go||!t.startsWith(bo))return!1;for(let e=Rb;e<go;e++)if(!_b(t.charCodeAt(e)))return!1;return!0}function $i(t){if(typeof t!="string")throw new U(typeof t,"DID must be a string");if(!t.startsWith(bo))throw new U(t,"Invalid did:plc prefix");if(t.length!==go)throw new U(t,`did:plc must be ${go} characters long`);for(let e=Rb;e<go;e++)if(!_b(t.charCodeAt(e)))throw new U(t,`Invalid character at position ${e}`)}var _b=t=>t>=97&&t<=122||t>=50&&t<=55;var Se="did:web:";function Eb(t){if(typeof t!="string"||!t.startsWith(Se)||t.charAt(Se.length)===":")return!1;try{qi(t,Se.length)}catch{return!1}return yo(Sa(t))}function Ib(t){if(typeof t!="string")throw new U(typeof t,"DID must be a string");if(!t.startsWith(Se))throw new U(t,"Invalid did:web prefix");if(t.charAt(Se.length)===":")throw new U(t,"did:web MSID must not start with a colon");if(qi(t,Se.length),!yo(Sa(t)))throw new U(t,"Invalid Web DID")}function Db(t){try{return new URL(Sa(t))}catch(e){throw new U(t,"Invalid Web DID",e)}}function Sa(t){let e=Se.length,r=t.indexOf(":",e),i=(r===-1?t.slice(e):t.slice(e,r)).replaceAll("%3A",":"),s=r===-1?"":t.slice(r).replaceAll(":","/");return`${i.startsWith("localhost")&&(i.length===9||i.charCodeAt(9)===58)?"http":"https"}://${i}${s}`}function Tb(t,e,r){return r.charCodeAt(0)===35?r.length===e.length+1&&r.endsWith(e):r.length===e.length+1+t.length&&r.charCodeAt(t.length)===35&&r.startsWith(t)&&r.endsWith(e)}var Pb=n.string().refine(vo,'Atproto only allows "plc" and "web" DID methods');function vo(t){return Cb(t)||zT(t)}function Ra(t){if(typeof t!="string")throw new U(typeof t,"DID must be a string");if(t.startsWith(bo))$i(t);else if(t.startsWith(Se))OT(t);else throw new U(t,'Atproto only allows "plc" and "web" DID methods')}function OT(t){if(Ib(t),jb(t))throw new U(t,"Atproto does not allow path components in Web DIDs");if(qb(t))throw new U(t,"Atproto does not allow port numbers in Web DIDs, except for localhost")}function zT(t){return!(!Eb(t)||jb(t)||qb(t))}function jb(t){return t.includes(":",Se.length)}function UT(t){return t==="did:web:localhost"||t.startsWith("did:web:localhost:")||t.startsWith("did:web:localhost%3A")}function qb(t){if(UT(t))return!1;let e=t.indexOf(":",Se.length);return e===-1?t.includes("%3A",Se.length):t.lastIndexOf("%3A",e)!==-1}function Bb(t){let e=t.service?.find(GT,t);if(!e)throw new ae(t.id,`Document ${t.id} does not contain a (valid) #atproto_pds service URL`,"did-service-not-found");return new URL(e.serviceEndpoint)}function GT(t){return t?.type==="AtprotoPersonalDataServer"&&typeof t.serviceEndpoint=="string"&&yo(t.serviceEndpoint)&&Tb(this.id,"atproto_pds",t.id)}var z2=Object.freeze(["EcdsaSecp256r1VerificationKey2019","EcdsaSecp256k1VerificationKey2019","Multikey"]);var Cr=n.string().url("RFC3968 compliant URI"),Lb=n.union([Bi,n.array(Bi)]),Ca=n.union([Cr.refine(t=>{let e=t.indexOf("#");return e===-1?!1:Li(t,e+1)},{message:"Missing or invalid fragment in RFC3968 URI"}),n.string().refine(t=>t.charCodeAt(0)===35,{message:"Fragment must start with #"}).refine(t=>Li(t,1),{message:"Invalid char in URI fragment"})]),$b=n.object({id:Ca,type:n.string().min(1),controller:Lb,publicKeyJwk:n.record(n.string(),n.unknown()).optional(),publicKeyMultibase:n.string().optional()}),FT=Ca,NT=n.union([n.string(),n.array(n.string())]),KT=n.union([Cr,n.record(n.string(),Cr),n.array(n.union([Cr,n.record(n.string(),Cr)])).nonempty()]),HT=n.object({id:FT,type:NT,serviceEndpoint:KT}),JT=n.union([Ca,$b]),WT=n.object({"@context":n.union([n.literal("https://www.w3.org/ns/did/v1"),n.array(n.string().url()).nonempty().refine(t=>t[0]==="https://www.w3.org/ns/did/v1",{message:"First @context must be https://www.w3.org/ns/did/v1"})]).optional(),id:Bi,controller:Lb.optional(),alsoKnownAs:n.array(Cr).optional(),service:n.array(HT).optional(),authentication:n.array(JT).optional(),verificationMethod:n.array($b).optional()}),Mi=WT.superRefine(({id:t,service:e},r)=>{if(e){let o=new Set;for(let i=0;i<e.length;i++){let s=e[i],a=s.id.startsWith("#")?`${t}${s.id}`:s.id;o.has(a)?r.addIssue({code:n.ZodIssueCode.custom,message:`Duplicate service id (${s.id}) found in the document`,path:["service",i,"id"]}):o.add(a)}}});function _a(t,e="Assertion failed"){if(!t)throw new Error(e)}var XT=()=>!0,QT=()=>!1,Re=class{#e=new Map;#r;#s;#f={};constructor(e,r,o={}){this.#r=e,this.#s=r,this.#f=o}async get(e,{signal:r,context:o,allowStale:i=!1,noCache:s=!1}={}){r?.throwIfAborted();let{isStale:a,deleteOnError:c}=this.#f,u=s?QT:i||a==null?XT:async g=>!await a(e,g),f;for(;f=this.#e.get(e);){try{let{isFresh:g,value:b}=await f;if(g||await u(b))return b}catch{}r?.throwIfAborted()}let m=Promise.resolve().then(async()=>{r?.throwIfAborted();let g=await this.getStored(e,{signal:r});return g!==void 0&&await u(g)?{isFresh:!1,value:g}:(r?.throwIfAborted(),Promise.resolve().then(async()=>{let b={signal:r,noCache:s,context:o};return this.#r.call(null,e,b,g)}).catch(async b=>{if(g!==void 0)try{await c?.(b,e,g)&&await this.delStored(e,b)}catch(v){throw new AggregateError([b,v],"Error while deleting stored value")}throw b}).then(async b=>(await this.setStored(e,b),{isFresh:!0,value:b})))}).finally(()=>{_a(this.#e.get(e)===m,`Pending item for key "${e}" was replaced before it finished.`),this.#e.delete(e)});_a(!this.#e.has(e),`Concurrent execution flow for key "${e}" should not exist.`),this.#e.set(e,m);let{value:h}=await m;return h}async getStored(e,r){return this.#s.get(e,r)}async setStored(e,r){await this.#s.set(e,r)}async delStored(e,r){await this.#s.del(e)}};var ZT=(t,e)=>{console.error(`SimpleStore error during "${e}"`,t)};function mt(t,e=ZT){return{async get(r,o){o?.signal?.throwIfAborted();try{return await t.get(r,o)}catch(i){if(o?.signal?.aborted)throw i;e(i,"get",r);return}},async set(r,o){try{await t.set(r,o)}catch(i){e(i,"set",r)}},async del(r){try{await t.del(r)}catch(o){e(o,"del",r)}},async clear(){try{await t.clear?.()}catch(r){e(r,"clear")}}}}var _r=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Vb=new Set,Ea=typeof process=="object"&&process?process:{},Ob=(t,e,r,o)=>{typeof Ea.emitWarning=="function"?Ea.emitWarning(t,e,r,o):console.error(`[${r}] ${e}: ${t}`)},Vi=globalThis.AbortController,Mb=globalThis.AbortSignal;if(typeof Vi>"u"){Mb=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(o,i){this._onabort.push(i)}},Vi=class{constructor(){e()}signal=new Mb;abort(o){if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(let i of this.signal._onabort)i(o);this.signal.onabort?.(o)}}};let t=Ea.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Ob("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var YT=t=>!Vb.has(t);var ht=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),zb=t=>ht(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Er:null:null,Er=class extends Array{constructor(e){super(e),this.fill(0)}},Ia=class t{heap;length;static#e=!1;static create(e){let r=zb(e);if(!r)return[];t.#e=!0;let o=new t(e,r);return t.#e=!1,o}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Oi=class t{#e;#r;#s;#f;#D;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#g;#n;#i;#t;#l;#m;#d;#p;#b;#c;#v;#x;#h;#w;#C;#u;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#h,sizes:e.#v,keyMap:e.#n,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#m,get head(){return e.#d},get tail(){return e.#p},free:e.#b,isBackgroundFetch:r=>e.#o(r),backgroundFetch:(r,o,i,s)=>e.#q(r,o,i,s),moveToTail:r=>e.#I(r),indexes:r=>e.#k(r),rindexes:r=>e.#A(r),isStale:r=>e.#y(r)}}get max(){return this.#e}get maxSize(){return this.#r}get calculatedSize(){return this.#g}get size(){return this.#a}get fetchMethod(){return this.#D}get memoMethod(){return this.#T}get dispose(){return this.#s}get disposeAfter(){return this.#f}constructor(e){let{max:r=0,ttl:o,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:f,disposeAfter:m,noDisposeOnSet:h,noUpdateTTL:g,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:x,fetchMethod:I,memoMethod:k,noDeleteOnFetchRejection:B,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:N,ignoreFetchAbort:Z}=e;if(r!==0&&!ht(r))throw new TypeError("max option must be a nonnegative integer");let H=r?zb(r):Array;if(!H)throw new Error("invalid max value: "+r);if(this.#e=r,this.#r=b,this.maxEntrySize=v||this.#r,this.sizeCalculation=x,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=k,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#D=I,this.#C=!!I,this.#n=new Map,this.#i=new Array(r).fill(void 0),this.#t=new Array(r).fill(void 0),this.#l=new H(r),this.#m=new H(r),this.#d=0,this.#p=0,this.#b=Ia.create(r),this.#a=0,this.#g=0,typeof f=="function"&&(this.#s=f),typeof m=="function"?(this.#f=m,this.#c=[]):(this.#f=void 0,this.#c=void 0),this.#w=!!this.#s,this.#u=!!this.#f,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!B,this.allowStaleOnFetchRejection=!!z,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!Z,this.maxEntrySize!==0){if(this.#r!==0&&!ht(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!ht(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=ht(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=o||0,this.ttl){if(!ht(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#B()}if(this.#e===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#r){let de="LRU_CACHE_UNBOUNDED";YT(de)&&(Vb.add(de),Ob("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",de,t))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#B(){let e=new Er(this.#e),r=new Er(this.#e);this.#h=e,this.#x=r,this.#L=(s,a,c=_r.now())=>{if(r[s]=a!==0?c:0,e[s]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#y(s)&&this.#S(this.#i[s],"expire")},a+1);u.unref&&u.unref()}},this.#_=s=>{r[s]=e[s]!==0?_r.now():0},this.#R=(s,a)=>{if(e[a]){let c=e[a],u=r[a];if(!c||!u)return;s.ttl=c,s.start=u,s.now=o||i();let f=s.now-u;s.remainingTTL=c-f}};let o=0,i=()=>{let s=_r.now();if(this.ttlResolution>0){o=s;let a=setTimeout(()=>o=0,this.ttlResolution);a.unref&&a.unref()}return s};this.getRemainingTTL=s=>{let a=this.#n.get(s);if(a===void 0)return 0;let c=e[a],u=r[a];if(!c||!u)return 1/0;let f=(o||i())-u;return c-f},this.#y=s=>{let a=r[s],c=e[s];return!!c&&!!a&&(o||i())-a>c}}#_=()=>{};#R=()=>{};#L=()=>{};#y=()=>!1;#z(){let e=new Er(this.#e);this.#g=0,this.#v=e,this.#E=r=>{this.#g-=e[r],e[r]=0},this.#$=(r,o,i,s)=>{if(this.#o(o))return 0;if(!ht(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(o,r),!ht(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#P=(r,o,i)=>{if(e[r]=o,this.#r){let s=this.#r-e[r];for(;this.#g>s;)this.#j(!0)}this.#g+=e[r],i&&(i.entrySize=o,i.totalCalculatedSize=this.#g)}}#E=e=>{};#P=(e,r,o)=>{};#$=(e,r,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!this.#M(r)||((e||!this.#y(r))&&(yield r),r===this.#d));)r=this.#m[r]}*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#d;!(!this.#M(r)||((e||!this.#y(r))&&(yield r),r===this.#p));)r=this.#l[r]}#M(e){return e!==void 0&&this.#n.get(this.#i[e])===e}*entries(){for(let e of this.#k())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#o(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#o(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#k()){let r=this.#i[e];r!==void 0&&!this.#o(this.#t[e])&&(yield r)}}*rkeys(){for(let e of this.#A()){let r=this.#i[e];r!==void 0&&!this.#o(this.#t[e])&&(yield r)}}*values(){for(let e of this.#k())this.#t[e]!==void 0&&!this.#o(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#o(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let o of this.#k()){let i=this.#t[o],s=this.#o(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#i[o],this))return this.get(this.#i[o],r)}}forEach(e,r=this){for(let o of this.#k()){let i=this.#t[o],s=this.#o(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#i[o],this)}}rforEach(e,r=this){for(let o of this.#A()){let i=this.#t[o],s=this.#o(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#i[o],this)}}purgeStale(){let e=!1;for(let r of this.#A({allowStale:!0}))this.#y(r)&&(this.#S(this.#i[r],"expire"),e=!0);return e}info(e){let r=this.#n.get(e);if(r===void 0)return;let o=this.#t[r],i=this.#o(o)?o.__staleWhileFetching:o;if(i===void 0)return;let s={value:i};if(this.#h&&this.#x){let a=this.#h[r],c=this.#x[r];if(a&&c){let u=a-(_r.now()-c);s.ttl=u,s.start=Date.now()}}return this.#v&&(s.size=this.#v[r]),s}dump(){let e=[];for(let r of this.#k({allowStale:!0})){let o=this.#i[r],i=this.#t[r],s=this.#o(i)?i.__staleWhileFetching:i;if(s===void 0||o===void 0)continue;let a={value:s};if(this.#h&&this.#x){a.ttl=this.#h[r];let c=_r.now()-this.#x[r];a.start=Math.floor(Date.now()-c)}this.#v&&(a.size=this.#v[r]),e.unshift([o,a])}return e}load(e){this.clear();for(let[r,o]of e){if(o.start){let i=Date.now()-o.start;o.start=_r.now()-i}this.set(r,o.value,o)}}set(e,r,o={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=o,{noUpdateTTL:f=this.noUpdateTTL}=o,m=this.#$(e,r,o.size||0,c);if(this.maxEntrySize&&m>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#S(e,"set"),this;let h=this.#a===0?void 0:this.#n.get(e);if(h===void 0)h=this.#a===0?this.#p:this.#b.length!==0?this.#b.pop():this.#a===this.#e?this.#j(!1):this.#a,this.#i[h]=e,this.#t[h]=r,this.#n.set(e,h),this.#l[this.#p]=h,this.#m[h]=this.#p,this.#p=h,this.#a++,this.#P(h,m,u),u&&(u.set="add"),f=!1;else{this.#I(h);let g=this.#t[h];if(r!==g){if(this.#C&&this.#o(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:b}=g;b!==void 0&&!a&&(this.#w&&this.#s?.(b,e,"set"),this.#u&&this.#c?.push([b,e,"set"]))}else a||(this.#w&&this.#s?.(g,e,"set"),this.#u&&this.#c?.push([g,e,"set"]));if(this.#E(h),this.#P(h,m,u),this.#t[h]=r,u){u.set="replace";let b=g&&this.#o(g)?g.__staleWhileFetching:g;b!==void 0&&(u.oldValue=b)}}else u&&(u.set="update")}if(i!==0&&!this.#h&&this.#B(),this.#h&&(f||this.#L(h,i,s),u&&this.#R(u,h)),!a&&this.#u&&this.#c){let g=this.#c,b;for(;b=g?.shift();)this.#f?.(...b)}return this}pop(){try{for(;this.#a;){let e=this.#t[this.#d];if(this.#j(!0),this.#o(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#c){let e=this.#c,r;for(;r=e?.shift();)this.#f?.(...r)}}}#j(e){let r=this.#d,o=this.#i[r],i=this.#t[r];return this.#C&&this.#o(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#u)&&(this.#w&&this.#s?.(i,o,"evict"),this.#u&&this.#c?.push([i,o,"evict"])),this.#E(r),e&&(this.#i[r]=void 0,this.#t[r]=void 0,this.#b.push(r)),this.#a===1?(this.#d=this.#p=0,this.#b.length=0):this.#d=this.#l[r],this.#n.delete(o),this.#a--,r}has(e,r={}){let{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=r,s=this.#n.get(e);if(s!==void 0){let a=this.#t[s];if(this.#o(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#y(s))i&&(i.has="stale",this.#R(i,s));else return o&&this.#_(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:o=this.allowStale}=r,i=this.#n.get(e);if(i===void 0||!o&&this.#y(i))return;let s=this.#t[i];return this.#o(s)?s.__staleWhileFetching:s}#q(e,r,o,i){let s=r===void 0?void 0:this.#t[r];if(this.#o(s))return s;let a=new Vi,{signal:c}=o;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:o,context:i},f=(x,I=!1)=>{let{aborted:k}=a.signal,B=o.ignoreFetchAbort&&x!==void 0;if(o.status&&(k&&!I?(o.status.fetchAborted=!0,o.status.fetchError=a.signal.reason,B&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),k&&!B&&!I)return h(a.signal.reason);let L=b;return this.#t[r]===b&&(x===void 0?L.__staleWhileFetching?this.#t[r]=L.__staleWhileFetching:this.#S(e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,x,u.options))),x},m=x=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=x),h(x)),h=x=>{let{aborted:I}=a.signal,k=I&&o.allowStaleOnFetchAbort,B=k||o.allowStaleOnFetchRejection,L=B||o.noDeleteOnFetchRejection,z=b;if(this.#t[r]===b&&(!L||z.__staleWhileFetching===void 0?this.#S(e,"fetch"):k||(this.#t[r]=z.__staleWhileFetching)),B)return o.status&&z.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},g=(x,I)=>{let k=this.#D?.(e,s,u);k&&k instanceof Promise&&k.then(B=>x(B===void 0?void 0:B),I),a.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(x(void 0),o.allowStaleOnFetchAbort&&(x=B=>f(B,!0)))})};o.status&&(o.status.fetchDispatched=!0);let b=new Promise(g).then(f,m),v=Object.assign(b,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,v,{...u.options,status:void 0}),r=this.#n.get(e)):this.#t[r]=v,v}#o(e){if(!this.#C)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Vi}async fetch(e,r={}){let{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:x,forceRefresh:I=!1,status:k,signal:B}=r;if(!this.#C)return k&&(k.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:k});let L={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:v,ignoreFetchAbort:b,status:k,signal:B},z=this.#n.get(e);if(z===void 0){k&&(k.fetch="miss");let N=this.#q(e,z,L,x);return N.__returned=N}else{let N=this.#t[z];if(this.#o(N)){let jh=o&&N.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",jh&&(k.returnedStale=!0)),jh?N.__staleWhileFetching:N.__returned=N}let Z=this.#y(z);if(!I&&!Z)return k&&(k.fetch="hit"),this.#I(z),i&&this.#_(z),k&&this.#R(k,z),N;let H=this.#q(e,z,L,x),nt=H.__staleWhileFetching!==void 0&&o;return k&&(k.fetch=Z?"stale":"refresh",nt&&Z&&(k.returnedStale=!0)),nt?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,r={}){let o=await this.fetch(e,r);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,r={}){let o=this.#T;if(!o)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...a}=r,c=this.get(e,a);if(!s&&c!==void 0)return c;let u=o(e,c,{options:a,context:i});return this.set(e,u,a),u}get(e,r={}){let{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=r,c=this.#n.get(e);if(c!==void 0){let u=this.#t[c],f=this.#o(u);return a&&this.#R(a,c),this.#y(c)?(a&&(a.get="stale"),f?(a&&o&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),o?u.__staleWhileFetching:void 0):(s||this.#S(e,"expire"),a&&o&&(a.returnedStale=!0),o?u:void 0)):(a&&(a.get="hit"),f?u.__staleWhileFetching:(this.#I(c),i&&this.#_(c),u))}else a&&(a.get="miss")}#V(e,r){this.#m[r]=e,this.#l[e]=r}#I(e){e!==this.#p&&(e===this.#d?this.#d=this.#l[e]:this.#V(this.#m[e],this.#l[e]),this.#V(this.#p,e),this.#p=e)}delete(e){return this.#S(e,"delete")}#S(e,r){let o=!1;if(this.#a!==0){let i=this.#n.get(e);if(i!==void 0)if(o=!0,this.#a===1)this.#O(r);else{this.#E(i);let s=this.#t[i];if(this.#o(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#u)&&(this.#w&&this.#s?.(s,e,r),this.#u&&this.#c?.push([s,e,r])),this.#n.delete(e),this.#i[i]=void 0,this.#t[i]=void 0,i===this.#p)this.#p=this.#m[i];else if(i===this.#d)this.#d=this.#l[i];else{let a=this.#m[i];this.#l[a]=this.#l[i];let c=this.#l[i];this.#m[c]=this.#m[i]}this.#a--,this.#b.push(i)}}if(this.#u&&this.#c?.length){let i=this.#c,s;for(;s=i?.shift();)this.#f?.(...s)}return o}clear(){return this.#O("delete")}#O(e){for(let r of this.#A({allowStale:!0})){let o=this.#t[r];if(this.#o(o))o.__abortController.abort(new Error("deleted"));else{let i=this.#i[r];this.#w&&this.#s?.(o,i,e),this.#u&&this.#c?.push([o,i,e])}}if(this.#n.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#h&&this.#x&&(this.#h.fill(0),this.#x.fill(0)),this.#v&&this.#v.fill(0),this.#d=0,this.#p=0,this.#b.length=0,this.#g=0,this.#a=0,this.#u&&this.#c){let r=this.#c,o;for(;o=r?.shift();)this.#f?.(...o)}}};var Da=new WeakMap;function Ub(t){let e=new Set,r=[t],o=0;for(;r.length;){let i=r.pop();switch(typeof i){case"string":o+=12+4*Math.ceil(i.length/4);break;case"number":o+=12;break;case"boolean":o+=4;break;case"object":if(o+=4,i===null)break;if(Da.has(i)){o+=Da.get(i);break}if(e.has(i))continue;if(e.add(i),Array.isArray(i))o+=4,r.push(...i);else{o+=8;let s=Object.getOwnPropertyNames(i);for(let a=0;a<s.length;a++){o+=4;let c=s[a],u=i[c];u!==void 0&&r.push(u),r.push(c)}}break;case"function":o+=8;break;case"symbol":o+=8;break;case"bigint":o+=16;break}}return typeof t=="object"&&t!==null&&Da.set(t,o),o}var Fb=Symbol("nullItem"),eP=t=>t===null?Fb:t,Gb=t=>t===Fb?null:t,Fe=class{#e;constructor({sizeCalculation:e,...r}){this.#e=new Oi({...r,allowStale:!1,updateAgeOnGet:!1,updateAgeOnHas:!1,sizeCalculation:e?(o,i)=>e(Gb(o),i):r.maxEntrySize!=null||r.maxSize!=null?Ub:void 0})}get(e){let r=this.#e.get(e);if(r!==void 0)return Gb(r)}set(e,r){this.#e.set(e,eP(r))}del(e){this.#e.delete(e)}clear(){this.#e.clear()}};var Nb=3600*1e3,tP=50*1024*1024,zi=class extends Fe{constructor(e){super(e?.max==null?{ttl:Nb,maxSize:tP,...e}:{ttl:Nb,...e})}};var xo=class{constructor(e,r=new zi,o){this.getter=new Re((i,s)=>e.resolve(i,s),mt(r,o))}async resolve(e,r){return this.getter.get(e,r)}};var rt=class extends Error{constructor(e,r,o){super(r,o),this.statusCode=e}get expose(){return!0}};function Kb(t){return function(e,r){return t.call(this,Hb(e,r))}}function Hb(t,e){return!e&&t instanceof Request?t:new Request(t,e)}var Gi=t=>typeof t=="string"?t:void 0,Ui=class extends TransformStream{constructor(e){if(!(e>=0))throw new TypeError("maxBytes must be a non-negative number");let r=0;super({transform:(o,i)=>{(r+=o.length)<=e?i.enqueue(o):i.error(new Error("Response too large"))}})}};async function Te(t,e){t.body&&!t.bodyUsed&&!t.body.locked&&typeof t.body.cancel=="function"&&(typeof e=="function"?t.body.cancel().catch(e):e==="log"?t.body.cancel().catch(Ta):await t.body.cancel())}function Ta(t){console.warn("Failed to cancel response body",t)}var wo=class t extends rt{constructor(e,r,o,i){if(r==null||!o){let s=oP(rP(i?.cause));r??=s[0],o||=s[1]}super(r,o,i),this.request=e}get expose(){return this.statusCode!==500}static from(e,r){return r instanceof t?r:new t(e,void 0,void 0,{cause:r})}};function rP(t){return t instanceof TypeError&&t.message==="fetch failed"&&t.cause!==void 0?t.cause:t}function oP(t){if(typeof t=="string"&&t.length>0)return[500,t];if(!(t instanceof Error))return[500,"Failed to fetch"];switch(t.message){case"failed to fetch the data URL":return[400,t.message];case"unexpected redirect":case"cors failure":case"blocked":case"proxy authentication required":return[502,t.message]}let e="code"in t?t.code:void 0;if(typeof e=="string")switch(!0){case e==="ENOTFOUND":return[400,"Invalid hostname"];case e==="ECONNREFUSED":return[502,"Connection refused"];case e==="DEPTH_ZERO_SELF_SIGNED_CERT":return[502,"Self-signed certificate"];case e.startsWith("ERR_TLS"):return[502,"TLS error"];case e.startsWith("ECONN"):return[502,"Connection error"];default:return[500,`${e} error`]}return[500,t.message]}function Wt(...t){return t.reduce(Jb)}function Jb(t,e){return async(...r)=>e(await t(...r))}var ko=class extends Response{#e;constructor(e,r){if(!e.body)throw new TypeError("Response body is not available");if(e.bodyUsed)throw new TypeError("Response body is already used");super(e.body.pipeThrough(r),{status:e.status,statusText:e.statusText,headers:e.headers}),this.#e=e}get url(){return this.#e.url}get redirected(){return this.#e.redirected}get type(){return this.#e.type}get statusText(){return this.#e.statusText}};var Wb=/^application\/(?:[^()<>@,;:/[\]\\?={} \t]+\+)?json$/i,te=class t extends rt{constructor(e,r=e.status,o=e.statusText,i){super(r,o,i),this.response=e}static async from(e,r=iP,o=e.status,i){let s=typeof r=="string"?r:typeof r=="function"?await r(e):void 0;return new t(e,o,s,i)}},iP=async t=>{let e=Pa(t);if(e)try{if(e==="text/plain")return await t.text();if(Wb.test(e)){let r=await t.json();if(typeof r=="string")return r;if(typeof r=="object"&&r!=null){if("error_description"in r){let o=Gi(r.error_description);if(o)return o}if("error"in r){let o=Gi(r.error);if(o)return o}if("message"in r){let o=Gi(r.message);if(o)return o}}}}catch{}};async function Xb(t,e=1/0){if(Pa(t)!=="application/json")return;sP(t,e);let o=t.clone();return(t.body&&e<1/0?new ko(o,new Ui(e)):o).json()}function sP(t,e){if(!(e>=0))throw new TypeError("maxBytes must be a non-negative number");let r=nP(t);if(r!=null&&r>e)throw new te(t,502,"Response too large");return r}function nP(t){let e=t.headers.get("Content-Length");if(e==null)return;if(!/^\d+$/.test(e))throw new te(t,502,"Invalid Content-Length");let r=Number(e);if(!Number.isSafeInteger(r))throw new te(t,502,"Content-Length too large");return r}function Pa(t){let e=t.headers.get("Content-Type");if(e!=null)return e.split(";",1)[0].trim()}function ja(t,e=Ta){return async r=>{try{return await t(r)}catch(o){throw await Te(r,e??void 0),o}}}function Fi(t){return ja(e=>aP(e,t))}async function aP(t,e){if(t.ok)return t;throw await te.from(t,e)}function pP(t,e=!0){let r=typeof t=="string"?o=>o===t:t instanceof RegExp?o=>t.test(o):t;return ja(o=>cP(o,r,e))}async function cP(t,e,r=!0){let o=Pa(t);if(o){if(!e(o.toLowerCase()))throw await te.from(t,`Unexpected response Content-Type (${o})`,502)}else if(r)throw await te.from(t,"Missing response Content-Type header",502);return t}async function dP(t){try{let e=await t.json();return{response:t,json:e}}catch(e){throw new te(t,502,"Unable to parse response as JSON",{cause:e})}}function Ir(t=Wb,e=!0){return Wt(pP(t,e),ja(dP))}function lP(t,e){if("parseAsync"in t&&typeof t.parseAsync=="function")return async r=>t.parseAsync(r.json,e);if("parse"in t&&typeof t.parse=="function")return async r=>t.parse(r.json,e);throw new TypeError("Invalid schema")}var Ni=lP;function Ce(t=globalThis.fetch,e=globalThis){return Kb(async r=>{try{return await t.call(e,r)}catch(o){throw wo.from(r,o)}})}var Ki=class{constructor(e){this.methods=new Map(Object.entries(e))}async resolve(e,r){r?.signal?.throwIfAborted();let o=Ab(e),i=this.methods.get(o);if(!i)throw new ae(e,"Unsupported DID method","did-method-invalid",400);try{let s=await i.resolve(e,r);if(s.id!==e)throw new ae(e,`DID document id (${s.id}) does not match DID`,"did-document-id-mismatch",400);return s}catch(s){if(s instanceof te){let a=s.response.status>=500?502:s.response.status;throw new ae(e,s.message,"did-fetch-error",a,s)}throw s instanceof rt?new ae(e,s.message,"did-fetch-error",400,s):s instanceof Y?new ae(e,s.message,"did-document-format-error",503,s):ae.from(s,e)}}};var uP=Wt(Fi(),Ir(/^application\/(did\+ld\+)?json$/),Ni(Mi)),Hi=class{constructor(e){this.plcDirectoryUrl=new URL(e?.plcDirectoryUrl||"https://plc.directory/"),this.fetch=Ce(e?.fetch)}async resolve(e,r){$i(e);let o=new URL(`/${encodeURIComponent(e)}`,this.plcDirectoryUrl);return this.fetch(o,{redirect:"error",headers:{accept:"application/did+ld+json,application/json"},signal:r?.signal}).then(uP)}};var fP=Wt(Fi(),Ir(/^application\/(did\+ld\+)?json$/),Ni(Mi)),Ji=class{constructor({fetch:e=globalThis.fetch,allowHttp:r=!0}={}){this.fetch=Ce(e),this.allowHttp=r}async resolve(e,r){let o=mP(e);if(!this.allowHttp&&o.protocol==="http:")throw new ae(e,'Resolution of "http" did:web is not allowed',"did-web-http-not-allowed");return this.fetch(o,{redirect:"error",headers:{accept:"application/did+ld+json,application/json"},signal:r?.signal}).then(fP)}};function mP(t){let e=Db(t);return e.pathname==="/"?new URL("/.well-known/did.json",e):new URL(`${e.pathname}/did.json`,e)}var Wi=class extends Ki{constructor(e){super({plc:new Hi(e),web:new Ji(e)})}};function Qb(t){let{didResolver:e,didCache:r,onDidCacheError:o}=t;return e instanceof xo&&!r?e:new xo(e??new Wi(t),r,o)}var yt=class extends Error{constructor(){super(...arguments),this.name="HandleResolverError"}};function Xi(t){return t===null||vo(t)}var hP=n.object({error:n.string(),message:n.string().optional()}),Qi=class{constructor(e,r){this.serviceUrl=new URL(e),this.fetch=r?.fetch??globalThis.fetch}async resolve(e,r){let o=new URL("/xrpc/com.atproto.identity.resolveHandle",this.serviceUrl);o.searchParams.set("handle",e);let i=await this.fetch.call(null,o,{cache:r?.noCache?"no-cache":void 0,signal:r?.signal,redirect:"error"}),s=await i.json();if(i.status===400){let{error:c,data:u}=hP.safeParse(s);if(c)throw new yt(`Invalid response from resolveHandle method: ${c.message}`,{cause:c});if(u.error==="InvalidRequest"&&u.message==="Unable to resolve handle")return null}if(!i.ok)throw new yt("Invalid status code from resolveHandle method");let a=s?.did;if(!Xi(a))throw new yt("Invalid DID returned from resolveHandle method");return a}};var Ao=class{constructor(e,r=new Fe({max:1e3,ttl:10*6e4}),o){this.getter=new Re((i,s)=>e.resolve(i,s),mt(r,o))}async resolve(e,r){return this.getter.get(e,r)}};function Zb(t){let{handleResolver:e,handleCache:r,onHandleCacheError:o}=t;return e instanceof Ao&&!r?e:new Ao(typeof e=="string"||e instanceof URL?new Qi(e,t):e,r,o)}var Zi="urn:ietf:params:oauth:client-assertion-type:jwt-bearer";var Yb=URL.canParse?.bind(URL)??(t=>{try{return new URL(t),!0}catch{return!1}});function Yi(t){return!!(t.match(/^\d+\.\d+\.\d+\.\d+$/)||t.startsWith("[")&&t.endsWith("]"))}function So(t){return t==="localhost"||t==="127.0.0.1"||t==="[::1]"}function ev(t){let e=t.split(".");if(e.length<2)return!0;let r=e.at(-1).toLowerCase();return r==="test"||r==="local"||r==="localhost"||r==="invalid"||r==="example"}function tv(t){let e=t.startsWith("https://")?8:t.startsWith("http://")?7:-1;if(e===-1)throw new TypeError('URL must use the "https:" or "http:" protocol');let r=t.indexOf("#",e),o=t.indexOf("?",e),i=o!==-1&&(r===-1||o<r)?o:-1,s=r===-1?i===-1?t.length:i:i===-1?r:Math.min(r,i),a=t.indexOf("/",e),c=a===-1||a>s?s:a;if(e===c)throw new TypeError("URL must contain a host");return t.substring(c,s)}var qa=t=>{if(typeof t=="string"&&t.startsWith("{")&&t.endsWith("}"))try{return JSON.parse(t)}catch{return t}return t},rv=t=>{if(typeof t=="string"){let e=Number(t);if(!Number.isNaN(e))return e}return t};var ov=(t,e)=>{if(t.length===0)throw new TypeError("Value cannot be empty");if(t.includes(" "))throw new TypeError("Value cannot contain spaces");let r=e.length,o=t.length;if(r<o)return!1;let i=e.indexOf(t),s;for(;i!==-1;){if(s=i+o,(i===0||e.charCodeAt(i-1)===32)&&(s===r||e.charCodeAt(s)===32))return!0;i=e.indexOf(t,s+1)}return!1};var Ro=n.string().refine(t=>t.includes(":")&&Yb(t),{message:"Invalid URL"}),Ba=Ro.superRefine((t,e)=>{if(!t.startsWith("http://"))return e.addIssue({code:y.custom,message:'URL must use the "http:" protocol'}),!1;let r=new URL(t);return So(r.hostname)?!0:(e.addIssue({code:y.custom,message:'URL must use "localhost", "127.0.0.1" or "[::1]" as hostname'}),!1)}),Co=Ro.superRefine((t,e)=>{if(!t.startsWith("https://"))return e.addIssue({code:y.custom,message:'URL must use the "https:" protocol'}),!1;let r=new URL(t);if(So(r.hostname))return e.addIssue({code:y.custom,message:"https: URL must not use a loopback host"}),!1;if(!Yi(r.hostname)){if(!r.hostname.includes("."))return e.addIssue({code:y.custom,message:"Domain name must contain at least two segments"}),!1;if(r.hostname.endsWith(".local"))return e.addIssue({code:y.custom,message:'Domain name must not end with ".local"'}),!1}return!0}),K=n.string().superRefine((t,e)=>{if(t.startsWith("http://")){let r=Ba.safeParse(t);return r.success||r.error.issues.forEach(e.addIssue,e),r.success}if(t.startsWith("https://")){let r=Co.safeParse(t);return r.success||r.error.issues.forEach(e.addIssue,e),r.success}return e.addIssue({code:y.custom,message:'URL must use the "http:" or "https:" protocol'}),!1}),iv=Ro.superRefine((t,e)=>{let r=t.indexOf("."),o=t.indexOf(":");if(r===-1||o===-1||r>o)return e.addIssue({code:y.custom,message:'Private-use URI scheme requires a "." as part of the protocol'}),!1;let i=new URL(t);if(!i.protocol.includes("."))return e.addIssue({code:y.custom,message:"Invalid private-use URI scheme"}),!1;let a=i.protocol.slice(0,-1).split(".").reverse().join(".");return ev(a)&&e.addIssue({code:y.custom,message:"Private-use URI Scheme redirect URI must not be a local hostname"}),i.href.startsWith(`${i.protocol}//`)||i.username||i.password||i.hostname||i.port?(e.addIssue({code:y.custom,message:"Private-Use URI Scheme must be in the form <scheme>:/{path} (notice the single slash!) as per RFC 8252"}),!1):!0});var sv=Object.freeze(["http://127.0.0.1/","http://[::1]/"]);var yP=/^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/,La=t=>yP.test(t),Dr=n.string().refine(La,{message:"Invalid OAuth scope"});var nv="atproto";function $a(t){return La(t)&&ov(nv,t)}var av=n.string().refine($a,{message:"Invalid ATProto OAuth scope"}),pv=nv;var he=n.string().min(1);var cv=Ba.superRefine((t,e)=>t.startsWith("http://localhost")?(e.addIssue({code:y.custom,message:'Use of "localhost" hostname is not allowed (RFC 8252), use a loopback IP such as "127.0.0.1" instead'}),!1):!0),Ma=cv,Tr=n.string().superRefine((t,e)=>{if(t.startsWith("https:")){let r=Co.safeParse(t);return r.success||r.error.issues.forEach(e.addIssue,e),r.success}else if(t.startsWith("http:")){let r=cv.safeParse(t);return r.success||r.error.issues.forEach(e.addIssue,e),r.success}else if(/^[^.:]+(?:\.[^.:]+)+:/.test(t)){let r=iv.safeParse(t);return r.success||r.error.issues.forEach(e.addIssue,e),r.success}else return e.addIssue({code:y.custom,message:'URL must use the "https:" or "http:" protocol, or a private-use URI scheme (RFC 8252)'}),!1});var gt="http://localhost",dv=he.superRefine((t,e)=>{let r=Oa(t);return r.success||e.addIssue({code:"custom",message:r.message}),r.success});function lv(t){Va(t)}function uv(t){return Oa(t).success}function Va(t){let e=Oa(t);if(e.success)return e.value;throw new TypeError(`Invalid loopback client ID: ${e.message}`)}function Oa(t){if(!t.startsWith(gt))return{success:!1,message:`Value must start with "${gt}"`};if(t.includes("#",gt.length))return{success:!1,message:"Value must not contain a hash component"};let e=t.length>gt.length&&t.charCodeAt(gt.length)===47?gt.length+1:gt.length;if(t.length!==e&&t.charCodeAt(e)!==63)return{success:!1,message:"Value must not contain a path component"};let r=t.slice(e+1);return gP(r)}function gP(t){let e={},r=typeof t=="string"?new URLSearchParams(t):t;for(let[o,i]of r)if(o==="scope"){if("scope"in e)return{success:!1,message:'Duplicate "scope" query parameter'};let s=Dr.safeParse(i);if(!s.success)return{success:!1,message:`Invalid "scope" query parameter: ${s.error.issues.map(c=>c.message).join(", ")||"Validation failed"}`};e.scope=s.data}else if(o==="redirect_uri"){let s=Ma.safeParse(i);if(!s.success)return{success:!1,message:`Invalid "redirect_uri" query parameter: ${s.error.issues.map(c=>c.message).join(", ")||"Validation failed"}`};e.redirect_uris==null?e.redirect_uris=[s.data]:e.redirect_uris.push(s.data)}else return{success:!1,message:`Unexpected query parameter "${o}"`};return{success:!0,value:e}}function fv(t){let{scope:e=pv,redirect_uris:r}=Va(t);if(!$a(e))throw new TypeError('ATProto Loopback ClientID must include "atproto" scope');return{scope:e,redirect_uris:r??[...sv]}}function za(t){let e=fv(t);return bP(t,e)}function bP(t,e){return{client_id:t,scope:e.scope,redirect_uris:e.redirect_uris,response_types:["code"],grant_types:["authorization_code","refresh_token"],token_endpoint_auth_method:"none",application_type:"native",dpop_bound_access_tokens:!0}}var vP=n.object({type:n.string(),locations:n.array(Ro).optional(),actions:n.array(n.string()).optional(),datatypes:n.array(n.string()).optional(),identifier:n.string().optional(),privileges:n.array(n.string()).optional()}),es=n.array(vP);var mv=n.union([n.string().regex(/^DPoP$/i).transform(()=>"DPoP"),n.string().regex(/^Bearer$/i).transform(()=>"Bearer")]);var hv=n.object({access_token:n.string(),token_type:mv,scope:n.string().optional(),refresh_token:n.string().optional(),expires_in:n.number().optional(),id_token:lt.optional(),authorization_details:es.optional()}).passthrough();var yv=hv.extend({token_type:n.literal("DPoP"),sub:Pb,scope:av,id_token:n.never().optional()});var gv=n.string().min(1);var bv=n.object({grant_type:n.literal("authorization_code"),code:n.string().min(1),redirect_uri:Tr,code_verifier:n.string().min(43).max(128).regex(/^[a-zA-Z0-9-._~]+$/).optional()});var ts=n.object({request:n.union([lt,Qg])});var rs=n.enum(["S256","plain"]);var os=n.enum(["none","login","consent","select_account","create"]);var vv=n.enum(["query","fragment","form_post"]);var is=n.enum(["code","token","none","code id_token token","code id_token","code token","id_token token","id_token"]);var xv=n.enum(["auth_time","nonce","acr","name","family_name","given_name","middle_name","nickname","preferred_username","gender","picture","profile","website","birthdate","zoneinfo","locale","updated_at","email","email_verified","phone_number","phone_number_verified","address"]);var wv=n.union([n.string(),n.number(),n.boolean()]),kv=n.object({essential:n.boolean().optional(),value:wv.optional(),values:n.array(wv).optional()});var Av=n.enum(["userinfo","id_token"]);var ss=n.object({client_id:he,state:n.string().optional(),redirect_uri:Tr.optional(),scope:Dr.optional(),response_type:is,code_challenge:n.string().optional(),code_challenge_method:rs.optional(),dpop_jkt:n.string().optional(),response_mode:vv.optional(),nonce:n.string().optional(),max_age:n.preprocess(rv,n.number().int().min(0)).optional(),claims:n.preprocess(qa,n.record(Av,n.record(xv,n.union([n.literal(null),kv])))).optional(),login_hint:n.string().min(1).optional(),ui_locales:n.string().regex(/^[a-z]{2,3}(-[A-Z]{2})?( [a-z]{2,3}(-[A-Z]{2})?)*$/).optional(),id_token_hint:lt.optional(),display:n.enum(["page","popup","touch","wap"]).optional(),prompt:os.optional(),authorization_details:n.preprocess(qa,es).optional()});var N3=n.union([ss,ts]);var Sv=n.string().min(1);var Rv=n.object({request_uri:Sv});var o5=n.intersection(n.object({client_id:he}),n.union([ss,ts,Rv]));var n5=n.enum(["invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable"]);var bt=K.superRefine((t,e)=>{if(t.endsWith("/"))return e.addIssue({code:n.ZodIssueCode.custom,message:"Issuer URL must not end with a slash"}),!1;let r=new URL(t);if(r.username||r.password)return e.addIssue({code:n.ZodIssueCode.custom,message:"Issuer URL must not contain a username or password"}),!1;if(r.hash||r.search)return e.addIssue({code:n.ZodIssueCode.custom,message:"Issuer URL must not contain a query or fragment"}),!1;let o=r.pathname==="/"?r.origin:r.href;return t!==o?(e.addIssue({code:n.ZodIssueCode.custom,message:"Issuer URL must be in the canonical form"}),!1):!0});var xP=n.object({issuer:bt,claims_supported:n.array(n.string()).optional(),claims_locales_supported:n.array(n.string()).optional(),claims_parameter_supported:n.boolean().optional(),request_parameter_supported:n.boolean().optional(),request_uri_parameter_supported:n.boolean().optional(),require_request_uri_registration:n.boolean().optional(),scopes_supported:n.array(n.string()).optional(),subject_types_supported:n.array(n.string()).optional(),response_types_supported:n.array(n.string()).optional(),response_modes_supported:n.array(n.string()).optional(),grant_types_supported:n.array(n.string()).optional(),code_challenge_methods_supported:n.array(rs).min(1).optional(),ui_locales_supported:n.array(n.string()).optional(),id_token_signing_alg_values_supported:n.array(n.string()).optional(),display_values_supported:n.array(n.string()).optional(),request_object_signing_alg_values_supported:n.array(n.string()).optional(),authorization_response_iss_parameter_supported:n.boolean().optional(),authorization_details_types_supported:n.array(n.string()).optional(),request_object_encryption_alg_values_supported:n.array(n.string()).optional(),request_object_encryption_enc_values_supported:n.array(n.string()).optional(),jwks_uri:K.optional(),authorization_endpoint:K,token_endpoint:K,token_endpoint_auth_methods_supported:n.array(n.string()).default(["client_secret_basic"]),token_endpoint_auth_signing_alg_values_supported:n.array(n.string()).optional(),revocation_endpoint:K.optional(),introspection_endpoint:K.optional(),pushed_authorization_request_endpoint:K.optional(),require_pushed_authorization_requests:n.boolean().optional(),userinfo_endpoint:K.optional(),end_session_endpoint:K.optional(),registration_endpoint:K.optional(),dpop_signing_alg_values_supported:n.array(n.string()).optional(),protected_resources:n.array(K).optional(),client_id_metadata_document_supported:n.boolean().optional(),prompt_values_supported:n.array(os).optional()}),Cv=xP.superRefine((t,e)=>{t.require_pushed_authorization_requests&&!t.pushed_authorization_request_endpoint&&e.addIssue({code:n.ZodIssueCode.custom,message:'"pushed_authorization_request_endpoint" required when "require_pushed_authorization_requests" is true'})}).superRefine((t,e)=>{t.response_types_supported&&(t.response_types_supported.includes("code")||e.addIssue({code:n.ZodIssueCode.custom,message:'Response type "code" is required'}))}).superRefine((t,e)=>{t.token_endpoint_auth_signing_alg_values_supported?.includes("none")&&e.addIssue({code:n.ZodIssueCode.custom,message:'Client authentication method "none" is not allowed'})});var _v=n.object({grant_type:n.literal("client_credentials")});var wP=n.object({client_id:he,client_assertion_type:n.literal(Zi),client_assertion:lt}),kP=n.object({client_id:he,client_secret:n.string()}),AP=n.object({client_id:he}),A5=n.union([wP,kP,AP]);var ns=n.intersection(he,Co).superRefine((t,e)=>{let r=new URL(t);return r.username||r.password?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID must not contain credentials"}),!1):r.hash?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID must not contain a fragment"}),!1):r.pathname==="/"?(e.addIssue({code:n.ZodIssueCode.custom,message:'ClientID must contain a path component (e.g. "/client-metadata.json")'}),!1):r.pathname.endsWith("/")?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID path must not end with a trailing slash"}),!1):Yi(r.hostname)?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID hostname must not be an IP address"}),!1):tv(t)!==r.pathname?(e.addIssue({code:n.ZodIssueCode.custom,message:`ClientID must be in canonical form ("${r.href}", got "${t}")`}),!1):!0});var I5=ns.superRefine((t,e)=>{let r=new URL(t);return r.port?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID must not contain a port"}),!1):r.search?(e.addIssue({code:n.ZodIssueCode.custom,message:"ClientID must not contain a query string"}),!1):r.pathname!=="/oauth-client-metadata.json"?(e.addIssue({code:n.ZodIssueCode.custom,message:'ClientID must be "/oauth-client-metadata.json"'}),!1):!0});function as(t){ns.parse(t)}var Ev=n.enum(["client_secret_basic","client_secret_jwt","client_secret_post","none","private_key_jwt","self_signed_tls_client_auth","tls_client_auth"]);var Iv=n.enum(["authorization_code","implicit","refresh_token","password","client_credentials","urn:ietf:params:oauth:grant-type:jwt-bearer","urn:ietf:params:oauth:grant-type:saml2-bearer"]);var ps=n.object({redirect_uris:n.array(Tr).nonempty(),response_types:n.array(is).nonempty().default(["code"]),grant_types:n.array(Iv).nonempty().default(["authorization_code"]),scope:Dr.optional(),token_endpoint_auth_method:Ev.default("client_secret_basic"),token_endpoint_auth_signing_alg:n.string().optional(),userinfo_signed_response_alg:n.string().optional(),userinfo_encrypted_response_alg:n.string().optional(),jwks_uri:K.optional(),jwks:Xg.optional(),application_type:n.enum(["web","native"]).default("web"),subject_type:n.enum(["public","pairwise"]).default("public"),request_object_signing_alg:n.string().optional(),id_token_signed_response_alg:n.string().optional(),authorization_signed_response_alg:n.string().default("RS256"),authorization_encrypted_response_enc:n.enum(["A128CBC-HS256"]).optional(),authorization_encrypted_response_alg:n.string().optional(),client_id:he.optional(),client_name:n.string().optional(),client_uri:K.optional(),policy_uri:K.optional(),tos_uri:K.optional(),logo_uri:K.optional(),default_max_age:n.number().optional(),require_auth_time:n.boolean().optional(),contacts:n.array(n.string().email()).optional(),tls_client_certificate_bound_access_tokens:n.boolean().optional(),dpop_bound_access_tokens:n.boolean().optional(),authorization_details_types:n.array(n.string()).optional()});var Dv=n.object({request_uri:n.string(),expires_in:n.number().int().positive()});var Tv=n.object({grant_type:n.literal("password"),username:n.string(),password:n.string()});var Pv=n.object({resource:K.refine(t=>!t.includes("?"),{message:"Resource URL must not contain query parameters"}).refine(t=>!t.includes("#"),{message:"Resource URL must not contain a fragment"}),authorization_servers:n.array(bt).optional(),jwks_uri:K.optional(),scopes_supported:n.array(n.string()).optional(),bearer_methods_supported:n.array(n.enum(["header","body","query"])).optional(),resource_signing_alg_values_supported:n.array(n.string()).optional(),resource_documentation:K.optional(),resource_policy_uri:K.optional(),resource_tos_uri:K.optional()});var cs=n.string().min(1);var jv=n.object({grant_type:n.literal("refresh_token"),refresh_token:cs});var pH=n.object({token:n.union([gv,cs]),token_type_hint:n.enum(["access_token","refresh_token"]).optional()});var hH=n.discriminatedUnion("grant_type",[bv,jv,Tv,_v]);var bH=n.enum(["interaction_required","login_required","account_selection_required","consent_required","invalid_request_uri","invalid_request_object","request_not_supported","request_uri_not_supported","registration_not_supported"]);var wH=n.object({sub:n.string(),iss:n.string().url().optional(),aud:n.union([n.string(),n.array(n.string()).min(1)]).optional(),email:n.string().email().optional(),email_verified:n.boolean().optional(),name:n.string().optional(),preferred_username:n.string().optional(),picture:n.string().url().optional()});var ds=new Map;function SP(t){return new Promise(e=>{let o=(ds.get(t)??Promise.resolve()).then(()=>new Promise(i=>{e(()=>{ds.get(t)===o&&ds.delete(t),i()})}));ds.set(t,o)})}var qv=(t,e)=>SP(t).then(async r=>{try{return await e()}finally{r()}});var Ga=t=>typeof t=="string"?t:void 0;function ls(t){return t.get("content-type")?.split(";")[0].trim()}function us(t){if(typeof AbortSignal.timeout=="function")return AbortSignal.timeout(t);let e=new AbortController;return setTimeout(()=>e.abort(RP(t)),t),e.signal}function RP(t){let e=`The operation timed out after ${t} ms`;return typeof DOMException=="function"?new DOMException(e,"TimeoutError"):new Error(e)}function Bv(t){let e=new Ua,r=function(o){let i=new Error("This operation was aborted",{cause:this.reason});e.abort(i)};try{for(let o of t)o&&(o.throwIfAborted(),o.addEventListener("abort",r,{signal:e.signal}));return e}catch(o){throw e.abort(o),o}}var Ua=class extends AbortController{[Symbol.dispose](){this.abort(new Error("AbortController was disposed"))}};var fs=class extends Re{constructor(e,r,o){super(async(i,s)=>this.fetchMetadata(i,s),mt(e,o?.onCacheError)),this.fetch=Ce(r),this.allowHttpIssuer=o?.allowHttpIssuer===!0}async get(e,r){let o=bt.parse(String(e));if(!this.allowHttpIssuer&&o.startsWith("http:"))throw new TypeError("Unsecure issuer URL protocol only allowed in development and test environments");return super.get(o,r)}async fetchMetadata(e,r){let o=new URL("/.well-known/oauth-authorization-server",e),i=new Request(o,{headers:{accept:"application/json"},cache:r?.noCache?"no-cache":void 0,signal:r?.signal,redirect:"manual"}),s=await this.fetch(i);if(s.status!==200)throw await Te(s,"log"),await te.from(s,`Unexpected status code ${s.status} for "${o}"`,void 0,{cause:i});if(ls(s.headers)!=="application/json")throw await Te(s,"log"),await te.from(s,`Unexpected content type for "${o}"`,void 0,{cause:i});let a=Cv.parse(await s.json());if(a.issuer!==e)throw new TypeError(`Invalid issuer ${a.issuer}`);if(a.client_id_metadata_document_supported!==!0)throw new TypeError(`Authorization server "${e}" does not support client_id_metadata_document`);return a}};var pe=class t extends Error{static from(e,r,o){if(e instanceof t)return e;let i=e instanceof Error?e.message:void 0;return new t(r,i,o,e)}constructor(e,r=e.get("error_description")||"OAuth callback error",o,i){super(r,{cause:i}),this.params=e,this.state=o}};var _o="handle.invalid";var Pr=class extends Error{constructor(){super(...arguments),this.name="IdentityResolverError"}};function CP(t){if(t.alsoKnownAs){for(let e of t.alsoKnownAs)if(e.startsWith("at://"))return e.slice(5)}}function ms(t){let e=CP(t);if(e)return Fa(e)}function Fa(t){let e=_P(t);return EP(e)?e:void 0}function _P(t){return t.toLowerCase()}function EP(t){return t.length>0&&t.length<254&&/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/.test(t)}var hs=class{constructor(e,r){this.didResolver=e,this.handleResolver=r}async resolve(e,r){return vo(e)?this.resolveFromDid(e,r):this.resolveFromHandle(e,r)}async resolveFromDid(e,r){let o=await this.getDocumentFromDid(e,r);r?.signal?.throwIfAborted();let i=ms(o),s=i?await this.handleResolver.resolve(i,r).catch(()=>{}):void 0;return{did:o.id,didDoc:o,handle:i&&s===e?i:_o}}async resolveFromHandle(e,r){let o=await this.getDocumentFromHandle(e,r);return{did:o.id,didDoc:o,handle:ms(o)||_o}}async getDocumentFromDid(e,r){return this.didResolver.resolve(e,r)}async getDocumentFromHandle(e,r){let o=Fa(e);if(!o)throw new Pr(`Invalid handle "${e}" provided.`);let i=await this.handleResolver.resolve(o,r);if(!i)throw new Pr(`Handle "${o}" does not resolve to a DID`);r?.signal?.throwIfAborted();let s=await this.didResolver.resolve(i,r);if(o!==ms(s))throw new Pr(`Did document for "${i}" does not include the handle "${o}"`);return s}};function Na(t){if("identityResolver"in t&&t.identityResolver!=null)return t.identityResolver;if("handleResolver"in t&&t.handleResolver!=null){let e=Qb(t),r=Zb(t);return new hs(e,r)}throw new TypeError("identityResolver or handleResolver option is required")}var Ne="ES256";var Ke=class extends Error{};var vt=class extends Error{constructor(e,r=`The session for "${e}" was successfully revoked`,o){super(r,o),this.sub=e}};function Lv(t,e,r){let o=e.token_endpoint_auth_method,i=Mv(t);if(!i.includes(o))throw new Error(`The server does not support "${o}" authentication. Supported methods are: ${i.join(", ")}.`);if(o==="private_key_jwt"){if(!r)throw new Error("A keyset is required for private_key_jwt");let s=Vv(t);for(let a of r.list({alg:s,usage:"sign"}))if(a.kid)return{method:"private_key_jwt",kid:a.kid};throw new Error(s.includes(Ne)?`Client authentication method "${o}" requires at least one "${Ne}" signing key with a "kid" property`:`Authorization server requires "${o}" authentication method, but does not support "${Ne}" algorithm.`)}if(o==="none")return{method:"none"};throw new Error('The ATProto OAuth spec requires that client use either "none" or "private_key_jwt" authentication method.'+(o==="client_secret_basic"?' You might want to explicitly set "token_endpoint_auth_method" to one of those values in the client metadata document.':` You set "${o}" which is not allowed.`))}function $v(t,e,r,o,i){if(!Mv(e).includes(t.method))throw new Ke(`Client authentication method "${t.method}" no longer supported`);if(t.method==="none")return()=>({payload:{client_id:r.client_id}});if(t.method==="private_key_jwt")try{if(!i)throw new Error("A keyset is required for private_key_jwt");let{key:s,alg:a}=i.findPrivateKey({usage:"sign",kid:t.kid,alg:Vv(e)});return async()=>({payload:{client_id:r.client_id,client_assertion_type:Zi,client_assertion:await s.createJwt({alg:a},{iss:r.client_id,sub:r.client_id,aud:e.issuer,jti:await o.generateNonce(),iat:Math.floor(Date.now()/1e3),exp:Math.floor(Date.now()/1e3)+60})}})}catch(s){throw new Ke("Failed to load private key",{cause:s})}throw new Ke(`Unsupported auth method ${t.method}`)}function Mv(t){return t.token_endpoint_auth_methods_supported}function Vv(t){return t.token_endpoint_auth_signing_alg_values_supported??[Ne]}var ys=class extends Re{constructor(e,r=globalThis.fetch,o){super(async(i,s)=>this.fetchMetadata(i,s),mt(e,o?.onCacheError)),this.fetch=Ce(r),this.allowHttpResource=o?.allowHttpResource===!0}async get(e,r){let{protocol:o,origin:i}=new URL(e);if(o!=="https:"&&o!=="http:")throw new TypeError(`Invalid protected resource metadata URL protocol: ${o}`);if(o==="http:"&&!this.allowHttpResource)throw new TypeError(`Unsecure resource metadata URL (${o}) only allowed in development and test environments`);return super.get(i,r)}async fetchMetadata(e,r){let o=new URL("/.well-known/oauth-protected-resource",e),i=new Request(o,{signal:r?.signal,headers:{accept:"application/json"},cache:r?.noCache?"no-cache":void 0,redirect:"manual"}),s=await this.fetch(i);if(s.status===404)return await Te(s,"log"),null;if(s.status!==200)throw await Te(s,"log"),await te.from(s,`Unexpected status code ${s.status} for "${o}"`,void 0,{cause:i});if(ls(s.headers)!=="application/json")throw await Te(s,"log"),await te.from(s,`Unexpected content type for "${o}"`,void 0,{cause:i});let a=Pv.parse(await s.json());if(a.resource!==e)throw new TypeError(`Invalid issuer ${a.resource}`);return a}};var ot=class t extends Error{constructor(e,r){super(e,r)}static from(e,r){if(e instanceof t)return e;let o=e instanceof Y?`${e.errors[0].path} ${e.errors[0].message}`:null,i=(r??"Unable to resolve identity")+(o?` (${o})`:"");return new t(i,{cause:e})}};var gs=class{constructor(e,r,o){this.identityResolver=e,this.protectedResourceMetadataResolver=r,this.authorizationServerMetadataResolver=o}async resolve(e,r){return/^https?:\/\//.test(e)?this.resolveFromService(e,r):this.resolveFromIdentity(e,r)}async resolveFromService(e,r){try{return{metadata:await this.getResourceServerMetadata(e,r)}}catch(o){if(!r?.signal?.aborted&&o instanceof ot)try{let i=bt.safeParse(e);if(i.success)return{metadata:await this.getAuthorizationServerMetadata(i.data,r)}}catch{}throw o}}async resolveFromIdentity(e,r){let o=await this.resolveIdentity(e,r);r?.signal?.throwIfAborted();let i=Bb(o.didDoc),s=await this.getResourceServerMetadata(i,r);return{identityInfo:o,metadata:s,pds:i}}async resolveIdentity(e,r){try{return await this.identityResolver.resolve(e,r)}catch(o){throw ot.from(o,`Failed to resolve identity: ${e}`)}}async getAuthorizationServerMetadata(e,r){try{return await this.authorizationServerMetadataResolver.get(e,r)}catch(o){throw ot.from(o,`Failed to resolve OAuth server metadata for issuer: ${e}`)}}async getResourceServerMetadata(e,r){try{let o=await this.protectedResourceMetadataResolver.get(e,r);if(!o)return this.getAuthorizationServerMetadata(e,r);if(o.authorization_servers?.length!==1)throw new ot(o.authorization_servers?.length?`Unable to determine authorization server for PDS: ${e}`:`No authorization servers found for PDS: ${e}`);let i=o.authorization_servers[0];r?.signal?.throwIfAborted();let s=await this.getAuthorizationServerMetadata(i,r);if(s.protected_resources&&!s.protected_resources.includes(o.resource))throw new ot(`PDS "${e}" not protected by issuer "${i}"`);return s}catch(o){throw ot.from(o,`Failed to resolve OAuth server metadata for resource: ${e}`)}}};var _e=class extends Error{constructor(e,r,o){super(r,o),this.sub=e}};var Ka=globalThis.crypto?.subtle,Ov=globalThis.ReadableStream;function bs({key:t,supportedAlgs:e,nonces:r,sha256:o=typeof Ka<"u"?PP:void 0,isAuthServer:i,fetch:s=globalThis.fetch}){if(!o)throw new TypeError("crypto.subtle is not available in this environment. Please provide a sha256 function.");let a=TP(t,e);return async function(c,u){let f=u==null&&c instanceof Request?c:new Request(c,u),m=f.headers.get("Authorization"),h=m?.startsWith("DPoP ")?await o(m.slice(5)):void 0,{origin:g}=new URL(f.url),b=f.method,v=IP(f.url),x;try{x=await r.get(g)}catch{}let I=await zv(t,a,b,v,x,h);f.headers.set("DPoP",I);let k=await s.call(this,f),B=k.headers.get("DPoP-Nonce");if(!B||B===x)return k;try{await r.set(g,B)}catch{}if(!await DP(k,i)||c===f||Ov&&u?.body instanceof Ov)return k;await Te(k,"log");let z=await zv(t,a,b,v,B,h),N=new Request(c,u);N.headers.set("DPoP",z);let Z=await s.call(this,N),H=Z.headers.get("DPoP-Nonce");if(!H||H===x)return Z;try{await r.set(g,H)}catch{}return Z}}function IP(t){let e=t.indexOf("#"),r=t.indexOf("?"),o=e===-1?r:r===-1?e:Math.min(e,r);return o===-1?t:t.slice(0,o)}async function zv(t,e,r,o,i,s){let a=t.bareJwk;if(!a)throw new Error("Only asymmetric keys can be used as DPoP proofs");let c=Math.floor(Date.now()/1e3);return t.createJwt({alg:e,typ:"dpop+jwt",jwk:a},{iat:c,jti:Math.random().toString(36).slice(2),htm:r,htu:o,nonce:i,ath:s})}async function DP(t,e){if((e===void 0||e===!1)&&t.status===401){let r=t.headers.get("WWW-Authenticate");if(r?.startsWith("DPoP"))return r.includes('error="use_dpop_nonce"')}if((e===void 0||e===!0)&&t.status===400)try{return(await Xb(t,10240))?.error==="use_dpop_nonce"}catch{return!1}return!1}function TP(t,e){if(e){let r=e.find(o=>t.algorithms.includes(o));if(r)return r}else{let[r]=t.algorithms;if(r)return r}throw new Error("Key does not match any alg supported by the server")}async function PP(t){if(Ka==null)throw new Error("crypto.subtle is not available in this environment. Please provide a sha256 function.");let e=new TextEncoder().encode(t),r=await Ka.digest("SHA-256",e),o=new Uint8Array(r);return ke.baseEncode(o)}var jr=class extends Error{constructor(e,r){let o=Ga(r?.error),i=Ga(r?.error_description),s=o?`"${o}"`:"unknown",a=i?`: ${i}`:"",c=`OAuth ${s} error${a}`;super(c),this.response=e,this.payload=r,this.error=o,this.errorDescription=i}get status(){return this.response.status}get headers(){return this.response.headers}};var vs=class{constructor(e,r,o,i,s,a,c,u,f){this.authMethod=e,this.dpopKey=r,this.serverMetadata=o,this.clientMetadata=i,this.dpopNonces=s,this.oauthResolver=a,this.runtime=c,this.keyset=u,this.clientCredentialsFactory=$v(e,o,i,c,u),this.dpopFetch=bs({fetch:Ce(f),key:r,supportedAlgs:o.dpop_signing_alg_values_supported,sha256:async m=>c.sha256(m),nonces:s,isAuthServer:!0})}get issuer(){return this.serverMetadata.issuer}async revoke(e){try{await this.request("revocation",{token:e})}catch{}}async exchangeCode(e,r,o){let i=Date.now(),s=await this.request("token",{grant_type:"authorization_code",redirect_uri:o??this.clientMetadata.redirect_uris[0],code:e,code_verifier:r});try{return{aud:await this.verifyIssuer(s.sub),sub:s.sub,iss:this.issuer,scope:s.scope,refresh_token:s.refresh_token,access_token:s.access_token,token_type:s.token_type,expires_at:typeof s.expires_in=="number"?new Date(i+s.expires_in*1e3).toISOString():void 0}}catch(a){throw await this.revoke(s.access_token),a}}async refresh(e){if(!e.refresh_token)throw new _e(e.sub,"No refresh token available");let r=await this.verifyIssuer(e.sub),o=Date.now(),i=await this.request("token",{grant_type:"refresh_token",refresh_token:e.refresh_token});return{aud:r,sub:e.sub,iss:this.issuer,scope:i.scope,refresh_token:i.refresh_token,access_token:i.access_token,token_type:i.token_type,expires_at:typeof i.expires_in=="number"?new Date(o+i.expires_in*1e3).toISOString():void 0}}async verifyIssuer(e){let r=await this.oauthResolver.resolveFromIdentity(e,{noCache:!0,allowStale:!1,signal:us(1e4)});if(this.issuer!==r.metadata.issuer)throw new TypeError("Issuer mismatch");return r.pds.href}async request(e,r){let o=this.serverMetadata[`${e}_endpoint`];if(!o)throw new Error(`No ${e} endpoint available`);let i=await this.clientCredentialsFactory(),{response:s,json:a}=await this.dpopFetch(o,{method:"POST",headers:{...i.headers,"Content-Type":"application/x-www-form-urlencoded"},body:jP({...r,...i.payload})}).then(Ir());if(s.ok)switch(e){case"token":return yv.parse(a);case"pushed_authorization_request":return Dv.parse(a);default:return a}else throw new jr(s,a)}};function jP(t){return new URLSearchParams(Object.entries(t).filter(qP).map(BP)).toString()}function qP(t){return t[1]!==void 0}function BP(t){let e=t[0],r=t[1];switch(typeof r){case"string":return[e,r];case"number":case"boolean":return[e,String(r)];default:{let o=JSON.stringify(r);if(o===void 0)throw new Error(`Unsupported value type for ${e}: ${String(r)}`);return[e,o]}}}var xs=class{constructor(e,r,o,i,s,a){this.clientMetadata=e,this.runtime=r,this.resolver=o,this.fetch=i,this.keyset=s,this.dpopNonceCache=a}async fromIssuer(e,r,o,i){let s=await this.resolver.getAuthorizationServerMetadata(e,i);return this.fromMetadata(s,r,o)}async fromMetadata(e,r,o){return new vs(r,o,e,this.clientMetadata,this.dpopNonceCache,this.resolver,this.runtime,this.keyset,this.fetch)}};var qr=class extends Error{constructor(e,r=`The session for "${e}" is invalid`,o){super(r,o),this.sub=e}};var Uv=globalThis.ReadableStream,ws=class{constructor(e,r,o,i=globalThis.fetch){this.server=e,this.sub=r,this.sessionGetter=o,this.dpopFetch=bs({fetch:Ce(i),key:e.dpopKey,supportedAlgs:e.serverMetadata.dpop_signing_alg_values_supported,sha256:async s=>e.runtime.sha256(s),nonces:e.dpopNonces,isAuthServer:!1})}get did(){return this.sub}get serverMetadata(){return this.server.serverMetadata}async getTokenSet(e){let{tokenSet:r}=await this.sessionGetter.getSession(this.sub,e);return r}async getTokenInfo(e="auto"){let r=await this.getTokenSet(e),o=r.expires_at==null?void 0:new Date(r.expires_at);return{expiresAt:o,get expired(){return o==null?void 0:o.getTime()<Date.now()-5e3},scope:r.scope,iss:r.iss,aud:r.aud,sub:r.sub}}async signOut(){try{let e=await this.getTokenSet(!1);await this.server.revoke(e.access_token)}finally{await this.sessionGetter.delStored(this.sub,new vt(this.sub))}}async fetchHandler(e,r){let o=await this.getTokenSet("auto"),i=new URL(e,o.aud),s=`${o.token_type} ${o.access_token}`,a=new Headers(r?.headers);a.set("Authorization",s);let c=await this.dpopFetch(i,{...r,headers:a});if(!Gv(c))return c;let u;try{u=await this.getTokenSet(!0)}catch{return c}if(Uv&&r?.body instanceof Uv)return c;let f=`${u.token_type} ${u.access_token}`,m=new URL(e,u.aud);a.set("Authorization",f);let h=await this.dpopFetch(m,{...r,headers:a});return Gv(h)&&await this.sessionGetter.delStored(this.sub,new qr(this.sub)),h}};function Gv(t){if(t.status!==401)return!1;let e=t.headers.get("WWW-Authenticate");return e!=null&&(e.startsWith("Bearer ")||e.startsWith("DPoP "))&&e.includes('error="invalid_token"')}var ks=class{constructor(e){this.implementation=e;let{requestLock:r}=e;this.hasImplementationLock=r!=null,this.usingLock=r?.bind(e)||qv}async generateKey(e){let r=Array.from(e).sort($P);return this.implementation.createKey(r)}async sha256(e){let r=new TextEncoder().encode(e),o=await this.implementation.digest(r,{name:"sha256"});return ke.baseEncode(o)}async generateNonce(e=16){let r=await this.implementation.getRandomValues(e);return ke.baseEncode(r)}async generatePKCE(e){let r=await this.generateVerifier(e);return{verifier:r,challenge:await this.sha256(r),method:"S256"}}async calculateJwkThumbprint(e){let r=LP(e),o=JSON.stringify(r);return this.sha256(o)}async generateVerifier(e=32){if(e<32||e>96)throw new TypeError("Invalid code_verifier length");let r=await this.implementation.getRandomValues(e);return ke.baseEncode(r)}};function LP(t){let e=r=>{let o=t[r];if(typeof o!="string"||!o)throw new TypeError(`"${r}" Parameter missing or invalid`);return o};switch(t.kty){case"EC":return{crv:e("crv"),kty:e("kty"),x:e("x"),y:e("y")};case"OKP":return{crv:e("crv"),kty:e("kty"),x:e("x")};case"RSA":return{e:e("e"),kty:e("kty"),n:e("n")};case"oct":return{k:e("k"),kty:e("kty")};default:throw new TypeError('"kty" (Key Type) Parameter missing or unsupported')}}function $P(t,e){if(t==="ES256K")return-1;if(e==="ES256K")return 1;for(let r of["ES","PS","RS"])if(t.startsWith(r)){if(e.startsWith(r)){let o=parseInt(t.slice(2,5)),i=parseInt(e.slice(2,5));return o-i}return-1}else if(e.startsWith(r))return 1;return 0}var MP=function(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var o,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=e[Symbol.asyncDispose]}if(o===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=e[Symbol.dispose],r&&(i=o)}if(typeof o!="function")throw new TypeError("Object not disposable.");i&&(o=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:o,async:r})}else r&&t.stack.push({async:!0});return e},VP=(function(t){return function(e){function r(a){e.error=e.hasError?new t(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var o,i=0;function s(){for(;o=e.stack.pop();)try{if(!o.async&&i===1)return i=0,e.stack.push(o),Promise.resolve().then(s);if(o.dispose){var a=o.dispose.call(o.value);if(o.async)return i|=2,Promise.resolve(a).then(s,function(c){return r(c),s()})}else i|=1}catch(c){r(c)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}})(typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var o=new Error(r);return o.name="SuppressedError",o.error=t,o.suppressed=e,o});function Ha(t){return t instanceof _e||t instanceof vt||t instanceof qr||t instanceof Ke||t instanceof TypeError}var As=class extends Re{#e;#r;#s;constructor(e,r,o,i={}){super(async(s,{signal:a},c)=>{if(c===void 0){let g="The session was deleted by another process",b=new _e(s,g);throw await i.onSessionDeleted?.call(null,s,b),b}let{dpopKey:u,authMethod:f,tokenSet:m}=c;if(s!==m.sub)throw new _e(s,"Stored session sub mismatch");if(!m.refresh_token)throw new _e(s,"No refresh token available");let h=await r.fromIssuer(m.iss,f,u,{signal:a});a?.throwIfAborted();try{let g=await h.refresh(m);if(s!==g.sub)throw new _e(s,"Token set sub mismatch");return{dpopKey:u,tokenSet:g,authMethod:h.authMethod}}catch(g){if(g instanceof jr&&g.status===400&&g.error==="invalid_grant"){if(!o.hasImplementationLock){await new Promise(x=>setTimeout(x,1e3));let v=await this.getStored(s);if(v===void 0){let x="The session was deleted by another process";throw new _e(s,x,{cause:g})}else if(v.tokenSet.access_token!==m.access_token||v.tokenSet.refresh_token!==m.refresh_token)return v}let b=g.errorDescription??"The session was revoked";throw new _e(s,b,{cause:g})}throw g}},e,{isStale:(s,{tokenSet:a})=>a.expires_at!=null&&new Date(a.expires_at).getTime()<Date.now()+1e4+3e4*Math.random(),deleteOnError:Ha}),this.#e=r,this.#r=o,this.#s=i}async setStored(e,r){if(e!==r.tokenSet.sub)throw new Error("Token set does not match the expected sub");try{await super.setStored(e,r)}catch(o){let i=[o];try{let{tokenSet:s,dpopKey:a,authMethod:c}=r;await(await this.#e.fromIssuer(s.iss,c,a)).revoke(s.refresh_token??s.access_token)}catch(s){i.push(s)}try{await this.delStored(e,o)}catch(s){i.push(s)}throw new AggregateError(i,`Failed to store session for ${e}`)}await this.#s.onSessionUpdated?.call(null,e,r)}async delStored(e,r){await super.delStored(e,r),await this.#s.onSessionDeleted?.call(null,e,r)}async get(e,r){let o=await this.#r.usingLock(`@atproto-oauth-client-${e}`,async()=>{let i={stack:[],error:void 0,hasError:!1};try{let s=us(3e4),a=MP(i,Bv([r?.signal,s]),!1);return await super.get(e,{...r,signal:a.signal})}catch(s){i.error=s,i.hasError=!0}finally{VP(i)}});if(e!==o.tokenSet.sub)throw new Error("Token set does not match the expected sub");return o}async getSession(e,r="auto"){return this.get(e,{noCache:r===!0,allowStale:r===!1})}};var Fv=ps.extend({client_id:n.union([ns,dv])});function Nv(t,e){!t.jwks&&!t.jwks_uri&&e?.size&&(t={...t,jwks:e.toJSON()});let r=Fv.parse(t);if(r.client_id.startsWith("http:")?lv(r.client_id):as(r.client_id),!r.scope?.split(" ")?.includes("atproto"))throw new TypeError('Client metadata must include the "atproto" scope');if(!r.response_types.includes("code"))throw new TypeError('"response_types" must include "code"');if(!r.grant_types.includes("authorization_code"))throw new TypeError('"grant_types" must include "authorization_code"');let i=r.token_endpoint_auth_method,s=r.token_endpoint_auth_signing_alg;switch(i){case"none":if(s)throw new TypeError(`"token_endpoint_auth_signing_alg" must not be provided when "token_endpoint_auth_method" is "${i}"`);break;case"private_key_jwt":{if(!s)throw new TypeError(`"token_endpoint_auth_signing_alg" must be provided when "token_endpoint_auth_method" is "${i}"`);if(!e)throw new TypeError(`Client authentication method "${i}" requires a keyset`);let a=Array.from(e.list({usage:"sign"})).filter(c=>c.kid);if(!a.length)throw new TypeError(`Client authentication method "${i}" requires at least one active signing key with a "kid" property`);if(!a.some(c=>c.algorithms.includes(Ne)))throw new TypeError(`Client authentication method "${i}" requires at least one active "${Ne}" signing key`);if(r.jwks){for(let c of a)if(!r.jwks.keys.some(u=>u.kid===c.kid&&!u.revoked))throw new TypeError(`Missing or inactive key "${c.kid}" in jwks. Make sure that every signing key of the Keyset is declared as an active key in the Metadata's JWKS.`)}else if(!r.jwks_uri)throw new TypeError(`Client authentication method "${i}" requires a JWKS`);break}default:throw new TypeError(`Unsupported "token_endpoint_auth_method" value: ${i}`)}return r}var Eo=class{static async fetchMetadata({clientId:e,fetch:r=globalThis.fetch,signal:o}){o?.throwIfAborted();let i=new Request(e,{redirect:"error",signal:o}),s=await r(i);if(s.status!==200)throw s.body?.cancel?.(),new TypeError(`Failed to fetch client metadata: ${s.status}`);let a=s.headers.get("content-type")?.split(";")[0].trim();if(a!=="application/json")throw s.body?.cancel?.(),new TypeError(`Invalid client metadata content type: ${a}`);let c=await s.json();return o?.throwIfAborted(),ps.parse(c)}constructor(e){let{stateStore:r,sessionStore:o,dpopNonceCache:i=new Fe({ttl:6e4,max:100}),authorizationServerMetadataCache:s=new Fe({ttl:6e4,max:100}),protectedResourceMetadataCache:a=new Fe({ttl:6e4,max:100}),responseMode:c,clientMetadata:u,runtimeImplementation:f,keyset:m}=e;this.keyset=m?m instanceof la?m:new la(m):void 0,this.clientMetadata=Nv(u,this.keyset),this.responseMode=c,this.runtime=new ks(f),this.fetch=e.fetch??globalThis.fetch,this.oauthResolver=new gs(Na(e),new ys(a,this.fetch,{allowHttpResource:e.allowHttp}),new fs(s,this.fetch,{allowHttpIssuer:e.allowHttp})),this.serverFactory=new xs(this.clientMetadata,this.runtime,this.oauthResolver,this.fetch,this.keyset,i),this.stateStore=r,this.sessionGetter=new As(o,this.serverFactory,this.runtime,e)}get identityResolver(){return this.oauthResolver.identityResolver}get jwks(){return this.keyset?.publicJwks??{keys:[]}}async authorize(e,{signal:r,...o}={}){let i=o?.redirect_uri??this.clientMetadata.redirect_uris[0];if(!this.clientMetadata.redirect_uris.includes(i))throw new TypeError("Invalid redirect_uri");let{identityInfo:s,metadata:a}=await this.oauthResolver.resolve(e,{signal:r}),c=await this.runtime.generatePKCE(),u=await this.runtime.generateKey(a.dpop_signing_alg_values_supported||[Ne]),f=Lv(a,this.clientMetadata,this.keyset),m=await this.runtime.generateNonce();await this.stateStore.set(m,{iss:a.issuer,dpopKey:u,authMethod:f,verifier:c.verifier,appState:o?.state});let h={...o,client_id:this.clientMetadata.client_id,redirect_uri:i,code_challenge:c.challenge,code_challenge_method:c.method,state:m,login_hint:s?s.handle!==_o?s.handle:s.did:void 0,response_mode:this.responseMode,response_type:"code",scope:o?.scope??this.clientMetadata.scope},g=new URL(a.authorization_endpoint);if(g.protocol!=="https:"&&g.protocol!=="http:")throw new TypeError(`Invalid authorization endpoint protocol: ${g.protocol}`);if(a.pushed_authorization_request_endpoint){let v=await(await this.serverFactory.fromMetadata(a,f,u)).request("pushed_authorization_request",h);return g.searchParams.set("client_id",this.clientMetadata.client_id),g.searchParams.set("request_uri",v.request_uri),g}else{if(a.require_pushed_authorization_requests)throw new Error("Server requires pushed authorization requests (PAR) but no PAR endpoint is available");for(let[v,x]of Object.entries(h))x&&g.searchParams.set(v,String(x));if(g.pathname.length+g.search.length<2048)return g;if(!a.pushed_authorization_request_endpoint)throw new Error("Login URL too long")}throw new Error("Server does not support pushed authorization requests (PAR)")}async abortRequest(e){e.searchParams.get("request_uri")}async callback(e,r={}){if(e.get("response")!=null)throw new pe(e,"JARM not supported");let i=e.get("iss"),s=e.get("state"),a=e.get("error"),c=e.get("code");if(!s)throw new pe(e,'Missing "state" parameter');let u=await this.stateStore.get(s);if(u)await this.stateStore.del(s);else throw new pe(e,`Unknown authorization session "${s}"`);try{if(a!=null)throw new pe(e,void 0,u.appState);if(!c)throw new pe(e,'Missing "code" query param',u.appState);let f=await this.serverFactory.fromIssuer(u.iss,u.authMethod,u.dpopKey);if(i!=null){if(!f.issuer)throw new pe(e,"Issuer not found in metadata",u.appState);if(f.issuer!==i)throw new pe(e,"Issuer mismatch",u.appState)}else if(f.serverMetadata.authorization_response_iss_parameter_supported)throw new pe(e,"iss missing from the response",u.appState);let m=await f.exchangeCode(c,u.verifier,r?.redirect_uri??f.clientMetadata.redirect_uris[0]);try{await this.revoke(m.sub)}catch{}try{return await this.sessionGetter.setStored(m.sub,{dpopKey:u.dpopKey,authMethod:f.authMethod,tokenSet:m}),{session:this.createSession(f,m.sub),state:u.appState??null}}catch(h){throw await f.revoke(m.refresh_token||m.access_token),h}}catch(f){throw pe.from(f,e,u.appState)}}async restore(e,r="auto"){Ra(e);let{dpopKey:o,authMethod:i,tokenSet:s}=await this.sessionGetter.getSession(e,r);try{let a=await this.serverFactory.fromIssuer(s.iss,i,o,{noCache:r===!0,allowStale:r===!1});return this.createSession(a,e)}catch(a){throw a instanceof Ke&&await this.sessionGetter.delStored(e,a),a}}async revoke(e){Ra(e);let r=await this.sessionGetter.getSession(e,!1).catch(a=>{if(Ha(a))return null;throw a});if(!r)return;let{dpopKey:o,authMethod:i,tokenSet:s}=r;try{await(await this.serverFactory.fromIssuer(s.iss,i,o)).revoke(s.access_token)}finally{await this.sessionGetter.delStored(e,new vt(e))}}createSession(e,r){return new ws(e,r,this.sessionGetter,this.fetch)}};var ZW=or(Yr(),1);var WW=or(Yr(),1);function OP(t,e,r){let o=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{e(t.result),o()},s=()=>{r(t.error||new Error("Unknown error")),o()};t.addEventListener("success",i),t.addEventListener("error",s)}function ce(t){return new Promise((e,r)=>{OP(t,e,r)})}var Ss=class{constructor(e){this.idbIndex=e}count(e){return ce(this.idbIndex.count(e))}get(e){return ce(this.idbIndex.get(e))}getKey(e){return ce(this.idbIndex.getKey(e))}getAll(e,r){return ce(this.idbIndex.getAll(e,r))}getAllKeys(e,r){return ce(this.idbIndex.getAllKeys(e,r))}deleteAll(e){return new Promise((r,o)=>{let i=this.idbIndex.openCursor(e);i.onsuccess=function(s){let a=s.target.result;a?(a.delete(),a.continue()):r()},i.onerror=function(s){o(s.target?.error||new Error("Unexpected error"))}})}};var Rs=class{constructor(e){this.idbObjStore=e}get name(){return this.idbObjStore.name}index(e){return new Ss(this.idbObjStore.index(e))}get(e){return ce(this.idbObjStore.get(e))}getKey(e){return ce(this.idbObjStore.getKey(e))}getAll(e,r){return ce(this.idbObjStore.getAll(e,r))}getAllKeys(e,r){return ce(this.idbObjStore.getAllKeys(e,r))}add(e,r){return ce(this.idbObjStore.add(e,r))}put(e,r){return ce(this.idbObjStore.put(e,r))}delete(e){return ce(this.idbObjStore.delete(e))}clear(){return ce(this.idbObjStore.clear())}};var Cs=class{#e;constructor(e){this.#e=e;let r=()=>{i()},o=()=>{i()},i=()=>{this.#e=null,e.removeEventListener("abort",r),e.removeEventListener("complete",o)};e.addEventListener("abort",r),e.addEventListener("complete",o)}get tx(){if(!this.#e)throw new Error("Transaction already ended");return this.#e}async abort(){let{tx:e}=this;this.#e=null,e.abort()}async commit(){let{tx:e}=this;this.#e=null,e.commit?.()}objectStore(e){let r=this.tx.objectStore(e);return new Rs(r)}[Symbol.dispose](){this.#e&&this.commit()}};var _s=class t{static async open(e,r,o){let i=await new Promise((s,a)=>{let c=indexedDB.open(e,r.length);c.onerror=()=>a(c.error),c.onsuccess=()=>s(c.result),c.onupgradeneeded=({oldVersion:u,newVersion:f})=>{let m=c.result;try{for(let h=u;h<(f??r.length);++h){let g=r[h];if(g)g(m);else throw new Error(`Missing migration for version ${h}`)}}catch(h){m.close(),a(h)}}});return new t(i,o)}#e;constructor(e,r){this.txOptions=r,this.#e=e;let o=()=>{this.#e=null,e.removeEventListener("versionchange",o),e.removeEventListener("close",o),e.close()};e.addEventListener("versionchange",o),e.addEventListener("close",o)}get db(){if(!this.#e)throw new Error("Database closed");return this.#e}get name(){return this.db.name}get objectStoreNames(){return this.db.objectStoreNames}get version(){return this.db.version}async transaction(e,r,o){return new Promise(async(i,s)=>{try{let a=this.db.transaction(e,r,this.txOptions),c={done:!1};a.oncomplete=()=>{c.done?i(c.value):s(new Error("Transaction completed without result"))},a.onerror=()=>s(a.error),a.onabort=()=>s(a.error||new Error("Transaction aborted"));try{c={done:!0,value:await o(new Cs(a))},a.commit()}catch(u){throw a.abort(),u}}catch(a){s(a)}})}close(){let{db:e}=this;this.#e=null,e.close()}async[Symbol.asyncDispose](){this.#e&&await this.close()}};function Kv(t){if(!(t instanceof Jt)||!t.kid)throw new Error("Invalid key object");return{keyId:t.kid,keyPair:t.cryptoKeyPair}}async function Hv(t){return Jt.fromKeypair(t.keyPair,t.keyId)}var Jv=["state","session","didCache","dpopNonceCache","handleCache","authorizationServerMetadataCache","protectedResourceMetadataCache"],Es=class{#e;#r;constructor(e){this.#e=_s.open(e?.name??"@atproto-oauth-client",[r=>{for(let o of Jv)r.createObjectStore(o,{autoIncrement:!0}).createIndex("expiresAt","expiresAt",{unique:!1})}],{durability:e?.durability??"strict"}),this.#r=setInterval(()=>{this.cleanup()},e?.cleanupInterval??3e4)}async run(e,r,o){return await(await this.#e).transaction([e],r,s=>o(s.objectStore(e)))}createStore(e,{encode:r,decode:o,expiresAt:i}){return{get:async s=>{let a=await this.run(e,"readonly",c=>c.get(s));if(a!==void 0){if(a.expiresAt!=null&&new Date(a.expiresAt)<new Date){await this.run(e,"readwrite",c=>c.delete(s));return}return o(a.value)}},set:async(s,a)=>{let c={value:await r(a),expiresAt:i(a)?.toISOString()};await this.run(e,"readwrite",u=>u.put(c,s))},del:async s=>{await this.run(e,"readwrite",a=>a.delete(s))}}}getSessionStore(){return this.createStore("session",{expiresAt:({tokenSet:e})=>e.refresh_token||e.expires_at==null?null:new Date(e.expires_at),encode:({dpopKey:e,...r})=>({...r,dpopKey:Kv(e)}),decode:async({dpopKey:e,...r})=>({...r,dpopKey:await Hv(e)})})}getStateStore(){return this.createStore("state",{expiresAt:e=>new Date(Date.now()+10*6e4),encode:({dpopKey:e,...r})=>({...r,dpopKey:Kv(e)}),decode:async({dpopKey:e,...r})=>({...r,dpopKey:await Hv(e)})})}getDpopNonceCache(){return this.createStore("dpopNonceCache",{expiresAt:e=>new Date(Date.now()+6e5),encode:e=>e,decode:e=>e})}getDidCache(){return this.createStore("didCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getHandleCache(){return this.createStore("handleCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getAuthorizationServerMetadataCache(){return this.createStore("authorizationServerMetadataCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getProtectedResourceMetadataCache(){return this.createStore("protectedResourceMetadataCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}async cleanup(){let e=await this.#e;for(let r of Jv)await e.transaction([r],"readwrite",o=>o.objectStore(r).index("expiresAt").deleteAll(IDBKeyRange.upperBound(Date.now())))}async[Symbol.asyncDispose](){clearInterval(this.#r),this.#r=void 0;let e=this.#e;this.#e=Promise.reject(new Error("Database has been disposed")),this.#e.catch(()=>null);let r=await e.catch(()=>null);r&&await r[Symbol.asyncDispose]()}};var zP=typeof navigator<"u"&&navigator.locks?.request?(t,e)=>navigator.locks.request(t,{mode:"exclusive"},async()=>e()):void 0,Is=class{constructor(){if(this.requestLock=zP,typeof crypto!="object"||!crypto?.subtle)throw new Error("Crypto with CryptoSubtle is required. If running in a browser, make sure the current page is loaded over HTTPS.");this.requestLock||console.warn("Locks API not available. You should consider using a more recent browser.")}async createKey(e){return Jt.generate(e)}getRandomValues(e){return crypto.getRandomValues(new Uint8Array(e))}async digest(e,{name:r}){switch(r){case"sha256":case"sha384":case"sha512":{let o=await crypto.subtle.digest(`SHA-${r.slice(3)}`,e);return new Uint8Array(o)}default:throw new Error(`Unsupported digest algorithm: ${r}`)}}};var Br=class extends Error{constructor(){super("Login complete, please close the popup window."),this.code="LOGIN_CONTINUED_IN_PARENT_WINDOW"}};function Ja(t,e="127.0.0.1"){if(!So(t.hostname))throw new TypeError(`Expected a loopback host, got ${t.hostname}`);let r=`http://${t.hostname==="localhost"?e:t.hostname}${t.port&&!t.port.startsWith(":")?`:${t.port}`:t.port}${t.pathname}`;return`http://localhost${t.pathname==="/"?"":t.pathname}?redirect_uri=${encodeURIComponent(r)}`}var He="@@atproto/oauth-client-browser",Wv=`${He}(popup-channel)`,Io=`${He}(popup-state):`,Wa=new BroadcastChannel(`${He}(synchronization-channel:2)`),UP=new Is,Ds=class t extends Eo{static async load({clientId:e,...r}){if(e.startsWith("http:")){let o=za(e);return new t({clientMetadata:o,...r})}else if(e.startsWith("https:")){as(e);let o=await Eo.fetchMetadata({clientId:e,...r});return new t({...r,clientMetadata:o})}else throw new TypeError(`Invalid client id: ${e}`)}constructor({clientMetadata:e=za(Ja(window.location)),responseMode:r="fragment",...o}){if(!globalThis.crypto?.subtle)throw new Error("WebCrypto API is required");if(!["query","fragment"].includes(r))throw new TypeError(`Invalid response mode: ${r}`);let i=new Es;super({...o,clientMetadata:e,responseMode:r,keyset:void 0,runtimeImplementation:UP,sessionStore:i.getSessionStore(),stateStore:i.getStateStore(),didCache:i.getDidCache(),handleCache:i.getHandleCache(),dpopNonceCache:i.getDpopNonceCache(),authorizationServerMetadataCache:i.getAuthorizationServerMetadataCache(),protectedResourceMetadataCache:i.getProtectedResourceMetadataCache(),onSessionDeleted:async(a,c)=>(localStorage.getItem(`${He}(sub)`)===a&&localStorage.removeItem(`${He}(sub)`),Wa.postMessage({name:"onSessionDeleted",args:[a,c]}),o.onSessionDeleted?.call(null,a,c)),onSessionUpdated:async(a,c)=>(Wa.postMessage({name:"onSessionUpdated",args:[a,c]}),o.onSessionUpdated?.call(null,a,c))}),this.ac=new AbortController,this.database=i;let{signal:s}=this.ac;Wa.addEventListener("message",a=>{if(a.source===window)return;let{name:c,args:u}=a.data,f=o[c];f?.(...u)},{signal:s})}async init(e){let r=this.readCallbackParams();if(r){let o=this.findRedirectUrl();if(o)return this.initCallback(r,o)}return this.initRestore(e)}async initRestore(e){await GP(this.clientMetadata);let r=localStorage.getItem(`${He}(sub)`);if(r)try{return{session:await this.restore(r,e)}}catch(o){throw localStorage.removeItem(`${He}(sub)`),o}}async restore(e,r){let o=await super.restore(e,r);return localStorage.setItem(`${He}(sub)`,o.sub),o}async revoke(e){return localStorage.removeItem(`${He}(sub)`),super.revoke(e)}async signIn(e,r){return r?.display==="popup"?this.signInPopup(e,r):this.signInRedirect(e,r)}async signInRedirect(e,r){let o=await this.authorize(e,r);return window.location.href=o.href,new Promise((i,s)=>{setTimeout(a=>{this.abortRequest(o).then(()=>s(a),c=>s(new AggregateError([a,c])))},5e3,new Error("User navigated back"))})}async signInPopup(e,r){let o=r?.popupName??"_blank",i=r?.popupFeatures??"width=600,height=600,menubar=no,toolbar=no",s=window.open("about:blank",o,i),a=`${Math.random().toString(36).slice(2)}`,c=await this.authorize(e,{...r,state:`${Io}${a}`,display:r?.display??"popup"});return r?.signal?.throwIfAborted(),s?s.window.location.href=c.href:s=window.open(c.href,o,i),s?.focus(),new Promise((u,f)=>{let m=new BroadcastChannel(Wv),h=()=>{clearTimeout(b),m.removeEventListener("message",v),m.close(),r?.signal?.removeEventListener("abort",g),s?.close()},g=()=>{f(new Error(r?.signal?.aborted?"Aborted":"Timeout")),h()};r?.signal?.addEventListener("abort",g);let b=setTimeout(g,5*6e4),v=async({data:x})=>{if(x.key!==a||!("result"in x))return;m.postMessage({key:a,ack:!0}),h();let{result:I}=x;if(I.status==="fulfilled"){let k=I.value;try{r?.signal?.throwIfAborted(),u(await this.restore(k,!1))}catch(B){f(B),this.revoke(k)}}else{let{message:k,params:B}=I.reason;f(new pe(new URLSearchParams(B),k))}};m.addEventListener("message",v)})}findRedirectUrl(){for(let e of this.clientMetadata.redirect_uris){let r=new URL(e);if(location.origin===r.origin&&location.pathname===r.pathname)return e}}readCallbackParams(){let e=this.responseMode==="fragment"?new URLSearchParams(location.hash.slice(1)):new URLSearchParams(location.search);return!e.has("state")||!(e.has("code")||e.has("error"))?null:e}async initCallback(e=this.readCallbackParams(),r=this.findRedirectUrl()){if(!e)throw new TypeError("No OAuth callback parameters found in the URL");this.responseMode==="fragment"?history.replaceState(null,"",location.pathname+location.search):this.responseMode==="query"&&history.replaceState(null,"",location.pathname);let o=i=>{let s=new BroadcastChannel(Wv);return new Promise(a=>{let c=m=>{clearTimeout(f),s.removeEventListener("message",u),s.close(),a(m)},u=({data:m})=>{"ack"in m&&i.key===m.key&&c(!0)};s.addEventListener("message",u),s.postMessage(i);let f=setTimeout(c,500,!1)})};return this.callback(e,{redirect_uri:r}).then(async i=>{if(i.state?.startsWith(Io))throw await o({key:i.state.slice(Io.length),result:{status:"fulfilled",value:i.session.sub}})||await i.session.signOut(),new Br;return localStorage.setItem(`${He}(sub)`,i.session.sub),i}).catch(async i=>{throw i instanceof pe&&i.state?.startsWith(Io)?(await o({key:i.state.slice(Io.length),result:{status:"rejected",reason:{message:i.message,params:Array.from(i.params.entries())}}}),new Br):i}).catch(i=>{throw i instanceof Br&&window.close(),i})}async[Symbol.asyncDispose](){try{this.ac.abort()}finally{await this.database[Symbol.asyncDispose]()}}async dispose(){await this[Symbol.asyncDispose]()}};function GP(t){if(!uv(t.client_id)||window.location.hostname!=="localhost")return;let e=new URL(window.location.href);for(let r of t.redirect_uris){let o=new URL(r);if((o.hostname==="127.0.0.1"||o.hostname==="[::1]")&&(!o.port||o.port===e.port)&&o.protocol===e.protocol&&o.pathname===e.pathname)throw o.port=e.port,window.location.href=o.href,new Error("Redirecting to loopback IP...")}throw new Error(`Please use the loopback IP address instead of ${e}`)}var Xt={};Ct(Xt,{assure:()=>KP,create:()=>NP,is:()=>FP,isObject:()=>HP});var FP=(t,e)=>e.safeParse(t).success,NP=t=>e=>t.safeParse(e).success,KP=(t,e)=>t.parse(e),HP=t=>typeof t=="object"&&t!==null;var Xv=t=>new Promise(e=>setTimeout(e,t));var Qv="234567abcdefghijklmnopqrstuvwxyz",Xa=t=>{let e="";for(;t;){let r=t%32;t=Math.floor(t/32),e=Qv.charAt(r)+e}return e},Qa=t=>{let e=0;for(let r of t)e=e*32+Qv.indexOf(r);return e};var Zv=13,Za=0,Yv=0,Ts=null;function ex(t){return t.replaceAll("-","")}var Pe=class t{constructor(e){let r=ex(e);if(r.length!==Zv)throw new Error(`Poorly formatted TID: ${r.length} length`);this.str=r}static next(e){let r=Math.max(Date.now(),Za);r===Za&&Yv++,Za=r;let o=r*1e3+Yv;Ts===null&&(Ts=Math.floor(Math.random()*32));let i=t.fromTime(o,Ts);return!e||i.newerThan(e)?i:t.fromTime(e.timestamp()+1,Ts)}static nextStr(e){return t.next(e?new t(e):void 0).toString()}static fromTime(e,r){let o=`${Xa(e)}${Xa(r).padStart(2,"2")}`;return new t(o)}static fromStr(e){return new t(e)}static oldestFirst(e,r){return e.compareTo(r)}static newestFirst(e,r){return r.compareTo(e)}static is(e){return ex(e).length===Zv}timestamp(){return Qa(this.str.slice(0,11))}clockid(){return Qa(this.str.slice(11,13))}formatted(){let e=this.toString();return`${e.slice(0,4)}-${e.slice(4,7)}-${e.slice(7,11)}-${e.slice(11,13)}`}toString(){return this.str}compareTo(e){return this.str>e.str?1:this.str<e.str?-1:0}equals(e){return this.str===e.str}newerThan(e){return this.compareTo(e)>0}olderThan(e){return this.compareTo(e)<0}};var Do=se({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$6=se({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),M6=se({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),V6=se({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),O6=se({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),z6=se({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),U6=se({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),G6=se({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),F6=se({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ps=gr({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),H6=gr({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var it=gr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),X6=gr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var WP=ox,tx=128,XP=127,QP=~XP,ZP=Math.pow(2,31);function ox(t,e,r){e=e||[],r=r||0;for(var o=r;t>=ZP;)e[r++]=t&255|tx,t/=128;for(;t&QP;)e[r++]=t&255|tx,t>>>=7;return e[r]=t|0,ox.bytes=r-o+1,e}var YP=Ya,ej=128,rx=127;function Ya(t,o){var r=0,o=o||0,i=0,s=o,a,c=t.length;do{if(s>=c)throw Ya.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=i<28?(a&rx)<<i:(a&rx)*Math.pow(2,i),i+=7}while(a>=ej);return Ya.bytes=s-o,r}var tj=Math.pow(2,7),rj=Math.pow(2,14),oj=Math.pow(2,21),ij=Math.pow(2,28),sj=Math.pow(2,35),nj=Math.pow(2,42),aj=Math.pow(2,49),pj=Math.pow(2,56),cj=Math.pow(2,63),dj=function(t){return t<tj?1:t<rj?2:t<oj?3:t<ij?4:t<sj?5:t<nj?6:t<aj?7:t<pj?8:t<cj?9:10},lj={encode:WP,decode:YP,encodingLength:dj},uj=lj,To=uj;function Po(t,e=0){return[To.decode(t,e),To.decode.bytes]}function Lr(t,e,r=0){return To.encode(t,e,r),e}function $r(t){return To.encodingLength(t)}function jo(t,e){let r=e.byteLength,o=$r(t),i=o+$r(r),s=new Uint8Array(i+r);return Lr(t,s,0),Lr(r,s,o),s.set(e,i),new Mr(t,r,e,s)}function sx(t){let e=yr(t),[r,o]=Po(e),[i,s]=Po(e.subarray(o)),a=e.subarray(o+s);if(a.byteLength!==i)throw new Error("Incorrect length");return new Mr(r,i,a,e)}function nx(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Lg(t.bytes,r.bytes)}}var Mr=class{code;size;digest;bytes;constructor(e,r,o,i){this.code=e,this.size=r,this.digest=o,this.bytes=i}};function px(t,e){let{bytes:r,version:o}=t;return o===0?mj(r,ep(t),e??it.encoder):hj(r,ep(t),e??Do.encoder)}var cx=new WeakMap;function ep(t){let e=cx.get(t);if(e==null){let r=new Map;return cx.set(t,r),r}return e}var ie=class t{code;version;multihash;bytes;"/";constructor(e,r,o,i){this.code=r,this.version=e,this.multihash=o,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==qo)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==yj)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,o=jo(e,r);return t.createV1(this.code,o)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let o=r;return o!=null&&e.code===o.code&&e.version===o.version&&nx(e.multihash,o.multihash)}toString(e){return px(this,e)}toJSON(){return{"/":px(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:o,code:i,multihash:s,bytes:a}=r;return new t(o,i,s,a??dx(o,i,s.bytes))}else if(r[gj]===!0){let{version:o,multihash:i,code:s}=r,a=sx(i);return t.create(o,s,a)}else return null}static create(e,r,o){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(o.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==qo)throw new Error(`Version 0 CID must use dag-pb (code: ${qo}) block encoding`);return new t(e,r,o,o.bytes)}case 1:{let i=dx(e,r,o.bytes);return new t(e,r,o,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,qo,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,o]=t.decodeFirst(e);if(o.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),o=r.size-r.multihashSize,i=yr(e.subarray(o,o+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),a=new Mr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(a):t.createV1(r.codec,a),e.subarray(r.size)]}static inspectBytes(e){let r=0,o=()=>{let[h,g]=Po(e.subarray(r));return r+=g,h},i=o(),s=qo;if(i===18?(i=0,r=0):s=o(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=r,c=o(),u=o(),f=r+u,m=f-a;return{version:i,codec:s,multihashCode:c,digestSize:u,multihashSize:m,size:f}}static parse(e,r){let[o,i]=fj(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ep(s).set(o,e),s}};function fj(t,e){switch(t[0]){case"Q":{let r=e??it;return[it.prefix,r.decode(`${it.prefix}${t}`)]}case it.prefix:{let r=e??it;return[it.prefix,r.decode(t)]}case Do.prefix:{let r=e??Do;return[Do.prefix,r.decode(t)]}case Ps.prefix:{let r=e??Ps;return[Ps.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function mj(t,e,r){let{prefix:o}=r;if(o!==it.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(o);if(i==null){let s=r.encode(t).slice(1);return e.set(o,s),s}else return i}function hj(t,e,r){let{prefix:o}=r,i=e.get(o);if(i==null){let s=r.encode(t);return e.set(o,s),s}else return i}var qo=112,yj=18;function dx(t,e,r){let o=$r(t),i=o+$r(e),s=new Uint8Array(i+r.byteLength);return Lr(t,s,0),Lr(e,s,o),s.set(r,i),s}var gj=Symbol.for("@ipld/js-cid/CID");var bj=20;function rp({name:t,code:e,encode:r,minDigestLength:o,maxDigestLength:i}){return new tp(t,e,r,o,i)}var tp=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,r,o,i,s){this.name=e,this.code=r,this.encode=o,this.minDigestLength=i??bj,this.maxDigestLength=s}digest(e,r){if(r?.truncate!=null){if(r.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&r.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let o=this.encode(e);return o instanceof Uint8Array?lx(o,this.code,r?.truncate):o.then(i=>lx(i,this.code,r?.truncate))}else throw Error("Unknown type, must be binary type")}};function lx(t,e,r){if(r!=null&&r!==t.byteLength){if(r>t.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${t.byteLength}`);t=t.subarray(0,r)}return jo(e,t)}function ux(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var fx=rp({name:"sha2-256",code:18,encode:ux("SHA-256")}),mx=rp({name:"sha2-512",code:19,encode:ux("SHA-512")});function op(t){return Number.isInteger(t)&&t>=0&&t<256}function js(t){return t!=null&&typeof t=="object"}var vj=Object.prototype,xj=Object.prototype.toString;function hx(t){return js(t)&&yx(t)}function yx(t){let e=Object.getPrototypeOf(t);return e===null?!0:(e===vj||Object.getPrototypeOf(e)===null)&&xj.call(t)==="[object Object]"}var ip="Bu"+"f".repeat(2)+"er",Qt=globalThis?.[ip]?.prototype instanceof Uint8Array&&"byteLength"in globalThis[ip]?globalThis[ip]:null;var gx=Qt,bx=typeof Uint8Array.fromBase64=="function"?function(e,r="base64"){return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:"loose"})}:null,vx=gx?function(e,r="base64"){let o=gx.from(e,r);return wx(e,o),new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}:null;function xx(t,e="base64"){let r=t.endsWith("="),o=e==="base64url"?r?zg:ke:r?Og:di,i=o.decoder.decode(`${o.prefix}${t}`);return wx(t,i),i}function wx(t,e){let r=t.endsWith("==")?2:t.endsWith("=")?1:0,o=t.length-r,i=Math.floor(o*3/4);if(e.length!==i)throw new Error("Invalid base64 string");let s=e.length/3*4,a=s%4===0?0:4-s%4,c=s+a;if(t.length>c)throw new Error("Invalid base64 string");for(let u=Math.ceil(s);u<t.length-r;u++){let f=t.charCodeAt(u);if(!(f>=65&&f<=90)&&!(f>=97&&f<=122)&&!(f>=48&&f<=57)&&f!==43&&f!==47)throw new Error("Invalid base64 string")}}var sp=Qt,kx=typeof Uint8Array.prototype.toBase64=="function"?function(e,r="base64"){return e.toBase64({alphabet:r,omitPadding:!0})}:null,Ax=sp?function(e,r="base64"){let i=(e instanceof sp?e:sp.from(e)).toString(r);return i.charCodeAt(i.length-1)===61?i.charCodeAt(i.length-2)===61?i.slice(0,-2):i.slice(0,-1):i}:null;function Sx(t,e="base64"){let r=e==="base64url"?ke:di;return r.encoder.encode(t).slice(r.prefix.length)}var np=kx??Ax??Sx,ap=bx??vx??xx;function Rx(t,e){if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}var Cx=113,_x=85,wj=fx.code,IX=mx.code;function kj(t){return t.version===1&&t.code===_x}function Ex(t){return t.version===1&&(t.code===_x||t.code===Cx)&&t.multihash.code===wj&&t.multihash.digest.byteLength===32}function Aj(t){return t.code===Cx&&Ex(t)}function Sj(t,e){switch(e?.flavor){case void 0:return!0;case"cbor":return Aj(t);case"dasl":return Ex(t);case"raw":return kj(t);default:throw new TypeError(`Unknown CID flavor: ${e?.flavor}`)}}function qs(t,e){return Cj(t)&&Sj(t,e)}function Ix(t,e){return qs(t,e)?t:null}function Rj(t,e){if(qs(t,e))return t;throw new Error(`Invalid ${e?.flavor?`${e.flavor} CID`:"CID"} "${t}"`)}function pp(t,e){let r=ie.parse(t);return Rj(r,e)}function Cj(t){if(ie.asCID(t))return t.bytes!=null;try{if(!js(t))return!1;let e=t;if(e.version!==0&&e.version!==1||!op(e.code)||!js(e.multihash))return!1;let r=e.multihash;return!(!op(r.code)||!(r.digest instanceof Uint8Array)||!(e.bytes instanceof Uint8Array)||e.bytes[0]!==e.version||e.bytes[1]!==e.code||e.bytes[2]!==r.code||e.bytes[3]!==r.digest.length||e.bytes.length!==4+r.digest.length||!Rx(e.bytes.subarray(4),r.digest)||typeof e.equals!="function"||e.equals(e)!==!0)}catch{return!1}}var _j={flavor:"raw"},Ej=Number.isSafeInteger;function cp(t,e){if(!hx(t)||t?.$type!=="blob")return!1;let{mimeType:r,size:o,ref:i}=t;if(typeof r!="string"||!r.includes("/"))return!1;if(!(o===-1&&e?.strict===!1)){if(!Ej(o)||o<0)return!1}if(typeof i!="object"||i===null)return!1;for(let a in t)if(a!=="$type"&&a!=="mimeType"&&a!=="ref"&&a!=="size")return!1;return!!Ix(i,e?.strict===!1?void 0:_j)}function Bs(t,e=""){let r=[],o=t.split(",").map(s=>s?parseInt(s,36):0),i=0;for(let s=0;s<o.length;s++)s%2?r.push([i,i+o[s],e?parseInt(e[s>>1],36):0]):i=o[s];return r}function dp(t,e,r=0,o=e.length-1){for(;r<=o;){let i=r+o>>>1,s=e[i];if(t<s[0])o=i-1;else if(t>s[1])r=i+1;else return i}return-1}var Ls=Bs(",9,a,,b,1,d,,e,h,3j,w,4p,,4t,,4u,,lc,33,w3,6,13l,18,14v,,14x,1,150,1,153,,16o,5,174,a,17g,,18r,k,19s,,1cm,6,1ct,,1cv,5,1d3,1,1d6,3,1e7,,1e9,,1f4,q,1ie,a,1kb,8,1kt,,1li,3,1ln,8,1lx,2,1m1,4,1nd,2,1ow,1,1p3,8,1qi,n,1r6,,1r7,v,1s3,,1tm,,1tn,,1to,,1tq,2,1tt,7,1u1,3,1u5,,1u6,1,1u9,6,1uq,1,1vl,,1vm,1,1x8,,1xa,,1xb,1,1xd,3,1xj,1,1xn,1,1xp,,1xz,,1ya,1,1z2,,1z5,1,1z7,,20s,,20u,2,20x,1,213,1,217,2,21d,,228,1,22d,,22p,1,22r,,24c,,24e,2,24h,4,24n,1,24p,,24r,1,24t,,25e,1,262,5,269,,26a,1,27w,,27y,1,280,,281,3,287,1,28b,1,28d,,28l,2,28y,1,29u,,2bi,,2bj,,2bk,,2bl,1,2bq,2,2bu,2,2bx,,2c7,,2dc,,2dd,2,2dg,,2f0,,2f2,2,2f5,3,2fa,2,2fe,3,2fp,1,2g2,1,2gx,,2gy,1,2ik,,2im,,2in,1,2ip,,2iq,,2ir,1,2iu,2,2iy,3,2j9,1,2jm,1,2k3,,2kg,1,2ki,1,2m3,1,2m6,,2m7,1,2m9,3,2me,2,2mi,2,2ml,,2mm,,2mv,,2n6,1,2o1,,2o2,1,2q2,,2q7,,2q8,1,2qa,2,2qe,,2qg,6,2qn,,2r6,1,2sx,,2sz,,2t0,6,2tj,7,2wh,,2wj,,2wk,8,2x4,6,2zc,1,305,,307,,309,,30e,1,31t,d,327,,328,4,32e,1,32l,a,32x,z,346,,371,3,375,,376,5,37d,1,37f,1,37h,1,386,1,388,1,38e,2,38x,3,39e,,39g,,39h,1,39p,,3a5,,3cw,2n,3fk,1z,3hk,2f,3tp,2,4k2,3,4ky,2,4lu,1,4mq,1,4ok,1,4om,,4on,6,4ou,7,4p2,,4p3,1,4p5,a,4pp,,4qz,2,4r2,,4r3,,4ud,1,4vd,,4yo,2,4yr,3,4yv,1,4yx,2,4z4,1,4z6,,4z7,5,4zd,2,55j,1,55l,1,55n,,579,,57a,,57b,,57c,6,57k,,57m,,57p,7,57x,5,583,9,58f,,59s,u,5c0,3,5c4,,5dg,9,5dq,3,5du,2,5ez,8,5fk,1,5fm,,5gh,,5gi,3,5gm,1,5go,5,5ie,,5if,,5ig,1,5ii,2,5il,,5im,,5in,4,5k4,7,5kc,7,5kk,1,5km,1,5ow,2,5p0,c,5pd,,5pe,6,5pp,,5pw,,5pz,,5q0,1,5vk,1r,6bv,,6bw,,6bx,,6by,1,6co,6,6d8,,6dl,,6e8,f,6hc,w,6jm,,6k9,,6ms,5,6nd,1,6xm,1,6y0,,70o,,72n,,73d,a,73s,2,79e,,7fu,1,7g6,,7gg,,7i3,3,7i8,5,7if,b,7is,35,7m8,39,7pk,a,7pw,,7py,,7q5,,7q9,,7qg,,7qr,1,7r8,,7rb,,7rg,,7ri,,7rn,2,7rr,,7s3,4,7th,2,7tt,,7u8,,7un,,850,1,8hx,2,8ij,1,8k0,,8k5,,8vj,2,8zj,,928,v,wvj,3,wvo,9,wwu,1,wz4,1,x6q,,x6u,,x6z,,x7n,1,x7p,1,x7r,,x7w,,xa8,1,xbo,f,xc4,1,xcw,h,xdr,,xeu,7,xfr,a,xg2,,xg3,,xgg,s,xhc,2,xhf,,xir,,xis,1,xiu,3,xiy,1,xj0,1,xj2,1,xj4,,xk5,,xm1,5,xm7,1,xm9,1,xmb,1,xmd,1,xmr,,xn0,,xn1,,xoc,,xps,,xpu,2,xpz,1,xq6,1,xq9,,xrf,,xrg,1,xri,1,xrp,,xrq,,xyb,1,xyd,,xye,1,xyg,,xyh,1,xyk,,xyl,,1e68,f,1e74,f,1edb,,1ehq,1,1ek0,b,1eyl,,1f4w,,1f92,4,1gjl,2,1gjp,1,1gjw,3,1gl4,2,1glb,,1gpx,1,1h5w,3,1h7t,4,1hgr,1,1hj0,3,1hl2,a,1hmq,3,1hq8,,1hq9,,1hqa,,1hrs,e,1htc,,1htf,1,1htr,2,1htu,,1hv4,2,1hv7,3,1hvb,1,1hvd,1,1hvh,,1hvm,,1hvx,,1hxc,2,1hyf,4,1hyk,,1hyl,7,1hz9,1,1i0j,,1i0w,1,1i0y,,1i2b,2,1i2e,8,1i2n,,1i2o,,1i2q,1,1i2x,3,1i32,,1i33,,1i5o,2,1i5r,2,1i5u,1,1i5w,3,1i66,,1i69,,1ian,,1iao,2,1iar,7,1ibk,1,1ibm,1,1id7,1,1ida,,1idb,,1idc,,1idd,3,1idj,1,1idn,1,1idp,,1idz,,1iea,1,1iee,6,1ieo,4,1igo,,1igp,1,1igr,5,1igy,,1ih1,,1ih3,2,1ih6,,1ih8,1,1iha,2,1ihd,,1ihe,,1iht,1,1ik5,2,1ik8,7,1ikg,1,1iki,2,1ikl,,1ikm,,1ila,,1ink,,1inl,1,1inn,5,1int,,1inu,,1inv,1,1inx,,1iny,,1inz,1,1io1,,1io2,1,1iun,,1iuo,1,1iuq,3,1iuw,3,1iv0,1,1iv2,,1iv3,1,1ivw,1,1iy8,2,1iyb,7,1iyj,1,1iyl,,1iym,,1iyn,1,1j1n,,1j1o,,1j1p,,1j1q,1,1j1s,7,1j4t,,1j4u,,1j4v,,1j4y,3,1j52,,1j53,4,1jcc,2,1jcf,8,1jco,,1jcp,1,1jjk,,1jjl,4,1jjr,1,1jjv,3,1jjz,,1jk0,,1jk1,,1jk2,,1jk3,,1jo1,2,1jo4,3,1joa,1,1joc,3,1jog,,1jok,,1jpd,9,1jqr,5,1jqx,,1jqy,,1jqz,3,1jrb,,1jrl,5,1jrr,1,1jrt,2,1jt0,5,1jt6,c,1jtj,,1jtk,1,1k4v,,1k4w,6,1k54,5,1k5a,,1k5b,,1k7m,l,1k89,,1k8a,6,1k8h,,1k8i,1,1k8k,,1k8l,1,1kc1,5,1kca,,1kcc,1,1kcf,6,1kcm,,1kcn,,1kei,4,1keo,1,1ker,1,1ket,,1keu,,1kev,,1koj,1,1kol,1,1kow,1,1koy,,1koz,,1kqc,1,1kqe,4,1kqm,1,1kqo,2,1kre,,1ovk,f,1ow0,,1ow7,e,1xr2,b,1xre,2,1xrh,2,1zow,4,1zqo,6,206b,,206f,3,20jz,,20k1,1i,20lr,3,20o4,,20og,1,2ftp,1,2fts,3,2jgg,19,2jhs,m,2jxh,4,2jxp,5,2jxv,7,2jy3,7,2jyd,6,2jze,3,2k3m,2,2lmo,1i,2lob,1d,2lpx,,2lqc,,2lqz,4,2lr5,e,2mtc,6,2mtk,g,2mu3,6,2mub,1,2mue,4,2mxb,,2n1s,6,2nce,,2ne4,3,2nsc,3,2nzi,1,2ok0,6,2on8,6,2pz4,73,2q6l,2,2q7j,,2q98,5,2q9q,1,2qa6,,2qa9,9,2qb1,1k,2qcm,p,2qdd,e,2qe2,,2qen,,2qeq,8,2qf0,3,2qfd,c1,2qrf,4,2qrk,8t,2r0m,7d,2r9c,3j,2rg4,b,2rit,16,2rkc,3,2rm0,7,2rmi,5,2rns,7,2rou,29,2rrg,1a,2rss,9,2rt3,c8,2scg,sd,jny8,v,jnz4,2n,jo1s,3j,jo5c,6n,joc0,2rz","262122424333333393233393339333333333393393b3b3b3b3b333b33b3bb33333b3b3333333b3b33bb3333b33b3bb33333b3bbb333b333b33333b3b3b3b3333b3b33b3bb39333b33b33b3b3b333b333333b3b333333b33b3b3333b3335dc333333b3b3b33323333b3bb3b33b3b3b3333b3333b3b333bb3b33b3b3b3b3b333b333b3323e2244234444444444444444444444444444444444444444443333333333b3b3bb33333b353b3b3b3b333b3b333b333333b3bb3b3b3bb333232333333333333333b3b3333bb3b393933b3b33bb3b393b3b3b3333b33b33b3bbb33b333b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b33bb39b9b3b33b3b33b9333b393b3b33b33b3b3b3333393b3b3b33b39bb3b332333b333dd3b33332333323333333333333333333333344444444a44444434444444444444423232");var Dx=Bs("1sl,10,1ug,7,1vc,7,1w5,j,1wq,6,1wy,,1x2,3,1y4,1,1y7,,1yo,1,239,j,23u,6,242,1,245,4,261,,26t,j,27e,6,27m,1,27p,4,28s,1,28v,,29d,,2dx,j,2ei,f,2fs,2,2l1,11");var Tx=65535;function*Ij(t){let e=t.codePointAt(0);if(e==null)return;let r=e<=Tx?1:2,o=t.length,i=Px(e),s=0,a=0,c=!1,u=!1,f=!1,m=0,h=i,g=e;for(;r<o;){e=t.codePointAt(r),s=Px(e);let b=!0;i===1?b=s!==6:i===2||i===6||s===1||s===2||s===6?b=!0:s===3||s===14||s===11||i===9?b=!1:i===14&&s===4?b=!c:i===10&&s===10?b=a++%2===1:i===5?b=!(s===5||s===13||s===7||s===8):((i===7||i===13)&&(s===13||s===12)||(i===8||i===12)&&s===12||s===0&&u&&f&&jx(e))&&(b=!1),b?(yield{segment:t.slice(m,r),index:m,input:t,_hd:g,_catBegin:h,_catEnd:i},c=!1,a=0,m=r,h=s,g=e):s===14&&(i===3||i===4)?c=!0:e>=2325&&(!u&&i===0&&(u=jx(g)),u&&s===3?f=f||e===2381||e===2509||e===2637||e===2765||e===2893||e===3149||e===3405:f=!1),r+=e<=Tx?1:2,i=s}m<o&&(yield{segment:t.slice(m),index:m,input:t,_hd:g,_catBegin:h,_catEnd:i})}function qx(t){let e=0;for(let r of Ij(t))e+=1;return e}var Bx=new Uint8Array(6080),$s=128,lp=12287,Lx=new Uint8Array(1536),Ms=40960,$x=44031,Dj=(()=>{let t=0;for(;;){let[e,r,o]=Ls[t];if(e>$x)break;if(t++,!(r<$s||e>lp&&r<Ms))for(let i=e;i<=r;i++){let s,a=0;i<=lp?(s=Bx,a=i-$s>>1):(s=Lx,a=i-Ms>>1),s[a]=i&1?s[a]&15|o<<4:s[a]&240|o}}return t})();function Px(t){if(t<$s)return t>=32?0:t===10?6:t===13?1:2;if(t<=lp){let r=Bx[t-$s>>1];return t&1?r>>4:r&15}if(t<Ms)return t<12336?t>=12330?3:0:t<12443?t===12336||t===12349?4:t>=12441?3:0:t===12951||t===12953?4:0;if(t<=$x){let r=Lx[t-Ms>>1];return t&1?r>>4:r&15}if(t<=55203)return(t-44032)%28===0?7:8;if(t<=55295)return t<=55238?t>=55216?13:0:t>=55243?12:0;if(t<65024)return t===64286?3:0;let e=dp(t,Ls,Dj);return e<0?0:Ls[e][2]}function jx(t){return dp(t,Dx)>=0}var Mx="Segmenter"in Intl&&typeof Intl.Segmenter=="function"?new Intl.Segmenter:null,Vx=Mx?function(e){let r=0;for(let o of Mx.segment(e))r++;return r}:null;function Ox(t){return qx(t)}var zx=Qt?function(e){return Qt.byteLength(e,"utf8")}:null;function Ux(t){let e=t.length,r;for(let o=0;o<t.length;o+=1)r=t.charCodeAt(o),r<=127||(r<=2047?e+=1:(e+=2,r>=55296&&r<=56319&&(r=t.charCodeAt(o+1),r>=56320&&r<=57343&&o++)));return e}var Gx=Vx??Ox;var Fx=zx??Ux;function Nx(t){if(!(!t||!("$bytes"in t))){for(let e in t)if(e!=="$bytes")return;if(typeof t.$bytes=="string")try{return ap(t.$bytes)}catch{return}}}function Kx(t){return{$bytes:np(t)}}function Vs(t,e){if(!t||!("$link"in t))return;for(let o in t)if(o!=="$link")return;let{$link:r}=t;if(typeof r=="string"&&r.length!==0&&!(r.length>2048))try{return pp(r,e)}catch{return}}function Hx(t){return{$link:t.toString()}}function Jx(t,e){if(t.$type!=="blob")return;let r=t?.ref;if(!(!r||typeof r!="object")){if("$link"in r){let o=Vs(r);if(!o)return;let i={...t,ref:o};if(cp(i,e))return i}if(cp(t))return t}}function Os(t,e={strict:!1}){switch(typeof t){case"object":return t===null?null:Array.isArray(t)?Tj(t,e):Bj(t,e)??Pj(t,e);case"number":if(Number.isSafeInteger(t)||e.strict===!1)return t;throw new TypeError(`Invalid non-integer number: ${t}`);case"boolean":case"string":return t;default:throw new TypeError(`Invalid JSON value: ${typeof t}`)}}function Tj(t,e){let r;for(let o=0;o<t.length;o++){let i=t[o],s=Os(i,e);s!==i&&(r??=Array.from(t),r[o]=s)}return r??t}function Pj(t,e){let r;for(let[o,i]of Object.entries(t)){if(o==="__proto__")throw new TypeError("Invalid key: __proto__");if(i===void 0){r??={...t},delete r[o];continue}let s=Os(i,e);s!==i&&(r??={...t},r[o]=s)}return r??t}function zs(t){switch(typeof t){case"object":return t===null?t:Array.isArray(t)?jj(t):qs(t)?Hx(t):ArrayBuffer.isView(t)?Kx(t):qj(t);case"boolean":case"string":case"number":return t;default:throw new TypeError(`Invalid Lex value: ${typeof t}`)}}function jj(t){let e;for(let r=0;r<t.length;r++){let o=t[r],i=zs(o);i!==o&&(e??=Array.from(t),e[r]=i)}return e??t}function qj(t){let e;for(let[r,o]of Object.entries(t)){if(r==="__proto__")throw new TypeError("Invalid key: __proto__");if(o===void 0){e??={...t},delete e[r];continue}let i=zs(o);i!==o&&(e??={...t},e[r]=i)}return e??t}function Bj(t,e){if(t.$link!==void 0){let r=Vs(t);if(r)return r;if(e.strict)throw new TypeError("Invalid $link object")}else if(t.$bytes!==void 0){let r=Nx(t);if(r)return r;if(e.strict)throw new TypeError("Invalid $bytes object")}else if(t.$type!==void 0&&e.strict)if(t.$type==="blob"){let r=Jx(t,e);if(r)return r;throw new TypeError("Invalid blob object")}else{if(typeof t.$type!="string")throw new TypeError(`Invalid $type property (${typeof t.$type})`);if(t.$type.length===0)throw new TypeError("Empty $type property")}}var Wx=t=>Os(t,{strict:!1}),Us=t=>t===void 0||Number.isNaN(t)?t:zs(t);async function Xx(t,e={}){let{maxRetries:r=3,retryable:o=()=>!0,getWaitMs:i=Lj}=e,s=0,a;for(;!a;)try{return await t()}catch(c){let u=i(s);s<r&&u!==null&&o(c)?(s+=1,u!==0&&await Xv(u)):a=c}throw a}function Lj(t,e=100,r=1e3){let o=Math.pow(2,t)*e,i=Math.min(o,r);return $j(i)}function $j(t){let e=t*.15;return t+Mj(-e,e)}function Mj(t,e){return Math.random()*(e-t)+t}var Qx=n.unknown().transform((t,e)=>{let r=ie.asCID(t);return r??(e.addIssue({code:n.ZodIssueCode.custom,message:"Not a valid CID"}),n.NEVER)}),Vj=n.object({version:n.literal(1),roots:n.array(Qx)}),xt={cid:Qx,carHeader:Vj,bytes:n.instanceof(Uint8Array),string:n.string(),array:n.array(n.unknown()),map:n.record(n.string(),n.unknown()),unknown:n.unknown()},g8={cid:{name:"cid",schema:xt.cid},carHeader:{name:"CAR header",schema:xt.carHeader},bytes:{name:"bytes",schema:xt.bytes},string:{name:"string",schema:xt.string},map:{name:"map",schema:xt.map},unknown:{name:"unknown",schema:xt.unknown}};var Zx=/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/;function Bo(t){if(!Zx.test(t))throw new Vr("DID didn't validate via regex");if(t.length>2048)throw new Vr("DID is too long (2048 chars max)")}function Gs(t){return typeof t=="string"&&t.length<=2048&&Zx.test(t)}var Vr=class extends Error{};var Yx=/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;function ew(t){if(t.length>253)throw new Or("Handle is too long (253 chars max)");if(!Yx.test(t))throw new Or("Handle didn't validate via regex")}function Fs(t){return typeof t=="string"&&t.length<=253&&Yx.test(t)}var Or=class extends Error{};function tw(t){return t.startsWith("did:")}function up(t){try{if(!t||typeof t!="string")throw new TypeError("Identifier must be a non-empty string");t.startsWith("did:")?Bo(t):ew(t)}catch(e){throw new Or("Invalid DID or handle",{cause:e})}}function Ns(t){return!t||typeof t!="string"?!1:t.startsWith("did:")?Gs(t):Fs(t)}function Zt(t){return{success:!0,value:t}}function F(t){return{success:!1,message:t}}function mp(t){let e=Oj(t);if(!e.success)throw new fp(e.message)}function zr(t){return typeof t=="string"&&Nj(t).success}function Oj(t){if(t.length>317)return F("NSID is too long (317 chars max)");if(zj(t))return F("Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)");let e=t.split(".");if(e.length<3)return F("NSID needs at least three parts");for(let r of e){if(r.length<1)return F("NSID parts can not be empty");if(r.length>63)return F("NSID part too long (max 63 chars)");if(Uj(r)||Gj(r))return F("NSID parts can not start or end with hyphen")}return rw(e[0])?F("NSID first part may not start with a digit"):Fj(e[e.length-1])?Zt(e):F("NSID name part must be only letters and digits (and no leading digit)")}function zj(t){return!/^[a-zA-Z0-9.-]*$/.test(t)}function rw(t){let e=t.charCodeAt(0);return e>=48&&e<=57}function Uj(t){return t.charCodeAt(0)===45}function Gj(t){return t.charCodeAt(t.length-1)===45}function Fj(t){return!rw(t)&&!t.includes("-")}function Nj(t){return t.length>317?F("NSID is too long (317 chars max)"):t.length<5||!/^[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?:\.[a-zA-Z](?:[a-zA-Z0-9]{0,62})?)$/.test(t)?F("NSID didn't validate via regex"):Zt(t)}var fp=class extends Error{};var ow=new Set([".",".."]),iw=/^[a-zA-Z0-9_~.:-]{1,512}$/;function hp(t){if(t.length>512||t.length<1)throw new Lo("record key must be 1 to 512 characters");if(ow.has(t))throw new Lo('record key can not be "." or ".."');if(!iw.test(t))throw new Lo("record key syntax not valid (regex)")}function Ks(t){return typeof t=="string"&&t.length>=1&&t.length<=512&&iw.test(t)&&!ow.has(t)}var Lo=class extends Error{};function sw(t,e){return Jj(t,e).success}var Kj=/[^a-zA-Z0-9._~:@!$&'()*+,;=%/\\[\]#?-]/,Hj=/^(?<uri>at:\/\/(?<authority>[^/?#\s]+)(?:\/(?<collection>[^/?#\s]+)(?:\/(?<rkey>[^/?#\s]+))?)?(?<trailingSlash>\/)?)(?:\?(?<query>[^#\s]*))?(?:#(?<hash>[^\s]*))?$/;function Jj(t,e){if(typeof t!="string")return F("ATURI must be a string");if(t.length>8192)return F("ATURI exceeds maximum length");if(t.match(Kj))return F("Disallowed characters in ATURI (ASCII)");let i=t.match(Hj)?.groups;if(!i){if(e?.detailed){if(!t.startsWith("at://"))return F('ATURI must start with "at://"');if(t.includes(" "))return F("ATURI can not contain spaces");if(t.includes("//",5))return F("ATURI can not have empty path segments");let s=t.indexOf("/",5);if(s!==-1){let a=t.indexOf("#"),c=a!==-1?a:t.length,u=t.indexOf("/",s+1);if(u!==-1&&u!==c-1)return F("ATURI can not have more than two path segments")}}return F("ATURI does not match expected format")}if(!Ns(i.authority))return F("ATURI has invalid authority");if(i.collection!=null&&!zr(i.collection))return F("ATURI has invalid collection");if(i.hash!=null){let s=Xj(i.hash,e);if(s.success)i.hash=s.value;else return F(`ATURI has invalid fragment (${s.message})`)}if(e?.strict!==!1){if(i.trailingSlash!=null)return F("ATURI can not have a trailing slash");if(i.query!=null)return F("ATURI query part is not allowed");if(i.rkey!=null&&!Ks(i.rkey))return F("ATURI has invalid record key")}return Zt(i)}var Wj=/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/;function Xj(t,e){if(!Wj.test(t))return F("Invalid JSON pointer");let r=Qj(t);return!r.success&&e?.strict===!1?Zt(t):r}function Qj(t){try{return Zt(decodeURIComponent(t))}catch{return F("Invalid percent-encoding")}}var Zj=/^(at:\/\/)?((?:did:[a-z0-9:%-]+)|(?:[a-z0-9][a-z0-9.:-]*))(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i,Yj=/^(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i,ge=class t{constructor(e,r){let o=r!==void 0?Object.assign(typeof r=="string"?nw(r):{host:r.host},aw(e)):nw(e);up(o.host),this.hash=o.hash??"",this.host=o.host,this.pathname=o.pathname??"",this.searchParams=o.searchParams}static make(e,r,o){let i=e;return r&&(i+="/"+r),o&&(i+="/"+o),new t(i)}get protocol(){return"at:"}get origin(){return`at://${this.host}`}get did(){let{host:e}=this;if(tw(e))return e;throw new Vr(`AtUri "${this}" does not have a DID hostname`)}get hostname(){return this.host}set hostname(e){up(e),this.host=e}get search(){return this.searchParams.toString()}set search(e){this.searchParams=new URLSearchParams(e)}get collection(){return this.pathname.split("/").filter(Boolean)[0]||""}get collectionSafe(){let{collection:e}=this;return mp(e),e}set collection(e){mp(e),this.unsafelySetCollection(e)}unsafelySetCollection(e){let r=this.pathname.split("/").filter(Boolean);r[0]=e,this.pathname=r.join("/")}get rkey(){return this.pathname.split("/").filter(Boolean)[1]||""}get rkeySafe(){let{rkey:e}=this;return hp(e),e}set rkey(e){hp(e),this.unsafelySetRkey(e)}unsafelySetRkey(e){let r=this.pathname.split("/").filter(Boolean);r[0]||="undefined",r[1]=e,this.pathname=r.join("/")}get href(){return this.toString()}toString(){let e=this.pathname;for(e&&!e.startsWith("/")&&(e=`/${e}`);e.endsWith("/");)e=e.slice(0,-1);let r="";this.searchParams.size&&(r=`?${this.searchParams.toString()}`);let o=this.hash;return o==="#"?o="":o&&!o.startsWith("#")&&(o=`#${o}`),`at://${this.host}${e}${r}${o}`}};function nw(t){let e=t.match(Zj);if(!e)throw new Error(`Invalid AT uri: ${t}`);return{host:e[2],hash:e[5],pathname:e[3],searchParams:new URLSearchParams(e[4])}}function aw(t){let e=t.match(Yj);if(!e)throw new Error(`Invalid path: ${t}`);return{hash:e[3],pathname:e[1],searchParams:new URLSearchParams(e[2])}}var eq=or(cw(),1),{isValidISODateString:tq}=(t=>t.default??t)(eq),yp=class extends Error{};function rq(t){let e=uw(t);if(!e.success)throw new yp(e.message)}function oq(t){return rq(t),t}function iq(t){return aq(t).success}function dw(t){if(typeof t!="string")return!1;try{if(tq(t))return!0}catch{}return iq(t)}function lw(){return gp(new Date)}function gp(t){let e=typeof t=="string"||typeof t=="number"?new Date(t):t;return oq(e).toISOString()}var Yt=t=>({success:!1,message:t}),sq=t=>({success:!0,value:t}),nq=/^(?<full_year>[0-9]{4})-(?<date_month>0[1-9]|1[012])-(?<date_mday>[0-2][0-9]|3[01])T(?<time_hour>[0-1][0-9]|2[0-3]):(?<time_minute>[0-5][0-9]):(?<time_second>[0-5][0-9]|60)(?<time_secfrac>\.[0-9]+)?(?<time_offset>Z|(?<time_numoffset>[+-](?:[0-1][0-9]|2[0-3]):[0-5][0-9]))$/;function aq(t){if(typeof t!="string")return Yt("datetime must be a string");if(t.length>64)return Yt("datetime is too long (64 chars max)");if(t.endsWith("-00:00"))return Yt('datetime can not use "-00:00" for UTC timezone');if(!nq.test(t))return Yt("datetime is not in a valid format (must match RFC 3339 & ISO 8601 with 'Z' or \xB1hh:mm timezone)");let e=new Date(t);return uw(e)}function uw(t){let e=t.getUTCFullYear();return Number.isNaN(e)?Yt("datetime did not parse as ISO 8601"):e<0?Yt("datetime normalized to a negative time"):e>9999?Yt("datetime year is too far in the future"):sq(t)}var pq=/^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUseA>[xX](-[A-Za-z0-9]{1,8})+))?)|(?<privateUseB>[xX](-[A-Za-z0-9]{1,8})+))$/;function Hs(t){return pq.test(t)}var cq=/^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/;function fw(t){return typeof t=="string"&&t.length===13&&cq.test(t)}function mw(t){return typeof t=="string"&&/^\w+:(?:\/\/)?[^\s/][^\s]*$/.test(t)}var Js=Gx;var hw=Fx;var yw=Hs;var a9=URL.canParse??(t=>{try{return new URL(t),!0}catch{return!1}}),gw=n.object({id:n.string(),type:n.string(),controller:n.string(),publicKeyJwk:n.record(n.string(),n.unknown()).optional(),publicKeyMultibase:n.string().optional()}),dq=n.object({id:n.string(),type:n.string(),serviceEndpoint:n.union([n.string(),n.record(n.unknown())])}),p9=n.object({"@context":n.union([n.literal("https://www.w3.org/ns/did/v1"),n.array(n.string().url())]).optional(),id:n.string(),alsoKnownAs:n.array(n.string()).optional(),verificationMethod:n.array(gw).optional(),authentication:n.array(n.union([n.string(),gw])).optional(),service:n.array(dq).optional()});function Q(t,e){if(t.split("#").length>2)throw new Error("Uri can only have one hash segment");if(t.startsWith("lex:"))return t;if(t.startsWith("#")){if(!e)throw new Error(`Unable to resolve uri without anchor: ${t}`);return`${e}${t}`}return`lex:${t}`}function bp(t,e){if(t.required!==void 0){if(!Array.isArray(t.required)){e.addIssue({code:n.ZodIssueCode.invalid_type,received:typeof t.required,expected:"array"});return}if(t.properties===void 0){t.required.length>0&&e.addIssue({code:n.ZodIssueCode.custom,message:"Required fields defined but no properties defined"});return}for(let r of t.required)t.properties[r]===void 0&&e.addIssue({code:n.ZodIssueCode.custom,message:`Required field "${r}" not defined`})}}var lq=n.string().refine(yw,"Invalid BCP47 language tag"),bw=n.record(lq,n.string().optional()),Mo=n.object({type:n.literal("boolean"),description:n.string().optional(),default:n.boolean().optional(),const:n.boolean().optional()}),Vo=n.object({type:n.literal("integer"),description:n.string().optional(),default:n.number().int().optional(),minimum:n.number().int().optional(),maximum:n.number().int().optional(),enum:n.number().int().array().optional(),const:n.number().int().optional()}),uq=n.enum(["datetime","uri","at-uri","did","handle","at-identifier","nsid","cid","language","tid","record-key"]),Oo=n.object({type:n.literal("string"),format:uq.optional(),description:n.string().optional(),default:n.string().optional(),minLength:n.number().int().optional(),maxLength:n.number().int().optional(),minGraphemes:n.number().int().optional(),maxGraphemes:n.number().int().optional(),enum:n.string().array().optional(),const:n.string().optional(),knownValues:n.string().array().optional()}),zo=n.object({type:n.literal("unknown"),description:n.string().optional()}),fq=n.discriminatedUnion("type",[Mo,Vo,Oo,zo]),Xs=n.object({type:n.literal("bytes"),description:n.string().optional(),maxLength:n.number().optional(),minLength:n.number().optional()}),Qs=n.object({type:n.literal("cid-link"),description:n.string().optional()}),_9=n.discriminatedUnion("type",[Xs,Qs]),xp=n.object({type:n.literal("ref"),description:n.string().optional(),ref:n.string()}),Zs=n.object({type:n.literal("union"),description:n.string().optional(),refs:n.string().array(),closed:n.boolean().optional()}),mq=n.discriminatedUnion("type",[xp,Zs]),wp=n.object({type:n.literal("blob"),description:n.string().optional(),accept:n.string().array().optional(),maxSize:n.number().optional()}),kp=n.object({type:n.literal("array"),description:n.string().optional(),items:n.discriminatedUnion("type",[Mo,Vo,Oo,zo,Xs,Qs,xp,Zs,wp]),minLength:n.number().int().optional(),maxLength:n.number().int().optional()}),hq=kp.merge(n.object({items:fq})),yq=n.object({type:n.literal("token"),description:n.string().optional()}),Ap=n.object({type:n.literal("object"),description:n.string().optional(),required:n.string().array().optional(),nullable:n.string().array().optional(),properties:n.record(n.string(),n.discriminatedUnion("type",[kp,Mo,Vo,Oo,zo,Xs,Qs,xp,Zs,wp]))}).superRefine(bp),gq=n.intersection(n.object({type:n.literal("permission"),resource:n.string().nonempty()}),n.record(n.string(),n.union([n.array(n.union([n.string(),n.number().int(),n.boolean()])),n.boolean(),n.number().int(),n.string()]).optional())),bq=n.object({type:n.literal("permission-set"),description:n.string().optional(),title:n.string().optional(),"title:lang":bw.optional(),detail:n.string().optional(),"detail:lang":bw.optional(),permissions:n.array(gq)}),Sp=n.object({type:n.literal("params"),description:n.string().optional(),required:n.string().array().optional(),properties:n.record(n.string(),n.discriminatedUnion("type",[hq,Mo,Vo,Oo,zo]))}).superRefine(bp),vp=n.object({description:n.string().optional(),encoding:n.string(),schema:n.union([mq,Ap]).optional()}),Rp=n.object({name:n.string(),description:n.string().optional()}),vq=n.object({type:n.literal("query"),description:n.string().optional(),parameters:Sp.optional(),output:vp.optional(),errors:Rp.array().optional()}),xq=n.object({type:n.literal("procedure"),description:n.string().optional(),parameters:Sp.optional(),input:vp.optional(),output:vp.optional(),errors:Rp.array().optional()}),wq=n.object({type:n.literal("subscription"),description:n.string().optional(),parameters:Sp.optional(),message:n.object({description:n.string().optional(),schema:Zs}),errors:Rp.array().optional()}),kq=n.object({type:n.literal("record"),description:n.string().optional(),key:n.string().optional(),record:Ap}),Aq=n.unknown().superRefine((t,e)=>{if(!t||typeof t!="object")return e.addIssue({code:n.ZodIssueCode.custom,message:"Must be an object",fatal:!0}),n.NEVER;let o=t.type;if(o===void 0)return e.addIssue({code:n.ZodIssueCode.custom,message:"Must have a type",fatal:!0}),n.NEVER;if(typeof o!="string")return e.addIssue({code:n.ZodIssueCode.custom,message:"Type property must be a string",fatal:!0}),n.NEVER;let i=(()=>{switch(o){case"record":return kq;case"permission-set":return bq;case"query":return vq;case"procedure":return xq;case"subscription":return wq;case"blob":return wp;case"array":return kp;case"token":return yq;case"object":return Ap;case"boolean":return Mo;case"integer":return Vo;case"string":return Oo;case"bytes":return Xs;case"cid-link":return Qs;case"unknown":return zo}})();if(!i)return e.addIssue({code:n.ZodIssueCode.custom,message:`Invalid type: ${o} must be one of: record, query, procedure, subscription, blob, array, token, object, boolean, integer, string, bytes, cid-link, unknown`,fatal:!0}),n.NEVER;let s=i.safeParse(t);if(!s.success)for(let a of s.error.issues)e.addIssue(a)}),E9=n.object({lexicon:n.literal(1),id:n.string().refine(zr,{message:"Must be a valid NSID"}),revision:n.number().optional(),description:n.string().optional(),defs:n.record(n.string(),Aq)}).refine(t=>{for(let[e,r]of Object.entries(t.defs))if(e!=="main"&&(r.type==="record"||r.type==="permission-set"||r.type==="procedure"||r.type==="query"||r.type==="subscription"))return!1;return!0},{message:"Records, permission sets, procedures, queries, and subscriptions must be the main definition."});function wt(t){return t!=null&&typeof t=="object"}function vw(t){return wt(t)&&"$type"in t&&typeof t.$type=="string"}var C=class extends Error{},$o=class extends Error{},Ws=class extends Error{};var xw=n.object({$type:n.literal("blob"),ref:xt.cid,mimeType:n.string(),size:n.number()}).strict(),Sq=n.object({cid:n.string(),mimeType:n.string()}).strict(),Cp=n.union([xw,Sq]),kt=class t{constructor(e,r,o,i){this.ref=e,this.mimeType=r,this.size=o,this.original=i??{$type:"blob",ref:e,mimeType:r,size:o}}static asBlobRef(e){return Xt.is(e,Cp)?t.fromJsonRef(e):null}static fromJsonRef(e){return Xt.is(e,xw)?new t(e.ref,e.mimeType,e.size):new t(ie.parse(e.cid),e.mimeType,-1,e)}ipld(){return this.original}toJSON(){return Us(this.ipld())}};function ww(t,e,r,o){return!o||!(o instanceof kt)?{success:!1,error:new C(`${e} should be a blob ref`)}:{success:!0,value:o}}var kw=je(dw,"must be an valid atproto datetime (both RFC-3339 and ISO-8601)"),Aw=je(mw,"must be a uri"),Sw=je(sw,"must be a valid at-uri"),Rw=je(Gs,"must be a valid did"),Cw=je(Fs,"must be a valid handle"),_w=je(Ns,"must be a valid did or a handle"),Ew=je(zr,"must be a valid nsid"),Iw=je(Rq,"must be a cid string"),Dw=je(Hs,"must be a well-formed BCP 47 language tag"),Tw=je(fw,"must be a valid TID"),Pw=je(Ks,"must be a valid Record Key");function je(t,e){return(r,o)=>t(o)?{success:!0,value:o}:{success:!1,error:new C(`${r} ${e}`)}}function Rq(t){try{return ie.parse(t),!0}catch{return!1}}function Ys(t,e,r,o){switch(r.type){case"boolean":return _q(t,e,r,o);case"integer":return Eq(t,e,r,o);case"string":return Iq(t,e,r,o);case"bytes":return Dq(t,e,r,o);case"cid-link":return Tq(t,e,r,o);case"unknown":return Pq(t,e,r,o);default:return{success:!1,error:new C(`Unexpected lexicon type: ${r.type}`)}}}function _q(t,e,r,o){r=r;let i=typeof o;return i==="undefined"?typeof r.default=="boolean"?{success:!0,value:r.default}:{success:!1,error:new C(`${e} must be a boolean`)}:i!=="boolean"?{success:!1,error:new C(`${e} must be a boolean`)}:typeof r.const=="boolean"&&o!==r.const?{success:!1,error:new C(`${e} must be ${r.const}`)}:{success:!0,value:o}}function Eq(t,e,r,o){return r=r,typeof o==="undefined"?typeof r.default=="number"?{success:!0,value:r.default}:{success:!1,error:new C(`${e} must be an integer`)}:Number.isInteger(o)?typeof r.const=="number"&&o!==r.const?{success:!1,error:new C(`${e} must be ${r.const}`)}:Array.isArray(r.enum)&&!r.enum.includes(o)?{success:!1,error:new C(`${e} must be one of (${r.enum.join("|")})`)}:typeof r.maximum=="number"&&o>r.maximum?{success:!1,error:new C(`${e} can not be greater than ${r.maximum}`)}:typeof r.minimum=="number"&&o<r.minimum?{success:!1,error:new C(`${e} can not be less than ${r.minimum}`)}:{success:!0,value:o}:{success:!1,error:new C(`${e} must be an integer`)}}function Iq(t,e,r,o){if(r=r,typeof o>"u")return typeof r.default=="string"?{success:!0,value:r.default}:{success:!1,error:new C(`${e} must be a string`)};if(typeof o!="string")return{success:!1,error:new C(`${e} must be a string`)};if(typeof r.const=="string"&&o!==r.const)return{success:!1,error:new C(`${e} must be ${r.const}`)};if(Array.isArray(r.enum)&&!r.enum.includes(o))return{success:!1,error:new C(`${e} must be one of (${r.enum.join("|")})`)};if(typeof r.minLength=="number"||typeof r.maxLength=="number"){if(typeof r.minLength=="number"&&o.length*3<r.minLength)return{success:!1,error:new C(`${e} must not be shorter than ${r.minLength} characters`)};let i=!1;if(typeof r.minLength>"u"&&typeof r.maxLength=="number"&&o.length*3<=r.maxLength&&(i=!0),!i){let s=hw(o);if(typeof r.maxLength=="number"&&s>r.maxLength)return{success:!1,error:new C(`${e} must not be longer than ${r.maxLength} characters`)};if(typeof r.minLength=="number"&&s<r.minLength)return{success:!1,error:new C(`${e} must not be shorter than ${r.minLength} characters`)}}}if(typeof r.maxGraphemes=="number"||typeof r.minGraphemes=="number"){let i=!1,s=!1;if(typeof r.maxGraphemes=="number"&&(o.length<=r.maxGraphemes?i=!1:i=!0),typeof r.minGraphemes=="number"){if(o.length<r.minGraphemes)return{success:!1,error:new C(`${e} must not be shorter than ${r.minGraphemes} graphemes`)};s=!0}if(i||s){let a=Js(o);if(typeof r.maxGraphemes=="number"&&a>r.maxGraphemes)return{success:!1,error:new C(`${e} must not be longer than ${r.maxGraphemes} graphemes`)};if(typeof r.minGraphemes=="number"&&a<r.minGraphemes)return{success:!1,error:new C(`${e} must not be shorter than ${r.minGraphemes} graphemes`)}}}if(typeof r.format=="string")switch(r.format){case"datetime":return kw(e,o);case"uri":return Aw(e,o);case"at-uri":return Sw(e,o);case"did":return Rw(e,o);case"handle":return Cw(e,o);case"at-identifier":return _w(e,o);case"nsid":return Ew(e,o);case"cid":return Iw(e,o);case"language":return Dw(e,o);case"tid":return Tw(e,o);case"record-key":return Pw(e,o)}return{success:!0,value:o}}function Dq(t,e,r,o){return r=r,!o||!(o instanceof Uint8Array)?{success:!1,error:new C(`${e} must be a byte array`)}:typeof r.maxLength=="number"&&o.byteLength>r.maxLength?{success:!1,error:new C(`${e} must not be larger than ${r.maxLength} bytes`)}:typeof r.minLength=="number"&&o.byteLength<r.minLength?{success:!1,error:new C(`${e} must not be smaller than ${r.minLength} bytes`)}:{success:!0,value:o}}function Tq(t,e,r,o){return ie.asCID(o)===null?{success:!1,error:new C(`${e} must be a CID`)}:{success:!0,value:o}}function Pq(t,e,r,o){return!o||typeof o!="object"?{success:!1,error:new C(`${e} must be an object`)}:{success:!0,value:o}}function qq(t,e,r,o){switch(r.type){case"object":return er(t,e,r,o);case"array":return _p(t,e,r,o);case"blob":return ww(t,e,r,o);default:return Ys(t,e,r,o)}}function _p(t,e,r,o){if(!Array.isArray(o))return{success:!1,error:new C(`${e} must be an array`)};if(typeof r.maxLength=="number"&&o.length>r.maxLength)return{success:!1,error:new C(`${e} must not have more than ${r.maxLength} elements`)};if(typeof r.minLength=="number"&&o.length<r.minLength)return{success:!1,error:new C(`${e} must not have fewer than ${r.minLength} elements`)};let i=r.items;for(let s=0;s<o.length;s++){let a=o[s],c=`${e}/${s}`,u=en(t,c,i,a);if(!u.success)return u}return{success:!0,value:o}}function er(t,e,r,o){if(!wt(o))return{success:!1,error:new C(`${e} must be an object`)};let i=o;if("properties"in r&&r.properties!=null)for(let s in r.properties){let a=o[s];if(a===null&&r.nullable?.includes(s))continue;let c=r.properties[s];if(a===void 0&&!r.required?.includes(s))if(c.type==="integer"||c.type==="boolean"||c.type==="string"){if(c.default===void 0)continue}else continue;let u=`${e}/${s}`,f=en(t,u,c,a),m=f.success?f.value:a;if(m===void 0){if(r.required?.includes(s))return{success:!1,error:new C(`${e} must have the property "${s}"`)}}else if(!f.success)return f;m!==a&&(i===o&&(i={...o}),i[s]=m)}return{success:!0,value:i}}function en(t,e,r,o,i=!1){let s;if(r.type==="union"){if(!vw(o))return{success:!1,error:new C(`${e} must be an object which includes the "$type" property`)};if(Bq(r.refs,o.$type))s=t.getDefOrThrow(o.$type);else return r.closed?{success:!1,error:new C(`${e} $type must be one of ${r.refs.join(", ")}`)}:{success:!0,value:o}}else r.type==="ref"?s=t.getDefOrThrow(r.ref):s=r;return i?er(t,e,s,o):qq(t,e,s,o)}var Bq=(t,e)=>{let r=Q(e);return t.includes(r)?!0:r.endsWith("#main")?t.includes(r.slice(0,-5)):!r.includes("#")&&t.includes(`${r}#main`)};function jw(t,e,r,o){let i=wt(o)?o:{},s=new Set(r.required??[]),a=i;if(typeof r.properties=="object")for(let c in r.properties){let u=r.properties[c],f=u.type==="array"?_p(t,c,u,i[c]):Ys(t,c,u,i[c]),m=f.success?f.value:i[c],h=typeof m>"u";if(h&&s.has(c))return{success:!1,error:new C(`${e} must have the property "${c}"`)};if(!h&&!f.success)return f;m!==i[c]&&(a===i&&(a={...i}),a[c]=m)}return{success:!0,value:a}}function qw(t,e,r){let o=er(t,"Record",e.record,r);if(!o.success)throw o.error;return o.value}function Bw(t,e,r){if(e.parameters){let o=jw(t,"Params",e.parameters,r);if(!o.success)throw o.error;return o.value}}function Lw(t,e,r){if(e.input?.schema)return Ep(t,"Input",e.input.schema,r,!0)}function $w(t,e,r){if(e.output?.schema)return Ep(t,"Output",e.output.schema,r,!0)}function Mw(t,e,r){if(e.message?.schema)return Ep(t,"Message",e.message.schema,r,!0)}function Ep(t,e,r,o,i=!1){let s=en(t,e,r,o,i);if(!s.success)throw s.error;return s.value}var qe=class{constructor(e){if(this.docs=new Map,this.defs=new Map,e)for(let r of e)this.add(r)}[Symbol.iterator](){return this.docs.values()}add(e){let r=Q(e.id);if(this.docs.has(r))throw new Error(`${r} has already been registered`);Ip(e,r),this.docs.set(r,e);for(let[o,i]of Vw(e))this.defs.set(o,i)}remove(e){e=Q(e);let r=this.docs.get(e);if(!r)throw new Error(`Unable to remove "${e}": does not exist`);for(let[o,i]of Vw(r))this.defs.delete(o);this.docs.delete(e)}get(e){return e=Q(e),this.docs.get(e)}getDef(e){return e=Q(e),this.defs.get(e)}getDefOrThrow(e,r){let o=this.getDef(e);if(!o)throw new Ws(`Lexicon not found: ${e}`);if(r&&!r.includes(o.type))throw new $o(`Not a ${r.join(" or ")} lexicon: ${e}`);return o}validate(e,r){if(!wt(r))throw new C("Value must be an object");let o=Q(e),i=this.getDefOrThrow(o,["record","object"]);if(i.type==="record")return er(this,"Record",i.record,r);if(i.type==="object")return er(this,"Object",i,r);throw new $o("Definition must be a record or object")}assertValidRecord(e,r){if(!wt(r))throw new C("Record must be an object");if(!("$type"in r))throw new C("Record/$type must be a string");let{$type:o}=r;if(typeof o!="string")throw new C("Record/$type must be a string");let i=Q(e);if(Q(o)!==i)throw new C(`Invalid $type: must be ${i}, got ${o}`);let s=this.getDefOrThrow(i,["record"]);return qw(this,s,r)}assertValidXrpcParams(e,r){e=Q(e);let o=this.getDefOrThrow(e,["query","procedure","subscription"]);return Bw(this,o,r)}assertValidXrpcInput(e,r){e=Q(e);let o=this.getDefOrThrow(e,["procedure"]);return Lw(this,o,r)}assertValidXrpcOutput(e,r){e=Q(e);let o=this.getDefOrThrow(e,["query","procedure"]);return $w(this,o,r)}assertValidXrpcMessage(e,r){e=Q(e);let o=this.getDefOrThrow(e,["subscription"]);return Mw(this,o,r)}resolveLexUri(e,r){return e=Q(e),Q(r,e)}};function*Vw(t){for(let e in t.defs)yield[`lex:${t.id}#${e}`,t.defs[e]],e==="main"&&(yield[`lex:${t.id}`,t.defs[e]])}function Ip(t,e){for(let r in t)t.type==="ref"?t.ref=Q(t.ref,e):t.type==="union"?t.refs=t.refs.map(o=>Q(o,e)):Array.isArray(t[r])?t[r]=t[r].map(o=>typeof o=="string"?o.startsWith("#")?Q(o,e):o:o&&typeof o=="object"?Ip(o,e):o):t[r]&&typeof t[r]=="object"&&(t[r]=Ip(t[r],e));return t}var Dp=t=>{if(Array.isArray(t))return t.map(e=>Dp(e));if(t&&typeof t=="object"){if(t instanceof kt)return t.original;if(ie.asCID(t)||t instanceof Uint8Array)return t;let e={};for(let r of Object.keys(t))e[r]=Dp(t[r]);return e}return t},Tp=t=>{if(Array.isArray(t))return t.map(e=>Tp(e));if(t&&typeof t=="object"){let e=t;if((e.$type==="blob"||typeof e.cid=="string"&&typeof e.mimeType=="string")&&Xt.is(e,Cp))return kt.fromJsonRef(e);if(ie.asCID(t)||t instanceof Uint8Array)return t;let r={};for(let o of Object.keys(e))r[o]=Tp(e[o]);return r}return t},Ow=t=>Us(Dp(t)),Pp=t=>JSON.stringify(Ow(t)),zw=t=>Tp(Wx(t)),jp=t=>zw(JSON.parse(t));function Uw(t){return t!=null&&typeof t=="object"}function Gw(t,e,r){return r==="main"?t===e:typeof t=="string"&&t.length===e.length+1+r.length&&t.charCodeAt(e.length)===35&&t.startsWith(e)&&t.endsWith(r)}function d(t,e,r){return Uw(t)&&"$type"in t&&Gw(t.$type,e,r)}function Fw(t,e,r){return Uw(t)&&("$type"in t?t.$type===void 0||Gw(t.$type,e,r):!0)}function X(t){return function(e){return t(e).success}}var Lq={AppBskyActorContentVisibilityDeclaration:{lexicon:1,id:"app.bsky.actor.contentVisibilityDeclaration",defs:{main:{type:"record",description:"A declaration of an account's preferences for appearing in content discovery surfaces.",key:"literal:self",record:{type:"object",required:["hideFromAlgorithmicRecommendations"],properties:{hideFromAlgorithmicRecommendations:{type:"boolean",description:"Whether the account requests that its posts be hidden from algorithmic recommendations. Consumers must treat a missing record as false."}}}}}},AppBskyActorDefs:{lexicon:1,id:"app.bsky.actor.defs",defs:{profileViewBasic:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},pronouns:{type:"string"},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},createdAt:{type:"string",format:"datetime"},verification:{type:"ref",ref:"lex:app.bsky.actor.defs#verificationState"},status:{type:"ref",ref:"lex:app.bsky.actor.defs#statusView"},debug:{type:"unknown",description:"Debug information for internal development"}}},profileView:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},pronouns:{type:"string"},description:{type:"string",maxGraphemes:256,maxLength:2560},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},verification:{type:"ref",ref:"lex:app.bsky.actor.defs#verificationState"},status:{type:"ref",ref:"lex:app.bsky.actor.defs#statusView"},debug:{type:"unknown",description:"Debug information for internal development"}}},profileViewDetailed:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},description:{type:"string",maxGraphemes:256,maxLength:2560},pronouns:{type:"string"},website:{type:"string",format:"uri"},avatar:{type:"string",format:"uri"},banner:{type:"string",format:"uri"},followersCount:{type:"integer"},followsCount:{type:"integer"},postsCount:{type:"integer"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},joinedViaStarterPack:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"},indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},pinnedPost:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},verification:{type:"ref",ref:"lex:app.bsky.actor.defs#verificationState"},status:{type:"ref",ref:"lex:app.bsky.actor.defs#statusView"},debug:{type:"unknown",description:"Debug information for internal development"}}},profileAssociated:{type:"object",properties:{lists:{type:"integer"},feedgens:{type:"integer"},starterPacks:{type:"integer"},labeler:{type:"boolean"},chat:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociatedChat"},activitySubscription:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociatedActivitySubscription"},germ:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociatedGerm"}}},profileAssociatedChat:{type:"object",required:["allowIncoming"],properties:{allowIncoming:{type:"string",knownValues:["all","none","following"]},allowGroupInvites:{type:"string",knownValues:["all","none","following"]}}},profileAssociatedGerm:{type:"object",required:["showButtonTo","messageMeUrl"],properties:{messageMeUrl:{type:"string",format:"uri"},showButtonTo:{type:"string",knownValues:["usersIFollow","everyone"]}}},profileAssociatedActivitySubscription:{type:"object",required:["allowSubscriptions"],properties:{allowSubscriptions:{type:"string",knownValues:["followers","mutuals","none"]}}},viewerState:{type:"object",description:"Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",properties:{muted:{type:"boolean",description:"Whether the account is fully muted, directly or via a mutelist. False when the mute is scoped to specific kinds; see mutedOnlyReposts and mutedOnlyQuoteposts."},mutedOnlyReposts:{type:"boolean",description:"Whether the account's reposts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false."},mutedOnlyQuoteposts:{type:"boolean",description:"Whether the account's quote posts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false."},mutedByList:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},blockedBy:{type:"boolean"},blocking:{type:"string",format:"at-uri"},blockingByList:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},following:{type:"string",format:"at-uri"},followedBy:{type:"string",format:"at-uri"},knownFollowers:{description:"This property is present only in selected cases, as an optimization.",type:"ref",ref:"lex:app.bsky.actor.defs#knownFollowers"},activitySubscription:{description:"This property is present only in selected cases, as an optimization.",type:"ref",ref:"lex:app.bsky.notification.defs#activitySubscription"}}},knownFollowers:{type:"object",description:"The subject's followers whom you also follow",required:["count","followers"],properties:{count:{type:"integer"},followers:{type:"array",minLength:0,maxLength:5,items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}},verificationState:{type:"object",description:"Represents the verification information about the user this object is attached to.",required:["verifications","verifiedStatus","trustedVerifierStatus"],properties:{verifications:{type:"array",description:"All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.",items:{type:"ref",ref:"lex:app.bsky.actor.defs#verificationView"}},verifiedStatus:{type:"string",description:"The user's status as a verified account.",knownValues:["valid","invalid","none"]},trustedVerifierStatus:{type:"string",description:"The user's status as a trusted verifier.",knownValues:["valid","invalid","none"]}}},verificationView:{type:"object",description:"An individual verification for an associated subject.",required:["issuer","uri","isValid","createdAt"],properties:{issuer:{type:"string",description:"The user who issued this verification.",format:"did"},issuerDisplayName:{type:"string",description:"The display name of the issuer."},issuerHandle:{type:"string",description:"The handle of the issuer.",format:"handle"},uri:{type:"string",description:"The AT-URI of the verification record.",format:"at-uri"},isValid:{type:"boolean",description:"True if the verification passes validation, otherwise false."},createdAt:{type:"string",description:"Timestamp when the verification was created.",format:"datetime"}}},preferences:{type:"array",items:{type:"union",refs:["lex:app.bsky.actor.defs#adultContentPref","lex:app.bsky.actor.defs#contentLabelPref","lex:app.bsky.actor.defs#savedFeedsPref","lex:app.bsky.actor.defs#savedFeedsPrefV2","lex:app.bsky.actor.defs#personalDetailsPref","lex:app.bsky.actor.defs#declaredAgePref","lex:app.bsky.actor.defs#feedViewPref","lex:app.bsky.actor.defs#threadViewPref","lex:app.bsky.actor.defs#interestsPref","lex:app.bsky.actor.defs#mutedWordsPref","lex:app.bsky.actor.defs#hiddenPostsPref","lex:app.bsky.actor.defs#bskyAppStatePref","lex:app.bsky.actor.defs#labelersPref","lex:app.bsky.actor.defs#postInteractionSettingsPref","lex:app.bsky.actor.defs#verificationPrefs","lex:app.bsky.actor.defs#liveEventPreferences"]}},adultContentPref:{type:"object",required:["enabled"],properties:{enabled:{type:"boolean",default:!1}}},contentLabelPref:{type:"object",required:["label","visibility"],properties:{labelerDid:{type:"string",description:"Which labeler does this preference apply to? If undefined, applies globally.",format:"did"},label:{type:"string"},visibility:{type:"string",knownValues:["ignore","show","warn","hide"]}}},savedFeed:{type:"object",required:["id","type","value","pinned"],properties:{id:{type:"string"},type:{type:"string",knownValues:["feed","list","timeline"]},value:{type:"string"},pinned:{type:"boolean"}}},savedFeedsPrefV2:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#savedFeed"}}}},savedFeedsPref:{type:"object",required:["pinned","saved"],properties:{pinned:{type:"array",items:{type:"string",format:"at-uri"}},saved:{type:"array",items:{type:"string",format:"at-uri"}},timelineIndex:{type:"integer"}}},personalDetailsPref:{type:"object",properties:{birthDate:{type:"string",format:"datetime",description:"The birth date of account owner."}}},declaredAgePref:{type:"object",description:"Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.",properties:{isOverAge13:{type:"boolean",description:"Indicates if the user has declared that they are over 13 years of age."},isOverAge16:{type:"boolean",description:"Indicates if the user has declared that they are over 16 years of age."},isOverAge18:{type:"boolean",description:"Indicates if the user has declared that they are over 18 years of age."}}},feedViewPref:{type:"object",required:["feed"],properties:{feed:{type:"string",description:"The URI of the feed, or an identifier which describes the feed."},hideReplies:{type:"boolean",description:"Hide replies in the feed."},hideRepliesByUnfollowed:{type:"boolean",description:"Hide replies in the feed if they are not by followed users.",default:!0},hideRepliesByLikeCount:{type:"integer",description:"Hide replies in the feed if they do not have this number of likes."},hideReposts:{type:"boolean",description:"Hide reposts in the feed."},hideQuotePosts:{type:"boolean",description:"Hide quote posts in the feed."}}},threadViewPref:{type:"object",properties:{sort:{type:"string",description:"Sorting mode for threads.",knownValues:["oldest","newest","most-likes","random","hotness"]}}},interestsPref:{type:"object",required:["tags"],properties:{updatedAt:{type:"string",format:"datetime",description:"The timestamp when the account owner last updated their interests."},tags:{type:"array",maxLength:100,items:{type:"string",maxLength:640,maxGraphemes:64},description:"A list of tags which describe the account owner's interests gathered during onboarding."}}},mutedWordTarget:{type:"string",knownValues:["content","tag"],maxLength:640,maxGraphemes:64},mutedWord:{type:"object",description:"A word that the account owner has muted.",required:["value","targets"],properties:{id:{type:"string"},value:{type:"string",description:"The muted word itself.",maxLength:1e4,maxGraphemes:1e3},targets:{type:"array",description:"The intended targets of the muted word.",items:{type:"ref",ref:"lex:app.bsky.actor.defs#mutedWordTarget"}},actorTarget:{type:"string",description:"Groups of users to apply the muted word to. If undefined, applies to all users.",knownValues:["all","exclude-following"],default:"all"},expiresAt:{type:"string",format:"datetime",description:"The date and time at which the muted word will expire and no longer be applied."}}},mutedWordsPref:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#mutedWord"},description:"A list of words the account owner has muted."}}},hiddenPostsPref:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"string",format:"at-uri"},description:"A list of URIs of posts the account owner has hidden."}}},labelersPref:{type:"object",required:["labelers"],properties:{labelers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#labelerPrefItem"}}}},labelerPrefItem:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},bskyAppStatePref:{description:"A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.",type:"object",properties:{activeProgressGuide:{type:"ref",ref:"lex:app.bsky.actor.defs#bskyAppProgressGuide"},isBetaUser:{description:"Indicates if the user is participating in the beta features program.",type:"boolean"},queuedNudges:{description:"An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.",type:"array",maxLength:1e3,items:{type:"string",maxLength:100}},nuxs:{description:"Storage for NUXs the user has encountered.",type:"array",maxLength:100,items:{type:"ref",ref:"lex:app.bsky.actor.defs#nux"}}}},bskyAppProgressGuide:{description:"If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.",type:"object",required:["guide"],properties:{guide:{type:"string",maxLength:100}}},nux:{type:"object",description:"A new user experiences (NUX) storage object",required:["id","completed"],properties:{id:{type:"string",maxLength:100},completed:{type:"boolean",default:!1},data:{description:"Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.",type:"string",maxLength:3e3,maxGraphemes:300},expiresAt:{type:"string",format:"datetime",description:"The date and time at which the NUX will expire and should be considered completed."}}},verificationPrefs:{type:"object",description:"Preferences for how verified accounts appear in the app.",required:[],properties:{hideBadges:{description:"Hide the blue check badges for verified accounts and trusted verifiers.",type:"boolean",default:!1}}},liveEventPreferences:{type:"object",description:"Preferences for live events.",properties:{hiddenFeedIds:{description:"A list of feed IDs that the user has hidden from live events.",type:"array",items:{type:"string"}},hideAllFeeds:{description:"Whether to hide all feeds from live events.",type:"boolean",default:!1}}},postInteractionSettingsPref:{type:"object",description:"Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.",required:[],properties:{threadgateAllowRules:{description:"Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.threadgate#mentionRule","lex:app.bsky.feed.threadgate#followerRule","lex:app.bsky.feed.threadgate#followingRule","lex:app.bsky.feed.threadgate#listRule"]}},postgateEmbeddingRules:{description:"Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.postgate#disableRule"]}}}},statusView:{type:"object",required:["status","record"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},status:{type:"string",description:"The status for the account.",knownValues:["app.bsky.actor.status#live"]},record:{type:"unknown"},embed:{type:"union",description:"An optional embed associated with the status.",refs:["lex:app.bsky.embed.external#view"]},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},expiresAt:{type:"string",description:"The date when this status will expire. The application might choose to no longer return the status after expiration.",format:"datetime"},isActive:{type:"boolean",description:"True if the status is not expired, false if it is expired. Only present if expiration was set."},isDisabled:{type:"boolean",description:"True if the user's go-live access has been disabled by a moderator, false otherwise."}}}}},AppBskyActorGetPreferences:{lexicon:1,id:"app.bsky.actor.getPreferences",defs:{main:{type:"query",description:"Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth.",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.actor.defs#preferences"}}}}}}},AppBskyActorGetProfile:{lexicon:1,id:"app.bsky.actor.getProfile",defs:{main:{type:"query",description:"Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"Handle or DID of account to fetch profile of."}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"}}}}},AppBskyActorGetProfiles:{lexicon:1,id:"app.bsky.actor.getProfiles",defs:{main:{type:"query",description:"Get detailed profile views of multiple actors.",parameters:{type:"params",required:["actors"],properties:{actors:{type:"array",items:{type:"string",format:"at-identifier"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["profiles"],properties:{profiles:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"}}}}}}}},AppBskyActorGetSuggestions:{lexicon:1,id:"app.bsky.actor.getSuggestions",defs:{main:{type:"query",description:"Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recId:{type:"integer",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyActorProfile:{lexicon:1,id:"app.bsky.actor.profile",defs:{main:{type:"record",description:"A declaration of a Bluesky account profile.",key:"literal:self",record:{type:"object",properties:{displayName:{type:"string",maxGraphemes:64,maxLength:640},description:{type:"string",description:"Free-form profile description text.",maxGraphemes:256,maxLength:2560},pronouns:{type:"string",description:"Free-form pronouns text.",maxGraphemes:20,maxLength:200},website:{type:"string",format:"uri"},avatar:{type:"blob",description:"Small image to be displayed next to posts from account. AKA, 'profile picture'",accept:["image/png","image/jpeg"],maxSize:1e6},banner:{type:"blob",description:"Larger horizontal image to display behind profile view.",accept:["image/png","image/jpeg"],maxSize:1e6},labels:{type:"union",description:"Self-label values, specific to the Bluesky application, on the overall account.",refs:["lex:com.atproto.label.defs#selfLabels"]},joinedViaStarterPack:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},pinnedPost:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyActorPutPreferences:{lexicon:1,id:"app.bsky.actor.putPreferences",defs:{main:{type:"procedure",description:"Set the private preferences attached to the account.",input:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.actor.defs#preferences"}}}}}}},AppBskyActorSearchActors:{lexicon:1,id:"app.bsky.actor.searchActors",defs:{main:{type:"query",description:"Find actors (profiles) matching search criteria. Does not require auth.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead."},q:{type:"string",description:"Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyActorSearchActorsTypeahead:{lexicon:1,id:"app.bsky.actor.searchActorsTypeahead",defs:{main:{type:"query",description:"Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead."},q:{type:"string",description:"Search query prefix; not a full query string."},limit:{type:"integer",minimum:1,maximum:100,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}}}}}},AppBskyActorStatus:{lexicon:1,id:"app.bsky.actor.status",defs:{main:{type:"record",description:"A declaration of a Bluesky account status.",key:"literal:self",record:{type:"object",required:["status","createdAt"],properties:{status:{type:"string",description:"The status for the account.",knownValues:["app.bsky.actor.status#live"]},embed:{type:"union",description:"An optional embed associated with the status.",refs:["lex:app.bsky.embed.external"]},durationMinutes:{type:"integer",description:"The duration of the status in minutes. Applications can choose to impose minimum and maximum limits.",minimum:1},createdAt:{type:"string",format:"datetime"}}}},live:{type:"token",description:"Advertises an account as currently offering live content."}}},AppBskyAgeassuranceBegin:{lexicon:1,id:"app.bsky.ageassurance.begin",defs:{main:{type:"procedure",description:"Initiate Age Assurance for an account.",input:{encoding:"application/json",schema:{type:"object",required:["email","language","countryCode"],properties:{email:{type:"string",description:"The user's email address to receive Age Assurance instructions."},language:{type:"string",description:"The user's preferred language for communication during the Age Assurance process."},countryCode:{type:"string",description:"An ISO 3166-1 alpha-2 code of the user's location."},regionCode:{type:"string",description:"An optional ISO 3166-2 code of the user's region or state within the country."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#state"}},errors:[{name:"InvalidEmail"},{name:"DidTooLong"},{name:"InvalidInitiation"},{name:"RegionNotSupported"}]}}},AppBskyAgeassuranceDefs:{lexicon:1,id:"app.bsky.ageassurance.defs",defs:{access:{description:"The access level granted based on Age Assurance data we've processed.",type:"string",knownValues:["unknown","none","safe","full"]},status:{type:"string",description:"The status of the Age Assurance process.",knownValues:["unknown","pending","assured","blocked"]},state:{type:"object",description:"The user's computed Age Assurance state.",required:["status","access"],properties:{lastInitiatedAt:{type:"string",format:"datetime",description:"The timestamp when this state was last updated."},status:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#status"},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},stateMetadata:{type:"object",description:"Additional metadata needed to compute Age Assurance state client-side.",required:[],properties:{accountCreatedAt:{type:"string",format:"datetime",description:"The account creation timestamp."}}},config:{type:"object",description:"",required:["regions"],properties:{regions:{type:"array",description:"The per-region Age Assurance configuration.",items:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#configRegion"}}}},configRegion:{type:"object",description:"The Age Assurance configuration for a specific region.",required:["countryCode","minAccessAge","rules"],properties:{platforms:{type:"array",description:"The platforms this configuration applies to. If omitted, the configuration applies to all platforms.",items:{type:"string",knownValues:["web","ios","android"]}},countryCode:{type:"string",description:"The ISO 3166-1 alpha-2 country code this configuration applies to."},regionCode:{type:"string",description:"The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country."},minAccessAge:{type:"integer",description:"The minimum age (as a whole integer) required to use Bluesky in this region."},additionalVerificationMethods:{type:"array",description:"Verification methods permitted in this region in addition to the third-party (KWS) flow, which is always supported. `device` permits using the native on-device age APIs (e.g. Apple Declared Age Range, Google Play Age Signals).",items:{type:"string",knownValues:["device"]}},rules:{type:"array",description:"The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item.",items:{type:"union",refs:["lex:app.bsky.ageassurance.defs#configRegionRuleDefault","lex:app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge","lex:app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge","lex:app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge","lex:app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge","lex:app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan","lex:app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan"]}}}},configRegionRuleDefault:{type:"object",description:"Age Assurance rule that applies by default.",required:["access"],properties:{access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfDeclaredOverAge:{type:"object",description:"Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age.",required:["age","access"],properties:{age:{type:"integer",description:"The age threshold as a whole integer."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfDeclaredUnderAge:{type:"object",description:"Age Assurance rule that applies if the user has declared themselves under a certain age.",required:["age","access"],properties:{age:{type:"integer",description:"The age threshold as a whole integer."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfAssuredOverAge:{type:"object",description:"Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age.",required:["age","access"],properties:{age:{type:"integer",description:"The age threshold as a whole integer."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfAssuredUnderAge:{type:"object",description:"Age Assurance rule that applies if the user has been assured to be under a certain age.",required:["age","access"],properties:{age:{type:"integer",description:"The age threshold as a whole integer."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfAccountNewerThan:{type:"object",description:"Age Assurance rule that applies if the account is equal-to or newer than a certain date.",required:["date","access"],properties:{date:{type:"string",format:"datetime",description:"The date threshold as a datetime string."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},configRegionRuleIfAccountOlderThan:{type:"object",description:"Age Assurance rule that applies if the account is older than a certain date.",required:["date","access"],properties:{date:{type:"string",format:"datetime",description:"The date threshold as a datetime string."},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"}}},event:{type:"object",description:"Object used to store Age Assurance data in stash.",required:["createdAt","status","access","attemptId","countryCode"],properties:{createdAt:{type:"string",format:"datetime",description:"The date and time of this write operation."},attemptId:{type:"string",description:"The unique identifier for this instance of the Age Assurance flow, in UUID format."},status:{type:"string",description:"The status of the Age Assurance process.",knownValues:["unknown","pending","assured","blocked"]},access:{description:"The access level granted based on Age Assurance data we've processed.",type:"string",knownValues:["unknown","none","safe","full"]},countryCode:{type:"string",description:"The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow."},regionCode:{type:"string",description:"The ISO 3166-2 region code provided when beginning the Age Assurance flow."},email:{type:"string",description:"The email used for Age Assurance."},initIp:{type:"string",description:"The IP address used when initiating the Age Assurance flow."},initUa:{type:"string",description:"The user agent used when initiating the Age Assurance flow."},completeIp:{type:"string",description:"The IP address used when completing the Age Assurance flow."},completeUa:{type:"string",description:"The user agent used when completing the Age Assurance flow."}}}}},AppBskyAgeassuranceGetConfig:{lexicon:1,id:"app.bsky.ageassurance.getConfig",defs:{main:{type:"query",description:"Returns Age Assurance configuration for use on the client.",output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#config"}}}}},AppBskyAgeassuranceGetState:{lexicon:1,id:"app.bsky.ageassurance.getState",defs:{main:{type:"query",description:"Returns server-computed Age Assurance state, if available, and any additional metadata needed to compute Age Assurance state client-side.",parameters:{type:"params",required:["countryCode"],properties:{countryCode:{type:"string"},regionCode:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["state","metadata"],properties:{state:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#state"},metadata:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#stateMetadata"}}}}}}},AppBskyBookmarkCreateBookmark:{lexicon:1,id:"app.bsky.bookmark.createBookmark",defs:{main:{type:"procedure",description:"Creates a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"}}}},errors:[{name:"UnsupportedCollection",description:"The URI to be bookmarked is for an unsupported collection."}]}}},AppBskyBookmarkDefs:{lexicon:1,id:"app.bsky.bookmark.defs",defs:{bookmark:{description:"Object used to store bookmark data in stash.",type:"object",required:["subject"],properties:{subject:{description:"A strong ref to the record to be bookmarked. Currently, only `app.bsky.feed.post` records are supported.",type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},bookmarkView:{type:"object",required:["subject","item"],properties:{subject:{description:"A strong ref to the bookmarked record.",type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"},item:{type:"union",refs:["lex:app.bsky.feed.defs#blockedPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#postView"]}}}}},AppBskyBookmarkDeleteBookmark:{lexicon:1,id:"app.bsky.bookmark.deleteBookmark",defs:{main:{type:"procedure",description:"Deletes a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}}},errors:[{name:"UnsupportedCollection",description:"The URI to be bookmarked is for an unsupported collection."}]}}},AppBskyBookmarkGetBookmarks:{lexicon:1,id:"app.bsky.bookmark.getBookmarks",defs:{main:{type:"query",description:"Gets views of records bookmarked by the authenticated user. Requires authentication.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["bookmarks"],properties:{cursor:{type:"string"},bookmarks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.bookmark.defs#bookmarkView"}}}}}}}},AppBskyContactDefs:{lexicon:1,id:"app.bsky.contact.defs",defs:{matchAndContactIndex:{description:"Associates a profile with the positional index of the contact import input in the call to `app.bsky.contact.importContacts`, so clients can know which phone caused a particular match.",type:"object",required:["match","contactIndex"],properties:{match:{description:"Profile of the matched user.",type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},contactIndex:{description:"The index of this match in the import contact input.",type:"integer",minimum:0,maximum:999}}},syncStatus:{type:"object",required:["syncedAt","matchesCount"],properties:{syncedAt:{description:"Last date when contacts where imported.",type:"string",format:"datetime"},matchesCount:{description:"Number of existing contact matches resulting of the user imports and of their imported contacts having imported the user. Matches stop being counted when the user either follows the matched contact or dismisses the match.",type:"integer",minimum:0}}},notification:{description:"A stash object to be sent via bsync representing a notification to be created.",type:"object",required:["from","to"],properties:{from:{description:"The DID of who this notification comes from.",type:"string",format:"did"},to:{description:"The DID of who this notification should go to.",type:"string",format:"did"}}}}},AppBskyContactDismissMatch:{lexicon:1,id:"app.bsky.contact.dismissMatch",defs:{main:{type:"procedure",description:"Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{description:"The subject's DID to dismiss the match with.",type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}},errors:[{name:"InvalidDid"},{name:"InternalError"}]}}},AppBskyContactGetMatches:{lexicon:1,id:"app.bsky.contact.getMatches",defs:{main:{type:"query",description:"Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["matches"],properties:{cursor:{type:"string"},matches:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}},errors:[{name:"InvalidDid"},{name:"InvalidLimit"},{name:"InvalidCursor"},{name:"InternalError"}]}}},AppBskyContactGetSyncStatus:{lexicon:1,id:"app.bsky.contact.getSyncStatus",defs:{main:{type:"query",description:"Gets the user's current contact import status. Requires authentication.",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",properties:{syncStatus:{description:"If present, indicates the user has imported their contacts. If not present, indicates the user never used the feature or called `app.bsky.contact.removeData` and didn't import again since.",type:"ref",ref:"lex:app.bsky.contact.defs#syncStatus"}}}},errors:[{name:"InvalidDid"},{name:"InternalError"}]}}},AppBskyContactImportContacts:{lexicon:1,id:"app.bsky.contact.importContacts",defs:{main:{type:"procedure",description:"Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["token","contacts"],properties:{token:{description:"JWT to authenticate the call. Use the JWT received as a response to the call to `app.bsky.contact.verifyPhone`.",type:"string"},contacts:{description:"List of phone numbers in global E.164 format (e.g., '+12125550123'). Phone numbers that cannot be normalized into a valid phone number will be discarded. Should not repeat the 'phone' input used in `app.bsky.contact.verifyPhone`.",type:"array",items:{type:"string"},minLength:1,maxLength:1e3}}}},output:{encoding:"application/json",schema:{type:"object",required:["matchesAndContactIndexes"],properties:{matchesAndContactIndexes:{description:"The users that matched during import and their indexes on the input contacts, so the client can correlate with its local list.",type:"array",items:{type:"ref",ref:"lex:app.bsky.contact.defs#matchAndContactIndex"}}}}},errors:[{name:"InvalidDid"},{name:"InvalidContacts"},{name:"TooManyContacts"},{name:"InvalidToken"},{name:"InternalError"}]}}},AppBskyContactRemoveData:{lexicon:1,id:"app.bsky.contact.removeData",defs:{main:{type:"procedure",description:"Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",properties:{}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}},errors:[{name:"InvalidDid"},{name:"InternalError"}]}}},AppBskyContactSendNotification:{lexicon:1,id:"app.bsky.contact.sendNotification",defs:{main:{type:"procedure",description:"System endpoint to send notifications related to contact imports. Requires role authentication.",input:{encoding:"application/json",schema:{type:"object",required:["from","to"],properties:{from:{description:"The DID of who this notification comes from.",type:"string",format:"did"},to:{description:"The DID of who this notification should go to.",type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},AppBskyContactStartPhoneVerification:{lexicon:1,id:"app.bsky.contact.startPhoneVerification",defs:{main:{type:"procedure",description:"Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to `app.bsky.contact.verifyPhone`. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["phone"],properties:{phone:{description:"The phone number to receive the code via SMS.",type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}},errors:[{name:"RateLimitExceeded"},{name:"InvalidDid"},{name:"InvalidPhone"},{name:"InternalError"}]}}},AppBskyContactVerifyPhone:{lexicon:1,id:"app.bsky.contact.verifyPhone",defs:{main:{type:"procedure",description:"Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["phone","code"],properties:{phone:{description:"The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`.",type:"string"},code:{description:"The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`.",type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["token"],properties:{token:{description:"JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call.",type:"string"}}}},errors:[{name:"RateLimitExceeded"},{name:"InvalidDid"},{name:"InvalidPhone"},{name:"InvalidCode"},{name:"InternalError"}]}}},AppBskyDraftCreateDraft:{lexicon:1,id:"app.bsky.draft.createDraft",defs:{main:{type:"procedure",description:"Inserts a draft using private storage (stash). An upper limit of drafts might be enforced. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["draft"],properties:{draft:{type:"ref",ref:"lex:app.bsky.draft.defs#draft"}}}},output:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string",format:"tid",description:"The ID of the created draft."}}}},errors:[{name:"DraftLimitReached",description:"Trying to insert a new draft when the limit was already reached."}]}}},AppBskyDraftDefs:{lexicon:1,id:"app.bsky.draft.defs",defs:{draftWithId:{description:"A draft with an identifier, used to store drafts in private storage (stash).",type:"object",required:["id","draft"],properties:{id:{description:"A TID to be used as a draft identifier.",type:"string",format:"tid"},draft:{type:"ref",ref:"lex:app.bsky.draft.defs#draft"}}},draft:{description:"A draft containing an array of draft posts.",type:"object",required:["posts"],properties:{deviceId:{type:"string",description:"UUIDv4 identifier of the device that created this draft.",maxLength:100},deviceName:{type:"string",description:"The device and/or platform on which the draft was created.",maxLength:100},posts:{description:"Array of draft posts that compose this draft.",type:"array",minLength:1,maxLength:100,items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftPost"}},langs:{type:"array",description:"Indicates human language of posts primary text content.",maxLength:3,items:{type:"string",format:"language"}},postgateEmbeddingRules:{description:"Embedding rules for the postgates to be created when this draft is published.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.postgate#disableRule"]}},threadgateAllow:{description:"Allow-rules for the threadgate to be created when this draft is published.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.threadgate#mentionRule","lex:app.bsky.feed.threadgate#followerRule","lex:app.bsky.feed.threadgate#followingRule","lex:app.bsky.feed.threadgate#listRule"]}}}},draftPost:{description:"One of the posts that compose a draft.",type:"object",required:["text"],properties:{text:{type:"string",maxLength:1e4,maxGraphemes:1e3,description:"The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts."},labels:{type:"union",description:"Self-label values for this post. Effectively content warnings.",refs:["lex:com.atproto.label.defs#selfLabels"]},embedImages:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedImage"},maxLength:4},embedGallery:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedGallery"},embedVideos:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedVideo"},maxLength:1},embedExternals:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedExternal"},maxLength:1},embedRecords:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedRecord"},maxLength:1}}},draftView:{description:"View to present drafts data to users.",type:"object",required:["id","draft","createdAt","updatedAt"],properties:{id:{description:"A TID to be used as a draft identifier.",type:"string",format:"tid"},draft:{type:"ref",ref:"lex:app.bsky.draft.defs#draft"},createdAt:{description:"The time the draft was created.",type:"string",format:"datetime"},updatedAt:{description:"The time the draft was last updated.",type:"string",format:"datetime"}}},draftEmbedLocalRef:{type:"object",required:["path"],properties:{path:{type:"string",description:"Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts.",minLength:1,maxLength:1024}}},draftEmbedCaption:{type:"object",required:["lang","content"],properties:{lang:{type:"string",format:"language"},content:{type:"string",maxLength:1e4}}},draftEmbedGallery:{type:"object",required:["items"],properties:{items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedGalleryItems"}}},draftEmbedGalleryItems:{type:"array",items:{type:"union",refs:["lex:app.bsky.draft.defs#draftEmbedImage"]},maxLength:20,description:"The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs."},draftEmbedImage:{type:"object",required:["localRef"],properties:{localRef:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedLocalRef"},alt:{type:"string",maxGraphemes:2e3}}},draftEmbedVideo:{type:"object",required:["localRef"],properties:{localRef:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedLocalRef"},alt:{type:"string",maxGraphemes:2e3},captions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftEmbedCaption"},maxLength:20}}},draftEmbedExternal:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"uri"}}},draftEmbedRecord:{type:"object",required:["record"],properties:{record:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}}}},AppBskyDraftDeleteDraft:{lexicon:1,id:"app.bsky.draft.deleteDraft",defs:{main:{type:"procedure",description:"Deletes a draft by ID. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string",format:"tid"}}}}}}},AppBskyDraftGetDrafts:{lexicon:1,id:"app.bsky.draft.getDrafts",defs:{main:{type:"query",description:"Gets views of user drafts. Requires authentication.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["drafts"],properties:{cursor:{type:"string"},drafts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.draft.defs#draftView"}}}}}}}},AppBskyDraftUpdateDraft:{lexicon:1,id:"app.bsky.draft.updateDraft",defs:{main:{type:"procedure",description:"Updates a draft using private storage (stash). If the draft ID points to a non-existing ID, the update will be silently ignored. This is done because updates don't enforce draft limit, so it accepts all writes, but will ignore invalid ones. Requires authentication.",input:{encoding:"application/json",schema:{type:"object",required:["draft"],properties:{draft:{type:"ref",ref:"lex:app.bsky.draft.defs#draftWithId"}}}}}}},AppBskyEmbedDefs:{lexicon:1,id:"app.bsky.embed.defs",defs:{aspectRatio:{type:"object",description:"width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.",required:["width","height"],properties:{width:{type:"integer",minimum:1},height:{type:"integer",minimum:1}}}}},AppBskyEmbedExternal:{lexicon:1,id:"app.bsky.embed.external",defs:{main:{type:"object",description:"A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).",required:["external"],properties:{external:{type:"ref",ref:"lex:app.bsky.embed.external#external"}}},external:{type:"object",required:["uri","title","description"],properties:{uri:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},thumb:{type:"blob",accept:["image/*"],maxSize:1e6},associatedRefs:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},description:"StrongRefs (uri+cid) of the Atmosphere records that backed this view."}}},view:{type:"object",required:["external"],properties:{external:{type:"ref",ref:"lex:app.bsky.embed.external#viewExternal"}}},viewExternal:{type:"object",required:["uri","title","description"],properties:{uri:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},thumb:{type:"string",format:"uri"},createdAt:{type:"string",format:"datetime",description:"When the external content was created, if available. Example: a publication date, for an article."},updatedAt:{type:"string",format:"datetime",description:"When the external content was updated, if available."},readingTime:{type:"integer",description:"Estimated reading time in minutes, if applicable and available."},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},source:{type:"ref",ref:"lex:app.bsky.embed.external#viewExternalSource"},associatedRefs:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},description:"StrongRefs (uri+cid) of the Atmosphere records that backed this view."},associatedProfiles:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},description:"Profiles of the owners of the Atmosphere records that backed this view."}}},viewExternalSource:{type:"object",description:"The source of an external embed, such as a standard.site publication.",required:["uri","title"],properties:{uri:{type:"string",format:"uri",description:"URI of the source, if available. Example: the https:// URL of a site.standard.publication record."},icon:{type:"string",format:"uri",description:"Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View."},title:{type:"string"},description:{type:"string"},theme:{type:"ref",ref:"lex:app.bsky.embed.external#viewExternalSourceTheme"}}},viewExternalSourceTheme:{type:"object",description:"The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source.",properties:{backgroundRGB:{type:"ref",ref:"lex:app.bsky.embed.external#colorRGB"},foregroundRGB:{type:"ref",ref:"lex:app.bsky.embed.external#colorRGB"},accentRGB:{type:"ref",ref:"lex:app.bsky.embed.external#colorRGB"},accentForegroundRGB:{type:"ref",ref:"lex:app.bsky.embed.external#colorRGB"}}},colorRGB:{type:"object",description:"RGB color definition, inspired by site.standard.theme.color#rgb",required:["r","g","b"],properties:{r:{type:"integer",minimum:0,maximum:255},g:{type:"integer",minimum:0,maximum:255},b:{type:"integer",minimum:0,maximum:255}}}}},AppBskyEmbedGallery:{lexicon:1,id:"app.bsky.embed.gallery",description:"An assortment of media embedded in a Bluesky record (eg, a post).",defs:{main:{type:"object",required:["items"],properties:{items:{type:"array",maxLength:20,description:"The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.",items:{type:"union",refs:["lex:app.bsky.embed.gallery#image"],description:"The media items in the gallery. Each item may be of a different type, but all types must be supported by the client."}}}},image:{type:"object",required:["image","alt","aspectRatio"],properties:{image:{type:"blob",accept:["image/*"],maxSize:2e6},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}},view:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"union",refs:["lex:app.bsky.embed.gallery#viewImage"]}}}},viewImage:{type:"object",required:["thumbnail","fullsize","alt","aspectRatio"],properties:{thumbnail:{type:"string",format:"uri",description:"Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View."},fullsize:{type:"string",format:"uri",description:"Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View."},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}}}},AppBskyEmbedGetEmbedExternalView:{lexicon:1,id:"app.bsky.embed.getEmbedExternalView",defs:{main:{type:"query",description:"Resolve one or more AT-URIs into the data needed to render an enhanced external embed. Returns `associatedRefs` (strongRefs to embed into a post's external.associatedRefs), the raw `associatedRecords`, and a hydrated `view`. The response is empty (`{}`) when no records were resolvable, or when validation determined the resolved records don't actually back the requested URL; clients should fall back to their own link-card rendering in that case and skip writing strongRefs to the post.",parameters:{type:"params",required:["url","uris"],properties:{url:{type:"string",format:"uri",description:"The canonical web URL the embed represents (typically the URL the user pasted into the composer). Used as the returned view's `uri`. May be used for validation in the future."},uris:{type:"array",description:"AT-URIs of any Atmosphere records that can be resolved and used to construct #externalView views. Example: a site.standard.document and optionally its associated site.standard.publication.",items:{type:"string",format:"at-uri"},maxLength:4}}},output:{encoding:"application/json",schema:{type:"object",properties:{view:{type:"ref",ref:"lex:app.bsky.embed.external#view",description:"Hydrated view of the embed. Present only when the resolved records back the requested URL and supply enough information to populate the required `viewExternal` fields. Omitted alongside the rest of the response when no records resolved or validation failed."},associatedRefs:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},description:"StrongRefs (URI+CID) of the Atmosphere records that backed this view, suitable for embedding into a post's external.associatedRefs."},associatedRecords:{type:"array",items:{type:"unknown",description:"The raw record data of the Atmosphere records that backed this view. This is returned for convenience, to avoid the need for the client to separately fetch the record data for the associatedRefs. Example: the site.standard.document and site.standard.publication records that backed this view."}}}}}}}},AppBskyEmbedImages:{lexicon:1,id:"app.bsky.embed.images",description:"A set of images embedded in a Bluesky record (eg, a post).",defs:{main:{type:"object",required:["images"],properties:{images:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.images#image"},maxLength:4}}},image:{type:"object",required:["image","alt"],properties:{image:{type:"blob",description:"The raw image file. May be up to 2 MB, formerly limited to 1 MB.",accept:["image/*"],maxSize:2e6},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}},view:{type:"object",required:["images"],properties:{images:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.images#viewImage"},maxLength:4}}},viewImage:{type:"object",required:["thumb","fullsize","alt"],properties:{thumb:{type:"string",format:"uri",description:"Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View."},fullsize:{type:"string",format:"uri",description:"Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View."},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}}}},AppBskyEmbedRecord:{lexicon:1,id:"app.bsky.embed.record",description:"A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.",defs:{main:{type:"object",required:["record"],properties:{record:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},view:{type:"object",required:["record"],properties:{record:{type:"union",refs:["lex:app.bsky.embed.record#viewRecord","lex:app.bsky.embed.record#viewNotFound","lex:app.bsky.embed.record#viewBlocked","lex:app.bsky.embed.record#viewDetached","lex:app.bsky.feed.defs#generatorView","lex:app.bsky.graph.defs#listView","lex:app.bsky.labeler.defs#labelerView","lex:app.bsky.graph.defs#starterPackViewBasic"]}}},viewRecord:{type:"object",required:["uri","cid","author","value","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},value:{type:"unknown",description:"The record data itself."},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},replyCount:{type:"integer"},repostCount:{type:"integer"},likeCount:{type:"integer"},quoteCount:{type:"integer"},embeds:{type:"array",items:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.gallery#view","lex:app.bsky.embed.external#view","lex:app.bsky.embed.record#view","lex:app.bsky.embed.recordWithMedia#view"]}},indexedAt:{type:"string",format:"datetime"}}},viewNotFound:{type:"object",required:["uri","notFound"],properties:{uri:{type:"string",format:"at-uri"},notFound:{type:"boolean",const:!0}}},viewBlocked:{type:"object",required:["uri","blocked","author"],properties:{uri:{type:"string",format:"at-uri"},blocked:{type:"boolean",const:!0},author:{type:"ref",ref:"lex:app.bsky.feed.defs#blockedAuthor"}}},viewDetached:{type:"object",required:["uri","detached"],properties:{uri:{type:"string",format:"at-uri"},detached:{type:"boolean",const:!0}}}}},AppBskyEmbedRecordWithMedia:{lexicon:1,id:"app.bsky.embed.recordWithMedia",description:"A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.",defs:{main:{type:"object",required:["record","media"],properties:{record:{type:"ref",ref:"lex:app.bsky.embed.record"},media:{type:"union",refs:["lex:app.bsky.embed.images","lex:app.bsky.embed.video","lex:app.bsky.embed.gallery","lex:app.bsky.embed.external"]}}},view:{type:"object",required:["record","media"],properties:{record:{type:"ref",ref:"lex:app.bsky.embed.record#view"},media:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.gallery#view","lex:app.bsky.embed.external#view"]}}}}},AppBskyEmbedVideo:{lexicon:1,id:"app.bsky.embed.video",description:"A video embedded in a Bluesky record (eg, a post).",defs:{main:{type:"object",required:["video"],properties:{video:{type:"blob",description:"The mp4 video file. May be up to 300mb, formerly limited to 100mb.",accept:["video/mp4"],maxSize:3e8},captions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.video#caption"},maxLength:20},alt:{type:"string",description:"Alt text description of the video, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"},presentation:{type:"string",description:"A hint to the client about how to present the video.",knownValues:["default","gif"]}}},caption:{type:"object",required:["lang","file"],properties:{lang:{type:"string",format:"language"},file:{type:"blob",accept:["text/vtt"],maxSize:2e4}}},view:{type:"object",required:["cid","playlist"],properties:{cid:{type:"string",format:"cid"},playlist:{type:"string",format:"uri"},thumbnail:{type:"string",format:"uri"},alt:{type:"string"},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"},presentation:{type:"string",description:"A hint to the client about how to present the video.",knownValues:["default","gif"]}}}}},AppBskyFeedDefs:{lexicon:1,id:"app.bsky.feed.defs",defs:{postView:{type:"object",required:["uri","cid","author","record","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},record:{type:"unknown"},embed:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.gallery#view","lex:app.bsky.embed.external#view","lex:app.bsky.embed.record#view","lex:app.bsky.embed.recordWithMedia#view"]},bookmarkCount:{type:"integer"},replyCount:{type:"integer"},repostCount:{type:"integer"},likeCount:{type:"integer"},quoteCount:{type:"integer"},indexedAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.feed.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},threadgate:{type:"ref",ref:"lex:app.bsky.feed.defs#threadgateView"},debug:{type:"unknown",description:"Debug information for internal development"}}},viewerState:{type:"object",description:"Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",properties:{repost:{type:"string",format:"at-uri"},like:{type:"string",format:"at-uri"},bookmarked:{type:"boolean"},threadMuted:{type:"boolean"},replyDisabled:{type:"boolean"},embeddingDisabled:{type:"boolean"},pinned:{type:"boolean"},knownLikers:{description:"This property is present only in selected cases, as an optimization.",type:"ref",ref:"lex:app.bsky.feed.defs#knownLikers"}}},knownLikers:{type:"object",description:"The post's likers whom you also follow",required:["count","actors"],properties:{count:{type:"integer"},actors:{type:"array",minLength:0,maxLength:5,items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}},threadContext:{type:"object",description:"Metadata about this post within the context of the thread it is in.",properties:{rootAuthorLike:{type:"string",format:"at-uri"}}},feedViewPost:{type:"object",required:["post"],properties:{post:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},reply:{type:"ref",ref:"lex:app.bsky.feed.defs#replyRef"},opThreadPostIndex:{type:"integer",description:"The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread."},opThreadPostCount:{type:"integer",description:"The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread."},reason:{type:"union",refs:["lex:app.bsky.feed.defs#reasonRepost","lex:app.bsky.feed.defs#reasonPin"]},feedContext:{type:"string",description:"Context provided by feed generator that may be passed back alongside interactions.",maxLength:2e3},reqId:{type:"string",description:"Unique identifier per request that may be passed back alongside interactions.",maxLength:100}}},replyRef:{type:"object",required:["root","parent"],properties:{root:{type:"union",refs:["lex:app.bsky.feed.defs#postView","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},parent:{type:"union",refs:["lex:app.bsky.feed.defs#postView","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},grandparentAuthor:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic",description:"When parent is a reply to another post, this is the author of that post."}}},reasonRepost:{type:"object",required:["by","indexedAt"],properties:{by:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},indexedAt:{type:"string",format:"datetime"}}},reasonPin:{type:"object",properties:{}},threadViewPost:{type:"object",required:["post"],properties:{post:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},parent:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},replies:{type:"array",items:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]}},threadContext:{type:"ref",ref:"lex:app.bsky.feed.defs#threadContext"}}},notFoundPost:{type:"object",required:["uri","notFound"],properties:{uri:{type:"string",format:"at-uri"},notFound:{type:"boolean",const:!0}}},blockedPost:{type:"object",required:["uri","blocked","author"],properties:{uri:{type:"string",format:"at-uri"},blocked:{type:"boolean",const:!0},author:{type:"ref",ref:"lex:app.bsky.feed.defs#blockedAuthor"}}},blockedAuthor:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"}}},generatorView:{type:"object",required:["uri","cid","did","creator","displayName","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},did:{type:"string",format:"did"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},displayName:{type:"string"},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"string",format:"uri"},likeCount:{type:"integer",minimum:0},acceptsInteractions:{type:"boolean"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorViewerState"},contentMode:{type:"string",knownValues:["app.bsky.feed.defs#contentModeUnspecified","app.bsky.feed.defs#contentModeVideo"]},indexedAt:{type:"string",format:"datetime"}}},generatorViewerState:{type:"object",properties:{like:{type:"string",format:"at-uri"}}},skeletonFeedPost:{type:"object",required:["post"],properties:{post:{type:"string",format:"at-uri"},reason:{type:"union",refs:["lex:app.bsky.feed.defs#skeletonReasonRepost","lex:app.bsky.feed.defs#skeletonReasonPin"]},feedContext:{type:"string",description:"Context that will be passed through to client and may be passed to feed generator back alongside interactions.",maxLength:2e3}}},skeletonReasonRepost:{type:"object",required:["repost"],properties:{repost:{type:"string",format:"at-uri"}}},skeletonReasonPin:{type:"object",properties:{}},threadgateView:{type:"object",properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"}}}},interaction:{type:"object",properties:{item:{type:"string",format:"at-uri"},event:{type:"string",knownValues:["app.bsky.feed.defs#requestLess","app.bsky.feed.defs#requestMore","app.bsky.feed.defs#clickthroughItem","app.bsky.feed.defs#clickthroughAuthor","app.bsky.feed.defs#clickthroughReposter","app.bsky.feed.defs#clickthroughEmbed","app.bsky.feed.defs#interactionSeen","app.bsky.feed.defs#interactionLike","app.bsky.feed.defs#interactionRepost","app.bsky.feed.defs#interactionReply","app.bsky.feed.defs#interactionQuote","app.bsky.feed.defs#interactionShare"]},feedContext:{type:"string",description:"Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.",maxLength:2e3},reqId:{type:"string",description:"Unique identifier per request that may be passed back alongside interactions.",maxLength:100}}},requestLess:{type:"token",description:"Request that less content like the given feed item be shown in the feed"},requestMore:{type:"token",description:"Request that more content like the given feed item be shown in the feed"},clickthroughItem:{type:"token",description:"User clicked through to the feed item"},clickthroughAuthor:{type:"token",description:"User clicked through to the author of the feed item"},clickthroughReposter:{type:"token",description:"User clicked through to the reposter of the feed item"},clickthroughEmbed:{type:"token",description:"User clicked through to the embedded content of the feed item"},contentModeUnspecified:{type:"token",description:"Declares the feed generator returns any types of posts."},contentModeVideo:{type:"token",description:"Declares the feed generator returns posts containing app.bsky.embed.video embeds."},interactionSeen:{type:"token",description:"Feed item was seen by user"},interactionLike:{type:"token",description:"User liked the feed item"},interactionRepost:{type:"token",description:"User reposted the feed item"},interactionReply:{type:"token",description:"User replied to the feed item"},interactionQuote:{type:"token",description:"User quoted the feed item"},interactionShare:{type:"token",description:"User shared the feed item"}}},AppBskyFeedDescribeFeedGenerator:{lexicon:1,id:"app.bsky.feed.describeFeedGenerator",defs:{main:{type:"query",description:"Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).",output:{encoding:"application/json",schema:{type:"object",required:["did","feeds"],properties:{did:{type:"string",format:"did"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.describeFeedGenerator#feed"}},links:{type:"ref",ref:"lex:app.bsky.feed.describeFeedGenerator#links"}}}}},feed:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},links:{type:"object",properties:{privacyPolicy:{type:"string"},termsOfService:{type:"string"}}}}},AppBskyFeedGenerator:{lexicon:1,id:"app.bsky.feed.generator",defs:{main:{type:"record",description:"Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.",key:"any",record:{type:"object",required:["did","displayName","createdAt"],properties:{did:{type:"string",format:"did"},displayName:{type:"string",maxGraphemes:24,maxLength:240},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"blob",accept:["image/png","image/jpeg"],maxSize:1e6},acceptsInteractions:{type:"boolean",description:"Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions"},labels:{type:"union",description:"Self-label values",refs:["lex:com.atproto.label.defs#selfLabels"]},contentMode:{type:"string",knownValues:["app.bsky.feed.defs#contentModeUnspecified","app.bsky.feed.defs#contentModeVideo"]},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyFeedGetActorFeeds:{lexicon:1,id:"app.bsky.feed.getActorFeeds",defs:{main:{type:"query",description:"Get a list of feeds (feed generator records) created by the actor (in the actor's repo).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetActorLikes:{lexicon:1,id:"app.bsky.feed.getActorLikes",defs:{main:{type:"query",description:"Get a list of posts liked by an actor. Requires auth, actor must be the requesting account.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"BlockedActor"},{name:"BlockedByActor"}]}}},AppBskyFeedGetAuthorFeed:{lexicon:1,id:"app.bsky.feed.getAuthorFeed",defs:{main:{type:"query",description:"Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},filter:{type:"string",description:"Combinations of post/repost types to include in response.",knownValues:["posts_with_replies","posts_no_replies","posts_with_media","posts_and_author_threads","posts_with_video"],default:"posts_with_replies"},includePins:{type:"boolean",default:!1}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"BlockedActor"},{name:"BlockedByActor"}]}}},AppBskyFeedGetFeed:{lexicon:1,id:"app.bsky.feed.getFeed",defs:{main:{type:"query",description:"Get a hydrated feed from an actor's selected feed generator. Implemented by App View.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"UnknownFeed"}]}}},AppBskyFeedGetFeedGenerator:{lexicon:1,id:"app.bsky.feed.getFeedGenerator",defs:{main:{type:"query",description:"Get information about a feed generator. Implemented by AppView.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri",description:"AT-URI of the feed generator record."}}},output:{encoding:"application/json",schema:{type:"object",required:["view","isOnline","isValid"],properties:{view:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"},isOnline:{type:"boolean",description:"Indicates whether the feed generator service has been online recently, or else seems to be inactive."},isValid:{type:"boolean",description:"Indicates whether the feed generator service is compatible with the record declaration."}}}}}}},AppBskyFeedGetFeedGenerators:{lexicon:1,id:"app.bsky.feed.getFeedGenerators",defs:{main:{type:"query",description:"Get information about a list of feed generators.",parameters:{type:"params",required:["feeds"],properties:{feeds:{type:"array",items:{type:"string",format:"at-uri"}}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetFeedSkeleton:{lexicon:1,id:"app.bsky.feed.getFeedSkeleton",defs:{main:{type:"query",description:"Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri",description:"Reference to feed generator record describing the specific feed being requested."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#skeletonFeedPost"}},reqId:{type:"string",description:"Unique identifier per request that may be passed back alongside interactions.",maxLength:100}}}},errors:[{name:"UnknownFeed"}]}}},AppBskyFeedGetLikes:{lexicon:1,id:"app.bsky.feed.getLikes",defs:{main:{type:"query",description:"Get like records which reference a subject (by AT-URI and CID).",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"AT-URI of the subject (eg, a post record)."},cid:{type:"string",format:"cid",description:"CID of the subject record (aka, specific version of record), to filter likes."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","likes"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},likes:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.getLikes#like"}}}}}},like:{type:"object",required:["indexedAt","createdAt","actor"],properties:{indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},actor:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}},AppBskyFeedGetListFeed:{lexicon:1,id:"app.bsky.feed.getListFeed",defs:{main:{type:"query",description:"Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.",parameters:{type:"params",required:["list"],properties:{list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"UnknownList"}]}}},AppBskyFeedGetPostThread:{lexicon:1,id:"app.bsky.feed.getPostThread",defs:{main:{type:"query",description:"Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) to post record."},depth:{type:"integer",description:"How many levels of reply depth should be included in response.",default:6,minimum:0,maximum:1e3},parentHeight:{type:"integer",description:"How many levels of parent (and grandparent, etc) post to include.",default:80,minimum:0,maximum:1e3}}},output:{encoding:"application/json",schema:{type:"object",required:["thread"],properties:{thread:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},threadgate:{type:"ref",ref:"lex:app.bsky.feed.defs#threadgateView"}}}},errors:[{name:"NotFound"}]}}},AppBskyFeedGetPosts:{lexicon:1,id:"app.bsky.feed.getPosts",defs:{main:{type:"query",description:"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",description:"List of post AT-URIs to return hydrated views for.",items:{type:"string",format:"at-uri"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}}}}},AppBskyFeedGetQuotes:{lexicon:1,id:"app.bsky.feed.getQuotes",defs:{main:{type:"query",description:"Get a list of quotes for a given post.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) of post record"},cid:{type:"string",format:"cid",description:"If supplied, filters to quotes of specific version (by CID) of the post record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},sort:{type:"string",knownValues:["latest","top"],description:"Ordering of results. 'latest' (default when unset) is newest first; 'top' orders quotes by their like count."}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","posts"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}}}}},AppBskyFeedGetRepostedBy:{lexicon:1,id:"app.bsky.feed.getRepostedBy",defs:{main:{type:"query",description:"Get a list of reposts for a given post.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) of post record"},cid:{type:"string",format:"cid",description:"If supplied, filters to reposts of specific version (by CID) of the post record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","repostedBy"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},repostedBy:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyFeedGetSuggestedFeeds:{lexicon:1,id:"app.bsky.feed.getSuggestedFeeds",defs:{main:{type:"query",description:"Get a list of suggested feeds (feed generators) for the requesting account.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetTimeline:{lexicon:1,id:"app.bsky.feed.getTimeline",defs:{main:{type:"query",description:"Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.",parameters:{type:"params",properties:{algorithm:{type:"string",description:"Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}}}}},AppBskyFeedLike:{lexicon:1,id:"app.bsky.feed.like",defs:{main:{type:"record",description:"Record declaring a 'like' of a piece of subject content.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"},via:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}}}}},AppBskyFeedPost:{lexicon:1,id:"app.bsky.feed.post",defs:{main:{type:"record",description:"Record containing a Bluesky post.",key:"tid",record:{type:"object",required:["text","createdAt"],properties:{text:{type:"string",maxLength:3e3,maxGraphemes:300,description:"The primary post content. May be an empty string, if there are embeds."},entities:{type:"array",description:"DEPRECATED: replaced by app.bsky.richtext.facet.",items:{type:"ref",ref:"lex:app.bsky.feed.post#entity"}},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},reply:{type:"ref",ref:"lex:app.bsky.feed.post#replyRef"},embed:{type:"union",refs:["lex:app.bsky.embed.images","lex:app.bsky.embed.video","lex:app.bsky.embed.gallery","lex:app.bsky.embed.external","lex:app.bsky.embed.record","lex:app.bsky.embed.recordWithMedia"]},langs:{type:"array",description:"Indicates human language of post primary text content.",maxLength:3,items:{type:"string",format:"language"}},labels:{type:"union",description:"Self-label values for this post. Effectively content warnings.",refs:["lex:com.atproto.label.defs#selfLabels"]},tags:{type:"array",description:"Additional hashtags, in addition to any included in post text and facets.",maxLength:8,items:{type:"string",maxLength:640,maxGraphemes:64}},createdAt:{type:"string",format:"datetime",description:"Client-declared timestamp when this post was originally created."}}}},replyRef:{type:"object",required:["root","parent"],properties:{root:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},parent:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},entity:{type:"object",description:"Deprecated: use facets instead.",required:["index","type","value"],properties:{index:{type:"ref",ref:"lex:app.bsky.feed.post#textSlice"},type:{type:"string",description:"Expected values are 'mention' and 'link'."},value:{type:"string"}}},textSlice:{type:"object",description:"Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.",required:["start","end"],properties:{start:{type:"integer",minimum:0},end:{type:"integer",minimum:0}}}}},AppBskyFeedPostgate:{lexicon:1,id:"app.bsky.feed.postgate",defs:{main:{type:"record",key:"tid",description:"Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.",record:{type:"object",required:["post","createdAt"],properties:{createdAt:{type:"string",format:"datetime"},post:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the post record."},detachedEmbeddingUris:{type:"array",maxLength:50,items:{type:"string",format:"at-uri"},description:"List of AT-URIs embedding this post that the author has detached from."},embeddingRules:{description:"List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.postgate#disableRule"]}}}}},disableRule:{type:"object",description:"Disables embedding of this post.",properties:{}}}},AppBskyFeedRepost:{lexicon:1,id:"app.bsky.feed.repost",defs:{main:{description:"Record representing a 'repost' of an existing Bluesky post.",type:"record",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"},via:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}}}}},AppBskyFeedSearchPosts:{lexicon:1,id:"app.bsky.feed.searchPosts",defs:{main:{type:"query",description:"Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},sort:{type:"string",knownValues:["top","latest"],default:"latest",description:"Specifies the ranking order of results."},since:{type:"string",description:"Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},until:{type:"string",description:"Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)."},mentions:{type:"string",format:"at-identifier",description:"Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions."},author:{type:"string",format:"at-identifier",description:"Filter to posts by the given account. Handles are resolved to DID before query-time."},lang:{type:"string",format:"language",description:"Filter to posts in the given language. Expected to be based on post language field, though server may override language detection."},domain:{type:"string",description:"Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization."},url:{type:"string",format:"uri",description:"Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching."},tag:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyFeedSearchPostsV2:{lexicon:1,id:"app.bsky.feed.searchPostsV2",defs:{main:{type:"query",description:"Find posts matching a search query or filters, returning search hits for matching post records.",parameters:{type:"params",required:[],properties:{cursor:{type:"string",description:"Optional pagination cursor."},limit:{type:"integer",minimum:1,maximum:100,default:25,description:"Maximum number of results to return."},query:{type:"string",description:"Search query string. A query or at least one filter is required."},sort:{type:"string",knownValues:["recent","top"],description:"Ranking order for results. 'recent' sorts by recency; 'top' uses search ranking."},authors:{type:"array",items:{type:"string",format:"at-identifier"},description:"Include posts by any of these authors. Handles are resolved to DIDs before searching."},mentions:{type:"array",items:{type:"string",format:"at-identifier"},description:"Include posts that mention any of these accounts. Handles are resolved to DIDs before searching."},domains:{type:"array",items:{type:"string"},description:"Include posts that link to any of these domains."},urls:{type:"array",items:{type:"string",format:"uri"},description:"Include posts that link to any of these URLs."},embeddedAtUris:{type:"array",items:{type:"string",format:"at-uri"},description:"Include posts that embed any of these AT URIs."},hashtags:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Include posts tagged with any of these hashtags. Do not include the hash (#) prefix."},excludeAuthors:{type:"array",items:{type:"string",format:"at-identifier"},description:"Exclude posts by any of these authors. Handles are resolved to DIDs before searching."},excludeMentions:{type:"array",items:{type:"string",format:"at-identifier"},description:"Exclude posts that mention any of these accounts. Handles are resolved to DIDs before searching."},excludeDomains:{type:"array",items:{type:"string"},description:"Exclude posts that link to any of these domains."},excludeUrls:{type:"array",items:{type:"string",format:"uri"},description:"Exclude posts that link to any of these URLs."},excludeEmbeddedAtUris:{type:"array",items:{type:"string",format:"at-uri"},description:"Exclude posts that embed any of these AT URIs."},excludeHashtags:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Exclude posts tagged with any of these hashtags. Do not include the hash (#) prefix."},since:{type:"string",description:"Include posts indexed at or after this timestamp. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},until:{type:"string",description:"Include posts indexed before this timestamp. Defaults to the current time. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},allTime:{type:"boolean",description:"Search the full index instead of the recent-post window."},languages:{type:"array",items:{type:"string",format:"language"},description:"Include posts whose language matches any of these language codes."},excludeLanguages:{type:"array",items:{type:"string",format:"language"},description:"Exclude posts whose language matches any of these language codes."},hasMedia:{type:"boolean",description:"Include only posts with media."},hasVideo:{type:"boolean",description:"Include only posts with video."},replyParentUri:{type:"string",format:"at-uri",description:"Include only direct replies to this parent post URI."},threadRootUri:{type:"string",format:"at-uri",description:"Include only posts in the thread rooted at this post URI."},excludeReplies:{type:"boolean",description:"Exclude replies from results. Mutually exclusive with repliesOnly."},repliesOnly:{type:"boolean",description:"Include only replies. Mutually exclusive with excludeReplies."},following:{type:"boolean",description:"Include only posts from accounts followed by the viewer."},queryLanguage:{type:"string",knownValues:["ja","zh","ko","th","ar"],description:"Language analyzer hint for the query text. If unset, the server auto-detects when possible."}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{cursor:{type:"string",description:"Cursor for the next page of results."},hitsTotal:{type:"integer",description:"Estimated total number of matching hits. May be rounded or truncated."},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},description:"Hydrated views of matching posts."},detectedQueryLanguages:{type:"array",items:{type:"string",knownValues:["ja","zh","ko","th","ar"]},description:"Query languages detected for CJK, Thai, or Arabic text. Empty or omitted for other scripts."}}}},errors:[{name:"BadQueryString"}]}}},AppBskyFeedSendInteractions:{lexicon:1,id:"app.bsky.feed.sendInteractions",defs:{main:{type:"procedure",description:"Send information about interactions with feed items back to the feed generator that served them.",input:{encoding:"application/json",schema:{type:"object",required:["interactions"],properties:{feed:{type:"string",format:"at-uri"},interactions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#interaction"}}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},AppBskyFeedThreadgate:{lexicon:1,id:"app.bsky.feed.threadgate",defs:{main:{type:"record",key:"tid",description:"Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",record:{type:"object",required:["post","createdAt"],properties:{post:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the post record."},allow:{description:"List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.",type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.threadgate#mentionRule","lex:app.bsky.feed.threadgate#followerRule","lex:app.bsky.feed.threadgate#followingRule","lex:app.bsky.feed.threadgate#listRule"]}},createdAt:{type:"string",format:"datetime"},hiddenReplies:{type:"array",maxLength:300,items:{type:"string",format:"at-uri"},description:"List of hidden reply URIs."}}}},mentionRule:{type:"object",description:"Allow replies from actors mentioned in your post.",properties:{}},followerRule:{type:"object",description:"Allow replies from actors who follow you.",properties:{}},followingRule:{type:"object",description:"Allow replies from actors you follow.",properties:{}},listRule:{type:"object",description:"Allow replies from actors on a list.",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}},AppBskyGraphBlock:{lexicon:1,id:"app.bsky.graph.block",defs:{main:{type:"record",description:"Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"did",description:"DID of the account to be blocked."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphDefs:{lexicon:1,id:"app.bsky.graph.defs",defs:{listViewBasic:{type:"object",required:["uri","cid","name","purpose"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},name:{type:"string",maxLength:64,minLength:1},purpose:{type:"ref",ref:"lex:app.bsky.graph.defs#listPurpose"},avatar:{type:"string",format:"uri"},listItemCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewerState"},indexedAt:{type:"string",format:"datetime"}}},listView:{type:"object",required:["uri","cid","creator","name","purpose","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},name:{type:"string",maxLength:64,minLength:1},purpose:{type:"ref",ref:"lex:app.bsky.graph.defs#listPurpose"},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"string",format:"uri"},listItemCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewerState"},indexedAt:{type:"string",format:"datetime"}}},listItemView:{type:"object",required:["uri","subject"],properties:{uri:{type:"string",format:"at-uri"},subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},subjectOptedOut:{type:"boolean",const:!0,description:"Set to true when the subject has opted out of appearing in the reference list. Only set when the viewer owns the list."}}},starterPackView:{type:"object",required:["uri","cid","record","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},list:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},listItemsSample:{type:"array",maxLength:12,items:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}},feeds:{type:"array",maxLength:3,items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}},joinedWeekCount:{type:"integer",minimum:0},joinedAllTimeCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"}}},starterPackViewBasic:{type:"object",required:["uri","cid","record","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},listItemCount:{type:"integer",minimum:0},joinedWeekCount:{type:"integer",minimum:0},joinedAllTimeCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"}}},listPurpose:{type:"string",knownValues:["app.bsky.graph.defs#modlist","app.bsky.graph.defs#curatelist","app.bsky.graph.defs#referencelist"]},modlist:{type:"token",description:"A list of actors to apply an aggregate moderation action (mute/block) on."},curatelist:{type:"token",description:"A list of actors used for curation purposes such as list feeds or interaction gating."},referencelist:{type:"token",description:"A list of actors used for only for reference purposes such as within a starter pack."},listViewerState:{type:"object",properties:{muted:{type:"boolean"},blocked:{type:"string",format:"at-uri"},referenceListOptOut:{type:"string",format:"at-uri",description:"The authenticated viewer's app.bsky.graph.referencelistoptout record URI for this reference list. Only set for reference lists. A client can delete this record to undo the opt-out."}}},notFoundActor:{type:"object",description:"indicates that a handle or DID could not be resolved",required:["actor","notFound"],properties:{actor:{type:"string",format:"at-identifier"},notFound:{type:"boolean",const:!0}}},relationship:{type:"object",description:"lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)",required:["did"],properties:{did:{type:"string",format:"did"},following:{type:"string",format:"at-uri",description:"if the actor follows this DID, this is the AT-URI of the follow record"},followedBy:{type:"string",format:"at-uri",description:"if the actor is followed by this DID, contains the AT-URI of the follow record"},blocking:{type:"string",format:"at-uri",description:"if the actor blocks this DID, this is the AT-URI of the block record"},blockedBy:{type:"string",format:"at-uri",description:"if the actor is blocked by this DID, contains the AT-URI of the block record"},blockingByList:{type:"string",format:"at-uri",description:"if the actor blocks this DID via a block list, this is the AT-URI of the listblock record"},blockedByList:{type:"string",format:"at-uri",description:"if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record"}}}}},AppBskyGraphFollow:{lexicon:1,id:"app.bsky.graph.follow",defs:{main:{type:"record",description:"Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"},via:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}}}}},AppBskyGraphGetActorStarterPacks:{lexicon:1,id:"app.bsky.graph.getActorStarterPacks",defs:{main:{type:"query",description:"Get a list of starter packs created by the actor.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{cursor:{type:"string"},starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"}}}}}}}},AppBskyGraphGetBlocks:{lexicon:1,id:"app.bsky.graph.getBlocks",defs:{main:{type:"query",description:"Enumerates which accounts the requesting account is currently blocking. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["blocks"],properties:{cursor:{type:"string"},blocks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetFollowers:{lexicon:1,id:"app.bsky.graph.getFollowers",defs:{main:{type:"query",description:"Enumerates accounts which follow a specified account (actor).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},sort:{type:"string",knownValues:["latest","top"]}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","followers"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},followers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetFollows:{lexicon:1,id:"app.bsky.graph.getFollows",defs:{main:{type:"query",description:"Enumerates accounts which a specified account (actor) follows.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},sort:{type:"string",knownValues:["latest","top"]}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","follows"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},follows:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetKnownFollowers:{lexicon:1,id:"app.bsky.graph.getKnownFollowers",defs:{main:{type:"query",description:"Enumerates accounts which follow a specified account (actor) and are followed by the viewer.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","followers"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},followers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetList:{lexicon:1,id:"app.bsky.graph.getList",defs:{main:{type:"query",description:"Gets a 'view' (with additional context) of a specified list.",parameters:{type:"params",required:["list"],properties:{list:{type:"string",format:"at-uri",description:"Reference (AT-URI) of the list record to hydrate."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["list","items"],properties:{cursor:{type:"string"},list:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"},items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}}}}}}}},AppBskyGraphGetListBlocks:{lexicon:1,id:"app.bsky.graph.getListBlocks",defs:{main:{type:"query",description:"Get mod lists that the requesting account (actor) is blocking. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetListMutes:{lexicon:1,id:"app.bsky.graph.getListMutes",defs:{main:{type:"query",description:"Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetLists:{lexicon:1,id:"app.bsky.graph.getLists",defs:{main:{type:"query",description:"Enumerates the lists created by a specified account (actor).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"The account (actor) to enumerate lists from."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},purposes:{type:"array",description:"Optional filter by list purpose. If not specified, all supported types are returned.",items:{type:"string",knownValues:["modlist","curatelist"]}}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetListsWithMembership:{lexicon:1,id:"app.bsky.graph.getListsWithMembership",defs:{main:{type:"query",description:"Enumerates the lists created by the session user, and includes membership information about `actor` in those lists. Only supports curation and moderation lists (no reference lists, used in starter packs). Requires auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"The account (actor) to check for membership."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},purposes:{type:"array",description:"Optional filter by list purpose. If not specified, all supported types are returned.",items:{type:"string",knownValues:["modlist","curatelist"]}}}},output:{encoding:"application/json",schema:{type:"object",required:["listsWithMembership"],properties:{cursor:{type:"string"},listsWithMembership:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.getListsWithMembership#listWithMembership"}}}}}},listWithMembership:{description:"A list and an optional list item indicating membership of a target user to that list.",type:"object",required:["list"],properties:{list:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"},listItem:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}}}}},AppBskyGraphGetMutes:{lexicon:1,id:"app.bsky.graph.getMutes",defs:{main:{type:"query",description:"Enumerates accounts that the requesting account (actor) currently has fully muted. Mutes scoped to specific kinds of content (only reposts, only quote posts) are not included. Responses may contain more items than the requested limit. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["mutes"],properties:{cursor:{type:"string"},mutes:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetRelationships:{lexicon:1,id:"app.bsky.graph.getRelationships",defs:{main:{type:"query",description:"Enumerates public relationships between one account, and a list of other accounts. Does not require auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"Primary account requesting relationships for."},others:{type:"array",description:"List of 'other' accounts to be related back to the primary.",maxLength:30,items:{type:"string",format:"at-identifier"}}}},output:{encoding:"application/json",schema:{type:"object",required:["relationships"],properties:{actor:{type:"string",format:"did"},relationships:{type:"array",items:{type:"union",refs:["lex:app.bsky.graph.defs#relationship","lex:app.bsky.graph.defs#notFoundActor"]}}}}},errors:[{name:"ActorNotFound",description:"the primary actor at-identifier could not be resolved"}]}}},AppBskyGraphGetStarterPack:{lexicon:1,id:"app.bsky.graph.getStarterPack",defs:{main:{type:"query",description:"Gets a view of a starter pack.",parameters:{type:"params",required:["starterPack"],properties:{starterPack:{type:"string",format:"at-uri",description:"Reference (AT-URI) of the starter pack record."}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPack"],properties:{starterPack:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"}}}}}}},AppBskyGraphGetStarterPacks:{lexicon:1,id:"app.bsky.graph.getStarterPacks",defs:{main:{type:"query",description:"Get views for a list of starter packs.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",items:{type:"string",format:"at-uri"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"}}}}}}}},AppBskyGraphGetStarterPacksWithMembership:{lexicon:1,id:"app.bsky.graph.getStarterPacksWithMembership",defs:{main:{type:"query",description:"Enumerates the starter packs created by the session user, and includes membership information about `actor` in those starter packs. Requires auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"The account (actor) to check for membership."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacksWithMembership"],properties:{cursor:{type:"string"},starterPacksWithMembership:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.getStarterPacksWithMembership#starterPackWithMembership"}}}}}},starterPackWithMembership:{description:"A starter pack and an optional list item indicating membership of a target user to that starter pack.",type:"object",required:["starterPack"],properties:{starterPack:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"},listItem:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}}}}},AppBskyGraphGetSuggestedFollowsByActor:{lexicon:1,id:"app.bsky.graph.getSuggestedFollowsByActor",defs:{main:{type:"query",description:"Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"}}},output:{encoding:"application/json",schema:{type:"object",required:["suggestions"],properties:{suggestions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."},isFallback:{type:"boolean",description:"DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid",default:!1},recId:{type:"integer",description:"DEPRECATED: use recIdStr instead."}}}}}}},AppBskyGraphList:{lexicon:1,id:"app.bsky.graph.list",defs:{main:{type:"record",description:"Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.",key:"tid",record:{type:"object",required:["name","purpose","createdAt"],properties:{purpose:{type:"ref",description:"Defines the purpose of the list (aka, moderation-oriented or curration-oriented)",ref:"lex:app.bsky.graph.defs#listPurpose"},name:{type:"string",maxLength:64,minLength:1,description:"Display name for list; can not be empty."},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"blob",accept:["image/png","image/jpeg"],maxSize:1e6},labels:{type:"union",refs:["lex:com.atproto.label.defs#selfLabels"]},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphListblock:{lexicon:1,id:"app.bsky.graph.listblock",defs:{main:{type:"record",description:"Record representing a block relationship against an entire an entire list of accounts (actors).",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the mod list record."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphListitem:{lexicon:1,id:"app.bsky.graph.listitem",defs:{main:{type:"record",description:"Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.",key:"tid",record:{type:"object",required:["subject","list","createdAt"],properties:{subject:{type:"string",format:"did",description:"The account which is included on the list."},list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record (app.bsky.graph.list)."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphMuteActor:{lexicon:1,id:"app.bsky.graph.muteActor",defs:{main:{type:"procedure",description:"Creates a mute relationship for the specified account. If a mute already exists for the account, it is updated in place: the stored scope is replaced with the scope in this request. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},onlyReposts:{type:"boolean",description:"Restrict the mute to the account's reposts. When any 'only' scope is set, just the scoped content is muted; when none are set, the account is fully muted. Repeat calls replace the stored scope rather than adding to it."},onlyQuoteposts:{type:"boolean",description:"Restrict the mute to the account's quote posts. See onlyReposts."}}}}}}},AppBskyGraphMuteActorList:{lexicon:1,id:"app.bsky.graph.muteActorList",defs:{main:{type:"procedure",description:"Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphMuteThread:{lexicon:1,id:"app.bsky.graph.muteThread",defs:{main:{type:"procedure",description:"Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphReferencelistoptout:{lexicon:1,id:"app.bsky.graph.referencelistoptout",defs:{main:{type:"record",description:"Record requesting that its author be omitted from the public presentation of a reference list. This record is only enforced when the subject list's current purpose is app.bsky.graph.defs#referencelist. AppView indexes at most one record per actor and list pair, and ignores duplicate records.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"at-uri",description:"Canonical, DID-based AT URI of the app.bsky.graph.list record from which the author requests omission."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphSearchStarterPacks:{lexicon:1,id:"app.bsky.graph.searchStarterPacks",defs:{main:{type:"query",description:"Find starter packs matching search criteria. Does not require auth.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{cursor:{type:"string"},starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"}}}}}}}},AppBskyGraphSearchStarterPacksV2:{lexicon:1,id:"app.bsky.graph.searchStarterPacksV2",defs:{main:{type:"query",description:"Find starter packs matching search criteria. Does not require auth.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Estimated total number of matching hits. May be rounded or truncated."},starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"}}}}}}}},AppBskyGraphStarterpack:{lexicon:1,id:"app.bsky.graph.starterpack",defs:{main:{type:"record",description:"Record defining a starter pack of actors and feeds for new users.",key:"tid",record:{type:"object",required:["name","list","createdAt"],properties:{name:{type:"string",maxGraphemes:50,maxLength:500,minLength:1,description:"Display name for starter pack; can not be empty."},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record."},feeds:{type:"array",maxLength:3,items:{type:"ref",ref:"lex:app.bsky.graph.starterpack#feedItem"}},createdAt:{type:"string",format:"datetime"}}}},feedItem:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}}}},AppBskyGraphUnmuteActor:{lexicon:1,id:"app.bsky.graph.unmuteActor",defs:{main:{type:"procedure",description:"Unmutes the specified account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"}}}}}}},AppBskyGraphUnmuteActorList:{lexicon:1,id:"app.bsky.graph.unmuteActorList",defs:{main:{type:"procedure",description:"Unmutes the specified list of accounts. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphUnmuteThread:{lexicon:1,id:"app.bsky.graph.unmuteThread",defs:{main:{type:"procedure",description:"Unmutes the specified thread. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphVerification:{lexicon:1,id:"app.bsky.graph.verification",defs:{main:{type:"record",description:"Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted.",key:"tid",record:{type:"object",required:["subject","handle","displayName","createdAt"],properties:{subject:{description:"DID of the subject the verification applies to.",type:"string",format:"did"},handle:{description:"Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.",type:"string",format:"handle"},displayName:{description:"Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.",type:"string"},createdAt:{description:"Date of when the verification was created.",type:"string",format:"datetime"}}}}}},AppBskyLabelerDefs:{lexicon:1,id:"app.bsky.labeler.defs",defs:{labelerView:{type:"object",required:["uri","cid","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},likeCount:{type:"integer",minimum:0},viewer:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerViewerState"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},labelerViewDetailed:{type:"object",required:["uri","cid","creator","policies","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},policies:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerPolicies"},likeCount:{type:"integer",minimum:0},viewer:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerViewerState"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},reasonTypes:{description:"The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",type:"array",items:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"}},subjectTypes:{description:"The set of subject types (account, record, etc) this service accepts reports on.",type:"array",items:{type:"ref",ref:"lex:com.atproto.moderation.defs#subjectType"}},subjectCollections:{type:"array",description:"Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.",items:{type:"string",format:"nsid"}}}},labelerViewerState:{type:"object",properties:{like:{type:"string",format:"at-uri"}}},labelerPolicies:{type:"object",required:["labelValues"],properties:{labelValues:{type:"array",description:"The label values which this labeler publishes. May include global or custom labels.",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValue"}},labelValueDefinitions:{type:"array",description:"Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValueDefinition"}}}}}},AppBskyLabelerGetServices:{lexicon:1,id:"app.bsky.labeler.getServices",defs:{main:{type:"query",description:"Get information about a list of labeler services.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},detailed:{type:"boolean",default:!1}}},output:{encoding:"application/json",schema:{type:"object",required:["views"],properties:{views:{type:"array",items:{type:"union",refs:["lex:app.bsky.labeler.defs#labelerView","lex:app.bsky.labeler.defs#labelerViewDetailed"]}}}}}}}},AppBskyLabelerService:{lexicon:1,id:"app.bsky.labeler.service",defs:{main:{type:"record",description:"A declaration of the existence of labeler service.",key:"literal:self",record:{type:"object",required:["policies","createdAt"],properties:{policies:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerPolicies"},labels:{type:"union",refs:["lex:com.atproto.label.defs#selfLabels"]},createdAt:{type:"string",format:"datetime"},reasonTypes:{description:"The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",type:"array",items:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"}},subjectTypes:{description:"The set of subject types (account, record, etc) this service accepts reports on.",type:"array",items:{type:"ref",ref:"lex:com.atproto.moderation.defs#subjectType"}},subjectCollections:{type:"array",description:"Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.",items:{type:"string",format:"nsid"}}}}}}},AppBskyNotificationDeclaration:{lexicon:1,id:"app.bsky.notification.declaration",defs:{main:{type:"record",description:"A declaration of the user's choices related to notifications that can be produced by them.",key:"literal:self",record:{type:"object",required:["allowSubscriptions"],properties:{allowSubscriptions:{type:"string",description:"A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.",knownValues:["followers","mutuals","none"]}}}}}},AppBskyNotificationDefs:{lexicon:1,id:"app.bsky.notification.defs",defs:{recordDeleted:{type:"object",properties:{}},chatPreference:{type:"object",description:"Deprecated: use chat.bsky.notification preferences instead. This will only return a default value.",required:["include","push"],properties:{include:{type:"string",knownValues:["all","accepted"]},push:{type:"boolean"}}},filterablePreference:{type:"object",required:["include","list","push"],properties:{include:{type:"string",knownValues:["all","follows"]},list:{type:"boolean"},push:{type:"boolean"}}},preference:{type:"object",required:["list","push"],properties:{list:{type:"boolean"},push:{type:"boolean"}}},preferences:{type:"object",required:["chat","follow","like","likeViaRepost","mention","quote","reply","repost","repostViaRepost","starterpackJoined","subscribedPost","unverified","verified"],properties:{chat:{type:"ref",ref:"lex:app.bsky.notification.defs#chatPreference",description:"Deprecated: use chat.bsky.notification preferences instead. This will only return a default value."},follow:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},like:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},likeViaRepost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},mention:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},quote:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},reply:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},repost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},repostViaRepost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},starterpackJoined:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},subscribedPost:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},unverified:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},verified:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"}}},activitySubscription:{type:"object",required:["post","reply"],properties:{post:{type:"boolean"},reply:{type:"boolean"}}},subjectActivitySubscription:{description:"Object used to store activity subscription data in stash.",type:"object",required:["subject","activitySubscription"],properties:{subject:{type:"string",format:"did"},activitySubscription:{type:"ref",ref:"lex:app.bsky.notification.defs#activitySubscription"}}}}},AppBskyNotificationGetPreferences:{lexicon:1,id:"app.bsky.notification.getPreferences",defs:{main:{type:"query",description:"Get notification-related preferences for an account. Requires auth.",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.notification.defs#preferences"}}}}}}},AppBskyNotificationGetUnreadCount:{lexicon:1,id:"app.bsky.notification.getUnreadCount",defs:{main:{type:"query",description:"Count the number of unread notifications for the requesting account. Requires auth.",parameters:{type:"params",properties:{priority:{type:"boolean",description:"Deprecated: this parameter is ignored."},seenAt:{type:"string",format:"datetime"}}},output:{encoding:"application/json",schema:{type:"object",required:["count"],properties:{count:{type:"integer"}}}}}}},AppBskyNotificationListActivitySubscriptions:{lexicon:1,id:"app.bsky.notification.listActivitySubscriptions",defs:{main:{type:"query",description:"Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subscriptions"],properties:{cursor:{type:"string"},subscriptions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyNotificationListNotifications:{lexicon:1,id:"app.bsky.notification.listNotifications",defs:{main:{type:"query",description:"Enumerate notifications for the requesting account. Requires auth.",parameters:{type:"params",properties:{reasons:{description:"Notification reasons to include in response.",type:"array",items:{type:"string",description:"A reason that matches the reason property of #notification."}},limit:{type:"integer",minimum:1,maximum:100,default:50},priority:{type:"boolean",description:"Deprecated: this parameter is ignored."},cursor:{type:"string"},seenAt:{type:"string",format:"datetime",description:"Deprecated: this parameter is unsupported and will cause an error."}}},output:{encoding:"application/json",schema:{type:"object",required:["notifications"],properties:{cursor:{type:"string"},notifications:{type:"array",items:{type:"ref",ref:"lex:app.bsky.notification.listNotifications#notification"}},priority:{type:"boolean",description:"Deprecated: this field is no longer populated."},seenAt:{type:"string",format:"datetime"}}}}},notification:{type:"object",required:["uri","cid","author","reason","record","isRead","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},reason:{type:"string",description:"The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.",knownValues:["like","repost","follow","mention","reply","quote","starterpack-joined","verified","unverified","like-via-repost","repost-via-repost","subscribed-post","contact-match"]},reasonSubject:{type:"string",format:"at-uri"},record:{type:"unknown"},starterPack:{description:"The starter pack associated with this notification. Present when the notification is for a follow originating from a starter pack.",type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"},isRead:{type:"boolean"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}},AppBskyNotificationPutActivitySubscription:{lexicon:1,id:"app.bsky.notification.putActivitySubscription",defs:{main:{type:"procedure",description:"Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["subject","activitySubscription"],properties:{subject:{type:"string",format:"did"},activitySubscription:{type:"ref",ref:"lex:app.bsky.notification.defs#activitySubscription"}}}},output:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"string",format:"did"},activitySubscription:{type:"ref",ref:"lex:app.bsky.notification.defs#activitySubscription"}}}}}}},AppBskyNotificationPutPreferences:{lexicon:1,id:"app.bsky.notification.putPreferences",defs:{main:{type:"procedure",description:"Set notification-related preferences for an account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["priority"],properties:{priority:{type:"boolean"}}}}}}},AppBskyNotificationPutPreferencesV2:{lexicon:1,id:"app.bsky.notification.putPreferencesV2",defs:{main:{type:"procedure",description:"Set notification-related preferences for an account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",properties:{chat:{type:"ref",ref:"lex:app.bsky.notification.defs#chatPreference",description:"Deprecated: use chat.bsky.notification preferences instead. Setting this won't stick and the default values will be returned."},follow:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},like:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},likeViaRepost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},mention:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},quote:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},reply:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},repost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},repostViaRepost:{type:"ref",ref:"lex:app.bsky.notification.defs#filterablePreference"},starterpackJoined:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},subscribedPost:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},unverified:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"},verified:{type:"ref",ref:"lex:app.bsky.notification.defs#preference"}}}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.notification.defs#preferences"}}}}}}},AppBskyNotificationRegisterPush:{lexicon:1,id:"app.bsky.notification.registerPush",defs:{main:{type:"procedure",description:"Register to receive push notifications, via a specified service, for the requesting account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["serviceDid","token","platform","appId"],properties:{serviceDid:{type:"string",format:"did"},token:{type:"string"},platform:{type:"string",knownValues:["ios","android","web"]},appId:{type:"string"},ageRestricted:{type:"boolean",description:"Set to true when the actor is age restricted"}}}}}}},AppBskyNotificationUnregisterPush:{lexicon:1,id:"app.bsky.notification.unregisterPush",defs:{main:{type:"procedure",description:"The inverse of registerPush - inform a specified service that push notifications should no longer be sent to the given token for the requesting account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["serviceDid","token","platform","appId"],properties:{serviceDid:{type:"string",format:"did"},token:{type:"string"},platform:{type:"string",knownValues:["ios","android","web"]},appId:{type:"string"}}}}}}},AppBskyNotificationUpdateSeen:{lexicon:1,id:"app.bsky.notification.updateSeen",defs:{main:{type:"procedure",description:"Notify server that the requesting account has seen notifications. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["seenAt"],properties:{seenAt:{type:"string",format:"datetime"}}}}}}},AppBskyRichtextFacet:{lexicon:1,id:"app.bsky.richtext.facet",defs:{main:{type:"object",description:"Annotation of a sub-string within rich text.",required:["index","features"],properties:{index:{type:"ref",ref:"lex:app.bsky.richtext.facet#byteSlice"},features:{type:"array",items:{type:"union",refs:["lex:app.bsky.richtext.facet#mention","lex:app.bsky.richtext.facet#link","lex:app.bsky.richtext.facet#tag"]}}}},mention:{type:"object",description:"Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",required:["did"],properties:{did:{type:"string",format:"did"}}},link:{type:"object",description:"Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",required:["uri"],properties:{uri:{type:"string",format:"uri"}}},tag:{type:"object",description:"Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",required:["tag"],properties:{tag:{type:"string",maxLength:640,maxGraphemes:64}}},byteSlice:{type:"object",description:"Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",required:["byteStart","byteEnd"],properties:{byteStart:{type:"integer",minimum:0},byteEnd:{type:"integer",minimum:0}}}}},AppBskyUnspeccedDefs:{lexicon:1,id:"app.bsky.unspecced.defs",defs:{skeletonSearchPost:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},skeletonSearchActor:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},skeletonSearchStarterPack:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},trendingTopic:{type:"object",required:["topic","link"],properties:{topic:{type:"string"},displayName:{type:"string"},description:{type:"string"},link:{type:"string"}}},skeletonTrend:{type:"object",required:["topic","displayName","link","startedAt","postCount","dids"],properties:{topic:{type:"string"},displayName:{type:"string"},description:{type:"string"},link:{type:"string"},startedAt:{type:"string",format:"datetime"},postCount:{type:"integer"},status:{type:"string",knownValues:["hot"]},category:{type:"string"},dids:{type:"array",items:{type:"string",format:"did"}}}},trendView:{type:"object",required:["topic","displayName","link","startedAt","postCount","actors"],properties:{topic:{type:"string"},displayName:{type:"string"},description:{type:"string"},link:{type:"string"},startedAt:{type:"string",format:"datetime"},postCount:{type:"integer"},status:{type:"string",knownValues:["hot"]},category:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}},threadItemPost:{type:"object",required:["post","moreParents","moreReplies","opThread","hiddenByThreadgate","mutedByViewer"],properties:{post:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},moreParents:{type:"boolean",description:"This post has more parents that were not present in the response. This is just a boolean, without the number of parents."},moreReplies:{type:"integer",description:"This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate."},opThread:{type:"boolean",description:"This post is part of a contiguous thread by the OP from the thread root. Sub-threads by OP deeper in the tree are not considered an OP thread."},opThreadPostIndex:{type:"integer",description:"The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread (see `opThread`)."},opThreadPostCount:{type:"integer",description:"The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread (see `opThread`)."},hiddenByThreadgate:{type:"boolean",description:"The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread."},mutedByViewer:{type:"boolean",description:"This is by an account muted by the viewer requesting it."}}},threadItemNoUnauthenticated:{type:"object",properties:{}},threadItemNotFound:{type:"object",properties:{}},threadItemBlocked:{type:"object",required:["author"],properties:{author:{type:"ref",ref:"lex:app.bsky.feed.defs#blockedAuthor"}}},ageAssuranceState:{type:"object",description:"The computed state of the age assurance process, returned to the user in question on certain authenticated requests.",required:["status"],properties:{lastInitiatedAt:{type:"string",format:"datetime",description:"The timestamp when this state was last updated."},status:{type:"string",description:"The status of the age assurance process.",knownValues:["unknown","pending","assured","blocked"]}}},ageAssuranceEvent:{type:"object",description:"Object used to store age assurance data in stash.",required:["createdAt","status","attemptId"],properties:{createdAt:{type:"string",format:"datetime",description:"The date and time of this write operation."},status:{type:"string",description:"The status of the age assurance process.",knownValues:["unknown","pending","assured"]},attemptId:{type:"string",description:"The unique identifier for this instance of the age assurance flow, in UUID format."},email:{type:"string",description:"The email used for AA."},initIp:{type:"string",description:"The IP address used when initiating the AA flow."},initUa:{type:"string",description:"The user agent used when initiating the AA flow."},completeIp:{type:"string",description:"The IP address used when completing the AA flow."},completeUa:{type:"string",description:"The user agent used when completing the AA flow."}}}}},AppBskyUnspeccedGetAgeAssuranceState:{lexicon:1,id:"app.bsky.unspecced.getAgeAssuranceState",defs:{main:{type:"query",description:"Returns the current state of the age assurance process for an account. This is used to check if the user has completed age assurance or if further action is required.",output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.unspecced.defs#ageAssuranceState"}}}}},AppBskyUnspeccedGetConfig:{lexicon:1,id:"app.bsky.unspecced.getConfig",defs:{main:{type:"query",description:"Get miscellaneous runtime configuration.",output:{encoding:"application/json",schema:{type:"object",required:[],properties:{checkEmailConfirmed:{type:"boolean"},liveNow:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.getConfig#liveNowConfig"}}}}}},liveNowConfig:{type:"object",required:["did","domains"],properties:{did:{type:"string",format:"did"},domains:{type:"array",items:{type:"string"}}}}}},AppBskyUnspeccedGetOnboardingSuggestedStarterPacks:{lexicon:1,id:"app.bsky.unspecced.getOnboardingSuggestedStarterPacks",defs:{main:{type:"query",description:"Get a list of suggested starterpacks for onboarding",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"}}}}}}}},AppBskyUnspeccedGetOnboardingSuggestedStarterPacksSkeleton:{lexicon:1,id:"app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"string",format:"at-uri"}}}}}}}},AppBskyUnspeccedGetOnboardingSuggestedUsersSkeleton:{lexicon:1,id:"app.bsky.unspecced.getOnboardingSuggestedUsersSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested users for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedOnboardingUsers",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},recId:{type:"string",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetPopularFeedGenerators:{lexicon:1,id:"app.bsky.unspecced.getPopularFeedGenerators",defs:{main:{type:"query",description:"An unspecced view of globally popular feed generators.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},query:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyUnspeccedGetPostThreadOtherV2:{lexicon:1,id:"app.bsky.unspecced.getPostThreadOtherV2",defs:{main:{type:"query",description:"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",parameters:{type:"params",required:["anchor"],properties:{anchor:{type:"string",format:"at-uri",description:"Reference (AT-URI) to post record. This is the anchor post."}}},output:{encoding:"application/json",schema:{type:"object",required:["thread"],properties:{thread:{type:"array",description:"A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.",items:{type:"ref",ref:"lex:app.bsky.unspecced.getPostThreadOtherV2#threadItem"}}}}}},threadItem:{type:"object",required:["uri","depth","value"],properties:{uri:{type:"string",format:"at-uri"},depth:{type:"integer",description:"The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths."},value:{type:"union",refs:["lex:app.bsky.unspecced.defs#threadItemPost"]}}}}},AppBskyUnspeccedGetPostThreadV2:{lexicon:1,id:"app.bsky.unspecced.getPostThreadV2",defs:{main:{type:"query",description:"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests.",parameters:{type:"params",required:["anchor"],properties:{anchor:{type:"string",format:"at-uri",description:"Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post."},above:{type:"boolean",description:"Whether to include parents above the anchor.",default:!0},below:{type:"integer",description:"How many levels of replies to include below the anchor.",default:6,minimum:0,maximum:20},branchingFactor:{type:"integer",description:"Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated).",default:10,minimum:0,maximum:100},sort:{type:"string",description:"Sorting for the thread replies.",knownValues:["newest","oldest","top"],default:"oldest"}}},output:{encoding:"application/json",schema:{type:"object",required:["thread","hasOtherReplies"],properties:{thread:{type:"array",description:"A flat list of thread items. The depth of each item is indicated by the depth property inside the item.",items:{type:"ref",ref:"lex:app.bsky.unspecced.getPostThreadV2#threadItem"}},threadgate:{type:"ref",ref:"lex:app.bsky.feed.defs#threadgateView"},hasOtherReplies:{type:"boolean",description:"Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them."}}}}},threadItem:{type:"object",required:["uri","depth","value"],properties:{uri:{type:"string",format:"at-uri"},depth:{type:"integer",description:"The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths."},value:{type:"union",refs:["lex:app.bsky.unspecced.defs#threadItemPost","lex:app.bsky.unspecced.defs#threadItemNoUnauthenticated","lex:app.bsky.unspecced.defs#threadItemNotFound","lex:app.bsky.unspecced.defs#threadItemBlocked"]}}}}},AppBskyUnspeccedGetSuggestedFeeds:{lexicon:1,id:"app.bsky.unspecced.getSuggestedFeeds",defs:{main:{type:"query",description:"Get a list of suggested feeds",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyUnspeccedGetSuggestedFeedsSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedFeedsSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested feeds. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedFeeds",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{feeds:{type:"array",items:{type:"string",format:"at-uri"}}}}}}}},AppBskyUnspeccedGetSuggestedOnboardingUsers:{lexicon:1,id:"app.bsky.unspecced.getSuggestedOnboardingUsers",defs:{main:{type:"query",description:"Get a list of suggested users for onboarding",parameters:{type:"params",properties:{category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recId:{type:"string",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedStarterPacks:{lexicon:1,id:"app.bsky.unspecced.getSuggestedStarterPacks",defs:{main:{type:"query",description:"Get a list of suggested starterpacks",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"}}}}}}}},AppBskyUnspeccedGetSuggestedStarterPacksSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedStarterPacksSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested starterpacks. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedStarterpacks",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"string",format:"at-uri"}}}}}}}},AppBskyUnspeccedGetSuggestedUsers:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsers",defs:{main:{type:"query",description:"Get a list of suggested users",parameters:{type:"params",properties:{category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recId:{type:"string",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForDiscover:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForDiscover",defs:{main:{type:"query",description:"Get a list of suggested users for the Discover page",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForDiscoverSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForDiscoverSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested users for the Discover page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForDiscover",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForExplore:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForExplore",defs:{main:{type:"query",description:"Get a list of suggested users for the Explore page",parameters:{type:"params",properties:{category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForExploreSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForExploreSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested users for the Explore page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForExplore",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForSeeMore:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForSeeMore",defs:{main:{type:"query",description:"Get a list of suggested users for the See More page",parameters:{type:"params",properties:{category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersForSeeMoreSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersForSeeMoreSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested users for the See More page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForSeeMore",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestedUsersSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestedUsersSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested users. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsers",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},category:{type:"string",description:"Category of users to get suggestions for."},limit:{type:"integer",minimum:1,maximum:50,default:25}}},output:{encoding:"application/json",schema:{type:"object",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},recId:{type:"string",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetSuggestionsSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestionsSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},relativeToDid:{type:"string",format:"did",description:"DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer."}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchActor"}},relativeToDid:{type:"string",format:"did",description:"DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer."},recId:{type:"integer",description:"DEPRECATED: use recIdStr instead."},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetTaggedSuggestions:{lexicon:1,id:"app.bsky.unspecced.getTaggedSuggestions",defs:{main:{type:"query",description:"Get a list of suggestions (feeds and users) tagged with categories",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["suggestions"],properties:{suggestions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.getTaggedSuggestions#suggestion"}}}}}},suggestion:{type:"object",required:["tag","subjectType","subject"],properties:{tag:{type:"string"},subjectType:{type:"string",knownValues:["actor","feed"]},subject:{type:"string",format:"uri"}}}}},AppBskyUnspeccedGetTrendingTopics:{lexicon:1,id:"app.bsky.unspecced.getTrendingTopics",defs:{main:{type:"query",description:"Get a list of trending topics",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."},limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["topics","suggested"],properties:{topics:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#trendingTopic"}},suggested:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#trendingTopic"}}}}}}}},AppBskyUnspeccedGetTrends:{lexicon:1,id:"app.bsky.unspecced.getTrends",defs:{main:{type:"query",description:"Get the current trends on the network",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["trends"],properties:{trends:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#trendView"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedGetTrendsSkeleton:{lexicon:1,id:"app.bsky.unspecced.getTrendsSkeleton",defs:{main:{type:"query",description:"Get the skeleton of trends on the network. Intended to be called and then hydrated through app.bsky.unspecced.getTrends",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:25,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["trends"],properties:{trends:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonTrend"}},recIdStr:{type:"string",description:"Snowflake for this recommendation, use when submitting recommendation events."}}}}}}},AppBskyUnspeccedInitAgeAssurance:{lexicon:1,id:"app.bsky.unspecced.initAgeAssurance",defs:{main:{type:"procedure",description:"Initiate age assurance for an account. This is a one-time action that will start the process of verifying the user's age.",input:{encoding:"application/json",schema:{type:"object",required:["email","language","countryCode"],properties:{email:{type:"string",description:"The user's email address to receive assurance instructions."},language:{type:"string",description:"The user's preferred language for communication during the assurance process."},countryCode:{type:"string",description:"An ISO 3166-1 alpha-2 code of the user's location."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.unspecced.defs#ageAssuranceState"}},errors:[{name:"InvalidEmail"},{name:"DidTooLong"},{name:"InvalidInitiation"}]}}},AppBskyUnspeccedSearchActorsSkeleton:{lexicon:1,id:"app.bsky.unspecced.searchActorsSkeleton",defs:{main:{type:"query",description:"Backend Actors (profile) search, returns only skeleton.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax."},viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."},typeahead:{type:"boolean",description:"If true, acts as fast/simple 'typeahead' query."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchActor"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyUnspeccedSearchPostsSkeleton:{lexicon:1,id:"app.bsky.unspecced.searchPostsSkeleton",defs:{main:{type:"query",description:"Backend Posts search, returns only skeleton",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},sort:{type:"string",knownValues:["top","latest"],default:"latest",description:"Specifies the ranking order of results."},since:{type:"string",description:"Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},until:{type:"string",description:"Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)."},mentions:{type:"string",format:"at-identifier",description:"Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions."},author:{type:"string",format:"at-identifier",description:"Filter to posts by the given account. Handles are resolved to DID before query-time."},lang:{type:"string",format:"language",description:"Filter to posts in the given language. Expected to be based on post language field, though server may override language detection."},domain:{type:"string",description:"Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization."},url:{type:"string",format:"uri",description:"Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching."},tag:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching."},viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchPost"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyUnspeccedSearchStarterPacksSkeleton:{lexicon:1,id:"app.bsky.unspecced.searchStarterPacksSkeleton",defs:{main:{type:"query",description:"Backend Starter Pack search, returns only skeleton.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries)."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchStarterPack"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyVideoAbortUpload:{lexicon:1,id:"app.bsky.video.abortUpload",defs:{main:{type:"procedure",description:"Abort an upload only while it is created, releasing its quota reservation immediately. Terminal sessions are unchanged and return their terminal outcome. A finishing session returns UploadNotReady.",input:{encoding:"application/json",schema:{type:"object",required:["jobId"],properties:{jobId:{type:"string",minLength:1,maxLength:256}}}},output:{encoding:"application/json",schema:{type:"object",required:["state"],properties:{state:{type:"string",maxLength:32,knownValues:["aborted","completed","failed","expired"]},completedJobId:{type:"string",minLength:1,maxLength:256,description:"Present only when state is completed."},failureReason:{type:"string",maxLength:1024,description:"Present only when state is failed."}}}},errors:[{name:"UploadNotFound",description:"The job ID is unknown or aged out of retention; known terminal sessions return their outcome and are never reported as not found."},{name:"UploadNotReady",description:"A finish is in progress; check getUploadStatus and retry."}]}}},AppBskyVideoDefs:{lexicon:1,id:"app.bsky.video.defs",defs:{jobStatus:{type:"object",required:["jobId","did","state"],properties:{jobId:{type:"string"},did:{type:"string",format:"did"},state:{type:"string",description:"The state of the video processing job. All values not listed as a known value indicate that the job is in process.",knownValues:["JOB_STATE_CREATED","JOB_STATE_ENCODING","JOB_STATE_ENCODED","JOB_STATE_SCANNING","JOB_STATE_SCANNED","JOB_STATE_UPLOADING","JOB_STATE_UPLOADED","JOB_STATE_COMPLETED","JOB_STATE_FAILED"]},progress:{type:"integer",minimum:0,maximum:100,description:"Progress within the current processing state."},blob:{type:"blob"},error:{type:"string"},failureCode:{type:"string",description:"A machine-readable code for why the video processing job failed.",knownValues:["validation_failure","encoding_failure","pds_upload_failure","pds_upload_unsupported_blob_size","generic_failure"]},message:{type:"string"}}}}},AppBskyVideoFinishUpload:{lexicon:1,id:"app.bsky.video.finishUpload",defs:{main:{type:"procedure",description:"Finish an upload. This call is idempotent and safe to retry. On deduplication completedJobId may differ from the input jobId; poll getJobStatus with completedJobId. Probe-based validation failures surface later as JOB_STATE_FAILED from getJobStatus, not as errors from this call.",input:{encoding:"application/json",schema:{type:"object",required:["jobId"],properties:{jobId:{type:"string",minLength:1,maxLength:256}}}},output:{encoding:"application/json",schema:{type:"object",required:["completedJobId","jobStatus"],properties:{completedJobId:{type:"string",minLength:1,maxLength:256,description:"The processing job to poll with getJobStatus; on deduplication this may differ from the input jobId."},jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus"}}}},errors:[{name:"UploadNotFound",description:"The job ID is unknown or aged out of retention; known terminal sessions are never reported as not found."},{name:"UploadExpired",description:"The upload session expired before finalization began."},{name:"MissingParts",description:"Not all parts are recorded; the error message lists the missing part numbers."},{name:"UploadNotReady",description:"A finish is in progress; check getUploadStatus and retry."},{name:"UnsupportedContentType",description:"The assembled object's detected content type is not supported."},{name:"UploadFailed",description:"The session is known to have failed; the error carries its failure reason."},{name:"UploadAborted",description:"The session is known to have been aborted."},{name:"ServiceOverloaded",description:"The service is draining or temporarily at capacity; retry later."}]}}},AppBskyVideoGetJobStatus:{lexicon:1,id:"app.bsky.video.getJobStatus",defs:{main:{type:"query",description:"Get status details for a video processing job.",parameters:{type:"params",required:["jobId"],properties:{jobId:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["jobStatus"],properties:{jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus"}}}}}}},AppBskyVideoGetUploadLimits:{lexicon:1,id:"app.bsky.video.getUploadLimits",defs:{main:{type:"query",description:"Get video upload limits for the authenticated user.",output:{encoding:"application/json",schema:{type:"object",required:["canUpload"],properties:{canUpload:{type:"boolean"},remainingDailyVideos:{type:"integer"},remainingDailyBytes:{type:"integer"},message:{type:"string"},error:{type:"string"}}}}}}},AppBskyVideoGetUploadStatus:{lexicon:1,id:"app.bsky.video.getUploadStatus",defs:{main:{type:"query",description:"Get the authoritative status of the upload phase. Terminal states remain readable. completedJobId and jobStatus are present only for completed sessions; failureReason is present only for failed sessions.",parameters:{type:"params",required:["jobId"],properties:{jobId:{type:"string",minLength:1,maxLength:256}}},output:{encoding:"application/json",schema:{type:"object",required:["jobId","partSizeBytes","partCount","receivedParts","expiresAt","state"],properties:{jobId:{type:"string",minLength:1,maxLength:256},partSizeBytes:{type:"integer"},partCount:{type:"integer"},receivedParts:{type:"array",items:{type:"integer",minimum:1}},expiresAt:{type:"string",format:"datetime"},state:{type:"string",maxLength:32,knownValues:["created","finishing","completed","failed","aborted","expired"]},completedJobId:{type:"string",minLength:1,maxLength:256,description:"Present only when state is completed; may differ from jobId on deduplication."},jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus",description:"Present only when state is completed."},failureReason:{type:"string",maxLength:1024,description:"Present only when state is failed."}}}},errors:[{name:"UploadNotFound",description:"The job ID is unknown or aged out of retention; known terminal sessions remain readable and are never reported as not found."}]}}},AppBskyVideoStartUpload:{lexicon:1,id:"app.bsky.video.startUpload",defs:{main:{type:"procedure",description:"Start a multipart video upload. The declared size is exact, while optional media properties are advisory and used only for early failure; the authoritative probe runs asynchronously after upload.",input:{encoding:"application/json",schema:{type:"object",required:["sizeBytes","mimeType"],properties:{sizeBytes:{type:"integer",minimum:1,description:"Exact byte size of the complete upload-ready video file before it is split into parts."},mimeType:{type:"string",minLength:3,maxLength:255,description:"Declared MIME type of the video."},name:{type:"string",maxLength:256,description:"Optional client-provided file name."},durationMs:{type:"integer",description:"Advisory, non-authoritative duration used only for early failure; the authoritative probe runs asynchronously after upload."},width:{type:"integer",description:"Advisory, non-authoritative width used only for early failure; the authoritative probe runs asynchronously after upload."},height:{type:"integer",description:"Advisory, non-authoritative height used only for early failure; the authoritative probe runs asynchronously after upload."}}}},output:{encoding:"application/json",schema:{type:"object",required:["jobId","partSizeBytes","partCount","expiresAt"],properties:{jobId:{type:"string",minLength:1,maxLength:256},partSizeBytes:{type:"integer"},partCount:{type:"integer"},expiresAt:{type:"string",format:"datetime"}}}},errors:[{name:"UnsupportedContentType",description:"The declared MIME type is not supported."},{name:"VideoTooLarge",description:"The exact file size exceeds the per-file cap or remaining daily byte allowance."},{name:"VideoTooLong",description:"The advisory declared duration exceeds the limit."},{name:"BadAspectRatio",description:"The advisory declared dimensions have an unsupported aspect ratio."},{name:"DailyLimitExceeded",description:"The daily video or byte allowance, including active reservations, is exhausted."},{name:"TooManyOpenUploads",description:"The account has reached its open multipart upload limit."},{name:"UploadForbidden",description:"The account is not permitted to upload video."},{name:"ServiceOverloaded",description:"The service is draining, at capacity, or temporarily unable to create the multipart upload."}]}}},AppBskyVideoUploadPart:{lexicon:1,id:"app.bsky.video.uploadPart",defs:{main:{type:"procedure",description:"Upload one part. Parts are idempotent and may be retried or re-sent while the session is created. Each expected length is derived from the upload size and part size, and Content-Length must match exactly. ETags are never exposed to clients.",parameters:{type:"params",required:["jobId","partNumber"],properties:{jobId:{type:"string",minLength:1,maxLength:256},partNumber:{type:"integer",minimum:1}}},input:{encoding:"application/octet-stream"},output:{encoding:"application/json",schema:{type:"object",required:["partNumber","sizeBytes"],properties:{partNumber:{type:"integer",minimum:1},sizeBytes:{type:"integer"}}}},errors:[{name:"UploadNotFound",description:"The job ID is unknown or aged out of retention; known terminal sessions are never reported as not found."},{name:"UploadExpired",description:"The upload session expired before completion."},{name:"InvalidPartNumber",description:"The part number is outside the upload's valid part range."},{name:"PartSizeMismatch",description:"Content-Length does not exactly match the expected size for this part."},{name:"UploadNotReady",description:"A finish is in progress; check getUploadStatus and retry."},{name:"UploadFailed",description:"The session is known to have failed; the error carries its failure reason."},{name:"UploadAborted",description:"The session is known to have been aborted."},{name:"UploadAlreadyCompleted",description:"The session is known to have already completed."},{name:"ServiceOverloaded",description:"The service is draining or temporarily at capacity; retry on another worker."}]}}},AppBskyVideoUploadVideo:{lexicon:1,id:"app.bsky.video.uploadVideo",defs:{main:{type:"procedure",description:"Upload a video to be processed then stored on the PDS.",input:{encoding:"video/mp4"},output:{encoding:"application/json",schema:{type:"object",required:["jobStatus"],properties:{jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus"}}}}}}},ChatBskyActorDeclaration:{lexicon:1,id:"chat.bsky.actor.declaration",defs:{main:{type:"record",description:"A declaration of a Bluesky chat account.",key:"literal:self",record:{type:"object",required:["allowIncoming"],properties:{allowIncoming:{type:"string",knownValues:["all","none","following"]},allowGroupInvites:{description:"Declaration about group chat invitation preferences for the record owner.",type:"string",knownValues:["all","none","following"]}}}}}},ChatBskyActorDefs:{lexicon:1,id:"chat.bsky.actor.defs",defs:{memberRole:{type:"string",knownValues:["owner","standard"]},profileViewBasic:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},createdAt:{type:"string",format:"datetime"},chatDisabled:{type:"boolean",description:"Set to true when the actor cannot actively participate in conversations"},verification:{type:"ref",ref:"lex:app.bsky.actor.defs#verificationState"},kind:{description:"Union field that has data specific to different kinds of convos.",type:"union",refs:["lex:chat.bsky.actor.defs#directConvoMember","lex:chat.bsky.actor.defs#groupConvoMember","lex:chat.bsky.actor.defs#pastGroupConvoMember"]}}},directConvoMember:{type:"object",properties:{}},groupConvoMember:{description:"A current group convo member.",type:"object",required:["role"],properties:{addedBy:{description:"Who added this member. Only present if the member was added (instead of joining via link).",type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"},role:{description:"The member's role within this conversation. Only present in group conversation member lists.",type:"ref",ref:"lex:chat.bsky.actor.defs#memberRole"}}},pastGroupConvoMember:{description:"A past group convo member.",type:"object",required:[],properties:{}}}},ChatBskyActorDeleteAccount:{lexicon:1,id:"chat.bsky.actor.deleteAccount",defs:{main:{type:"procedure",output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},ChatBskyActorExportAccountData:{lexicon:1,id:"chat.bsky.actor.exportAccountData",defs:{main:{type:"query",output:{encoding:"application/jsonl"}}}},ChatBskyActorGetStatus:{lexicon:1,id:"chat.bsky.actor.getStatus",defs:{main:{type:"query",description:"Get the authenticated viewer's chat status: whether their account is chat-disabled and whether their group-membership additions are restricted to accounts they follow.",output:{encoding:"application/json",schema:{type:"object",required:["chatDisabled","canCreateGroups","groupMemberLimit"],properties:{chatDisabled:{type:"boolean",description:"True when the viewer's account is disabled and cannot actively participate in chat."},canCreateGroups:{type:"boolean",description:"Whether the viewer's account is allowed to create group chats. New accounts are restricted from creating groups."},groupMemberLimit:{type:"integer",description:"The maximum number of members allowed in a group conversation."}}}}}}},ChatBskyConvoAcceptConvo:{lexicon:1,id:"chat.bsky.convo.acceptConvo",defs:{main:{type:"procedure",description:"Marks a conversation as accepted, so it is shown in the list of accepted convos instead on the request convos.",errors:[{name:"InvalidConvo"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{rev:{description:"Rev when the convo was accepted. If not present, the convo was already accepted.",type:"string"}}}}}}},ChatBskyConvoAddReaction:{lexicon:1,id:"chat.bsky.convo.addReaction",defs:{main:{type:"procedure",description:"Adds an emoji reaction to a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in a single reaction.",input:{encoding:"application/json",schema:{type:"object",required:["convoId","messageId","value"],properties:{convoId:{type:"string"},messageId:{type:"string"},value:{type:"string",minLength:1,maxLength:64,minGraphemes:1,maxGraphemes:1}}}},output:{encoding:"application/json",schema:{type:"object",required:["message"],properties:{message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}},errors:[{name:"InvalidConvo"},{name:"ReactionNotAllowed",description:"Indicates that reactions are not allowed on this message, e.g. because it is a system message."},{name:"ReactionMessageDeleted",description:"Indicates that the message has been deleted and reactions can no longer be added/removed."},{name:"ReactionLimitReached",description:"Indicates that the message has the maximum number of reactions allowed for a single user, and the requested reaction wasn't yet present. If it was already present, the request will not fail since it is idempotent."},{name:"ReactionInvalidValue",description:"Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji."}]}}},ChatBskyConvoDefs:{lexicon:1,id:"chat.bsky.convo.defs",defs:{convoKind:{type:"string",knownValues:["direct","group"]},convoLockStatus:{type:"string",knownValues:["unlocked","locked","locked-permanently"]},convoStatus:{type:"string",knownValues:["request","accepted"]},convoRef:{type:"object",required:["did","convoId"],properties:{did:{type:"string",format:"did"},convoId:{type:"string"}}},messageRef:{type:"object",required:["did","messageId","convoId"],properties:{did:{type:"string",format:"did"},convoId:{type:"string"},messageId:{type:"string"}}},messageInput:{type:"object",required:["text"],properties:{text:{type:"string",maxLength:1e4,maxGraphemes:1e3},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},embed:{type:"union",refs:["lex:app.bsky.embed.record","lex:chat.bsky.embed.joinLink"]},replyTo:{description:"If set, the message this message is replying to. The referenced message must be in the same convo.",type:"ref",ref:"lex:chat.bsky.convo.defs#replyRef"}}},replyRef:{description:"A reference to another message within the same convo, used to indicate that a message is a reply to it.",type:"object",required:["messageId"],properties:{messageId:{type:"string"}}},messageView:{type:"object",required:["id","rev","text","sender","sentAt"],properties:{id:{type:"string"},rev:{type:"string"},text:{type:"string",maxLength:1e4,maxGraphemes:1e3},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},embed:{type:"union",refs:["lex:app.bsky.embed.record#view","lex:chat.bsky.embed.joinLink#view"]},reactions:{type:"array",description:"Reactions to this message, in ascending order of creation time.",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#reactionView"}},replyTo:{description:"If set, the message this message is replying to. The full view of the referenced message is embedded so the client can render it inline. Only a single level is embedded: the embedded message will not itself have a populated 'replyTo' field even if it was also a reply.",type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView","lex:chat.bsky.convo.defs#messageBeforeUserJoinedGroupView"]},sender:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageViewSender"},sentAt:{type:"string",format:"datetime"}}},systemMessageReferredUser:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},systemMessageView:{type:"object",required:["id","rev","sentAt","data"],properties:{id:{type:"string"},rev:{type:"string"},sentAt:{type:"string",format:"datetime"},data:{type:"union",refs:["lex:chat.bsky.convo.defs#systemMessageDataAddMember","lex:chat.bsky.convo.defs#systemMessageDataRemoveMember","lex:chat.bsky.convo.defs#systemMessageDataMemberJoin","lex:chat.bsky.convo.defs#systemMessageDataMemberLeave","lex:chat.bsky.convo.defs#systemMessageDataLockConvo","lex:chat.bsky.convo.defs#systemMessageDataUnlockConvo","lex:chat.bsky.convo.defs#systemMessageDataLockConvoPermanently","lex:chat.bsky.convo.defs#systemMessageDataEditGroup","lex:chat.bsky.convo.defs#systemMessageDataCreateJoinLink","lex:chat.bsky.convo.defs#systemMessageDataEditJoinLink","lex:chat.bsky.convo.defs#systemMessageDataEnableJoinLink","lex:chat.bsky.convo.defs#systemMessageDataDisableJoinLink"]}}},systemMessageDataAddMember:{description:"System message indicating a user was added to the group convo.",type:"object",required:["member","role","addedBy"],properties:{member:{description:"Current view of the member who was added.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"},role:{description:"Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.",type:"ref",ref:"lex:chat.bsky.actor.defs#memberRole"},addedBy:{type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataRemoveMember:{description:"System message indicating a user was removed from the group convo.",type:"object",required:["member","removedBy"],properties:{member:{description:"Current view of the member who was removed.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"},removedBy:{type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataMemberJoin:{description:"System message indicating a user joined the group convo via join link.",type:"object",required:["member","role"],properties:{member:{description:"Current view of the member who joined.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"},role:{description:"Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.",type:"ref",ref:"lex:chat.bsky.actor.defs#memberRole"},approvedBy:{description:"If join link was configured to require approval, this will be set to who approved the request. Undefined if approval was not required.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataMemberLeave:{description:"System message indicating a user voluntarily left the group convo.",type:"object",required:["member"],properties:{member:{description:"Current view of the member who left the group.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataLockConvo:{description:"System message indicating the group convo was locked.",type:"object",required:["lockedBy"],properties:{lockedBy:{description:"Current view of the member who locked the group.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataUnlockConvo:{description:"System message indicating the group convo was unlocked.",type:"object",required:["unlockedBy"],properties:{unlockedBy:{description:"Current view of the member who unlocked the group.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataLockConvoPermanently:{description:"System message indicating the group convo was locked permanently.",type:"object",required:["lockedBy"],properties:{lockedBy:{description:"Current view of the member who locked the group.",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageReferredUser"}}},systemMessageDataEditGroup:{description:"System message indicating the group info was edited.",type:"object",properties:{oldName:{description:"Group name that was replaced.",type:"string"},newName:{description:"Group name that replaced the old.",type:"string"}}},systemMessageDataCreateJoinLink:{description:"System message indicating the group join link was created.",type:"object",properties:{}},systemMessageDataEditJoinLink:{description:"System message indicating the group join link was edited.",type:"object",properties:{}},systemMessageDataEnableJoinLink:{description:"System message indicating the group join link was enabled.",type:"object",properties:{}},systemMessageDataDisableJoinLink:{description:"System message indicating the group join link was disabled.",type:"object",properties:{}},deletedMessageView:{type:"object",required:["id","rev","sender","sentAt"],properties:{id:{type:"string"},rev:{type:"string"},sender:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageViewSender"},sentAt:{type:"string",format:"datetime"}}},messageBeforeUserJoinedGroupView:{description:"Placeholder embedded in place of a reply's parent message when that parent was sent before the viewer joined the group convo. The viewer has no access to that history, so no message data is carried.",type:"object",properties:{}},messageViewSender:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},reactionView:{type:"object",required:["value","sender","createdAt"],properties:{value:{type:"string"},sender:{type:"ref",ref:"lex:chat.bsky.convo.defs#reactionViewSender"},createdAt:{type:"string",format:"datetime"}}},reactionViewSender:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},messageAndReactionView:{type:"object",required:["message","reaction"],properties:{message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"},reaction:{type:"ref",ref:"lex:chat.bsky.convo.defs#reactionView"}}},convoView:{type:"object",required:["id","rev","members","muted","unreadCount"],properties:{id:{type:"string"},rev:{type:"string"},members:{description:"Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who added the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. Use chat.bsky.convo.getConvoMembers to list all members.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}},lastMessage:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView","lex:chat.bsky.convo.defs#systemMessageView"]},lastReaction:{type:"union",refs:["lex:chat.bsky.convo.defs#messageAndReactionView"]},muted:{type:"boolean"},status:{description:"Convo status for the viewer member (not the convo itself).",type:"ref",ref:"lex:chat.bsky.convo.defs#convoStatus"},unreadCount:{type:"integer"},kind:{description:"Union field that has data specific to different kinds of convos.",type:"union",refs:["lex:chat.bsky.convo.defs#directConvo","lex:chat.bsky.convo.defs#groupConvo"]}}},directConvo:{type:"object",properties:{}},groupConvo:{type:"object",required:["createdAt","lockStatus","lockStatusModerationOverride","memberCount","memberLimit","name"],properties:{createdAt:{type:"string",format:"datetime"},joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"},joinRequestCount:{type:"integer",description:"The total number of pending join requests for the group conversation. Only present for the owner. Capped at 21."},lockStatus:{description:"The lock status of the conversation.",type:"ref",ref:"lex:chat.bsky.convo.defs#convoLockStatus"},lockStatusModerationOverride:{description:"Whether the lock status is being forced by a moderation override (account inactivation or convo takedown) rather than the owner's own setting.",type:"boolean"},memberCount:{type:"integer",description:"The total number of members in the group conversation."},memberLimit:{type:"integer",description:"The maximum number of members allowed in the group conversation."},name:{type:"string",description:"The display name of the group conversation.",maxGraphemes:50,maxLength:500},unreadJoinRequestCount:{type:"integer",description:"The number of unread join requests for the group conversation. Only present for the owner."}}},logBeginConvo:{description:"Event indicating a convo containing the viewer was started. Can be direct or group. When a member is added to a group convo, they also get this event.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logAcceptConvo:{description:"Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logLeaveConvo:{description:"Event indicating the viewer left a convo. Can be direct or group.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logMuteConvo:{description:"Event indicating the viewer muted a convo. Can be direct or group.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logUnmuteConvo:{description:"Event indicating the viewer unmuted a convo. Can be direct or group.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logCreateMessage:{description:"Event indicating a user-originated message was created. Is not emitted for system messages.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]},relatedProfiles:{description:"Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logDeleteMessage:{description:"Event indicating a user-originated message was deleted. Is not emitted for system messages.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]}}},logReadMessage:{description:"DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView","lex:chat.bsky.convo.defs#systemMessageView"]}}},logAddReaction:{description:"Event indicating a reaction was added to a message.",type:"object",required:["rev","convoId","message","reaction"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]},reaction:{type:"ref",ref:"lex:chat.bsky.convo.defs#reactionView"},relatedProfiles:{description:"Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logRemoveReaction:{description:"Event indicating a reaction was removed from a message.",type:"object",required:["rev","convoId","message","reaction"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]},reaction:{type:"ref",ref:"lex:chat.bsky.convo.defs#reactionView"},relatedProfiles:{description:"Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logReadConvo:{description:"Event indicating a convo was read up to a certain message.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView","lex:chat.bsky.convo.defs#systemMessageView"]}}},logAddMember:{description:"Event indicating a member was added to a group convo. The member who was added gets a logBeginConvo (to create the convo) but also a logAddMember (to show the system message as the first message the user sees).",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataAddMember",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logRemoveMember:{description:"Event indicating a member was removed from a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logRemoveMember (because they already left, so can't see the system message).",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataRemoveMember",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logMemberJoin:{description:"Event indicating a member joined a group convo via join link. The member who was added gets a logBeginConvo (to create the convo) but also a logMemberJoin (to show the system message as the first message the user sees).",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataMemberJoin",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logMemberLeave:{description:"Event indicating a member voluntarily left a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logMemberLeave (because they already left, so can't see the system message).",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataMemberLeave",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logLockConvo:{description:"Event indicating a group convo was locked.",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataLockConvo",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logUnlockConvo:{description:"Event indicating a group convo was unlocked.",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataUnlockConvo",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logLockConvoPermanently:{description:"Event indicating a group convo was locked permanently.",type:"object",required:["rev","convoId","message","relatedProfiles"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataLockConvoPermanently",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"},relatedProfiles:{description:"Profiles referred in the system message.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}},logEditGroup:{description:"Event indicating info about group convo was edited.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataEditGroup",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"}}},logCreateJoinLink:{description:"Event indicating a join link was created for a group convo.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataCreateJoinLink",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"}}},logEditJoinLink:{description:"Event indicating a settings about a join link for a group convo were edited.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataEditJoinLink",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"}}},logEnableJoinLink:{description:"Event indicating a join link was enabled for a group convo.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataEnableJoinLink",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"}}},logDisableJoinLink:{description:"Event indicating a join link was disabled for a group convo.",type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{description:"A system message with data of type #systemMessageDataDisableJoinLink",type:"ref",ref:"lex:chat.bsky.convo.defs#systemMessageView"}}},logIncomingJoinRequest:{description:"Event indicating a join request was made to a group the viewer owns. Only the owner gets this.",type:"object",required:["rev","convoId","member"],properties:{rev:{type:"string"},convoId:{type:"string"},member:{description:"Prospective member who requested to join.",type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}},logApproveJoinRequest:{description:"Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo.",type:"object",required:["rev","convoId","member"],properties:{rev:{type:"string"},convoId:{type:"string"},member:{description:"Prospective member who requested to join.",type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}},logRejectJoinRequest:{description:"Event indicating a join request was rejected by the viewer. Only the owner gets this.",type:"object",required:["rev","convoId","member"],properties:{rev:{type:"string"},convoId:{type:"string"},member:{description:"Prospective member who requested to join.",type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}},logOutgoingJoinRequest:{description:"Event indicating a join request was made by the requester. Only requester actor gets this.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logWithdrawIncomingJoinRequest:{description:"Event indicating a prospective member withdrew their join request. Only the owner gets this.",type:"object",required:["rev","convoId","member"],properties:{rev:{type:"string"},convoId:{type:"string"},member:{description:"Prospective member who withdrew their join request.",type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}},logWithdrawOutgoingJoinRequest:{description:"Event indicating the viewer withdrew their own join request. Only requester actor gets this.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logReadJoinRequests:{description:"Event indicating the group owner marked join requests as read. Only the owner gets this.",type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}}}},ChatBskyConvoDeleteMessageForSelf:{lexicon:1,id:"chat.bsky.convo.deleteMessageForSelf",defs:{main:{type:"procedure",description:"Marks a message as deleted for the viewer, so they won't see that message in future enumerations.",errors:[{name:"InvalidConvo"},{name:"MessageDeleteNotAllowed",description:"Indicates that this message cannot be deleted, e.g. because it is a system message."}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","messageId"],properties:{convoId:{type:"string"},messageId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:chat.bsky.convo.defs#deletedMessageView"}}}}},ChatBskyConvoGetConvo:{lexicon:1,id:"chat.bsky.convo.getConvo",defs:{main:{type:"query",description:"Gets an existing conversation by its ID.",errors:[{name:"InvalidConvo"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoGetConvoAvailability:{lexicon:1,id:"chat.bsky.convo.getConvoAvailability",defs:{main:{type:"query",description:"Check whether the requester and the other members can start a 1-1 chat. Only applicable to direct (non-group) conversations. If an existing convo is found for these members, it is returned. Does not create a new convo if it doesn't exist.",parameters:{type:"params",required:["members"],properties:{members:{type:"array",minLength:1,maxLength:10,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["canChat"],properties:{canChat:{type:"boolean"},convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoGetConvoForMembers:{lexicon:1,id:"chat.bsky.convo.getConvoForMembers",defs:{main:{type:"query",description:"Get or create a 1-1 conversation for the given members. Always returns the same direct (non-group) conversation. To create a group conversation, use createGroup.",errors:[{name:"AccountSuspended"},{name:"BlockedActor"},{name:"BlockedSubject"},{name:"MessagesDisabled"},{name:"NotFollowedBySender"},{name:"RecipientNotFound"}],parameters:{type:"params",required:["members"],properties:{members:{type:"array",minLength:1,maxLength:10,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoGetConvoMembers:{lexicon:1,id:"chat.bsky.convo.getConvoMembers",defs:{main:{type:"query",description:"Returns a paginated list of members from a conversation.",errors:[{name:"InvalidConvo"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["members"],properties:{cursor:{type:"string"},members:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}}}}}},ChatBskyConvoGetLog:{lexicon:1,id:"chat.bsky.convo.getLog",defs:{main:{type:"query",parameters:{type:"params",required:[],properties:{cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["logs"],properties:{cursor:{type:"string"},logs:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#logBeginConvo","lex:chat.bsky.convo.defs#logAcceptConvo","lex:chat.bsky.convo.defs#logLeaveConvo","lex:chat.bsky.convo.defs#logMuteConvo","lex:chat.bsky.convo.defs#logUnmuteConvo","lex:chat.bsky.convo.defs#logCreateMessage","lex:chat.bsky.convo.defs#logDeleteMessage","lex:chat.bsky.convo.defs#logReadMessage","lex:chat.bsky.convo.defs#logAddReaction","lex:chat.bsky.convo.defs#logRemoveReaction","lex:chat.bsky.convo.defs#logReadConvo","lex:chat.bsky.convo.defs#logAddMember","lex:chat.bsky.convo.defs#logRemoveMember","lex:chat.bsky.convo.defs#logMemberJoin","lex:chat.bsky.convo.defs#logMemberLeave","lex:chat.bsky.convo.defs#logLockConvo","lex:chat.bsky.convo.defs#logUnlockConvo","lex:chat.bsky.convo.defs#logLockConvoPermanently","lex:chat.bsky.convo.defs#logEditGroup","lex:chat.bsky.convo.defs#logCreateJoinLink","lex:chat.bsky.convo.defs#logEditJoinLink","lex:chat.bsky.convo.defs#logEnableJoinLink","lex:chat.bsky.convo.defs#logDisableJoinLink","lex:chat.bsky.convo.defs#logIncomingJoinRequest","lex:chat.bsky.convo.defs#logApproveJoinRequest","lex:chat.bsky.convo.defs#logRejectJoinRequest","lex:chat.bsky.convo.defs#logOutgoingJoinRequest","lex:chat.bsky.convo.defs#logWithdrawIncomingJoinRequest","lex:chat.bsky.convo.defs#logWithdrawOutgoingJoinRequest","lex:chat.bsky.convo.defs#logReadJoinRequests"]}}}}}}}},ChatBskyConvoGetMessages:{lexicon:1,id:"chat.bsky.convo.getMessages",defs:{main:{type:"query",description:"Returns a page of messages from a conversation.",errors:[{name:"InvalidConvo"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["messages"],properties:{cursor:{type:"string"},messages:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView","lex:chat.bsky.convo.defs#systemMessageView"]}},relatedProfiles:{description:"Set of all members who authored or reacted to the returned messages. Members referred to by system messages are also included.",type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}}}}}},ChatBskyConvoGetUnreadCounts:{lexicon:1,id:"chat.bsky.convo.getUnreadCounts",defs:{main:{type:"query",description:"Returns unread conversation counts for conversations that are unlocked, not muted, split by convo status. Direct convos are excluded when a block relationship exists between the actor and the other member, or when the other member's account is deleted or deactivated. Group convos are considered unread if they have unread join request counts.",parameters:{type:"params",properties:{includeGroupChats:{type:"boolean",default:!0,description:"When false, group convos are excluded from the counts."}}},output:{encoding:"application/json",schema:{type:"object",required:["unreadAcceptedConvos","unreadRequestConvos"],properties:{unreadAcceptedConvos:{type:"integer",description:"Number of unread, unlocked accepted convos. Counts convos with unread messages and unread join requests. Capped at 100, where 100 means more than 99."},unreadRequestConvos:{type:"integer",description:"Number of unread, unlocked request convos. Includes convos with unread messages, but not with unread join request, since only the owner of a group has join requests to read, and the group would necessarily be accepted. Capped at 100, where 100 means more than 99."}}}}}}},ChatBskyConvoLeaveConvo:{lexicon:1,id:"chat.bsky.convo.leaveConvo",defs:{main:{type:"procedure",description:"Leaves a conversation (direct or group). For group, this effectively removes membership. For direct, membership is never removed, only changed to remove from enumerations by the user who left.",errors:[{name:"InvalidConvo"},{name:"OwnerCannotLeave",description:"The owner of a group conversation cannot leave before locking the group."}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convoId","rev"],properties:{convoId:{type:"string"},rev:{type:"string"}}}}}}},ChatBskyConvoListConvoRequests:{lexicon:1,id:"chat.bsky.convo.listConvoRequests",defs:{main:{type:"query",description:"Returns a page of incoming conversation requests for the user. Direct convo requests are returned as convoView; group join requests made by the user are returned as joinRequestConvoView.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["requests"],properties:{cursor:{type:"string"},requests:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#convoView","lex:chat.bsky.group.defs#joinRequestConvoView"]}}}}}}}},ChatBskyConvoListConvos:{lexicon:1,id:"chat.bsky.convo.listConvos",defs:{main:{type:"query",description:"Returns a page of conversations (direct or group) for the user.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},readState:{type:"string",knownValues:["unread"]},status:{description:'Filter convos by their status. It is discouraged to call with "request" and preferred to call chat.bsky.convo.listConvoRequests, which also includes group join requests made by the user.',type:"string",knownValues:["request","accepted"]},kind:{type:"string",description:"Filter by conversation kind.",knownValues:["direct","group"]},lockStatus:{type:"string",description:"Filter by conversation lock status. Values follow chat.bsky.convo.defs#convoLockStatus.",knownValues:["unlocked","locked","locked-permanently"]}}},output:{encoding:"application/json",schema:{type:"object",required:["convos"],properties:{cursor:{type:"string"},convos:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}}},ChatBskyConvoLockConvo:{lexicon:1,id:"chat.bsky.convo.lockConvo",defs:{main:{type:"procedure",description:"Locks a group convo so no more content (messages, reactions) can be added to it.",errors:[{name:"ConvoLocked"},{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoMuteConvo:{lexicon:1,id:"chat.bsky.convo.muteConvo",defs:{main:{type:"procedure",description:"Mutes a conversation, preventing notifications related to it.",errors:[{name:"InvalidConvo"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoRemoveReaction:{lexicon:1,id:"chat.bsky.convo.removeReaction",defs:{main:{type:"procedure",description:"Removes an emoji reaction from a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in that reaction not being present, even if it already wasn't.",input:{encoding:"application/json",schema:{type:"object",required:["convoId","messageId","value"],properties:{convoId:{type:"string"},messageId:{type:"string"},value:{type:"string",minLength:1,maxLength:64,minGraphemes:1,maxGraphemes:1}}}},output:{encoding:"application/json",schema:{type:"object",required:["message"],properties:{message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}},errors:[{name:"InvalidConvo"},{name:"ReactionNotAllowed",description:"Indicates that reactions are not allowed on this message, e.g. because it is a system message."},{name:"ReactionMessageDeleted",description:"Indicates that the message has been deleted and reactions can no longer be added/removed."},{name:"ReactionInvalidValue",description:"Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji."}]}}},ChatBskyConvoSendMessage:{lexicon:1,id:"chat.bsky.convo.sendMessage",defs:{main:{type:"procedure",description:"Sends a message to a conversation.",errors:[{name:"ConvoLocked"},{name:"InvalidConvo"},{name:"ReplyTargetNotFound"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","message"],properties:{convoId:{type:"string"},message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageInput"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}}},ChatBskyConvoSendMessageBatch:{lexicon:1,id:"chat.bsky.convo.sendMessageBatch",defs:{main:{type:"procedure",description:"Sends a batch of messages to a conversation.",errors:[{name:"ConvoLocked"},{name:"InvalidConvo"},{name:"ReplyTargetNotFound"}],input:{encoding:"application/json",schema:{type:"object",required:["items"],properties:{items:{type:"array",maxLength:100,items:{type:"ref",ref:"lex:chat.bsky.convo.sendMessageBatch#batchItem"}}}}},output:{encoding:"application/json",schema:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}}}},batchItem:{type:"object",required:["convoId","message"],properties:{convoId:{type:"string"},message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageInput"}}}}},ChatBskyConvoUnlockConvo:{lexicon:1,id:"chat.bsky.convo.unlockConvo",defs:{main:{type:"procedure",description:"Unlocks a group convo so it is able to receive new content.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"},{name:"ConvoLockedByModeration"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoUnmuteConvo:{lexicon:1,id:"chat.bsky.convo.unmuteConvo",defs:{main:{type:"procedure",description:"Unmutes a conversation, allowing notifications related to it.",errors:[{name:"InvalidConvo"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoUpdateAllRead:{lexicon:1,id:"chat.bsky.convo.updateAllRead",defs:{main:{type:"procedure",description:"Sets conversations from a user as read to the latest message, with filters.",input:{encoding:"application/json",schema:{type:"object",properties:{status:{type:"string",knownValues:["request","accepted"]}}}},output:{encoding:"application/json",schema:{type:"object",required:["updatedCount"],properties:{updatedCount:{description:"The count of updated convos.",type:"integer"}}}}}}},ChatBskyConvoUpdateRead:{lexicon:1,id:"chat.bsky.convo.updateRead",defs:{main:{type:"procedure",description:"Updates the read state of a conversation from, optionally specifying the last read message.",errors:[{name:"InvalidConvo"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"},messageId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyEmbedJoinLink:{lexicon:1,id:"chat.bsky.embed.joinLink",description:"A join link embedded in a chat message.",defs:{main:{type:"object",required:["code"],properties:{code:{type:"string",description:"The join link code."}}},view:{type:"object",required:["joinLinkPreview"],properties:{joinLinkPreview:{type:"union",refs:["lex:chat.bsky.group.defs#joinLinkPreviewView","lex:chat.bsky.group.defs#disabledJoinLinkPreviewView","lex:chat.bsky.group.defs#invalidJoinLinkPreviewView"]}}}}},ChatBskyGroupAddMembers:{lexicon:1,id:"chat.bsky.group.addMembers",defs:{main:{type:"procedure",description:"Adds members to a group. The members are added in 'request' status, so they have to accept it. This creates convo memberships.",errors:[{name:"AccountSuspended"},{name:"BlockedActor"},{name:"BlockedSubject"},{name:"ConvoLocked"},{name:"InsufficientRole"},{name:"InvalidConvo"},{name:"MemberLimitReached"},{name:"NotFollowedBySender"},{name:"RecipientNotFound"},{name:"UserForbidsGroups"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","members"],properties:{convoId:{type:"string"},members:{type:"array",items:{type:"string",format:"did"},minLength:1}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"},addedMembers:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}}}}}},ChatBskyGroupApproveJoinRequest:{lexicon:1,id:"chat.bsky.group.approveJoinRequest",defs:{main:{type:"procedure",description:"Approves a request to join a group (via join link) the user owns. Action taken by the group owner.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"},{name:"MemberLimitReached"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","member"],properties:{convoId:{type:"string"},member:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyGroupCreateGroup:{lexicon:1,id:"chat.bsky.group.createGroup",defs:{main:{type:"procedure",description:"Creates a group convo, specifying the members to be added to it. Unlike getConvoForMembers, this isn't idempotent. It will create new groups even if the membership is identical to pre-existing groups. Will create 'request' membership for all members, except the owner who is 'accepted'.",errors:[{name:"AccountSuspended"},{name:"BlockedActor"},{name:"BlockedSubject"},{name:"NewAccountCannotCreateGroup"},{name:"NotFollowedBySender"},{name:"RecipientNotFound"},{name:"UserForbidsGroups"}],input:{encoding:"application/json",schema:{type:"object",required:["members","name"],properties:{members:{type:"array",description:"The members to add to the group. The owner is automatically added. Implementations may enforce a lower maximum than the 10,000-item schema limit; Bluesky currently supports up to 100 total members. If the owner is included in this list, the list may contain up to the implementation's total member limit. Otherwise, it may contain one fewer.",maxLength:1e4,items:{type:"string",format:"did"}},name:{type:"string",minLength:1,maxGraphemes:50,maxLength:500}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyGroupCreateJoinLink:{lexicon:1,id:"chat.bsky.group.createJoinLink",defs:{main:{type:"procedure",description:"Creates a join link for the group convo.",errors:[{name:"EnabledJoinLinkAlreadyExists"},{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","joinRule"],properties:{convoId:{type:"string"},requireApproval:{type:"boolean",default:!1},joinRule:{type:"ref",ref:"lex:chat.bsky.group.defs#joinRule"}}}},output:{encoding:"application/json",schema:{type:"object",required:["joinLink"],properties:{joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"}}}}}}},ChatBskyGroupDefs:{lexicon:1,id:"chat.bsky.group.defs",defs:{linkEnabledStatus:{type:"string",knownValues:["enabled","disabled"]},joinRule:{type:"string",knownValues:["anyone","followedByOwner"]},joinLinkView:{description:"Join link view to be used within a group view, so the convo is surrounding, not specified inside this view.",type:"object",required:["code","enabledStatus","requireApproval","joinRule","createdAt"],properties:{code:{type:"string"},enabledStatus:{type:"ref",ref:"lex:chat.bsky.group.defs#linkEnabledStatus"},requireApproval:{type:"boolean"},joinRule:{type:"ref",ref:"lex:chat.bsky.group.defs#joinRule"},createdAt:{type:"string",format:"datetime"}}},joinLinkPreviewView:{description:"Preview that can be shown in feeds, including to unauthenticated viewers.",type:"object",required:["convoId","code","name","owner","memberCount","memberLimit","requireApproval","joinRule"],properties:{convoId:{type:"string"},code:{type:"string"},name:{type:"string"},owner:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"},memberCount:{type:"integer"},memberLimit:{type:"integer"},requireApproval:{type:"boolean"},joinRule:{type:"ref",ref:"lex:chat.bsky.group.defs#joinRule"},convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView",description:"Present only if the request is authenticated and the user is a member of the group."},viewer:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkViewerState"}}},disabledJoinLinkPreviewView:{description:"Preview for a disabled join link. Carries only the code so clients can correlate with the input and render a disabled state.",type:"object",required:["code"],properties:{code:{type:"string"}}},invalidJoinLinkPreviewView:{description:"Preview for a join link code that does not map to an existing link. Carries only the code so clients can correlate with the input and render an invalid state.",type:"object",required:["code"],properties:{code:{type:"string"}}},joinLinkViewerState:{type:"object",properties:{requestedAt:{type:"string",format:"datetime"}}},joinRequestView:{description:"A join request from the perspective of the group owner.",type:"object",required:["convoId","requestedBy","requestedAt"],properties:{convoId:{type:"string"},requestedBy:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"},requestedAt:{type:"string",format:"datetime"}}},joinRequestConvoView:{description:"A join request from the perspective of the requester, including enough group context to render the request in a list (e.g. group name, owner, member count).",type:"object",required:["convoId","name","owner","memberCount","memberLimit","viewer"],properties:{convoId:{type:"string"},name:{type:"string"},owner:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"},memberCount:{type:"integer"},memberLimit:{type:"integer"},viewer:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkViewerState"}}}}},ChatBskyGroupDisableJoinLink:{lexicon:1,id:"chat.bsky.group.disableJoinLink",defs:{main:{type:"procedure",description:"Disables the active join link for the group convo.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"},{name:"NoJoinLink"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["joinLink"],properties:{joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"}}}}}}},ChatBskyGroupEditGroup:{lexicon:1,id:"chat.bsky.group.editGroup",defs:{main:{type:"procedure",description:"Edits group settings.",errors:[{name:"ConvoLocked"},{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","name"],properties:{convoId:{type:"string"},name:{type:"string",minLength:1,maxGraphemes:50,maxLength:500}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyGroupEditJoinLink:{lexicon:1,id:"chat.bsky.group.editJoinLink",defs:{main:{type:"procedure",description:"Edits the existing join link settings for the group convo.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"},{name:"NoJoinLink"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"},requireApproval:{type:"boolean"},joinRule:{type:"ref",ref:"lex:chat.bsky.group.defs#joinRule"}}}},output:{encoding:"application/json",schema:{type:"object",required:["joinLink"],properties:{joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"}}}}}}},ChatBskyGroupEnableJoinLink:{lexicon:1,id:"chat.bsky.group.enableJoinLink",defs:{main:{type:"procedure",description:"Re-enables a previously disabled join link for the group convo.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"},{name:"NoJoinLink"},{name:"LinkAlreadyEnabled"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["joinLink"],properties:{joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"}}}}}}},ChatBskyGroupGetJoinLinkPreviews:{lexicon:1,id:"chat.bsky.group.getJoinLinkPreviews",defs:{main:{type:"query",description:"Get public information about groups from join links. The output array matches the input codes one-to-one by position (and each view also carries its 'code'). Disabled codes return a disabledJoinLinkPreviewView, and codes that do not map to a previewable link return an invalidJoinLinkPreviewView.",parameters:{type:"params",required:["codes"],properties:{codes:{type:"array",minLength:1,maxLength:50,items:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["joinLinkPreviews"],properties:{joinLinkPreviews:{type:"array",items:{type:"union",refs:["lex:chat.bsky.group.defs#joinLinkPreviewView","lex:chat.bsky.group.defs#disabledJoinLinkPreviewView","lex:chat.bsky.group.defs#invalidJoinLinkPreviewView"]}}}}}}}},ChatBskyGroupListJoinRequests:{lexicon:1,id:"chat.bsky.group.listJoinRequests",defs:{main:{type:"query",description:"Lists a page of request to join a group (via join link) the user owns. Shows the data from the owner's point of view.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["requests"],properties:{cursor:{type:"string"},requests:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.group.defs#joinRequestView"}}}}}}}},ChatBskyGroupListMutualGroups:{lexicon:1,id:"chat.bsky.group.listMutualGroups",defs:{main:{type:"query",description:"Returns a page of group conversations that both the requester and the specified actor are members of.",parameters:{type:"params",required:["subject"],properties:{subject:{type:"string",format:"did"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["convos"],properties:{cursor:{type:"string"},convos:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}}},ChatBskyGroupRejectJoinRequest:{lexicon:1,id:"chat.bsky.group.rejectJoinRequest",defs:{main:{type:"procedure",description:"Rejects a request to join a group (via join link) the user owns. Action taken by the group owner.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","member"],properties:{convoId:{type:"string"},member:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:[],properties:{}}}}}},ChatBskyGroupRemoveMembers:{lexicon:1,id:"chat.bsky.group.removeMembers",defs:{main:{type:"procedure",description:"Removes members from a group. This deletes convo memberships, doesn't just set a status.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId","members"],properties:{convoId:{type:"string"},members:{type:"array",items:{type:"string",format:"did"},minLength:1}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyGroupRequestJoin:{lexicon:1,id:"chat.bsky.group.requestJoin",defs:{main:{type:"procedure",description:"Sends a request to join a group (via join link) to the group owner. Action taken by the prospective group member.",errors:[{name:"ConvoLocked"},{name:"FollowRequired"},{name:"InvalidCode"},{name:"LinkDisabled"},{name:"MemberLimitReached"},{name:"UserKicked"}],input:{encoding:"application/json",schema:{type:"object",required:["code"],properties:{code:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["status"],properties:{status:{type:"string",knownValues:["joined","pending"]},convo:{description:"The group convo joined. This is only present in the case of status=joined",type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyGroupUpdateJoinRequestsRead:{lexicon:1,id:"chat.bsky.group.updateJoinRequestsRead",defs:{main:{type:"procedure",description:"Marks all join requests as read for the group owner.",errors:[{name:"InvalidConvo"},{name:"InsufficientRole"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:[],properties:{}}}}}},ChatBskyGroupWithdrawJoinRequest:{lexicon:1,id:"chat.bsky.group.withdrawJoinRequest",defs:{main:{type:"procedure",description:"Withdraws a pending request to join a group. Action taken by the prospective member who originally requested to join.",errors:[{name:"InvalidJoinRequest"}],input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:[],properties:{}}}}}},ChatBskyModerationDefs:{lexicon:1,id:"chat.bsky.moderation.defs",defs:{convoView:{description:"A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members.",type:"object",required:["id","rev"],properties:{id:{type:"string"},rev:{type:"string"},kind:{description:"Union field that has data specific to different kinds of convos.",type:"union",refs:["lex:chat.bsky.moderation.defs#directConvo","lex:chat.bsky.moderation.defs#groupConvo"]}}},directConvo:{description:"Data specific to a direct conversation, for moderation purposes.",type:"object",properties:{}},groupConvo:{description:"Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation.",type:"object",required:["createdAt","joinRequestCount","lockStatus","memberCount","memberLimit","name"],properties:{createdAt:{type:"string",format:"datetime"},joinLink:{type:"ref",ref:"lex:chat.bsky.group.defs#joinLinkView"},joinRequestCount:{type:"integer",description:"The total number of pending join requests for the group conversation. This information is only visible to the owner and to moderators. Capped at 21."},lockStatus:{description:"The lock status of the conversation.",type:"ref",ref:"lex:chat.bsky.convo.defs#convoLockStatus"},memberCount:{type:"integer",description:"The total number of members in the group conversation."},memberLimit:{type:"integer",description:"The maximum number of members allowed in the group conversation."},name:{type:"string",description:"The display name of the group conversation.",maxGraphemes:50,maxLength:500}}}}},ChatBskyModerationGetActorMetadata:{lexicon:1,id:"chat.bsky.moderation.getActorMetadata",defs:{main:{type:"query",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"object",required:["day","month","all"],properties:{day:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"},month:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"},all:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"}}}}},metadata:{type:"object",required:["messagesSent","messagesReceived","convos","convosStarted"],properties:{messagesSent:{type:"integer"},messagesReceived:{type:"integer"},convos:{type:"integer"},convosStarted:{type:"integer"}}}}},ChatBskyModerationGetConvo:{lexicon:1,id:"chat.bsky.moderation.getConvo",defs:{main:{type:"query",description:"Gets an existing conversation by its ID, for moderation purposes. Does not require the requester to be a member of the conversation.",errors:[{name:"InvalidConvo"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.moderation.defs#convoView"}}}}}}},ChatBskyModerationGetConvoMembers:{lexicon:1,id:"chat.bsky.moderation.getConvoMembers",defs:{main:{type:"query",description:"Returns a paginated list of members from a conversation, for moderation purposes. Does not require the requester to be a member of the conversation.",errors:[{name:"InvalidConvo"}],parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["members"],properties:{cursor:{type:"string"},members:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}}}}}}}},ChatBskyModerationGetConvos:{lexicon:1,id:"chat.bsky.moderation.getConvos",defs:{main:{type:"query",description:"Gets existing conversations by their IDs, for moderation purposes. Does not require the requester to be a member of the conversations. Unknown IDs are silently omitted from the response.",parameters:{type:"params",required:["convoIds"],properties:{convoIds:{type:"array",minLength:1,maxLength:100,items:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convos"],properties:{convos:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.moderation.defs#convoView"}}}}}}}},ChatBskyModerationGetMessageContext:{lexicon:1,id:"chat.bsky.moderation.getMessageContext",defs:{main:{type:"query",parameters:{type:"params",required:["messageId"],properties:{convoId:{type:"string",description:"Conversation that the message is from. NOTE: this field will eventually be required."},messageId:{type:"string"},before:{type:"integer",default:5,description:"Number of user messages before the target to include. System messages between the earliest returned user message and the target are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages before the target, up to `maxInterleavedSystemMessages` system messages immediately preceding the target are returned instead."},after:{type:"integer",default:5,description:"Number of user messages after the target to include. System messages between the target and the latest returned user message are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages after the target, up to `maxInterleavedSystemMessages` system messages immediately following the target are returned instead."},maxInterleavedSystemMessages:{type:"integer",default:10,minimum:0,maximum:1e3,description:"Maximum number of system messages to include per gap between consecutive returned messages (and per side when there are no user messages on that side). Within a gap, the system messages closest to the earlier message are kept."}}},output:{encoding:"application/json",schema:{type:"object",required:["messages"],properties:{messages:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#systemMessageView"]}}}}}}}},ChatBskyModerationSubscribeModEvents:{lexicon:1,id:"chat.bsky.moderation.subscribeModEvents",defs:{main:{type:"subscription",description:"Subscribe to stream of chat events targeted to moderation. Private endpoint.",parameters:{type:"params",properties:{cursor:{type:"string",description:"The last known event seq number to backfill from. Use '2222222222222' to backfill from the beginning. Don't specify a cursor to listen only for new events."}}},message:{schema:{type:"union",refs:["lex:chat.bsky.moderation.subscribeModEvents#eventConvoFirstMessage","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatCreated","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatMemberAdded","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatMemberJoined","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatJoinRequest","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatJoinRequestApproved","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatJoinRequestRejected","lex:chat.bsky.moderation.subscribeModEvents#eventChatAccepted","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatMemberLeft","lex:chat.bsky.moderation.subscribeModEvents#eventGroupChatUpdated","lex:chat.bsky.moderation.subscribeModEvents#eventRateLimitExceeded"]}},errors:[{name:"FutureCursor"},{name:"ConsumerTooSlow",description:"If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."}]},eventConvoFirstMessage:{type:"object",description:"Fired when the first message was sent on a convo.",required:["createdAt","rev","convoId","user","recipients"],properties:{convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},messageId:{type:"string"},recipients:{description:"The list of DIDs message recipients. Does not include the sender, which is in the `user` field",type:"array",items:{type:"string",format:"did"}},rev:{type:"string"},user:{description:"The DID of the message author.",type:"string",format:"did"}}},eventGroupChatCreated:{type:"object",description:"Fire when a group chat is created.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","initialMemberDids","ownerDid","rev"],properties:{actorDid:{description:"The DID of the actor performing the action. For this event, same as ownerDid.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{description:"The name set at creation time.",type:"string"},initialMemberDids:{description:"DIDs of everyone added at creation time.",type:"array",items:{type:"string",format:"did"}},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"}}},eventGroupChatMemberAdded:{type:"object",description:"Fired when a member is added to a group chat. Note that members are added in the 'request' state.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","ownerDid","requestMembersCount","rev","subjectDid","subjectFollowsOwner"],properties:{actorDid:{description:"The DID of the actor performing the action. For this event, same as ownerDid.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},requestMembersCount:{description:"The number of members who have not yet accepted the convo.",type:"integer"},rev:{type:"string"},subjectDid:{description:"The DID of the member who was added.",type:"string",format:"did"},subjectFollowsOwner:{description:"Whether the added member follows the group owner.",type:"boolean"}}},eventGroupChatMemberJoined:{type:"object",description:"Fired when a member joins a group chat via an join link that does not require approval.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","joinLinkCode","ownerDid","rev","subjectFollowsOwner"],properties:{actorDid:{description:"The DID of the person joining.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},joinLinkCode:{description:"The code of the join link used to join.",type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},subjectFollowsOwner:{description:"Whether the joining member follows the group owner.",type:"boolean"}}},eventGroupChatJoinRequest:{type:"object",description:"Fired when a user requests to join a group chat via an join link that requires approval.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","joinLinkCode","ownerDid","rev","subjectFollowsOwner"],properties:{actorDid:{description:"The DID of the person requesting to join.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},joinLinkCode:{description:"The code of the join link used to request joining.",type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},subjectFollowsOwner:{description:"Whether the requesting member follows the group owner.",type:"boolean"}}},eventGroupChatJoinRequestApproved:{type:"object",description:"Fired when a join request is approved by the group owner.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","ownerDid","rev","subjectDid"],properties:{actorDid:{description:"The DID of the owner approving the request.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},subjectDid:{description:"The DID of the member whose request was approved.",type:"string",format:"did"}}},eventGroupChatJoinRequestRejected:{type:"object",description:"Fired when a join request is rejected by the group owner.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","ownerDid","rev","subjectDid"],properties:{actorDid:{description:"The DID of the owner rejecting the request.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},subjectDid:{description:"The DID of the member whose request was rejected.",type:"string",format:"did"}}},eventChatAccepted:{type:"object",description:"Fired when a user accepts a chat convo, either explicitly or by sending a message.",required:["actorDid","convoCreatedAt","convoId","createdAt","method","rev"],properties:{actorDid:{description:"The DID of the person accepting the convo.",type:"string",format:"did"},convoCreatedAt:{description:"When the convo was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event. Only present for group convos.",type:"integer"},groupName:{description:"The name of the group chat. Only present for group convos.",type:"string"},method:{description:"How the convo was accepted.",type:"string",knownValues:["explicit","message"]},ownerDid:{description:"The DID of the group chat owner. Only present for group convos.",type:"string",format:"did"},rev:{type:"string"}}},eventGroupChatMemberLeft:{type:"object",description:"Fired when a member leaves or is removed from a group chat.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","leaveMethod","ownerDid","rev","subjectDid"],properties:{actorDid:{description:"The DID of the actor. For voluntary: the person leaving. For kicked: the owner.",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{type:"string"},leaveMethod:{description:"How the member left.",type:"string",knownValues:["voluntary","kicked"]},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},subjectDid:{description:"The DID of the member who left or was removed.",type:"string",format:"did"}}},eventGroupChatUpdated:{type:"object",description:"Fired when a group chat's metadata or status changes.",required:["actorDid","convoCreatedAt","convoId","createdAt","groupMemberCount","groupName","ownerDid","rev","updateType"],properties:{actorDid:{description:"The DID of the actor performing the action (the owner).",type:"string",format:"did"},convoCreatedAt:{description:"When the group was originally created.",type:"string",format:"datetime"},convoId:{type:"string"},createdAt:{type:"string",format:"datetime"},groupMemberCount:{description:"Current member count at the time of the event.",type:"integer"},groupName:{description:"Current group name.",type:"string"},joinLinkCode:{description:"The code of the join link. Only present when updateType is join-link-related.",type:"string"},joinLinkFollowersOnly:{description:"Whether the join link is restricted to followers of the owner. Only present when updateType is join-link-related.",type:"boolean"},joinLinkRequiresApproval:{description:"Whether the join link requires owner approval to join. Only present when updateType is join-link-related.",type:"boolean"},lockReason:{description:"Why the group was locked. Only present when updateType is 'locked'.",type:"string",knownValues:["owner_action","owner_left","owner_deactivated","owner_deleted","owner_suspended","owner_taken_down","label_applied","convo_taken_down"]},newName:{description:"The new group name. Only present when updateType is 'name_changed'.",type:"string"},oldName:{description:"The previous group name. Only present when updateType is 'name_changed'.",type:"string"},ownerDid:{description:"The DID of the group chat owner.",type:"string",format:"did"},rev:{type:"string"},updateType:{description:"What changed.",type:"string",knownValues:["name_changed","locked","locked_permanently","unlocked","join_link_created","join_link_disabled","join_link_settings_changed"]}}},eventRateLimitExceeded:{type:"object",description:"Fired when a user exceeds a rate limit.",required:["actorDid","createdAt","endpoint","rev"],properties:{actorDid:{description:"The DID of the user who hit the rate limit.",type:"string",format:"did"},createdAt:{type:"string",format:"datetime"},endpoint:{description:"The NSID of the endpoint that was rate limited.",type:"string"},rev:{type:"string"}}}}},ChatBskyModerationUpdateActorAccess:{lexicon:1,id:"chat.bsky.moderation.updateActorAccess",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["actor","allowAccess"],properties:{actor:{type:"string",format:"did"},allowAccess:{type:"boolean"},ref:{type:"string"}}}}}}},ChatBskyNotificationDefs:{lexicon:1,id:"chat.bsky.notification.defs",defs:{preferences:{type:"object",required:["chat","chatRequest"],properties:{chat:{type:"ref",ref:"lex:chat.bsky.notification.defs#chatPreference"},chatRequest:{type:"ref",ref:"lex:chat.bsky.notification.defs#chatPreference"}}},chatPreference:{type:"object",required:["include","push"],properties:{include:{type:"string",knownValues:["all","follows"]},push:{type:"boolean"}}}}},ChatBskyNotificationGetPreferences:{lexicon:1,id:"chat.bsky.notification.getPreferences",defs:{main:{type:"query",description:"Get the requesting account's chat notification preferences. Defaults are returned for accounts that have not set any preferences. Requires auth.",output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:chat.bsky.notification.defs#preferences"}}}}}}},ChatBskyNotificationPutPreferences:{lexicon:1,id:"chat.bsky.notification.putPreferences",defs:{main:{type:"procedure",description:"Set the requesting account's chat notification preferences. Only the provided preferences are updated; omitted preferences are left unchanged.",input:{encoding:"application/json",schema:{type:"object",properties:{chat:{type:"ref",ref:"lex:chat.bsky.notification.defs#chatPreference"},chatRequest:{type:"ref",ref:"lex:chat.bsky.notification.defs#chatPreference"}}}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:chat.bsky.notification.defs#preferences"}}}}}}},ComAtprotoAdminDefs:{lexicon:1,id:"com.atproto.admin.defs",defs:{statusAttr:{type:"object",required:["applied"],properties:{applied:{type:"boolean"},ref:{type:"string"}}},accountView:{type:"object",required:["did","handle","indexedAt"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invites:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}},invitesDisabled:{type:"boolean"},emailConfirmedAt:{type:"string",format:"datetime"},inviteNote:{type:"string"},deactivatedAt:{type:"string",format:"datetime"},threatSignatures:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#threatSignature"}}}},repoRef:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},repoBlobRef:{type:"object",required:["did","cid"],properties:{did:{type:"string",format:"did"},cid:{type:"string",format:"cid"},recordUri:{type:"string",format:"at-uri"}}},threatSignature:{type:"object",required:["property","value"],properties:{property:{type:"string"},value:{type:"string"}}}}},ComAtprotoAdminDeleteAccount:{lexicon:1,id:"com.atproto.admin.deleteAccount",defs:{main:{type:"procedure",description:"Delete a user account as an administrator.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}}}}},ComAtprotoAdminDisableAccountInvites:{lexicon:1,id:"com.atproto.admin.disableAccountInvites",defs:{main:{type:"procedure",description:"Disable an account from receiving new invite codes, but does not invalidate existing codes.",input:{encoding:"application/json",schema:{type:"object",required:["account"],properties:{account:{type:"string",format:"did"},note:{type:"string",description:"Optional reason for disabled invites."}}}}}}},ComAtprotoAdminDisableInviteCodes:{lexicon:1,id:"com.atproto.admin.disableInviteCodes",defs:{main:{type:"procedure",description:"Disable some set of codes and/or all codes associated with a set of users.",input:{encoding:"application/json",schema:{type:"object",properties:{codes:{type:"array",items:{type:"string"}},accounts:{type:"array",items:{type:"string"}}}}}}}},ComAtprotoAdminEnableAccountInvites:{lexicon:1,id:"com.atproto.admin.enableAccountInvites",defs:{main:{type:"procedure",description:"Re-enable an account's ability to receive invite codes.",input:{encoding:"application/json",schema:{type:"object",required:["account"],properties:{account:{type:"string",format:"did"},note:{type:"string",description:"Optional reason for enabled invites."}}}}}}},ComAtprotoAdminGetAccountInfo:{lexicon:1,id:"com.atproto.admin.getAccountInfo",defs:{main:{type:"query",description:"Get details about an account.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}},ComAtprotoAdminGetAccountInfos:{lexicon:1,id:"com.atproto.admin.getAccountInfos",defs:{main:{type:"query",description:"Get details about some accounts.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["infos"],properties:{infos:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ComAtprotoAdminGetInviteCodes:{lexicon:1,id:"com.atproto.admin.getInviteCodes",defs:{main:{type:"query",description:"Get an admin view of invite codes.",parameters:{type:"params",properties:{sort:{type:"string",knownValues:["recent","usage"],default:"recent"},limit:{type:"integer",minimum:1,maximum:500,default:100},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{cursor:{type:"string"},codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}}}}}}}},ComAtprotoAdminGetSubjectStatus:{lexicon:1,id:"com.atproto.admin.getSubjectStatus",defs:{main:{type:"query",description:"Get the service-specific admin status of a subject (account, record, or blob).",parameters:{type:"params",properties:{did:{type:"string",format:"did"},uri:{type:"string",format:"at-uri"},blob:{type:"string",format:"cid"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"},deactivated:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}}}}},ComAtprotoAdminSearchAccounts:{lexicon:1,id:"com.atproto.admin.searchAccounts",defs:{main:{type:"query",description:"Get list of accounts that matches your search query.",parameters:{type:"params",properties:{email:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ComAtprotoAdminSendEmail:{lexicon:1,id:"com.atproto.admin.sendEmail",defs:{main:{type:"procedure",description:"Send email to a user's account email address.",input:{encoding:"application/json",schema:{type:"object",required:["recipientDid","content","senderDid"],properties:{recipientDid:{type:"string",format:"did"},content:{type:"string"},subject:{type:"string"},senderDid:{type:"string",format:"did"},comment:{type:"string",description:"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers"}}}},output:{encoding:"application/json",schema:{type:"object",required:["sent"],properties:{sent:{type:"boolean"}}}}}}},ComAtprotoAdminUpdateAccountEmail:{lexicon:1,id:"com.atproto.admin.updateAccountEmail",defs:{main:{type:"procedure",description:"Administrative action to update an account's email.",input:{encoding:"application/json",schema:{type:"object",required:["account","email"],properties:{account:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},email:{type:"string"}}}}}}},ComAtprotoAdminUpdateAccountHandle:{lexicon:1,id:"com.atproto.admin.updateAccountHandle",defs:{main:{type:"procedure",description:"Administrative action to update an account's handle.",input:{encoding:"application/json",schema:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"}}}}}}},ComAtprotoAdminUpdateAccountPassword:{lexicon:1,id:"com.atproto.admin.updateAccountPassword",defs:{main:{type:"procedure",description:"Update the password for a user account as an administrator.",input:{encoding:"application/json",schema:{type:"object",required:["did","password"],properties:{did:{type:"string",format:"did"},password:{type:"string"}}}}}}},ComAtprotoAdminUpdateAccountSigningKey:{lexicon:1,id:"com.atproto.admin.updateAccountSigningKey",defs:{main:{type:"procedure",description:"Administrative action to update an account's signing key in their Did document.",input:{encoding:"application/json",schema:{type:"object",required:["did","signingKey"],properties:{did:{type:"string",format:"did"},signingKey:{type:"string",format:"did",description:"Did-key formatted public key"}}}}}}},ComAtprotoAdminUpdateSubjectStatus:{lexicon:1,id:"com.atproto.admin.updateSubjectStatus",defs:{main:{type:"procedure",description:"Update the service-specific admin status of a subject (account, record, or blob).",input:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"},deactivated:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}},output:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}}}}},ComAtprotoIdentityDefs:{lexicon:1,id:"com.atproto.identity.defs",defs:{identityInfo:{type:"object",required:["did","handle","didDoc"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle",description:"The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document."},didDoc:{type:"unknown",description:"The complete DID document for the identity."}}}}},ComAtprotoIdentityGetRecommendedDidCredentials:{lexicon:1,id:"com.atproto.identity.getRecommendedDidCredentials",defs:{main:{type:"query",description:"Describe the credentials that should be included in the DID doc of an account that is migrating to this service.",output:{encoding:"application/json",schema:{type:"object",properties:{rotationKeys:{description:"Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.",type:"array",items:{type:"string"}},alsoKnownAs:{type:"array",items:{type:"string"}},verificationMethods:{type:"unknown"},services:{type:"unknown"}}}}}}},ComAtprotoIdentityRefreshIdentity:{lexicon:1,id:"com.atproto.identity.refreshIdentity",defs:{main:{type:"procedure",description:"Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.",input:{encoding:"application/json",schema:{type:"object",required:["identifier"],properties:{identifier:{type:"string",format:"at-identifier"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.identity.defs#identityInfo"}},errors:[{name:"HandleNotFound",description:"The resolution process confirmed that the handle does not resolve to any DID."},{name:"DidNotFound",description:"The DID resolution process confirmed that there is no current DID."},{name:"DidDeactivated",description:"The DID previously existed, but has been deactivated."}]}}},ComAtprotoIdentityRequestPlcOperationSignature:{lexicon:1,id:"com.atproto.identity.requestPlcOperationSignature",defs:{main:{type:"procedure",description:"Request an email with a code to in order to request a signed PLC operation. Requires Auth."}}},ComAtprotoIdentityResolveDid:{lexicon:1,id:"com.atproto.identity.resolveDid",defs:{main:{type:"query",description:"Resolves DID to DID document. Does not bi-directionally verify handle.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"DID to resolve."}}},output:{encoding:"application/json",schema:{type:"object",required:["didDoc"],properties:{didDoc:{type:"unknown",description:"The complete DID document for the identity."}}}},errors:[{name:"DidNotFound",description:"The DID resolution process confirmed that there is no current DID."},{name:"DidDeactivated",description:"The DID previously existed, but has been deactivated."}]}}},ComAtprotoIdentityResolveHandle:{lexicon:1,id:"com.atproto.identity.resolveHandle",defs:{main:{type:"query",description:"Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.",parameters:{type:"params",required:["handle"],properties:{handle:{type:"string",format:"handle",description:"The handle to resolve."}}},output:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}},errors:[{name:"HandleNotFound",description:"The resolution process confirmed that the handle does not resolve to any DID."}]}}},ComAtprotoIdentityResolveIdentity:{lexicon:1,id:"com.atproto.identity.resolveIdentity",defs:{main:{type:"query",description:"Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).",parameters:{type:"params",required:["identifier"],properties:{identifier:{type:"string",format:"at-identifier",description:"Handle or DID to resolve."}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.identity.defs#identityInfo"}},errors:[{name:"HandleNotFound",description:"The resolution process confirmed that the handle does not resolve to any DID."},{name:"DidNotFound",description:"The DID resolution process confirmed that there is no current DID."},{name:"DidDeactivated",description:"The DID previously existed, but has been deactivated."}]}}},ComAtprotoIdentitySignPlcOperation:{lexicon:1,id:"com.atproto.identity.signPlcOperation",defs:{main:{type:"procedure",description:"Signs a PLC operation to update some value(s) in the requesting DID's document.",input:{encoding:"application/json",schema:{type:"object",properties:{token:{description:"A token received through com.atproto.identity.requestPlcOperationSignature",type:"string"},rotationKeys:{type:"array",items:{type:"string"}},alsoKnownAs:{type:"array",items:{type:"string"}},verificationMethods:{type:"unknown"},services:{type:"unknown"}}}},output:{encoding:"application/json",schema:{type:"object",required:["operation"],properties:{operation:{type:"unknown",description:"A signed DID PLC operation."}}}}}}},ComAtprotoIdentitySubmitPlcOperation:{lexicon:1,id:"com.atproto.identity.submitPlcOperation",defs:{main:{type:"procedure",description:"Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry",input:{encoding:"application/json",schema:{type:"object",required:["operation"],properties:{operation:{type:"unknown"}}}}}}},ComAtprotoIdentityUpdateHandle:{lexicon:1,id:"com.atproto.identity.updateHandle",defs:{main:{type:"procedure",description:"Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["handle"],properties:{handle:{type:"string",format:"handle",description:"The new handle."}}}}}}},ComAtprotoLabelDefs:{lexicon:1,id:"com.atproto.label.defs",defs:{label:{type:"object",description:"Metadata tag on an atproto resource (eg, repo or record).",required:["src","uri","val","cts"],properties:{ver:{type:"integer",description:"The AT Protocol version of the label object."},src:{type:"string",format:"did",description:"DID of the actor who created this label."},uri:{type:"string",format:"uri",description:"AT URI of the record, repository (account), or other resource that this label applies to."},cid:{type:"string",format:"cid",description:"Optionally, CID specifying the specific version of 'uri' resource this label applies to."},val:{type:"string",maxLength:128,description:"The short string name of the value or type of this label."},neg:{type:"boolean",description:"If true, this is a negation label, overwriting a previous label."},cts:{type:"string",format:"datetime",description:"Timestamp when this label was created."},exp:{type:"string",format:"datetime",description:"Timestamp at which this label expires (no longer applies)."},sig:{type:"bytes",description:"Signature of dag-cbor encoded label."}}},selfLabels:{type:"object",description:"Metadata tags on an atproto record, published by the author within the record.",required:["values"],properties:{values:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#selfLabel"},maxLength:10}}},selfLabel:{type:"object",description:"Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",required:["val"],properties:{val:{type:"string",maxLength:128,description:"The short string name of the value or type of this label."}}},labelValueDefinition:{type:"object",description:"Declares a label value and its expected interpretations and behaviors.",required:["identifier","severity","blurs","locales"],properties:{identifier:{type:"string",description:"The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",maxLength:100,maxGraphemes:100},severity:{type:"string",description:"How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",knownValues:["inform","alert","none"]},blurs:{type:"string",description:"What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",knownValues:["content","media","none"]},defaultSetting:{type:"string",description:"The default setting for this label.",knownValues:["ignore","warn","hide"],default:"warn"},adultOnly:{type:"boolean",description:"Does the user need to have adult content enabled in order to configure this label?"},locales:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValueDefinitionStrings"}}}},labelValueDefinitionStrings:{type:"object",description:"Strings which describe the label in the UI, localized into a specific language.",required:["lang","name","description"],properties:{lang:{type:"string",description:"The code of the language these strings are written in.",format:"language"},name:{type:"string",description:"A short human-readable name for the label.",maxGraphemes:64,maxLength:640},description:{type:"string",description:"A longer description of what the label means and why it might be applied.",maxGraphemes:1e4,maxLength:1e5}}},labelValue:{type:"string",knownValues:["!hide","!warn","!no-unauthenticated","porn","sexual","nudity","graphic-media","bot"]}}},ComAtprotoLabelQueryLabels:{lexicon:1,id:"com.atproto.label.queryLabels",defs:{main:{type:"query",description:"Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.",parameters:{type:"params",required:["uriPatterns"],properties:{uriPatterns:{type:"array",items:{type:"string"},description:"List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI."},sources:{type:"array",items:{type:"string",format:"did"},description:"Optional list of label sources (DIDs) to filter on."},limit:{type:"integer",minimum:1,maximum:250,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["labels"],properties:{cursor:{type:"string"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}}}},ComAtprotoLabelSubscribeLabels:{lexicon:1,id:"com.atproto.label.subscribeLabels",defs:{main:{type:"subscription",description:"Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.",parameters:{type:"params",properties:{cursor:{type:"integer",description:"The last known event seq number to backfill from."}}},message:{schema:{type:"union",refs:["lex:com.atproto.label.subscribeLabels#labels","lex:com.atproto.label.subscribeLabels#info"]}},errors:[{name:"FutureCursor"}]},labels:{type:"object",required:["seq","labels"],properties:{seq:{type:"integer"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},info:{type:"object",required:["name"],properties:{name:{type:"string",knownValues:["OutdatedCursor"]},message:{type:"string"}}}}},ComAtprotoLexiconResolveLexicon:{lexicon:1,id:"com.atproto.lexicon.resolveLexicon",defs:{main:{type:"query",description:"Resolves an atproto lexicon (NSID) to a schema.",parameters:{type:"params",properties:{nsid:{format:"nsid",type:"string",description:"The lexicon NSID to resolve."}},required:["nsid"]},output:{encoding:"application/json",schema:{type:"object",properties:{cid:{type:"string",format:"cid",description:"The CID of the lexicon schema record."},schema:{type:"ref",ref:"lex:com.atproto.lexicon.schema#main",description:"The resolved lexicon schema record."},uri:{type:"string",format:"at-uri",description:"The AT-URI of the lexicon schema record."}},required:["uri","cid","schema"]}},errors:[{description:"No lexicon was resolved for the NSID.",name:"LexiconNotFound"}]}}},ComAtprotoLexiconSchema:{lexicon:1,id:"com.atproto.lexicon.schema",defs:{main:{type:"record",description:"Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc).",key:"nsid",record:{type:"object",required:["lexicon"],properties:{lexicon:{type:"integer",description:"Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system."}}}}}},ComAtprotoModerationCreateReport:{lexicon:1,id:"com.atproto.moderation.createReport",defs:{main:{type:"procedure",description:"Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["reasonType","subject"],properties:{reasonType:{type:"ref",description:"Indicates the broad category of violation the report is for.",ref:"lex:com.atproto.moderation.defs#reasonType"},reason:{type:"string",maxGraphemes:2e3,maxLength:2e4,description:"Additional context about the content and violation."},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},modTool:{type:"ref",ref:"lex:com.atproto.moderation.createReport#modTool"}}}},output:{encoding:"application/json",schema:{type:"object",required:["id","reasonType","subject","reportedBy","createdAt"],properties:{id:{type:"integer"},reasonType:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"},reason:{type:"string",maxGraphemes:2e3,maxLength:2e4},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},reportedBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"}}}}},modTool:{type:"object",description:"Moderation tool information for tracing the source of the action",required:["name"],properties:{name:{type:"string",description:"Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')"},meta:{type:"unknown",description:"Additional arbitrary metadata about the source"}}}}},ComAtprotoModerationDefs:{lexicon:1,id:"com.atproto.moderation.defs",defs:{reasonType:{type:"string",knownValues:["com.atproto.moderation.defs#reasonSpam","com.atproto.moderation.defs#reasonViolation","com.atproto.moderation.defs#reasonMisleading","com.atproto.moderation.defs#reasonSexual","com.atproto.moderation.defs#reasonRude","com.atproto.moderation.defs#reasonOther","com.atproto.moderation.defs#reasonAppeal","tools.ozone.report.defs#reasonAppeal","tools.ozone.report.defs#reasonOther","tools.ozone.report.defs#reasonViolenceAnimal","tools.ozone.report.defs#reasonViolenceThreats","tools.ozone.report.defs#reasonViolenceGraphicContent","tools.ozone.report.defs#reasonViolenceGlorification","tools.ozone.report.defs#reasonViolenceExtremistContent","tools.ozone.report.defs#reasonViolenceTrafficking","tools.ozone.report.defs#reasonViolenceOther","tools.ozone.report.defs#reasonSexualAbuseContent","tools.ozone.report.defs#reasonSexualNCII","tools.ozone.report.defs#reasonSexualDeepfake","tools.ozone.report.defs#reasonSexualAnimal","tools.ozone.report.defs#reasonSexualUnlabeled","tools.ozone.report.defs#reasonSexualOther","tools.ozone.report.defs#reasonChildSafetyCSAM","tools.ozone.report.defs#reasonChildSafetyGroom","tools.ozone.report.defs#reasonChildSafetyPrivacy","tools.ozone.report.defs#reasonChildSafetyHarassment","tools.ozone.report.defs#reasonChildSafetyOther","tools.ozone.report.defs#reasonHarassmentTroll","tools.ozone.report.defs#reasonHarassmentTargeted","tools.ozone.report.defs#reasonHarassmentHateSpeech","tools.ozone.report.defs#reasonHarassmentDoxxing","tools.ozone.report.defs#reasonHarassmentOther","tools.ozone.report.defs#reasonMisleadingBot","tools.ozone.report.defs#reasonMisleadingImpersonation","tools.ozone.report.defs#reasonMisleadingSpam","tools.ozone.report.defs#reasonMisleadingScam","tools.ozone.report.defs#reasonMisleadingElections","tools.ozone.report.defs#reasonMisleadingOther","tools.ozone.report.defs#reasonRuleSiteSecurity","tools.ozone.report.defs#reasonRuleProhibitedSales","tools.ozone.report.defs#reasonRuleBanEvasion","tools.ozone.report.defs#reasonRuleOther","tools.ozone.report.defs#reasonSelfHarmContent","tools.ozone.report.defs#reasonSelfHarmED","tools.ozone.report.defs#reasonSelfHarmStunts","tools.ozone.report.defs#reasonSelfHarmSubstances","tools.ozone.report.defs#reasonSelfHarmOther"]},reasonSpam:{type:"token",description:"Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`."},reasonViolation:{type:"token",description:"Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`."},reasonMisleading:{type:"token",description:"Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`."},reasonSexual:{type:"token",description:"Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`."},reasonRude:{type:"token",description:"Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`."},reasonOther:{type:"token",description:"Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`."},reasonAppeal:{type:"token",description:"Appeal a previously taken moderation action"},subjectType:{type:"string",description:"Tag describing a type of subject that might be reported.",knownValues:["account","record","chat"]}}},ComAtprotoRepoApplyWrites:{lexicon:1,id:"com.atproto.repo.applyWrites",defs:{main:{type:"procedure",description:"Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","writes"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons."},writes:{type:"array",items:{type:"union",refs:["lex:com.atproto.repo.applyWrites#create","lex:com.atproto.repo.applyWrites#update","lex:com.atproto.repo.applyWrites#delete"],closed:!0}},swapCommit:{type:"string",description:"If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.",format:"cid"}}}},output:{encoding:"application/json",schema:{type:"object",required:[],properties:{commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},results:{type:"array",items:{type:"union",refs:["lex:com.atproto.repo.applyWrites#createResult","lex:com.atproto.repo.applyWrites#updateResult","lex:com.atproto.repo.applyWrites#deleteResult"],closed:!0}}}}},errors:[{name:"InvalidSwap",description:"Indicates that the 'swapCommit' parameter did not match current commit."}]},create:{type:"object",description:"Operation which creates a new record.",required:["collection","value"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string",maxLength:512,format:"record-key",description:"NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility."},value:{type:"unknown"}}},update:{type:"object",description:"Operation which updates an existing record.",required:["collection","rkey","value"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string",format:"record-key"},value:{type:"unknown"}}},delete:{type:"object",description:"Operation which deletes an existing record.",required:["collection","rkey"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string",format:"record-key"}}},createResult:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}},updateResult:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}},deleteResult:{type:"object",required:[],properties:{}}}},ComAtprotoRepoCreateRecord:{lexicon:1,id:"com.atproto.repo.createRecord",defs:{main:{type:"procedure",description:"Create a single new repository record. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","record"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",format:"record-key",description:"The Record Key.",maxLength:512},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."},record:{type:"unknown",description:"The record itself. Must contain a $type field."},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}}},errors:[{name:"InvalidSwap",description:"Indicates that 'swapCommit' didn't match current repo commit."}]}}},ComAtprotoRepoDefs:{lexicon:1,id:"com.atproto.repo.defs",defs:{commitMeta:{type:"object",required:["cid","rev"],properties:{cid:{type:"string",format:"cid"},rev:{type:"string",format:"tid"}}}}},ComAtprotoRepoDeleteRecord:{lexicon:1,id:"com.atproto.repo.deleteRecord",defs:{main:{type:"procedure",description:"Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","rkey"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",format:"record-key",description:"The Record Key."},swapRecord:{type:"string",format:"cid",description:"Compare and swap with the previous record by CID."},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",properties:{commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"}}}},errors:[{name:"InvalidSwap"}]}}},ComAtprotoRepoDescribeRepo:{lexicon:1,id:"com.atproto.repo.describeRepo",defs:{main:{type:"query",description:"Get information about an account and repository, including the list of collections. Does not require auth.",parameters:{type:"params",required:["repo"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["handle","did","didDoc","collections","handleIsCorrect"],properties:{handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown",description:"The complete DID document for this account."},collections:{type:"array",description:"List of all the collections (NSIDs) for which this repo contains at least one record.",items:{type:"string",format:"nsid"}},handleIsCorrect:{type:"boolean",description:"Indicates if handle is currently valid (resolves bi-directionally)"}}}}}}},ComAtprotoRepoGetRecord:{lexicon:1,id:"com.atproto.repo.getRecord",defs:{main:{type:"query",description:"Get a single record from a repository. Does not require auth.",parameters:{type:"params",required:["repo","collection","rkey"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",description:"The Record Key.",format:"record-key"},cid:{type:"string",format:"cid",description:"The CID of the version of the record. If not specified, then return the most recent version."}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","value"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"}}}},errors:[{name:"RecordNotFound"}]}}},ComAtprotoRepoImportRepo:{lexicon:1,id:"com.atproto.repo.importRepo",defs:{main:{type:"procedure",description:"Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.",input:{encoding:"application/vnd.ipld.car"}}}},ComAtprotoRepoListMissingBlobs:{lexicon:1,id:"com.atproto.repo.listMissingBlobs",defs:{main:{type:"query",description:"Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["blobs"],properties:{cursor:{type:"string"},blobs:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.listMissingBlobs#recordBlob"}}}}}},recordBlob:{type:"object",required:["cid","recordUri"],properties:{cid:{type:"string",format:"cid"},recordUri:{type:"string",format:"at-uri"}}}}},ComAtprotoRepoListRecords:{lexicon:1,id:"com.atproto.repo.listRecords",defs:{main:{type:"query",description:"List a range of records in a repository, matching a specific collection. Does not require auth.",parameters:{type:"params",required:["repo","collection"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},collection:{type:"string",format:"nsid",description:"The NSID of the record type."},limit:{type:"integer",minimum:1,maximum:100,default:50,description:"The number of records to return."},cursor:{type:"string"},reverse:{type:"boolean",description:"Flag to reverse the order of the returned records."}}},output:{encoding:"application/json",schema:{type:"object",required:["records"],properties:{cursor:{type:"string"},records:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.listRecords#record"}}}}}},record:{type:"object",required:["uri","cid","value"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"}}}}},ComAtprotoRepoPutRecord:{lexicon:1,id:"com.atproto.repo.putRecord",defs:{main:{type:"procedure",description:"Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","rkey","record"],nullable:["swapRecord"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",format:"record-key",description:"The Record Key.",maxLength:512},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."},record:{type:"unknown",description:"The record to write."},swapRecord:{type:"string",format:"cid",description:"Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation"},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}}},errors:[{name:"InvalidSwap"}]}}},ComAtprotoRepoStrongRef:{lexicon:1,id:"com.atproto.repo.strongRef",description:"A URI with a content-hash fingerprint.",defs:{main:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"}}}}},ComAtprotoRepoUploadBlob:{lexicon:1,id:"com.atproto.repo.uploadBlob",defs:{main:{type:"procedure",description:"Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.",input:{encoding:"*/*"},output:{encoding:"application/json",schema:{type:"object",required:["blob"],properties:{blob:{type:"blob"}}}}}}},ComAtprotoServerActivateAccount:{lexicon:1,id:"com.atproto.server.activateAccount",defs:{main:{type:"procedure",description:"Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup."}}},ComAtprotoServerCheckAccountStatus:{lexicon:1,id:"com.atproto.server.checkAccountStatus",defs:{main:{type:"query",description:"Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.",output:{encoding:"application/json",schema:{type:"object",required:["activated","validDid","repoCommit","repoRev","repoBlocks","indexedRecords","privateStateValues","expectedBlobs","importedBlobs"],properties:{activated:{type:"boolean"},validDid:{type:"boolean"},repoCommit:{type:"string",format:"cid"},repoRev:{type:"string"},repoBlocks:{type:"integer"},indexedRecords:{type:"integer"},privateStateValues:{type:"integer"},expectedBlobs:{type:"integer"},importedBlobs:{type:"integer"}}}}}}},ComAtprotoServerConfirmEmail:{lexicon:1,id:"com.atproto.server.confirmEmail",defs:{main:{type:"procedure",description:"Confirm an email using a token from com.atproto.server.requestEmailConfirmation.",input:{encoding:"application/json",schema:{type:"object",required:["email","token"],properties:{email:{type:"string"},token:{type:"string"}}}},errors:[{name:"AccountNotFound"},{name:"ExpiredToken"},{name:"InvalidToken"},{name:"InvalidEmail"}]}}},ComAtprotoServerCreateAccount:{lexicon:1,id:"com.atproto.server.createAccount",defs:{main:{type:"procedure",description:"Create an account. Implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["handle"],properties:{email:{type:"string"},handle:{type:"string",format:"handle",description:"Requested handle for the account."},did:{type:"string",format:"did",description:"Pre-existing atproto DID, being imported to a new account."},inviteCode:{type:"string"},verificationCode:{type:"string"},verificationPhone:{type:"string"},password:{type:"string",description:"Initial account password. May need to meet instance-specific password strength requirements."},recoveryKey:{type:"string",description:"DID PLC rotation key (aka, recovery key) to be included in PLC creation operation."},plcOp:{type:"unknown",description:"A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented."}}}},output:{encoding:"application/json",schema:{type:"object",description:"Account login session returned on successful account creation.",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did",description:"The DID of the new account."},didDoc:{type:"unknown",description:"Complete DID document."}}}},errors:[{name:"InvalidHandle"},{name:"InvalidPassword"},{name:"InvalidInviteCode"},{name:"HandleNotAvailable"},{name:"UnsupportedDomain"},{name:"UnresolvableDid"},{name:"IncompatibleDidDoc"}]}}},ComAtprotoServerCreateAppPassword:{lexicon:1,id:"com.atproto.server.createAppPassword",defs:{main:{type:"procedure",description:"Create an App Password.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string",description:"A short name for the App Password, to help distinguish them."},privileged:{type:"boolean",description:"If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.server.createAppPassword#appPassword"}},errors:[{name:"AccountTakedown"}]},appPassword:{type:"object",required:["name","password","createdAt"],properties:{name:{type:"string"},password:{type:"string"},createdAt:{type:"string",format:"datetime"},privileged:{type:"boolean"}}}}},ComAtprotoServerCreateInviteCode:{lexicon:1,id:"com.atproto.server.createInviteCode",defs:{main:{type:"procedure",description:"Create an invite code.",input:{encoding:"application/json",schema:{type:"object",required:["useCount"],properties:{useCount:{type:"integer"},forAccount:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["code"],properties:{code:{type:"string"}}}}}}},ComAtprotoServerCreateInviteCodes:{lexicon:1,id:"com.atproto.server.createInviteCodes",defs:{main:{type:"procedure",description:"Create invite codes.",input:{encoding:"application/json",schema:{type:"object",required:["codeCount","useCount"],properties:{codeCount:{type:"integer",default:1},useCount:{type:"integer"},forAccounts:{type:"array",items:{type:"string",format:"did"}}}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.createInviteCodes#accountCodes"}}}}}},accountCodes:{type:"object",required:["account","codes"],properties:{account:{type:"string"},codes:{type:"array",items:{type:"string"}}}}}},ComAtprotoServerCreateSession:{lexicon:1,id:"com.atproto.server.createSession",defs:{main:{type:"procedure",description:"Create an authentication session.",input:{encoding:"application/json",schema:{type:"object",required:["identifier","password"],properties:{identifier:{type:"string",description:"Handle or other identifier supported by the server for the authenticating user."},password:{type:"string"},authFactorToken:{type:"string"},allowTakendown:{type:"boolean",description:"When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned"}}}},output:{encoding:"application/json",schema:{type:"object",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown"},email:{type:"string"},emailConfirmed:{type:"boolean"},emailAuthFactor:{type:"boolean"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]}}}},errors:[{name:"AccountTakedown"},{name:"AuthFactorTokenRequired"}]}}},ComAtprotoServerDeactivateAccount:{lexicon:1,id:"com.atproto.server.deactivateAccount",defs:{main:{type:"procedure",description:"Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.",input:{encoding:"application/json",schema:{type:"object",properties:{deleteAfter:{type:"string",format:"datetime",description:"A recommendation to server as to how long they should hold onto the deactivated account before deleting."}}}}}}},ComAtprotoServerDefs:{lexicon:1,id:"com.atproto.server.defs",defs:{inviteCode:{type:"object",required:["code","available","disabled","forAccount","createdBy","createdAt","uses"],properties:{code:{type:"string"},available:{type:"integer"},disabled:{type:"boolean"},forAccount:{type:"string"},createdBy:{type:"string"},createdAt:{type:"string",format:"datetime"},uses:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCodeUse"}}}},inviteCodeUse:{type:"object",required:["usedBy","usedAt"],properties:{usedBy:{type:"string",format:"did"},usedAt:{type:"string",format:"datetime"}}}}},ComAtprotoServerDeleteAccount:{lexicon:1,id:"com.atproto.server.deleteAccount",defs:{main:{type:"procedure",description:"Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["did","password","token"],properties:{did:{type:"string",format:"did"},password:{type:"string"},token:{type:"string"}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"}]}}},ComAtprotoServerDeleteSession:{lexicon:1,id:"com.atproto.server.deleteSession",defs:{main:{type:"procedure",description:"Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt').",errors:[{name:"InvalidToken"},{name:"ExpiredToken"}]}}},ComAtprotoServerDescribeServer:{lexicon:1,id:"com.atproto.server.describeServer",defs:{main:{type:"query",description:"Describes the server's account creation requirements and capabilities. Implemented by PDS.",output:{encoding:"application/json",schema:{type:"object",required:["did","availableUserDomains"],properties:{inviteCodeRequired:{type:"boolean",description:"If true, an invite code must be supplied to create an account on this instance."},phoneVerificationRequired:{type:"boolean",description:"If true, a phone verification token must be supplied to create an account on this instance."},blobUploadLimit:{type:"integer",description:"Maximum size of a blob that can be uploaded via com.atproto.repo.uploadBlob, in bytes."},availableUserDomains:{type:"array",description:"List of domain suffixes that can be used in account handles.",items:{type:"string"}},links:{type:"ref",description:"URLs of service policy documents.",ref:"lex:com.atproto.server.describeServer#links"},contact:{type:"ref",description:"Contact information",ref:"lex:com.atproto.server.describeServer#contact"},did:{type:"string",format:"did"}}}}},links:{type:"object",properties:{privacyPolicy:{type:"string",format:"uri"},termsOfService:{type:"string",format:"uri"}}},contact:{type:"object",properties:{email:{type:"string"}}}}},ComAtprotoServerGetAccountInviteCodes:{lexicon:1,id:"com.atproto.server.getAccountInviteCodes",defs:{main:{type:"query",description:"Get all invite codes for the current account. Requires auth.",parameters:{type:"params",properties:{includeUsed:{type:"boolean",default:!0},createAvailable:{type:"boolean",default:!0,description:"Controls whether any new 'earned' but not 'created' invites should be created."}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}}}}},errors:[{name:"DuplicateCreate"}]}}},ComAtprotoServerGetServiceAuth:{lexicon:1,id:"com.atproto.server.getServiceAuth",defs:{main:{type:"query",description:"Get a signed token on behalf of the requesting DID for the requested service.",parameters:{type:"params",required:["aud"],properties:{aud:{type:"string",maxLength:2048,description:"The DID or `did#serviceId` reference of the service that the token will be used to authenticate with."},exp:{type:"integer",description:"The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope."},lxm:{type:"string",format:"nsid",description:"Lexicon (XRPC) method to bind the requested token to"}}},output:{encoding:"application/json",schema:{type:"object",required:["token"],properties:{token:{type:"string"}}}},errors:[{name:"BadExpiration",description:"Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes."}]}}},ComAtprotoServerGetSession:{lexicon:1,id:"com.atproto.server.getSession",defs:{main:{type:"query",description:"Get information about the current auth session. Requires auth.",output:{encoding:"application/json",schema:{type:"object",required:["handle","did"],properties:{handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown"},email:{type:"string"},emailConfirmed:{type:"boolean"},emailAuthFactor:{type:"boolean"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]}}}}}}},ComAtprotoServerListAppPasswords:{lexicon:1,id:"com.atproto.server.listAppPasswords",defs:{main:{type:"query",description:"List all App Passwords.",output:{encoding:"application/json",schema:{type:"object",required:["passwords"],properties:{passwords:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.listAppPasswords#appPassword"}}}}},errors:[{name:"AccountTakedown"}]},appPassword:{type:"object",required:["name","createdAt"],properties:{name:{type:"string"},createdAt:{type:"string",format:"datetime"},privileged:{type:"boolean"}}}}},ComAtprotoServerRefreshSession:{lexicon:1,id:"com.atproto.server.refreshSession",defs:{main:{type:"procedure",description:"Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').",output:{encoding:"application/json",schema:{type:"object",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown"},email:{type:"string"},emailConfirmed:{type:"boolean"},emailAuthFactor:{type:"boolean"},active:{type:"boolean"},status:{type:"string",description:"Hosting status of the account. If not specified, then assume 'active'.",knownValues:["takendown","suspended","deactivated"]}}}},errors:[{name:"AccountTakedown"},{name:"InvalidToken"},{name:"ExpiredToken"}]}}},ComAtprotoServerRequestAccountDelete:{lexicon:1,id:"com.atproto.server.requestAccountDelete",defs:{main:{type:"procedure",description:"Initiate a user account deletion via email."}}},ComAtprotoServerRequestEmailConfirmation:{lexicon:1,id:"com.atproto.server.requestEmailConfirmation",defs:{main:{type:"procedure",description:"Request an email with a code to confirm ownership of email."}}},ComAtprotoServerRequestEmailUpdate:{lexicon:1,id:"com.atproto.server.requestEmailUpdate",defs:{main:{type:"procedure",description:"Request a token in order to update email.",output:{encoding:"application/json",schema:{type:"object",required:["tokenRequired"],properties:{tokenRequired:{type:"boolean"}}}}}}},ComAtprotoServerRequestPasswordReset:{lexicon:1,id:"com.atproto.server.requestPasswordReset",defs:{main:{type:"procedure",description:"Initiate a user account password reset via email.",input:{encoding:"application/json",schema:{type:"object",required:["email"],properties:{email:{type:"string"}}}}}}},ComAtprotoServerReserveSigningKey:{lexicon:1,id:"com.atproto.server.reserveSigningKey",defs:{main:{type:"procedure",description:"Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.",input:{encoding:"application/json",schema:{type:"object",properties:{did:{type:"string",format:"did",description:"The DID to reserve a key for."}}}},output:{encoding:"application/json",schema:{type:"object",required:["signingKey"],properties:{signingKey:{type:"string",description:"The public key for the reserved signing key, in did:key serialization."}}}}}}},ComAtprotoServerResetPassword:{lexicon:1,id:"com.atproto.server.resetPassword",defs:{main:{type:"procedure",description:"Reset a user account password using a token.",input:{encoding:"application/json",schema:{type:"object",required:["token","password"],properties:{token:{type:"string"},password:{type:"string"}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"}]}}},ComAtprotoServerRevokeAppPassword:{lexicon:1,id:"com.atproto.server.revokeAppPassword",defs:{main:{type:"procedure",description:"Revoke an App Password by name.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string"}}}}}}},ComAtprotoServerUpdateEmail:{lexicon:1,id:"com.atproto.server.updateEmail",defs:{main:{type:"procedure",description:"Update an account's email.",input:{encoding:"application/json",schema:{type:"object",required:["email"],properties:{email:{type:"string"},emailAuthFactor:{type:"boolean"},token:{type:"string",description:"Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed."}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"},{name:"TokenRequired"}]}}},ComAtprotoSyncDefs:{lexicon:1,id:"com.atproto.sync.defs",defs:{hostStatus:{type:"string",knownValues:["active","idle","offline","throttled","banned"]}}},ComAtprotoSyncGetBlob:{lexicon:1,id:"com.atproto.sync.getBlob",defs:{main:{type:"query",description:"Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did","cid"],properties:{did:{type:"string",format:"did",description:"The DID of the account."},cid:{type:"string",format:"cid",description:"The CID of the blob to fetch"}}},output:{encoding:"*/*"},errors:[{name:"BlobNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetBlocks:{lexicon:1,id:"com.atproto.sync.getBlocks",defs:{main:{type:"query",description:"Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did","cids"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},cids:{type:"array",items:{type:"string",format:"cid"}}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"BlockNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetCheckout:{lexicon:1,id:"com.atproto.sync.getCheckout",defs:{main:{type:"query",description:"DEPRECATED - please use com.atproto.sync.getRepo instead",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/vnd.ipld.car"}}}},ComAtprotoSyncGetHead:{lexicon:1,id:"com.atproto.sync.getHead",defs:{main:{type:"query",description:"DEPRECATED - please use com.atproto.sync.getLatestCommit instead",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"cid"}}}},errors:[{name:"HeadNotFound"}]}}},ComAtprotoSyncGetHostStatus:{lexicon:1,id:"com.atproto.sync.getHostStatus",defs:{main:{type:"query",description:"Returns information about a specified upstream host, as consumed by the server. Implemented by relays.",parameters:{type:"params",required:["hostname"],properties:{hostname:{type:"string",description:"Hostname of the host (eg, PDS or relay) being queried."}}},output:{encoding:"application/json",schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string"},seq:{type:"integer",description:"Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)."},accountCount:{type:"integer",description:"Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts."},status:{type:"ref",ref:"lex:com.atproto.sync.defs#hostStatus"}}}},errors:[{name:"HostNotFound"}]}}},ComAtprotoSyncGetLatestCommit:{lexicon:1,id:"com.atproto.sync.getLatestCommit",defs:{main:{type:"query",description:"Get the current commit CID & revision of the specified repo. Does not require auth.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["cid","rev"],properties:{cid:{type:"string",format:"cid"},rev:{type:"string",format:"tid"}}}},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRecord:{lexicon:1,id:"com.atproto.sync.getRecord",defs:{main:{type:"query",description:"Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.",parameters:{type:"params",required:["did","collection","rkey"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},collection:{type:"string",format:"nsid"},rkey:{type:"string",description:"Record Key",format:"record-key"}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"RecordNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRepo:{lexicon:1,id:"com.atproto.sync.getRepo",defs:{main:{type:"query",description:"Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},since:{type:"string",format:"tid",description:"The revision ('rev') of the repo to create a diff from."}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRepoStatus:{lexicon:1,id:"com.atproto.sync.getRepoStatus",defs:{main:{type:"query",description:"Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["did","active"],properties:{did:{type:"string",format:"did"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deleted","deactivated","desynchronized","throttled"]},rev:{type:"string",format:"tid",description:"Optional field, the current rev of the repo, if active=true"}}}},errors:[{name:"RepoNotFound"}]}}},ComAtprotoSyncListBlobs:{lexicon:1,id:"com.atproto.sync.listBlobs",defs:{main:{type:"query",description:"List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},since:{type:"string",format:"tid",description:"Optional revision of the repo to list blobs since."},limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["cids"],properties:{cursor:{type:"string"},cids:{type:"array",items:{type:"string",format:"cid"}}}}},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncListHosts:{lexicon:1,id:"com.atproto.sync.listHosts",defs:{main:{type:"query",description:"Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:1e3,default:200},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["hosts"],properties:{cursor:{type:"string"},hosts:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.listHosts#host"},description:"Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first."}}}}},host:{type:"object",required:["hostname"],properties:{hostname:{type:"string",description:"hostname of server; not a URL (no scheme)"},seq:{type:"integer",description:"Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)."},accountCount:{type:"integer"},status:{type:"ref",ref:"lex:com.atproto.sync.defs#hostStatus"}}}}},ComAtprotoSyncListRepos:{lexicon:1,id:"com.atproto.sync.listRepos",defs:{main:{type:"query",description:"Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{cursor:{type:"string"},repos:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.listRepos#repo"}}}}}},repo:{type:"object",required:["did","head","rev"],properties:{did:{type:"string",format:"did"},head:{type:"string",format:"cid",description:"Current repo commit CID"},rev:{type:"string",format:"tid"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deleted","deactivated","desynchronized","throttled"]}}}}},ComAtprotoSyncListReposByCollection:{lexicon:1,id:"com.atproto.sync.listReposByCollection",defs:{main:{type:"query",description:"Enumerates all the DIDs which have records with the given collection NSID.",parameters:{type:"params",required:["collection"],properties:{collection:{type:"string",format:"nsid"},limit:{type:"integer",description:"Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.",minimum:1,maximum:2e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{cursor:{type:"string"},repos:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.listReposByCollection#repo"}}}}}},repo:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}}},ComAtprotoSyncNotifyOfUpdate:{lexicon:1,id:"com.atproto.sync.notifyOfUpdate",defs:{main:{type:"procedure",description:"Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl",input:{encoding:"application/json",schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string",description:"Hostname of the current service (usually a PDS) that is notifying of update."}}}}}}},ComAtprotoSyncRequestCrawl:{lexicon:1,id:"com.atproto.sync.requestCrawl",defs:{main:{type:"procedure",description:"Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.",input:{encoding:"application/json",schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string",description:"Hostname of the current service (eg, PDS) that is requesting to be crawled."}}}},errors:[{name:"HostBanned"}]}}},ComAtprotoSyncSubscribeRepos:{lexicon:1,id:"com.atproto.sync.subscribeRepos",defs:{main:{type:"subscription",description:"Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.",parameters:{type:"params",properties:{cursor:{type:"integer",description:"The last known event seq number to backfill from."}}},message:{schema:{type:"union",refs:["lex:com.atproto.sync.subscribeRepos#commit","lex:com.atproto.sync.subscribeRepos#sync","lex:com.atproto.sync.subscribeRepos#identity","lex:com.atproto.sync.subscribeRepos#account","lex:com.atproto.sync.subscribeRepos#info"]}},errors:[{name:"FutureCursor"},{name:"ConsumerTooSlow",description:"If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."}]},commit:{type:"object",description:"Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.",required:["seq","rebase","tooBig","repo","commit","rev","since","blocks","ops","blobs","time"],nullable:["since"],properties:{seq:{type:"integer",description:"The stream sequence number of this message."},rebase:{type:"boolean",description:"DEPRECATED -- unused"},tooBig:{type:"boolean",description:"DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data."},repo:{type:"string",format:"did",description:"The repo this event comes from. Note that all other message types name this field 'did'."},commit:{type:"cid-link",description:"Repo commit object CID."},rev:{type:"string",format:"tid",description:"The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event."},since:{type:"string",format:"tid",description:"The rev of the last emitted commit from this repo (if any)."},blocks:{type:"bytes",description:"CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.",maxLength:2e6},ops:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.subscribeRepos#repoOp",description:"List of repo mutation operations in this commit (eg, records created, updated, or deleted)."},maxLength:200},blobs:{type:"array",items:{type:"cid-link",description:"DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit."}},prevData:{type:"cid-link",description:"The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose."},time:{type:"string",format:"datetime",description:"Timestamp of when this message was originally broadcast."}}},sync:{type:"object",description:"Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.",required:["seq","did","blocks","rev","time"],properties:{seq:{type:"integer",description:"The stream sequence number of this message."},did:{type:"string",format:"did",description:"The account this repo event corresponds to. Must match that in the commit object."},blocks:{type:"bytes",description:"CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.",maxLength:1e4},rev:{type:"string",description:"The rev of the commit. This value must match that in the commit object."},time:{type:"string",format:"datetime",description:"Timestamp of when this message was originally broadcast."}}},identity:{type:"object",description:"Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.",required:["seq","did","time"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},time:{type:"string",format:"datetime"},handle:{type:"string",format:"handle",description:"The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details."}}},account:{type:"object",description:"Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.",required:["seq","did","time","active"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},time:{type:"string",format:"datetime"},active:{type:"boolean",description:"Indicates that the account has a repository which can be fetched from the host that emitted this event."},status:{type:"string",description:"If active=false, this optional field indicates a reason for why the account is not active.",knownValues:["takendown","suspended","deleted","deactivated","desynchronized","throttled"]}}},info:{type:"object",required:["name"],properties:{name:{type:"string",knownValues:["OutdatedCursor"]},message:{type:"string"}}},repoOp:{type:"object",description:"A repo operation, ie a mutation of a single record.",required:["action","path","cid"],nullable:["cid"],properties:{action:{type:"string",knownValues:["create","update","delete"]},path:{type:"string"},cid:{type:"cid-link",description:"For creates and updates, the new record CID. For deletions, null."},prev:{type:"cid-link",description:"For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined."}}}}},ComAtprotoTempAddReservedHandle:{lexicon:1,id:"com.atproto.temp.addReservedHandle",defs:{main:{type:"procedure",description:"Add a handle to the set of reserved handles.",input:{encoding:"application/json",schema:{type:"object",required:["handle"],properties:{handle:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},ComAtprotoTempCheckHandleAvailability:{lexicon:1,id:"com.atproto.temp.checkHandleAvailability",defs:{main:{type:"query",description:"Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions.",parameters:{type:"params",required:["handle"],properties:{handle:{type:"string",format:"handle",description:"Tentative handle. Will be checked for availability or used to build handle suggestions."},email:{type:"string",description:"User-provided email. Might be used to build handle suggestions."},birthDate:{type:"string",format:"datetime",description:"User-provided birth date. Might be used to build handle suggestions."}}},output:{encoding:"application/json",schema:{type:"object",required:["handle","result"],properties:{handle:{type:"string",format:"handle",description:"Echo of the input handle."},result:{type:"union",refs:["lex:com.atproto.temp.checkHandleAvailability#resultAvailable","lex:com.atproto.temp.checkHandleAvailability#resultUnavailable"]}}}},errors:[{name:"InvalidEmail",description:"An invalid email was provided."}]},resultAvailable:{type:"object",description:"Indicates the provided handle is available.",properties:{}},resultUnavailable:{type:"object",description:"Indicates the provided handle is unavailable and gives suggestions of available handles.",required:["suggestions"],properties:{suggestions:{type:"array",description:"List of suggested handles based on the provided inputs.",items:{type:"ref",ref:"lex:com.atproto.temp.checkHandleAvailability#suggestion"}}}},suggestion:{type:"object",required:["handle","method"],properties:{handle:{type:"string",format:"handle"},method:{type:"string",description:"Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics."}}}}},ComAtprotoTempCheckSignupQueue:{lexicon:1,id:"com.atproto.temp.checkSignupQueue",defs:{main:{type:"query",description:"Check accounts location in signup queue.",output:{encoding:"application/json",schema:{type:"object",required:["activated"],properties:{activated:{type:"boolean"},placeInQueue:{type:"integer"},estimatedTimeMs:{type:"integer"}}}}}}},ComAtprotoTempDereferenceScope:{lexicon:1,id:"com.atproto.temp.dereferenceScope",defs:{main:{type:"query",description:"Allows finding the oauth permission scope from a reference",parameters:{type:"params",required:["scope"],properties:{scope:{type:"string",description:"The scope reference (starts with 'ref:')"}}},output:{encoding:"application/json",schema:{type:"object",required:["scope"],properties:{scope:{type:"string",description:"The full oauth permission scope"}}}},errors:[{name:"InvalidScopeReference",description:"An invalid scope reference was provided."}]}}},ComAtprotoTempFetchLabels:{lexicon:1,id:"com.atproto.temp.fetchLabels",defs:{main:{type:"query",description:"DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date.",parameters:{type:"params",properties:{since:{type:"integer"},limit:{type:"integer",minimum:1,maximum:250,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["labels"],properties:{labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}}}},ComAtprotoTempRequestPhoneVerification:{lexicon:1,id:"com.atproto.temp.requestPhoneVerification",defs:{main:{type:"procedure",description:"Request a verification code to be sent to the supplied phone number",input:{encoding:"application/json",schema:{type:"object",required:["phoneNumber"],properties:{phoneNumber:{type:"string"}}}}}}},ComAtprotoTempRevokeAccountCredentials:{lexicon:1,id:"com.atproto.temp.revokeAccountCredentials",defs:{main:{type:"procedure",description:"Revoke sessions, password, and app passwords associated with account. May be resolved by a password reset.",input:{encoding:"application/json",schema:{type:"object",required:["account"],properties:{account:{type:"string",format:"at-identifier"}}}}}}},ComGermnetworkDeclaration:{lexicon:1,id:"com.germnetwork.declaration",defs:{main:{type:"record",description:"A declaration of a Germ Network account",key:"literal:self",record:{type:"object",required:["version","currentKey"],properties:{version:{type:"string",description:"Semver version number, without pre-release or build information, for the format of opaque content",minLength:5,maxLength:14},currentKey:{type:"bytes",description:"Opaque value, an ed25519 public key prefixed with a byte enum"},messageMe:{type:"ref",description:"Controls who can message this account",ref:"lex:com.germnetwork.declaration#messageMe"},keyPackage:{type:"bytes",description:"Opaque value, contains MLS KeyPackage(s), and other signature data, and is signed by the currentKey"},continuityProofs:{type:"array",description:"Array of opaque values to allow for key rolling",items:{type:"bytes"},maxLength:1e3}}}},messageMe:{type:"object",required:["showButtonTo","messageMeUrl"],properties:{messageMeUrl:{type:"string",description:"A URL to present to an account that does not have its own com.germnetwork.declaration record, must have an empty fragment component, where the app should fill in the fragment component with the DIDs of the two accounts who wish to message each other",format:"uri",minLength:1,maxLength:2047},showButtonTo:{type:"string",knownValues:["none","usersIFollow","everyone"],description:"The policy of who can message the account, this value is included in the keyPackage, but is duplicated here to allow applications to decide if they should show a 'Message on Germ' button to the viewer.",minLength:1,maxLength:100}}}}},ToolsOzoneCommunicationCreateTemplate:{lexicon:1,id:"tools.ozone.communication.createTemplate",defs:{main:{type:"procedure",description:"Administrative action to create a new, re-usable communication (email for now) template.",input:{encoding:"application/json",schema:{type:"object",required:["subject","contentMarkdown","name"],properties:{name:{type:"string",description:"Name of the template."},contentMarkdown:{type:"string",description:"Content of the template, markdown supported, can contain variable placeholders."},subject:{type:"string",description:"Subject of the message, used in emails."},lang:{type:"string",format:"language",description:"Message language."},createdBy:{type:"string",format:"did",description:"DID of the user who is creating the template."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}},errors:[{name:"DuplicateTemplateName"}]}}},ToolsOzoneCommunicationDefs:{lexicon:1,id:"tools.ozone.communication.defs",defs:{templateView:{type:"object",required:["id","name","contentMarkdown","disabled","lastUpdatedBy","createdAt","updatedAt"],properties:{id:{type:"string"},name:{type:"string",description:"Name of the template."},subject:{type:"string",description:"Content of the template, can contain markdown and variable placeholders."},contentMarkdown:{type:"string",description:"Subject of the message, used in emails."},disabled:{type:"boolean"},lang:{type:"string",format:"language",description:"Message language."},lastUpdatedBy:{type:"string",format:"did",description:"DID of the user who last updated the template."},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"}}}}},ToolsOzoneCommunicationDeleteTemplate:{lexicon:1,id:"tools.ozone.communication.deleteTemplate",defs:{main:{type:"procedure",description:"Delete a communication template.",input:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string"}}}}}}},ToolsOzoneCommunicationListTemplates:{lexicon:1,id:"tools.ozone.communication.listTemplates",defs:{main:{type:"query",description:"Get list of all communication templates.",output:{encoding:"application/json",schema:{type:"object",required:["communicationTemplates"],properties:{communicationTemplates:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}}}}}}}},ToolsOzoneCommunicationUpdateTemplate:{lexicon:1,id:"tools.ozone.communication.updateTemplate",defs:{main:{type:"procedure",description:"Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.",input:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string",description:"ID of the template to be updated."},name:{type:"string",description:"Name of the template."},lang:{type:"string",format:"language",description:"Message language."},contentMarkdown:{type:"string",description:"Content of the template, markdown supported, can contain variable placeholders."},subject:{type:"string",description:"Subject of the message, used in emails."},updatedBy:{type:"string",format:"did",description:"DID of the user who is updating the template."},disabled:{type:"boolean"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}},errors:[{name:"DuplicateTemplateName"}]}}},ToolsOzoneHostingGetAccountHistory:{lexicon:1,id:"tools.ozone.hosting.getAccountHistory",defs:{main:{type:"query",description:"Get account history, e.g. log of updated email addresses or other identity information.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"},events:{type:"array",items:{type:"string",knownValues:["accountCreated","emailUpdated","emailConfirmed","passwordUpdated","handleUpdated"]}},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["events"],properties:{cursor:{type:"string"},events:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.hosting.getAccountHistory#event"}}}}}},event:{type:"object",required:["details","createdBy","createdAt"],properties:{details:{type:"union",refs:["lex:tools.ozone.hosting.getAccountHistory#accountCreated","lex:tools.ozone.hosting.getAccountHistory#emailUpdated","lex:tools.ozone.hosting.getAccountHistory#emailConfirmed","lex:tools.ozone.hosting.getAccountHistory#passwordUpdated","lex:tools.ozone.hosting.getAccountHistory#handleUpdated"]},createdBy:{type:"string"},createdAt:{type:"string",format:"datetime"}}},accountCreated:{type:"object",required:[],properties:{email:{type:"string"},handle:{type:"string",format:"handle"}}},emailUpdated:{type:"object",required:["email"],properties:{email:{type:"string"}}},emailConfirmed:{type:"object",required:["email"],properties:{email:{type:"string"}}},passwordUpdated:{type:"object",required:[],properties:{}},handleUpdated:{type:"object",required:["handle"],properties:{handle:{type:"string",format:"handle"}}}}},ToolsOzoneInboxAppealActionedSubject:{lexicon:1,id:"tools.ozone.inbox.appealActionedSubject",defs:{main:{type:"procedure",description:"Appeal a moderation action affecting the user's account or content.",input:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{action:{type:"union",refs:["lex:tools.ozone.inbox.appealActionedSubject#actionRef","lex:tools.ozone.inbox.appealActionedSubject#labelRef","lex:tools.ozone.inbox.appealActionedSubject#takedownRef"],closed:!0,description:"Moderation action being appealed."},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"],description:"Subject being appealed."},reason:{type:"string",maxGraphemes:2e3,maxLength:2e4,description:"Optional explanation supplied by the user."},modTool:{type:"ref",ref:"lex:com.atproto.moderation.createReport#modTool"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.inbox.defs#subjectView"}},errors:[{name:"InvalidAppealSubject",description:"Invalid appeal subject input."},{name:"AlreadyAppealed",description:"An active appeal already exists for this action."},{name:"NotAppealable",description:"The subject cannot be appealed."},{name:"AppealWindowExpired",description:"The appeal window for this action has closed."}]},actionRef:{type:"object",required:["id"],properties:{id:{type:"integer",minimum:1,description:"ID of the moderation action being appealed, available via actions in mod inbox."}}},labelRef:{type:"object",required:["val"],properties:{val:{type:"string",minLength:1,description:"Label being appealed."}}},takedownRef:{type:"object",properties:{}}}},ToolsOzoneInboxDefs:{lexicon:1,id:"tools.ozone.inbox.defs",defs:{subjectView:{type:"object",description:"A subject belonging to the viewer that has moderation actions against it.",required:["src","subject","enforcement","createdAt","updatedAt"],properties:{src:{type:"string",format:"did",description:"DID of the moderation service that took the actions."},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},enforcement:{type:"ref",ref:"lex:tools.ozone.inbox.defs#enforcementView"},appeal:{type:"ref",ref:"lex:tools.ozone.inbox.defs#appealView"},availableActions:{type:"array",items:{type:"string",knownValues:["appeal"]}},latestAction:{type:"ref",ref:"lex:tools.ozone.inbox.defs#actionView"},actionCount:{type:"integer"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"}}},enforcementView:{type:"object",description:"The current enforcement state of a subject.",required:["state"],properties:{state:{type:"string",knownValues:["none","labeled","removed","suspended","takendown"]},scope:{type:"string",knownValues:["network","app","labelOnly"]},expiresAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"string"},description:"Active label values on the subject, excluding negated and expired labels."}}},appealView:{type:"object",description:"The state of the viewer's appeal against the actions on a subject.",required:["state"],properties:{state:{type:"string",knownValues:["none","pending","resolved","superseded","expired"]},appealedAt:{type:"string",format:"datetime"},resolvedAt:{type:"string",format:"datetime",description:"When the appeal's report was closed."},note:{type:"string",description:"Moderator explanation, from the publicNote on the closing activity. Absent if none was written."},appealableUntil:{type:"string",format:"datetime"}}},actionView:{type:"object",description:"A single moderation action taken against a subject.",required:["id","type","createdAt"],properties:{id:{type:"integer",description:"Action ID (moderation event ID)."},type:{type:"string",description:"Public action type."},scope:{type:"string",knownValues:["network","app","labelOnly"]},createdAt:{type:"string",format:"datetime"},reversedAt:{type:"string",format:"datetime"},expiresAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"string"},description:"Label values, for labelApplied/labelRemoved."},policies:{type:"array",items:{type:"string"},description:"Policies that were applied in this action."}}}}},ToolsOzoneModerationCancelScheduledActions:{lexicon:1,id:"tools.ozone.moderation.cancelScheduledActions",defs:{main:{type:"procedure",description:"Cancel all pending scheduled moderation actions for specified subjects",input:{encoding:"application/json",schema:{type:"object",required:["subjects"],properties:{subjects:{type:"array",maxLength:100,items:{type:"string",format:"did"},description:"Array of DID subjects to cancel scheduled actions for"},comment:{type:"string",description:"Optional comment describing the reason for cancellation"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.cancelScheduledActions#cancellationResults"}}},cancellationResults:{type:"object",required:["succeeded","failed"],properties:{succeeded:{type:"array",items:{type:"string",format:"did"},description:"DIDs for which all pending scheduled actions were successfully cancelled"},failed:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.cancelScheduledActions#failedCancellation"},description:"DIDs for which cancellation failed with error details"}}},failedCancellation:{type:"object",required:["did","error"],properties:{did:{type:"string",format:"did"},error:{type:"string"},errorCode:{type:"string"}}}}},ToolsOzoneModerationDefs:{lexicon:1,id:"tools.ozone.moderation.defs",defs:{modEventView:{type:"object",required:["id","event","subject","subjectBlobCids","createdBy","createdAt"],properties:{id:{type:"integer"},event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventDivert","lex:tools.ozone.moderation.defs#modEventTag","lex:tools.ozone.moderation.defs#accountEvent","lex:tools.ozone.moderation.defs#identityEvent","lex:tools.ozone.moderation.defs#recordEvent","lex:tools.ozone.moderation.defs#modEventPriorityScore","lex:tools.ozone.moderation.defs#ageAssuranceEvent","lex:tools.ozone.moderation.defs#ageAssuranceOverrideEvent","lex:tools.ozone.moderation.defs#ageAssurancePurgeEvent","lex:tools.ozone.moderation.defs#revokeAccountCredentialsEvent","lex:tools.ozone.moderation.defs#scheduleTakedownEvent","lex:tools.ozone.moderation.defs#cancelScheduledTakedownEvent"]},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:chat.bsky.convo.defs#messageRef","lex:chat.bsky.convo.defs#convoRef"]},subjectBlobCids:{type:"array",items:{type:"string"}},createdBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"},creatorHandle:{type:"string"},subjectHandle:{type:"string"},modTool:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modTool"}}},modEventViewDetail:{type:"object",required:["id","event","subject","subjectBlobs","createdBy","createdAt"],properties:{id:{type:"integer"},event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventDivert","lex:tools.ozone.moderation.defs#modEventTag","lex:tools.ozone.moderation.defs#accountEvent","lex:tools.ozone.moderation.defs#identityEvent","lex:tools.ozone.moderation.defs#recordEvent","lex:tools.ozone.moderation.defs#modEventPriorityScore","lex:tools.ozone.moderation.defs#ageAssuranceEvent","lex:tools.ozone.moderation.defs#ageAssuranceOverrideEvent","lex:tools.ozone.moderation.defs#ageAssurancePurgeEvent","lex:tools.ozone.moderation.defs#revokeAccountCredentialsEvent","lex:tools.ozone.moderation.defs#scheduleTakedownEvent","lex:tools.ozone.moderation.defs#cancelScheduledTakedownEvent"]},subject:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoView","lex:tools.ozone.moderation.defs#repoViewNotFound","lex:tools.ozone.moderation.defs#recordView","lex:tools.ozone.moderation.defs#recordViewNotFound","lex:tools.ozone.moderation.defs#convoView"]},subjectBlobs:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#blobView"}},createdBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"},modTool:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modTool"}}},subjectStatusView:{type:"object",required:["id","subject","createdAt","updatedAt","reviewState"],properties:{id:{type:"integer"},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:chat.bsky.convo.defs#messageRef","lex:chat.bsky.convo.defs#convoRef"]},hosting:{type:"union",refs:["lex:tools.ozone.moderation.defs#accountHosting","lex:tools.ozone.moderation.defs#recordHosting"]},subjectBlobCids:{type:"array",items:{type:"string",format:"cid"}},subjectRepoHandle:{type:"string"},updatedAt:{type:"string",format:"datetime",description:"Timestamp referencing when the last update was made to the moderation status of the subject"},createdAt:{type:"string",format:"datetime",description:"Timestamp referencing the first moderation status impacting event was emitted on the subject"},reviewState:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectReviewState"},comment:{type:"string",description:"Sticky comment on the subject."},priorityScore:{type:"integer",description:"Numeric value representing the level of priority. Higher score means higher priority.",minimum:0,maximum:100},muteUntil:{type:"string",format:"datetime"},muteReportingUntil:{type:"string",format:"datetime"},lastReviewedBy:{type:"string",format:"did"},lastReviewedAt:{type:"string",format:"datetime"},lastReportedAt:{type:"string",format:"datetime"},lastAppealedAt:{type:"string",format:"datetime",description:"Timestamp referencing when the author of the subject appealed a moderation action"},takendown:{type:"boolean"},appealed:{type:"boolean",description:"True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators."},suspendUntil:{type:"string",format:"datetime"},tags:{type:"array",items:{type:"string"}},accountStats:{description:"Statistics related to the account subject",type:"ref",ref:"lex:tools.ozone.moderation.defs#accountStats"},recordsStats:{description:"Statistics related to the record subjects authored by the subject's account",type:"ref",ref:"lex:tools.ozone.moderation.defs#recordsStats"},accountStrike:{description:"Strike information for the account (account-level only)",type:"ref",ref:"lex:tools.ozone.moderation.defs#accountStrike"},ageAssuranceState:{type:"string",description:"Current age assurance state of the subject.",knownValues:["pending","assured","unknown","reset","blocked"]},ageAssuranceUpdatedBy:{type:"string",description:"Whether or not the last successful update to age assurance was made by the user or admin.",knownValues:["admin","user"]}}},subjectView:{description:"Detailed view of a subject. For record subjects, the author's repo and profile will be returned.",type:"object",required:["type","subject"],properties:{type:{type:"ref",ref:"lex:com.atproto.moderation.defs#subjectType"},subject:{type:"string"},status:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"},repo:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoViewDetail"},profile:{type:"union",refs:[]},record:{type:"ref",ref:"lex:tools.ozone.moderation.defs#recordViewDetail"}}},accountStats:{description:"Statistics about a particular account subject",type:"object",properties:{reportCount:{description:"Total number of reports on the account",type:"integer"},appealCount:{description:"Total number of appeals against a moderation action on the account",type:"integer"},suspendCount:{description:"Number of times the account was suspended",type:"integer"},escalateCount:{description:"Number of times the account was escalated",type:"integer"},takedownCount:{description:"Number of times the account was taken down",type:"integer"}}},recordsStats:{description:"Statistics about a set of record subject items",type:"object",properties:{totalReports:{description:"Cumulative sum of the number of reports on the items in the set",type:"integer"},reportedCount:{description:"Number of items that were reported at least once",type:"integer"},escalatedCount:{description:"Number of items that were escalated at least once",type:"integer"},appealedCount:{description:"Number of items that were appealed at least once",type:"integer"},subjectCount:{description:"Total number of item in the set",type:"integer"},pendingCount:{description:'Number of item currently in "reviewOpen" or "reviewEscalated" state',type:"integer"},processedCount:{description:'Number of item currently in "reviewNone" or "reviewClosed" state',type:"integer"},takendownCount:{description:"Number of item currently taken down",type:"integer"}}},accountStrike:{description:"Strike information for an account",type:"object",properties:{activeStrikeCount:{description:"Current number of active strikes (excluding expired strikes)",type:"integer"},totalStrikeCount:{description:"Total number of strikes ever received (including expired strikes)",type:"integer"},firstStrikeAt:{description:"Timestamp of the first strike received",type:"string",format:"datetime"},lastStrikeAt:{description:"Timestamp of the most recent strike received",type:"string",format:"datetime"}}},subjectReviewState:{type:"string",knownValues:["tools.ozone.moderation.defs#reviewOpen","tools.ozone.moderation.defs#reviewEscalated","tools.ozone.moderation.defs#reviewClosed","tools.ozone.moderation.defs#reviewNone"]},reviewOpen:{type:"token",description:"Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator"},reviewEscalated:{type:"token",description:"Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator"},reviewClosed:{type:"token",description:"Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator"},reviewNone:{type:"token",description:"Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it"},modEventTakedown:{type:"object",description:"Take down a subject permanently or temporarily",properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the takedown should be in effect before automatically expiring."},acknowledgeAccountSubjects:{type:"boolean",description:"If true, all other reports on content authored by this account will be resolved (acknowledged)."},policies:{type:"array",maxLength:5,items:{type:"string"},description:"Names/Keywords of the policies that drove the decision."},severityLevel:{type:"string",description:"Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)."},targetServices:{type:"array",items:{type:"string",knownValues:["appview","pds"]},description:"List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services."},strikeCount:{type:"integer",description:"Number of strikes to assign to the user for this violation."},strikeExpiresAt:{type:"string",format:"datetime",description:"When the strike should expire. If not provided, the strike never expires."}}},modEventReverseTakedown:{type:"object",description:"Revert take down action on a subject",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."},policies:{type:"array",maxLength:5,items:{type:"string"},description:"Names/Keywords of the policy infraction for which takedown is being reversed."},severityLevel:{type:"string",description:"Severity level of the violation. Usually set from the last policy infraction's severity."},strikeCount:{type:"integer",description:"Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity."}}},modEventResolveAppeal:{type:"object",description:"Resolve appeal on a subject",properties:{comment:{type:"string",description:"Describe resolution."}}},modEventComment:{type:"object",description:"Add a comment to a subject. An empty comment will clear any previously set sticky comment.",properties:{comment:{type:"string"},sticky:{type:"boolean",description:"Make the comment persistent on the subject"}}},modEventReport:{type:"object",description:"Report a subject",required:["reportType"],properties:{comment:{type:"string"},isReporterMuted:{type:"boolean",description:"Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject."},reportType:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"}}},modEventLabel:{type:"object",description:"Apply/Negate labels on a subject",required:["createLabelVals","negateLabelVals"],properties:{comment:{type:"string"},createLabelVals:{type:"array",items:{type:"string"}},negateLabelVals:{type:"array",items:{type:"string"}},durationInHours:{type:"integer",description:"Indicates how long the label will remain on the subject. Only applies on labels that are being added."}}},modEventPriorityScore:{type:"object",description:"Set priority score of the subject. Higher score means higher priority.",required:["score"],properties:{comment:{type:"string"},score:{type:"integer",minimum:0,maximum:100}}},ageAssuranceEvent:{type:"object",description:"Age assurance info coming directly from users. Only works on DID subjects.",required:["createdAt","status","attemptId"],properties:{createdAt:{type:"string",format:"datetime",description:"The date and time of this write operation."},attemptId:{type:"string",description:"The unique identifier for this instance of the age assurance flow, in UUID format."},status:{type:"string",description:"The status of the Age Assurance process.",knownValues:["unknown","pending","assured"]},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"},countryCode:{type:"string",description:"The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow."},regionCode:{type:"string",description:"The ISO 3166-2 region code provided when beginning the Age Assurance flow."},initIp:{type:"string",description:"The IP address used when initiating the AA flow."},initUa:{type:"string",description:"The user agent used when initiating the AA flow."},completeIp:{type:"string",description:"The IP address used when completing the AA flow."},completeUa:{type:"string",description:"The user agent used when completing the AA flow."}}},ageAssuranceOverrideEvent:{type:"object",description:"Age assurance status override by moderators. Only works on DID subjects.",required:["comment","status"],properties:{status:{type:"string",description:"The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.",knownValues:["assured","reset","blocked"]},access:{type:"ref",ref:"lex:app.bsky.ageassurance.defs#access"},comment:{type:"string",minLength:1,description:"Comment describing the reason for the override."}}},ageAssurancePurgeEvent:{type:"object",description:"Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only.",required:["comment"],properties:{comment:{type:"string",minLength:1,description:"Comment describing the reason for the purge."}}},revokeAccountCredentialsEvent:{type:"object",description:"Account credentials revocation by moderators. Only works on DID subjects.",required:["comment"],properties:{comment:{minLength:1,type:"string",description:"Comment describing the reason for the revocation."}}},modEventAcknowledge:{type:"object",properties:{comment:{type:"string"},acknowledgeAccountSubjects:{type:"boolean",description:"If true, all other reports on content authored by this account will be resolved (acknowledged)."}}},modEventEscalate:{type:"object",properties:{comment:{type:"string"}}},modEventMute:{type:"object",description:"Mute incoming reports on a subject",required:["durationInHours"],properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the subject should remain muted."}}},modEventUnmute:{type:"object",description:"Unmute action on a subject",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."}}},modEventMuteReporter:{type:"object",description:"Mute incoming reports from an account",properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the account should remain muted. Falsy value here means a permanent mute."}}},modEventUnmuteReporter:{type:"object",description:"Unmute incoming reports from an account",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."}}},modEventEmail:{type:"object",description:"Keep a log of outgoing email to a user",required:["subjectLine"],properties:{subjectLine:{type:"string",description:"The subject line of the email sent to the user."},content:{type:"string",description:"The content of the email sent to the user."},comment:{type:"string",description:"Additional comment about the outgoing comm."},policies:{type:"array",maxLength:5,items:{type:"string"},description:"Names/Keywords of the policies that necessitated the email."},severityLevel:{type:"string",description:"Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense"},strikeCount:{type:"integer",description:"Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense."},strikeExpiresAt:{type:"string",format:"datetime",description:"When the strike should expire. If not provided, the strike never expires."},isDelivered:{type:"boolean",description:"Indicates whether the email was successfully delivered to the user's inbox."}}},modEventDivert:{type:"object",description:"Divert a record's blobs to a 3rd party service for further scanning/tagging",properties:{comment:{type:"string"}}},modEventTag:{type:"object",description:"Add/Remove a tag on a subject",required:["add","remove"],properties:{add:{type:"array",items:{type:"string"},description:"Tags to be added to the subject. If already exists, won't be duplicated."},remove:{type:"array",items:{type:"string"},description:"Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated."},comment:{type:"string",description:"Additional comment about added/removed tags."},durationInHours:{type:"integer",description:"Indicates how long the tags being added should remain before automatically being removed. Only applies to tags being added."}}},accountEvent:{type:"object",description:"Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",required:["timestamp","active"],properties:{comment:{type:"string"},active:{type:"boolean",description:"Indicates that the account has a repository which can be fetched from the host that emitted this event."},status:{type:"string",knownValues:["unknown","deactivated","deleted","takendown","suspended","tombstoned"]},timestamp:{type:"string",format:"datetime"}}},identityEvent:{type:"object",description:"Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",required:["timestamp"],properties:{comment:{type:"string"},handle:{type:"string",format:"handle"},pdsHost:{type:"string",format:"uri"},tombstone:{type:"boolean"},timestamp:{type:"string",format:"datetime"}}},recordEvent:{type:"object",description:"Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",required:["timestamp","op"],properties:{comment:{type:"string"},op:{type:"string",knownValues:["create","update","delete"]},cid:{type:"string",format:"cid"},timestamp:{type:"string",format:"datetime"}}},scheduleTakedownEvent:{type:"object",description:"Logs a scheduled takedown action for an account.",properties:{comment:{type:"string"},executeAt:{type:"string",format:"datetime"},executeAfter:{type:"string",format:"datetime"},executeUntil:{type:"string",format:"datetime"}}},cancelScheduledTakedownEvent:{type:"object",description:"Logs cancellation of a scheduled takedown action for an account.",properties:{comment:{type:"string"}}},repoView:{type:"object",required:["did","handle","relatedRecords","indexedAt","moderation"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invitesDisabled:{type:"boolean"},inviteNote:{type:"string"},deactivatedAt:{type:"string",format:"datetime"},threatSignatures:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#threatSignature"}}}},repoViewDetail:{type:"object",required:["did","handle","relatedRecords","indexedAt","moderation"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderationDetail"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invites:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}},invitesDisabled:{type:"boolean"},inviteNote:{type:"string"},emailConfirmedAt:{type:"string",format:"datetime"},deactivatedAt:{type:"string",format:"datetime"},threatSignatures:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#threatSignature"}}}},repoViewNotFound:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},recordView:{type:"object",required:["uri","cid","value","blobCids","indexedAt","moderation","repo"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"},blobCids:{type:"array",items:{type:"string",format:"cid"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"},repo:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}},recordViewDetail:{type:"object",required:["uri","cid","value","blobs","indexedAt","moderation","repo"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"},blobs:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#blobView"}},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderationDetail"},repo:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}},recordViewNotFound:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},convoView:{type:"object",required:["did","convoId"],properties:{did:{type:"string",format:"did"},convoId:{type:"string"}}},moderation:{type:"object",properties:{subjectStatus:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}},moderationDetail:{type:"object",properties:{subjectStatus:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}},blobView:{type:"object",required:["cid","mimeType","size","createdAt"],properties:{cid:{type:"string",format:"cid"},mimeType:{type:"string"},size:{type:"integer"},createdAt:{type:"string",format:"datetime"},details:{type:"union",refs:["lex:tools.ozone.moderation.defs#imageDetails","lex:tools.ozone.moderation.defs#videoDetails"]},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"}}},imageDetails:{type:"object",required:["width","height"],properties:{width:{type:"integer"},height:{type:"integer"}}},videoDetails:{type:"object",required:["width","height","length"],properties:{width:{type:"integer"},height:{type:"integer"},length:{type:"integer"}}},accountHosting:{type:"object",required:["status"],properties:{status:{type:"string",knownValues:["takendown","suspended","deleted","deactivated","unknown"]},updatedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},deletedAt:{type:"string",format:"datetime"},deactivatedAt:{type:"string",format:"datetime"},reactivatedAt:{type:"string",format:"datetime"}}},recordHosting:{type:"object",required:["status"],properties:{status:{type:"string",knownValues:["deleted","unknown"]},updatedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},deletedAt:{type:"string",format:"datetime"}}},reporterStats:{type:"object",required:["did","accountReportCount","recordReportCount","reportedAccountCount","reportedRecordCount","takendownAccountCount","takendownRecordCount","labeledAccountCount","labeledRecordCount"],properties:{did:{type:"string",format:"did"},accountReportCount:{type:"integer",description:"The total number of reports made by the user on accounts."},recordReportCount:{type:"integer",description:"The total number of reports made by the user on records."},reportedAccountCount:{type:"integer",description:"The total number of accounts reported by the user."},reportedRecordCount:{type:"integer",description:"The total number of records reported by the user."},takendownAccountCount:{type:"integer",description:"The total number of accounts taken down as a result of the user's reports."},takendownRecordCount:{type:"integer",description:"The total number of records taken down as a result of the user's reports."},labeledAccountCount:{type:"integer",description:"The total number of accounts labeled as a result of the user's reports."},labeledRecordCount:{type:"integer",description:"The total number of records labeled as a result of the user's reports."}}},modTool:{type:"object",description:"Moderation tool information for tracing the source of the action",required:["name"],properties:{name:{type:"string",description:"Name/identifier of the source (e.g., 'automod', 'ozone/workspace')"},meta:{type:"unknown",description:"Additional arbitrary metadata about the source"}}},timelineEventPlcCreate:{type:"token",description:"Moderation event timeline event for a PLC create operation"},timelineEventPlcOperation:{type:"token",description:"Moderation event timeline event for generic PLC operation"},timelineEventPlcTombstone:{type:"token",description:"Moderation event timeline event for a PLC tombstone operation"},scheduledActionView:{type:"object",description:"View of a scheduled moderation action",required:["id","action","did","createdBy","createdAt","status"],properties:{id:{type:"integer",description:"Auto-incrementing row ID"},action:{type:"string",knownValues:["takedown"],description:"Type of action to be executed"},eventData:{type:"unknown",description:"Serialized event object that will be propagated to the event when performed"},did:{type:"string",format:"did",description:"Subject DID for the action"},executeAt:{type:"string",format:"datetime",description:"Exact time to execute the action"},executeAfter:{type:"string",format:"datetime",description:"Earliest time to execute the action (for randomized scheduling)"},executeUntil:{type:"string",format:"datetime",description:"Latest time to execute the action (for randomized scheduling)"},randomizeExecution:{type:"boolean",description:"Whether execution time should be randomized within the specified range"},createdBy:{type:"string",format:"did",description:"DID of the user who created this scheduled action"},createdAt:{type:"string",format:"datetime",description:"When the scheduled action was created"},updatedAt:{type:"string",format:"datetime",description:"When the scheduled action was last updated"},status:{type:"string",knownValues:["pending","executed","cancelled","failed"],description:"Current status of the scheduled action"},lastExecutedAt:{type:"string",format:"datetime",description:"When the action was last attempted to be executed"},lastFailureReason:{type:"string",description:"Reason for the last execution failure"},executionEventId:{type:"integer",description:"ID of the moderation event created when action was successfully executed"}}}}},ToolsOzoneModerationEmitEvent:{lexicon:1,id:"tools.ozone.moderation.emitEvent",defs:{main:{type:"procedure",description:"Take a moderation action on an actor.",input:{encoding:"application/json",schema:{type:"object",required:["event","subject","createdBy"],properties:{event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventDivert","lex:tools.ozone.moderation.defs#modEventTag","lex:tools.ozone.moderation.defs#accountEvent","lex:tools.ozone.moderation.defs#identityEvent","lex:tools.ozone.moderation.defs#recordEvent","lex:tools.ozone.moderation.defs#modEventPriorityScore","lex:tools.ozone.moderation.defs#ageAssuranceEvent","lex:tools.ozone.moderation.defs#ageAssuranceOverrideEvent","lex:tools.ozone.moderation.defs#ageAssurancePurgeEvent","lex:tools.ozone.moderation.defs#revokeAccountCredentialsEvent","lex:tools.ozone.moderation.defs#scheduleTakedownEvent","lex:tools.ozone.moderation.defs#cancelScheduledTakedownEvent"]},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},subjectBlobCids:{type:"array",items:{type:"string",format:"cid"}},createdBy:{type:"string",format:"did"},modTool:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modTool"},externalId:{type:"string",description:"An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject."},reportAction:{type:"ref",ref:"lex:tools.ozone.moderation.emitEvent#reportAction",description:"Optional report-level targeting. If provided, this event will be linked to specific reports and reporters may be notified."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventView"}},errors:[{name:"SubjectHasAction"},{name:"DuplicateExternalId",description:"An event with the same external ID already exists for the subject."}]},reportAction:{type:"object",description:"Target specific reports when emitting a moderation event",properties:{ids:{type:"array",items:{type:"integer"},description:"Target specific report IDs"},types:{type:"array",items:{type:"string"},description:"Target reports matching these report types on the subject (fully qualified NSIDs)"},all:{type:"boolean",description:"Target ALL reports on the subject"},note:{type:"string",description:"Note to send to reporter(s) when actioning their report"}}}}},ToolsOzoneModerationGetAccountPreferences:{lexicon:1,id:"tools.ozone.moderation.getAccountPreferences",defs:{main:{type:"query",description:"Get private preferences for an account. Requires moderator or admin auth.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.actor.defs#preferences"}}}}}}},ToolsOzoneModerationGetAccountTimeline:{lexicon:1,id:"tools.ozone.moderation.getAccountTimeline",defs:{main:{type:"query",description:"Get timeline of all available events of an account. This includes moderation events, account history and did history.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"object",required:["timeline"],properties:{timeline:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.getAccountTimeline#timelineItem"}}}}},errors:[{name:"RepoNotFound"}]},timelineItem:{type:"object",required:["day","summary"],properties:{day:{type:"string"},summary:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.getAccountTimeline#timelineItemSummary"}}}},timelineItemSummary:{type:"object",required:["eventSubjectType","eventType","count"],properties:{eventSubjectType:{type:"string",knownValues:["account","record","chat"]},eventType:{type:"string",knownValues:["tools.ozone.moderation.defs#modEventTakedown","tools.ozone.moderation.defs#modEventReverseTakedown","tools.ozone.moderation.defs#modEventComment","tools.ozone.moderation.defs#modEventReport","tools.ozone.moderation.defs#modEventLabel","tools.ozone.moderation.defs#modEventAcknowledge","tools.ozone.moderation.defs#modEventEscalate","tools.ozone.moderation.defs#modEventMute","tools.ozone.moderation.defs#modEventUnmute","tools.ozone.moderation.defs#modEventMuteReporter","tools.ozone.moderation.defs#modEventUnmuteReporter","tools.ozone.moderation.defs#modEventEmail","tools.ozone.moderation.defs#modEventResolveAppeal","tools.ozone.moderation.defs#modEventDivert","tools.ozone.moderation.defs#modEventTag","tools.ozone.moderation.defs#accountEvent","tools.ozone.moderation.defs#identityEvent","tools.ozone.moderation.defs#recordEvent","tools.ozone.moderation.defs#modEventPriorityScore","tools.ozone.moderation.defs#revokeAccountCredentialsEvent","tools.ozone.moderation.defs#ageAssuranceEvent","tools.ozone.moderation.defs#ageAssuranceOverrideEvent","tools.ozone.moderation.defs#timelineEventPlcCreate","tools.ozone.moderation.defs#timelineEventPlcOperation","tools.ozone.moderation.defs#timelineEventPlcTombstone","tools.ozone.hosting.getAccountHistory#accountCreated","tools.ozone.hosting.getAccountHistory#emailConfirmed","tools.ozone.hosting.getAccountHistory#passwordUpdated","tools.ozone.hosting.getAccountHistory#handleUpdated","tools.ozone.moderation.defs#scheduleTakedownEvent","tools.ozone.moderation.defs#cancelScheduledTakedownEvent"]},count:{type:"integer"}}}}},ToolsOzoneModerationGetEvent:{lexicon:1,id:"tools.ozone.moderation.getEvent",defs:{main:{type:"query",description:"Get details about a moderation event.",parameters:{type:"params",required:["id"],properties:{id:{type:"integer"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventViewDetail"}}}}},ToolsOzoneModerationGetRecord:{lexicon:1,id:"tools.ozone.moderation.getRecord",defs:{main:{type:"query",description:"Get details about a record.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#recordViewDetail"}},errors:[{name:"RecordNotFound"}]}}},ToolsOzoneModerationGetRecords:{lexicon:1,id:"tools.ozone.moderation.getRecords",defs:{main:{type:"query",description:"Get details about some records.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",maxLength:100,items:{type:"string",format:"at-uri"}}}},output:{encoding:"application/json",schema:{type:"object",required:["records"],properties:{records:{type:"array",items:{type:"union",refs:["lex:tools.ozone.moderation.defs#recordViewDetail","lex:tools.ozone.moderation.defs#recordViewNotFound"]}}}}}}}},ToolsOzoneModerationGetRepo:{lexicon:1,id:"tools.ozone.moderation.getRepo",defs:{main:{type:"query",description:"Get details about a repository.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoViewDetail"}},errors:[{name:"RepoNotFound"}]}}},ToolsOzoneModerationGetReporterStats:{lexicon:1,id:"tools.ozone.moderation.getReporterStats",defs:{main:{type:"query",description:"Get reporter stats for a list of users.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",maxLength:100,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["stats"],properties:{stats:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#reporterStats"}}}}}}}},ToolsOzoneModerationGetRepos:{lexicon:1,id:"tools.ozone.moderation.getRepos",defs:{main:{type:"query",description:"Get details about some repositories.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",maxLength:100,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{repos:{type:"array",items:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoViewDetail","lex:tools.ozone.moderation.defs#repoViewNotFound"]}}}}}}}},ToolsOzoneModerationGetSubjects:{lexicon:1,id:"tools.ozone.moderation.getSubjects",defs:{main:{type:"query",description:"Get details about subjects.",parameters:{type:"params",required:["subjects"],properties:{subjects:{type:"array",maxLength:100,minLength:1,items:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["subjects"],properties:{subjects:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectView"}}}}}}}},ToolsOzoneModerationListScheduledActions:{lexicon:1,id:"tools.ozone.moderation.listScheduledActions",defs:{main:{type:"procedure",description:"List scheduled moderation actions with optional filtering",input:{encoding:"application/json",schema:{type:"object",required:["statuses"],properties:{startsAfter:{type:"string",format:"datetime",description:"Filter actions scheduled to execute after this time"},endsBefore:{type:"string",format:"datetime",description:"Filter actions scheduled to execute before this time"},subjects:{type:"array",maxLength:100,items:{type:"string",format:"did"},description:"Filter actions for specific DID subjects"},statuses:{type:"array",minLength:1,items:{type:"string",knownValues:["pending","executed","cancelled","failed"]},description:"Filter actions by status"},limit:{type:"integer",minimum:1,maximum:100,default:50,description:"Maximum number of results to return"},cursor:{type:"string",description:"Cursor for pagination"}}}},output:{encoding:"application/json",schema:{type:"object",required:["actions"],properties:{actions:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#scheduledActionView"}},cursor:{type:"string",description:"Cursor for next page of results"}}}}}}},ToolsOzoneModerationQueryEvents:{lexicon:1,id:"tools.ozone.moderation.queryEvents",defs:{main:{type:"query",description:"List moderation events related to a subject.",parameters:{type:"params",properties:{types:{type:"array",items:{type:"string"},description:"The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned."},createdBy:{type:"string",format:"did"},sortDirection:{type:"string",default:"desc",enum:["asc","desc"],description:"Sort direction for the events. Defaults to descending order of created at timestamp."},createdAfter:{type:"string",format:"datetime",description:"Retrieve events created after a given timestamp"},createdBefore:{type:"string",format:"datetime",description:"Retrieve events created before a given timestamp"},subject:{type:"string",format:"uri"},collections:{type:"array",maxLength:20,description:"If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.",items:{type:"string",format:"nsid"}},subjectType:{type:"string",description:"If specified, only events where the subject is of the given type (account, record, or conversation) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.",knownValues:["account","record","conversation"]},includeAllUserRecords:{type:"boolean",default:!1,description:"If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned."},limit:{type:"integer",minimum:1,maximum:100,default:50},hasComment:{type:"boolean",description:"If true, only events with comments are returned"},comment:{type:"string",description:"If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition."},addedLabels:{type:"array",items:{type:"string"},description:"If specified, only events where all of these labels were added are returned"},removedLabels:{type:"array",items:{type:"string"},description:"If specified, only events where all of these labels were removed are returned"},addedTags:{type:"array",items:{type:"string"},description:"If specified, only events where all of these tags were added are returned"},removedTags:{type:"array",items:{type:"string"},description:"If specified, only events where all of these tags were removed are returned"},reportTypes:{type:"array",items:{type:"string"}},policies:{type:"array",items:{type:"string",description:"If specified, only events where the action policies match any of the given policies are returned"}},modTool:{type:"array",items:{type:"string"},description:"If specified, only events where the modTool name matches any of the given values are returned"},batchId:{type:"string",description:"If specified, only events where the batchId matches the given value are returned"},ageAssuranceState:{type:"string",description:"If specified, only events where the age assurance state matches the given value are returned",knownValues:["pending","assured","unknown","reset","blocked"]},withStrike:{type:"boolean",description:"If specified, only events where strikeCount value is set are returned."},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["events"],properties:{cursor:{type:"string"},events:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventView"}}}}}}}},ToolsOzoneModerationQueryStatuses:{lexicon:1,id:"tools.ozone.moderation.queryStatuses",defs:{main:{type:"query",description:"View moderation statuses of subjects (record or repo).",parameters:{type:"params",properties:{queueCount:{type:"integer",description:"Number of queues being used by moderators. Subjects will be split among all queues."},queueIndex:{type:"integer",description:"Index of the queue to fetch subjects from. Works only when queueCount value is specified."},queueSeed:{type:"string",description:"A seeder to shuffle/balance the queue items."},includeAllUserRecords:{type:"boolean",description:"All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned."},subject:{type:"string",format:"uri",description:"The subject to get the status for."},comment:{type:"string",description:"Search subjects by keyword from comments"},reportedAfter:{type:"string",format:"datetime",description:"Search subjects reported after a given timestamp"},reportedBefore:{type:"string",format:"datetime",description:"Search subjects reported before a given timestamp"},reviewedAfter:{type:"string",format:"datetime",description:"Search subjects reviewed after a given timestamp"},hostingDeletedAfter:{type:"string",format:"datetime",description:"Search subjects where the associated record/account was deleted after a given timestamp"},hostingDeletedBefore:{type:"string",format:"datetime",description:"Search subjects where the associated record/account was deleted before a given timestamp"},hostingUpdatedAfter:{type:"string",format:"datetime",description:"Search subjects where the associated record/account was updated after a given timestamp"},hostingUpdatedBefore:{type:"string",format:"datetime",description:"Search subjects where the associated record/account was updated before a given timestamp"},hostingStatuses:{type:"array",items:{type:"string"},description:"Search subjects by the status of the associated record/account"},reviewedBefore:{type:"string",format:"datetime",description:"Search subjects reviewed before a given timestamp"},includeMuted:{type:"boolean",description:"By default, we don't include muted subjects in the results. Set this to true to include them."},onlyMuted:{type:"boolean",description:"When set to true, only muted subjects and reporters will be returned."},reviewState:{type:"string",description:"Specify when fetching subjects in a certain state",knownValues:["tools.ozone.moderation.defs#reviewOpen","tools.ozone.moderation.defs#reviewClosed","tools.ozone.moderation.defs#reviewEscalated","tools.ozone.moderation.defs#reviewNone"]},ignoreSubjects:{type:"array",items:{type:"string",format:"uri"}},lastReviewedBy:{type:"string",format:"did",description:"Get all subject statuses that were reviewed by a specific moderator"},sortField:{type:"string",default:"lastReportedAt",enum:["lastReviewedAt","lastReportedAt","reportedRecordsCount","takendownRecordsCount","priorityScore"]},sortDirection:{type:"string",default:"desc",enum:["asc","desc"]},takendown:{type:"boolean",description:"Get subjects that were taken down"},appealed:{type:"boolean",description:"Get subjects in unresolved appealed status"},limit:{type:"integer",minimum:1,maximum:100,default:50},tags:{type:"array",maxLength:25,items:{type:"string",description:"Items in this array are applied with OR filters. To apply AND filter, put all tags in the same string and separate using && characters"}},excludeTags:{type:"array",items:{type:"string"}},cursor:{type:"string"},collections:{type:"array",maxLength:20,description:"If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored.",items:{type:"string",format:"nsid"}},subjectType:{type:"string",description:"If specified, subjects of the given type (account, record, or conversation) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.",knownValues:["account","record","conversation"]},minAccountSuspendCount:{type:"integer",description:"If specified, only subjects that belong to an account that has at least this many suspensions will be returned."},minReportedRecordsCount:{type:"integer",description:"If specified, only subjects that belong to an account that has at least this many reported records will be returned."},minTakendownRecordsCount:{type:"integer",description:"If specified, only subjects that belong to an account that has at least this many taken down records will be returned."},minPriorityScore:{minimum:0,maximum:100,type:"integer",description:"If specified, only subjects that have priority score value above the given value will be returned."},minStrikeCount:{type:"integer",minimum:1,description:"If specified, only subjects that belong to an account that has at least this many active strikes will be returned."},ageAssuranceState:{type:"string",description:"If specified, only subjects with the given age assurance state will be returned.",knownValues:["pending","assured","unknown","reset","blocked"]}}},output:{encoding:"application/json",schema:{type:"object",required:["subjectStatuses"],properties:{cursor:{type:"string"},subjectStatuses:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}}}}}}},ToolsOzoneModerationScheduleAction:{lexicon:1,id:"tools.ozone.moderation.scheduleAction",defs:{main:{type:"procedure",description:"Schedule a moderation action to be executed at a future time",input:{encoding:"application/json",schema:{type:"object",required:["action","subjects","createdBy","scheduling"],properties:{action:{type:"union",refs:["lex:tools.ozone.moderation.scheduleAction#takedown"]},subjects:{type:"array",maxLength:100,items:{type:"string",format:"did"},description:"Array of DID subjects to schedule the action for"},createdBy:{type:"string",format:"did"},scheduling:{type:"ref",ref:"lex:tools.ozone.moderation.scheduleAction#schedulingConfig"},modTool:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modTool",description:"This will be propagated to the moderation event when it is applied"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.scheduleAction#scheduledActionResults"}}},takedown:{type:"object",description:"Schedule a takedown action",properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the takedown should be in effect before automatically expiring."},acknowledgeAccountSubjects:{type:"boolean",description:"If true, all other reports on content authored by this account will be resolved (acknowledged)."},policies:{type:"array",maxLength:5,items:{type:"string"},description:"Names/Keywords of the policies that drove the decision."},severityLevel:{type:"string",description:"Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)."},strikeCount:{type:"integer",description:"Number of strikes to assign to the user when takedown is applied."},strikeExpiresAt:{type:"string",format:"datetime",description:"When the strike should expire. If not provided, the strike never expires."},emailContent:{type:"string",description:"Email content to be sent to the user upon takedown."},emailSubject:{type:"string",description:"Subject of the email to be sent to the user upon takedown."}}},schedulingConfig:{type:"object",description:"Configuration for when the action should be executed",properties:{executeAt:{type:"string",format:"datetime",description:"Exact time to execute the action"},executeAfter:{type:"string",format:"datetime",description:"Earliest time to execute the action (for randomized scheduling)"},executeUntil:{type:"string",format:"datetime",description:"Latest time to execute the action (for randomized scheduling)"}}},scheduledActionResults:{type:"object",required:["succeeded","failed"],properties:{succeeded:{type:"array",items:{type:"string",format:"did"}},failed:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.scheduleAction#failedScheduling"}}}},failedScheduling:{type:"object",required:["subject","error"],properties:{subject:{type:"string",format:"did"},error:{type:"string"},errorCode:{type:"string"}}}}},ToolsOzoneModerationSearchRepos:{lexicon:1,id:"tools.ozone.moderation.searchRepos",defs:{main:{type:"query",description:"Find repositories based on a search term.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead"},q:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{cursor:{type:"string"},repos:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}}}}}}},ToolsOzoneQueueAssignModerator:{lexicon:1,id:"tools.ozone.queue.assignModerator",defs:{main:{type:"procedure",description:"Assign a user to a queue.",input:{encoding:"application/json",schema:{type:"object",required:["queueId","did"],properties:{queueId:{type:"integer",description:"The ID of the queue to assign the user to."},did:{type:"string",description:"DID to be assigned."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.queue.defs#assignmentView"}},errors:[{name:"InvalidAssignment",description:"The specified queue does not exist or is not enabled."}]}}},ToolsOzoneQueueCreateQueue:{lexicon:1,id:"tools.ozone.queue.createQueue",defs:{main:{type:"procedure",description:"Create a new moderation queue. A queue can have optional matching criteria that ozone's queue router will use to match reports. A queue with no criteria must have reports assigned to it manually via (1) `modTool.meta.queueId` in `tools.ozone.moderation.emitEvent` or (2) `tools.ozone.report.reassignQueue`.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string",description:"Display name for the queue (must be unique)"},subjectTypes:{type:"array",items:{type:"string",knownValues:["account","record","message","conversation"]},description:"Subject types this queue accepts"},collection:{type:"string",format:"nsid",description:"Collection name for record subjects. Required if subjectTypes includes 'record'."},reportTypes:{type:"array",items:{type:"string"},maxLength:25,description:"Report reason types (fully qualified NSIDs)"},description:{type:"string",description:"Optional description of the queue"},recommendedPolicies:{type:"array",items:{type:"string"},description:"Policy keys to recommend when actioning reports in this queue"},recommendedLabels:{type:"array",items:{type:"string"},description:"Labels to recommend for this queue and use as fallback appeal routing mappings"}}}},output:{encoding:"application/json",schema:{type:"object",required:["queue"],properties:{queue:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView"}}}},errors:[{name:"InvalidRecommendedPolicies",description:"One or more recommended policy keys do not exist in the configured policy list"},{name:"ConflictingQueue",description:"The queue configuration conflicts with an existing queue"}]}}},ToolsOzoneQueueDefs:{lexicon:1,id:"tools.ozone.queue.defs",defs:{queueView:{type:"object",required:["id","name","createdBy","createdAt","updatedAt","enabled","stats"],properties:{id:{type:"integer",description:"Queue ID"},name:{type:"string",description:"Display name of the queue"},subjectTypes:{type:"array",items:{type:"string",knownValues:["account","record","message","conversation"]},description:"Subject types this queue accepts."},collection:{type:"string",format:"nsid",description:"Collection name for record subjects (e.g., 'app.bsky.feed.post')"},reportTypes:{type:"array",items:{type:"string"},description:"Report reason types this queue accepts (fully qualified NSIDs)"},description:{type:"string",description:"Optional description of the queue"},recommendedPolicies:{type:"array",items:{type:"string"},description:"Policy keys recommended when actioning reports in this queue"},recommendedLabels:{type:"array",items:{type:"string"},description:"Labels recommended for this queue and used as a fallback when routing label appeals"},createdBy:{type:"string",format:"did",description:"DID of moderator who created this queue"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"},enabled:{type:"boolean",description:"Whether this queue is currently active"},deletedAt:{type:"string",format:"datetime",description:"When the queue was deleted, if applicable"},stats:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueStats",description:"Statistics about this queue"}}},queueStats:{type:"object",required:[],properties:{pendingCount:{type:"integer",description:"Number of reports in 'open' status"},actionedCount:{type:"integer",description:"Number of reports in 'closed' status"},escalatedCount:{type:"integer",description:"Number of reports in 'escalated' status"},inboundCount:{type:"integer",description:"Reports received in this queue in the last 24 hours."},actionRate:{type:"integer",description:"Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer. Absent when inboundCount is 0."},avgHandlingTimeSec:{type:"integer",description:"Average time in seconds from report creation to close, for reports closed in this period."},lastUpdated:{type:"string",format:"datetime",description:"When these statistics were last computed"}}},assignmentView:{type:"object",required:["id","did","queue","startAt"],properties:{id:{type:"integer"},did:{type:"string",format:"did"},moderator:{type:"ref",ref:"lex:tools.ozone.team.defs#member",description:"The moderator assigned to this queue"},queue:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView"},startAt:{type:"string",format:"datetime"},endAt:{type:"string",format:"datetime"}}}}},ToolsOzoneQueueDeleteQueue:{lexicon:1,id:"tools.ozone.queue.deleteQueue",defs:{main:{type:"procedure",description:"Delete a moderation queue. Optionally migrate reports to another queue.",input:{encoding:"application/json",schema:{type:"object",required:["queueId"],properties:{queueId:{type:"integer",description:"ID of the queue to delete"},migrateToQueueId:{type:"integer",description:"Optional: migrate all reports to this queue. If not specified, reports will be set to unassigned (-1)."}}}},output:{encoding:"application/json",schema:{type:"object",required:["deleted"],properties:{deleted:{type:"boolean"},reportsMigrated:{type:"integer",description:"Number of reports that were migrated (if migration occurred)"}}}}}}},ToolsOzoneQueueGetAssignments:{lexicon:1,id:"tools.ozone.queue.getAssignments",defs:{main:{type:"query",description:"Get moderator assignments, optionally filtered by active status, queue, or moderator.",parameters:{type:"params",properties:{onlyActive:{type:"boolean",default:!0,description:"When true, only returns active assignments."},queueIds:{type:"array",items:{type:"integer"},description:"If specified, returns assignments for these queues only."},dids:{type:"array",items:{type:"string",format:"did"},description:"If specified, returns assignments for these moderators only."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["assignments"],properties:{cursor:{type:"string"},assignments:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.queue.defs#assignmentView"}}}}}}}},ToolsOzoneQueueListQueues:{lexicon:1,id:"tools.ozone.queue.listQueues",defs:{main:{type:"query",description:"List all configured moderation queues with statistics.",parameters:{type:"params",properties:{enabled:{type:"boolean",description:"Filter by enabled status. If not specified, returns all queues."},subjectType:{type:"string",description:"Filter queues that handle this subject type ('account', 'record', 'message', or 'conversation')."},collection:{type:"string",description:"Filter queues by collection name (e.g. 'app.bsky.feed.post')."},reportTypes:{type:"array",items:{type:"string"},maxLength:10,description:"Filter queues that handle any of these report reason types."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["queues"],properties:{cursor:{type:"string"},queues:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView"}}}}}}}},ToolsOzoneQueueRouteReports:{lexicon:1,id:"tools.ozone.queue.routeReports",defs:{main:{type:"procedure",description:"Route reports within an ID range to matching queues based.",input:{encoding:"application/json",schema:{type:"object",required:["startReportId","endReportId"],properties:{startReportId:{type:"integer",description:"Start of report ID range (inclusive)."},endReportId:{type:"integer",description:"End of report ID range (inclusive). Difference between start and end must be less than 5,000."}}}},output:{encoding:"application/json",schema:{type:"object",required:["assigned","unmatched"],properties:{assigned:{type:"integer",description:"The number of reports assigned to a queue."},unmatched:{type:"integer",description:"The number of reports with no matching queue."}}}},errors:[{name:"OutOfRange",description:"The request is invalid, such as missing required fields or invalid field values."}]}}},ToolsOzoneQueueUnassignModerator:{lexicon:1,id:"tools.ozone.queue.unassignModerator",defs:{main:{type:"procedure",description:"Remove a user's assignment from a queue.",input:{encoding:"application/json",schema:{type:"object",required:["queueId","did"],properties:{queueId:{type:"integer",description:"The ID of the queue to unassign the user from."},did:{type:"string",format:"did",description:"DID to be unassigned."}}}},errors:[{name:"InvalidAssignment",description:"No active assignment exists for the given queue and user."}]}}},ToolsOzoneQueueUpdateQueue:{lexicon:1,id:"tools.ozone.queue.updateQueue",defs:{main:{type:"procedure",description:"Update queue properties.",input:{encoding:"application/json",schema:{type:"object",required:["queueId"],properties:{queueId:{type:"integer",description:"ID of the queue to update"},name:{type:"string",description:"New display name for the queue"},enabled:{type:"boolean",description:"Enable or disable the queue"},description:{type:"string",description:"Optional description of the queue"},recommendedPolicies:{type:"array",items:{type:"string"},description:"Policy keys to recommend when actioning reports in this queue"},recommendedLabels:{type:"array",items:{type:"string"},description:"Labels to recommend for this queue and use as fallback appeal routing mappings"}}}},output:{encoding:"application/json",schema:{type:"object",required:["queue"],properties:{queue:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView"}}}},errors:[{name:"InvalidRecommendedPolicies",description:"One or more recommended policy keys do not exist in the configured policy list"},{name:"ConflictingQueue",description:"The queue configuration conflicts with an existing queue"}]}}},ToolsOzoneReportAssignModerator:{lexicon:1,id:"tools.ozone.report.assignModerator",defs:{main:{type:"procedure",description:"Assign a report to a user. Defaults to the caller. Admins may assign to any moderator.",input:{encoding:"application/json",schema:{type:"object",required:["reportId"],properties:{reportId:{type:"integer",description:"The ID of the report to assign."},queueId:{type:"integer",description:"Optional queue ID to associate the assignment with. If not provided and the report has been assigned on a queue before, it will stay on that queue."},did:{type:"string",format:"did",description:"DID to be assigned. Defaults to the caller's DID. Admins may assign to any moderator."},isPermanent:{type:"boolean",description:"When true, the assignment has no expiry (endAt is null). Throws AlreadyAssigned if another user already has a permanent assignment on this report."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.report.defs#assignmentView"}},errors:[{name:"AlreadyAssigned",description:"The report is already assigned to another user."},{name:"InvalidAssignment",description:"The report ID or queue ID is invalid."}]}}},ToolsOzoneReportCloseReports:{lexicon:1,id:"tools.ozone.report.closeReports",defs:{main:{type:"procedure",description:"Close all reports on a subject matching the given criteria. Reports whose current status does not permit a transition to closed are skipped silently. Intended for automated flows that resolve reports without taking action on the subject.",input:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"string",format:"uri",description:"Subject DID (account-level reports) or AT-URI (record-level reports) whose reports should be closed."},reportTypes:{type:"array",items:{type:"string"},description:"If specified, only reports of the given report types (fully qualified reason NSIDs) are closed. When omitted, all non-closed reports on the subject are targeted."},internalNote:{type:"string",description:"Optional moderator-only note recorded on each close activity. Not visible to reporters."},isAutomated:{type:"boolean",description:"Set true when this action is triggered by an automated process. Defaults to false.",default:!1}}}},output:{encoding:"application/json",schema:{type:"object",required:["closedCount","reportIds"],properties:{closedCount:{type:"integer",description:"Number of reports that were transitioned to closed."},reportIds:{type:"array",items:{type:"integer"},description:"IDs of the reports that were closed."}}}}}}},ToolsOzoneReportCreateActivity:{lexicon:1,id:"tools.ozone.report.createActivity",defs:{main:{type:"procedure",description:"Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically.",input:{encoding:"application/json",schema:{type:"object",required:["activity"],properties:{reportId:{type:"integer",description:"ID of the report to record activity on. Exactly one of reportId or eventId must be provided."},eventId:{type:"integer",description:"ID of the report moderation event. Resolves to the report created from that event. Exactly one of reportId or eventId must be provided."},activity:{type:"union",refs:["lex:tools.ozone.report.defs#queueActivity","lex:tools.ozone.report.defs#assignmentActivity","lex:tools.ozone.report.defs#escalationActivity","lex:tools.ozone.report.defs#closeActivity","lex:tools.ozone.report.defs#reopenActivity","lex:tools.ozone.report.defs#noteActivity"],description:"The type of activity to record."},internalNote:{type:"string",description:"Optional moderator-only note. Not visible to reporters."},publicNote:{type:"string",description:"Optional public-facing note, potentially visible to the reporter."},isAutomated:{type:"boolean",description:"Set true when this activity is triggered by an automated process. Defaults to false.",default:!1}}}},output:{encoding:"application/json",schema:{type:"object",required:["activity"],properties:{activity:{type:"ref",ref:"lex:tools.ozone.report.defs#reportActivityView"}}}},errors:[{name:"ReportNotFound",description:"No report exists with the given reportId or eventId"},{name:"InvalidStateTransition",description:"The requested state transition is not permitted from the report's current status"},{name:"AlreadyInTargetState",description:"The report is already in the status implied by this activity type"}]}}},ToolsOzoneReportDefs:{lexicon:1,id:"tools.ozone.report.defs",defs:{reasonType:{type:"string",knownValues:["tools.ozone.report.defs#reasonAppeal","tools.ozone.report.defs#reasonOther","tools.ozone.report.defs#reasonViolenceAnimal","tools.ozone.report.defs#reasonViolenceThreats","tools.ozone.report.defs#reasonViolenceGraphicContent","tools.ozone.report.defs#reasonViolenceGlorification","tools.ozone.report.defs#reasonViolenceExtremistContent","tools.ozone.report.defs#reasonViolenceTrafficking","tools.ozone.report.defs#reasonViolenceOther","tools.ozone.report.defs#reasonSexualAbuseContent","tools.ozone.report.defs#reasonSexualNCII","tools.ozone.report.defs#reasonSexualDeepfake","tools.ozone.report.defs#reasonSexualAnimal","tools.ozone.report.defs#reasonSexualUnlabeled","tools.ozone.report.defs#reasonSexualOther","tools.ozone.report.defs#reasonChildSafetyCSAM","tools.ozone.report.defs#reasonChildSafetyGroom","tools.ozone.report.defs#reasonChildSafetyPrivacy","tools.ozone.report.defs#reasonChildSafetyHarassment","tools.ozone.report.defs#reasonChildSafetyOther","tools.ozone.report.defs#reasonHarassmentTroll","tools.ozone.report.defs#reasonHarassmentTargeted","tools.ozone.report.defs#reasonHarassmentHateSpeech","tools.ozone.report.defs#reasonHarassmentDoxxing","tools.ozone.report.defs#reasonHarassmentOther","tools.ozone.report.defs#reasonMisleadingBot","tools.ozone.report.defs#reasonMisleadingImpersonation","tools.ozone.report.defs#reasonMisleadingSpam","tools.ozone.report.defs#reasonMisleadingScam","tools.ozone.report.defs#reasonMisleadingElections","tools.ozone.report.defs#reasonMisleadingOther","tools.ozone.report.defs#reasonRuleSiteSecurity","tools.ozone.report.defs#reasonRuleProhibitedSales","tools.ozone.report.defs#reasonRuleBanEvasion","tools.ozone.report.defs#reasonRuleOther","tools.ozone.report.defs#reasonSelfHarmContent","tools.ozone.report.defs#reasonSelfHarmED","tools.ozone.report.defs#reasonSelfHarmStunts","tools.ozone.report.defs#reasonSelfHarmSubstances","tools.ozone.report.defs#reasonSelfHarmOther"]},reasonAppeal:{type:"token",description:"Appeal a previously taken moderation action"},reasonOther:{type:"token",description:"An issue not included in these options"},reasonViolenceAnimal:{type:"token",description:"Animal welfare violations"},reasonViolenceThreats:{type:"token",description:"Threats or incitement"},reasonViolenceGraphicContent:{type:"token",description:"Graphic violent content"},reasonViolenceGlorification:{type:"token",description:"Glorification of violence"},reasonViolenceExtremistContent:{type:"token",description:"Extremist content. These reports will be sent only be sent to the application's Moderation Authority."},reasonViolenceTrafficking:{type:"token",description:"Human trafficking"},reasonViolenceOther:{type:"token",description:"Other violent content"},reasonSexualAbuseContent:{type:"token",description:"Adult sexual abuse content"},reasonSexualNCII:{type:"token",description:"Non-consensual intimate imagery"},reasonSexualDeepfake:{type:"token",description:"Deepfake adult content"},reasonSexualAnimal:{type:"token",description:"Animal sexual abuse"},reasonSexualUnlabeled:{type:"token",description:"Unlabelled adult content"},reasonSexualOther:{type:"token",description:"Other sexual violence content"},reasonChildSafetyCSAM:{type:"token",description:"Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority."},reasonChildSafetyGroom:{type:"token",description:"Grooming or predatory behavior. These reports will be sent only be sent to the application's Moderation Authority."},reasonChildSafetyPrivacy:{type:"token",description:"Privacy violation involving a minor"},reasonChildSafetyHarassment:{type:"token",description:"Harassment or bullying of minors"},reasonChildSafetyOther:{type:"token",description:"Other child safety. These reports will be sent only be sent to the application's Moderation Authority."},reasonHarassmentTroll:{type:"token",description:"Trolling"},reasonHarassmentTargeted:{type:"token",description:"Targeted harassment"},reasonHarassmentHateSpeech:{type:"token",description:"Hate speech"},reasonHarassmentDoxxing:{type:"token",description:"Doxxing"},reasonHarassmentOther:{type:"token",description:"Other harassing or hateful content"},reasonMisleadingBot:{type:"token",description:"Fake account or bot"},reasonMisleadingImpersonation:{type:"token",description:"Impersonation"},reasonMisleadingSpam:{type:"token",description:"Spam"},reasonMisleadingScam:{type:"token",description:"Scam"},reasonMisleadingElections:{type:"token",description:"False information about elections"},reasonMisleadingOther:{type:"token",description:"Other misleading content"},reasonRuleSiteSecurity:{type:"token",description:"Hacking or system attacks"},reasonRuleProhibitedSales:{type:"token",description:"Promoting or selling prohibited items or services"},reasonRuleBanEvasion:{type:"token",description:"Banned user returning"},reasonRuleOther:{type:"token",description:"Other"},reasonSelfHarmContent:{type:"token",description:"Content promoting or depicting self-harm"},reasonSelfHarmED:{type:"token",description:"Eating disorders"},reasonSelfHarmStunts:{type:"token",description:"Dangerous challenges or activities"},reasonSelfHarmSubstances:{type:"token",description:"Dangerous substances or drug abuse"},reasonSelfHarmOther:{type:"token",description:"Other dangerous content"},reportAssignment:{type:"object",description:"Information about the moderator currently assigned to a report.",required:["did","assignedAt"],properties:{did:{type:"string",format:"did",description:"DID of the assigned moderator"},moderator:{type:"ref",ref:"lex:tools.ozone.team.defs#member",description:"Full member record of the assigned moderator"},assignedAt:{type:"string",format:"datetime",description:"When the report was assigned"}}},reportView:{type:"object",required:["id","eventId","status","subject","reportType","reportedBy","reporter","createdAt"],properties:{id:{type:"integer",description:"Report ID"},eventId:{type:"integer",description:"ID of the moderation event that created this report"},status:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"Current status of the report"},subject:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectView",description:"The subject that was reported with full details"},reportType:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType",description:"Type of report"},reportedBy:{type:"string",format:"did",description:"DID of the user who made the report"},reporter:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectView",description:"Full subject view of the reporter account"},comment:{type:"string",description:"Comment provided by the reporter"},createdAt:{type:"string",format:"datetime",description:"When the report was created"},updatedAt:{type:"string",format:"datetime",description:"When the report was last updated"},queuedAt:{type:"string",format:"datetime",description:"When the report was assigned to its current queue"},actionEventIds:{type:"array",items:{type:"integer"},description:"Array of moderation event IDs representing actions taken on this report, in append order (most recently linked event last)"},actions:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventView"},description:"Optional: expanded action events"},actionNote:{type:"string",description:"Note sent to reporter when report was actioned"},subjectStatus:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView",description:"Current status of the reported subject"},relatedReportCount:{type:"integer",description:"Number of other pending reports on the same subject"},assignment:{type:"ref",ref:"lex:tools.ozone.report.defs#reportAssignment",description:"Information about moderator currently assigned to this report (if any)"},queue:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView",description:"The queue this report is assigned to (if any)"},isMuted:{type:"boolean",description:"Whether this report is muted. A report is muted if the reporter was muted or the subject was muted at the time the report was created."},isAutomated:{type:"boolean",default:!1,description:"Whether this report was emitted by automated tooling."}}},queueActivity:{type:"object",description:"Activity recording a report being routed to a queue.",properties:{previousStatus:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"The report's status before this activity. Populated automatically from the report row; not required in input."}}},assignmentActivity:{type:"object",description:"Activity recording a moderator being assigned to a report.",properties:{previousStatus:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"The report's status before this activity. Populated automatically from the report row; not required in input."}}},escalationActivity:{type:"object",description:"Activity recording a report being escalated.",properties:{previousStatus:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"The report's status before this activity. Populated automatically from the report row; not required in input."}}},closeActivity:{type:"object",description:"Activity recording a report being closed.",properties:{previousStatus:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"The report's status before this activity. Populated automatically from the report row; not required in input."}}},reopenActivity:{type:"object",description:"Activity recording a closed report being reopened. Only valid when the report is in 'closed' status.",properties:{previousStatus:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"The report's status before this activity. Populated automatically from the report row; not required in input."}}},noteActivity:{type:"object",description:"Activity recording a note on a report. Use internalNote for moderator-only notes or publicNote for reporter-visible notes (or both).",properties:{}},reportActivityView:{type:"object",description:"A single activity entry on a report.",required:["id","reportId","activity","isAutomated","createdBy","createdAt"],properties:{id:{type:"integer",description:"Activity ID"},reportId:{type:"integer",description:"ID of the report this activity belongs to"},activity:{type:"union",refs:["lex:tools.ozone.report.defs#queueActivity","lex:tools.ozone.report.defs#assignmentActivity","lex:tools.ozone.report.defs#escalationActivity","lex:tools.ozone.report.defs#closeActivity","lex:tools.ozone.report.defs#reopenActivity","lex:tools.ozone.report.defs#noteActivity"],description:"The typed activity object describing what occurred."},internalNote:{type:"string",description:"Optional moderator-only note. Not visible to reporters."},publicNote:{type:"string",description:"Optional public note, potentially visible to the reporter."},meta:{type:"unknown",description:"Extensible JSON payload for loose activity-specific metadata (e.g. assignmentId)."},isAutomated:{type:"boolean",description:"True if this activity was created by an automated process (e.g. queue router) rather than a direct human action."},createdBy:{type:"string",format:"did",description:"DID of the actor who created this activity, or the service DID for automated activities."},moderator:{type:"ref",ref:"lex:tools.ozone.team.defs#member",description:"Full member record of the moderator who created this activity"},report:{type:"ref",ref:"lex:tools.ozone.report.defs#reportView",description:"Full view of the report this activity belongs to."},createdAt:{type:"string",format:"datetime",description:"When this activity was created"}}},liveStats:{description:"Live statistics for reports for the current calendar day, filterable by queue, moderator, or report type.",type:"object",properties:{pendingCount:{type:"integer",description:"Number of reports currently not closed."},closedCount:{type:"integer",description:"Number of close transitions."},actionedCount:{type:"integer",description:"Number of closures whose last report action is label, tag, or takedown."},acknowledgedCount:{type:"integer",description:"Number of closures whose last report action is not label, tag, or takedown."},escalatedCount:{type:"integer",description:"Number of reports escalated."},inboundCount:{type:"integer",description:"Reports received."},labelActionCount:{type:"integer",description:"Closures whose last report action is a label event."},tagActionCount:{type:"integer",description:"Closures whose last report action is a tag event."},takedownActionCount:{type:"integer",description:"Closures whose last report action is a takedown event."},ahtDurationSec:{type:"integer",description:"Sum of report assignment-to-close seconds."},ahtSampleCount:{type:"integer",description:"Number of assigned closed-report samples in ahtDurationSec."},resolutionDurationSec:{type:"integer",description:"Sum of report creation-to-close seconds."},resolutionSampleCount:{type:"integer",description:"Number of closed-report samples in resolutionDurationSec."},actionRate:{type:"integer",description:"Percentage of closures actioned (actionedCount / closedCount * 100), rounded to nearest integer."},avgHandlingTimeSec:{type:"integer",description:"Average handling time in seconds from report assignment to close."},avgResolutionTimeSec:{type:"integer",description:"Average resolution time in seconds from report creation to close."},lastUpdated:{type:"string",format:"datetime",description:"When these statistics were last computed."}}},historicalStats:{description:"A single daily snapshot of report statistics for a calendar date.",type:"object",required:["date"],properties:{date:{type:"string",description:"The calendar date this snapshot covers (YYYY-MM-DD)."},computedAt:{type:"string",format:"datetime",description:"When this snapshot was last computed."},pendingCount:{type:"integer",description:"Number of reports not closed at time of computation."},closedCount:{type:"integer",description:"Number of close transitions during this day."},actionedCount:{type:"integer",description:"Number of closures whose last report action is label, tag, or takedown during this day."},acknowledgedCount:{type:"integer",description:"Number of closures whose last report action is not label, tag, or takedown during this day."},escalatedCount:{type:"integer",description:"Number of reports escalated during this day."},inboundCount:{type:"integer",description:"Reports received during this day."},labelActionCount:{type:"integer",description:"Closures whose last report action is a label event during this day."},tagActionCount:{type:"integer",description:"Closures whose last report action is a tag event during this day."},takedownActionCount:{type:"integer",description:"Closures whose last report action is a takedown event during this day."},ahtDurationSec:{type:"integer",description:"Sum of report assignment-to-close seconds for this day's samples."},ahtSampleCount:{type:"integer",description:"Number of assigned closed-report samples in ahtDurationSec."},resolutionDurationSec:{type:"integer",description:"Sum of report creation-to-close seconds for this day's samples."},resolutionSampleCount:{type:"integer",description:"Number of closed-report samples in resolutionDurationSec."},actionRate:{type:"integer",description:"Percentage of closures actioned (actionedCount / closedCount * 100), rounded to nearest integer."},avgHandlingTimeSec:{type:"integer",description:"Average handling time in seconds from report assignment to close."},avgResolutionTimeSec:{type:"integer",description:"Average resolution time in seconds from report creation to close."}}},assignmentView:{type:"object",required:["id","did","reportId","startAt"],properties:{id:{type:"integer"},did:{type:"string",format:"did"},moderator:{type:"ref",ref:"lex:tools.ozone.team.defs#member",description:"The moderator assigned to this report"},queue:{type:"ref",ref:"lex:tools.ozone.queue.defs#queueView"},reportId:{type:"integer"},startAt:{type:"string",format:"datetime"},endAt:{type:"string",format:"datetime"}}}}},ToolsOzoneReportGetAssignments:{lexicon:1,id:"tools.ozone.report.getAssignments",defs:{main:{type:"query",description:"Get assignments for reports.",parameters:{type:"params",properties:{onlyActive:{type:"boolean",default:!0,description:"When true, only returns active assignments."},reportIds:{type:"array",items:{type:"integer"},maxLength:50,description:"If specified, returns assignments for these reports only."},dids:{type:"array",items:{type:"string",format:"did"},maxLength:50,description:"If specified, returns assignments for these moderators only."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["assignments"],properties:{cursor:{type:"string"},assignments:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.report.defs#assignmentView"}}}}}}}},ToolsOzoneReportGetHistoricalStats:{lexicon:1,id:"tools.ozone.report.getHistoricalStats",defs:{main:{type:"query",description:"Get historical daily report statistics. Returns a paginated list of daily stat snapshots, newest first. Filter by queue, moderator, or report type.",parameters:{type:"params",properties:{queueId:{type:"integer",description:"Filter stats by queue. Use -1 for unqueued reports."},moderatorDid:{type:"string",format:"did",description:"Filter stats by moderator DID."},reportTypes:{type:"array",items:{type:"string"},description:"Filter stats by report types."},startDate:{type:"string",format:"datetime",description:"Earliest date to include (inclusive)."},endDate:{type:"string",format:"datetime",description:"Latest date to include (inclusive)."},limit:{type:"integer",minimum:1,maximum:100,default:30,description:"Maximum number of entries to return."},cursor:{type:"string",description:"Pagination cursor."}}},output:{encoding:"application/json",schema:{type:"object",required:["stats"],properties:{stats:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.report.defs#historicalStats"}},cursor:{type:"string"}}}}}}},ToolsOzoneReportGetLatestReport:{lexicon:1,id:"tools.ozone.report.getLatestReport",defs:{main:{type:"query",description:"Get the most recent report.",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["report"],properties:{report:{type:"ref",ref:"lex:tools.ozone.report.defs#reportView"}}}},errors:[{name:"NotFound",description:"No report found."}]}}},ToolsOzoneReportGetLiveStats:{lexicon:1,id:"tools.ozone.report.getLiveStats",defs:{main:{type:"query",description:"Get live report statistics for the current UTC calendar day. Filter by queue, moderator, or report type. Omit all parameters for aggregate stats.",parameters:{type:"params",properties:{queueId:{type:"integer",description:"Filter stats by queue. Use -1 for unqueued reports."},moderatorDid:{type:"string",format:"did",description:"Filter stats by moderator DID."},reportTypes:{type:"array",items:{type:"string"},description:"Filter stats by report types."}}},output:{encoding:"application/json",schema:{type:"object",required:["stats"],properties:{stats:{type:"ref",ref:"lex:tools.ozone.report.defs#liveStats",description:"Statistics for the requested filter."}}}}}}},ToolsOzoneReportGetReport:{lexicon:1,id:"tools.ozone.report.getReport",defs:{main:{type:"query",description:"Get details about a single moderation report by ID.",parameters:{type:"params",required:["id"],properties:{id:{type:"integer",description:"The ID of the report to retrieve."}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.report.defs#reportView"}},errors:[{name:"NotFound",description:"No report found."}]}}},ToolsOzoneReportListActivities:{lexicon:1,id:"tools.ozone.report.listActivities",defs:{main:{type:"query",description:"List all activities for a report, sorted most-recent-first.",parameters:{type:"params",required:["reportId"],properties:{reportId:{type:"integer",description:"ID of the report whose activities to list"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["activities"],properties:{activities:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.report.defs#reportActivityView"}},cursor:{type:"string"}}}}}}},ToolsOzoneReportQueryActivities:{lexicon:1,id:"tools.ozone.report.queryActivities",defs:{main:{type:"query",description:"Query report activities across all reports, ordered by createdAt. Used by downstream pollers; for per-report activity history use listActivities.",parameters:{type:"params",properties:{activityTypes:{type:"array",items:{type:"string"},description:"Filter to specific activity types (e.g. closeActivity, escalationActivity). If omitted, all types are returned."},createdAfter:{type:"string",format:"datetime",description:"Retrieve activities created at or after a given timestamp"},createdBefore:{type:"string",format:"datetime",description:"Retrieve activities created at or before a given timestamp"},sortDirection:{type:"string",default:"desc",enum:["asc","desc"]},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string",description:"Cursor of the form `<createdAtMs>::<activityId>`."}}},output:{encoding:"application/json",schema:{type:"object",required:["activities"],properties:{activities:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.report.defs#reportActivityView"}},cursor:{type:"string"}}}}}}},ToolsOzoneReportQueryReports:{lexicon:1,id:"tools.ozone.report.queryReports",defs:{main:{type:"query",description:"View moderation reports. Reports are individual instances of content being reported, as opposed to subject statuses which aggregate reports at the subject level.",parameters:{type:"params",required:["status"],properties:{queueId:{type:"integer",description:"Filter by queue ID. Use -1 for unassigned reports."},reportTypes:{type:"array",items:{type:"string"},description:"Filter by report types (fully qualified string in the format of com.atproto.moderation.defs#reason<name>)."},status:{type:"string",knownValues:["open","closed","escalated","queued","assigned"],description:"Filter by report status."},subject:{type:"string",format:"uri",description:"Filter by subject DID or AT-URI."},did:{type:"string",format:"did",description:"Filter to reports where the subject is this DID or any record owned by this DID. Unlike `subject` (which scopes to a specific account or record), this returns all reports tied to the DID across both account-level and record-level subjects."},subjectType:{type:"string",description:"If specified, reports of the given subject type will be returned.",knownValues:["account","record","message","conversation"]},collections:{type:"array",maxLength:20,description:"If specified, reports where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.",items:{type:"string",format:"nsid"}},reportedAfter:{type:"string",format:"datetime",description:"Retrieve reports created after a given timestamp"},reportedBefore:{type:"string",format:"datetime",description:"Retrieve reports created before a given timestamp"},isMuted:{type:"boolean",default:!1,description:"Filter by muted status. true returns only muted reports, false returns only unmuted reports. Defaults to false."},assignedTo:{type:"string",format:"did",description:"Filter by the DID of the moderator permanently assigned to the report."},sortField:{type:"string",default:"createdAt",enum:["createdAt","updatedAt"]},sortDirection:{type:"string",default:"desc",enum:["asc","desc"]},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["reports"],properties:{cursor:{type:"string"},reports:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.report.defs#reportView"}}}}}}}},ToolsOzoneReportReassignQueue:{lexicon:1,id:"tools.ozone.report.reassignQueue",defs:{main:{type:"procedure",description:"Manually reassign a report to a different queue (or unassign it). Records a queueActivity entry on the report.",input:{encoding:"application/json",schema:{type:"object",required:["reportId","queueId"],properties:{reportId:{type:"integer",description:"ID of the report to reassign"},queueId:{type:"integer",description:"Target queue ID. Use -1 to unassign from any queue."},comment:{type:"string",description:"Optional moderator-only note recorded on the resulting queueActivity as internalNote."}}}},output:{encoding:"application/json",schema:{type:"object",required:["report"],properties:{report:{type:"ref",ref:"lex:tools.ozone.report.defs#reportView"}}}},errors:[{name:"ReportNotFound",description:"No report exists with the given reportId"},{name:"ReportClosed",description:"The report is closed and cannot be reassigned"},{name:"AlreadyInTargetQueue",description:"The report is already assigned to the target queue"},{name:"QueueNotFound",description:"No active queue exists with the given queueId"},{name:"QueueDisabled",description:"The target queue is disabled and cannot receive new assignments"}]}}},ToolsOzoneReportRefreshStats:{lexicon:1,id:"tools.ozone.report.refreshStats",defs:{main:{type:"procedure",description:"Recompute report statistics for a date range.",input:{encoding:"application/json",schema:{type:"object",required:["startDate","endDate"],properties:{startDate:{type:"string",description:"Start date for recomputation, inclusive (YYYY-MM-DD)."},endDate:{type:"string",description:"End date for recomputation, inclusive (YYYY-MM-DD)."},queueIds:{type:"array",items:{type:"integer"},description:"Optional list of queue IDs to recompute. Omit to recompute all groups."}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},ToolsOzoneReportUnassignModerator:{lexicon:1,id:"tools.ozone.report.unassignModerator",defs:{main:{type:"procedure",description:"Remove report assignment.",input:{encoding:"application/json",schema:{type:"object",required:["reportId"],properties:{reportId:{type:"integer",description:"The ID of the report to unassign."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.report.defs#assignmentView"}},errors:[{name:"InvalidAssignment",description:"The report ID is invalid."}]}}},ToolsOzoneSafelinkAddRule:{lexicon:1,id:"tools.ozone.safelink.addRule",defs:{main:{type:"procedure",description:"Add a new URL safety rule",input:{encoding:"application/json",schema:{type:"object",required:["url","pattern","action","reason"],properties:{url:{type:"string",description:"The URL or domain to apply the rule to"},pattern:{type:"ref",ref:"lex:tools.ozone.safelink.defs#patternType"},action:{type:"ref",ref:"lex:tools.ozone.safelink.defs#actionType"},reason:{type:"ref",ref:"lex:tools.ozone.safelink.defs#reasonType"},comment:{type:"string",description:"Optional comment about the decision"},createdBy:{type:"string",format:"did",description:"Author DID. Only respected when using admin auth"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.safelink.defs#event"}},errors:[{name:"InvalidUrl",description:"The provided URL is invalid"},{name:"RuleAlreadyExists",description:"A rule for this URL/domain already exists"}]}}},ToolsOzoneSafelinkDefs:{lexicon:1,id:"tools.ozone.safelink.defs",defs:{event:{type:"object",description:"An event for URL safety decisions",required:["id","eventType","url","pattern","action","reason","createdBy","createdAt"],properties:{id:{type:"integer",description:"Auto-incrementing row ID"},eventType:{type:"ref",ref:"lex:tools.ozone.safelink.defs#eventType"},url:{type:"string",description:"The URL that this rule applies to"},pattern:{type:"ref",ref:"lex:tools.ozone.safelink.defs#patternType"},action:{type:"ref",ref:"lex:tools.ozone.safelink.defs#actionType"},reason:{type:"ref",ref:"lex:tools.ozone.safelink.defs#reasonType"},createdBy:{type:"string",format:"did",description:"DID of the user who created this rule"},createdAt:{type:"string",format:"datetime"},comment:{type:"string",description:"Optional comment about the decision"}}},eventType:{type:"string",knownValues:["addRule","updateRule","removeRule"]},patternType:{type:"string",knownValues:["domain","url"]},actionType:{type:"string",knownValues:["block","warn","whitelist"]},reasonType:{type:"string",knownValues:["csam","spam","phishing","none"]},urlRule:{type:"object",description:"Input for creating a URL safety rule",required:["url","pattern","action","reason","createdBy","createdAt","updatedAt"],properties:{url:{type:"string",description:"The URL or domain to apply the rule to"},pattern:{type:"ref",ref:"lex:tools.ozone.safelink.defs#patternType"},action:{type:"ref",ref:"lex:tools.ozone.safelink.defs#actionType"},reason:{type:"ref",ref:"lex:tools.ozone.safelink.defs#reasonType"},comment:{type:"string",description:"Optional comment about the decision"},createdBy:{type:"string",format:"did",description:"DID of the user added the rule."},createdAt:{type:"string",format:"datetime",description:"Timestamp when the rule was created"},updatedAt:{type:"string",format:"datetime",description:"Timestamp when the rule was last updated"}}}}},ToolsOzoneSafelinkQueryEvents:{lexicon:1,id:"tools.ozone.safelink.queryEvents",defs:{main:{type:"procedure",description:"Query URL safety audit events",input:{encoding:"application/json",schema:{type:"object",properties:{cursor:{type:"string",description:"Cursor for pagination"},limit:{type:"integer",minimum:1,maximum:100,default:50,description:"Maximum number of results to return"},urls:{type:"array",items:{type:"string"},description:"Filter by specific URLs or domains"},patternType:{type:"string",description:"Filter by pattern type"},sortDirection:{type:"string",knownValues:["asc","desc"],default:"desc",description:"Sort direction"}}}},output:{encoding:"application/json",schema:{type:"object",required:["events"],properties:{cursor:{type:"string",description:"Next cursor for pagination. Only present if there are more results."},events:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.safelink.defs#event"}}}}}}}},ToolsOzoneSafelinkQueryRules:{lexicon:1,id:"tools.ozone.safelink.queryRules",defs:{main:{type:"procedure",description:"Query URL safety rules",input:{encoding:"application/json",schema:{type:"object",properties:{cursor:{type:"string",description:"Cursor for pagination"},limit:{type:"integer",minimum:1,maximum:100,default:50,description:"Maximum number of results to return"},urls:{type:"array",items:{type:"string"},description:"Filter by specific URLs or domains"},patternType:{type:"string",description:"Filter by pattern type"},actions:{type:"array",items:{type:"string"},description:"Filter by action types"},reason:{type:"string",description:"Filter by reason type"},createdBy:{type:"string",format:"did",description:"Filter by rule creator"},sortDirection:{type:"string",knownValues:["asc","desc"],default:"desc",description:"Sort direction"}}}},output:{encoding:"application/json",schema:{type:"object",required:["rules"],properties:{cursor:{type:"string",description:"Next cursor for pagination. Only present if there are more results."},rules:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.safelink.defs#urlRule"}}}}}}}},ToolsOzoneSafelinkRemoveRule:{lexicon:1,id:"tools.ozone.safelink.removeRule",defs:{main:{type:"procedure",description:"Remove an existing URL safety rule",input:{encoding:"application/json",schema:{type:"object",required:["url","pattern"],properties:{url:{type:"string",description:"The URL or domain to remove the rule for"},pattern:{type:"ref",ref:"lex:tools.ozone.safelink.defs#patternType"},comment:{type:"string",description:"Optional comment about why the rule is being removed"},createdBy:{type:"string",format:"did",description:"Optional DID of the user. Only respected when using admin auth."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.safelink.defs#event"}},errors:[{name:"RuleNotFound",description:"No active rule found for this URL/domain"}]}}},ToolsOzoneSafelinkUpdateRule:{lexicon:1,id:"tools.ozone.safelink.updateRule",defs:{main:{type:"procedure",description:"Update an existing URL safety rule",input:{encoding:"application/json",schema:{type:"object",required:["url","pattern","action","reason"],properties:{url:{type:"string",description:"The URL or domain to update the rule for"},pattern:{type:"ref",ref:"lex:tools.ozone.safelink.defs#patternType"},action:{type:"ref",ref:"lex:tools.ozone.safelink.defs#actionType"},reason:{type:"ref",ref:"lex:tools.ozone.safelink.defs#reasonType"},comment:{type:"string",description:"Optional comment about the update"},createdBy:{type:"string",format:"did",description:"Optional DID to credit as the creator. Only respected for admin_token authentication."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.safelink.defs#event"}},errors:[{name:"RuleNotFound",description:"No active rule found for this URL/domain"}]}}},ToolsOzoneServerGetConfig:{lexicon:1,id:"tools.ozone.server.getConfig",defs:{main:{type:"query",description:"Get details about ozone's server configuration.",output:{encoding:"application/json",schema:{type:"object",properties:{appview:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},pds:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},blobDivert:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},chat:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},viewer:{type:"ref",ref:"lex:tools.ozone.server.getConfig#viewerConfig"},verifierDid:{type:"string",format:"did",description:"The did of the verifier used for verification."}}}}},serviceConfig:{type:"object",properties:{url:{type:"string",format:"uri"}}},viewerConfig:{type:"object",properties:{role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage","tools.ozone.team.defs#roleVerifier"]}}}}},ToolsOzoneSetAddValues:{lexicon:1,id:"tools.ozone.set.addValues",defs:{main:{type:"procedure",description:"Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.",input:{encoding:"application/json",schema:{type:"object",required:["name","values"],properties:{name:{type:"string",description:"Name of the set to add values to"},values:{type:"array",minLength:1,maxLength:1e3,items:{type:"string"},description:"Array of string values to add to the set"}}}}}}},ToolsOzoneSetDefs:{lexicon:1,id:"tools.ozone.set.defs",defs:{set:{type:"object",required:["name"],properties:{name:{type:"string",minLength:3,maxLength:128},description:{type:"string",maxGraphemes:1024,maxLength:10240}}},setView:{type:"object",required:["name","setSize","createdAt","updatedAt"],properties:{name:{type:"string",minLength:3,maxLength:128},description:{type:"string",maxGraphemes:1024,maxLength:10240},setSize:{type:"integer"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"}}}}},ToolsOzoneSetDeleteSet:{lexicon:1,id:"tools.ozone.set.deleteSet",defs:{main:{type:"procedure",description:"Delete an entire set. Attempting to delete a set that does not exist will result in an error.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string",description:"Name of the set to delete"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetDeleteValues:{lexicon:1,id:"tools.ozone.set.deleteValues",defs:{main:{type:"procedure",description:"Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error",input:{encoding:"application/json",schema:{type:"object",required:["name","values"],properties:{name:{type:"string",description:"Name of the set to delete values from"},values:{type:"array",minLength:1,items:{type:"string"},description:"Array of string values to delete from the set"}}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetGetValues:{lexicon:1,id:"tools.ozone.set.getValues",defs:{main:{type:"query",description:"Get a specific set and its values",parameters:{type:"params",required:["name"],properties:{name:{type:"string"},limit:{type:"integer",minimum:1,maximum:1e3,default:100},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["set","values"],properties:{set:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"},values:{type:"array",items:{type:"string"}},cursor:{type:"string"}}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetQuerySets:{lexicon:1,id:"tools.ozone.set.querySets",defs:{main:{type:"query",description:"Query available sets",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},namePrefix:{type:"string"},sortBy:{type:"string",enum:["name","createdAt","updatedAt"],default:"name"},sortDirection:{type:"string",default:"asc",enum:["asc","desc"],description:"Defaults to ascending order of name field."}}},output:{encoding:"application/json",schema:{type:"object",required:["sets"],properties:{sets:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"}},cursor:{type:"string"}}}}}}},ToolsOzoneSetUpsertSet:{lexicon:1,id:"tools.ozone.set.upsertSet",defs:{main:{type:"procedure",description:"Create or update set metadata",input:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.set.defs#set"}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"}}}}},ToolsOzoneSettingDefs:{lexicon:1,id:"tools.ozone.setting.defs",defs:{option:{type:"object",required:["key","value","did","scope","createdBy","lastUpdatedBy"],properties:{key:{type:"string",format:"nsid"},did:{type:"string",format:"did"},value:{type:"unknown"},description:{type:"string",maxGraphemes:1024,maxLength:10240},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"},managerRole:{type:"string",knownValues:["tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage","tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleVerifier"]},scope:{type:"string",knownValues:["instance","personal"]},createdBy:{type:"string",format:"did"},lastUpdatedBy:{type:"string",format:"did"}}}}},ToolsOzoneSettingListOptions:{lexicon:1,id:"tools.ozone.setting.listOptions",defs:{main:{type:"query",description:"List settings with optional filtering",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},scope:{type:"string",knownValues:["instance","personal"],default:"instance"},prefix:{type:"string",description:"Filter keys by prefix"},keys:{type:"array",maxLength:100,items:{type:"string",format:"nsid"},description:"Filter for only the specified keys. Ignored if prefix is provided"}}},output:{encoding:"application/json",schema:{type:"object",required:["options"],properties:{cursor:{type:"string"},options:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.setting.defs#option"}}}}}}}},ToolsOzoneSettingRemoveOptions:{lexicon:1,id:"tools.ozone.setting.removeOptions",defs:{main:{type:"procedure",description:"Delete settings by key",input:{encoding:"application/json",schema:{type:"object",required:["keys","scope"],properties:{keys:{type:"array",minLength:1,maxLength:200,items:{type:"string",format:"nsid"}},scope:{type:"string",knownValues:["instance","personal"]}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},ToolsOzoneSettingUpsertOption:{lexicon:1,id:"tools.ozone.setting.upsertOption",defs:{main:{type:"procedure",description:"Create or update setting option",input:{encoding:"application/json",schema:{type:"object",required:["key","scope","value"],properties:{key:{type:"string",format:"nsid"},scope:{type:"string",knownValues:["instance","personal"]},value:{type:"unknown"},description:{type:"string",maxLength:2e3},managerRole:{type:"string",knownValues:["tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage","tools.ozone.team.defs#roleVerifier","tools.ozone.team.defs#roleAdmin"]}}}},output:{encoding:"application/json",schema:{type:"object",required:["option"],properties:{option:{type:"ref",ref:"lex:tools.ozone.setting.defs#option"}}}}}}},ToolsOzoneSignatureDefs:{lexicon:1,id:"tools.ozone.signature.defs",defs:{sigDetail:{type:"object",required:["property","value"],properties:{property:{type:"string"},value:{type:"string"}}}}},ToolsOzoneSignatureFindCorrelation:{lexicon:1,id:"tools.ozone.signature.findCorrelation",defs:{main:{type:"query",description:"Find all correlated threat signatures between 2 or more accounts.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["details"],properties:{details:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.defs#sigDetail"}}}}}}}},ToolsOzoneSignatureFindRelatedAccounts:{lexicon:1,id:"tools.ozone.signature.findRelatedAccounts",defs:{main:{type:"query",description:"Get accounts that share some matching threat signatures with the root account.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.findRelatedAccounts#relatedAccount"}}}}}},relatedAccount:{type:"object",required:["account"],properties:{account:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"},similarities:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.defs#sigDetail"}}}}}},ToolsOzoneSignatureSearchAccounts:{lexicon:1,id:"tools.ozone.signature.searchAccounts",defs:{main:{type:"query",description:"Search for accounts that match one or more threat signature values.",parameters:{type:"params",required:["values"],properties:{values:{type:"array",items:{type:"string"}},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ToolsOzoneTeamAddMember:{lexicon:1,id:"tools.ozone.team.addMember",defs:{main:{type:"procedure",description:"Add a member to the ozone team. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did","role"],properties:{did:{type:"string",format:"did"},role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleVerifier","tools.ozone.team.defs#roleTriage"]}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}},errors:[{name:"MemberAlreadyExists",description:"Member already exists in the team."}]}}},ToolsOzoneTeamDefs:{lexicon:1,id:"tools.ozone.team.defs",defs:{member:{type:"object",required:["did","role"],properties:{did:{type:"string",format:"did"},disabled:{type:"boolean"},profile:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"},lastUpdatedBy:{type:"string"},role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage","tools.ozone.team.defs#roleVerifier"]}}},roleAdmin:{type:"token",description:"Admin role. Highest level of access, can perform all actions."},roleModerator:{type:"token",description:"Moderator role. Can perform most actions."},roleTriage:{type:"token",description:"Triage role. Mostly intended for monitoring and escalating issues."},roleVerifier:{type:"token",description:"Verifier role. Only allowed to issue verifications."}}},ToolsOzoneTeamDeleteMember:{lexicon:1,id:"tools.ozone.team.deleteMember",defs:{main:{type:"procedure",description:"Delete a member from ozone team. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}},errors:[{name:"MemberNotFound",description:"The member being deleted does not exist"},{name:"CannotDeleteSelf",description:"You can not delete yourself from the team"}]}}},ToolsOzoneTeamListMembers:{lexicon:1,id:"tools.ozone.team.listMembers",defs:{main:{type:"query",description:"List all members with access to the ozone service.",parameters:{type:"params",properties:{q:{type:"string"},disabled:{type:"boolean"},roles:{type:"array",items:{type:"string"}},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["members"],properties:{cursor:{type:"string"},members:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}}}}}}}},ToolsOzoneTeamUpdateMember:{lexicon:1,id:"tools.ozone.team.updateMember",defs:{main:{type:"procedure",description:"Update a member in the ozone service. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"},disabled:{type:"boolean"},role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleVerifier","tools.ozone.team.defs#roleTriage"]}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}},errors:[{name:"MemberNotFound",description:"The member being updated does not exist in the team"}]}}},ToolsOzoneVerificationDefs:{lexicon:1,id:"tools.ozone.verification.defs",defs:{verificationView:{type:"object",description:"Verification data for the associated subject.",required:["issuer","uri","subject","handle","displayName","createdAt"],properties:{issuer:{type:"string",description:"The user who issued this verification.",format:"did"},uri:{type:"string",description:"The AT-URI of the verification record.",format:"at-uri"},subject:{type:"string",format:"did",description:"The subject of the verification."},handle:{type:"string",description:"Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.",format:"handle"},displayName:{type:"string",description:"Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying."},createdAt:{type:"string",description:"Timestamp when the verification was created.",format:"datetime"},revokeReason:{type:"string",description:"Describes the reason for revocation, also indicating that the verification is no longer valid."},revokedAt:{type:"string",description:"Timestamp when the verification was revoked.",format:"datetime"},revokedBy:{type:"string",description:"The user who revoked this verification.",format:"did"},subjectProfile:{type:"union",refs:[]},issuerProfile:{type:"union",refs:[]},subjectRepo:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoViewDetail","lex:tools.ozone.moderation.defs#repoViewNotFound"]},issuerRepo:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoViewDetail","lex:tools.ozone.moderation.defs#repoViewNotFound"]}}}}},ToolsOzoneVerificationGrantVerifications:{lexicon:1,id:"tools.ozone.verification.grantVerifications",defs:{main:{type:"procedure",description:"Grant verifications to multiple subjects. Allows batch processing of up to 100 verifications at once.",input:{encoding:"application/json",schema:{type:"object",required:["verifications"],properties:{verifications:{type:"array",description:"Array of verification requests to process",maxLength:100,items:{type:"ref",ref:"lex:tools.ozone.verification.grantVerifications#verificationInput"}}}}},output:{encoding:"application/json",schema:{type:"object",required:["verifications","failedVerifications"],properties:{verifications:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.verification.defs#verificationView"}},failedVerifications:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.verification.grantVerifications#grantError"}}}}}},verificationInput:{type:"object",required:["subject","handle","displayName"],properties:{subject:{type:"string",description:"The did of the subject being verified",format:"did"},handle:{type:"string",description:"Handle of the subject the verification applies to at the moment of verifying.",format:"handle"},displayName:{type:"string",description:"Display name of the subject the verification applies to at the moment of verifying."},createdAt:{type:"string",format:"datetime",description:"Timestamp for verification record. Defaults to current time when not specified."}}},grantError:{type:"object",description:"Error object for failed verifications.",required:["error","subject"],properties:{error:{type:"string",description:"Error message describing the reason for failure."},subject:{type:"string",description:"The did of the subject being verified",format:"did"}}}}},ToolsOzoneVerificationListVerifications:{lexicon:1,id:"tools.ozone.verification.listVerifications",defs:{main:{type:"query",description:"List verifications",parameters:{type:"params",properties:{cursor:{type:"string",description:"Pagination cursor"},limit:{type:"integer",description:"Maximum number of results to return",minimum:1,maximum:100,default:50},createdAfter:{type:"string",format:"datetime",description:"Filter to verifications created after this timestamp"},createdBefore:{type:"string",format:"datetime",description:"Filter to verifications created before this timestamp"},issuers:{type:"array",maxLength:100,description:"Filter to verifications from specific issuers",items:{type:"string",format:"did"}},subjects:{type:"array",description:"Filter to specific verified DIDs",maxLength:100,items:{type:"string",format:"did"}},sortDirection:{type:"string",description:"Sort direction for creation date",enum:["asc","desc"],default:"desc"},isRevoked:{type:"boolean",description:"Filter to verifications that are revoked or not. By default, includes both."}}},output:{encoding:"application/json",schema:{type:"object",required:["verifications"],properties:{cursor:{type:"string"},verifications:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.verification.defs#verificationView"}}}}}}}},ToolsOzoneVerificationRevokeVerifications:{lexicon:1,id:"tools.ozone.verification.revokeVerifications",defs:{main:{type:"procedure",description:"Revoke previously granted verifications in batches of up to 100.",input:{encoding:"application/json",schema:{type:"object",required:["uris"],properties:{uris:{type:"array",description:"Array of verification record uris to revoke",maxLength:100,items:{type:"string",description:"The AT-URI of the verification record to revoke.",format:"at-uri"}},revokeReason:{type:"string",description:"Reason for revoking the verification. This is optional and can be omitted if not needed.",maxLength:1e3}}}},output:{encoding:"application/json",schema:{type:"object",required:["revokedVerifications","failedRevocations"],properties:{revokedVerifications:{type:"array",description:"List of verification uris successfully revoked",items:{type:"string",format:"at-uri"}},failedRevocations:{type:"array",description:"List of verification uris that couldn't be revoked, including failure reasons",items:{type:"ref",ref:"lex:tools.ozone.verification.revokeVerifications#revokeError"}}}}}},revokeError:{type:"object",description:"Error object for failed revocations",required:["uri","error"],properties:{uri:{type:"string",description:"The AT-URI of the verification record that failed to revoke.",format:"at-uri"},error:{type:"string",description:"Description of the error that occurred during revocation."}}}}}},Ur=Object.values(Lq),qp=new qe(Ur);function l(t,e,r,o){return(o?d:Fw)(t,e,r)?qp.validate(`${e}#${r}`,t):{success:!1,error:new C(`Must be an object with "${r==="main"?e:`${e}#${r}`}" $type property`)}}var st={AppBskyActorContentVisibilityDeclaration:"app.bsky.actor.contentVisibilityDeclaration",AppBskyActorDefs:"app.bsky.actor.defs",AppBskyActorGetPreferences:"app.bsky.actor.getPreferences",AppBskyActorGetProfile:"app.bsky.actor.getProfile",AppBskyActorGetProfiles:"app.bsky.actor.getProfiles",AppBskyActorGetSuggestions:"app.bsky.actor.getSuggestions",AppBskyActorProfile:"app.bsky.actor.profile",AppBskyActorPutPreferences:"app.bsky.actor.putPreferences",AppBskyActorSearchActors:"app.bsky.actor.searchActors",AppBskyActorSearchActorsTypeahead:"app.bsky.actor.searchActorsTypeahead",AppBskyActorStatus:"app.bsky.actor.status",AppBskyAgeassuranceBegin:"app.bsky.ageassurance.begin",AppBskyAgeassuranceDefs:"app.bsky.ageassurance.defs",AppBskyAgeassuranceGetConfig:"app.bsky.ageassurance.getConfig",AppBskyAgeassuranceGetState:"app.bsky.ageassurance.getState",AppBskyBookmarkCreateBookmark:"app.bsky.bookmark.createBookmark",AppBskyBookmarkDefs:"app.bsky.bookmark.defs",AppBskyBookmarkDeleteBookmark:"app.bsky.bookmark.deleteBookmark",AppBskyBookmarkGetBookmarks:"app.bsky.bookmark.getBookmarks",AppBskyContactDefs:"app.bsky.contact.defs",AppBskyContactDismissMatch:"app.bsky.contact.dismissMatch",AppBskyContactGetMatches:"app.bsky.contact.getMatches",AppBskyContactGetSyncStatus:"app.bsky.contact.getSyncStatus",AppBskyContactImportContacts:"app.bsky.contact.importContacts",AppBskyContactRemoveData:"app.bsky.contact.removeData",AppBskyContactSendNotification:"app.bsky.contact.sendNotification",AppBskyContactStartPhoneVerification:"app.bsky.contact.startPhoneVerification",AppBskyContactVerifyPhone:"app.bsky.contact.verifyPhone",AppBskyDraftCreateDraft:"app.bsky.draft.createDraft",AppBskyDraftDefs:"app.bsky.draft.defs",AppBskyDraftDeleteDraft:"app.bsky.draft.deleteDraft",AppBskyDraftGetDrafts:"app.bsky.draft.getDrafts",AppBskyDraftUpdateDraft:"app.bsky.draft.updateDraft",AppBskyEmbedDefs:"app.bsky.embed.defs",AppBskyEmbedExternal:"app.bsky.embed.external",AppBskyEmbedGallery:"app.bsky.embed.gallery",AppBskyEmbedGetEmbedExternalView:"app.bsky.embed.getEmbedExternalView",AppBskyEmbedImages:"app.bsky.embed.images",AppBskyEmbedRecord:"app.bsky.embed.record",AppBskyEmbedRecordWithMedia:"app.bsky.embed.recordWithMedia",AppBskyEmbedVideo:"app.bsky.embed.video",AppBskyFeedDefs:"app.bsky.feed.defs",AppBskyFeedDescribeFeedGenerator:"app.bsky.feed.describeFeedGenerator",AppBskyFeedGenerator:"app.bsky.feed.generator",AppBskyFeedGetActorFeeds:"app.bsky.feed.getActorFeeds",AppBskyFeedGetActorLikes:"app.bsky.feed.getActorLikes",AppBskyFeedGetAuthorFeed:"app.bsky.feed.getAuthorFeed",AppBskyFeedGetFeed:"app.bsky.feed.getFeed",AppBskyFeedGetFeedGenerator:"app.bsky.feed.getFeedGenerator",AppBskyFeedGetFeedGenerators:"app.bsky.feed.getFeedGenerators",AppBskyFeedGetFeedSkeleton:"app.bsky.feed.getFeedSkeleton",AppBskyFeedGetLikes:"app.bsky.feed.getLikes",AppBskyFeedGetListFeed:"app.bsky.feed.getListFeed",AppBskyFeedGetPostThread:"app.bsky.feed.getPostThread",AppBskyFeedGetPosts:"app.bsky.feed.getPosts",AppBskyFeedGetQuotes:"app.bsky.feed.getQuotes",AppBskyFeedGetRepostedBy:"app.bsky.feed.getRepostedBy",AppBskyFeedGetSuggestedFeeds:"app.bsky.feed.getSuggestedFeeds",AppBskyFeedGetTimeline:"app.bsky.feed.getTimeline",AppBskyFeedLike:"app.bsky.feed.like",AppBskyFeedPost:"app.bsky.feed.post",AppBskyFeedPostgate:"app.bsky.feed.postgate",AppBskyFeedRepost:"app.bsky.feed.repost",AppBskyFeedSearchPosts:"app.bsky.feed.searchPosts",AppBskyFeedSearchPostsV2:"app.bsky.feed.searchPostsV2",AppBskyFeedSendInteractions:"app.bsky.feed.sendInteractions",AppBskyFeedThreadgate:"app.bsky.feed.threadgate",AppBskyGraphBlock:"app.bsky.graph.block",AppBskyGraphDefs:"app.bsky.graph.defs",AppBskyGraphFollow:"app.bsky.graph.follow",AppBskyGraphGetActorStarterPacks:"app.bsky.graph.getActorStarterPacks",AppBskyGraphGetBlocks:"app.bsky.graph.getBlocks",AppBskyGraphGetFollowers:"app.bsky.graph.getFollowers",AppBskyGraphGetFollows:"app.bsky.graph.getFollows",AppBskyGraphGetKnownFollowers:"app.bsky.graph.getKnownFollowers",AppBskyGraphGetList:"app.bsky.graph.getList",AppBskyGraphGetListBlocks:"app.bsky.graph.getListBlocks",AppBskyGraphGetListMutes:"app.bsky.graph.getListMutes",AppBskyGraphGetLists:"app.bsky.graph.getLists",AppBskyGraphGetListsWithMembership:"app.bsky.graph.getListsWithMembership",AppBskyGraphGetMutes:"app.bsky.graph.getMutes",AppBskyGraphGetRelationships:"app.bsky.graph.getRelationships",AppBskyGraphGetStarterPack:"app.bsky.graph.getStarterPack",AppBskyGraphGetStarterPacks:"app.bsky.graph.getStarterPacks",AppBskyGraphGetStarterPacksWithMembership:"app.bsky.graph.getStarterPacksWithMembership",AppBskyGraphGetSuggestedFollowsByActor:"app.bsky.graph.getSuggestedFollowsByActor",AppBskyGraphList:"app.bsky.graph.list",AppBskyGraphListblock:"app.bsky.graph.listblock",AppBskyGraphListitem:"app.bsky.graph.listitem",AppBskyGraphMuteActor:"app.bsky.graph.muteActor",AppBskyGraphMuteActorList:"app.bsky.graph.muteActorList",AppBskyGraphMuteThread:"app.bsky.graph.muteThread",AppBskyGraphReferencelistoptout:"app.bsky.graph.referencelistoptout",AppBskyGraphSearchStarterPacks:"app.bsky.graph.searchStarterPacks",AppBskyGraphSearchStarterPacksV2:"app.bsky.graph.searchStarterPacksV2",AppBskyGraphStarterpack:"app.bsky.graph.starterpack",AppBskyGraphUnmuteActor:"app.bsky.graph.unmuteActor",AppBskyGraphUnmuteActorList:"app.bsky.graph.unmuteActorList",AppBskyGraphUnmuteThread:"app.bsky.graph.unmuteThread",AppBskyGraphVerification:"app.bsky.graph.verification",AppBskyLabelerDefs:"app.bsky.labeler.defs",AppBskyLabelerGetServices:"app.bsky.labeler.getServices",AppBskyLabelerService:"app.bsky.labeler.service",AppBskyNotificationDeclaration:"app.bsky.notification.declaration",AppBskyNotificationDefs:"app.bsky.notification.defs",AppBskyNotificationGetPreferences:"app.bsky.notification.getPreferences",AppBskyNotificationGetUnreadCount:"app.bsky.notification.getUnreadCount",AppBskyNotificationListActivitySubscriptions:"app.bsky.notification.listActivitySubscriptions",AppBskyNotificationListNotifications:"app.bsky.notification.listNotifications",AppBskyNotificationPutActivitySubscription:"app.bsky.notification.putActivitySubscription",AppBskyNotificationPutPreferences:"app.bsky.notification.putPreferences",AppBskyNotificationPutPreferencesV2:"app.bsky.notification.putPreferencesV2",AppBskyNotificationRegisterPush:"app.bsky.notification.registerPush",AppBskyNotificationUnregisterPush:"app.bsky.notification.unregisterPush",AppBskyNotificationUpdateSeen:"app.bsky.notification.updateSeen",AppBskyRichtextFacet:"app.bsky.richtext.facet",AppBskyUnspeccedDefs:"app.bsky.unspecced.defs",AppBskyUnspeccedGetAgeAssuranceState:"app.bsky.unspecced.getAgeAssuranceState",AppBskyUnspeccedGetConfig:"app.bsky.unspecced.getConfig",AppBskyUnspeccedGetOnboardingSuggestedStarterPacks:"app.bsky.unspecced.getOnboardingSuggestedStarterPacks",AppBskyUnspeccedGetOnboardingSuggestedStarterPacksSkeleton:"app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton",AppBskyUnspeccedGetOnboardingSuggestedUsersSkeleton:"app.bsky.unspecced.getOnboardingSuggestedUsersSkeleton",AppBskyUnspeccedGetPopularFeedGenerators:"app.bsky.unspecced.getPopularFeedGenerators",AppBskyUnspeccedGetPostThreadOtherV2:"app.bsky.unspecced.getPostThreadOtherV2",AppBskyUnspeccedGetPostThreadV2:"app.bsky.unspecced.getPostThreadV2",AppBskyUnspeccedGetSuggestedFeeds:"app.bsky.unspecced.getSuggestedFeeds",AppBskyUnspeccedGetSuggestedFeedsSkeleton:"app.bsky.unspecced.getSuggestedFeedsSkeleton",AppBskyUnspeccedGetSuggestedOnboardingUsers:"app.bsky.unspecced.getSuggestedOnboardingUsers",AppBskyUnspeccedGetSuggestedStarterPacks:"app.bsky.unspecced.getSuggestedStarterPacks",AppBskyUnspeccedGetSuggestedStarterPacksSkeleton:"app.bsky.unspecced.getSuggestedStarterPacksSkeleton",AppBskyUnspeccedGetSuggestedUsers:"app.bsky.unspecced.getSuggestedUsers",AppBskyUnspeccedGetSuggestedUsersForDiscover:"app.bsky.unspecced.getSuggestedUsersForDiscover",AppBskyUnspeccedGetSuggestedUsersForDiscoverSkeleton:"app.bsky.unspecced.getSuggestedUsersForDiscoverSkeleton",AppBskyUnspeccedGetSuggestedUsersForExplore:"app.bsky.unspecced.getSuggestedUsersForExplore",AppBskyUnspeccedGetSuggestedUsersForExploreSkeleton:"app.bsky.unspecced.getSuggestedUsersForExploreSkeleton",AppBskyUnspeccedGetSuggestedUsersForSeeMore:"app.bsky.unspecced.getSuggestedUsersForSeeMore",AppBskyUnspeccedGetSuggestedUsersForSeeMoreSkeleton:"app.bsky.unspecced.getSuggestedUsersForSeeMoreSkeleton",AppBskyUnspeccedGetSuggestedUsersSkeleton:"app.bsky.unspecced.getSuggestedUsersSkeleton",AppBskyUnspeccedGetSuggestionsSkeleton:"app.bsky.unspecced.getSuggestionsSkeleton",AppBskyUnspeccedGetTaggedSuggestions:"app.bsky.unspecced.getTaggedSuggestions",AppBskyUnspeccedGetTrendingTopics:"app.bsky.unspecced.getTrendingTopics",AppBskyUnspeccedGetTrends:"app.bsky.unspecced.getTrends",AppBskyUnspeccedGetTrendsSkeleton:"app.bsky.unspecced.getTrendsSkeleton",AppBskyUnspeccedInitAgeAssurance:"app.bsky.unspecced.initAgeAssurance",AppBskyUnspeccedSearchActorsSkeleton:"app.bsky.unspecced.searchActorsSkeleton",AppBskyUnspeccedSearchPostsSkeleton:"app.bsky.unspecced.searchPostsSkeleton",AppBskyUnspeccedSearchStarterPacksSkeleton:"app.bsky.unspecced.searchStarterPacksSkeleton",AppBskyVideoAbortUpload:"app.bsky.video.abortUpload",AppBskyVideoDefs:"app.bsky.video.defs",AppBskyVideoFinishUpload:"app.bsky.video.finishUpload",AppBskyVideoGetJobStatus:"app.bsky.video.getJobStatus",AppBskyVideoGetUploadLimits:"app.bsky.video.getUploadLimits",AppBskyVideoGetUploadStatus:"app.bsky.video.getUploadStatus",AppBskyVideoStartUpload:"app.bsky.video.startUpload",AppBskyVideoUploadPart:"app.bsky.video.uploadPart",AppBskyVideoUploadVideo:"app.bsky.video.uploadVideo",ChatBskyActorDeclaration:"chat.bsky.actor.declaration",ChatBskyActorDefs:"chat.bsky.actor.defs",ChatBskyActorDeleteAccount:"chat.bsky.actor.deleteAccount",ChatBskyActorExportAccountData:"chat.bsky.actor.exportAccountData",ChatBskyActorGetStatus:"chat.bsky.actor.getStatus",ChatBskyConvoAcceptConvo:"chat.bsky.convo.acceptConvo",ChatBskyConvoAddReaction:"chat.bsky.convo.addReaction",ChatBskyConvoDefs:"chat.bsky.convo.defs",ChatBskyConvoDeleteMessageForSelf:"chat.bsky.convo.deleteMessageForSelf",ChatBskyConvoGetConvo:"chat.bsky.convo.getConvo",ChatBskyConvoGetConvoAvailability:"chat.bsky.convo.getConvoAvailability",ChatBskyConvoGetConvoForMembers:"chat.bsky.convo.getConvoForMembers",ChatBskyConvoGetConvoMembers:"chat.bsky.convo.getConvoMembers",ChatBskyConvoGetLog:"chat.bsky.convo.getLog",ChatBskyConvoGetMessages:"chat.bsky.convo.getMessages",ChatBskyConvoGetUnreadCounts:"chat.bsky.convo.getUnreadCounts",ChatBskyConvoLeaveConvo:"chat.bsky.convo.leaveConvo",ChatBskyConvoListConvoRequests:"chat.bsky.convo.listConvoRequests",ChatBskyConvoListConvos:"chat.bsky.convo.listConvos",ChatBskyConvoLockConvo:"chat.bsky.convo.lockConvo",ChatBskyConvoMuteConvo:"chat.bsky.convo.muteConvo",ChatBskyConvoRemoveReaction:"chat.bsky.convo.removeReaction",ChatBskyConvoSendMessage:"chat.bsky.convo.sendMessage",ChatBskyConvoSendMessageBatch:"chat.bsky.convo.sendMessageBatch",ChatBskyConvoUnlockConvo:"chat.bsky.convo.unlockConvo",ChatBskyConvoUnmuteConvo:"chat.bsky.convo.unmuteConvo",ChatBskyConvoUpdateAllRead:"chat.bsky.convo.updateAllRead",ChatBskyConvoUpdateRead:"chat.bsky.convo.updateRead",ChatBskyEmbedJoinLink:"chat.bsky.embed.joinLink",ChatBskyGroupAddMembers:"chat.bsky.group.addMembers",ChatBskyGroupApproveJoinRequest:"chat.bsky.group.approveJoinRequest",ChatBskyGroupCreateGroup:"chat.bsky.group.createGroup",ChatBskyGroupCreateJoinLink:"chat.bsky.group.createJoinLink",ChatBskyGroupDefs:"chat.bsky.group.defs",ChatBskyGroupDisableJoinLink:"chat.bsky.group.disableJoinLink",ChatBskyGroupEditGroup:"chat.bsky.group.editGroup",ChatBskyGroupEditJoinLink:"chat.bsky.group.editJoinLink",ChatBskyGroupEnableJoinLink:"chat.bsky.group.enableJoinLink",ChatBskyGroupGetJoinLinkPreviews:"chat.bsky.group.getJoinLinkPreviews",ChatBskyGroupListJoinRequests:"chat.bsky.group.listJoinRequests",ChatBskyGroupListMutualGroups:"chat.bsky.group.listMutualGroups",ChatBskyGroupRejectJoinRequest:"chat.bsky.group.rejectJoinRequest",ChatBskyGroupRemoveMembers:"chat.bsky.group.removeMembers",ChatBskyGroupRequestJoin:"chat.bsky.group.requestJoin",ChatBskyGroupUpdateJoinRequestsRead:"chat.bsky.group.updateJoinRequestsRead",ChatBskyGroupWithdrawJoinRequest:"chat.bsky.group.withdrawJoinRequest",ChatBskyModerationDefs:"chat.bsky.moderation.defs",ChatBskyModerationGetActorMetadata:"chat.bsky.moderation.getActorMetadata",ChatBskyModerationGetConvo:"chat.bsky.moderation.getConvo",ChatBskyModerationGetConvoMembers:"chat.bsky.moderation.getConvoMembers",ChatBskyModerationGetConvos:"chat.bsky.moderation.getConvos",ChatBskyModerationGetMessageContext:"chat.bsky.moderation.getMessageContext",ChatBskyModerationSubscribeModEvents:"chat.bsky.moderation.subscribeModEvents",ChatBskyModerationUpdateActorAccess:"chat.bsky.moderation.updateActorAccess",ChatBskyNotificationDefs:"chat.bsky.notification.defs",ChatBskyNotificationGetPreferences:"chat.bsky.notification.getPreferences",ChatBskyNotificationPutPreferences:"chat.bsky.notification.putPreferences",ComAtprotoAdminDefs:"com.atproto.admin.defs",ComAtprotoAdminDeleteAccount:"com.atproto.admin.deleteAccount",ComAtprotoAdminDisableAccountInvites:"com.atproto.admin.disableAccountInvites",ComAtprotoAdminDisableInviteCodes:"com.atproto.admin.disableInviteCodes",ComAtprotoAdminEnableAccountInvites:"com.atproto.admin.enableAccountInvites",ComAtprotoAdminGetAccountInfo:"com.atproto.admin.getAccountInfo",ComAtprotoAdminGetAccountInfos:"com.atproto.admin.getAccountInfos",ComAtprotoAdminGetInviteCodes:"com.atproto.admin.getInviteCodes",ComAtprotoAdminGetSubjectStatus:"com.atproto.admin.getSubjectStatus",ComAtprotoAdminSearchAccounts:"com.atproto.admin.searchAccounts",ComAtprotoAdminSendEmail:"com.atproto.admin.sendEmail",ComAtprotoAdminUpdateAccountEmail:"com.atproto.admin.updateAccountEmail",ComAtprotoAdminUpdateAccountHandle:"com.atproto.admin.updateAccountHandle",ComAtprotoAdminUpdateAccountPassword:"com.atproto.admin.updateAccountPassword",ComAtprotoAdminUpdateAccountSigningKey:"com.atproto.admin.updateAccountSigningKey",ComAtprotoAdminUpdateSubjectStatus:"com.atproto.admin.updateSubjectStatus",ComAtprotoIdentityDefs:"com.atproto.identity.defs",ComAtprotoIdentityGetRecommendedDidCredentials:"com.atproto.identity.getRecommendedDidCredentials",ComAtprotoIdentityRefreshIdentity:"com.atproto.identity.refreshIdentity",ComAtprotoIdentityRequestPlcOperationSignature:"com.atproto.identity.requestPlcOperationSignature",ComAtprotoIdentityResolveDid:"com.atproto.identity.resolveDid",ComAtprotoIdentityResolveHandle:"com.atproto.identity.resolveHandle",ComAtprotoIdentityResolveIdentity:"com.atproto.identity.resolveIdentity",ComAtprotoIdentitySignPlcOperation:"com.atproto.identity.signPlcOperation",ComAtprotoIdentitySubmitPlcOperation:"com.atproto.identity.submitPlcOperation",ComAtprotoIdentityUpdateHandle:"com.atproto.identity.updateHandle",ComAtprotoLabelDefs:"com.atproto.label.defs",ComAtprotoLabelQueryLabels:"com.atproto.label.queryLabels",ComAtprotoLabelSubscribeLabels:"com.atproto.label.subscribeLabels",ComAtprotoLexiconResolveLexicon:"com.atproto.lexicon.resolveLexicon",ComAtprotoLexiconSchema:"com.atproto.lexicon.schema",ComAtprotoModerationCreateReport:"com.atproto.moderation.createReport",ComAtprotoModerationDefs:"com.atproto.moderation.defs",ComAtprotoRepoApplyWrites:"com.atproto.repo.applyWrites",ComAtprotoRepoCreateRecord:"com.atproto.repo.createRecord",ComAtprotoRepoDefs:"com.atproto.repo.defs",ComAtprotoRepoDeleteRecord:"com.atproto.repo.deleteRecord",ComAtprotoRepoDescribeRepo:"com.atproto.repo.describeRepo",ComAtprotoRepoGetRecord:"com.atproto.repo.getRecord",ComAtprotoRepoImportRepo:"com.atproto.repo.importRepo",ComAtprotoRepoListMissingBlobs:"com.atproto.repo.listMissingBlobs",ComAtprotoRepoListRecords:"com.atproto.repo.listRecords",ComAtprotoRepoPutRecord:"com.atproto.repo.putRecord",ComAtprotoRepoStrongRef:"com.atproto.repo.strongRef",ComAtprotoRepoUploadBlob:"com.atproto.repo.uploadBlob",ComAtprotoServerActivateAccount:"com.atproto.server.activateAccount",ComAtprotoServerCheckAccountStatus:"com.atproto.server.checkAccountStatus",ComAtprotoServerConfirmEmail:"com.atproto.server.confirmEmail",ComAtprotoServerCreateAccount:"com.atproto.server.createAccount",ComAtprotoServerCreateAppPassword:"com.atproto.server.createAppPassword",ComAtprotoServerCreateInviteCode:"com.atproto.server.createInviteCode",ComAtprotoServerCreateInviteCodes:"com.atproto.server.createInviteCodes",ComAtprotoServerCreateSession:"com.atproto.server.createSession",ComAtprotoServerDeactivateAccount:"com.atproto.server.deactivateAccount",ComAtprotoServerDefs:"com.atproto.server.defs",ComAtprotoServerDeleteAccount:"com.atproto.server.deleteAccount",ComAtprotoServerDeleteSession:"com.atproto.server.deleteSession",ComAtprotoServerDescribeServer:"com.atproto.server.describeServer",ComAtprotoServerGetAccountInviteCodes:"com.atproto.server.getAccountInviteCodes",ComAtprotoServerGetServiceAuth:"com.atproto.server.getServiceAuth",ComAtprotoServerGetSession:"com.atproto.server.getSession",ComAtprotoServerListAppPasswords:"com.atproto.server.listAppPasswords",ComAtprotoServerRefreshSession:"com.atproto.server.refreshSession",ComAtprotoServerRequestAccountDelete:"com.atproto.server.requestAccountDelete",ComAtprotoServerRequestEmailConfirmation:"com.atproto.server.requestEmailConfirmation",ComAtprotoServerRequestEmailUpdate:"com.atproto.server.requestEmailUpdate",ComAtprotoServerRequestPasswordReset:"com.atproto.server.requestPasswordReset",ComAtprotoServerReserveSigningKey:"com.atproto.server.reserveSigningKey",ComAtprotoServerResetPassword:"com.atproto.server.resetPassword",ComAtprotoServerRevokeAppPassword:"com.atproto.server.revokeAppPassword",ComAtprotoServerUpdateEmail:"com.atproto.server.updateEmail",ComAtprotoSyncDefs:"com.atproto.sync.defs",ComAtprotoSyncGetBlob:"com.atproto.sync.getBlob",ComAtprotoSyncGetBlocks:"com.atproto.sync.getBlocks",ComAtprotoSyncGetCheckout:"com.atproto.sync.getCheckout",ComAtprotoSyncGetHead:"com.atproto.sync.getHead",ComAtprotoSyncGetHostStatus:"com.atproto.sync.getHostStatus",ComAtprotoSyncGetLatestCommit:"com.atproto.sync.getLatestCommit",ComAtprotoSyncGetRecord:"com.atproto.sync.getRecord",ComAtprotoSyncGetRepo:"com.atproto.sync.getRepo",ComAtprotoSyncGetRepoStatus:"com.atproto.sync.getRepoStatus",ComAtprotoSyncListBlobs:"com.atproto.sync.listBlobs",ComAtprotoSyncListHosts:"com.atproto.sync.listHosts",ComAtprotoSyncListRepos:"com.atproto.sync.listRepos",ComAtprotoSyncListReposByCollection:"com.atproto.sync.listReposByCollection",ComAtprotoSyncNotifyOfUpdate:"com.atproto.sync.notifyOfUpdate",ComAtprotoSyncRequestCrawl:"com.atproto.sync.requestCrawl",ComAtprotoSyncSubscribeRepos:"com.atproto.sync.subscribeRepos",ComAtprotoTempAddReservedHandle:"com.atproto.temp.addReservedHandle",ComAtprotoTempCheckHandleAvailability:"com.atproto.temp.checkHandleAvailability",ComAtprotoTempCheckSignupQueue:"com.atproto.temp.checkSignupQueue",ComAtprotoTempDereferenceScope:"com.atproto.temp.dereferenceScope",ComAtprotoTempFetchLabels:"com.atproto.temp.fetchLabels",ComAtprotoTempRequestPhoneVerification:"com.atproto.temp.requestPhoneVerification",ComAtprotoTempRevokeAccountCredentials:"com.atproto.temp.revokeAccountCredentials",ComGermnetworkDeclaration:"com.germnetwork.declaration",ToolsOzoneCommunicationCreateTemplate:"tools.ozone.communication.createTemplate",ToolsOzoneCommunicationDefs:"tools.ozone.communication.defs",ToolsOzoneCommunicationDeleteTemplate:"tools.ozone.communication.deleteTemplate",ToolsOzoneCommunicationListTemplates:"tools.ozone.communication.listTemplates",ToolsOzoneCommunicationUpdateTemplate:"tools.ozone.communication.updateTemplate",ToolsOzoneHostingGetAccountHistory:"tools.ozone.hosting.getAccountHistory",ToolsOzoneInboxAppealActionedSubject:"tools.ozone.inbox.appealActionedSubject",ToolsOzoneInboxDefs:"tools.ozone.inbox.defs",ToolsOzoneModerationCancelScheduledActions:"tools.ozone.moderation.cancelScheduledActions",ToolsOzoneModerationDefs:"tools.ozone.moderation.defs",ToolsOzoneModerationEmitEvent:"tools.ozone.moderation.emitEvent",ToolsOzoneModerationGetAccountPreferences:"tools.ozone.moderation.getAccountPreferences",ToolsOzoneModerationGetAccountTimeline:"tools.ozone.moderation.getAccountTimeline",ToolsOzoneModerationGetEvent:"tools.ozone.moderation.getEvent",ToolsOzoneModerationGetRecord:"tools.ozone.moderation.getRecord",ToolsOzoneModerationGetRecords:"tools.ozone.moderation.getRecords",ToolsOzoneModerationGetRepo:"tools.ozone.moderation.getRepo",ToolsOzoneModerationGetReporterStats:"tools.ozone.moderation.getReporterStats",ToolsOzoneModerationGetRepos:"tools.ozone.moderation.getRepos",ToolsOzoneModerationGetSubjects:"tools.ozone.moderation.getSubjects",ToolsOzoneModerationListScheduledActions:"tools.ozone.moderation.listScheduledActions",ToolsOzoneModerationQueryEvents:"tools.ozone.moderation.queryEvents",ToolsOzoneModerationQueryStatuses:"tools.ozone.moderation.queryStatuses",ToolsOzoneModerationScheduleAction:"tools.ozone.moderation.scheduleAction",ToolsOzoneModerationSearchRepos:"tools.ozone.moderation.searchRepos",ToolsOzoneQueueAssignModerator:"tools.ozone.queue.assignModerator",ToolsOzoneQueueCreateQueue:"tools.ozone.queue.createQueue",ToolsOzoneQueueDefs:"tools.ozone.queue.defs",ToolsOzoneQueueDeleteQueue:"tools.ozone.queue.deleteQueue",ToolsOzoneQueueGetAssignments:"tools.ozone.queue.getAssignments",ToolsOzoneQueueListQueues:"tools.ozone.queue.listQueues",ToolsOzoneQueueRouteReports:"tools.ozone.queue.routeReports",ToolsOzoneQueueUnassignModerator:"tools.ozone.queue.unassignModerator",ToolsOzoneQueueUpdateQueue:"tools.ozone.queue.updateQueue",ToolsOzoneReportAssignModerator:"tools.ozone.report.assignModerator",ToolsOzoneReportCloseReports:"tools.ozone.report.closeReports",ToolsOzoneReportCreateActivity:"tools.ozone.report.createActivity",ToolsOzoneReportDefs:"tools.ozone.report.defs",ToolsOzoneReportGetAssignments:"tools.ozone.report.getAssignments",ToolsOzoneReportGetHistoricalStats:"tools.ozone.report.getHistoricalStats",ToolsOzoneReportGetLatestReport:"tools.ozone.report.getLatestReport",ToolsOzoneReportGetLiveStats:"tools.ozone.report.getLiveStats",ToolsOzoneReportGetReport:"tools.ozone.report.getReport",ToolsOzoneReportListActivities:"tools.ozone.report.listActivities",ToolsOzoneReportQueryActivities:"tools.ozone.report.queryActivities",ToolsOzoneReportQueryReports:"tools.ozone.report.queryReports",ToolsOzoneReportReassignQueue:"tools.ozone.report.reassignQueue",ToolsOzoneReportRefreshStats:"tools.ozone.report.refreshStats",ToolsOzoneReportUnassignModerator:"tools.ozone.report.unassignModerator",ToolsOzoneSafelinkAddRule:"tools.ozone.safelink.addRule",ToolsOzoneSafelinkDefs:"tools.ozone.safelink.defs",ToolsOzoneSafelinkQueryEvents:"tools.ozone.safelink.queryEvents",ToolsOzoneSafelinkQueryRules:"tools.ozone.safelink.queryRules",ToolsOzoneSafelinkRemoveRule:"tools.ozone.safelink.removeRule",ToolsOzoneSafelinkUpdateRule:"tools.ozone.safelink.updateRule",ToolsOzoneServerGetConfig:"tools.ozone.server.getConfig",ToolsOzoneSetAddValues:"tools.ozone.set.addValues",ToolsOzoneSetDefs:"tools.ozone.set.defs",ToolsOzoneSetDeleteSet:"tools.ozone.set.deleteSet",ToolsOzoneSetDeleteValues:"tools.ozone.set.deleteValues",ToolsOzoneSetGetValues:"tools.ozone.set.getValues",ToolsOzoneSetQuerySets:"tools.ozone.set.querySets",ToolsOzoneSetUpsertSet:"tools.ozone.set.upsertSet",ToolsOzoneSettingDefs:"tools.ozone.setting.defs",ToolsOzoneSettingListOptions:"tools.ozone.setting.listOptions",ToolsOzoneSettingRemoveOptions:"tools.ozone.setting.removeOptions",ToolsOzoneSettingUpsertOption:"tools.ozone.setting.upsertOption",ToolsOzoneSignatureDefs:"tools.ozone.signature.defs",ToolsOzoneSignatureFindCorrelation:"tools.ozone.signature.findCorrelation",ToolsOzoneSignatureFindRelatedAccounts:"tools.ozone.signature.findRelatedAccounts",ToolsOzoneSignatureSearchAccounts:"tools.ozone.signature.searchAccounts",ToolsOzoneTeamAddMember:"tools.ozone.team.addMember",ToolsOzoneTeamDefs:"tools.ozone.team.defs",ToolsOzoneTeamDeleteMember:"tools.ozone.team.deleteMember",ToolsOzoneTeamListMembers:"tools.ozone.team.listMembers",ToolsOzoneTeamUpdateMember:"tools.ozone.team.updateMember",ToolsOzoneVerificationDefs:"tools.ozone.verification.defs",ToolsOzoneVerificationGrantVerifications:"tools.ozone.verification.grantVerifications",ToolsOzoneVerificationListVerifications:"tools.ozone.verification.listVerifications",ToolsOzoneVerificationRevokeVerifications:"tools.ozone.verification.revokeVerifications"};var Bp=n.object({error:n.string().optional(),message:n.string().optional()}),M;(function(t){t[t.Unknown=1]="Unknown",t[t.InvalidResponse=2]="InvalidResponse",t[t.Success=200]="Success",t[t.InvalidRequest=400]="InvalidRequest",t[t.AuthenticationRequired=401]="AuthenticationRequired",t[t.Forbidden=403]="Forbidden",t[t.XRPCNotSupported=404]="XRPCNotSupported",t[t.NotAcceptable=406]="NotAcceptable",t[t.PayloadTooLarge=413]="PayloadTooLarge",t[t.UnsupportedMediaType=415]="UnsupportedMediaType",t[t.RateLimitExceeded=429]="RateLimitExceeded",t[t.InternalServerError=500]="InternalServerError",t[t.MethodNotImplemented=501]="MethodNotImplemented",t[t.UpstreamFailure=502]="UpstreamFailure",t[t.NotEnoughResources=503]="NotEnoughResources",t[t.UpstreamTimeout=504]="UpstreamTimeout"})(M||(M={}));function Gr(t){return t in M?t:t>=100&&t<200?M.XRPCNotSupported:t>=200&&t<300?M.Success:t>=300&&t<400?M.XRPCNotSupported:t>=400&&t<500?M.InvalidRequest:M.InternalServerError}function $q(t){return M[Gr(t)]}var Nw={[M.Unknown]:"Unknown",[M.InvalidResponse]:"Invalid Response",[M.Success]:"Success",[M.InvalidRequest]:"Invalid Request",[M.AuthenticationRequired]:"Authentication Required",[M.Forbidden]:"Forbidden",[M.XRPCNotSupported]:"XRPC Not Supported",[M.NotAcceptable]:"Not Acceptable",[M.PayloadTooLarge]:"Payload Too Large",[M.UnsupportedMediaType]:"Unsupported Media Type",[M.RateLimitExceeded]:"Rate Limit Exceeded",[M.InternalServerError]:"Internal Server Error",[M.MethodNotImplemented]:"Method Not Implemented",[M.UpstreamFailure]:"Upstream Failure",[M.NotEnoughResources]:"Not Enough Resources",[M.UpstreamTimeout]:"Upstream Timeout"};function Mq(t){return Nw[Gr(t)]}var tn=class{constructor(e,r){this.data=e,this.headers=r,this.success=!0}},p=class t extends Error{constructor(e,r=$q(e),o,i,s){super(o||r||Mq(e),s),this.error=r,this.headers=i,this.success=!1,this.status=Gr(e);let a=s?.cause;this.cause===void 0&&a!==void 0&&(this.cause=a)}static from(e,r){if(e instanceof t)return e;let o=e instanceof Error?e:void 0,i=e instanceof Response?e:e?.response instanceof Response?e.response:void 0,s=o?.statusCode??o?.status??i?.status,a=typeof s=="number"?Gr(s):r??M.Unknown,c=o?.message??String(e),u=i?Object.fromEntries(i.headers.entries()):void 0;return new t(a,void 0,c,u,{cause:e})}},rn=class extends p{constructor(e,r,o){super(M.InvalidResponse,Nw[M.InvalidResponse],"The server gave an invalid response and may be out of date.",void 0,{cause:r}),this.lexiconNsid=e,this.validationError=r,this.responseBody=o}};var Uo=globalThis.ReadableStream||class{constructor(){throw new Error("ReadableStream is not supported in this environment")}};function Hw(t){return Bp.safeParse(t).success}function Jw(t){return t.type==="procedure"?"post":"get"}function Ww(t,e,r){let o=`/xrpc/${encodeURIComponent(t)}`;if(!r)return o;let i=[];for(let[s,a]of Object.entries(r)){let c=e.parameters?.properties?.[s];if(!c)throw new Error(`Invalid query parameter: ${s}`);if(a!==void 0)if(c.type==="array"){let u=Array.isArray(a)?a:[a];for(let f of u)i.push([s,Kw(c.items.type,f)])}else i.push([s,Kw(c.type,a)])}return i.length?`${o}?${new URLSearchParams(i).toString()}`:o}function Kw(t,e){if(t==="string"||t==="unknown")return String(e);if(t==="float")return String(Number(e));if(t==="integer")return String(Number(e)|0);if(t==="boolean")return e?"true":"false";if(t==="datetime")return e instanceof Date?e.toISOString():String(e);throw new Error(`Unsupported query param type: ${t}`)}function Xw(t,e,r){let o=new Headers;if(r?.headers)for(let i in r.headers){if(o.has(i))throw new TypeError(`Duplicate header: ${i}`);let s=r.headers[i];s!=null&&o.set(i,s)}if(t.type==="procedure"){if(r?.encoding)o.set("content-type",r.encoding);else if(!o.has("content-type")&&typeof e<"u")if(e instanceof ArrayBuffer||e instanceof Uo||ArrayBuffer.isView(e))o.set("content-type","application/octet-stream");else if(e instanceof FormData)o.set("content-type","multipart/form-data");else if(e instanceof URLSearchParams)o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8");else if(Qw(e))o.set("content-type",e.type||"application/octet-stream");else if(typeof e=="string")o.set("content-type","text/plain;charset=UTF-8");else if(Zw(e))o.set("content-type","application/octet-stream");else if(typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="object")o.set("content-type","application/json");else throw new p(M.InvalidRequest,`Unsupported data type: ${typeof e}`)}return o}function Fr(t,e){if(!e)return t;let r;for(let[o,i]of e){if(i===void 0||(r??=new Headers(t),r.has(o)))continue;let s=typeof i=="function"?i():i;if(typeof s=="string")r.set(o,s);else if(s===null)r.delete(o);else throw new TypeError(`Invalid "${o}" header value: ${typeof s}`)}return r??t}function Qw(t){if(t==null||typeof t!="object")return!1;if(typeof Blob=="function"&&t instanceof Blob)return!0;let e=t[Symbol.toStringTag];return e==="Blob"||e==="File"?"stream"in t&&typeof t.stream=="function":!1}function Vq(t){switch(typeof t){case"string":return!0;case"object":return t instanceof ArrayBuffer||t instanceof FormData||t instanceof URLSearchParams||t instanceof Uo||ArrayBuffer.isView(t)||Qw(t);default:return!1}}function Zw(t){return t!=null&&typeof t=="object"&&(Symbol.iterator in t||Symbol.asyncIterator in t)}function Yw(t,e){let r=t.get("content-type");if(!r)return;if(typeof e>"u")throw new p(M.InvalidRequest,"A request body is expected but none was provided");if(Vq(e))return e instanceof FormData&&r==="multipart/form-data"&&t.delete("content-type"),e;if(Zw(e))return Oq(e);if(r.startsWith("text/"))return new TextEncoder().encode(String(e));if(r.startsWith("application/json")){let i=Pp(e);if(i===void 0)throw new p(M.InvalidRequest,"Failed to encode request body as JSON");return new TextEncoder().encode(i)}let o=!e||typeof e!="object"?typeof e:e.constructor!==Object&&typeof e.constructor=="function"&&typeof e.constructor?.name=="string"?e.constructor.name:"object";throw new p(M.InvalidRequest,`Unable to encode ${o} as ${r} data`)}function Oq(t){if("from"in Uo&&typeof Uo.from=="function")return Uo.from(t);throw new TypeError("ReadableStream.from() is not supported in this environment. It is required to support using iterables as the request body. Consider using a polyfill or re-write your code to use a different body type.")}function ek(t,e){try{if(t){if(t.includes("application/json")){let r=new TextDecoder().decode(e);return jp(r)}if(t.startsWith("text/"))return new TextDecoder().decode(e)}return e instanceof ArrayBuffer?new Uint8Array(e):e}catch(r){throw new p(M.InvalidResponse,void 0,`Failed to parse response body: ${String(r)}`,void 0,{cause:r})}}function on(t){if(typeof t=="function")return t;if(typeof t=="object"&&"fetchHandler"in t)return t.fetchHandler.bind(t);let{service:e,headers:r=void 0,fetch:o=globalThis.fetch}=typeof t=="string"||t instanceof URL?{service:t}:t;if(typeof o!="function")throw new TypeError("XrpcDispatcher requires fetch() to be available in your environment.");let i=r!=null?Object.entries(r):void 0;return async function(s,a){let c=typeof e=="function"?e():e,u=new URL(s,c),f=Fr(a.headers,i);return o(u,{...a,headers:f})}}var At=class{constructor(e,r){this.headers=new Map,this.fetchHandler=on(e),this.lex=r instanceof qe?r:new qe(r)}setHeader(e,r){this.headers.set(e.toLowerCase(),r)}unsetHeader(e){this.headers.delete(e.toLowerCase())}clearHeaders(){this.headers.clear()}async call(e,r,o,i){let s=this.lex.getDefOrThrow(e);if(!s||s.type!=="query"&&s.type!=="procedure")throw new TypeError(`Invalid lexicon: ${e}. Must be a query or procedure.`);let a=Ww(e,s,r),c=Jw(s),u=Xw(s,o,i),f=Yw(u,o),m={method:c,headers:Fr(u,this.headers),body:f,duplex:"half",redirect:"follow",signal:i?.signal};try{let h=await this.fetchHandler.call(void 0,a,m),g=h.status,b=Object.fromEntries(h.headers.entries()),v=await h.arrayBuffer(),x=ek(h.headers.get("content-type"),v),I=Gr(g);if(I!==M.Success){let{error:k=void 0,message:B=void 0}=x&&Hw(x)?x:{};throw new p(I,k,B,b)}try{this.lex.assertValidXrpcOutput(e,x)}catch(k){throw k instanceof C?new rn(e,k,x):k}return new tn(x,b)}catch(h){throw p.from(h)}}};var sn=class{constructor(){this.lex=new qe}get fetch(){throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.")}set fetch(e){throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.")}async call(e,r,o,i,s){return this.service(e).call(r,o,i,s)}service(e){return new Lp(this,e)}addLexicon(e){this.lex.add(e)}addLexicons(e){for(let r of e)this.addLexicon(r)}removeLexicon(e){this.lex.remove(e)}},Lp=class extends At{constructor(e,r){super(async(o,i)=>{let s=Fr(i.headers,Object.entries(this.headers));return fetch(new URL(o,this.uri),{...i,headers:s})},e.lex),this.baseClient=e,this.uri=typeof r=="string"?new URL(r):r}};var $Q=new sn;function zq(t){return!t.includes(" ")&&!t.includes("#")}function Go(t){if(!t.startsWith("did:")||t.length<8||t.length>2048)return!1;let e=t.indexOf(":",4);return e>4&&e<t.length-1}function Uq(t){if(!Go(t))throw new TypeError(`Invalid DID: ${t}`)}function nn(t){return Uq(t),t}function Gq(t){let{length:e,[0]:r,[1]:o}=t.split("#");return e===2&&Go(r)&&zq(o)}function Fq(t){if(!Gq(t))throw new TypeError(`Invalid DID reference: ${t} (must be of the form did:example:alice#service)`)}function tk(t){return Fq(t),t}var rk="did:plc:ar7c4by46qjdydhdevvrndac";function $p(t){return t.trim().replace(/^#(?!\ufe0f)/,"").replace(/[\r\n\u00AD\u2060\u200D\u200C\u200B]+/,"")}function ok(t){let e=[],r=[];for(let o of t)o.pinned&&e.push(o.value),r.push(o.value);return{pinned:e,saved:r}}function Mp(t){switch(new ge(t).collection){case"app.bsky.feed.generator":return"feed";case"app.bsky.graph.list":return"list";default:return"unknown"}}function an(t){if(!t.id)throw new Error("Saved feed must have an `id` - use a TID");if(["feed","list"].includes(t.type)){let e=new ge(t.value),r=e.collection==="app.bsky.feed.generator",o=e.collection==="app.bsky.graph.list";if(t.type==="feed"&&!r)throw new Error(`Saved feed of type 'feed' must be a feed, got ${e.collection}`);if(t.type==="list"&&!o)throw new Error(`Saved feed of type 'list' must be a list, got ${e.collection}`)}}var Nq=n.object({id:n.string().max(64),completed:n.boolean(),data:n.string().max(300).optional(),expiresAt:n.string().datetime().optional()}).strict();function ik(t){Nq.parse(t)}var T={};Ct(T,{isAdultContentPref:()=>hB,isBskyAppProgressGuide:()=>HB,isBskyAppStatePref:()=>NB,isContentLabelPref:()=>gB,isDeclaredAgePref:()=>_B,isFeedViewPref:()=>IB,isHiddenPostsPref:()=>VB,isInterestsPref:()=>jB,isKnownFollowers:()=>cB,isLabelerPrefItem:()=>GB,isLabelersPref:()=>zB,isLiveEventPreferences:()=>YB,isMutedWord:()=>BB,isMutedWordsPref:()=>$B,isNux:()=>WB,isPersonalDetailsPref:()=>RB,isPostInteractionSettingsPref:()=>tL,isProfileAssociated:()=>Yq,isProfileAssociatedActivitySubscription:()=>sB,isProfileAssociatedChat:()=>tB,isProfileAssociatedGerm:()=>oB,isProfileView:()=>Wq,isProfileViewBasic:()=>Hq,isProfileViewDetailed:()=>Qq,isSavedFeed:()=>vB,isSavedFeedsPref:()=>AB,isSavedFeedsPrefV2:()=>wB,isStatusView:()=>oL,isThreadViewPref:()=>TB,isVerificationPrefs:()=>QB,isVerificationState:()=>lB,isVerificationView:()=>fB,isViewerState:()=>aB,validateAdultContentPref:()=>yB,validateBskyAppProgressGuide:()=>JB,validateBskyAppStatePref:()=>KB,validateContentLabelPref:()=>bB,validateDeclaredAgePref:()=>EB,validateFeedViewPref:()=>DB,validateHiddenPostsPref:()=>OB,validateInterestsPref:()=>qB,validateKnownFollowers:()=>dB,validateLabelerPrefItem:()=>FB,validateLabelersPref:()=>UB,validateLiveEventPreferences:()=>eL,validateMutedWord:()=>LB,validateMutedWordsPref:()=>MB,validateNux:()=>XB,validatePersonalDetailsPref:()=>CB,validatePostInteractionSettingsPref:()=>rL,validateProfileAssociated:()=>eB,validateProfileAssociatedActivitySubscription:()=>nB,validateProfileAssociatedChat:()=>rB,validateProfileAssociatedGerm:()=>iB,validateProfileView:()=>Xq,validateProfileViewBasic:()=>Jq,validateProfileViewDetailed:()=>Zq,validateSavedFeed:()=>xB,validateSavedFeedsPref:()=>SB,validateSavedFeedsPrefV2:()=>kB,validateStatusView:()=>iL,validateThreadViewPref:()=>PB,validateVerificationPrefs:()=>ZB,validateVerificationState:()=>uB,validateVerificationView:()=>mB,validateViewerState:()=>pB});var V=d,O=l,S="app.bsky.actor.defs",sk="profileViewBasic";function Hq(t){return V(t,S,sk)}function Jq(t){return O(t,S,sk)}var nk="profileView";function Wq(t){return V(t,S,nk)}function Xq(t){return O(t,S,nk)}var ak="profileViewDetailed";function Qq(t){return V(t,S,ak)}function Zq(t){return O(t,S,ak)}var pk="profileAssociated";function Yq(t){return V(t,S,pk)}function eB(t){return O(t,S,pk)}var ck="profileAssociatedChat";function tB(t){return V(t,S,ck)}function rB(t){return O(t,S,ck)}var dk="profileAssociatedGerm";function oB(t){return V(t,S,dk)}function iB(t){return O(t,S,dk)}var lk="profileAssociatedActivitySubscription";function sB(t){return V(t,S,lk)}function nB(t){return O(t,S,lk)}var uk="viewerState";function aB(t){return V(t,S,uk)}function pB(t){return O(t,S,uk)}var fk="knownFollowers";function cB(t){return V(t,S,fk)}function dB(t){return O(t,S,fk)}var mk="verificationState";function lB(t){return V(t,S,mk)}function uB(t){return O(t,S,mk)}var hk="verificationView";function fB(t){return V(t,S,hk)}function mB(t){return O(t,S,hk)}var yk="adultContentPref";function hB(t){return V(t,S,yk)}function yB(t){return O(t,S,yk)}var gk="contentLabelPref";function gB(t){return V(t,S,gk)}function bB(t){return O(t,S,gk)}var bk="savedFeed";function vB(t){return V(t,S,bk)}function xB(t){return O(t,S,bk)}var vk="savedFeedsPrefV2";function wB(t){return V(t,S,vk)}function kB(t){return O(t,S,vk)}var xk="savedFeedsPref";function AB(t){return V(t,S,xk)}function SB(t){return O(t,S,xk)}var wk="personalDetailsPref";function RB(t){return V(t,S,wk)}function CB(t){return O(t,S,wk)}var kk="declaredAgePref";function _B(t){return V(t,S,kk)}function EB(t){return O(t,S,kk)}var Ak="feedViewPref";function IB(t){return V(t,S,Ak)}function DB(t){return O(t,S,Ak)}var Sk="threadViewPref";function TB(t){return V(t,S,Sk)}function PB(t){return O(t,S,Sk)}var Rk="interestsPref";function jB(t){return V(t,S,Rk)}function qB(t){return O(t,S,Rk)}var Ck="mutedWord";function BB(t){return V(t,S,Ck)}function LB(t){return O(t,S,Ck)}var _k="mutedWordsPref";function $B(t){return V(t,S,_k)}function MB(t){return O(t,S,_k)}var Ek="hiddenPostsPref";function VB(t){return V(t,S,Ek)}function OB(t){return O(t,S,Ek)}var Ik="labelersPref";function zB(t){return V(t,S,Ik)}function UB(t){return O(t,S,Ik)}var Dk="labelerPrefItem";function GB(t){return V(t,S,Dk)}function FB(t){return O(t,S,Dk)}var Tk="bskyAppStatePref";function NB(t){return V(t,S,Tk)}function KB(t){return O(t,S,Tk)}var Pk="bskyAppProgressGuide";function HB(t){return V(t,S,Pk)}function JB(t){return O(t,S,Pk)}var jk="nux";function WB(t){return V(t,S,jk)}function XB(t){return O(t,S,jk)}var qk="verificationPrefs";function QB(t){return V(t,S,qk)}function ZB(t){return O(t,S,qk)}var Bk="liveEventPreferences";function YB(t){return V(t,S,Bk)}function eL(t){return O(t,S,Bk)}var Lk="postInteractionSettingsPref";function tL(t){return V(t,S,Lk)}function rL(t){return O(t,S,Lk)}var $k="statusView";function oL(t){return V(t,S,$k)}function iL(t){return O(t,S,$k)}var Nr={};Ct(Nr,{isMain:()=>lL,isRecord:()=>lL,validateMain:()=>uL,validateRecord:()=>uL});var cL=d,dL=l,Mk="app.bsky.actor.profile",Vk="main";function lL(t){return cL(t,Mk,Vk)}function uL(t){return dL(t,Mk,Vk,!0)}var yL="app.bsky.actor.status";var w7=`${yL}#live`;var Vp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Op=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},zp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Up=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Ok(t){if(t instanceof p){if(t.error==="InvalidEmail")return new Vp(t);if(t.error==="DidTooLong")return new Op(t);if(t.error==="InvalidInitiation")return new zp(t);if(t.error==="RegionNotSupported")return new Up(t)}return t}var Gp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Gk(t){return t instanceof p&&t.error==="UnsupportedCollection"?new Gp(t):t}var Fp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Nk(t){return t instanceof p&&t.error==="UnsupportedCollection"?new Fp(t):t}var Np=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Kp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Hk(t){if(t instanceof p){if(t.error==="InvalidDid")return new Np(t);if(t.error==="InternalError")return new Kp(t)}return t}var Hp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Jp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Wp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Xp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Wk(t){if(t instanceof p){if(t.error==="InvalidDid")return new Hp(t);if(t.error==="InvalidLimit")return new Jp(t);if(t.error==="InvalidCursor")return new Wp(t);if(t.error==="InternalError")return new Xp(t)}return t}var Qp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Zp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Qk(t){if(t instanceof p){if(t.error==="InvalidDid")return new Qp(t);if(t.error==="InternalError")return new Zp(t)}return t}var Yp=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ec=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},tc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},rc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},oc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function Yk(t){if(t instanceof p){if(t.error==="InvalidDid")return new Yp(t);if(t.error==="InvalidContacts")return new ec(t);if(t.error==="TooManyContacts")return new tc(t);if(t.error==="InvalidToken")return new rc(t);if(t.error==="InternalError")return new oc(t)}return t}var ic=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},sc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function tA(t){if(t instanceof p){if(t.error==="InvalidDid")return new ic(t);if(t.error==="InternalError")return new sc(t)}return t}var nc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ac=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},pc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},cc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function oA(t){if(t instanceof p){if(t.error==="RateLimitExceeded")return new nc(t);if(t.error==="InvalidDid")return new ac(t);if(t.error==="InvalidPhone")return new pc(t);if(t.error==="InternalError")return new cc(t)}return t}var dc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},lc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},uc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},fc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},mc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function sA(t){if(t instanceof p){if(t.error==="RateLimitExceeded")return new dc(t);if(t.error==="InvalidDid")return new lc(t);if(t.error==="InvalidPhone")return new uc(t);if(t.error==="InvalidCode")return new fc(t);if(t.error==="InternalError")return new mc(t)}return t}var hc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function aA(t){return t instanceof p&&t.error==="DraftLimitReached"?new hc(t):t}var ye="app.bsky.feed.defs";var vre=`${ye}#requestLess`,xre=`${ye}#requestMore`,wre=`${ye}#clickthroughItem`,kre=`${ye}#clickthroughAuthor`,Are=`${ye}#clickthroughReposter`,Sre=`${ye}#clickthroughEmbed`,Rre=`${ye}#contentModeUnspecified`,Cre=`${ye}#contentModeVideo`,_re=`${ye}#interactionSeen`,Ere=`${ye}#interactionLike`,Ire=`${ye}#interactionRepost`,Dre=`${ye}#interactionReply`,Tre=`${ye}#interactionQuote`,Pre=`${ye}#interactionShare`;var bc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},vc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function uA(t){if(t instanceof p){if(t.error==="BlockedActor")return new bc(t);if(t.error==="BlockedByActor")return new vc(t)}return t}var xc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},wc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function mA(t){if(t instanceof p){if(t.error==="BlockedActor")return new xc(t);if(t.error==="BlockedByActor")return new wc(t)}return t}var kc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function yA(t){return t instanceof p&&t.error==="UnknownFeed"?new kc(t):t}var Ac=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function bA(t){return t instanceof p&&t.error==="UnknownFeed"?new Ac(t):t}var Sc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function xA(t){return t instanceof p&&t.error==="UnknownList"?new Sc(t):t}var Rc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function kA(t){return t instanceof p&&t.error==="NotFound"?new Rc(t):t}var Cc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function RA(t){return t instanceof p&&t.error==="BadQueryString"?new Cc(t):t}var _c=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function _A(t){return t instanceof p&&t.error==="BadQueryString"?new _c(t):t}var Ec="app.bsky.graph.defs";var cne=`${Ec}#modlist`,dne=`${Ec}#curatelist`,lne=`${Ec}#referencelist`;var Ic=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function IA(t){return t instanceof p&&t.error==="ActorNotFound"?new Ic(t):t}var Tc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Pc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},jc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function TA(t){if(t instanceof p){if(t.error==="InvalidEmail")return new Tc(t);if(t.error==="DidTooLong")return new Pc(t);if(t.error==="InvalidInitiation")return new jc(t)}return t}var qc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function jA(t){return t instanceof p&&t.error==="BadQueryString"?new qc(t):t}var Bc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function BA(t){return t instanceof p&&t.error==="BadQueryString"?new Bc(t):t}var Lc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function $A(t){return t instanceof p&&t.error==="BadQueryString"?new Lc(t):t}var $c=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Mc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function VA(t){if(t instanceof p){if(t.error==="UploadNotFound")return new $c(t);if(t.error==="UploadNotReady")return new Mc(t)}return t}var Vc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Oc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},zc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Uc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Gc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Fc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Nc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Kc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function zA(t){if(t instanceof p){if(t.error==="UploadNotFound")return new Vc(t);if(t.error==="UploadExpired")return new Oc(t);if(t.error==="MissingParts")return new zc(t);if(t.error==="UploadNotReady")return new Uc(t);if(t.error==="UnsupportedContentType")return new Gc(t);if(t.error==="UploadFailed")return new Fc(t);if(t.error==="UploadAborted")return new Nc(t);if(t.error==="ServiceOverloaded")return new Kc(t)}return t}var Hc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function GA(t){return t instanceof p&&t.error==="UploadNotFound"?new Hc(t):t}var Jc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Wc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Xc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Qc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Zc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Yc=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ed=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},td=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function NA(t){if(t instanceof p){if(t.error==="UnsupportedContentType")return new Jc(t);if(t.error==="VideoTooLarge")return new Wc(t);if(t.error==="VideoTooLong")return new Xc(t);if(t.error==="BadAspectRatio")return new Qc(t);if(t.error==="DailyLimitExceeded")return new Zc(t);if(t.error==="TooManyOpenUploads")return new Yc(t);if(t.error==="UploadForbidden")return new ed(t);if(t.error==="ServiceOverloaded")return new td(t)}return t}var rd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},od=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},id=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},sd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},nd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ad=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},pd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},cd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},dd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function HA(t){if(t instanceof p){if(t.error==="UploadNotFound")return new rd(t);if(t.error==="UploadExpired")return new od(t);if(t.error==="InvalidPartNumber")return new id(t);if(t.error==="PartSizeMismatch")return new sd(t);if(t.error==="UploadNotReady")return new nd(t);if(t.error==="UploadFailed")return new ad(t);if(t.error==="UploadAborted")return new pd(t);if(t.error==="UploadAlreadyCompleted")return new cd(t);if(t.error==="ServiceOverloaded")return new dd(t)}return t}var ld=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function WA(t){return t instanceof p&&t.error==="InvalidConvo"?new ld(t):t}var ud=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},fd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},md=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},hd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},yd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function QA(t){if(t instanceof p){if(t.error==="InvalidConvo")return new ud(t);if(t.error==="ReactionNotAllowed")return new fd(t);if(t.error==="ReactionMessageDeleted")return new md(t);if(t.error==="ReactionLimitReached")return new hd(t);if(t.error==="ReactionInvalidValue")return new yd(t)}return t}var gd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},bd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function YA(t){if(t instanceof p){if(t.error==="InvalidConvo")return new gd(t);if(t.error==="MessageDeleteNotAllowed")return new bd(t)}return t}var vd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function tS(t){return t instanceof p&&t.error==="InvalidConvo"?new vd(t):t}var xd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},wd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},kd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ad=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Sd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Rd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function oS(t){if(t instanceof p){if(t.error==="AccountSuspended")return new xd(t);if(t.error==="BlockedActor")return new wd(t);if(t.error==="BlockedSubject")return new kd(t);if(t.error==="MessagesDisabled")return new Ad(t);if(t.error==="NotFollowedBySender")return new Sd(t);if(t.error==="RecipientNotFound")return new Rd(t)}return t}var Cd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function sS(t){return t instanceof p&&t.error==="InvalidConvo"?new Cd(t):t}var _d=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function aS(t){return t instanceof p&&t.error==="InvalidConvo"?new _d(t):t}var Ed=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Id=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function cS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Ed(t);if(t.error==="OwnerCannotLeave")return new Id(t)}return t}var Dd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Td=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Pd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function lS(t){if(t instanceof p){if(t.error==="ConvoLocked")return new Dd(t);if(t.error==="InvalidConvo")return new Td(t);if(t.error==="InsufficientRole")return new Pd(t)}return t}var jd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function fS(t){return t instanceof p&&t.error==="InvalidConvo"?new jd(t):t}var qd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Bd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ld=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},$d=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function hS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new qd(t);if(t.error==="ReactionNotAllowed")return new Bd(t);if(t.error==="ReactionMessageDeleted")return new Ld(t);if(t.error==="ReactionInvalidValue")return new $d(t)}return t}var Md=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Vd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Od=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function gS(t){if(t instanceof p){if(t.error==="ConvoLocked")return new Md(t);if(t.error==="InvalidConvo")return new Vd(t);if(t.error==="ReplyTargetNotFound")return new Od(t)}return t}var zd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ud=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Gd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function vS(t){if(t instanceof p){if(t.error==="ConvoLocked")return new zd(t);if(t.error==="InvalidConvo")return new Ud(t);if(t.error==="ReplyTargetNotFound")return new Gd(t)}return t}var Fd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Nd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Kd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function wS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Fd(t);if(t.error==="InsufficientRole")return new Nd(t);if(t.error==="ConvoLockedByModeration")return new Kd(t)}return t}var Hd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function AS(t){return t instanceof p&&t.error==="InvalidConvo"?new Hd(t):t}var Jd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function RS(t){return t instanceof p&&t.error==="InvalidConvo"?new Jd(t):t}var Wd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Xd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Qd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Zd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Yd=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},el=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},tl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},rl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ol=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},il=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function _S(t){if(t instanceof p){if(t.error==="AccountSuspended")return new Wd(t);if(t.error==="BlockedActor")return new Xd(t);if(t.error==="BlockedSubject")return new Qd(t);if(t.error==="ConvoLocked")return new Zd(t);if(t.error==="InsufficientRole")return new Yd(t);if(t.error==="InvalidConvo")return new el(t);if(t.error==="MemberLimitReached")return new tl(t);if(t.error==="NotFollowedBySender")return new rl(t);if(t.error==="RecipientNotFound")return new ol(t);if(t.error==="UserForbidsGroups")return new il(t)}return t}var sl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},nl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},al=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function IS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new sl(t);if(t.error==="InsufficientRole")return new nl(t);if(t.error==="MemberLimitReached")return new al(t)}return t}var pl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},cl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},dl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ll=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ul=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},fl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ml=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function TS(t){if(t instanceof p){if(t.error==="AccountSuspended")return new pl(t);if(t.error==="BlockedActor")return new cl(t);if(t.error==="BlockedSubject")return new dl(t);if(t.error==="NewAccountCannotCreateGroup")return new ll(t);if(t.error==="NotFollowedBySender")return new ul(t);if(t.error==="RecipientNotFound")return new fl(t);if(t.error==="UserForbidsGroups")return new ml(t)}return t}var hl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},yl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},gl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function jS(t){if(t instanceof p){if(t.error==="EnabledJoinLinkAlreadyExists")return new hl(t);if(t.error==="InvalidConvo")return new yl(t);if(t.error==="InsufficientRole")return new gl(t)}return t}var bl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},vl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},xl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function BS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new bl(t);if(t.error==="InsufficientRole")return new vl(t);if(t.error==="NoJoinLink")return new xl(t)}return t}var wl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},kl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Al=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function $S(t){if(t instanceof p){if(t.error==="ConvoLocked")return new wl(t);if(t.error==="InvalidConvo")return new kl(t);if(t.error==="InsufficientRole")return new Al(t)}return t}var Sl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Rl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Cl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function VS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Sl(t);if(t.error==="InsufficientRole")return new Rl(t);if(t.error==="NoJoinLink")return new Cl(t)}return t}var _l=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},El=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Il=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Dl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function zS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new _l(t);if(t.error==="InsufficientRole")return new El(t);if(t.error==="NoJoinLink")return new Il(t);if(t.error==="LinkAlreadyEnabled")return new Dl(t)}return t}var Tl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Pl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function GS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Tl(t);if(t.error==="InsufficientRole")return new Pl(t)}return t}var jl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ql=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function NS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new jl(t);if(t.error==="InsufficientRole")return new ql(t)}return t}var Bl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ll=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function HS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Bl(t);if(t.error==="InsufficientRole")return new Ll(t)}return t}var $l=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ml=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Vl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ol=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},zl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ul=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function WS(t){if(t instanceof p){if(t.error==="ConvoLocked")return new $l(t);if(t.error==="FollowRequired")return new Ml(t);if(t.error==="InvalidCode")return new Vl(t);if(t.error==="LinkDisabled")return new Ol(t);if(t.error==="MemberLimitReached")return new zl(t);if(t.error==="UserKicked")return new Ul(t)}return t}var Gl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Fl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function QS(t){if(t instanceof p){if(t.error==="InvalidConvo")return new Gl(t);if(t.error==="InsufficientRole")return new Fl(t)}return t}var Nl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function YS(t){return t instanceof p&&t.error==="InvalidJoinRequest"?new Nl(t):t}var Kl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function tR(t){return t instanceof p&&t.error==="InvalidConvo"?new Kl(t):t}var Hl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function oR(t){return t instanceof p&&t.error==="InvalidConvo"?new Hl(t):t}var Jl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Wl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Xl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function sR(t){if(t instanceof p){if(t.error==="HandleNotFound")return new Jl(t);if(t.error==="DidNotFound")return new Wl(t);if(t.error==="DidDeactivated")return new Xl(t)}return t}var Ql=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Zl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function aR(t){if(t instanceof p){if(t.error==="DidNotFound")return new Ql(t);if(t.error==="DidDeactivated")return new Zl(t)}return t}var Yl=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function cR(t){return t instanceof p&&t.error==="HandleNotFound"?new Yl(t):t}var eu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},tu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ru=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function lR(t){if(t instanceof p){if(t.error==="HandleNotFound")return new eu(t);if(t.error==="DidNotFound")return new tu(t);if(t.error==="DidDeactivated")return new ru(t)}return t}var pn={};Ct(pn,{isLabel:()=>l$,isLabelValueDefinition:()=>g$,isLabelValueDefinitionStrings:()=>v$,isSelfLabel:()=>h$,isSelfLabels:()=>f$,validateLabel:()=>u$,validateLabelValueDefinition:()=>b$,validateLabelValueDefinitionStrings:()=>x$,validateSelfLabel:()=>y$,validateSelfLabels:()=>m$});var Fo=d,No=l,Je="com.atproto.label.defs",fR="label";function l$(t){return Fo(t,Je,fR)}function u$(t){return No(t,Je,fR)}var mR="selfLabels";function f$(t){return Fo(t,Je,mR)}function m$(t){return No(t,Je,mR)}var hR="selfLabel";function h$(t){return Fo(t,Je,hR)}function y$(t){return No(t,Je,hR)}var yR="labelValueDefinition";function g$(t){return Fo(t,Je,yR)}function b$(t){return No(t,Je,yR)}var gR="labelValueDefinitionStrings";function v$(t){return Fo(t,Je,gR)}function x$(t){return No(t,Je,gR)}var ou=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function bR(t){return t instanceof p&&t.error==="LexiconNotFound"?new ou(t):t}var tr="com.atproto.moderation.defs",jDe=`${tr}#reasonSpam`,qDe=`${tr}#reasonViolation`,BDe=`${tr}#reasonMisleading`,LDe=`${tr}#reasonSexual`,$De=`${tr}#reasonRude`,MDe=`${tr}#reasonOther`,VDe=`${tr}#reasonAppeal`;var iu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function xR(t){return t instanceof p&&t.error==="InvalidSwap"?new iu(t):t}var su=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function kR(t){return t instanceof p&&t.error==="InvalidSwap"?new su(t):t}var nu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function SR(t){return t instanceof p&&t.error==="InvalidSwap"?new nu(t):t}var au=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function CR(t){return t instanceof p&&t.error==="RecordNotFound"?new au(t):t}var Ko={};Ct(Ko,{InvalidSwapError:()=>cn,toKnownErr:()=>pu});var cn=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function pu(t){return t instanceof p&&t.error==="InvalidSwap"?new cn(t):t}var cu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},du=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},lu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},uu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function ER(t){if(t instanceof p){if(t.error==="AccountNotFound")return new cu(t);if(t.error==="ExpiredToken")return new du(t);if(t.error==="InvalidToken")return new lu(t);if(t.error==="InvalidEmail")return new uu(t)}return t}var fu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},mu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},hu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},yu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},gu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},bu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},vu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function DR(t){if(t instanceof p){if(t.error==="InvalidHandle")return new fu(t);if(t.error==="InvalidPassword")return new mu(t);if(t.error==="InvalidInviteCode")return new hu(t);if(t.error==="HandleNotAvailable")return new yu(t);if(t.error==="UnsupportedDomain")return new gu(t);if(t.error==="UnresolvableDid")return new bu(t);if(t.error==="IncompatibleDidDoc")return new vu(t)}return t}var xu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function PR(t){return t instanceof p&&t.error==="AccountTakedown"?new xu(t):t}var wu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ku=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function qR(t){if(t instanceof p){if(t.error==="AccountTakedown")return new wu(t);if(t.error==="AuthFactorTokenRequired")return new ku(t)}return t}var Au=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Su=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function LR(t){if(t instanceof p){if(t.error==="ExpiredToken")return new Au(t);if(t.error==="InvalidToken")return new Su(t)}return t}var Ru=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Cu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function MR(t){if(t instanceof p){if(t.error==="InvalidToken")return new Ru(t);if(t.error==="ExpiredToken")return new Cu(t)}return t}var _u=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function OR(t){return t instanceof p&&t.error==="DuplicateCreate"?new _u(t):t}var Eu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function UR(t){return t instanceof p&&t.error==="BadExpiration"?new Eu(t):t}var Iu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function FR(t){return t instanceof p&&t.error==="AccountTakedown"?new Iu(t):t}var Du=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Tu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Pu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function KR(t){if(t instanceof p){if(t.error==="AccountTakedown")return new Du(t);if(t.error==="InvalidToken")return new Tu(t);if(t.error==="ExpiredToken")return new Pu(t)}return t}var ju=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},qu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function JR(t){if(t instanceof p){if(t.error==="ExpiredToken")return new ju(t);if(t.error==="InvalidToken")return new qu(t)}return t}var Bu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Lu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},$u=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function XR(t){if(t instanceof p){if(t.error==="ExpiredToken")return new Bu(t);if(t.error==="InvalidToken")return new Lu(t);if(t.error==="TokenRequired")return new $u(t)}return t}var Mu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Vu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ou=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},zu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Uu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function ZR(t){if(t instanceof p){if(t.error==="BlobNotFound")return new Mu(t);if(t.error==="RepoNotFound")return new Vu(t);if(t.error==="RepoTakendown")return new Ou(t);if(t.error==="RepoSuspended")return new zu(t);if(t.error==="RepoDeactivated")return new Uu(t)}return t}var Gu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Fu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Nu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ku=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Hu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function eC(t){if(t instanceof p){if(t.error==="BlockNotFound")return new Gu(t);if(t.error==="RepoNotFound")return new Fu(t);if(t.error==="RepoTakendown")return new Nu(t);if(t.error==="RepoSuspended")return new Ku(t);if(t.error==="RepoDeactivated")return new Hu(t)}return t}var Ju=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function rC(t){return t instanceof p&&t.error==="HeadNotFound"?new Ju(t):t}var Wu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function iC(t){return t instanceof p&&t.error==="HostNotFound"?new Wu(t):t}var Xu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Qu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Zu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Yu=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function nC(t){if(t instanceof p){if(t.error==="RepoNotFound")return new Xu(t);if(t.error==="RepoTakendown")return new Qu(t);if(t.error==="RepoSuspended")return new Zu(t);if(t.error==="RepoDeactivated")return new Yu(t)}return t}var ef=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},tf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},rf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},of=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},sf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function pC(t){if(t instanceof p){if(t.error==="RecordNotFound")return new ef(t);if(t.error==="RepoNotFound")return new tf(t);if(t.error==="RepoTakendown")return new rf(t);if(t.error==="RepoSuspended")return new of(t);if(t.error==="RepoDeactivated")return new sf(t)}return t}var nf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},af=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},pf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},cf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function dC(t){if(t instanceof p){if(t.error==="RepoNotFound")return new nf(t);if(t.error==="RepoTakendown")return new af(t);if(t.error==="RepoSuspended")return new pf(t);if(t.error==="RepoDeactivated")return new cf(t)}return t}var df=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function uC(t){return t instanceof p&&t.error==="RepoNotFound"?new df(t):t}var lf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},uf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},ff=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},mf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function mC(t){if(t instanceof p){if(t.error==="RepoNotFound")return new lf(t);if(t.error==="RepoTakendown")return new uf(t);if(t.error==="RepoSuspended")return new ff(t);if(t.error==="RepoDeactivated")return new mf(t)}return t}var hf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function yC(t){return t instanceof p&&t.error==="HostBanned"?new hf(t):t}var yf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function bC(t){return t instanceof p&&t.error==="InvalidEmail"?new yf(t):t}var gf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function xC(t){return t instanceof p&&t.error==="InvalidScopeReference"?new gf(t):t}var bf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function kC(t){return t instanceof p&&t.error==="DuplicateTemplateName"?new bf(t):t}var vf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function SC(t){return t instanceof p&&t.error==="DuplicateTemplateName"?new vf(t):t}var xf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},wf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},kf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Af=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function CC(t){if(t instanceof p){if(t.error==="InvalidAppealSubject")return new xf(t);if(t.error==="AlreadyAppealed")return new wf(t);if(t.error==="NotAppealable")return new kf(t);if(t.error==="AppealWindowExpired")return new Af(t)}return t}var rr="tools.ozone.moderation.defs";var LMe=`${rr}#reviewOpen`,$Me=`${rr}#reviewEscalated`,MMe=`${rr}#reviewClosed`,VMe=`${rr}#reviewNone`;var OMe=`${rr}#timelineEventPlcCreate`,zMe=`${rr}#timelineEventPlcOperation`,UMe=`${rr}#timelineEventPlcTombstone`;var Sf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Rf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function EC(t){if(t instanceof p){if(t.error==="SubjectHasAction")return new Sf(t);if(t.error==="DuplicateExternalId")return new Rf(t)}return t}var Cf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function DC(t){return t instanceof p&&t.error==="RepoNotFound"?new Cf(t):t}var _f=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function PC(t){return t instanceof p&&t.error==="RecordNotFound"?new _f(t):t}var Ef=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function qC(t){return t instanceof p&&t.error==="RepoNotFound"?new Ef(t):t}var If=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function LC(t){return t instanceof p&&t.error==="InvalidAssignment"?new If(t):t}var Df=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Tf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function MC(t){if(t instanceof p){if(t.error==="InvalidRecommendedPolicies")return new Df(t);if(t.error==="ConflictingQueue")return new Tf(t)}return t}var Pf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function OC(t){return t instanceof p&&t.error==="OutOfRange"?new Pf(t):t}var jf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function UC(t){return t instanceof p&&t.error==="InvalidAssignment"?new jf(t):t}var qf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Bf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function FC(t){if(t instanceof p){if(t.error==="InvalidRecommendedPolicies")return new qf(t);if(t.error==="ConflictingQueue")return new Bf(t)}return t}var Lf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},$f=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function KC(t){if(t instanceof p){if(t.error==="AlreadyAssigned")return new Lf(t);if(t.error==="InvalidAssignment")return new $f(t)}return t}var Mf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Vf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Of=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function JC(t){if(t instanceof p){if(t.error==="ReportNotFound")return new Mf(t);if(t.error==="InvalidStateTransition")return new Vf(t);if(t.error==="AlreadyInTargetState")return new Of(t)}return t}var q="tools.ozone.report.defs",LUe=`${q}#reasonAppeal`,$Ue=`${q}#reasonOther`,MUe=`${q}#reasonViolenceAnimal`,VUe=`${q}#reasonViolenceThreats`,OUe=`${q}#reasonViolenceGraphicContent`,zUe=`${q}#reasonViolenceGlorification`,UUe=`${q}#reasonViolenceExtremistContent`,GUe=`${q}#reasonViolenceTrafficking`,FUe=`${q}#reasonViolenceOther`,NUe=`${q}#reasonSexualAbuseContent`,KUe=`${q}#reasonSexualNCII`,HUe=`${q}#reasonSexualDeepfake`,JUe=`${q}#reasonSexualAnimal`,WUe=`${q}#reasonSexualUnlabeled`,XUe=`${q}#reasonSexualOther`,QUe=`${q}#reasonChildSafetyCSAM`,ZUe=`${q}#reasonChildSafetyGroom`,YUe=`${q}#reasonChildSafetyPrivacy`,eGe=`${q}#reasonChildSafetyHarassment`,tGe=`${q}#reasonChildSafetyOther`,rGe=`${q}#reasonHarassmentTroll`,oGe=`${q}#reasonHarassmentTargeted`,iGe=`${q}#reasonHarassmentHateSpeech`,sGe=`${q}#reasonHarassmentDoxxing`,nGe=`${q}#reasonHarassmentOther`,aGe=`${q}#reasonMisleadingBot`,pGe=`${q}#reasonMisleadingImpersonation`,cGe=`${q}#reasonMisleadingSpam`,dGe=`${q}#reasonMisleadingScam`,lGe=`${q}#reasonMisleadingElections`,uGe=`${q}#reasonMisleadingOther`,fGe=`${q}#reasonRuleSiteSecurity`,mGe=`${q}#reasonRuleProhibitedSales`,hGe=`${q}#reasonRuleBanEvasion`,yGe=`${q}#reasonRuleOther`,gGe=`${q}#reasonSelfHarmContent`,bGe=`${q}#reasonSelfHarmED`,vGe=`${q}#reasonSelfHarmStunts`,xGe=`${q}#reasonSelfHarmSubstances`,wGe=`${q}#reasonSelfHarmOther`;var zf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function XC(t){return t instanceof p&&t.error==="NotFound"?new zf(t):t}var Uf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function ZC(t){return t instanceof p&&t.error==="NotFound"?new Uf(t):t}var Gf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Ff=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Nf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Kf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Hf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function e_(t){if(t instanceof p){if(t.error==="ReportNotFound")return new Gf(t);if(t.error==="ReportClosed")return new Ff(t);if(t.error==="AlreadyInTargetQueue")return new Nf(t);if(t.error==="QueueNotFound")return new Kf(t);if(t.error==="QueueDisabled")return new Hf(t)}return t}var Jf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function r_(t){return t instanceof p&&t.error==="InvalidAssignment"?new Jf(t):t}var Wf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},Xf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function i_(t){if(t instanceof p){if(t.error==="InvalidUrl")return new Wf(t);if(t.error==="RuleAlreadyExists")return new Xf(t)}return t}var Qf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function n_(t){return t instanceof p&&t.error==="RuleNotFound"?new Qf(t):t}var Zf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function p_(t){return t instanceof p&&t.error==="RuleNotFound"?new Zf(t):t}var Yf=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function d_(t){return t instanceof p&&t.error==="SetNotFound"?new Yf(t):t}var em=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function u_(t){return t instanceof p&&t.error==="SetNotFound"?new em(t):t}var tm=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function m_(t){return t instanceof p&&t.error==="SetNotFound"?new tm(t):t}var rm=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function y_(t){return t instanceof p&&t.error==="MemberAlreadyExists"?new rm(t):t}var dn="tools.ozone.team.defs";var l3e=`${dn}#roleAdmin`,u3e=`${dn}#roleModerator`,f3e=`${dn}#roleTriage`,m3e=`${dn}#roleVerifier`;var om=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}},im=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function b_(t){if(t instanceof p){if(t.error==="MemberNotFound")return new om(t);if(t.error==="CannotDeleteSelf")return new im(t)}return t}var sm=class extends p{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};function x_(t){return t instanceof p&&t.error==="MemberNotFound"?new sm(t):t}var ln=class{constructor(e){this._client=e,this.bsky=new nm(e)}},nm=class{constructor(e){this._client=e,this.actor=new am(e),this.ageassurance=new lm(e),this.bookmark=new um(e),this.contact=new fm(e),this.draft=new mm(e),this.embed=new hm(e),this.feed=new ym(e),this.graph=new Am(e),this.labeler=new Pm(e),this.notification=new qm(e),this.richtext=new Lm(e),this.unspecced=new $m(e),this.video=new Mm(e)}},am=class{constructor(e){this._client=e,this.contentVisibilityDeclaration=new pm(e),this.profile=new cm(e),this.status=new dm(e)}getPreferences(e,r){return this._client.call("app.bsky.actor.getPreferences",e,void 0,r)}getProfile(e,r){return this._client.call("app.bsky.actor.getProfile",e,void 0,r)}getProfiles(e,r){return this._client.call("app.bsky.actor.getProfiles",e,void 0,r)}getSuggestions(e,r){return this._client.call("app.bsky.actor.getSuggestions",e,void 0,r)}putPreferences(e,r){return this._client.call("app.bsky.actor.putPreferences",r?.qp,e,r)}searchActors(e,r){return this._client.call("app.bsky.actor.searchActors",e,void 0,r)}searchActorsTypeahead(e,r){return this._client.call("app.bsky.actor.searchActorsTypeahead",e,void 0,r)}},pm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.actor.contentVisibilityDeclaration",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.actor.contentVisibilityDeclaration",...e})).data}async create(e,r,o){let i="app.bsky.actor.contentVisibilityDeclaration";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.actor.contentVisibilityDeclaration";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.actor.contentVisibilityDeclaration",...e},{headers:r})}},cm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.actor.profile",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.actor.profile",...e})).data}async create(e,r,o){let i="app.bsky.actor.profile";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.actor.profile";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.actor.profile",...e},{headers:r})}},dm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.actor.status",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.actor.status",...e})).data}async create(e,r,o){let i="app.bsky.actor.status";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.actor.status";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.actor.status",...e},{headers:r})}},lm=class{constructor(e){this._client=e}begin(e,r){return this._client.call("app.bsky.ageassurance.begin",r?.qp,e,r).catch(o=>{throw Ok(o)})}getConfig(e,r){return this._client.call("app.bsky.ageassurance.getConfig",e,void 0,r)}getState(e,r){return this._client.call("app.bsky.ageassurance.getState",e,void 0,r)}},um=class{constructor(e){this._client=e}createBookmark(e,r){return this._client.call("app.bsky.bookmark.createBookmark",r?.qp,e,r).catch(o=>{throw Gk(o)})}deleteBookmark(e,r){return this._client.call("app.bsky.bookmark.deleteBookmark",r?.qp,e,r).catch(o=>{throw Nk(o)})}getBookmarks(e,r){return this._client.call("app.bsky.bookmark.getBookmarks",e,void 0,r)}},fm=class{constructor(e){this._client=e}dismissMatch(e,r){return this._client.call("app.bsky.contact.dismissMatch",r?.qp,e,r).catch(o=>{throw Hk(o)})}getMatches(e,r){return this._client.call("app.bsky.contact.getMatches",e,void 0,r).catch(o=>{throw Wk(o)})}getSyncStatus(e,r){return this._client.call("app.bsky.contact.getSyncStatus",e,void 0,r).catch(o=>{throw Qk(o)})}importContacts(e,r){return this._client.call("app.bsky.contact.importContacts",r?.qp,e,r).catch(o=>{throw Yk(o)})}removeData(e,r){return this._client.call("app.bsky.contact.removeData",r?.qp,e,r).catch(o=>{throw tA(o)})}sendNotification(e,r){return this._client.call("app.bsky.contact.sendNotification",r?.qp,e,r)}startPhoneVerification(e,r){return this._client.call("app.bsky.contact.startPhoneVerification",r?.qp,e,r).catch(o=>{throw oA(o)})}verifyPhone(e,r){return this._client.call("app.bsky.contact.verifyPhone",r?.qp,e,r).catch(o=>{throw sA(o)})}},mm=class{constructor(e){this._client=e}createDraft(e,r){return this._client.call("app.bsky.draft.createDraft",r?.qp,e,r).catch(o=>{throw aA(o)})}deleteDraft(e,r){return this._client.call("app.bsky.draft.deleteDraft",r?.qp,e,r)}getDrafts(e,r){return this._client.call("app.bsky.draft.getDrafts",e,void 0,r)}updateDraft(e,r){return this._client.call("app.bsky.draft.updateDraft",r?.qp,e,r)}},hm=class{constructor(e){this._client=e}getEmbedExternalView(e,r){return this._client.call("app.bsky.embed.getEmbedExternalView",e,void 0,r)}},ym=class{constructor(e){this._client=e,this.generator=new gm(e),this.like=new bm(e),this.post=new vm(e),this.postgate=new xm(e),this.repost=new wm(e),this.threadgate=new km(e)}describeFeedGenerator(e,r){return this._client.call("app.bsky.feed.describeFeedGenerator",e,void 0,r)}getActorFeeds(e,r){return this._client.call("app.bsky.feed.getActorFeeds",e,void 0,r)}getActorLikes(e,r){return this._client.call("app.bsky.feed.getActorLikes",e,void 0,r).catch(o=>{throw uA(o)})}getAuthorFeed(e,r){return this._client.call("app.bsky.feed.getAuthorFeed",e,void 0,r).catch(o=>{throw mA(o)})}getFeed(e,r){return this._client.call("app.bsky.feed.getFeed",e,void 0,r).catch(o=>{throw yA(o)})}getFeedGenerator(e,r){return this._client.call("app.bsky.feed.getFeedGenerator",e,void 0,r)}getFeedGenerators(e,r){return this._client.call("app.bsky.feed.getFeedGenerators",e,void 0,r)}getFeedSkeleton(e,r){return this._client.call("app.bsky.feed.getFeedSkeleton",e,void 0,r).catch(o=>{throw bA(o)})}getLikes(e,r){return this._client.call("app.bsky.feed.getLikes",e,void 0,r)}getListFeed(e,r){return this._client.call("app.bsky.feed.getListFeed",e,void 0,r).catch(o=>{throw xA(o)})}getPostThread(e,r){return this._client.call("app.bsky.feed.getPostThread",e,void 0,r).catch(o=>{throw kA(o)})}getPosts(e,r){return this._client.call("app.bsky.feed.getPosts",e,void 0,r)}getQuotes(e,r){return this._client.call("app.bsky.feed.getQuotes",e,void 0,r)}getRepostedBy(e,r){return this._client.call("app.bsky.feed.getRepostedBy",e,void 0,r)}getSuggestedFeeds(e,r){return this._client.call("app.bsky.feed.getSuggestedFeeds",e,void 0,r)}getTimeline(e,r){return this._client.call("app.bsky.feed.getTimeline",e,void 0,r)}searchPosts(e,r){return this._client.call("app.bsky.feed.searchPosts",e,void 0,r).catch(o=>{throw RA(o)})}searchPostsV2(e,r){return this._client.call("app.bsky.feed.searchPostsV2",e,void 0,r).catch(o=>{throw _A(o)})}sendInteractions(e,r){return this._client.call("app.bsky.feed.sendInteractions",r?.qp,e,r)}},gm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.generator",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.generator",...e})).data}async create(e,r,o){let i="app.bsky.feed.generator";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.generator";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.generator",...e},{headers:r})}},bm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.like",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.like",...e})).data}async create(e,r,o){let i="app.bsky.feed.like";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.like";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.like",...e},{headers:r})}},vm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.post",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.post",...e})).data}async create(e,r,o){let i="app.bsky.feed.post";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.post";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.post",...e},{headers:r})}},xm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.postgate",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.postgate",...e})).data}async create(e,r,o){let i="app.bsky.feed.postgate";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.postgate";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.postgate",...e},{headers:r})}},wm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.repost",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.repost",...e})).data}async create(e,r,o){let i="app.bsky.feed.repost";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.repost";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.repost",...e},{headers:r})}},km=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.threadgate",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.threadgate",...e})).data}async create(e,r,o){let i="app.bsky.feed.threadgate";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.feed.threadgate";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.threadgate",...e},{headers:r})}},Am=class{constructor(e){this._client=e,this.block=new Sm(e),this.follow=new Rm(e),this.list=new Cm(e),this.listblock=new _m(e),this.listitem=new Em(e),this.referencelistoptout=new Im(e),this.starterpack=new Dm(e),this.verification=new Tm(e)}getActorStarterPacks(e,r){return this._client.call("app.bsky.graph.getActorStarterPacks",e,void 0,r)}getBlocks(e,r){return this._client.call("app.bsky.graph.getBlocks",e,void 0,r)}getFollowers(e,r){return this._client.call("app.bsky.graph.getFollowers",e,void 0,r)}getFollows(e,r){return this._client.call("app.bsky.graph.getFollows",e,void 0,r)}getKnownFollowers(e,r){return this._client.call("app.bsky.graph.getKnownFollowers",e,void 0,r)}getList(e,r){return this._client.call("app.bsky.graph.getList",e,void 0,r)}getListBlocks(e,r){return this._client.call("app.bsky.graph.getListBlocks",e,void 0,r)}getListMutes(e,r){return this._client.call("app.bsky.graph.getListMutes",e,void 0,r)}getLists(e,r){return this._client.call("app.bsky.graph.getLists",e,void 0,r)}getListsWithMembership(e,r){return this._client.call("app.bsky.graph.getListsWithMembership",e,void 0,r)}getMutes(e,r){return this._client.call("app.bsky.graph.getMutes",e,void 0,r)}getRelationships(e,r){return this._client.call("app.bsky.graph.getRelationships",e,void 0,r).catch(o=>{throw IA(o)})}getStarterPack(e,r){return this._client.call("app.bsky.graph.getStarterPack",e,void 0,r)}getStarterPacks(e,r){return this._client.call("app.bsky.graph.getStarterPacks",e,void 0,r)}getStarterPacksWithMembership(e,r){return this._client.call("app.bsky.graph.getStarterPacksWithMembership",e,void 0,r)}getSuggestedFollowsByActor(e,r){return this._client.call("app.bsky.graph.getSuggestedFollowsByActor",e,void 0,r)}muteActor(e,r){return this._client.call("app.bsky.graph.muteActor",r?.qp,e,r)}muteActorList(e,r){return this._client.call("app.bsky.graph.muteActorList",r?.qp,e,r)}muteThread(e,r){return this._client.call("app.bsky.graph.muteThread",r?.qp,e,r)}searchStarterPacks(e,r){return this._client.call("app.bsky.graph.searchStarterPacks",e,void 0,r)}searchStarterPacksV2(e,r){return this._client.call("app.bsky.graph.searchStarterPacksV2",e,void 0,r)}unmuteActor(e,r){return this._client.call("app.bsky.graph.unmuteActor",r?.qp,e,r)}unmuteActorList(e,r){return this._client.call("app.bsky.graph.unmuteActorList",r?.qp,e,r)}unmuteThread(e,r){return this._client.call("app.bsky.graph.unmuteThread",r?.qp,e,r)}},Sm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.block",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.block",...e})).data}async create(e,r,o){let i="app.bsky.graph.block";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.block";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.block",...e},{headers:r})}},Rm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.follow",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.follow",...e})).data}async create(e,r,o){let i="app.bsky.graph.follow";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.follow";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.follow",...e},{headers:r})}},Cm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.list",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.list",...e})).data}async create(e,r,o){let i="app.bsky.graph.list";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.list";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.list",...e},{headers:r})}},_m=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.listblock",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.listblock",...e})).data}async create(e,r,o){let i="app.bsky.graph.listblock";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.listblock";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.listblock",...e},{headers:r})}},Em=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.listitem",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.listitem",...e})).data}async create(e,r,o){let i="app.bsky.graph.listitem";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.listitem";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.listitem",...e},{headers:r})}},Im=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.referencelistoptout",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.referencelistoptout",...e})).data}async create(e,r,o){let i="app.bsky.graph.referencelistoptout";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.referencelistoptout";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.referencelistoptout",...e},{headers:r})}},Dm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.starterpack",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.starterpack",...e})).data}async create(e,r,o){let i="app.bsky.graph.starterpack";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.starterpack";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.starterpack",...e},{headers:r})}},Tm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.verification",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.verification",...e})).data}async create(e,r,o){let i="app.bsky.graph.verification";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.graph.verification";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.verification",...e},{headers:r})}},Pm=class{constructor(e){this._client=e,this.service=new jm(e)}getServices(e,r){return this._client.call("app.bsky.labeler.getServices",e,void 0,r)}},jm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.labeler.service",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.labeler.service",...e})).data}async create(e,r,o){let i="app.bsky.labeler.service";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.labeler.service";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.labeler.service",...e},{headers:r})}},qm=class{constructor(e){this._client=e,this.declaration=new Bm(e)}getPreferences(e,r){return this._client.call("app.bsky.notification.getPreferences",e,void 0,r)}getUnreadCount(e,r){return this._client.call("app.bsky.notification.getUnreadCount",e,void 0,r)}listActivitySubscriptions(e,r){return this._client.call("app.bsky.notification.listActivitySubscriptions",e,void 0,r)}listNotifications(e,r){return this._client.call("app.bsky.notification.listNotifications",e,void 0,r)}putActivitySubscription(e,r){return this._client.call("app.bsky.notification.putActivitySubscription",r?.qp,e,r)}putPreferences(e,r){return this._client.call("app.bsky.notification.putPreferences",r?.qp,e,r)}putPreferencesV2(e,r){return this._client.call("app.bsky.notification.putPreferencesV2",r?.qp,e,r)}registerPush(e,r){return this._client.call("app.bsky.notification.registerPush",r?.qp,e,r)}unregisterPush(e,r){return this._client.call("app.bsky.notification.unregisterPush",r?.qp,e,r)}updateSeen(e,r){return this._client.call("app.bsky.notification.updateSeen",r?.qp,e,r)}},Bm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.notification.declaration",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.notification.declaration",...e})).data}async create(e,r,o){let i="app.bsky.notification.declaration";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="app.bsky.notification.declaration";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.notification.declaration",...e},{headers:r})}},Lm=class{constructor(e){this._client=e}},$m=class{constructor(e){this._client=e}getAgeAssuranceState(e,r){return this._client.call("app.bsky.unspecced.getAgeAssuranceState",e,void 0,r)}getConfig(e,r){return this._client.call("app.bsky.unspecced.getConfig",e,void 0,r)}getOnboardingSuggestedStarterPacks(e,r){return this._client.call("app.bsky.unspecced.getOnboardingSuggestedStarterPacks",e,void 0,r)}getOnboardingSuggestedStarterPacksSkeleton(e,r){return this._client.call("app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton",e,void 0,r)}getOnboardingSuggestedUsersSkeleton(e,r){return this._client.call("app.bsky.unspecced.getOnboardingSuggestedUsersSkeleton",e,void 0,r)}getPopularFeedGenerators(e,r){return this._client.call("app.bsky.unspecced.getPopularFeedGenerators",e,void 0,r)}getPostThreadOtherV2(e,r){return this._client.call("app.bsky.unspecced.getPostThreadOtherV2",e,void 0,r)}getPostThreadV2(e,r){return this._client.call("app.bsky.unspecced.getPostThreadV2",e,void 0,r)}getSuggestedFeeds(e,r){return this._client.call("app.bsky.unspecced.getSuggestedFeeds",e,void 0,r)}getSuggestedFeedsSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedFeedsSkeleton",e,void 0,r)}getSuggestedOnboardingUsers(e,r){return this._client.call("app.bsky.unspecced.getSuggestedOnboardingUsers",e,void 0,r)}getSuggestedStarterPacks(e,r){return this._client.call("app.bsky.unspecced.getSuggestedStarterPacks",e,void 0,r)}getSuggestedStarterPacksSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedStarterPacksSkeleton",e,void 0,r)}getSuggestedUsers(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsers",e,void 0,r)}getSuggestedUsersForDiscover(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForDiscover",e,void 0,r)}getSuggestedUsersForDiscoverSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForDiscoverSkeleton",e,void 0,r)}getSuggestedUsersForExplore(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForExplore",e,void 0,r)}getSuggestedUsersForExploreSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForExploreSkeleton",e,void 0,r)}getSuggestedUsersForSeeMore(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForSeeMore",e,void 0,r)}getSuggestedUsersForSeeMoreSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersForSeeMoreSkeleton",e,void 0,r)}getSuggestedUsersSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestedUsersSkeleton",e,void 0,r)}getSuggestionsSkeleton(e,r){return this._client.call("app.bsky.unspecced.getSuggestionsSkeleton",e,void 0,r)}getTaggedSuggestions(e,r){return this._client.call("app.bsky.unspecced.getTaggedSuggestions",e,void 0,r)}getTrendingTopics(e,r){return this._client.call("app.bsky.unspecced.getTrendingTopics",e,void 0,r)}getTrends(e,r){return this._client.call("app.bsky.unspecced.getTrends",e,void 0,r)}getTrendsSkeleton(e,r){return this._client.call("app.bsky.unspecced.getTrendsSkeleton",e,void 0,r)}initAgeAssurance(e,r){return this._client.call("app.bsky.unspecced.initAgeAssurance",r?.qp,e,r).catch(o=>{throw TA(o)})}searchActorsSkeleton(e,r){return this._client.call("app.bsky.unspecced.searchActorsSkeleton",e,void 0,r).catch(o=>{throw jA(o)})}searchPostsSkeleton(e,r){return this._client.call("app.bsky.unspecced.searchPostsSkeleton",e,void 0,r).catch(o=>{throw BA(o)})}searchStarterPacksSkeleton(e,r){return this._client.call("app.bsky.unspecced.searchStarterPacksSkeleton",e,void 0,r).catch(o=>{throw $A(o)})}},Mm=class{constructor(e){this._client=e}abortUpload(e,r){return this._client.call("app.bsky.video.abortUpload",r?.qp,e,r).catch(o=>{throw VA(o)})}finishUpload(e,r){return this._client.call("app.bsky.video.finishUpload",r?.qp,e,r).catch(o=>{throw zA(o)})}getJobStatus(e,r){return this._client.call("app.bsky.video.getJobStatus",e,void 0,r)}getUploadLimits(e,r){return this._client.call("app.bsky.video.getUploadLimits",e,void 0,r)}getUploadStatus(e,r){return this._client.call("app.bsky.video.getUploadStatus",e,void 0,r).catch(o=>{throw GA(o)})}startUpload(e,r){return this._client.call("app.bsky.video.startUpload",r?.qp,e,r).catch(o=>{throw NA(o)})}uploadPart(e,r){return this._client.call("app.bsky.video.uploadPart",r?.qp,e,r).catch(o=>{throw HA(o)})}uploadVideo(e,r){return this._client.call("app.bsky.video.uploadVideo",r?.qp,e,r)}},un=class{constructor(e){this._client=e,this.bsky=new Vm(e)}},Vm=class{constructor(e){this._client=e,this.actor=new Om(e),this.convo=new Um(e),this.embed=new Gm(e),this.group=new Fm(e),this.moderation=new Nm(e),this.notification=new Km(e)}},Om=class{constructor(e){this._client=e,this.declaration=new zm(e)}deleteAccount(e,r){return this._client.call("chat.bsky.actor.deleteAccount",r?.qp,e,r)}exportAccountData(e,r){return this._client.call("chat.bsky.actor.exportAccountData",e,void 0,r)}getStatus(e,r){return this._client.call("chat.bsky.actor.getStatus",e,void 0,r)}},zm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"chat.bsky.actor.declaration",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"chat.bsky.actor.declaration",...e})).data}async create(e,r,o){let i="chat.bsky.actor.declaration";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="chat.bsky.actor.declaration";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"chat.bsky.actor.declaration",...e},{headers:r})}},Um=class{constructor(e){this._client=e}acceptConvo(e,r){return this._client.call("chat.bsky.convo.acceptConvo",r?.qp,e,r).catch(o=>{throw WA(o)})}addReaction(e,r){return this._client.call("chat.bsky.convo.addReaction",r?.qp,e,r).catch(o=>{throw QA(o)})}deleteMessageForSelf(e,r){return this._client.call("chat.bsky.convo.deleteMessageForSelf",r?.qp,e,r).catch(o=>{throw YA(o)})}getConvo(e,r){return this._client.call("chat.bsky.convo.getConvo",e,void 0,r).catch(o=>{throw tS(o)})}getConvoAvailability(e,r){return this._client.call("chat.bsky.convo.getConvoAvailability",e,void 0,r)}getConvoForMembers(e,r){return this._client.call("chat.bsky.convo.getConvoForMembers",e,void 0,r).catch(o=>{throw oS(o)})}getConvoMembers(e,r){return this._client.call("chat.bsky.convo.getConvoMembers",e,void 0,r).catch(o=>{throw sS(o)})}getLog(e,r){return this._client.call("chat.bsky.convo.getLog",e,void 0,r)}getMessages(e,r){return this._client.call("chat.bsky.convo.getMessages",e,void 0,r).catch(o=>{throw aS(o)})}getUnreadCounts(e,r){return this._client.call("chat.bsky.convo.getUnreadCounts",e,void 0,r)}leaveConvo(e,r){return this._client.call("chat.bsky.convo.leaveConvo",r?.qp,e,r).catch(o=>{throw cS(o)})}listConvoRequests(e,r){return this._client.call("chat.bsky.convo.listConvoRequests",e,void 0,r)}listConvos(e,r){return this._client.call("chat.bsky.convo.listConvos",e,void 0,r)}lockConvo(e,r){return this._client.call("chat.bsky.convo.lockConvo",r?.qp,e,r).catch(o=>{throw lS(o)})}muteConvo(e,r){return this._client.call("chat.bsky.convo.muteConvo",r?.qp,e,r).catch(o=>{throw fS(o)})}removeReaction(e,r){return this._client.call("chat.bsky.convo.removeReaction",r?.qp,e,r).catch(o=>{throw hS(o)})}sendMessage(e,r){return this._client.call("chat.bsky.convo.sendMessage",r?.qp,e,r).catch(o=>{throw gS(o)})}sendMessageBatch(e,r){return this._client.call("chat.bsky.convo.sendMessageBatch",r?.qp,e,r).catch(o=>{throw vS(o)})}unlockConvo(e,r){return this._client.call("chat.bsky.convo.unlockConvo",r?.qp,e,r).catch(o=>{throw wS(o)})}unmuteConvo(e,r){return this._client.call("chat.bsky.convo.unmuteConvo",r?.qp,e,r).catch(o=>{throw AS(o)})}updateAllRead(e,r){return this._client.call("chat.bsky.convo.updateAllRead",r?.qp,e,r)}updateRead(e,r){return this._client.call("chat.bsky.convo.updateRead",r?.qp,e,r).catch(o=>{throw RS(o)})}},Gm=class{constructor(e){this._client=e}},Fm=class{constructor(e){this._client=e}addMembers(e,r){return this._client.call("chat.bsky.group.addMembers",r?.qp,e,r).catch(o=>{throw _S(o)})}approveJoinRequest(e,r){return this._client.call("chat.bsky.group.approveJoinRequest",r?.qp,e,r).catch(o=>{throw IS(o)})}createGroup(e,r){return this._client.call("chat.bsky.group.createGroup",r?.qp,e,r).catch(o=>{throw TS(o)})}createJoinLink(e,r){return this._client.call("chat.bsky.group.createJoinLink",r?.qp,e,r).catch(o=>{throw jS(o)})}disableJoinLink(e,r){return this._client.call("chat.bsky.group.disableJoinLink",r?.qp,e,r).catch(o=>{throw BS(o)})}editGroup(e,r){return this._client.call("chat.bsky.group.editGroup",r?.qp,e,r).catch(o=>{throw $S(o)})}editJoinLink(e,r){return this._client.call("chat.bsky.group.editJoinLink",r?.qp,e,r).catch(o=>{throw VS(o)})}enableJoinLink(e,r){return this._client.call("chat.bsky.group.enableJoinLink",r?.qp,e,r).catch(o=>{throw zS(o)})}getJoinLinkPreviews(e,r){return this._client.call("chat.bsky.group.getJoinLinkPreviews",e,void 0,r)}listJoinRequests(e,r){return this._client.call("chat.bsky.group.listJoinRequests",e,void 0,r).catch(o=>{throw GS(o)})}listMutualGroups(e,r){return this._client.call("chat.bsky.group.listMutualGroups",e,void 0,r)}rejectJoinRequest(e,r){return this._client.call("chat.bsky.group.rejectJoinRequest",r?.qp,e,r).catch(o=>{throw NS(o)})}removeMembers(e,r){return this._client.call("chat.bsky.group.removeMembers",r?.qp,e,r).catch(o=>{throw HS(o)})}requestJoin(e,r){return this._client.call("chat.bsky.group.requestJoin",r?.qp,e,r).catch(o=>{throw WS(o)})}updateJoinRequestsRead(e,r){return this._client.call("chat.bsky.group.updateJoinRequestsRead",r?.qp,e,r).catch(o=>{throw QS(o)})}withdrawJoinRequest(e,r){return this._client.call("chat.bsky.group.withdrawJoinRequest",r?.qp,e,r).catch(o=>{throw YS(o)})}},Nm=class{constructor(e){this._client=e}getActorMetadata(e,r){return this._client.call("chat.bsky.moderation.getActorMetadata",e,void 0,r)}getConvo(e,r){return this._client.call("chat.bsky.moderation.getConvo",e,void 0,r).catch(o=>{throw tR(o)})}getConvoMembers(e,r){return this._client.call("chat.bsky.moderation.getConvoMembers",e,void 0,r).catch(o=>{throw oR(o)})}getConvos(e,r){return this._client.call("chat.bsky.moderation.getConvos",e,void 0,r)}getMessageContext(e,r){return this._client.call("chat.bsky.moderation.getMessageContext",e,void 0,r)}updateActorAccess(e,r){return this._client.call("chat.bsky.moderation.updateActorAccess",r?.qp,e,r)}},Km=class{constructor(e){this._client=e}getPreferences(e,r){return this._client.call("chat.bsky.notification.getPreferences",e,void 0,r)}putPreferences(e,r){return this._client.call("chat.bsky.notification.putPreferences",r?.qp,e,r)}},fn=class{constructor(e){this._client=e,this.atproto=new Hm(e),this.germnetwork=new oh(e)}},Hm=class{constructor(e){this._client=e,this.admin=new Jm(e),this.identity=new Wm(e),this.label=new Xm(e),this.lexicon=new Qm(e),this.moderation=new Ym(e),this.repo=new eh(e),this.server=new mn(e),this.sync=new th(e),this.temp=new rh(e)}},Jm=class{constructor(e){this._client=e}deleteAccount(e,r){return this._client.call("com.atproto.admin.deleteAccount",r?.qp,e,r)}disableAccountInvites(e,r){return this._client.call("com.atproto.admin.disableAccountInvites",r?.qp,e,r)}disableInviteCodes(e,r){return this._client.call("com.atproto.admin.disableInviteCodes",r?.qp,e,r)}enableAccountInvites(e,r){return this._client.call("com.atproto.admin.enableAccountInvites",r?.qp,e,r)}getAccountInfo(e,r){return this._client.call("com.atproto.admin.getAccountInfo",e,void 0,r)}getAccountInfos(e,r){return this._client.call("com.atproto.admin.getAccountInfos",e,void 0,r)}getInviteCodes(e,r){return this._client.call("com.atproto.admin.getInviteCodes",e,void 0,r)}getSubjectStatus(e,r){return this._client.call("com.atproto.admin.getSubjectStatus",e,void 0,r)}searchAccounts(e,r){return this._client.call("com.atproto.admin.searchAccounts",e,void 0,r)}sendEmail(e,r){return this._client.call("com.atproto.admin.sendEmail",r?.qp,e,r)}updateAccountEmail(e,r){return this._client.call("com.atproto.admin.updateAccountEmail",r?.qp,e,r)}updateAccountHandle(e,r){return this._client.call("com.atproto.admin.updateAccountHandle",r?.qp,e,r)}updateAccountPassword(e,r){return this._client.call("com.atproto.admin.updateAccountPassword",r?.qp,e,r)}updateAccountSigningKey(e,r){return this._client.call("com.atproto.admin.updateAccountSigningKey",r?.qp,e,r)}updateSubjectStatus(e,r){return this._client.call("com.atproto.admin.updateSubjectStatus",r?.qp,e,r)}},Wm=class{constructor(e){this._client=e}getRecommendedDidCredentials(e,r){return this._client.call("com.atproto.identity.getRecommendedDidCredentials",e,void 0,r)}refreshIdentity(e,r){return this._client.call("com.atproto.identity.refreshIdentity",r?.qp,e,r).catch(o=>{throw sR(o)})}requestPlcOperationSignature(e,r){return this._client.call("com.atproto.identity.requestPlcOperationSignature",r?.qp,e,r)}resolveDid(e,r){return this._client.call("com.atproto.identity.resolveDid",e,void 0,r).catch(o=>{throw aR(o)})}resolveHandle(e,r){return this._client.call("com.atproto.identity.resolveHandle",e,void 0,r).catch(o=>{throw cR(o)})}resolveIdentity(e,r){return this._client.call("com.atproto.identity.resolveIdentity",e,void 0,r).catch(o=>{throw lR(o)})}signPlcOperation(e,r){return this._client.call("com.atproto.identity.signPlcOperation",r?.qp,e,r)}submitPlcOperation(e,r){return this._client.call("com.atproto.identity.submitPlcOperation",r?.qp,e,r)}updateHandle(e,r){return this._client.call("com.atproto.identity.updateHandle",r?.qp,e,r)}},Xm=class{constructor(e){this._client=e}queryLabels(e,r){return this._client.call("com.atproto.label.queryLabels",e,void 0,r)}},Qm=class{constructor(e){this._client=e,this.schema=new Zm(e)}resolveLexicon(e,r){return this._client.call("com.atproto.lexicon.resolveLexicon",e,void 0,r).catch(o=>{throw bR(o)})}},Zm=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"com.atproto.lexicon.schema",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"com.atproto.lexicon.schema",...e})).data}async create(e,r,o){let i="com.atproto.lexicon.schema";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="com.atproto.lexicon.schema";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"com.atproto.lexicon.schema",...e},{headers:r})}},Ym=class{constructor(e){this._client=e}createReport(e,r){return this._client.call("com.atproto.moderation.createReport",r?.qp,e,r)}},eh=class{constructor(e){this._client=e}applyWrites(e,r){return this._client.call("com.atproto.repo.applyWrites",r?.qp,e,r).catch(o=>{throw xR(o)})}createRecord(e,r){return this._client.call("com.atproto.repo.createRecord",r?.qp,e,r).catch(o=>{throw kR(o)})}deleteRecord(e,r){return this._client.call("com.atproto.repo.deleteRecord",r?.qp,e,r).catch(o=>{throw SR(o)})}describeRepo(e,r){return this._client.call("com.atproto.repo.describeRepo",e,void 0,r)}getRecord(e,r){return this._client.call("com.atproto.repo.getRecord",e,void 0,r).catch(o=>{throw CR(o)})}importRepo(e,r){return this._client.call("com.atproto.repo.importRepo",r?.qp,e,r)}listMissingBlobs(e,r){return this._client.call("com.atproto.repo.listMissingBlobs",e,void 0,r)}listRecords(e,r){return this._client.call("com.atproto.repo.listRecords",e,void 0,r)}putRecord(e,r){return this._client.call("com.atproto.repo.putRecord",r?.qp,e,r).catch(o=>{throw pu(o)})}uploadBlob(e,r){return this._client.call("com.atproto.repo.uploadBlob",r?.qp,e,r)}},mn=class{constructor(e){this._client=e}activateAccount(e,r){return this._client.call("com.atproto.server.activateAccount",r?.qp,e,r)}checkAccountStatus(e,r){return this._client.call("com.atproto.server.checkAccountStatus",e,void 0,r)}confirmEmail(e,r){return this._client.call("com.atproto.server.confirmEmail",r?.qp,e,r).catch(o=>{throw ER(o)})}createAccount(e,r){return this._client.call("com.atproto.server.createAccount",r?.qp,e,r).catch(o=>{throw DR(o)})}createAppPassword(e,r){return this._client.call("com.atproto.server.createAppPassword",r?.qp,e,r).catch(o=>{throw PR(o)})}createInviteCode(e,r){return this._client.call("com.atproto.server.createInviteCode",r?.qp,e,r)}createInviteCodes(e,r){return this._client.call("com.atproto.server.createInviteCodes",r?.qp,e,r)}createSession(e,r){return this._client.call("com.atproto.server.createSession",r?.qp,e,r).catch(o=>{throw qR(o)})}deactivateAccount(e,r){return this._client.call("com.atproto.server.deactivateAccount",r?.qp,e,r)}deleteAccount(e,r){return this._client.call("com.atproto.server.deleteAccount",r?.qp,e,r).catch(o=>{throw LR(o)})}deleteSession(e,r){return this._client.call("com.atproto.server.deleteSession",r?.qp,e,r).catch(o=>{throw MR(o)})}describeServer(e,r){return this._client.call("com.atproto.server.describeServer",e,void 0,r)}getAccountInviteCodes(e,r){return this._client.call("com.atproto.server.getAccountInviteCodes",e,void 0,r).catch(o=>{throw OR(o)})}getServiceAuth(e,r){return this._client.call("com.atproto.server.getServiceAuth",e,void 0,r).catch(o=>{throw UR(o)})}getSession(e,r){return this._client.call("com.atproto.server.getSession",e,void 0,r)}listAppPasswords(e,r){return this._client.call("com.atproto.server.listAppPasswords",e,void 0,r).catch(o=>{throw FR(o)})}refreshSession(e,r){return this._client.call("com.atproto.server.refreshSession",r?.qp,e,r).catch(o=>{throw KR(o)})}requestAccountDelete(e,r){return this._client.call("com.atproto.server.requestAccountDelete",r?.qp,e,r)}requestEmailConfirmation(e,r){return this._client.call("com.atproto.server.requestEmailConfirmation",r?.qp,e,r)}requestEmailUpdate(e,r){return this._client.call("com.atproto.server.requestEmailUpdate",r?.qp,e,r)}requestPasswordReset(e,r){return this._client.call("com.atproto.server.requestPasswordReset",r?.qp,e,r)}reserveSigningKey(e,r){return this._client.call("com.atproto.server.reserveSigningKey",r?.qp,e,r)}resetPassword(e,r){return this._client.call("com.atproto.server.resetPassword",r?.qp,e,r).catch(o=>{throw JR(o)})}revokeAppPassword(e,r){return this._client.call("com.atproto.server.revokeAppPassword",r?.qp,e,r)}updateEmail(e,r){return this._client.call("com.atproto.server.updateEmail",r?.qp,e,r).catch(o=>{throw XR(o)})}},th=class{constructor(e){this._client=e}getBlob(e,r){return this._client.call("com.atproto.sync.getBlob",e,void 0,r).catch(o=>{throw ZR(o)})}getBlocks(e,r){return this._client.call("com.atproto.sync.getBlocks",e,void 0,r).catch(o=>{throw eC(o)})}getCheckout(e,r){return this._client.call("com.atproto.sync.getCheckout",e,void 0,r)}getHead(e,r){return this._client.call("com.atproto.sync.getHead",e,void 0,r).catch(o=>{throw rC(o)})}getHostStatus(e,r){return this._client.call("com.atproto.sync.getHostStatus",e,void 0,r).catch(o=>{throw iC(o)})}getLatestCommit(e,r){return this._client.call("com.atproto.sync.getLatestCommit",e,void 0,r).catch(o=>{throw nC(o)})}getRecord(e,r){return this._client.call("com.atproto.sync.getRecord",e,void 0,r).catch(o=>{throw pC(o)})}getRepo(e,r){return this._client.call("com.atproto.sync.getRepo",e,void 0,r).catch(o=>{throw dC(o)})}getRepoStatus(e,r){return this._client.call("com.atproto.sync.getRepoStatus",e,void 0,r).catch(o=>{throw uC(o)})}listBlobs(e,r){return this._client.call("com.atproto.sync.listBlobs",e,void 0,r).catch(o=>{throw mC(o)})}listHosts(e,r){return this._client.call("com.atproto.sync.listHosts",e,void 0,r)}listRepos(e,r){return this._client.call("com.atproto.sync.listRepos",e,void 0,r)}listReposByCollection(e,r){return this._client.call("com.atproto.sync.listReposByCollection",e,void 0,r)}notifyOfUpdate(e,r){return this._client.call("com.atproto.sync.notifyOfUpdate",r?.qp,e,r)}requestCrawl(e,r){return this._client.call("com.atproto.sync.requestCrawl",r?.qp,e,r).catch(o=>{throw yC(o)})}},rh=class{constructor(e){this._client=e}addReservedHandle(e,r){return this._client.call("com.atproto.temp.addReservedHandle",r?.qp,e,r)}checkHandleAvailability(e,r){return this._client.call("com.atproto.temp.checkHandleAvailability",e,void 0,r).catch(o=>{throw bC(o)})}checkSignupQueue(e,r){return this._client.call("com.atproto.temp.checkSignupQueue",e,void 0,r)}dereferenceScope(e,r){return this._client.call("com.atproto.temp.dereferenceScope",e,void 0,r).catch(o=>{throw xC(o)})}fetchLabels(e,r){return this._client.call("com.atproto.temp.fetchLabels",e,void 0,r)}requestPhoneVerification(e,r){return this._client.call("com.atproto.temp.requestPhoneVerification",r?.qp,e,r)}revokeAccountCredentials(e,r){return this._client.call("com.atproto.temp.revokeAccountCredentials",r?.qp,e,r)}},oh=class{constructor(e){this._client=e,this.declaration=new ih(e)}},ih=class{constructor(e){this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"com.germnetwork.declaration",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"com.germnetwork.declaration",...e})).data}async create(e,r,o){let i="com.germnetwork.declaration";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:i,rkey:"self",...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async put(e,r,o){let i="com.germnetwork.declaration";return(await this._client.call("com.atproto.repo.putRecord",void 0,{collection:i,...e,record:{...r,$type:i}},{encoding:"application/json",headers:o})).data}async delete(e,r){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"com.germnetwork.declaration",...e},{headers:r})}},hn=class{constructor(e){this._client=e,this.ozone=new sh(e)}},sh=class{constructor(e){this._client=e,this.communication=new nh(e),this.hosting=new ah(e),this.inbox=new ph(e),this.moderation=new ch(e),this.queue=new dh(e),this.report=new lh(e),this.safelink=new uh(e),this.server=new fh(e),this.set=new mh(e),this.setting=new hh(e),this.signature=new yh(e),this.team=new gh(e),this.verification=new bh(e)}},nh=class{constructor(e){this._client=e}createTemplate(e,r){return this._client.call("tools.ozone.communication.createTemplate",r?.qp,e,r).catch(o=>{throw kC(o)})}deleteTemplate(e,r){return this._client.call("tools.ozone.communication.deleteTemplate",r?.qp,e,r)}listTemplates(e,r){return this._client.call("tools.ozone.communication.listTemplates",e,void 0,r)}updateTemplate(e,r){return this._client.call("tools.ozone.communication.updateTemplate",r?.qp,e,r).catch(o=>{throw SC(o)})}},ah=class{constructor(e){this._client=e}getAccountHistory(e,r){return this._client.call("tools.ozone.hosting.getAccountHistory",e,void 0,r)}},ph=class{constructor(e){this._client=e}appealActionedSubject(e,r){return this._client.call("tools.ozone.inbox.appealActionedSubject",r?.qp,e,r).catch(o=>{throw CC(o)})}},ch=class{constructor(e){this._client=e}cancelScheduledActions(e,r){return this._client.call("tools.ozone.moderation.cancelScheduledActions",r?.qp,e,r)}emitEvent(e,r){return this._client.call("tools.ozone.moderation.emitEvent",r?.qp,e,r).catch(o=>{throw EC(o)})}getAccountPreferences(e,r){return this._client.call("tools.ozone.moderation.getAccountPreferences",e,void 0,r)}getAccountTimeline(e,r){return this._client.call("tools.ozone.moderation.getAccountTimeline",e,void 0,r).catch(o=>{throw DC(o)})}getEvent(e,r){return this._client.call("tools.ozone.moderation.getEvent",e,void 0,r)}getRecord(e,r){return this._client.call("tools.ozone.moderation.getRecord",e,void 0,r).catch(o=>{throw PC(o)})}getRecords(e,r){return this._client.call("tools.ozone.moderation.getRecords",e,void 0,r)}getRepo(e,r){return this._client.call("tools.ozone.moderation.getRepo",e,void 0,r).catch(o=>{throw qC(o)})}getReporterStats(e,r){return this._client.call("tools.ozone.moderation.getReporterStats",e,void 0,r)}getRepos(e,r){return this._client.call("tools.ozone.moderation.getRepos",e,void 0,r)}getSubjects(e,r){return this._client.call("tools.ozone.moderation.getSubjects",e,void 0,r)}listScheduledActions(e,r){return this._client.call("tools.ozone.moderation.listScheduledActions",r?.qp,e,r)}queryEvents(e,r){return this._client.call("tools.ozone.moderation.queryEvents",e,void 0,r)}queryStatuses(e,r){return this._client.call("tools.ozone.moderation.queryStatuses",e,void 0,r)}scheduleAction(e,r){return this._client.call("tools.ozone.moderation.scheduleAction",r?.qp,e,r)}searchRepos(e,r){return this._client.call("tools.ozone.moderation.searchRepos",e,void 0,r)}},dh=class{constructor(e){this._client=e}assignModerator(e,r){return this._client.call("tools.ozone.queue.assignModerator",r?.qp,e,r).catch(o=>{throw LC(o)})}createQueue(e,r){return this._client.call("tools.ozone.queue.createQueue",r?.qp,e,r).catch(o=>{throw MC(o)})}deleteQueue(e,r){return this._client.call("tools.ozone.queue.deleteQueue",r?.qp,e,r)}getAssignments(e,r){return this._client.call("tools.ozone.queue.getAssignments",e,void 0,r)}listQueues(e,r){return this._client.call("tools.ozone.queue.listQueues",e,void 0,r)}routeReports(e,r){return this._client.call("tools.ozone.queue.routeReports",r?.qp,e,r).catch(o=>{throw OC(o)})}unassignModerator(e,r){return this._client.call("tools.ozone.queue.unassignModerator",r?.qp,e,r).catch(o=>{throw UC(o)})}updateQueue(e,r){return this._client.call("tools.ozone.queue.updateQueue",r?.qp,e,r).catch(o=>{throw FC(o)})}},lh=class{constructor(e){this._client=e}assignModerator(e,r){return this._client.call("tools.ozone.report.assignModerator",r?.qp,e,r).catch(o=>{throw KC(o)})}closeReports(e,r){return this._client.call("tools.ozone.report.closeReports",r?.qp,e,r)}createActivity(e,r){return this._client.call("tools.ozone.report.createActivity",r?.qp,e,r).catch(o=>{throw JC(o)})}getAssignments(e,r){return this._client.call("tools.ozone.report.getAssignments",e,void 0,r)}getHistoricalStats(e,r){return this._client.call("tools.ozone.report.getHistoricalStats",e,void 0,r)}getLatestReport(e,r){return this._client.call("tools.ozone.report.getLatestReport",e,void 0,r).catch(o=>{throw XC(o)})}getLiveStats(e,r){return this._client.call("tools.ozone.report.getLiveStats",e,void 0,r)}getReport(e,r){return this._client.call("tools.ozone.report.getReport",e,void 0,r).catch(o=>{throw ZC(o)})}listActivities(e,r){return this._client.call("tools.ozone.report.listActivities",e,void 0,r)}queryActivities(e,r){return this._client.call("tools.ozone.report.queryActivities",e,void 0,r)}queryReports(e,r){return this._client.call("tools.ozone.report.queryReports",e,void 0,r)}reassignQueue(e,r){return this._client.call("tools.ozone.report.reassignQueue",r?.qp,e,r).catch(o=>{throw e_(o)})}refreshStats(e,r){return this._client.call("tools.ozone.report.refreshStats",r?.qp,e,r)}unassignModerator(e,r){return this._client.call("tools.ozone.report.unassignModerator",r?.qp,e,r).catch(o=>{throw r_(o)})}},uh=class{constructor(e){this._client=e}addRule(e,r){return this._client.call("tools.ozone.safelink.addRule",r?.qp,e,r).catch(o=>{throw i_(o)})}queryEvents(e,r){return this._client.call("tools.ozone.safelink.queryEvents",r?.qp,e,r)}queryRules(e,r){return this._client.call("tools.ozone.safelink.queryRules",r?.qp,e,r)}removeRule(e,r){return this._client.call("tools.ozone.safelink.removeRule",r?.qp,e,r).catch(o=>{throw n_(o)})}updateRule(e,r){return this._client.call("tools.ozone.safelink.updateRule",r?.qp,e,r).catch(o=>{throw p_(o)})}},fh=class{constructor(e){this._client=e}getConfig(e,r){return this._client.call("tools.ozone.server.getConfig",e,void 0,r)}},mh=class{constructor(e){this._client=e}addValues(e,r){return this._client.call("tools.ozone.set.addValues",r?.qp,e,r)}deleteSet(e,r){return this._client.call("tools.ozone.set.deleteSet",r?.qp,e,r).catch(o=>{throw d_(o)})}deleteValues(e,r){return this._client.call("tools.ozone.set.deleteValues",r?.qp,e,r).catch(o=>{throw u_(o)})}getValues(e,r){return this._client.call("tools.ozone.set.getValues",e,void 0,r).catch(o=>{throw m_(o)})}querySets(e,r){return this._client.call("tools.ozone.set.querySets",e,void 0,r)}upsertSet(e,r){return this._client.call("tools.ozone.set.upsertSet",r?.qp,e,r)}},hh=class{constructor(e){this._client=e}listOptions(e,r){return this._client.call("tools.ozone.setting.listOptions",e,void 0,r)}removeOptions(e,r){return this._client.call("tools.ozone.setting.removeOptions",r?.qp,e,r)}upsertOption(e,r){return this._client.call("tools.ozone.setting.upsertOption",r?.qp,e,r)}},yh=class{constructor(e){this._client=e}findCorrelation(e,r){return this._client.call("tools.ozone.signature.findCorrelation",e,void 0,r)}findRelatedAccounts(e,r){return this._client.call("tools.ozone.signature.findRelatedAccounts",e,void 0,r)}searchAccounts(e,r){return this._client.call("tools.ozone.signature.searchAccounts",e,void 0,r)}},gh=class{constructor(e){this._client=e}addMember(e,r){return this._client.call("tools.ozone.team.addMember",r?.qp,e,r).catch(o=>{throw y_(o)})}deleteMember(e,r){return this._client.call("tools.ozone.team.deleteMember",r?.qp,e,r).catch(o=>{throw b_(o)})}listMembers(e,r){return this._client.call("tools.ozone.team.listMembers",e,void 0,r)}updateMember(e,r){return this._client.call("tools.ozone.team.updateMember",r?.qp,e,r).catch(o=>{throw x_(o)})}},bh=class{constructor(e){this._client=e}grantVerifications(e,r){return this._client.call("tools.ozone.verification.grantVerifications",r?.qp,e,r)}listVerifications(e,r){return this._client.call("tools.ozone.verification.listVerifications",e,void 0,r)}revokeVerifications(e,r){return this._client.call("tools.ozone.verification.revokeVerifications",r?.qp,e,r)}};var _6e=new TextEncoder,E6e=new TextDecoder;var vh={porn:"hide",sexual:"warn",nudity:"ignore","graphic-media":"warn"};var k_;(function(t){t[t.High=0]="High",t[t.Medium=1]="Medium",t[t.Low=2]="Low"})(k_||(k_={}));function A_(t,e){let r={account:{},profile:{},content:{}},o=t.severity==="alert"?"alert":t.severity==="inform"?"inform":void 0;t.blurs==="content"?(r.account.profileList=o,r.account.profileView=o,r.account.contentList="blur",r.account.contentView=t.adultOnly?"blur":o,r.profile.profileList=o,r.profile.profileView=o,r.content.contentList="blur",r.content.contentView=t.adultOnly?"blur":o):t.blurs==="media"?(r.account.profileList=o,r.account.profileView=o,r.account.avatar="blur",r.account.banner="blur",r.profile.profileList=o,r.profile.profileView=o,r.profile.avatar="blur",r.profile.banner="blur",r.content.contentMedia="blur"):t.blurs==="none"&&(r.account.profileList=o,r.account.profileView=o,r.account.contentList=o,r.account.contentView=o,r.profile.profileList=o,r.profile.profileView=o,r.content.contentList=o,r.content.contentView=o);let i="warn";(t.defaultSetting==="hide"||t.defaultSetting==="ignore")&&(i=t.defaultSetting);let s=["no-self"];return t.adultOnly&&s.push("adult"),{...t,definedBy:e,configurable:!0,defaultSetting:i,flags:s,behaviors:r}}function xh(t){return(t.policies?.labelValueDefinitions||[]).filter(X(pn.validateLabelValueDefinition)).map(e=>A_(e,t.creator.did))}var ZXe={Default:`${st.AppBskyAgeassuranceDefs}#configRegionRuleDefault`,IfDeclaredOverAge:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfDeclaredOverAge`,IfDeclaredUnderAge:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfDeclaredUnderAge`,IfAssuredOverAge:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfAssuredOverAge`,IfAssuredUnderAge:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfAssuredUnderAge`,IfAccountNewerThan:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfAccountNewerThan`,IfAccountOlderThan:`${st.AppBskyAgeassuranceDefs}#configRegionRuleIfAccountOlderThan`};var Wo=class{#e=!1;#r=new Set;get acquired(){return this.#e}acquireAsync({timeout:e}={}){if(!this.#e)return this.#e=!0,Promise.resolve();if(e==null)return new Promise(i=>{this.#r.add(i)});let r,o;return Promise.race([new Promise(i=>{r=()=>{clearTimeout(o),i()},this.#r.add(r)}),new Promise((i,s)=>{o=setTimeout(()=>{this.#r.delete(r),s(new Error("Timed out waiting for lock"))},e)})])}tryAcquire(){return this.#e?!1:(this.#e=!0,!0)}release(){if(!this.#e)throw new Error("Cannot release an unacquired lock");if(this.#r.size>0){let[e]=this.#r;this.#r.delete(e),e()}else this.#e=!1}};var S_=X(Nr.validateRecord),wh=X(T.validateAdultContentPref),Rt=X(T.validateBskyAppStatePref),yn=X(T.validateContentLabelPref),kh=X(T.validateFeedViewPref),Ah=X(T.validateHiddenPostsPref),Sh=X(T.validateInterestsPref),Xo=X(T.validateLabelersPref),Qo=X(T.validateMutedWordsPref),Rh=X(T.validatePersonalDetailsPref),R_=X(T.validateDeclaredAgePref),Ch=X(T.validatePostInteractionSettingsPref),gn=X(T.validateSavedFeedsPref),_h=X(T.validateSavedFeedsPrefV2),Eh=X(T.validateThreadViewPref),Ih=X(T.validateVerificationPrefs),Dh=X(T.validateLiveEventPreferences);var C_={hideReplies:!1,hideRepliesByUnfollowed:!0,hideRepliesByLikeCount:0,hideReposts:!1,hideQuotePosts:!1},cV={sort:"hotness"},Kr=class t extends At{static{this.appLabelers=[rk]}static configure(e){e.appLabelers&&(this.appLabelers=e.appLabelers.map(nn))}get xrpc(){return this}constructor(e){let r=typeof e=="object"&&"fetchHandler"in e?e:{did:void 0,fetchHandler:on(e)};super((o,i)=>{let s=new Headers(i?.headers);return this.proxy&&!s.has("atproto-proxy")&&s.set("atproto-proxy",this.proxy),s.set("atproto-accept-labelers",[...this.appLabelers.map(a=>`${a};redact`),...this.labelers,s.get("atproto-accept-labelers")?.trim()].filter(Boolean).join(", ")),this.sessionManager.fetchHandler(o,{...i,headers:s})},Ur),this.com=new fn(this),this.app=new ln(this),this.chat=new un(this),this.tools=new hn(this),this.labelers=[],this.uploadBlob=(o,i)=>this.com.atproto.repo.uploadBlob(o,i),this.resolveHandle=(o,i)=>this.com.atproto.identity.resolveHandle(o,i),this.updateHandle=(o,i)=>this.com.atproto.identity.updateHandle(o,i),this.createModerationReport=(o,i)=>this.com.atproto.moderation.createReport(o,i),this.getTimeline=(o,i)=>this.app.bsky.feed.getTimeline(o,i),this.getAuthorFeed=(o,i)=>this.app.bsky.feed.getAuthorFeed(o,i),this.getActorLikes=(o,i)=>this.app.bsky.feed.getActorLikes(o,i),this.getPostThread=(o,i)=>this.app.bsky.feed.getPostThread(o,i),this.getPost=o=>this.app.bsky.feed.post.get(o),this.getPosts=(o,i)=>this.app.bsky.feed.getPosts(o,i),this.getLikes=(o,i)=>this.app.bsky.feed.getLikes(o,i),this.getRepostedBy=(o,i)=>this.app.bsky.feed.getRepostedBy(o,i),this.getFollows=(o,i)=>this.app.bsky.graph.getFollows(o,i),this.getFollowers=(o,i)=>this.app.bsky.graph.getFollowers(o,i),this.getProfile=(o,i)=>this.app.bsky.actor.getProfile(o,i),this.getProfiles=(o,i)=>this.app.bsky.actor.getProfiles(o,i),this.getSuggestions=(o,i)=>this.app.bsky.actor.getSuggestions(o,i),this.searchActors=(o,i)=>this.app.bsky.actor.searchActors(o,i),this.searchActorsTypeahead=(o,i)=>this.app.bsky.actor.searchActorsTypeahead(o,i),this.listNotifications=(o,i)=>this.app.bsky.notification.listNotifications(o,i),this.countUnreadNotifications=(o,i)=>this.app.bsky.notification.getUnreadCount(o,i),this.getLabelers=(o,i)=>this.app.bsky.labeler.getServices(o,i),this.#e=new Wo,this.sessionManager=r}clone(){return this.copyInto(new t(this.sessionManager))}copyInto(e){e.configureLabelers(this.labelers),e.configureProxy(this.proxy??null),e.clearHeaders();for(let[r,o]of this.headers)e.setHeader(r,o);return e}withProxy(e,r){let o=this.clone();return o.configureProxy(`${nn(r)}#${e}`),o}get appLabelers(){return this.constructor.appLabelers}configureLabelers(e){this.labelers=e.map(nn)}configureLabelersHeader(e){this.configureLabelers(e.filter(Go))}configureProxy(e){e===null?this.proxy=void 0:this.proxy=tk(e)}configureProxyHeader(e,r){Go(r)&&this.configureProxy(`${r}#${e}`)}get did(){let{did:e}=this.sessionManager;if(e)return Bo(e),e}get accountDid(){return this.assertDid}get assertDid(){return this.assertAuthenticated(),this.did}assertAuthenticated(){if(!this.did)throw new Error("Not logged in")}get api(){return this}async getLabelDefinitions(e){let r=[...this.appLabelers];uV(e)?r.push(...e.moderationPrefs.labelers.map(s=>s.did)):E_(e)?r.push(...e.labelers.map(s=>s.did)):r.push(...e);let o=await this.getLabelers({dids:r,detailed:!0}),i={};if(o.data)for(let s of o.data.views)i[s.creator.did]=xh(s);return i}async post(e){return e.createdAt||=new Date().toISOString(),this.app.bsky.feed.post.create({repo:this.accountDid},e)}async deletePost(e){this.assertAuthenticated();let r=new ge(e);return this.app.bsky.feed.post.delete({repo:r.hostname,rkey:r.rkey})}async like(e,r,o){return this.app.bsky.feed.like.create({repo:this.accountDid},{subject:{uri:e,cid:r},createdAt:new Date().toISOString(),via:o})}async deleteLike(e){this.assertAuthenticated();let r=new ge(e);return this.app.bsky.feed.like.delete({repo:r.hostname,rkey:r.rkey})}async repost(e,r,o){return this.app.bsky.feed.repost.create({repo:this.accountDid},{subject:{uri:e,cid:r},createdAt:new Date().toISOString(),via:o})}async deleteRepost(e){this.assertAuthenticated();let r=new ge(e);return this.app.bsky.feed.repost.delete({repo:r.hostname,rkey:r.rkey})}async follow(e,r){return this.app.bsky.graph.follow.create({repo:this.accountDid},{subject:e,createdAt:new Date().toISOString(),via:r})}async deleteFollow(e){this.assertAuthenticated();let r=new ge(e);return this.app.bsky.graph.follow.delete({repo:r.hostname,rkey:r.rkey})}async upsertProfile(e){return Xx(async()=>{let o=this.assertDid,i="app.bsky.actor.profile",s=await this.com.atproto.repo.getRecord({repo:o,collection:i,rkey:"self"}).catch(f=>{}),a=s&&S_(s.data.value)?s.data.value:void 0,c=await e(a),u=Nr.validateRecord({$type:i,...c});if(!u.success)throw u.error;await this.com.atproto.repo.putRecord({repo:o,collection:i,rkey:"self",record:u.value,swapRecord:s?.data.cid||null})},{maxRetries:5,retryable:o=>o instanceof Ko.InvalidSwapError})}async mute(e,r={}){return this.app.bsky.graph.muteActor({actor:e,onlyReposts:r.onlyReposts,onlyQuoteposts:r.onlyQuoteposts})}async unmute(e){return this.app.bsky.graph.unmuteActor({actor:e})}async muteModList(e){return this.app.bsky.graph.muteActorList({list:e})}async unmuteModList(e){return this.app.bsky.graph.unmuteActorList({list:e})}async blockModList(e){return this.app.bsky.graph.listblock.create({repo:this.accountDid},{subject:e,createdAt:new Date().toISOString()})}async unblockModList(e){let r=this.accountDid,i=(await this.app.bsky.graph.getList({list:e,limit:1})).data.list.viewer?.blocked;if(i){let{rkey:s}=new ge(i);return this.app.bsky.graph.listblock.delete({repo:r,rkey:s})}}async updateSeenNotifications(e=new Date().toISOString()){return this.app.bsky.notification.updateSeen({seenAt:e})}async getPreferences(){let e={feeds:{saved:void 0,pinned:void 0},savedFeeds:void 0,feedViewPrefs:{home:{...C_}},threadViewPrefs:{...cV},moderationPrefs:{adultContentEnabled:!1,labels:{...vh},labelers:this.appLabelers.map(i=>({did:i,labels:{}})),mutedWords:[],hiddenPosts:[]},birthDate:void 0,interests:{tags:[]},bskyAppState:{queuedNudges:[],activeProgressGuide:void 0,nuxs:[]},postInteractionSettings:{threadgateAllowRules:void 0,postgateEmbeddingRules:void 0},verificationPrefs:{hideBadges:!1},liveEventPreferences:{hiddenFeedIds:[],hideAllFeeds:!1}},r=await this.app.bsky.actor.getPreferences({}),o=[];for(let i of r.data.preferences)if(wh(i))e.moderationPrefs.adultContentEnabled=i.enabled;else if(yn(i)){let s=dV(i);o.push(s)}else if(Xo(i))e.moderationPrefs.labelers=this.appLabelers.map(s=>({did:s,labels:{}})).concat(i.labelers.map(s=>({...s,labels:{}})));else if(_h(i))e.savedFeeds=i.items;else if(gn(i))e.feeds.saved=i.saved,e.feeds.pinned=i.pinned;else if(Rh(i))i.birthDate&&(e.birthDate=new Date(i.birthDate));else if(R_(i)){let{$type:s,...a}=i;e.declaredAge=a}else if(kh(i)){let{$type:s,feed:a,...c}=i;e.feedViewPrefs[a]={...C_,...c}}else if(Eh(i)){let{$type:s,...a}=i;e.threadViewPrefs={...e.threadViewPrefs,...a}}else if(Sh(i)){let{$type:s,updatedAt:a,...c}=i;e.interests={...e.interests,...c,...a!==void 0&&{updatedAt:gp(a)}}}else Qo(i)?(e.moderationPrefs.mutedWords=i.items,e.moderationPrefs.mutedWords.length&&(e.moderationPrefs.mutedWords=e.moderationPrefs.mutedWords.map(s=>(s.actorTarget=s.actorTarget||"all",s)))):Ah(i)?e.moderationPrefs.hiddenPosts=i.items:Rt(i)?(e.bskyAppState.queuedNudges=i.queuedNudges||[],e.bskyAppState.activeProgressGuide=i.activeProgressGuide,e.bskyAppState.nuxs=i.nuxs||[],i.isBetaUser!==void 0&&(e.bskyAppState.isBetaUser=i.isBetaUser)):Ch(i)?(e.postInteractionSettings.threadgateAllowRules=i.threadgateAllowRules,e.postInteractionSettings.postgateEmbeddingRules=i.postgateEmbeddingRules):Ih(i)?e.verificationPrefs={hideBadges:i.hideBadges}:Dh(i)&&(e.liveEventPreferences={hiddenFeedIds:i.hiddenFeedIds||[],hideAllFeeds:i.hideAllFeeds??!1});if(e.savedFeeds==null){let{saved:i,pinned:s}=e.feeds;if(i&&s){let a=new Map;a.set("timeline",{id:Pe.nextStr(),type:"timeline",value:"following",pinned:!0});for(let c of s){let u=Mp(c);u!=="unknown"&&a.set(c,{id:Pe.nextStr(),type:u,value:c,pinned:!0})}for(let c of i)if(!a.has(c)){let u=Mp(c);if(u==="unknown")continue;a.set(c,{id:Pe.nextStr(),type:u,value:c,pinned:!1})}e.savedFeeds=Array.from(a.values())}else e.savedFeeds=[{id:Pe.nextStr(),type:"timeline",value:"following",pinned:!0}];await this.overwriteSavedFeeds(e.savedFeeds)}for(let i of o)if(i.labelerDid){let s=e.moderationPrefs.labelers.find(a=>a.did===i.labelerDid);if(!s)continue;s.labels[i.label]=i.visibility}else e.moderationPrefs.labels[i.label]=i.visibility;return e.moderationPrefs.labels=lV(e.moderationPrefs.labels),this.configureLabelers(Th(r.data.preferences)),e}async overwriteSavedFeeds(e){e.forEach(an);let r=new Map;return e.forEach(o=>{r.has(o.id)&&r.delete(o.id),r.set(o.id,o)}),this.updateSavedFeedsV2Preferences(()=>Array.from(r.values()))}async updateSavedFeeds(e){return e.map(an),this.updateSavedFeedsV2Preferences(r=>r.map(o=>{let i=e.find(s=>o.id===s.id);return i?{...o,pinned:i.pinned}:o}))}async addSavedFeeds(e){let r=e.map(o=>({...o,id:Pe.nextStr()}));return r.forEach(an),this.updateSavedFeedsV2Preferences(o=>[...o,...r])}async removeSavedFeeds(e){return this.updateSavedFeedsV2Preferences(r=>[...r.filter(o=>!e.find(i=>o.id===i))])}async setSavedFeeds(e,r){return this.updateFeedPreferences(()=>({saved:e,pinned:r}))}async addSavedFeed(e){return this.updateFeedPreferences((r,o)=>({saved:[...r.filter(i=>i!==e),e],pinned:o}))}async removeSavedFeed(e){return this.updateFeedPreferences((r,o)=>({saved:r.filter(i=>i!==e),pinned:o.filter(i=>i!==e)}))}async addPinnedFeed(e){return this.updateFeedPreferences((r,o)=>({saved:[...r.filter(i=>i!==e),e],pinned:[...o.filter(i=>i!==e),e]}))}async removePinnedFeed(e){return this.updateFeedPreferences((r,o)=>({saved:r,pinned:o.filter(i=>i!==e)}))}async setAdultContentEnabled(e){await this.updatePreferences(r=>{let o=r.findLast(wh)||{$type:"app.bsky.actor.defs#adultContentPref",enabled:e};return o.enabled=e,r.filter(i=>!T.isAdultContentPref(i)).concat(o)})}async setContentLabelPref(e,r,o){o&&Bo(o),await this.updatePreferences(i=>{let s=i.filter(yn).findLast(c=>c.label===e&&c.labelerDid===o)||{$type:"app.bsky.actor.defs#contentLabelPref",label:e,labelerDid:o,visibility:r};s.visibility=r;let a;if(T.isContentLabelPref(s)&&!s.labelerDid){let c={"graphic-media":"gore",porn:"nsfw",sexual:"suggestive",__proto__:null}[s.label];c&&(a=i.filter(yn).findLast(u=>u.label===c&&u.labelerDid===void 0)||{$type:"app.bsky.actor.defs#contentLabelPref",label:c,labelerDid:void 0,visibility:r},a.visibility=r)}return i.filter(c=>!T.isContentLabelPref(c)||!(c.label===e&&c.labelerDid===o)).concat(s).filter(c=>a?!T.isContentLabelPref(c)||!(c.label===a.label&&c.labelerDid===void 0):!0).concat(a?[a]:[])})}async addLabeler(e){let r=await this.updatePreferences(o=>{let i=o.findLast(Xo)||{$type:"app.bsky.actor.defs#labelersPref",labelers:[]};return i.labelers.some(s=>s.did===e)||i.labelers.push({did:e}),o.filter(s=>!T.isLabelersPref(s)).concat(i)});this.configureLabelers(Th(r))}async removeLabeler(e){let r=await this.updatePreferences(o=>{let i=o.findLast(Xo)||{$type:"app.bsky.actor.defs#labelersPref",labelers:[]};return i.labelers=i.labelers.filter(s=>s.did!==e),o.filter(s=>!T.isLabelersPref(s)).concat(i)});this.configureLabelers(Th(r))}async setPersonalDetails({birthDate:e}){await this.updatePreferences(r=>{let o=r.findLast(Rh)||{$type:"app.bsky.actor.defs#personalDetailsPref"};return o.birthDate=e instanceof Date?e.toISOString():e,r.filter(i=>!T.isPersonalDetailsPref(i)).concat(o)})}async setFeedViewPrefs(e,r){await this.updatePreferences(o=>{let i=o.filter(kh).findLast(s=>s.feed===e);return o.filter(s=>!T.isFeedViewPref(s)||s.feed!==e).concat({...i,...r,$type:"app.bsky.actor.defs#feedViewPref",feed:e})})}async setThreadViewPrefs(e){await this.updatePreferences(r=>{let o=r.findLast(Eh);return r.filter(i=>!T.isThreadViewPref(i)).concat({...o,...e,$type:"app.bsky.actor.defs#threadViewPref"})})}async setInterestsPref(e){await this.updatePreferences(r=>{let o=r.findLast(Sh);return r.filter(i=>!T.isInterestsPref(i)).concat({...o,...e,$type:"app.bsky.actor.defs#interestsPref",updatedAt:lw()})})}async addMutedWord(e){let r=$p(e.value);r&&await this.updatePreferences(o=>{let i=o.findLast(Qo),s={id:Pe.nextStr(),value:r,targets:e.targets||[],actorTarget:e.actorTarget||"all",expiresAt:e.expiresAt||void 0};return i?(i.items.push(s),i.items=Ph(i.items)):i={$type:"app.bsky.actor.defs#mutedWordsPref",items:[s]},o.filter(a=>!T.isMutedWordsPref(a)).concat(i)})}async addMutedWords(e){await Promise.all(e.map(r=>this.addMutedWord(r)))}async upsertMutedWords(e){await this.addMutedWords(e)}async updateMutedWord(e){await this.updatePreferences(r=>{let o=r.findLast(Qo);return o?(o.items=o.items.map(i=>{if(__(i,e)){let a={...i,...e};return{id:i.id||Pe.nextStr(),value:$p(a.value)||i.value,targets:a.targets||[],actorTarget:a.actorTarget||"all",expiresAt:a.expiresAt||void 0}}else return i}),o.items=Ph(o.items),r.filter(i=>!T.isMutedWordsPref(i)).concat(o)):r})}async removeMutedWord(e){await this.updatePreferences(r=>{let o=r.findLast(Qo);if(o){for(let i=0;i<o.items.length;i++)if(__(o.items[i],e)){o.items.splice(i,1);break}return o.items=Ph(o.items),r.filter(i=>!T.isMutedWordsPref(i)).concat(o)}return r})}async removeMutedWords(e){await Promise.all(e.map(r=>this.removeMutedWord(r)))}async hidePost(e){await this.updateHiddenPost(e,"hide")}async unhidePost(e){await this.updateHiddenPost(e,"unhide")}async bskyAppQueueNudges(e){await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};return o.queuedNudges=(o.queuedNudges||[]).concat(e),r.filter(i=>!T.isBskyAppStatePref(i)).concat(o)})}async bskyAppDismissNudges(e){await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};return e=Array.isArray(e)?e:[e],o.queuedNudges=(o.queuedNudges||[]).filter(i=>!e.includes(i)),r.filter(i=>!T.isBskyAppStatePref(i)).concat(o)})}async bskyAppSetActiveProgressGuide(e){if(e){let r=T.validateBskyAppProgressGuide(e);if(!r.success)throw r.error}await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};return o.activeProgressGuide=e,r.filter(i=>!T.isBskyAppStatePref(i)).concat(o)})}async setIsBetaUser(e){await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};return o.isBetaUser=e,r.filter(i=>!T.isBskyAppStatePref(i)).concat(o)})}async bskyAppUpsertNux(e){ik(e),await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};o.nuxs=o.nuxs||[];let i=o.nuxs?.find(a=>a.id===e.id),s;return i?s={id:i.id,completed:e.completed,data:e.data,expiresAt:e.expiresAt}:s=e,o.nuxs=o.nuxs.filter(a=>a.id!==e.id).concat(s),r.filter(a=>!T.isBskyAppStatePref(a)).concat(o)})}async bskyAppRemoveNuxs(e){await this.updatePreferences(r=>{let o=r.findLast(Rt)||{$type:"app.bsky.actor.defs#bskyAppStatePref"};return o.nuxs=(o.nuxs||[]).filter(i=>!e.includes(i.id)),r.filter(i=>!T.isBskyAppStatePref(i)).concat(o)})}async setPostInteractionSettings(e){let r=T.validatePostInteractionSettingsPref(e);if(!r.success)throw r.error;await this.updatePreferences(o=>{let i=o.findLast(Ch)||{$type:"app.bsky.actor.defs#postInteractionSettingsPref"};return i.threadgateAllowRules=e.threadgateAllowRules,i.postgateEmbeddingRules=e.postgateEmbeddingRules,o.filter(s=>!T.isPostInteractionSettingsPref(s)).concat(i)})}async setVerificationPrefs(e){let r=T.validateVerificationPrefs(e);if(!r.success)throw r.error;await this.updatePreferences(o=>{let i=o.findLast(Ih)||{$type:"app.bsky.actor.defs#verificationPrefs",hideBadges:!1};return i.hideBadges=e.hideBadges,o.filter(s=>!T.isVerificationPrefs(s)).concat(i)})}async updateLiveEventPreferences(e){return this.updatePreferences(r=>{let o=r.findLast(Dh)||{$type:"app.bsky.actor.defs#liveEventPreferences",hiddenFeedIds:[],hideAllFeeds:!1},i=new Set(o.hiddenFeedIds||[]);switch(e.type){case"hideFeed":i.add(e.id);break;case"unhideFeed":i.delete(e.id);break;case"toggleHideAllFeeds":o.hideAllFeeds=!o.hideAllFeeds;break}return o.hiddenFeedIds=[...i],r.filter(s=>!T.isLiveEventPreferences(s)).concat(o)})}#e;async updatePreferences(e){try{await this.#e.acquireAsync();let r=await this.app.bsky.actor.getPreferences({}),o=e(r.data.preferences);return o===!1?r.data.preferences:(await this.app.bsky.actor.putPreferences({preferences:o}),o)}finally{this.#e.release()}}async updateHiddenPost(e,r){await this.updatePreferences(o=>{let i=o.findLast(Ah)||{$type:"app.bsky.actor.defs#hiddenPostsPref",items:[]},s=new Set(i.items);return r==="hide"?s.add(e):s.delete(e),i.items=[...s],o.filter(a=>!T.isHiddenPostsPref(a)).concat(i)})}async updateFeedPreferences(e){let r;return await this.updatePreferences(o=>{let i=o.findLast(gn)||{$type:"app.bsky.actor.defs#savedFeedsPref",saved:[],pinned:[]};return r=e(i.saved,i.pinned),i.saved=r.saved,i.pinned=r.pinned,o.filter(s=>!T.isSavedFeedsPref(s)).concat(i)}),r}async updateSavedFeedsV2Preferences(e){let r=[];return await this.updatePreferences(o=>{let i=o.findLast(_h)||{$type:"app.bsky.actor.defs#savedFeedsPrefV2",items:[]},s=e(i.items);i.items=[...s].sort((u,f)=>u.pinned===f.pinned?0:u.pinned?-1:1),r=s;let a=o.filter(u=>!T.isSavedFeedsPrefV2(u)).concat(i),c=o.findLast(gn);if(c){let{saved:u,pinned:f}=c,m=ok(i.items.filter(h=>["feed","list"].includes(h.type)));c={...c,saved:Array.from(new Set([...u,...m.saved])),pinned:Array.from(new Set([...f,...m.pinned]))},a=a.filter(h=>!T.isSavedFeedsPref(h)).concat(c)}return a}),r}};function dV(t){let e=t.visibility;return e==="show"&&(e="ignore"),{...t,visibility:e}}function lV(t){let e={...t},r={gore:"graphic-media",nsfw:"porn",suggestive:"sexual"};for(let o in e){let i=r[o];i&&(e[i]=e[o])}return e}function Th(t){let e=t.findLast(Xo),r=[];return e&&(r=e.labelers.map(o=>o.did)),r}function uV(t){return t&&typeof t=="object"&&"moderationPrefs"in t&&E_(t.moderationPrefs)}function E_(t){return t&&typeof t=="object"&&"labelers"in t}function Ph(t){return t.map(e=>({...e,id:e.id||Pe.nextStr()}))}function __(t,e){let r=t.id,o=r&&r===e.id,i=!r&&t.value===e.value;return o||i}var k8e=globalThis.ReadableStream;var T8e=new qe(qp);var D_=document.currentScript;if(!D_?.src)throw new Error("Impossible de d\xE9terminer l\u2019URL du bundle ATProto.");var fV=new URL("oauth-client-metadata.php",D_.src).href,bn=null,We=null,Hr=null;async function T_(){bn=await Ds.load({clientId:fV,handleResolver:"https://bsky.social/"});let t=await bn.init();return t?.session?(We=t.session,Hr=new Kr(We),{connected:!0,did:We.did}):{connected:!1}}async function P_(t){if(!bn)throw new Error("Client OAuth non initialis\xE9.");await bn.signIn(t,{signal:AbortSignal.timeout(1e4)})}async function j_(){if(!Hr||!We)throw new Error("Aucune session ATProto active.");let t=await Hr.getProfile({actor:We.did});return{did:We.did,handle:t.data.handle,displayName:t.data.displayName||"",avatar:t.data.avatar||""}}async function q_(){return We?(await We.signOut(),We=null,Hr=null,{disconnected:!0}):{disconnected:!0}}async function B_(t,e){if(!Hr||!We)throw new Error("Aucune session ATProto active.");if(t=String(t||"").trim(),!t)throw new Error("La r\xE9ponse est vide.");if(!e||!e.uri||!e.cid)throw new Error("La publication ATProto racine est introuvable.");let r=await Hr.post({text:t,reply:{root:{uri:e.uri,cid:e.cid},parent:{uri:e.uri,cid:e.cid}},createdAt:new Date().toISOString()});return{uri:r.uri,cid:r.cid}}window.FederatedCommentsATProto={init:T_,login:P_,publish:B_,profile:j_,logout:q_};})();
/*! Bundled license information:

@atproto/lex-data/dist/uint8array.js:
@atproto/lex-data/dist/utf8.js:
  (* v8 ignore next -- @preserve *)
*/