@devvit/public-api 0.11.0-next-2024-07-24-919ab41f5.0 → 0.11.0-next-2024-07-24-34983954c.0

Sign up to get free protection for your applications and to get access to all the features.
package/public-api.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var zS=Object.create;var ap=Object.defineProperty;var JS=Object.getOwnPropertyDescriptor;var $S=Object.getOwnPropertyNames;var KS=Object.getPrototypeOf,XS=Object.prototype.hasOwnProperty;var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var ZS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $S(e))!XS.call(r,s)&&s!==t&&ap(r,s,{get:()=>e[s],enumerable:!(i=JS(e,s))||i.enumerable});return r};var Bn=(r,e,t)=>(t=r!=null?zS(KS(r)):{},ZS(e||!r||!r.__esModule?ap(t,"default",{value:r,enumerable:!0}):t,r));var Wl=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var n=(r,e,t)=>(Wl(r,e,"read from private field"),t?t.call(r):e.get(r)),d=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},l=(r,e,t,i)=>(Wl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);var S=(r,e,t)=>(Wl(r,e,"access private method"),t);var ne=h((PF,dp)=>{dp.exports=function(r){try{return!!r()}catch{return!0}}});var Ea=h((CF,lp)=>{var YS=ne();lp.exports=!YS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var z=h((IF,mp)=>{var up=Ea(),cp=Function.prototype,Gl=cp.call,QS=up&&cp.bind.bind(Gl,Gl);mp.exports=up?QS:function(r){return function(){return Gl.apply(r,arguments)}}});var fp=h((wF,pp)=>{var eP=Math.ceil,tP=Math.floor;pp.exports=Math.trunc||function(e){var t=+e;return(t>0?tP:eP)(t)}});var Ra=h((xF,gp)=>{var rP=fp();gp.exports=function(r){var e=+r;return e!==e||e===0?0:rP(e)}});var le=h((AF,hp)=>{var Oa=function(r){return r&&r.Math==Math&&r};hp.exports=Oa(typeof globalThis=="object"&&globalThis)||Oa(typeof window=="object"&&window)||Oa(typeof self=="object"&&self)||Oa(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var _r=h((TF,vp)=>{vp.exports=!1});var Fa=h((EF,bp)=>{var yp=le(),iP=Object.defineProperty;bp.exports=function(r,e){try{iP(yp,r,{value:e,configurable:!0,writable:!0})}catch{yp[r]=e}return e}});var Ma=h((RF,Sp)=>{var nP=le(),sP=Fa(),kp="__core-js_shared__",oP=nP[kp]||sP(kp,{});Sp.exports=oP});var Vl=h((OF,Cp)=>{var aP=_r(),Pp=Ma();(Cp.exports=function(r,e){return Pp[r]||(Pp[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:aP?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var La=h((FF,Ip)=>{Ip.exports=function(r){return r==null}});var Ua=h((MF,wp)=>{var dP=La(),lP=TypeError;wp.exports=function(r){if(dP(r))throw lP("Can't call method on "+r);return r}});var Dn=h((LF,xp)=>{var uP=Ua(),cP=Object;xp.exports=function(r){return cP(uP(r))}});var Se=h((UF,Ap)=>{var mP=z(),pP=Dn(),fP=mP({}.hasOwnProperty);Ap.exports=Object.hasOwn||function(e,t){return fP(pP(e),t)}});var zl=h((BF,Tp)=>{var gP=z(),hP=0,vP=Math.random(),yP=gP(1 .toString);Tp.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+yP(++hP+vP,36)}});var Rp=h((DF,Ep)=>{Ep.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var Dp=h((_F,Bp)=>{var Up=le(),Jl=Rp(),Op=Up.process,Fp=Up.Deno,Mp=Op&&Op.versions||Fp&&Fp.version,Lp=Mp&&Mp.v8,Ne,Ba;Lp&&(Ne=Lp.split("."),Ba=Ne[0]>0&&Ne[0]<4?1:+(Ne[0]+Ne[1]));!Ba&&Jl&&(Ne=Jl.match(/Edge\/(\d+)/),(!Ne||Ne[1]>=74)&&(Ne=Jl.match(/Chrome\/(\d+)/),Ne&&(Ba=+Ne[1])));Bp.exports=Ba});var $l=h((NF,Np)=>{var _p=Dp(),bP=ne();Np.exports=!!Object.getOwnPropertySymbols&&!bP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&_p&&_p<41})});var Kl=h((qF,qp)=>{var kP=$l();qp.exports=kP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Pe=h((jF,Hp)=>{var SP=le(),PP=Vl(),jp=Se(),CP=zl(),IP=$l(),wP=Kl(),Nr=SP.Symbol,Xl=PP("wks"),xP=wP?Nr.for||Nr:Nr&&Nr.withoutSetter||CP;Hp.exports=function(r){return jp(Xl,r)||(Xl[r]=IP&&jp(Nr,r)?Nr[r]:xP("Symbol."+r)),Xl[r]}});var Vp=h((HF,Gp)=>{var AP=Pe(),TP=AP("toStringTag"),Wp={};Wp[TP]="z";Gp.exports=String(Wp)==="[object z]"});var Yl=h((WF,zp)=>{var Zl=typeof document=="object"&&document.all,EP=typeof Zl>"u"&&Zl!==void 0;zp.exports={all:Zl,IS_HTMLDDA:EP}});var J=h((GF,$p)=>{var Jp=Yl(),RP=Jp.all;$p.exports=Jp.IS_HTMLDDA?function(r){return typeof r=="function"||r===RP}:function(r){return typeof r=="function"}});var Da=h((VF,Xp)=>{var Kp=z(),OP=Kp({}.toString),FP=Kp("".slice);Xp.exports=function(r){return FP(OP(r),8,-1)}});var _n=h((zF,Zp)=>{var MP=Vp(),LP=J(),_a=Da(),UP=Pe(),BP=UP("toStringTag"),DP=Object,_P=_a(function(){return arguments}())=="Arguments",NP=function(r,e){try{return r[e]}catch{}};Zp.exports=MP?_a:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=NP(e=DP(r),BP))=="string"?t:_P?_a(e):(i=_a(e))=="Object"&&LP(e.callee)?"Arguments":i}});var Nn=h((JF,Yp)=>{var qP=_n(),jP=String;Yp.exports=function(r){if(qP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return jP(r)}});var eu=h(($F,tf)=>{var Ql=z(),HP=Ra(),WP=Nn(),GP=Ua(),VP=Ql("".charAt),Qp=Ql("".charCodeAt),zP=Ql("".slice),ef=function(r){return function(e,t){var i=WP(GP(e)),s=HP(t),o=i.length,a,c;return s<0||s>=o?r?"":void 0:(a=Qp(i,s),a<55296||a>56319||s+1===o||(c=Qp(i,s+1))<56320||c>57343?r?VP(i,s):a:r?zP(i,s,s+2):(a-55296<<10)+(c-56320)+65536)}};tf.exports={codeAt:ef(!1),charAt:ef(!0)}});var sf=h((KF,nf)=>{var JP=le(),$P=J(),rf=JP.WeakMap;nf.exports=$P(rf)&&/native code/.test(String(rf))});var yt=h((XF,df)=>{var of=J(),af=Yl(),KP=af.all;df.exports=af.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:of(r)||r===KP}:function(r){return typeof r=="object"?r!==null:of(r)}});var ue=h((ZF,lf)=>{var XP=ne();lf.exports=!XP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var ru=h((YF,cf)=>{var ZP=le(),uf=yt(),tu=ZP.document,YP=uf(tu)&&uf(tu.createElement);cf.exports=function(r){return YP?tu.createElement(r):{}}});var iu=h((QF,mf)=>{var QP=ue(),eC=ne(),tC=ru();mf.exports=!QP&&!eC(function(){return Object.defineProperty(tC("div"),"a",{get:function(){return 7}}).a!=7})});var nu=h((eM,pf)=>{var rC=ue(),iC=ne();pf.exports=rC&&iC(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var $e=h((tM,ff)=>{var nC=yt(),sC=String,oC=TypeError;ff.exports=function(r){if(nC(r))return r;throw oC(sC(r)+" is not an object")}});var qe=h((rM,gf)=>{var aC=Ea(),Na=Function.prototype.call;gf.exports=aC?Na.bind(Na):function(){return Na.apply(Na,arguments)}});var qn=h((iM,hf)=>{var su=le(),dC=J(),lC=function(r){return dC(r)?r:void 0};hf.exports=function(r,e){return arguments.length<2?lC(su[r]):su[r]&&su[r][e]}});var ou=h((nM,vf)=>{var uC=z();vf.exports=uC({}.isPrototypeOf)});var au=h((sM,yf)=>{var cC=qn(),mC=J(),pC=ou(),fC=Kl(),gC=Object;yf.exports=fC?function(r){return typeof r=="symbol"}:function(r){var e=cC("Symbol");return mC(e)&&pC(e.prototype,gC(r))}});var du=h((oM,bf)=>{var hC=String;bf.exports=function(r){try{return hC(r)}catch{return"Object"}}});var qa=h((aM,kf)=>{var vC=J(),yC=du(),bC=TypeError;kf.exports=function(r){if(vC(r))return r;throw bC(yC(r)+" is not a function")}});var ja=h((dM,Sf)=>{var kC=qa(),SC=La();Sf.exports=function(r,e){var t=r[e];return SC(t)?void 0:kC(t)}});var Cf=h((lM,Pf)=>{var lu=qe(),uu=J(),cu=yt(),PC=TypeError;Pf.exports=function(r,e){var t,i;if(e==="string"&&uu(t=r.toString)&&!cu(i=lu(t,r))||uu(t=r.valueOf)&&!cu(i=lu(t,r))||e!=="string"&&uu(t=r.toString)&&!cu(i=lu(t,r)))return i;throw PC("Can't convert object to primitive value")}});var Af=h((uM,xf)=>{var CC=qe(),If=yt(),wf=au(),IC=ja(),wC=Cf(),xC=Pe(),AC=TypeError,TC=xC("toPrimitive");xf.exports=function(r,e){if(!If(r)||wf(r))return r;var t=IC(r,TC),i;if(t){if(e===void 0&&(e="default"),i=CC(t,r,e),!If(i)||wf(i))return i;throw AC("Can't convert object to primitive value")}return e===void 0&&(e="number"),wC(r,e)}});var Ha=h((cM,Tf)=>{var EC=Af(),RC=au();Tf.exports=function(r){var e=EC(r,"string");return RC(e)?e:e+""}});var Ke=h(Rf=>{var OC=ue(),FC=iu(),MC=nu(),Wa=$e(),Ef=Ha(),LC=TypeError,mu=Object.defineProperty,UC=Object.getOwnPropertyDescriptor,pu="enumerable",fu="configurable",gu="writable";Rf.f=OC?MC?function(e,t,i){if(Wa(e),t=Ef(t),Wa(i),typeof e=="function"&&t==="prototype"&&"value"in i&&gu in i&&!i[gu]){var s=UC(e,t);s&&s[gu]&&(e[t]=i.value,i={configurable:fu in i?i[fu]:s[fu],enumerable:pu in i?i[pu]:s[pu],writable:!1})}return mu(e,t,i)}:mu:function(e,t,i){if(Wa(e),t=Ef(t),Wa(i),FC)try{return mu(e,t,i)}catch{}if("get"in i||"set"in i)throw LC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var qr=h((pM,Of)=>{Of.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Ga=h((fM,Ff)=>{var BC=ue(),DC=Ke(),_C=qr();Ff.exports=BC?function(r,e,t){return DC.f(r,e,_C(1,t))}:function(r,e,t){return r[e]=t,r}});var Va=h((gM,Lf)=>{var NC=Vl(),qC=zl(),Mf=NC("keys");Lf.exports=function(r){return Mf[r]||(Mf[r]=qC(r))}});var za=h((hM,Uf)=>{Uf.exports={}});var jr=h((vM,_f)=>{var jC=sf(),Df=le(),HC=yt(),WC=Ga(),hu=Se(),vu=Ma(),GC=Va(),VC=za(),Bf="Object already initialized",yu=Df.TypeError,zC=Df.WeakMap,Ja,jn,$a,JC=function(r){return $a(r)?jn(r):Ja(r,{})},$C=function(r){return function(e){var t;if(!HC(e)||(t=jn(e)).type!==r)throw yu("Incompatible receiver, "+r+" required");return t}};jC||vu.state?(je=vu.state||(vu.state=new zC),je.get=je.get,je.has=je.has,je.set=je.set,Ja=function(r,e){if(je.has(r))throw yu(Bf);return e.facade=r,je.set(r,e),e},jn=function(r){return je.get(r)||{}},$a=function(r){return je.has(r)}):(Qt=GC("state"),VC[Qt]=!0,Ja=function(r,e){if(hu(r,Qt))throw yu(Bf);return e.facade=r,WC(r,Qt,e),e},jn=function(r){return hu(r,Qt)?r[Qt]:{}},$a=function(r){return hu(r,Qt)});var je,Qt;_f.exports={set:Ja,get:jn,has:$a,enforce:JC,getterFor:$C}});var bu=h(jf=>{"use strict";var Nf={}.propertyIsEnumerable,qf=Object.getOwnPropertyDescriptor,KC=qf&&!Nf.call({1:2},1);jf.f=KC?function(e){var t=qf(this,e);return!!t&&t.enumerable}:Nf});var Su=h((bM,Hf)=>{var XC=z(),ZC=ne(),YC=Da(),ku=Object,QC=XC("".split);Hf.exports=ZC(function(){return!ku("z").propertyIsEnumerable(0)})?function(r){return YC(r)=="String"?QC(r,""):ku(r)}:ku});var Hr=h((kM,Wf)=>{var eI=Su(),tI=Ua();Wf.exports=function(r){return eI(tI(r))}});var Pu=h(Vf=>{var rI=ue(),iI=qe(),nI=bu(),sI=qr(),oI=Hr(),aI=Ha(),dI=Se(),lI=iu(),Gf=Object.getOwnPropertyDescriptor;Vf.f=rI?Gf:function(e,t){if(e=oI(e),t=aI(t),lI)try{return Gf(e,t)}catch{}if(dI(e,t))return sI(!iI(nI.f,e,t),e[t])}});var wu=h((PM,Jf)=>{var Cu=ue(),uI=Se(),zf=Function.prototype,cI=Cu&&Object.getOwnPropertyDescriptor,Iu=uI(zf,"name"),mI=Iu&&function(){}.name==="something",pI=Iu&&(!Cu||Cu&&cI(zf,"name").configurable);Jf.exports={EXISTS:Iu,PROPER:mI,CONFIGURABLE:pI}});var Au=h((CM,$f)=>{var fI=z(),gI=J(),xu=Ma(),hI=fI(Function.toString);gI(xu.inspectSource)||(xu.inspectSource=function(r){return hI(r)});$f.exports=xu.inspectSource});var Ru=h((IM,Zf)=>{var Eu=z(),vI=ne(),yI=J(),Ka=Se(),Tu=ue(),bI=wu().CONFIGURABLE,kI=Au(),Xf=jr(),SI=Xf.enforce,PI=Xf.get,Kf=String,Xa=Object.defineProperty,CI=Eu("".slice),II=Eu("".replace),wI=Eu([].join),xI=Tu&&!vI(function(){return Xa(function(){},"length",{value:8}).length!==8}),AI=String(String).split("String"),TI=Zf.exports=function(r,e,t){CI(Kf(e),0,7)==="Symbol("&&(e="["+II(Kf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Ka(r,"name")||bI&&r.name!==e)&&(Tu?Xa(r,"name",{value:e,configurable:!0}):r.name=e),xI&&t&&Ka(t,"arity")&&r.length!==t.arity&&Xa(r,"length",{value:t.arity});try{t&&Ka(t,"constructor")&&t.constructor?Tu&&Xa(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=SI(r);return Ka(i,"source")||(i.source=wI(AI,typeof e=="string"?e:"")),r};Function.prototype.toString=TI(function(){return yI(this)&&PI(this).source||kI(this)},"toString")});var er=h((wM,Yf)=>{var EI=J(),RI=Ke(),OI=Ru(),FI=Fa();Yf.exports=function(r,e,t,i){i||(i={});var s=i.enumerable,o=i.name!==void 0?i.name:e;if(EI(t)&&OI(t,o,i),i.global)s?r[e]=t:FI(e,t);else{try{i.unsafe?r[e]&&(s=!0):delete r[e]}catch{}s?r[e]=t:RI.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var Ou=h((xM,Qf)=>{var MI=Ra(),LI=Math.max,UI=Math.min;Qf.exports=function(r,e){var t=MI(r);return t<0?LI(t+e,0):UI(t,e)}});var tg=h((AM,eg)=>{var BI=Ra(),DI=Math.min;eg.exports=function(r){return r>0?DI(BI(r),9007199254740991):0}});var Za=h((TM,rg)=>{var _I=tg();rg.exports=function(r){return _I(r.length)}});var sg=h((EM,ng)=>{var NI=Hr(),qI=Ou(),jI=Za(),ig=function(r){return function(e,t,i){var s=NI(e),o=jI(s),a=qI(i,o),c;if(r&&t!=t){for(;o>a;)if(c=s[a++],c!=c)return!0}else for(;o>a;a++)if((r||a in s)&&s[a]===t)return r||a||0;return!r&&-1}};ng.exports={includes:ig(!0),indexOf:ig(!1)}});var Mu=h((RM,ag)=>{var HI=z(),Fu=Se(),WI=Hr(),GI=sg().indexOf,VI=za(),og=HI([].push);ag.exports=function(r,e){var t=WI(r),i=0,s=[],o;for(o in t)!Fu(VI,o)&&Fu(t,o)&&og(s,o);for(;e.length>i;)Fu(t,o=e[i++])&&(~GI(s,o)||og(s,o));return s}});var Ya=h((OM,dg)=>{dg.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ug=h(lg=>{var zI=Mu(),JI=Ya(),$I=JI.concat("length","prototype");lg.f=Object.getOwnPropertyNames||function(e){return zI(e,$I)}});var Lu=h(cg=>{cg.f=Object.getOwnPropertySymbols});var pg=h((LM,mg)=>{var KI=qn(),XI=z(),ZI=ug(),YI=Lu(),QI=$e(),ew=XI([].concat);mg.exports=KI("Reflect","ownKeys")||function(e){var t=ZI.f(QI(e)),i=YI.f;return i?ew(t,i(e)):t}});var hg=h((UM,gg)=>{var fg=Se(),tw=pg(),rw=Pu(),iw=Ke();gg.exports=function(r,e,t){for(var i=tw(e),s=iw.f,o=rw.f,a=0;a<i.length;a++){var c=i[a];!fg(r,c)&&!(t&&fg(t,c))&&s(r,c,o(e,c))}}});var yg=h((BM,vg)=>{var nw=ne(),sw=J(),ow=/#|\.prototype\./,Hn=function(r,e){var t=dw[aw(r)];return t==uw?!0:t==lw?!1:sw(e)?nw(e):!!e},aw=Hn.normalize=function(r){return String(r).replace(ow,".").toLowerCase()},dw=Hn.data={},lw=Hn.NATIVE="N",uw=Hn.POLYFILL="P";vg.exports=Hn});var Wn=h((DM,bg)=>{var Uu=le(),cw=Pu().f,mw=Ga(),pw=er(),fw=Fa(),gw=hg(),hw=yg();bg.exports=function(r,e){var t=r.target,i=r.global,s=r.stat,o,a,c,p,f,v;if(i?a=Uu:s?a=Uu[t]||fw(t,{}):a=(Uu[t]||{}).prototype,a)for(c in e){if(f=e[c],r.dontCallGetSet?(v=cw(a,c),p=v&&v.value):p=a[c],o=hw(i?c:t+(s?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;gw(f,p)}(r.sham||p&&p.sham)&&mw(f,"sham",!0),pw(a,c,f,r)}}});var Bu=h((_M,kg)=>{var vw=Mu(),yw=Ya();kg.exports=Object.keys||function(e){return vw(e,yw)}});var Pg=h(Sg=>{var bw=ue(),kw=nu(),Sw=Ke(),Pw=$e(),Cw=Hr(),Iw=Bu();Sg.f=bw&&!kw?Object.defineProperties:function(e,t){Pw(e);for(var i=Cw(t),s=Iw(t),o=s.length,a=0,c;o>a;)Sw.f(e,c=s[a++],i[c]);return e}});var Ig=h((qM,Cg)=>{var ww=qn();Cg.exports=ww("document","documentElement")});var Gn=h((jM,Og)=>{var xw=$e(),Aw=Pg(),wg=Ya(),Tw=za(),Ew=Ig(),Rw=ru(),Ow=Va(),xg=">",Ag="<",_u="prototype",Nu="script",Eg=Ow("IE_PROTO"),Du=function(){},Rg=function(r){return Ag+Nu+xg+r+Ag+"/"+Nu+xg},Tg=function(r){r.write(Rg("")),r.close();var e=r.parentWindow.Object;return r=null,e},Fw=function(){var r=Rw("iframe"),e="java"+Nu+":",t;return r.style.display="none",Ew.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Rg("document.F=Object")),t.close(),t.F},Qa,ed=function(){try{Qa=new ActiveXObject("htmlfile")}catch{}ed=typeof document<"u"?document.domain&&Qa?Tg(Qa):Fw():Tg(Qa);for(var r=wg.length;r--;)delete ed[_u][wg[r]];return ed()};Tw[Eg]=!0;Og.exports=Object.create||function(e,t){var i;return e!==null?(Du[_u]=xw(e),i=new Du,Du[_u]=null,i[Eg]=e):i=ed(),t===void 0?i:Aw.f(i,t)}});var Mg=h((HM,Fg)=>{var Mw=ne();Fg.exports=!Mw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var ju=h((WM,Ug)=>{var Lw=Se(),Uw=J(),Bw=Dn(),Dw=Va(),_w=Mg(),Lg=Dw("IE_PROTO"),qu=Object,Nw=qu.prototype;Ug.exports=_w?qu.getPrototypeOf:function(r){var e=Bw(r);if(Lw(e,Lg))return e[Lg];var t=e.constructor;return Uw(t)&&e instanceof t?t.prototype:e instanceof qu?Nw:null}});var Vu=h((GM,_g)=>{"use strict";var qw=ne(),jw=J(),Hw=yt(),Ww=Gn(),Bg=ju(),Gw=er(),Vw=Pe(),zw=_r(),Gu=Vw("iterator"),Dg=!1,it,Hu,Wu;[].keys&&(Wu=[].keys(),"next"in Wu?(Hu=Bg(Bg(Wu)),Hu!==Object.prototype&&(it=Hu)):Dg=!0);var Jw=!Hw(it)||qw(function(){var r={};return it[Gu].call(r)!==r});Jw?it={}:zw&&(it=Ww(it));jw(it[Gu])||Gw(it,Gu,function(){return this});_g.exports={IteratorPrototype:it,BUGGY_SAFARI_ITERATORS:Dg}});var Vn=h((VM,qg)=>{var $w=Ke().f,Kw=Se(),Xw=Pe(),Ng=Xw("toStringTag");qg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Kw(r,Ng)&&$w(r,Ng,{configurable:!0,value:e})}});var Wr=h((zM,jg)=>{jg.exports={}});var zu=h((JM,Hg)=>{"use strict";var Zw=Vu().IteratorPrototype,Yw=Gn(),Qw=qr(),ex=Vn(),tx=Wr(),rx=function(){return this};Hg.exports=function(r,e,t,i){var s=e+" Iterator";return r.prototype=Yw(Zw,{next:Qw(+!i,t)}),ex(r,s,!1,!0),tx[s]=rx,r}});var Gg=h(($M,Wg)=>{var ix=J(),nx=String,sx=TypeError;Wg.exports=function(r){if(typeof r=="object"||ix(r))return r;throw sx("Can't set "+nx(r)+" as a prototype")}});var zg=h((KM,Vg)=>{var ox=z(),ax=$e(),dx=Gg();Vg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=ox(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(s,o){return ax(s),dx(o),r?t(s,o):s.__proto__=o,s}}():void 0)});var $u=h((XM,rh)=>{"use strict";var lx=Wn(),ux=qe(),td=_r(),eh=wu(),cx=J(),mx=zu(),Jg=ju(),$g=zg(),px=Vn(),fx=Ga(),Ju=er(),gx=Pe(),Kg=Wr(),th=Vu(),hx=eh.PROPER,vx=eh.CONFIGURABLE,Xg=th.IteratorPrototype,rd=th.BUGGY_SAFARI_ITERATORS,zn=gx("iterator"),Zg="keys",Jn="values",Yg="entries",Qg=function(){return this};rh.exports=function(r,e,t,i,s,o,a){mx(t,e,i);var c=function(F){if(F===s&&b)return b;if(!rd&&F in v)return v[F];switch(F){case Zg:return function(){return new t(this,F)};case Jn:return function(){return new t(this,F)};case Yg:return function(){return new t(this,F)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,v=r.prototype,m=v[zn]||v["@@iterator"]||s&&v[s],b=!rd&&m||c(s),y=e=="Array"&&v.entries||m,C,w,A;if(y&&(C=Jg(y.call(new r)),C!==Object.prototype&&C.next&&(!td&&Jg(C)!==Xg&&($g?$g(C,Xg):cx(C[zn])||Ju(C,zn,Qg)),px(C,p,!0,!0),td&&(Kg[p]=Qg))),hx&&s==Jn&&m&&m.name!==Jn&&(!td&&vx?fx(v,"name",Jn):(f=!0,b=function(){return ux(m,this)})),s)if(w={values:c(Jn),keys:o?b:c(Zg),entries:c(Yg)},a)for(A in w)(rd||f||!(A in v))&&Ju(v,A,w[A]);else lx({target:e,proto:!0,forced:rd||f},w);return(!td||a)&&v[zn]!==b&&Ju(v,zn,b,{name:s}),Kg[e]=b,w}});var Ku=h((ZM,ih)=>{ih.exports=function(r,e){return{value:r,done:e}}});var ah=h(()=>{"use strict";var yx=eu().charAt,bx=Nn(),sh=jr(),kx=$u(),nh=Ku(),oh="String Iterator",Sx=sh.set,Px=sh.getterFor(oh);kx(String,"String",function(r){Sx(this,{type:oh,string:bx(r),index:0})},function(){var e=Px(this),t=e.string,i=e.index,s;return i>=t.length?nh(void 0,!0):(s=yx(t,i),e.index+=s.length,nh(s,!1))})});var Xu=h((eL,dh)=>{var Cx=ne(),Ix=Pe(),wx=_r(),xx=Ix("iterator");dh.exports=!Cx(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,s){e.delete("b"),t+=s+i}),wx&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[xx]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var uh=h((tL,lh)=>{var Ax=Da(),Tx=z();lh.exports=function(r){if(Ax(r)==="Function")return Tx(r)}});var id=h((rL,mh)=>{var ch=uh(),Ex=qa(),Rx=Ea(),Ox=ch(ch.bind);mh.exports=function(r,e){return Ex(r),e===void 0?r:Rx?Ox(r,e):function(){return r.apply(e,arguments)}}});var gh=h((iL,fh)=>{var ph=Ru(),Fx=Ke();fh.exports=function(r,e,t){return t.get&&ph(t.get,e,{getter:!0}),t.set&&ph(t.set,e,{setter:!0}),Fx.f(r,e,t)}});var Zu=h((nL,hh)=>{var Mx=ou(),Lx=TypeError;hh.exports=function(r,e){if(Mx(e,r))return r;throw Lx("Incorrect invocation")}});var kh=h((sL,bh)=>{"use strict";var vh=ue(),Ux=z(),Bx=qe(),Dx=ne(),Yu=Bu(),_x=Lu(),Nx=bu(),qx=Dn(),jx=Su(),Gr=Object.assign,yh=Object.defineProperty,Hx=Ux([].concat);bh.exports=!Gr||Dx(function(){if(vh&&Gr({b:1},Gr(yh({},"a",{enumerable:!0,get:function(){yh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(s){e[s]=s}),Gr({},r)[t]!=7||Yu(Gr({},e)).join("")!=i})?function(e,t){for(var i=qx(e),s=arguments.length,o=1,a=_x.f,c=Nx.f;s>o;)for(var p=jx(arguments[o++]),f=a?Hx(Yu(p),a(p)):Yu(p),v=f.length,m=0,b;v>m;)b=f[m++],(!vh||Bx(c,p,b))&&(i[b]=p[b]);return i}:Gr});var Ch=h((oL,Ph)=>{var Wx=qe(),Sh=$e(),Gx=ja();Ph.exports=function(r,e,t){var i,s;Sh(r);try{if(i=Gx(r,"return"),!i){if(e==="throw")throw t;return t}i=Wx(i,r)}catch(o){s=!0,i=o}if(e==="throw")throw t;if(s)throw i;return Sh(i),t}});var wh=h((aL,Ih)=>{var Vx=$e(),zx=Ch();Ih.exports=function(r,e,t,i){try{return i?e(Vx(t)[0],t[1]):e(t)}catch(s){zx(r,"throw",s)}}});var Ah=h((dL,xh)=>{var Jx=Pe(),$x=Wr(),Kx=Jx("iterator"),Xx=Array.prototype;xh.exports=function(r){return r!==void 0&&($x.Array===r||Xx[Kx]===r)}});var Mh=h((lL,Fh)=>{var Zx=z(),Yx=ne(),Th=J(),Qx=_n(),eA=qn(),tA=Au(),Eh=function(){},rA=[],Rh=eA("Reflect","construct"),Qu=/^\s*(?:class|function)\b/,iA=Zx(Qu.exec),nA=!Qu.exec(Eh),$n=function(e){if(!Th(e))return!1;try{return Rh(Eh,rA,e),!0}catch{return!1}},Oh=function(e){if(!Th(e))return!1;switch(Qx(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return nA||!!iA(Qu,tA(e))}catch{return!0}};Oh.sham=!0;Fh.exports=!Rh||Yx(function(){var r;return $n($n.call)||!$n(Object)||!$n(function(){r=!0})||r})?Oh:$n});var ec=h((uL,Lh)=>{"use strict";var sA=Ha(),oA=Ke(),aA=qr();Lh.exports=function(r,e,t){var i=sA(e);i in r?oA.f(r,i,aA(0,t)):r[i]=t}});var nd=h((cL,Bh)=>{var dA=_n(),Uh=ja(),lA=La(),uA=Wr(),cA=Pe(),mA=cA("iterator");Bh.exports=function(r){if(!lA(r))return Uh(r,mA)||Uh(r,"@@iterator")||uA[dA(r)]}});var tc=h((mL,Dh)=>{var pA=qe(),fA=qa(),gA=$e(),hA=du(),vA=nd(),yA=TypeError;Dh.exports=function(r,e){var t=arguments.length<2?vA(r):e;if(fA(t))return gA(pA(t,r));throw yA(hA(r)+" is not iterable")}});var jh=h((pL,qh)=>{"use strict";var bA=id(),kA=qe(),SA=Dn(),PA=wh(),CA=Ah(),IA=Mh(),wA=Za(),_h=ec(),xA=tc(),AA=nd(),Nh=Array;qh.exports=function(e){var t=SA(e),i=IA(this),s=arguments.length,o=s>1?arguments[1]:void 0,a=o!==void 0;a&&(o=bA(o,s>2?arguments[2]:void 0));var c=AA(t),p=0,f,v,m,b,y,C;if(c&&!(this===Nh&&CA(c)))for(b=xA(t,c),y=b.next,v=i?new this:[];!(m=kA(y,b)).done;p++)C=a?PA(b,o,[m.value,p],!0):m.value,_h(v,p,C);else for(f=wA(t),v=i?new this(f):Nh(f);f>p;p++)C=a?o(t[p],p):t[p],_h(v,p,C);return v.length=p,v}});var rc=h((fL,Wh)=>{var Hh=Ou(),TA=Za(),EA=ec(),RA=Array,OA=Math.max;Wh.exports=function(r,e,t){for(var i=TA(r),s=Hh(e,i),o=Hh(t===void 0?i:t,i),a=RA(OA(o-s,0)),c=0;s<o;s++,c++)EA(a,c,r[s]);return a.length=c,a}});var Yh=h((gL,Zh)=>{var tr=z(),ic=2147483647,Kn=36,$h=1,oc=26,FA=38,MA=700,LA=72,UA=128,BA="-",DA=/[^\0-\u007E]/,Kh=/[.\u3002\uFF0E\uFF61]/g,Gh="Overflow: input needs wider integers to process",nc=Kn-$h,Vh=RangeError,_A=tr(Kh.exec),Vr=Math.floor,sc=String.fromCharCode,zh=tr("".charCodeAt),Xh=tr([].join),bt=tr([].push),NA=tr("".replace),qA=tr("".split),jA=tr("".toLowerCase),HA=function(r){for(var e=[],t=0,i=r.length;t<i;){var s=zh(r,t++);if(s>=55296&&s<=56319&&t<i){var o=zh(r,t++);(o&64512)==56320?bt(e,((s&1023)<<10)+(o&1023)+65536):(bt(e,s),t--)}else bt(e,s)}return e},Jh=function(r){return r+22+75*(r<26)},WA=function(r,e,t){var i=0;for(r=t?Vr(r/MA):r>>1,r+=Vr(r/e);r>nc*oc>>1;)r=Vr(r/nc),i+=Kn;return Vr(i+(nc+1)*r/(r+FA))},GA=function(r){var e=[];r=HA(r);var t=r.length,i=UA,s=0,o=LA,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&bt(e,sc(c));var p=e.length,f=p;for(p&&bt(e,BA);f<t;){var v=ic;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<v&&(v=c);var m=f+1;if(v-i>Vr((ic-s)/m))throw Vh(Gh);for(s+=(v-i)*m,i=v,a=0;a<r.length;a++){if(c=r[a],c<i&&++s>ic)throw Vh(Gh);if(c==i){for(var b=s,y=Kn;;){var C=y<=o?$h:y>=o+oc?oc:y-o;if(b<C)break;var w=b-C,A=Kn-C;bt(e,sc(Jh(C+w%A))),b=Vr(w/A),y+=Kn}bt(e,sc(Jh(b))),o=WA(s,m,f==p),s=0,f++}}s++,i++}return Xh(e,"")};Zh.exports=function(r){var e=[],t=qA(NA(jA(r),Kh,"."),"."),i,s;for(i=0;i<t.length;i++)s=t[i],bt(e,_A(DA,s)?"xn--"+GA(s):s);return Xh(e,".")}});var ac=h((hL,Qh)=>{var VA=TypeError;Qh.exports=function(r,e){if(r<e)throw VA("Not enough arguments");return r}});var tv=h((vL,ev)=>{var zA=Pe(),JA=Gn(),$A=Ke().f,dc=zA("unscopables"),lc=Array.prototype;lc[dc]==null&&$A(lc,dc,{configurable:!0,value:JA(null)});ev.exports=function(r){lc[dc][r]=!0}});var av=h((yL,ov)=>{"use strict";var KA=Hr(),uc=tv(),rv=Wr(),nv=jr(),XA=Ke().f,ZA=$u(),sd=Ku(),YA=_r(),QA=ue(),sv="Array Iterator",eT=nv.set,tT=nv.getterFor(sv);ov.exports=ZA(Array,"Array",function(r,e){eT(this,{type:sv,target:KA(r),index:0,kind:e})},function(){var r=tT(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,sd(void 0,!0)):t=="keys"?sd(i,!1):t=="values"?sd(e[i],!1):sd([i,e[i]],!1)},"values");var iv=rv.Arguments=rv.Array;uc("keys");uc("values");uc("entries");if(!YA&&QA&&iv.name!=="values")try{XA(iv,"name",{value:"values"})}catch{}});var lv=h((bL,dv)=>{var rT=er();dv.exports=function(r,e,t){for(var i in e)rT(r,i,e[i],t);return r}});var mv=h((kL,cv)=>{var uv=rc(),iT=Math.floor,cc=function(r,e){var t=r.length,i=iT(t/2);return t<8?nT(r,e):sT(r,cc(uv(r,0,i),e),cc(uv(r,i),e),e)},nT=function(r,e){for(var t=r.length,i=1,s,o;i<t;){for(o=i,s=r[i];o&&e(r[o-1],s)>0;)r[o]=r[--o];o!==i++&&(r[o]=s)}return r},sT=function(r,e,t,i){for(var s=e.length,o=t.length,a=0,c=0;a<s||c<o;)r[a+c]=a<s&&c<o?i(e[a],t[c])<=0?e[a++]:t[c++]:a<s?e[a++]:t[c++];return r};cv.exports=cc});var Sc=h((SL,Fv)=>{"use strict";av();var hc=Wn(),Jr=le(),od=qe(),Xe=z(),oT=ue(),Iv=Xu(),wv=er(),aT=lv(),dT=Vn(),lT=zu(),bc=jr(),xv=Zu(),mc=J(),uT=Se(),cT=id(),mT=_n(),pT=$e(),Av=yt(),ce=Nn(),fT=Gn(),pv=qr(),vc=tc(),gT=nd(),zr=ac(),hT=Pe(),vT=mv(),yT=hT("iterator"),Yn="URLSearchParams",Tv=Yn+"Iterator",Ev=bc.set,He=bc.getterFor(Yn),bT=bc.getterFor(Tv),kT=Object.getOwnPropertyDescriptor,kc=function(r){if(!oT)return Jr[r];var e=kT(Jr,r);return e&&e.value},fv=kc("fetch"),dd=kc("Request"),Xn=kc("Headers"),pc=dd&&dd.prototype,gv=Xn&&Xn.prototype,ST=Jr.RegExp,PT=Jr.TypeError,Rv=Jr.decodeURIComponent,CT=Jr.encodeURIComponent,IT=Xe("".charAt),hv=Xe([].join),rr=Xe([].push),yc=Xe("".replace),wT=Xe([].shift),vv=Xe([].splice),yv=Xe("".split),xT=Xe("".slice),AT=/\+/g,bv=Array(4),TT=function(r){return bv[r-1]||(bv[r-1]=ST("((?:%[\\da-f]{2}){"+r+"})","gi"))},ET=function(r){try{return Rv(r)}catch{return r}},kv=function(r){var e=yc(r,AT," "),t=4;try{return Rv(e)}catch{for(;t;)e=yc(e,TT(t--),ET);return e}},RT=/[!'()~]|%20/g,OT={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},FT=function(r){return OT[r]},Sv=function(r){return yc(CT(r),RT,FT)},fc=lT(function(e,t){Ev(this,{type:Tv,iterator:vc(He(e).entries),kind:t})},"Iterator",function(){var e=bT(this),t=e.kind,i=e.iterator.next(),s=i.value;return i.done||(i.value=t==="keys"?s.key:t==="values"?s.value:[s.key,s.value]),i},!0),Ov=function(r){this.entries=[],this.url=null,r!==void 0&&(Av(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?IT(r,0)==="?"?xT(r,1):r:ce(r)))};Ov.prototype={type:Yn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=gT(r),t,i,s,o,a,c,p;if(e)for(t=vc(r,e),i=t.next;!(s=od(i,t)).done;){if(o=vc(pT(s.value)),a=o.next,(c=od(a,o)).done||(p=od(a,o)).done||!od(a,o).done)throw PT("Expected sequence with length 2");rr(this.entries,{key:ce(c.value),value:ce(p.value)})}else for(var f in r)uT(r,f)&&rr(this.entries,{key:f,value:ce(r[f])})},parseQuery:function(r){if(r)for(var e=yv(r,"&"),t=0,i,s;t<e.length;)i=e[t++],i.length&&(s=yv(i,"="),rr(this.entries,{key:kv(wT(s)),value:kv(hv(s,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],rr(e,Sv(i.key)+"="+Sv(i.value));return hv(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ld=function(){xv(this,Zn);var e=arguments.length>0?arguments[0]:void 0;Ev(this,new Ov(e))},Zn=ld.prototype;aT(Zn,{append:function(e,t){zr(arguments.length,2);var i=He(this);rr(i.entries,{key:ce(e),value:ce(t)}),i.updateURL()},delete:function(r){zr(arguments.length,1);for(var e=He(this),t=e.entries,i=ce(r),s=0;s<t.length;)t[s].key===i?vv(t,s,1):s++;e.updateURL()},get:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=0;s<t.length;s++)if(t[s].key===i)return t[s].value;return null},getAll:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=[],o=0;o<t.length;o++)t[o].key===i&&rr(s,t[o].value);return s},has:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=0;s<t.length;)if(t[s++].key===i)return!0;return!1},set:function(e,t){zr(arguments.length,1);for(var i=He(this),s=i.entries,o=!1,a=ce(e),c=ce(t),p=0,f;p<s.length;p++)f=s[p],f.key===a&&(o?vv(s,p--,1):(o=!0,f.value=c));o||rr(s,{key:a,value:c}),i.updateURL()},sort:function(){var e=He(this);vT(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=He(this).entries,i=cT(e,arguments.length>1?arguments[1]:void 0),s=0,o;s<t.length;)o=t[s++],i(o.value,o.key,this)},keys:function(){return new fc(this,"keys")},values:function(){return new fc(this,"values")},entries:function(){return new fc(this,"entries")}},{enumerable:!0});wv(Zn,yT,Zn.entries,{name:"entries"});wv(Zn,"toString",function(){return He(this).serialize()},{enumerable:!0});dT(ld,Yn);hc({global:!0,constructor:!0,forced:!Iv},{URLSearchParams:ld});!Iv&&mc(Xn)&&(Pv=Xe(gv.has),Cv=Xe(gv.set),gc=function(r){if(Av(r)){var e=r.body,t;if(mT(e)===Yn)return t=r.headers?new Xn(r.headers):new Xn,Pv(t,"content-type")||Cv(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),fT(r,{body:pv(0,ce(e)),headers:pv(0,t)})}return r},mc(fv)&&hc({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return fv(e,arguments.length>1?gc(arguments[1]):{})}}),mc(dd)&&(ad=function(e){return xv(this,pc),new dd(e,arguments.length>1?gc(arguments[1]):{})},pc.constructor=ad,ad.prototype=pc,hc({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ad})));var Pv,Cv,gc,ad;Fv.exports={URLSearchParams:ld,getState:He}});var Zv=h(()=>{"use strict";ah();var MT=Wn(),Dc=ue(),LT=Xu(),_c=le(),Mv=id(),Ae=z(),fd=er(),Ce=gh(),UT=Zu(),Lc=Se(),Nc=kh(),$r=jh(),We=rc(),BT=eu().codeAt,DT=Yh(),st=Nn(),_T=Vn(),NT=ac(),Vv=Sc(),zv=jr(),qT=zv.set,gd=zv.getterFor("URL"),jT=Vv.URLSearchParams,HT=Vv.getState,Qn=_c.URL,Uc=_c.TypeError,hd=_c.parseInt,WT=Math.floor,Lv=Math.pow,xe=Ae("".charAt),Ge=Ae(/./.exec),ts=Ae([].join),GT=Ae(1 .toString),VT=Ae([].pop),Xr=Ae([].push),Uv=Ae("".replace),zT=Ae([].shift),JT=Ae("".split),is=Ae("".slice),vd=Ae("".toLowerCase),$T=Ae([].unshift),KT="Invalid authority",Pc="Invalid scheme",ir="Invalid host",Bv="Invalid port",Jv=/[a-z]/i,XT=/[\d+-.a-z]/i,Bc=/\d/,ZT=/^0x/i,YT=/^[0-7]+$/,QT=/^\d+$/,$v=/^[\da-f]+$/i,e0=/[\0\t\n\r #%/:<>?@[\\\]^|]/,t0=/[\0\t\n\r #/:<>?@[\\\]^|]/,r0=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,i0=/[\t\n\r]/g,Ie,n0=function(r){var e=JT(r,"."),t,i,s,o,a,c,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],s=0;s<t;s++){if(o=e[s],o=="")return r;if(a=10,o.length>1&&xe(o,0)=="0"&&(a=Ge(ZT,o)?16:8,o=is(o,a==8?1:2)),o==="")c=0;else{if(!Ge(a==10?QT:a==8?YT:$v,o))return r;c=hd(o,a)}Xr(i,c)}for(s=0;s<t;s++)if(c=i[s],s==t-1){if(c>=Lv(256,5-t))return null}else if(c>255)return null;for(p=VT(i),s=0;s<i.length;s++)p+=i[s]*Lv(256,3-s);return p},s0=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,s=0,o,a,c,p,f,v,m,b=function(){return xe(r,s)};if(b()==":"){if(xe(r,1)!=":")return;s+=2,t++,i=t}for(;b();){if(t==8)return;if(b()==":"){if(i!==null)return;s++,t++,i=t;continue}for(o=a=0;a<4&&Ge($v,b());)o=o*16+hd(b(),16),s++,a++;if(b()=="."){if(a==0||(s-=a,t>6))return;for(c=0;b();){if(p=null,c>0)if(b()=="."&&c<4)s++;else return;if(!Ge(Bc,b()))return;for(;Ge(Bc,b());){if(f=hd(b(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}if(p>255)return;s++}e[t]=e[t]*256+p,c++,(c==2||c==4)&&t++}if(c!=4)return;break}else if(b()==":"){if(s++,!b())return}else if(b())return;e[t++]=o}if(i!==null)for(v=t-i,t=7;t!=0&&v>0;)m=e[t],e[t--]=e[i+v-1],e[i+--v]=m;else if(t!=8)return;return e},o0=function(r){for(var e=null,t=1,i=null,s=0,o=0;o<8;o++)r[o]!==0?(s>t&&(e=i,t=s),i=null,s=0):(i===null&&(i=o),++s);return s>t&&(e=i,t=s),e},es=function(r){var e,t,i,s;if(typeof r=="number"){for(e=[],t=0;t<4;t++)$T(e,r%256),r=WT(r/256);return ts(e,".")}else if(typeof r=="object"){for(e="",i=o0(r),t=0;t<8;t++)s&&r[t]===0||(s&&(s=!1),i===t?(e+=t?":":"::",s=!0):(e+=GT(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},pd={},Kv=Nc({},pd,{" ":1,'"':1,"<":1,">":1,"`":1}),Xv=Nc({},Kv,{"#":1,"?":1,"{":1,"}":1}),Cc=Nc({},Xv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),kt=function(r,e){var t=BT(r,0);return t>32&&t<127&&!Lc(e,r)?r:encodeURIComponent(r)},ud={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rs=function(r,e){var t;return r.length==2&&Ge(Jv,xe(r,0))&&((t=xe(r,1))==":"||!e&&t=="|")},Dv=function(r){var e;return r.length>1&&rs(is(r,0,2))&&(r.length==2||(e=xe(r,2))==="/"||e==="\\"||e==="?"||e==="#")},a0=function(r){return r==="."||vd(r)==="%2e"},d0=function(r){return r=vd(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ic={},_v={},wc={},Nv={},qv={},xc={},jv={},Hv={},cd={},md={},Ac={},Tc={},Ec={},Rc={},Wv={},Oc={},Kr={},Ze={},Gv={},nr={},nt={},qc=function(r,e,t){var i=st(r),s,o,a;if(e){if(o=this.parse(i),o)throw Uc(o);this.searchParams=null}else{if(t!==void 0&&(s=new qc(t,!0)),o=this.parse(i,null,s),o)throw Uc(o);a=HT(new jT),a.bindURL(this),this.searchParams=a}};qc.prototype={type:"URL",parse:function(r,e,t){var i=this,s=e||Ic,o=0,a="",c=!1,p=!1,f=!1,v,m,b,y;for(r=st(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=Uv(r,r0,"")),r=Uv(r,i0,""),v=$r(r);o<=v.length;){switch(m=v[o],s){case Ic:if(m&&Ge(Jv,m))a+=vd(m),s=_v;else{if(e)return Pc;s=wc;continue}break;case _v:if(m&&(Ge(XT,m)||m=="+"||m=="-"||m=="."))a+=vd(m);else if(m==":"){if(e&&(i.isSpecial()!=Lc(ud,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&ud[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?s=Rc:i.isSpecial()&&t&&t.scheme==i.scheme?s=Nv:i.isSpecial()?s=Hv:v[o+1]=="/"?(s=qv,o++):(i.cannotBeABaseURL=!0,Xr(i.path,""),s=Gv)}else{if(e)return Pc;a="",s=wc,o=0;continue}break;case wc:if(!t||t.cannotBeABaseURL&&m!="#")return Pc;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=We(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,s=nt;break}s=t.scheme=="file"?Rc:xc;continue;case Nv:if(m=="/"&&v[o+1]=="/")s=cd,o++;else{s=xc;continue}break;case qv:if(m=="/"){s=md;break}else{s=Ze;continue}case xc:if(i.scheme=t.scheme,m==Ie)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())s=jv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query="",s=nr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query=t.query,i.fragment="",s=nt;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.path.length--,s=Ze;continue}break;case jv:if(i.isSpecial()&&(m=="/"||m=="\\"))s=cd;else if(m=="/")s=md;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,s=Ze;continue}break;case Hv:if(s=cd,m!="/"||xe(a,o+1)!="/")continue;o++;break;case cd:if(m!="/"&&m!="\\"){s=md;continue}break;case md:if(m=="@"){c&&(a="%40"+a),c=!0,b=$r(a);for(var C=0;C<b.length;C++){var w=b[C];if(w==":"&&!f){f=!0;continue}var A=kt(w,Cc);f?i.password+=A:i.username+=A}a=""}else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return KT;o-=$r(a).length+1,a="",s=Ac}else a+=m;break;case Ac:case Tc:if(e&&i.scheme=="file"){s=Oc;continue}else if(m==":"&&!p){if(a=="")return ir;if(y=i.parseHost(a),y)return y;if(a="",s=Ec,e==Tc)return}else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return ir;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(y=i.parseHost(a),y)return y;if(a="",s=Kr,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case Ec:if(Ge(Bc,m))a+=m;else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var F=hd(a,10);if(F>65535)return Bv;i.port=i.isSpecial()&&F===ud[i.scheme]?null:F,a=""}if(e)return;s=Kr;continue}else return Bv;break;case Rc:if(i.scheme="file",m=="/"||m=="\\")s=Wv;else if(t&&t.scheme=="file")if(m==Ie)i.host=t.host,i.path=We(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=We(t.path),i.query="",s=nr;else if(m=="#")i.host=t.host,i.path=We(t.path),i.query=t.query,i.fragment="",s=nt;else{Dv(ts(We(v,o),""))||(i.host=t.host,i.path=We(t.path),i.shortenPath()),s=Ze;continue}else{s=Ze;continue}break;case Wv:if(m=="/"||m=="\\"){s=Oc;break}t&&t.scheme=="file"&&!Dv(ts(We(v,o),""))&&(rs(t.path[0],!0)?Xr(i.path,t.path[0]):i.host=t.host),s=Ze;continue;case Oc:if(m==Ie||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&rs(a))s=Ze;else if(a==""){if(i.host="",e)return;s=Kr}else{if(y=i.parseHost(a),y)return y;if(i.host=="localhost"&&(i.host=""),e)return;a="",s=Kr}continue}else a+=m;break;case Kr:if(i.isSpecial()){if(s=Ze,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",s=nr;else if(!e&&m=="#")i.fragment="",s=nt;else if(m!=Ie&&(s=Ze,m!="/"))continue;break;case Ze:if(m==Ie||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(d0(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&Xr(i.path,"")):a0(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&Xr(i.path,""):(i.scheme=="file"&&!i.path.length&&rs(a)&&(i.host&&(i.host=""),a=xe(a,0)+":"),Xr(i.path,a)),a="",i.scheme=="file"&&(m==Ie||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)zT(i.path);m=="?"?(i.query="",s=nr):m=="#"&&(i.fragment="",s=nt)}else a+=kt(m,Xv);break;case Gv:m=="?"?(i.query="",s=nr):m=="#"?(i.fragment="",s=nt):m!=Ie&&(i.path[0]+=kt(m,pd));break;case nr:!e&&m=="#"?(i.fragment="",s=nt):m!=Ie&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=kt(m,pd));break;case nt:m!=Ie&&(i.fragment+=kt(m,Kv));break}o++}},parseHost:function(r){var e,t,i;if(xe(r,0)=="["){if(xe(r,r.length-1)!="]"||(e=s0(is(r,1,-1)),!e))return ir;this.host=e}else if(this.isSpecial()){if(r=DT(r),Ge(e0,r)||(e=n0(r),e===null))return ir;this.host=e}else{if(Ge(t0,r))return ir;for(e="",t=$r(r),i=0;i<t.length;i++)e+=kt(t[i],pd);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return Lc(ud,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!rs(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,s=r.host,o=r.port,a=r.path,c=r.query,p=r.fragment,f=e+":";return s!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=es(s),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+ts(a,"/"):"",c!==null&&(f+="?"+c),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw Uc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new Zr(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+es(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(st(r)+":",Ic)},getUsername:function(){return this.username},setUsername:function(r){var e=$r(st(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=kt(e[t],Cc)}},getPassword:function(){return this.password},setPassword:function(r){var e=$r(st(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=kt(e[t],Cc)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?es(r):es(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Ac)},getHostname:function(){var r=this.host;return r===null?"":es(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Tc)},getPort:function(){var r=this.port;return r===null?"":st(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=st(r),r==""?this.port=null:this.parse(r,Ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+ts(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Kr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=st(r),r==""?this.query=null:(xe(r,0)=="?"&&(r=is(r,1)),this.query="",this.parse(r,nr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=st(r),r==""){this.fragment=null;return}xe(r,0)=="#"&&(r=is(r,1)),this.fragment="",this.parse(r,nt)},update:function(){this.query=this.searchParams.serialize()||null}};var Zr=function(e){var t=UT(this,Y),i=NT(arguments.length,1)>1?arguments[1]:void 0,s=qT(t,new qc(e,!1,i));Dc||(t.href=s.serialize(),t.origin=s.getOrigin(),t.protocol=s.getProtocol(),t.username=s.getUsername(),t.password=s.getPassword(),t.host=s.getHost(),t.hostname=s.getHostname(),t.port=s.getPort(),t.pathname=s.getPathname(),t.search=s.getSearch(),t.searchParams=s.getSearchParams(),t.hash=s.getHash())},Y=Zr.prototype,we=function(r,e){return{get:function(){return gd(this)[r]()},set:e&&function(t){return gd(this)[e](t)},configurable:!0,enumerable:!0}};Dc&&(Ce(Y,"href",we("serialize","setHref")),Ce(Y,"origin",we("getOrigin")),Ce(Y,"protocol",we("getProtocol","setProtocol")),Ce(Y,"username",we("getUsername","setUsername")),Ce(Y,"password",we("getPassword","setPassword")),Ce(Y,"host",we("getHost","setHost")),Ce(Y,"hostname",we("getHostname","setHostname")),Ce(Y,"port",we("getPort","setPort")),Ce(Y,"pathname",we("getPathname","setPathname")),Ce(Y,"search",we("getSearch","setSearch")),Ce(Y,"searchParams",we("getSearchParams")),Ce(Y,"hash",we("getHash","setHash")));fd(Y,"toJSON",function(){return gd(this).serialize()},{enumerable:!0});fd(Y,"toString",function(){return gd(this).serialize()},{enumerable:!0});Qn&&(Fc=Qn.createObjectURL,Mc=Qn.revokeObjectURL,Fc&&fd(Zr,"createObjectURL",Mv(Fc,Qn)),Mc&&fd(Zr,"revokeObjectURL",Mv(Mc,Qn)));var Fc,Mc;_T(Zr,"URL");MT({global:!0,constructor:!0,forced:!LT,sham:!Dc},{URL:Zr})});var Yv=h(()=>{Zv()});var Qv=h(()=>{"use strict";var l0=Wn(),u0=qe();l0({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return u0(URL.prototype.toString,this)}})});var ey=h(()=>{Sc()});var ry=h((RL,ty)=>{var c0=le();ty.exports=c0});var ny=h((OL,iy)=>{Yv();Qv();ey();var m0=ry();iy.exports=m0.URL});var fm=h((t_,mb)=>{var wE=Object.prototype.toString;mb.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return RE(e)?"generatorfunction":"function";if(xE(e))return"array";if(ME(e))return"buffer";if(FE(e))return"arguments";if(TE(e))return"date";if(AE(e))return"error";if(EE(e))return"regexp";switch(cb(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(OE(e))return"generator";switch(t=wE.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function cb(r){return typeof r.constructor=="function"?r.constructor.name:null}function xE(r){return Array.isArray?Array.isArray(r):r instanceof Array}function AE(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function TE(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function EE(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function RE(r,e){return cb(r)==="GeneratorFunction"}function OE(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function FE(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function ME(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var gb=h((r_,fb)=>{"use strict";var pb=Symbol.prototype.valueOf,LE=fm();function UE(r,e){switch(LE(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return NE(r);case"symbol":return qE(r);case"arraybuffer":return DE(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return _E(r);case"regexp":return BE(r);case"error":return Object.create(r);default:return r}}function BE(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function DE(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function _E(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function NE(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function qE(r){return pb?Object(pb.call(r)):{}}fb.exports=UE});var vb=h((i_,hb)=>{"use strict";hb.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var kb=h((n_,bb)=>{"use strict";var jE=vb();function yb(r){return jE(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}bb.exports=function(e){var t,i;return!(yb(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,yb(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Pb=h((s_,Sb)=>{"use strict";var HE=gb(),WE=fm(),GE=kb();function gm(r,e){switch(WE(r)){case"object":return VE(r,e);case"array":return zE(r,e);default:return HE(r)}}function VE(r,e){if(typeof e=="function")return e(r);if(e||GE(r)){let t=new r.constructor;for(let i in r)t[i]=gm(r[i],e);return t}return r}function zE(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=gm(r[i],e);return t}Sb.exports=gm});var Am=h((ys,Si)=>{var JE=200,xm="__lodash_hash_undefined__",Kd=1,Lb=2,Ub=9007199254740991,Hd="[object Arguments]",bm="[object Array]",$E="[object AsyncFunction]",Bb="[object Boolean]",Db="[object Date]",_b="[object Error]",Nb="[object Function]",KE="[object GeneratorFunction]",Wd="[object Map]",qb="[object Number]",XE="[object Null]",ki="[object Object]",Cb="[object Promise]",ZE="[object Proxy]",jb="[object RegExp]",Gd="[object Set]",Hb="[object String]",YE="[object Symbol]",QE="[object Undefined]",km="[object WeakMap]",Wb="[object ArrayBuffer]",Vd="[object DataView]",eR="[object Float32Array]",tR="[object Float64Array]",rR="[object Int8Array]",iR="[object Int16Array]",nR="[object Int32Array]",sR="[object Uint8Array]",oR="[object Uint8ClampedArray]",aR="[object Uint16Array]",dR="[object Uint32Array]",lR=/[\\^$.*+?()[\]{}|]/g,uR=/^\[object .+?Constructor\]$/,cR=/^(?:0|[1-9]\d*)$/,q={};q[eR]=q[tR]=q[rR]=q[iR]=q[nR]=q[sR]=q[oR]=q[aR]=q[dR]=!0;q[Hd]=q[bm]=q[Wb]=q[Bb]=q[Vd]=q[Db]=q[_b]=q[Nb]=q[Wd]=q[qb]=q[ki]=q[jb]=q[Gd]=q[Hb]=q[km]=!1;var Gb=typeof global=="object"&&global&&global.Object===Object&&global,mR=typeof self=="object"&&self&&self.Object===Object&&self,lt=Gb||mR||Function("return this")(),Vb=typeof ys=="object"&&ys&&!ys.nodeType&&ys,Ib=Vb&&typeof Si=="object"&&Si&&!Si.nodeType&&Si,zb=Ib&&Ib.exports===Vb,hm=zb&&Gb.process,wb=function(){try{return hm&&hm.binding&&hm.binding("util")}catch{}}(),xb=wb&&wb.isTypedArray;function pR(r,e){for(var t=-1,i=r==null?0:r.length,s=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[s++]=a)}return o}function fR(r,e){for(var t=-1,i=e.length,s=r.length;++t<i;)r[s+t]=e[t];return r}function gR(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function hR(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function vR(r){return function(e){return r(e)}}function yR(r,e){return r.has(e)}function bR(r,e){return r?.[e]}function kR(r){var e=-1,t=Array(r.size);return r.forEach(function(i,s){t[++e]=[s,i]}),t}function SR(r,e){return function(t){return r(e(t))}}function PR(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var CR=Array.prototype,IR=Function.prototype,Xd=Object.prototype,vm=lt["__core-js_shared__"],Jb=IR.toString,Ye=Xd.hasOwnProperty,Ab=function(){var r=/[^.]+$/.exec(vm&&vm.keys&&vm.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),$b=Xd.toString,wR=RegExp("^"+Jb.call(Ye).replace(lR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tb=zb?lt.Buffer:void 0,zd=lt.Symbol,Eb=lt.Uint8Array,Kb=Xd.propertyIsEnumerable,xR=CR.splice,fr=zd?zd.toStringTag:void 0,Rb=Object.getOwnPropertySymbols,AR=Tb?Tb.isBuffer:void 0,TR=SR(Object.keys,Object),Sm=Pi(lt,"DataView"),bs=Pi(lt,"Map"),Pm=Pi(lt,"Promise"),Cm=Pi(lt,"Set"),Im=Pi(lt,"WeakMap"),ks=Pi(Object,"create"),ER=vr(Sm),RR=vr(bs),OR=vr(Pm),FR=vr(Cm),MR=vr(Im),Ob=zd?zd.prototype:void 0,ym=Ob?Ob.valueOf:void 0;function gr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function LR(){this.__data__=ks?ks(null):{},this.size=0}function UR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function BR(r){var e=this.__data__;if(ks){var t=e[r];return t===xm?void 0:t}return Ye.call(e,r)?e[r]:void 0}function DR(r){var e=this.__data__;return ks?e[r]!==void 0:Ye.call(e,r)}function _R(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=ks&&e===void 0?xm:e,this}gr.prototype.clear=LR;gr.prototype.delete=UR;gr.prototype.get=BR;gr.prototype.has=DR;gr.prototype.set=_R;function ut(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function NR(){this.__data__=[],this.size=0}function qR(r){var e=this.__data__,t=Zd(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():xR.call(e,t,1),--this.size,!0}function jR(r){var e=this.__data__,t=Zd(e,r);return t<0?void 0:e[t][1]}function HR(r){return Zd(this.__data__,r)>-1}function WR(r,e){var t=this.__data__,i=Zd(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ut.prototype.clear=NR;ut.prototype.delete=qR;ut.prototype.get=jR;ut.prototype.has=HR;ut.prototype.set=WR;function hr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function GR(){this.size=0,this.__data__={hash:new gr,map:new(bs||ut),string:new gr}}function VR(r){var e=Yd(this,r).delete(r);return this.size-=e?1:0,e}function zR(r){return Yd(this,r).get(r)}function JR(r){return Yd(this,r).has(r)}function $R(r,e){var t=Yd(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}hr.prototype.clear=GR;hr.prototype.delete=VR;hr.prototype.get=zR;hr.prototype.has=JR;hr.prototype.set=$R;function Jd(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new hr;++e<t;)this.add(r[e])}function KR(r){return this.__data__.set(r,xm),this}function XR(r){return this.__data__.has(r)}Jd.prototype.add=Jd.prototype.push=KR;Jd.prototype.has=XR;function Rt(r){var e=this.__data__=new ut(r);this.size=e.size}function ZR(){this.__data__=new ut,this.size=0}function YR(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function QR(r){return this.__data__.get(r)}function eO(r){return this.__data__.has(r)}function tO(r,e){var t=this.__data__;if(t instanceof ut){var i=t.__data__;if(!bs||i.length<JE-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new hr(i)}return t.set(r,e),this.size=t.size,this}Rt.prototype.clear=ZR;Rt.prototype.delete=YR;Rt.prototype.get=QR;Rt.prototype.has=eO;Rt.prototype.set=tO;function rO(r,e){var t=$d(r),i=!t&&vO(r),s=!t&&!i&&wm(r),o=!t&&!i&&!s&&rk(r),a=t||i||s||o,c=a?hR(r.length,String):[],p=c.length;for(var f in r)(e||Ye.call(r,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||mO(f,p)))&&c.push(f);return c}function Zd(r,e){for(var t=r.length;t--;)if(Yb(r[t][0],e))return t;return-1}function iO(r,e,t){var i=e(r);return $d(r)?i:fR(i,t(r))}function Ps(r){return r==null?r===void 0?QE:XE:fr&&fr in Object(r)?uO(r):hO(r)}function Fb(r){return Ss(r)&&Ps(r)==Hd}function Xb(r,e,t,i,s){return r===e?!0:r==null||e==null||!Ss(r)&&!Ss(e)?r!==r&&e!==e:nO(r,e,t,i,Xb,s)}function nO(r,e,t,i,s,o){var a=$d(r),c=$d(e),p=a?bm:Et(r),f=c?bm:Et(e);p=p==Hd?ki:p,f=f==Hd?ki:f;var v=p==ki,m=f==ki,b=p==f;if(b&&wm(r)){if(!wm(e))return!1;a=!0,v=!1}if(b&&!v)return o||(o=new Rt),a||rk(r)?Zb(r,e,t,i,s,o):dO(r,e,p,t,i,s,o);if(!(t&Kd)){var y=v&&Ye.call(r,"__wrapped__"),C=m&&Ye.call(e,"__wrapped__");if(y||C){var w=y?r.value():r,A=C?e.value():e;return o||(o=new Rt),s(w,A,t,i,o)}}return b?(o||(o=new Rt),lO(r,e,t,i,s,o)):!1}function sO(r){if(!tk(r)||fO(r))return!1;var e=Qb(r)?wR:uR;return e.test(vr(r))}function oO(r){return Ss(r)&&ek(r.length)&&!!q[Ps(r)]}function aO(r){if(!gO(r))return TR(r);var e=[];for(var t in Object(r))Ye.call(r,t)&&t!="constructor"&&e.push(t);return e}function Zb(r,e,t,i,s,o){var a=t&Kd,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var v=-1,m=!0,b=t&Lb?new Jd:void 0;for(o.set(r,e),o.set(e,r);++v<c;){var y=r[v],C=e[v];if(i)var w=a?i(C,y,v,e,r,o):i(y,C,v,r,e,o);if(w!==void 0){if(w)continue;m=!1;break}if(b){if(!gR(e,function(A,F){if(!yR(b,F)&&(y===A||s(y,A,t,i,o)))return b.push(F)})){m=!1;break}}else if(!(y===C||s(y,C,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function dO(r,e,t,i,s,o,a){switch(t){case Vd:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Wb:return!(r.byteLength!=e.byteLength||!o(new Eb(r),new Eb(e)));case Bb:case Db:case qb:return Yb(+r,+e);case _b:return r.name==e.name&&r.message==e.message;case jb:case Hb:return r==e+"";case Wd:var c=kR;case Gd:var p=i&Kd;if(c||(c=PR),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=Lb,a.set(r,e);var v=Zb(c(r),c(e),i,s,o,a);return a.delete(r),v;case YE:if(ym)return ym.call(r)==ym.call(e)}return!1}function lO(r,e,t,i,s,o){var a=t&Kd,c=Mb(r),p=c.length,f=Mb(e),v=f.length;if(p!=v&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:Ye.call(e,b)))return!1}var y=o.get(r);if(y&&o.get(e))return y==e;var C=!0;o.set(r,e),o.set(e,r);for(var w=a;++m<p;){b=c[m];var A=r[b],F=e[b];if(i)var de=a?i(F,A,b,e,r,o):i(A,F,b,r,e,o);if(!(de===void 0?A===F||s(A,F,t,i,o):de)){C=!1;break}w||(w=b=="constructor")}if(C&&!w){var Un=r.constructor,Ta=e.constructor;Un!=Ta&&"constructor"in r&&"constructor"in e&&!(typeof Un=="function"&&Un instanceof Un&&typeof Ta=="function"&&Ta instanceof Ta)&&(C=!1)}return o.delete(r),o.delete(e),C}function Mb(r){return iO(r,kO,cO)}function Yd(r,e){var t=r.__data__;return pO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Pi(r,e){var t=bR(r,e);return sO(t)?t:void 0}function uO(r){var e=Ye.call(r,fr),t=r[fr];try{r[fr]=void 0;var i=!0}catch{}var s=$b.call(r);return i&&(e?r[fr]=t:delete r[fr]),s}var cO=Rb?function(r){return r==null?[]:(r=Object(r),pR(Rb(r),function(e){return Kb.call(r,e)}))}:SO,Et=Ps;(Sm&&Et(new Sm(new ArrayBuffer(1)))!=Vd||bs&&Et(new bs)!=Wd||Pm&&Et(Pm.resolve())!=Cb||Cm&&Et(new Cm)!=Gd||Im&&Et(new Im)!=km)&&(Et=function(r){var e=Ps(r),t=e==ki?r.constructor:void 0,i=t?vr(t):"";if(i)switch(i){case ER:return Vd;case RR:return Wd;case OR:return Cb;case FR:return Gd;case MR:return km}return e});function mO(r,e){return e=e??Ub,!!e&&(typeof r=="number"||cR.test(r))&&r>-1&&r%1==0&&r<e}function pO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function fO(r){return!!Ab&&Ab in r}function gO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xd;return r===t}function hO(r){return $b.call(r)}function vr(r){if(r!=null){try{return Jb.call(r)}catch{}try{return r+""}catch{}}return""}function Yb(r,e){return r===e||r!==r&&e!==e}var vO=Fb(function(){return arguments}())?Fb:function(r){return Ss(r)&&Ye.call(r,"callee")&&!Kb.call(r,"callee")},$d=Array.isArray;function yO(r){return r!=null&&ek(r.length)&&!Qb(r)}var wm=AR||PO;function bO(r,e){return Xb(r,e)}function Qb(r){if(!tk(r))return!1;var e=Ps(r);return e==Nb||e==KE||e==$E||e==ZE}function ek(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ub}function tk(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function Ss(r){return r!=null&&typeof r=="object"}var rk=xb?vR(xb):oO;function kO(r){return yO(r)?rO(r):aO(r)}function SO(){return[]}function PO(){return!1}Si.exports=bO});var DS=h(Pl=>{"use strict";Pl.byteLength=$O;Pl.toByteArray=XO;Pl.fromByteArray=QO;var et=[],Be=[],JO=typeof Uint8Array<"u"?Uint8Array:Array,tp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rr=0,US=tp.length;Rr<US;++Rr)et[Rr]=tp[Rr],Be[tp.charCodeAt(Rr)]=Rr;var Rr,US;Be["-".charCodeAt(0)]=62;Be["_".charCodeAt(0)]=63;function BS(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function $O(r){var e=BS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function KO(r,e,t){return(e+t)*3/4-t}function XO(r){var e,t=BS(r),i=t[0],s=t[1],o=new JO(KO(r,i,s)),a=0,c=s>0?i-4:i,p;for(p=0;p<c;p+=4)e=Be[r.charCodeAt(p)]<<18|Be[r.charCodeAt(p+1)]<<12|Be[r.charCodeAt(p+2)]<<6|Be[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return s===2&&(e=Be[r.charCodeAt(p)]<<2|Be[r.charCodeAt(p+1)]>>4,o[a++]=e&255),s===1&&(e=Be[r.charCodeAt(p)]<<10|Be[r.charCodeAt(p+1)]<<4|Be[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ZO(r){return et[r>>18&63]+et[r>>12&63]+et[r>>6&63]+et[r&63]}function YO(r,e,t){for(var i,s=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),s.push(ZO(i));return s.join("")}function QO(r){for(var e,t=r.length,i=t%3,s=[],o=16383,a=0,c=t-i;a<c;a+=o)s.push(YO(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],s.push(et[e>>2]+et[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],s.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"=")),s.join("")}});var hH=Bn(ny(),1);function g(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function sr(r,e){if(!r)throw Error(e)}var Q;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(Q||(Q={}));function St(r){return r.startsWith(Q.COMMENT)}function yd(r){return r.startsWith(Q.ACCOUNT)}function or(r){return r.startsWith(Q.LINK)}function sy(r){return r.startsWith(Q.MESSAGE)}function oy(r){return r.startsWith(Q.SUBREDDIT)}function ay(r){return r.startsWith(Q.AWARD)}function p0(r){sr(St(r),`Expected comment id to start with ${Q.COMMENT}, got ${r}}`)}function f0(r){sr(yd(r),`Expected account id to start with ${Q.ACCOUNT}, got ${r}}`)}function g0(r){sr(or(r),`Expected link id to start with ${Q.LINK}, got ${r}}`)}function h0(r){sr(sy(r),`Expected message id to start with ${Q.MESSAGE}, got ${r}}`)}function v0(r){sr(oy(r),`Expected subreddit id to start with ${Q.SUBREDDIT}, got ${r}}`)}function y0(r){sr(ay(r),`Expected award id to start with ${Q.AWARD}, got ${r}}`)}function Yr(r){return p0(r),r}function ee(r){return f0(r),r}function me(r){return g0(r),r}function b0(r){return h0(r),r}function Te(r){return v0(r),r}function k0(r){return y0(r),r}function pe(r){if(St(r))return Yr(r);if(yd(r))return ee(r);if(or(r))return me(r);if(sy(r))return b0(r);if(oy(r))return Te(r);if(ay(r))return k0(r);throw new Error(`Expected thing id to start with ${Object.values(Q).join(", ")} got ${r}}`)}function jc(r){return St(r)}import*as P from"@devvit/protos";var bd=class{constructor(e){}};var Hc=(t=>(t.Installation="installation",t.App="app",t))(Hc||{});function ar(r,e=new Set){for(let t of r){if(t.type==="group"){ar(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}S0(r)}function S0(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var Pt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var jL=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","brand-awareness","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as D0,GetFieldsResponse as _0}from"@devvit/protos";import{FormField as dr,FormFieldType as Ee}from"@devvit/protos";function ot(r){return r.map(e=>{switch(e.type){case"string":return P0(e);case"image":return C0(e);case"paragraph":return I0(e);case"number":return w0(e);case"select":return x0(e);case"boolean":return A0(e);case"group":return T0(e);default:throw new Error("Unknown field type.")}})}function P0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Ee.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret})}function C0(r){return dr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Ee.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function I0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Ee.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required})}function w0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Ee.NUMBER,helpText:r.helpText,label:r.label,required:r.required})}function x0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.SELECTION,selectionValue:{values:r.defaultValue}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Ee.SELECTION,helpText:r.helpText,label:r.label,required:r.required})}function A0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Ee.BOOLEAN,helpText:r.helpText,label:r.label})}function T0(r){return dr.fromPartial({fieldType:Ee.GROUP,fieldConfig:{groupConfig:{fields:ot(r.fields)}},label:r.label,helpText:r.helpText})}function L(r,e){u.prototype[r]=e}import{ValidateFormResponse as B0}from"@devvit/protos";import{RealtimeSubscriptionStatus as ly}from"@devvit/protos";var B=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",TraceID:"devvit-trace-id",User:"devvit-user",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies",WebviewTemplate:"devvit-webview-template"}),dy;(function(r){r.Blocks="blocks",r.EmitSnapshots="emitSnapshots",r.EmitState="emitState",r.Realtime="realtime",r.Runtime="runtime",r.Surface="surface",r.UseAsync="useAsync",r.Payments="payments"})(dy||(dy={}));function uy(r){function e(t){let s=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[B.App]?.values[0];g(c,"useChannel - app is missing from Context");let p=r.metadata[B.Installation]?.values[0];g(p,"useChannel - installation is missing from Context");async function f(A){let F=o[s].channel;if(o[s].active)if(o[s].connected)await r.realtime.send(F,A);else throw Error(`Failed to send to channel '${F}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${F}`)}function v(){if(!o[s].active){let A=o[s].channel;o[s].active=!0,r.addRealtimeChannel(A)}}function m(){if(o[s].active){let A=o[s].channel;o[s].active=!1,r.removeRealtimeChannel(A)}}function b(A){return async()=>{let F;switch(A.status){case ly.REALTIME_SUBSCRIBED:o[s].connected=!0,F=t.onSubscribed?.();break;case ly.REALTIME_UNSUBSCRIBED:o[s].connected=!1,F=t.onUnsubscribed?.();break;default:F=t.onMessage(A.event?.data??{});break}await F}}let y={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:Pt.CHANNEL};s in o?y=o[s]:s in a&&(y=a[s]);let C=r.realtimeEvent;r.isInitialRender?y.active=!1:C&&y.active&&C.event.channel===y.channel&&(y.preventCallback||r.runHook(b(C)),r.rerenderIn(0)),o[s]=y,r.currentHookIndex++;let w=0;return y.active&&y.connected?w=2:y.active&&!y.connected?w=1:!y.active&&y.connected?w=3:!y.active&&!y.connected&&(w=4),{subscribe:v,unsubscribe:m,send:f,status:w}}return e}import{FormFieldType as Qr}from"@devvit/protos";function Wc(r){switch(r.fieldType){case Qr.STRING:return r.stringValue;case Qr.IMAGE:return r.stringValue;case Qr.PARAGRAPH:return r.stringValue;case Qr.NUMBER:return r.numberValue;case Qr.BOOLEAN:return r.boolValue;case Qr.SELECTION:return r.selectionValue?.values??[];default:return}}function Ct(r){return Object.keys(r).reduce((e,t)=>{let i=Wc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function cy(r){function e(t,i){let s=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${s}`,f={formKey:p,preventSubmit:!1,type:Pt.FORM};s in a?f=a[s]:s in c&&(f=c[s]),a[s]=f,r.forms.set(p,t);let v=r.formSubmittedEvent;return v&&!f.preventSubmit&&v.formId===p&&r.runHook(async()=>{let m=i(Ct(v.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[s].preventSubmit=!1,r.currentHookIndex++,p}return e}function my(r){function e(t,i){let s=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:Pt.INTERVAL};s in o?f=o[s]:s in a&&(f=a[s]);function v(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,y]of Object.entries(o))if(b!==s.toString()&&y?.type===Pt.INTERVAL&&y?.running)throw new Error("Only one useInterval hook may be running at a time");o[s]={running:!0,lastRun:o[s]?.lastRun??Date.now(),preventCallback:!1,type:Pt.INTERVAL},r.rerenderIn(p)}function m(){o[s].running=!1,o[s].lastRun=void 0,o[s].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[s]=f,r.currentHookIndex++,{start:v,stop:m}}return e}function py(r){function e(t){let i=r.currentHookIndex,s=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in s)return r.currentHookIndex++,[s[i],a];if(r.isInitialRender||!(i in o)){let c=t instanceof Function?t():t;if(c instanceof Promise)throw(async()=>{s[i]=await c,r.currentHookIndex=0})();s[i]=c}else s[i]=o[i];function a(c){if(r.isRendering)throw new Error("Cannot call setState while rendering.");s[i]=c instanceof Function?c(s[i]):c}return r.currentHookIndex++,[s[i],a]}return e}var Jc={now(){return new Date}};function fy(r){return`__autocache__${r}`}function gy(r){return`__lock__${r}`}var R0=300,O0=1e3,kd=5e3,Gc=3,hy=.1,vy=1e3,F0=3e4;function yy(r){if(r.error)throw new Error(r.error);return r.value}var It,wt,Re,ei,Pd,by,Cd,ky,Id,Sy,ns,Vc,wd,Py,xd,Cy,ss,zc,Ad,Iy,Sd=class{constructor(e,t,i=Jc){d(this,Pd);d(this,Cd);d(this,Id);d(this,ns);d(this,wd);d(this,xd);d(this,ss);d(this,Ad);d(this,It,void 0);d(this,wt,{});d(this,Re,void 0);d(this,ei,void 0);l(this,It,e),l(this,ei,t),l(this,Re,i)}async cache(e,t){l(this,wt,n(this,ei).__cache=n(this,ei).__cache??{}),S(this,Ad,Iy).call(this,t);let i=S(this,Pd,by).call(this,t.key);if(i!==void 0)return i;let s=await S(this,ss,zc).call(this,t.key),o=await S(this,Cd,ky).call(this,t,s,e);return yy(o)}};It=new WeakMap,wt=new WeakMap,Re=new WeakMap,ei=new WeakMap,Pd=new WeakSet,by=function(e){let t=n(this,wt)[e];if(t){let i=n(this,Re).now().getTime(),s=t?.error&&t?.errorTime&&t.errorCount<Gc&&Math.random()<hy&&t.errorTime+vy<i;if(t?.expires&&t.expires<i&&t.checkedAt+vy<i||s){delete n(this,wt)[e];return}else return yy(t)}},Cd=new WeakSet,ky=async function(e,t,i){let s=t?.expires,o=s?S(this,xd,Cy).call(this,s):1;return!t||t?.error&&t.errorCount<Gc&&hy>Math.random()||o>Math.random()?S(this,Id,Sy).call(this,e,t,i):t},Id=new WeakSet,Sy=async function(e,t,i){let s=gy(e.key),o=n(this,Re).now().getTime(),a=new Date(o+e.ttl/2);if(await n(this,It).set(s,"1",{expiration:a,nx:!0}))return S(this,wd,Py).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=n(this,Re).now();return S(this,ns,Vc).call(this,p,e.key,e.ttl)}},ns=new WeakSet,Vc=async function(e,t,i){let s=Math.min(i,O0),o=await S(this,ss,zc).call(this,t);if(o)return o;if(n(this,Re).now().getTime()-e.getTime()>=s)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,R0)),S(this,ns,Vc).call(this,e,t,i)},wd=new WeakSet,Py=async function(e,t,i,s){let o=n(this,Re).now().getTime()+s;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=n(this,Re).now().getTime(),t.errorCount++}return n(this,wt)[e]=t,await n(this,It).set(fy(e),JSON.stringify(t),{expiration:new Date(o+F0)}),t.error&&t.errorCount<Gc&&await n(this,It).del(gy(e)),t},xd=new WeakSet,Cy=function(e){let t=n(this,Re).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},ss=new WeakSet,zc=async function(e){let t=await n(this,It).get(fy(e));if(t){let i=JSON.parse(t);return i.checkedAt=n(this,Re).now().getTime(),n(this,wt)[e]=i,i}},Ad=new WeakSet,Iy=function(e){e.ttl<kd&&(console.warn(`Cache TTL cannot be less than ${kd} milliseconds! Updating ttl value of ${e.ttl} to ${kd}.`),e.ttl=kd)};function wy(r,e,t=Jc){let i=new Sd(r,e,t);return i.cache.bind(i)}var ti,ri,Td,xy,Ed,Ay,ii=class{constructor(){d(this,Td);d(this,Ed);d(this,ti,{});d(this,ri,{});l(this,ti,u.assets),l(this,ri,u.webviewAssets)}getURL(e,t){return typeof e=="string"?S(this,Td,xy).call(this,e,t??{webview:!1}):S(this,Ed,Ay).call(this,e,t??{webview:!1})}};ti=new WeakMap,ri=new WeakMap,Td=new WeakSet,xy=function(e,t){let i=t.webview?n(this,ri)[e]:n(this,ti)[e];if(i)return i;try{return new URL(e.slice(0,e.indexOf(","))),e}catch{return""}},Ed=new WeakSet,Ay=function(e,t){let i={},s=[],o=t.webview?n(this,ri):n(this,ti);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{new URL(a.slice(0,a.indexOf(","))),i[a]=a}catch{s.push(a)}else s=e;if(s.length>0)throw new Error(`The following assets were missing from the assets list: ${s.join(", ")}`);return i};var xt,ni=class{constructor(e){d(this,xt,void 0);l(this,xt,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},n(this,xt));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await u.kvStorePlugin.Put({messages:i},n(this,xt))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},n(this,xt))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},n(this,xt));return e}};xt=new WeakMap;var os,si=class{constructor(e){d(this,os,void 0);l(this,os,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,n(this,os));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};os=new WeakMap;var as,oi=class{constructor(e){d(this,as,void 0);l(this,as,e)}async add(e){await u.modLogPlugin.Add(e,n(this,as))}};as=new WeakMap;var ds,ai=class{constructor(e){d(this,ds,void 0);l(this,ds,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:t},n(this,ds))}};ds=new WeakMap;var k,ls,li=class{constructor(e){d(this,k,void 0);d(this,ls,void 0);l(this,k,e),l(this,ls,new Od(e))}get modMail(){return n(this,ls)}getSubredditById(e){return fe.getById(pe(e),n(this,k))}getSubredditByName(e){return fe.getByName(e,n(this,k))}addSubredditRemovalReason(e,t){return fe.addRemovalReason(e,t.title,t.message,n(this,k))}getSubredditRemovalReasons(e){return fe.getRemovalReasons(e,n(this,k))}getCurrentSubreddit(){return fe.getFromMetadata(n(this,k))}getPostById(e){return G.getById(pe(e),n(this,k))}submitPost(e){return G.submit(e,n(this,k))}crosspost(e){return G.crosspost(e,n(this,k))}getUserById(e){return I.getById(pe(e),n(this,k))}getCollectionById(e){return di.getCollectionById({collectionId:e},n(this,k))}createCollection(e){return di.create(e,n(this,k))}getCollectionsForSubreddit(e){return di.getCollectionsForSubreddit({subredditId:e},n(this,k))}getUserByUsername(e){return I.getByUsername(e,n(this,k))}getCurrentUser(){return I.getFromMetadata(B.User,n(this,k))}getAppUser(){return I.getFromMetadata(B.AppUser,n(this,k))}getSnoovatarUrl(e){return I.getSnoovatarUrl(e,n(this,k))}getCommentById(e){return $.getById(pe(e),n(this,k))}getComments(e){return $.getComments(e,n(this,k))}getCommentsByUser(e){return $.getCommentsByUser(e,n(this,k))}submitComment(e){return $.submit({...e,id:pe(e.id)},n(this,k))}getControversialPosts(e){return G.getControversialPosts(e,n(this,k))}getTopPosts(e){return G.getTopPosts(e,n(this,k))}getHotPosts(e){return G.getHotPosts(e,n(this,k))}getNewPosts(e){return G.getNewPosts(e,n(this,k))}getRisingPosts(e){return G.getRisingPosts(e,n(this,k))}getPostsByUser(e){return G.getPostsByUser(e,n(this,k))}getCommentsAndPostsByUser(e){return I.getOverview(e,n(this,k))}getModerationLog(e){return Rd(e,n(this,k))}getApprovedUsers(e){return I.getSubredditUsersByType({type:"contributors",...e},n(this,k))}approveUser(e,t){return I.createRelationship({username:e,subredditName:t,type:"contributor"},n(this,k))}removeUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"contributor"},n(this,k))}getWikiContributors(e){return I.getSubredditUsersByType({type:"wikicontributors",...e},n(this,k))}addWikiContributor(e,t){return I.createRelationship({username:e,subredditName:t,type:"wikicontributor"},n(this,k))}removeWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},n(this,k))}getBannedUsers(e){return I.getSubredditUsersByType({type:"banned",...e},n(this,k))}banUser(e){return I.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},n(this,k))}unbanUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"banned"},n(this,k))}getBannedWikiContributors(e){return I.getSubredditUsersByType({type:"wikibanned",...e},n(this,k))}banWikiContributor(e){return I.createRelationship({...e,type:"wikibanned"},n(this,k))}unbanWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikibanned"},n(this,k))}getModerators(e){return I.getSubredditUsersByType({type:"moderators",...e},n(this,k))}inviteModerator(e){return I.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},n(this,k))}revokeModeratorInvite(e,t){return I.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},n(this,k))}removeModerator(e,t){return I.removeRelationship({type:"moderator",subredditName:t,username:e},n(this,k))}setModeratorPermissions(e,t,i){return I.setModeratorPermissions(e,t,i,n(this,k))}getMutedUsers(e){return I.getSubredditUsersByType({type:"muted",...e},n(this,k))}muteUser(e){return I.createRelationship({...e,type:"muted"},n(this,k))}unmuteUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"muted"},n(this,k))}getModNotes(e){return Oe.get(e,n(this,k))}deleteModNote(e){return Oe.delete(e,n(this,k))}addModNote(e){let t={...e,redditId:pe(e.redditId)};return Oe.add(t,n(this,k))}addRemovalNote(e){return Oe.addRemovalNote(e,n(this,k))}async sendPrivateMessage(e){return lr.send(e,n(this,k))}async sendPrivateMessageAsSubreddit(e){return lr.sendAsSubreddit(e,n(this,k))}async approve(e){if(St(e))return $.approve(e,n(this,k));if(or(e))return G.approve(e,n(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(St(e))return $.remove(e,t,n(this,k));if(or(e))return G.remove(e,t,n(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return se.getPostFlairTemplates(e,n(this,k))}async getUserFlairTemplates(e){return se.getUserFlairTemplates(e,n(this,k))}async createPostFlairTemplate(e){return se.createPostFlairTemplate(e,n(this,k))}async createUserFlairTemplate(e){return se.createUserFlairTemplate(e,n(this,k))}async editFlairTemplate(e){return se.editFlairTemplate(e,n(this,k))}async deleteFlairTemplate(e,t){return se.deleteFlairTemplate(e,t,n(this,k))}async setUserFlair(e){return Fe.setUserFlair(e,n(this,k))}async removeUserFlair(e,t){return Fe.removeUserFlair(e,t,n(this,k))}async setPostFlair(e){return Fe.setPostFlair(e,n(this,k))}async removePostFlair(e,t){return Fe.removePostFlair(e,me(t),n(this,k))}async getWidgets(e){return te.getWidgets(e,n(this,k))}async deleteWidget(e,t){return te.delete(e,t,n(this,k))}async addWidget(e){return te.add(e,n(this,k))}async reorderWidgets(e,t){return te.reorder(e,t,n(this,k))}async getWikiPage(e,t){return ge.getPage(e,t,n(this,k))}async getWikiPages(e){return ge.getPages(e,n(this,k))}async createWikiPage(e){return ge.createPage(e,n(this,k))}async updateWikiPage(e){return ge.updatePage(e,n(this,k))}getWikiPageRevisions(e){return ge.getPageRevisions(e,n(this,k))}async revertWikiPage(e,t,i){return ge.revertPage(e,t,i,n(this,k))}async getWikiPageSettings(e,t){return ge.getPageSettings(e,t,n(this,k))}async updateWikiPageSettings(e){return ge.updatePageSettings(e,n(this,k))}async addEditorToWikiPage(e,t,i){return ge.addEditor(e,t,i,n(this,k))}async removeEditorFromWikiPage(e,t,i){return ge.removeEditor(e,t,i,n(this,k))}getMessages(e){return lr.getMessages(e,n(this,k))}markAllMessagesAsRead(){return lr.markAllAsRead(n(this,k))}report(e,t){return u.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},n(this,k))}getModQueue(e){return fe.aboutLocation({...e,location:"modqueue"},n(this,k))}getReports(e){return fe.aboutLocation({...e,location:"reports"},n(this,k))}getSpam(e){return fe.aboutLocation({...e,location:"spam"},n(this,k))}getUnmoderated(e){return fe.aboutLocation({...e,location:"unmoderated"},n(this,k))}getEdited(e){return fe.aboutLocation({...e,location:"edited"},n(this,k))}getVaultByAddress(e){return Ry(e,n(this,k))}getVaultByUserId(e){return Oy(pe(e),n(this,k))}getSubredditLeaderboard(e){return Ey(e,n(this,k))}};k=new WeakMap,ls=new WeakMap;import{RedisKeyScope as $c}from"@devvit/protos";var E,R,O,Kc=class{constructor(e,t,i){d(this,E,void 0);d(this,R,void 0);d(this,O,void 0);l(this,E,e),l(this,R,t),l(this,O,i)}async get(e){return await n(this,E).Get({key:e,transactionId:n(this,R)},n(this,O)),this}async multi(){await n(this,E).Multi(n(this,R),n(this,O))}async set(e,t,i){let s;return i?.expiration&&(s=Math.floor((i.expiration.getTime()-Date.now())/1e3),s<1&&(s=1)),await n(this,E).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:s||0,transactionId:n(this,R)},n(this,O)),this}async del(...e){return await n(this,E).Del({keys:e,transactionId:n(this,R)},n(this,O)),this}async type(e){return await n(this,E).Type({key:e,transactionId:n(this,R)},n(this,O)),this}async exec(){let e=await n(this,E).Exec(n(this,R),n(this,O)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await n(this,E).Discard(n(this,R),n(this,O))}async watch(...e){return await n(this,E).Watch({keys:e,transactionId:n(this,R)},n(this,O)),this}async unwatch(){return await n(this,E).Unwatch(n(this,R),n(this,O)),this}async getRange(e,t,i){return await n(this,E).GetRange({key:e,start:t,end:i,transactionId:n(this,R)},n(this,O)),this}async setRange(e,t,i){return await n(this,E).SetRange({key:e,offset:t,value:i,transactionId:n(this,R)},n(this,O)),this}async strlen(e){return await n(this,E).Strlen({key:e,transactionId:n(this,R)},n(this,O)),this}async mget(e){return await n(this,E).MGet({keys:e,transactionId:n(this,R)},n(this,O)),this}async mset(e){let t=Object.entries(e).map(([i,s])=>({key:i,value:s}));return await n(this,E).MSet({kv:t,transactionId:n(this,R)},n(this,O)),this}async incrBy(e,t){return await n(this,E).IncrBy({key:e,value:t,transactionId:n(this,R)},n(this,O)),this}async expire(e,t){return await n(this,E).Expire({key:e,seconds:t,transactionId:n(this,R)},n(this,O)),this}async expireTime(e){return await n(this,E).ExpireTime({key:e,transactionId:n(this,R)},n(this,O)),this}async zAdd(e,...t){return await n(this,E).ZAdd({key:e,members:t,transactionId:n(this,R)},n(this,O)),this}async zScore(e,t){return await n(this,E).ZScore({key:{key:e,transactionId:n(this,R)},member:t},n(this,O)),this}async zRank(e,t){return await n(this,E).ZRank({key:{key:e,transactionId:n(this,R)},member:t},n(this,O)),this}async zIncrBy(e,t,i){return await n(this,E).ZIncrBy({key:e,member:t,value:i,transactionId:n(this,R)},n(this,O)),this}async zScan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,transactionId:n(this,R)};return await n(this,E).ZScan(o,n(this,O)),this}async zCard(e){return await n(this,E).ZCard({key:e,transactionId:n(this,R)},n(this,O)),this}async zRange(e,t,i,s){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return s?.reverse&&(o.rev=s.reverse),s?.by==="lex"?o.byLex=!0:s?.by==="score"&&(o.byScore=!0),await n(this,E).ZRange({key:{key:e,transactionId:n(this,R)},start:t+"",stop:i+"",...o},n(this,O)),this}async zRem(e,t){return await n(this,E).ZRem({key:{key:e,transactionId:n(this,R)},members:t},n(this,O)),this}async zRemRangeByLex(e,t,i){return await n(this,E).ZRemRangeByLex({key:{key:e,transactionId:n(this,R)},min:t,max:i},n(this,O)),this}async zRemRangeByRank(e,t,i){return await n(this,E).ZRemRangeByRank({key:{key:e,transactionId:n(this,R)},start:t,stop:i},n(this,O)),this}async zRemRangeByScore(e,t,i){return await n(this,E).ZRemRangeByScore({key:{key:e,transactionId:n(this,R)},min:t,max:i},n(this,O)),this}async hgetall(e){return await n(this,E).HGetAll({key:e,transactionId:n(this,R)},n(this,O)),this}async hget(e,t){return await n(this,E).HGet({key:e,field:t,transactionId:n(this,R)},n(this,O)),this}async hset(e,t){let i=Object.entries(t).map(([s,o])=>({field:s,value:o}));return await n(this,E).HSet({key:e,fv:i,transactionId:n(this,R)},n(this,O)),this}async hincrby(e,t,i){return await n(this,E).HIncrBy({key:e,field:t,value:i,transactionId:n(this,R)},n(this,O)),this}async hdel(e,t){return await n(this,E).HDel({key:e,fields:t,transactionId:n(this,R)},n(this,O)),this}async hscan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,transactionId:n(this,R)};return await n(this,E).HScan(o,n(this,O)),this}async hkeys(e){return await n(this,E).HKeys({key:e,transactionId:n(this,R)},n(this,O)),this}async hlen(e){return await n(this,E).HLen({key:e,transactionId:n(this,R)},n(this,O)),this}};E=new WeakMap,R=new WeakMap,O=new WeakMap;var M,ui,Xc=class Xc{constructor(e,t=void 0,i=$c.INSTALLATION){d(this,M,void 0);d(this,ui,void 0);l(this,M,e),l(this,ui,t),this.scope=i,this.global=i===$c.INSTALLATION?new Xc(n(this,M),n(this,ui),$c.GLOBAL):this}get storage(){return n(this,ui)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},n(this,M));return new Kc(this.storage,t,n(this,M))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},n(this,M));return t!==null?t.value??void 0:t}async set(e,t,i){let s;return i?.expiration&&(s=Math.floor((i.expiration.getTime()-Date.now())/1e3),s<1&&(s=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:s||0,scope:this.scope},n(this,M))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},n(this,M))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},n(this,M))).value}async getRange(e,t,i){let s=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},n(this,M));return s!==null?s.value:s}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},n(this,M))).value}async strlen(e){return(await this.storage.Strlen({key:e,scope:this.scope},n(this,M))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},n(this,M))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},n(this,M))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},n(this,M))).value}async zRange(e,t,i,s){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return s?.reverse&&(o.rev=s.reverse),s?.by==="lex"?o.byLex=!0:s?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},n(this,M))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},n(this,M))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},n(this,M))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},n(this,M))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},n(this,M))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},n(this,M));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},n(this,M));return i!==null?i.value:i}async zIncrBy(e,t,i){let s=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},n(this,M));return s!==null?s.value:s}async mget(e){let t=await this.storage.MGet({keys:e,scope:this.scope},n(this,M));return t!==null?t.values.map(i=>i||null):t}async mset(e){let t=Object.entries(e).map(([i,s])=>({key:i,value:s}));await this.storage.MSet({kv:t,scope:this.scope},n(this,M))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},n(this,M));return t!==null?t.value:t}async zScan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,scope:this.scope};return await this.storage.ZScan(o,n(this,M))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},n(this,M));return t!==null?t.value:t}async hget(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},n(this,M));return i!==null?i.value??void 0:i}async hset(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},n(this,M))).value}async hgetall(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},n(this,M));return t!==null?t.fieldValues:t}async hdel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},n(this,M))).value}async hscan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,scope:this.scope};return await this.storage.HScan(o,n(this,M))}async hkeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},n(this,M));return t!==null?t.keys:t}async hincrby(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},n(this,M))).value}async hlen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};M=new WeakMap,ui=new WeakMap;var ci=Xc;var ur,mi=class{constructor(e){d(this,ur,void 0);l(this,ur,e)}async runJob(e){return(await u.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},n(this,ur))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},n(this,ur))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},n(this,ur))).actions.map(t=>(g(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};ur=new WeakMap;var us,pi=class{constructor(e){d(this,us,void 0);l(this,us,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},n(this,us));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...Fy(t.installationSettings.settings,u.installationSettings),...Fy(t.appSettings.settings,u.appSettings)}}};us=new WeakMap;function Fy(r,e){let t=Object.keys(r).reduce((i,s)=>(i[s]=Wc(r[s]),i),{});return e&&My(t,e),t}function My(r,e){for(let t of e)t.type==="group"?My(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as Zc,Form as M0,ToastAppearance as Ly}from"@devvit/protos";var cr,fi,Fd=class{constructor(e){d(this,cr,[]);d(this,fi,void 0);l(this,fi,e)}showForm(e,t){let i=u.formDefinitions.get(e);if(!i&&n(this,fi)){let a=n(this,fi).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let s=i.form instanceof Function?i.form(t??{}):i.form,o=M0.fromPartial({id:e,title:s.title,acceptLabel:s.acceptLabel,cancelLabel:s.cancelLabel,shortDescription:s.description});ar(s.fields),o.fields=ot(s.fields),n(this,cr).push({type:Zc.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?Ly.SUCCESS:Ly.NEUTRAL}:t={text:e},n(this,cr).push({type:Zc.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),n(this,cr).push({type:Zc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return n(this,cr)}};cr=new WeakMap,fi=new WeakMap;function Me({metadata:r,ui:e,hooks:t,reconciler:i}){let s=new oi(r),o=new ni(r),a=new ci(r),c=wy(a,i?i.state:{}),p=new li(r),f=new mi(r),v=new pi(r),m=e?new Fd(i):void 0,b=new si(r),y=new ii,C=new ai(r),w=t&&i?py(i):void 0,A=t&&i?my(i):void 0,F=t&&i?cy(i):void 0,de=t&&i?uy(i):void 0;return{modLog:s,kvStore:o,redis:a,reddit:p,scheduler:f,settings:v,media:b,assets:y,realtime:C,get useForm(){return F??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return w??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return A??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return de??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!m)throw new Error("ui client is not available");return m}}}var Uy={name:"@devvit/public-api",version:"0.11.0-dev",license:"BSD-3-Clause",repository:{type:"git",url:"https://developers.reddit.com/"},type:"module",exports:{".":"./dist/index.js","./package.json":"./package.json","./*":"./dist/*"},main:"./dist/index.js",files:["dist/**"],scripts:{build:"yarn build:icon-types && yarn build:semantic-colors && tsc && cp -af devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin","build:icon-types":"make-icons src/types/icons.ts","build:min":"esbuild --bundle --sourcemap=linked --target=es2020 --format=esm --metafile=dist/meta.min.json --outfile=dist/public-api.min.js --external:@devvit/protos --minify src/index.ts","build:semantic-colors":"node scripts/make-semantic-colors.js","build:types":"api-extractor run && sed -ne '/declare global {/,$ p' src/devvit/Devvit.ts >> dist/public-api.d.ts","build:unmin":"esbuild --bundle --sourcemap=inline --target=es2020 --format=iife --metafile=dist/meta.json --outfile=dist/public-api.iife.js --global-name=devvitPublicAPI src/index.ts",clean:"rm -rf .turbo api-extractor coverage dist src/devvit/internals/semanticColors.ts src/types/icons.ts || :",clobber:"yarn clean && rm -rf node_modules",dev:"tsc -w","dev:build":"chokidar ./src --command 'yarn build' --ignore './src/types/icons.ts' --ignore './src/devvit/internals/semanticColors.ts'",lint:"redlint .","lint:fix":"yarn lint --fix",prepublishOnly:"publish-package-json",test:"yarn test:unit && yarn test:types && yarn test:size","test:size":"filesize","test:types":"tsc --noEmit","test:unit":"vitest run","test:unit-with-coverage":"vitest run --coverage"},types:"./dist/index.d.ts",dependencies:{"@devvit/protos":"0.11.0-dev","@devvit/shared-types":"0.11.0-dev","base64-js":"1.5.1","clone-deep":"4.0.1","core-js":"3.27.2","lodash.isequal":"4.5.0"},devDependencies:{"@ampproject/filesize":"4.3.0","@devvit/eslint-config":"0.11.0-dev","@devvit/repo-tools":"0.11.0-dev","@devvit/tsconfig":"0.11.0-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"11.3.3","@types/clone-deep":"4.0.1","@types/core-js":"2.5.6","@types/lodash.isequal":"4.5.6","@vitest/coverage-c8":"0.32.0","chokidar-cli":"3.0.0",esbuild:"0.18.12",eslint:"8.9.0",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"255 KB"}},source:"./src/index.ts"};function oe(r,e,t){let i=r[B.Subreddit]?.values[0];g(i,"subreddit is missing from Context");let s=r[B.AppUser]?.values[0],o=r[B.User]?.values[0],a=U0(r);return{get appAccountId(){return g(s,"appAccountId is missing from Context"),s},subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:s,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}function U0(r){let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0},t={};for(let s in e)t[s.toLowerCase()]=s;let i={};for(let s of(r[B.Debug]?.values??[]).join().split(",")){let[o,a]=s.split("=");o&&(o=o.trim(),a=a?.trim(),o.toLowerCase()in t&&(o=t[o.toLowerCase()]),i[o]??(i[o]=a||`${!0}`))}return r[B.Debug]&&console.info(`[api] @devvit/public-api v${Uy.version} ${Object.entries(i).map(([s,o])=>`${s}=${o}`).join(" ")}`),{...i,metadata:r}}async function Md(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=B0.fromPartial({success:!0,errors:{}}),s=Ct(r.fieldValues),o=e.flatMap(a=>a.type==="group"?a.fields:a);return await Promise.all(o.map(async a=>{let c=a.name;if(c&&a.type!=="group"&&a.onValidate){let p=s[c],f=a.onValidate,v=Object.assign(Me({metadata:t}),oe(t)),m=await f({value:p,isEditing:r.editing},v);m&&(i.success=!1,i.errors[c]=m)}})),i}async function N0(){if(!u.appSettings)throw new Error("App settings were not defined.");return _0.fromPartial({fields:{fields:ot(u.appSettings)}})}async function q0(r,e){return Md(r,u.appSettings,e)}function By(r){r.provides(D0),L("GetAppSettingsFields",N0),L("ValidateAppForm",q0)}import{CustomPostDefinition as J0}from"@devvit/protos";import{BlockRenderEventType as cm,EffectType as tb}from"@devvit/protos";function gi(r){return r.__effects}function Dy(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as um,BlockAnimationDirection as $y,BlockAnimationLoopMode as Ky,BlockAnimationType as Xy,BlockAvatarBackground as Zy,BlockAvatarFacing as Yy,BlockAvatarSize as At,BlockBorderWidth as Bd,BlockButtonAppearance as Tt,BlockButtonSize as rm,BlockFullSnooSize as vi,BlockGap as Dd,BlockHorizontalAlignment as im,BlockIconSize as _d,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as nm,BlockSpacerSize as Nd,BlockStackDirection as sm,BlockTextOutline as om,BlockTextOverflow as am,BlockTextSize as yi,BlockTextStyle as dm,BlockTextWeight as Qy,BlockType as Le,BlockVerticalAlignment as lm}from"@devvit/protos";var Yc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var _y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ny=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),qy=r=>r in Yc,Qc=r=>r in _y,jy=r=>!!r.match(/^rgba?\(.*/),Hy=r=>!!r.match(/^hsla?\(.*/),Wy=(r,e="light")=>{if(Qc(r))return Ld(r);let i=Yc[r];return typeof i=="string"?i:i[e]},Ld=r=>_y[r]??r,Gy=r=>{let[e,t,i,s]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(s){let p=parseFloat(s),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as Ud}from"@devvit/protos";var em={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:Ud.UNRECOGNIZED,alignment:void 0}};function zy(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:s}=j0(r?.grow,e.direction,e.alignment),o=t?.height?.value?.value||t?.height?.min?.value||Vy(2,i,s,e.hasHeight),a=t?.width?.value?.value||t?.width?.min?.value||Vy(1,i,s,e.hasWidth);return{hasHeight:!!o,hasWidth:!!a}}function Vy(r,e,t,i){return e===r&&i||t===r&&i}function j0(r,e,t){let i=e===Ud.STACK_VERTICAL||e===Ud.UNRECOGNIZED,s=e===Ud.STACK_HORIZONTAL,o=0;s&&r?o=1:i&&r&&(o=2);let a=t===void 0||t.horizontal===void 0,c=t===void 0||t.vertical===void 0,p=s?!!c:i?!!a:!1,f=0;return s&&p?f=2:i&&p&&(f=1),{growDirection:o,stretchDirection:f}}import{BlockSizeUnit as mr,BlockStackDirection as Jy}from"@devvit/protos";function hi(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:mr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=mr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=mr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function H0(r,e){return(r.width?.value?.unit===mr.SIZE_UNIT_PERCENT||r.width?.min?.unit===mr.SIZE_UNIT_PERCENT)&&e.direction===Jy.STACK_HORIZONTAL&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===mr.SIZE_UNIT_PERCENT||r.height?.min?.unit===mr.SIZE_UNIT_PERCENT)&&e.direction===Jy.STACK_VERTICAL&&(e.hasHeight||(r.height=void 0)),r}function tm(r,e){if(r){let t=r.width!=null||r.minWidth!=null||r.maxWidth!=null,i=r.height!=null||r.minHeight!=null||r.maxHeight!=null;if(t||i||r.grow!=null){let s={width:t?{value:hi(r.width),min:hi(r.minWidth),max:hi(r.maxWidth)}:void 0,height:i?{value:hi(r.height),min:hi(r.minHeight),max:hi(r.maxHeight)}:void 0,grow:r.grow};return e.stackParentLayout&&(s=H0(s,e.stackParentLayout)),s}}}var eb="data-",W0=new Set(["onPress","onMessage"]),G0=new Map([["onPress",um.ACTION_CLICK],["onMessage",um.ACTION_WEBVIEW]]),fs,bi=class{constructor(e=()=>{}){d(this,fs,void 0);l(this,fs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let s=this.createBlocksElement({type:e,props:t,children:i},em);if(!s)throw new Error(`Could not create block of type ${e}`);return s}createBlocksElement({type:e,props:t,children:i},s){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,s,...i);case"vstack":return this.makeVStack(t,s,...i);case"zstack":return this.makeZStack(t,s,...i);case"text":return this.makeText(t,s,...i);case"button":return this.makeButton(t,s,...i);case"image":return this.makeImage(t,s);case"spacer":return this.makeSpacer(t,s);case"icon":return this.makeIcon(t,s);case"avatar":return this.makeAvatar(t,s);case"fullsnoo":return this.makeFullSnoo(t,s);case"animation":return this.makeAnimation(t,s);case"webview":return this.makeWebView(t,s);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ms.PADDING_NONE;case"xsmall":return ms.PADDING_XSMALL;case"small":return ms.PADDING_SMALL;case"medium":return ms.PADDING_MEDIUM;case"large":return ms.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ps.RADIUS_NONE;case"small":return ps.RADIUS_SMALL;case"medium":return ps.RADIUS_MEDIUM;case"large":return ps.RADIUS_LARGE;case"full":return ps.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return Dd.GAP_NONE;case"small":return Dd.GAP_SMALL;case"medium":return Dd.GAP_MEDIUM;case"large":return Dd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=lm.ALIGN_TOP:e.includes("middle")?t=lm.ALIGN_MIDDLE:e.includes("bottom")&&(t=lm.ALIGN_BOTTOM),e.includes("start")?i=im.ALIGN_START:e.includes("center")?i=im.ALIGN_CENTER:e.includes("end")&&(i=im.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,s){if(!e&&!t)return;let o;switch(e){case"none":o=Bd.BORDER_WIDTH_NONE;break;case"thin":o=Bd.BORDER_WIDTH_THIN;break;case"thick":o=Bd.BORDER_WIDTH_THICK;break;default:o=Bd.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",c=this.getThemedColors(a,i,s);return{width:o,color:c?.light,colors:c}}makeBlockTextSize(e){switch(e){case"xsmall":return yi.TEXT_SIZE_XSMALL;case"small":return yi.TEXT_SIZE_SMALL;case"medium":return yi.TEXT_SIZE_MEDIUM;case"large":return yi.TEXT_SIZE_LARGE;case"xlarge":return yi.TEXT_SIZE_XLARGE;case"xxlarge":return yi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return dm.TEXT_STYLE_BODY;case"metadata":return dm.TEXT_STYLE_METADATA;case"heading":return dm.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return om.TEXT_OUTLINE_NONE;case"thin":return om.TEXT_OUTLINE_THIN;case"thick":return om.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Qy.TEXT_WEIGHT_REGULAR;case"bold":return Qy.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return am.TEXT_OVERFLOW_CLIP;case"ellipsis":return am.TEXT_OVERFLOW_ELLIPSE}return am.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Tt.BUTTON_APPEARANCE_SECONDARY;case"primary":return Tt.BUTTON_APPEARANCE_PRIMARY;case"plain":return Tt.BUTTON_APPEARANCE_PLAIN;case"bordered":return Tt.BUTTON_APPEARANCE_BORDERED;case"media":return Tt.BUTTON_APPEARANCE_MEDIA;case"destructive":return Tt.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Tt.BUTTON_APPEARANCE_CAUTION;case"success":return Tt.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return rm.BUTTON_SIZE_SMALL;case"medium":return rm.BUTTON_SIZE_MEDIUM;case"large":return rm.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return cs.IMAGE_RESIZE_NONE;case"fit":return cs.IMAGE_RESIZE_FIT;case"fill":return cs.IMAGE_RESIZE_FILL;case"cover":return cs.IMAGE_RESIZE_COVER;case"scale-down":return cs.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return Nd.SPACER_XSMALL;case"small":return Nd.SPACER_SMALL;case"medium":return Nd.SPACER_MEDIUM;case"large":return Nd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return nm.SPACER_INVISIBLE;case"thin":return nm.SPACER_THIN;case"square":return nm.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return _d.ICON_SIZE_XSMALL;case"small":return _d.ICON_SIZE_SMALL;case"medium":return _d.ICON_SIZE_MEDIUM;case"large":return _d.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return At.AVATAR_SIZE_XXSMALL;case"xsmall":return At.AVATAR_SIZE_XSMALL;case"small":return At.AVATAR_SIZE_SMALL;case"medium":return At.AVATAR_SIZE_MEDIUM;case"large":return At.AVATAR_SIZE_LARGE;case"xlarge":return At.AVATAR_SIZE_XXLARGE;case"xxlarge":return At.AVATAR_SIZE_XXLARGE;case"xxxlarge":return At.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Yy.AVATAR_FACING_LEFT;case"right":return Yy.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return vi.FULLSNOO_XSMALL;case"small":return vi.FULLSNOO_SMALL;case"medium":return vi.FULLSNOO_MEDIUM;case"large":return vi.FULLSNOO_LARGE;case"xlarge":return vi.FULLSNOO_XLARGE;case"xxlarge":return vi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return Zy.AVATAR_BG_DARK;case"light":return Zy.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?Xy.ANIM_LOTTIE:Xy.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return $y.ANIM_DIR_BACKWARD;case"forward":return $y.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Ky.ANIM_LOOP_REPEAT;case"bounce":return Ky.ANIM_LOOP_BOUNCE}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(eb)).reduce((t,i)=>(t[i.substring(eb.length)]=e[i],t),{})}makeActions(e,t){let i=[],s=this.getDataSet(t);return W0.forEach(o=>{if(o in t){let a=t[o];i.push({type:G0.get(o)??um.UNRECOGNIZED,id:a.toString(),data:s})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),Ny(e)?e:qy(e)?Wy(e,t):Qc(e)?Ld(e):jy(e)?Gy(e):Hy(e)?e:(console.warn(`Could not parse color: ${e}.`),Ld("red"))}childrenToBlocks(e,t){return e.flatMap(i=>(typeof i!="string"?this.createBlocksElement(i,t):void 0)??[])}getThemedColors(e,t,i){let s=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!s||!o)){let c=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...c.map(p=>p[0]))}return s||(s=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),s||o?{light:s,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}resolveAssetUrl(e,t){return n(this,fs).call(this)?.getURL(e,t)??e}childrenToString(e){return e.map(t=>t.toString()).join("")}makeRoot(e,...t){return this.wrapRoot(e,this.childrenToBlocks(t,em))}wrapRoot(e,t){return this.makeBlock(Le.BLOCK_ROOT,{},{},{rootConfig:{children:t,height:this.makeRootHeight(u.customPostType?.height??e?.height??"regular")}})}makeStackBlock(e,t,i,s){let o=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor),a=this.makeBlockAlignment(t?.alignment),c=tm(t,i),p=zy(t,i.stackParentLayout,c);return this.makeBlock(Le.BLOCK_STACK,t,i,{stackConfig:{alignment:a,backgroundColor:o?.light,backgroundColors:o,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:this.childrenToBlocks(s,{stackParentLayout:{...p,direction:e,alignment:a}}),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}makeHStack(e,t,...i){return this.makeStackBlock(sm.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(sm.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(sm.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let s=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(Le.BLOCK_TEXT,e,t,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:s?.light,colors:s,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(i),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,t,...i){let s=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(Le.BLOCK_BUTTON,e,t,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(i),textColor:s?.light,textColors:s,disabled:e?.disabled}})}makeImage(e,t){return e&&this.makeBlock(Le.BLOCK_IMAGE,e,t,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:this.resolveAssetUrl(e.url),width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e,t){return this.makeBlock(Le.BLOCK_SPACER,e,t,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e,t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(Le.BLOCK_ICON,e,t,{iconConfig:{icon:e.name,color:i?.light,colors:i,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e,t){return e&&this.makeBlock(Le.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e,t){return e&&this.makeBlock(Le.BLOCK_FULLSNOO,e,t,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}makeAnimation(e,t){return e&&this.makeBlock(Le.BLOCK_ANIMATION,e,t,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:this.resolveAssetUrl(e.url),loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e,t){return e&&this.makeBlock(Le.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webview:!0}),state:e.state}})}makeBlock(e,t,i,s){return{type:e,sizes:tm(t,i),config:s,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t=e;if(t.type===Le.BLOCK_ROOT)return t.config?.rootConfig&&u.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t;let i=this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};fs=new WeakMap;function rb(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var ib=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=ib(i);return e+=`</${r.type}>`,e};function V0(r){return" ".repeat(r)}function z0(r){let e="",t=0,i=r.split(/>\s*</);for(let s=0;s<i.length;s++){let o=i[s];s===0&&(o=o.trim()),s===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=V0(t),s!==0&&(e+="<"),e+=o,s!==i.length-1&&(e+=`>
1
+ var zS=Object.create;var ap=Object.defineProperty;var JS=Object.getOwnPropertyDescriptor;var $S=Object.getOwnPropertyNames;var KS=Object.getPrototypeOf,XS=Object.prototype.hasOwnProperty;var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var ZS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $S(e))!XS.call(r,s)&&s!==t&&ap(r,s,{get:()=>e[s],enumerable:!(i=JS(e,s))||i.enumerable});return r};var Bn=(r,e,t)=>(t=r!=null?zS(KS(r)):{},ZS(e||!r||!r.__esModule?ap(t,"default",{value:r,enumerable:!0}):t,r));var Wl=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var n=(r,e,t)=>(Wl(r,e,"read from private field"),t?t.call(r):e.get(r)),d=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},l=(r,e,t,i)=>(Wl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);var S=(r,e,t)=>(Wl(r,e,"access private method"),t);var ne=h((PF,dp)=>{dp.exports=function(r){try{return!!r()}catch{return!0}}});var Ea=h((CF,lp)=>{var YS=ne();lp.exports=!YS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var z=h((IF,mp)=>{var up=Ea(),cp=Function.prototype,Gl=cp.call,QS=up&&cp.bind.bind(Gl,Gl);mp.exports=up?QS:function(r){return function(){return Gl.apply(r,arguments)}}});var fp=h((wF,pp)=>{var eP=Math.ceil,tP=Math.floor;pp.exports=Math.trunc||function(e){var t=+e;return(t>0?tP:eP)(t)}});var Ra=h((xF,gp)=>{var rP=fp();gp.exports=function(r){var e=+r;return e!==e||e===0?0:rP(e)}});var le=h((AF,hp)=>{var Oa=function(r){return r&&r.Math==Math&&r};hp.exports=Oa(typeof globalThis=="object"&&globalThis)||Oa(typeof window=="object"&&window)||Oa(typeof self=="object"&&self)||Oa(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var _r=h((TF,vp)=>{vp.exports=!1});var Fa=h((EF,bp)=>{var yp=le(),iP=Object.defineProperty;bp.exports=function(r,e){try{iP(yp,r,{value:e,configurable:!0,writable:!0})}catch{yp[r]=e}return e}});var Ma=h((RF,Sp)=>{var nP=le(),sP=Fa(),kp="__core-js_shared__",oP=nP[kp]||sP(kp,{});Sp.exports=oP});var Vl=h((OF,Cp)=>{var aP=_r(),Pp=Ma();(Cp.exports=function(r,e){return Pp[r]||(Pp[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:aP?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var La=h((FF,Ip)=>{Ip.exports=function(r){return r==null}});var Ua=h((MF,wp)=>{var dP=La(),lP=TypeError;wp.exports=function(r){if(dP(r))throw lP("Can't call method on "+r);return r}});var Dn=h((LF,xp)=>{var uP=Ua(),cP=Object;xp.exports=function(r){return cP(uP(r))}});var Se=h((UF,Ap)=>{var mP=z(),pP=Dn(),fP=mP({}.hasOwnProperty);Ap.exports=Object.hasOwn||function(e,t){return fP(pP(e),t)}});var zl=h((BF,Tp)=>{var gP=z(),hP=0,vP=Math.random(),yP=gP(1 .toString);Tp.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+yP(++hP+vP,36)}});var Rp=h((DF,Ep)=>{Ep.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var Dp=h((_F,Bp)=>{var Up=le(),Jl=Rp(),Op=Up.process,Fp=Up.Deno,Mp=Op&&Op.versions||Fp&&Fp.version,Lp=Mp&&Mp.v8,Ne,Ba;Lp&&(Ne=Lp.split("."),Ba=Ne[0]>0&&Ne[0]<4?1:+(Ne[0]+Ne[1]));!Ba&&Jl&&(Ne=Jl.match(/Edge\/(\d+)/),(!Ne||Ne[1]>=74)&&(Ne=Jl.match(/Chrome\/(\d+)/),Ne&&(Ba=+Ne[1])));Bp.exports=Ba});var $l=h((NF,Np)=>{var _p=Dp(),bP=ne();Np.exports=!!Object.getOwnPropertySymbols&&!bP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&_p&&_p<41})});var Kl=h((qF,qp)=>{var kP=$l();qp.exports=kP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Pe=h((jF,Hp)=>{var SP=le(),PP=Vl(),jp=Se(),CP=zl(),IP=$l(),wP=Kl(),Nr=SP.Symbol,Xl=PP("wks"),xP=wP?Nr.for||Nr:Nr&&Nr.withoutSetter||CP;Hp.exports=function(r){return jp(Xl,r)||(Xl[r]=IP&&jp(Nr,r)?Nr[r]:xP("Symbol."+r)),Xl[r]}});var Vp=h((HF,Gp)=>{var AP=Pe(),TP=AP("toStringTag"),Wp={};Wp[TP]="z";Gp.exports=String(Wp)==="[object z]"});var Yl=h((WF,zp)=>{var Zl=typeof document=="object"&&document.all,EP=typeof Zl>"u"&&Zl!==void 0;zp.exports={all:Zl,IS_HTMLDDA:EP}});var J=h((GF,$p)=>{var Jp=Yl(),RP=Jp.all;$p.exports=Jp.IS_HTMLDDA?function(r){return typeof r=="function"||r===RP}:function(r){return typeof r=="function"}});var Da=h((VF,Xp)=>{var Kp=z(),OP=Kp({}.toString),FP=Kp("".slice);Xp.exports=function(r){return FP(OP(r),8,-1)}});var _n=h((zF,Zp)=>{var MP=Vp(),LP=J(),_a=Da(),UP=Pe(),BP=UP("toStringTag"),DP=Object,_P=_a(function(){return arguments}())=="Arguments",NP=function(r,e){try{return r[e]}catch{}};Zp.exports=MP?_a:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=NP(e=DP(r),BP))=="string"?t:_P?_a(e):(i=_a(e))=="Object"&&LP(e.callee)?"Arguments":i}});var Nn=h((JF,Yp)=>{var qP=_n(),jP=String;Yp.exports=function(r){if(qP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return jP(r)}});var eu=h(($F,tf)=>{var Ql=z(),HP=Ra(),WP=Nn(),GP=Ua(),VP=Ql("".charAt),Qp=Ql("".charCodeAt),zP=Ql("".slice),ef=function(r){return function(e,t){var i=WP(GP(e)),s=HP(t),o=i.length,a,c;return s<0||s>=o?r?"":void 0:(a=Qp(i,s),a<55296||a>56319||s+1===o||(c=Qp(i,s+1))<56320||c>57343?r?VP(i,s):a:r?zP(i,s,s+2):(a-55296<<10)+(c-56320)+65536)}};tf.exports={codeAt:ef(!1),charAt:ef(!0)}});var sf=h((KF,nf)=>{var JP=le(),$P=J(),rf=JP.WeakMap;nf.exports=$P(rf)&&/native code/.test(String(rf))});var yt=h((XF,df)=>{var of=J(),af=Yl(),KP=af.all;df.exports=af.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:of(r)||r===KP}:function(r){return typeof r=="object"?r!==null:of(r)}});var ue=h((ZF,lf)=>{var XP=ne();lf.exports=!XP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var ru=h((YF,cf)=>{var ZP=le(),uf=yt(),tu=ZP.document,YP=uf(tu)&&uf(tu.createElement);cf.exports=function(r){return YP?tu.createElement(r):{}}});var iu=h((QF,mf)=>{var QP=ue(),eC=ne(),tC=ru();mf.exports=!QP&&!eC(function(){return Object.defineProperty(tC("div"),"a",{get:function(){return 7}}).a!=7})});var nu=h((eM,pf)=>{var rC=ue(),iC=ne();pf.exports=rC&&iC(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var $e=h((tM,ff)=>{var nC=yt(),sC=String,oC=TypeError;ff.exports=function(r){if(nC(r))return r;throw oC(sC(r)+" is not an object")}});var qe=h((rM,gf)=>{var aC=Ea(),Na=Function.prototype.call;gf.exports=aC?Na.bind(Na):function(){return Na.apply(Na,arguments)}});var qn=h((iM,hf)=>{var su=le(),dC=J(),lC=function(r){return dC(r)?r:void 0};hf.exports=function(r,e){return arguments.length<2?lC(su[r]):su[r]&&su[r][e]}});var ou=h((nM,vf)=>{var uC=z();vf.exports=uC({}.isPrototypeOf)});var au=h((sM,yf)=>{var cC=qn(),mC=J(),pC=ou(),fC=Kl(),gC=Object;yf.exports=fC?function(r){return typeof r=="symbol"}:function(r){var e=cC("Symbol");return mC(e)&&pC(e.prototype,gC(r))}});var du=h((oM,bf)=>{var hC=String;bf.exports=function(r){try{return hC(r)}catch{return"Object"}}});var qa=h((aM,kf)=>{var vC=J(),yC=du(),bC=TypeError;kf.exports=function(r){if(vC(r))return r;throw bC(yC(r)+" is not a function")}});var ja=h((dM,Sf)=>{var kC=qa(),SC=La();Sf.exports=function(r,e){var t=r[e];return SC(t)?void 0:kC(t)}});var Cf=h((lM,Pf)=>{var lu=qe(),uu=J(),cu=yt(),PC=TypeError;Pf.exports=function(r,e){var t,i;if(e==="string"&&uu(t=r.toString)&&!cu(i=lu(t,r))||uu(t=r.valueOf)&&!cu(i=lu(t,r))||e!=="string"&&uu(t=r.toString)&&!cu(i=lu(t,r)))return i;throw PC("Can't convert object to primitive value")}});var Af=h((uM,xf)=>{var CC=qe(),If=yt(),wf=au(),IC=ja(),wC=Cf(),xC=Pe(),AC=TypeError,TC=xC("toPrimitive");xf.exports=function(r,e){if(!If(r)||wf(r))return r;var t=IC(r,TC),i;if(t){if(e===void 0&&(e="default"),i=CC(t,r,e),!If(i)||wf(i))return i;throw AC("Can't convert object to primitive value")}return e===void 0&&(e="number"),wC(r,e)}});var Ha=h((cM,Tf)=>{var EC=Af(),RC=au();Tf.exports=function(r){var e=EC(r,"string");return RC(e)?e:e+""}});var Ke=h(Rf=>{var OC=ue(),FC=iu(),MC=nu(),Wa=$e(),Ef=Ha(),LC=TypeError,mu=Object.defineProperty,UC=Object.getOwnPropertyDescriptor,pu="enumerable",fu="configurable",gu="writable";Rf.f=OC?MC?function(e,t,i){if(Wa(e),t=Ef(t),Wa(i),typeof e=="function"&&t==="prototype"&&"value"in i&&gu in i&&!i[gu]){var s=UC(e,t);s&&s[gu]&&(e[t]=i.value,i={configurable:fu in i?i[fu]:s[fu],enumerable:pu in i?i[pu]:s[pu],writable:!1})}return mu(e,t,i)}:mu:function(e,t,i){if(Wa(e),t=Ef(t),Wa(i),FC)try{return mu(e,t,i)}catch{}if("get"in i||"set"in i)throw LC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var qr=h((pM,Of)=>{Of.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Ga=h((fM,Ff)=>{var BC=ue(),DC=Ke(),_C=qr();Ff.exports=BC?function(r,e,t){return DC.f(r,e,_C(1,t))}:function(r,e,t){return r[e]=t,r}});var Va=h((gM,Lf)=>{var NC=Vl(),qC=zl(),Mf=NC("keys");Lf.exports=function(r){return Mf[r]||(Mf[r]=qC(r))}});var za=h((hM,Uf)=>{Uf.exports={}});var jr=h((vM,_f)=>{var jC=sf(),Df=le(),HC=yt(),WC=Ga(),hu=Se(),vu=Ma(),GC=Va(),VC=za(),Bf="Object already initialized",yu=Df.TypeError,zC=Df.WeakMap,Ja,jn,$a,JC=function(r){return $a(r)?jn(r):Ja(r,{})},$C=function(r){return function(e){var t;if(!HC(e)||(t=jn(e)).type!==r)throw yu("Incompatible receiver, "+r+" required");return t}};jC||vu.state?(je=vu.state||(vu.state=new zC),je.get=je.get,je.has=je.has,je.set=je.set,Ja=function(r,e){if(je.has(r))throw yu(Bf);return e.facade=r,je.set(r,e),e},jn=function(r){return je.get(r)||{}},$a=function(r){return je.has(r)}):(Qt=GC("state"),VC[Qt]=!0,Ja=function(r,e){if(hu(r,Qt))throw yu(Bf);return e.facade=r,WC(r,Qt,e),e},jn=function(r){return hu(r,Qt)?r[Qt]:{}},$a=function(r){return hu(r,Qt)});var je,Qt;_f.exports={set:Ja,get:jn,has:$a,enforce:JC,getterFor:$C}});var bu=h(jf=>{"use strict";var Nf={}.propertyIsEnumerable,qf=Object.getOwnPropertyDescriptor,KC=qf&&!Nf.call({1:2},1);jf.f=KC?function(e){var t=qf(this,e);return!!t&&t.enumerable}:Nf});var Su=h((bM,Hf)=>{var XC=z(),ZC=ne(),YC=Da(),ku=Object,QC=XC("".split);Hf.exports=ZC(function(){return!ku("z").propertyIsEnumerable(0)})?function(r){return YC(r)=="String"?QC(r,""):ku(r)}:ku});var Hr=h((kM,Wf)=>{var eI=Su(),tI=Ua();Wf.exports=function(r){return eI(tI(r))}});var Pu=h(Vf=>{var rI=ue(),iI=qe(),nI=bu(),sI=qr(),oI=Hr(),aI=Ha(),dI=Se(),lI=iu(),Gf=Object.getOwnPropertyDescriptor;Vf.f=rI?Gf:function(e,t){if(e=oI(e),t=aI(t),lI)try{return Gf(e,t)}catch{}if(dI(e,t))return sI(!iI(nI.f,e,t),e[t])}});var wu=h((PM,Jf)=>{var Cu=ue(),uI=Se(),zf=Function.prototype,cI=Cu&&Object.getOwnPropertyDescriptor,Iu=uI(zf,"name"),mI=Iu&&function(){}.name==="something",pI=Iu&&(!Cu||Cu&&cI(zf,"name").configurable);Jf.exports={EXISTS:Iu,PROPER:mI,CONFIGURABLE:pI}});var Au=h((CM,$f)=>{var fI=z(),gI=J(),xu=Ma(),hI=fI(Function.toString);gI(xu.inspectSource)||(xu.inspectSource=function(r){return hI(r)});$f.exports=xu.inspectSource});var Ru=h((IM,Zf)=>{var Eu=z(),vI=ne(),yI=J(),Ka=Se(),Tu=ue(),bI=wu().CONFIGURABLE,kI=Au(),Xf=jr(),SI=Xf.enforce,PI=Xf.get,Kf=String,Xa=Object.defineProperty,CI=Eu("".slice),II=Eu("".replace),wI=Eu([].join),xI=Tu&&!vI(function(){return Xa(function(){},"length",{value:8}).length!==8}),AI=String(String).split("String"),TI=Zf.exports=function(r,e,t){CI(Kf(e),0,7)==="Symbol("&&(e="["+II(Kf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Ka(r,"name")||bI&&r.name!==e)&&(Tu?Xa(r,"name",{value:e,configurable:!0}):r.name=e),xI&&t&&Ka(t,"arity")&&r.length!==t.arity&&Xa(r,"length",{value:t.arity});try{t&&Ka(t,"constructor")&&t.constructor?Tu&&Xa(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=SI(r);return Ka(i,"source")||(i.source=wI(AI,typeof e=="string"?e:"")),r};Function.prototype.toString=TI(function(){return yI(this)&&PI(this).source||kI(this)},"toString")});var er=h((wM,Yf)=>{var EI=J(),RI=Ke(),OI=Ru(),FI=Fa();Yf.exports=function(r,e,t,i){i||(i={});var s=i.enumerable,o=i.name!==void 0?i.name:e;if(EI(t)&&OI(t,o,i),i.global)s?r[e]=t:FI(e,t);else{try{i.unsafe?r[e]&&(s=!0):delete r[e]}catch{}s?r[e]=t:RI.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var Ou=h((xM,Qf)=>{var MI=Ra(),LI=Math.max,UI=Math.min;Qf.exports=function(r,e){var t=MI(r);return t<0?LI(t+e,0):UI(t,e)}});var tg=h((AM,eg)=>{var BI=Ra(),DI=Math.min;eg.exports=function(r){return r>0?DI(BI(r),9007199254740991):0}});var Za=h((TM,rg)=>{var _I=tg();rg.exports=function(r){return _I(r.length)}});var sg=h((EM,ng)=>{var NI=Hr(),qI=Ou(),jI=Za(),ig=function(r){return function(e,t,i){var s=NI(e),o=jI(s),a=qI(i,o),c;if(r&&t!=t){for(;o>a;)if(c=s[a++],c!=c)return!0}else for(;o>a;a++)if((r||a in s)&&s[a]===t)return r||a||0;return!r&&-1}};ng.exports={includes:ig(!0),indexOf:ig(!1)}});var Mu=h((RM,ag)=>{var HI=z(),Fu=Se(),WI=Hr(),GI=sg().indexOf,VI=za(),og=HI([].push);ag.exports=function(r,e){var t=WI(r),i=0,s=[],o;for(o in t)!Fu(VI,o)&&Fu(t,o)&&og(s,o);for(;e.length>i;)Fu(t,o=e[i++])&&(~GI(s,o)||og(s,o));return s}});var Ya=h((OM,dg)=>{dg.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ug=h(lg=>{var zI=Mu(),JI=Ya(),$I=JI.concat("length","prototype");lg.f=Object.getOwnPropertyNames||function(e){return zI(e,$I)}});var Lu=h(cg=>{cg.f=Object.getOwnPropertySymbols});var pg=h((LM,mg)=>{var KI=qn(),XI=z(),ZI=ug(),YI=Lu(),QI=$e(),ew=XI([].concat);mg.exports=KI("Reflect","ownKeys")||function(e){var t=ZI.f(QI(e)),i=YI.f;return i?ew(t,i(e)):t}});var hg=h((UM,gg)=>{var fg=Se(),tw=pg(),rw=Pu(),iw=Ke();gg.exports=function(r,e,t){for(var i=tw(e),s=iw.f,o=rw.f,a=0;a<i.length;a++){var c=i[a];!fg(r,c)&&!(t&&fg(t,c))&&s(r,c,o(e,c))}}});var yg=h((BM,vg)=>{var nw=ne(),sw=J(),ow=/#|\.prototype\./,Hn=function(r,e){var t=dw[aw(r)];return t==uw?!0:t==lw?!1:sw(e)?nw(e):!!e},aw=Hn.normalize=function(r){return String(r).replace(ow,".").toLowerCase()},dw=Hn.data={},lw=Hn.NATIVE="N",uw=Hn.POLYFILL="P";vg.exports=Hn});var Wn=h((DM,bg)=>{var Uu=le(),cw=Pu().f,mw=Ga(),pw=er(),fw=Fa(),gw=hg(),hw=yg();bg.exports=function(r,e){var t=r.target,i=r.global,s=r.stat,o,a,c,p,f,v;if(i?a=Uu:s?a=Uu[t]||fw(t,{}):a=(Uu[t]||{}).prototype,a)for(c in e){if(f=e[c],r.dontCallGetSet?(v=cw(a,c),p=v&&v.value):p=a[c],o=hw(i?c:t+(s?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;gw(f,p)}(r.sham||p&&p.sham)&&mw(f,"sham",!0),pw(a,c,f,r)}}});var Bu=h((_M,kg)=>{var vw=Mu(),yw=Ya();kg.exports=Object.keys||function(e){return vw(e,yw)}});var Pg=h(Sg=>{var bw=ue(),kw=nu(),Sw=Ke(),Pw=$e(),Cw=Hr(),Iw=Bu();Sg.f=bw&&!kw?Object.defineProperties:function(e,t){Pw(e);for(var i=Cw(t),s=Iw(t),o=s.length,a=0,c;o>a;)Sw.f(e,c=s[a++],i[c]);return e}});var Ig=h((qM,Cg)=>{var ww=qn();Cg.exports=ww("document","documentElement")});var Gn=h((jM,Og)=>{var xw=$e(),Aw=Pg(),wg=Ya(),Tw=za(),Ew=Ig(),Rw=ru(),Ow=Va(),xg=">",Ag="<",_u="prototype",Nu="script",Eg=Ow("IE_PROTO"),Du=function(){},Rg=function(r){return Ag+Nu+xg+r+Ag+"/"+Nu+xg},Tg=function(r){r.write(Rg("")),r.close();var e=r.parentWindow.Object;return r=null,e},Fw=function(){var r=Rw("iframe"),e="java"+Nu+":",t;return r.style.display="none",Ew.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Rg("document.F=Object")),t.close(),t.F},Qa,ed=function(){try{Qa=new ActiveXObject("htmlfile")}catch{}ed=typeof document<"u"?document.domain&&Qa?Tg(Qa):Fw():Tg(Qa);for(var r=wg.length;r--;)delete ed[_u][wg[r]];return ed()};Tw[Eg]=!0;Og.exports=Object.create||function(e,t){var i;return e!==null?(Du[_u]=xw(e),i=new Du,Du[_u]=null,i[Eg]=e):i=ed(),t===void 0?i:Aw.f(i,t)}});var Mg=h((HM,Fg)=>{var Mw=ne();Fg.exports=!Mw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var ju=h((WM,Ug)=>{var Lw=Se(),Uw=J(),Bw=Dn(),Dw=Va(),_w=Mg(),Lg=Dw("IE_PROTO"),qu=Object,Nw=qu.prototype;Ug.exports=_w?qu.getPrototypeOf:function(r){var e=Bw(r);if(Lw(e,Lg))return e[Lg];var t=e.constructor;return Uw(t)&&e instanceof t?t.prototype:e instanceof qu?Nw:null}});var Vu=h((GM,_g)=>{"use strict";var qw=ne(),jw=J(),Hw=yt(),Ww=Gn(),Bg=ju(),Gw=er(),Vw=Pe(),zw=_r(),Gu=Vw("iterator"),Dg=!1,it,Hu,Wu;[].keys&&(Wu=[].keys(),"next"in Wu?(Hu=Bg(Bg(Wu)),Hu!==Object.prototype&&(it=Hu)):Dg=!0);var Jw=!Hw(it)||qw(function(){var r={};return it[Gu].call(r)!==r});Jw?it={}:zw&&(it=Ww(it));jw(it[Gu])||Gw(it,Gu,function(){return this});_g.exports={IteratorPrototype:it,BUGGY_SAFARI_ITERATORS:Dg}});var Vn=h((VM,qg)=>{var $w=Ke().f,Kw=Se(),Xw=Pe(),Ng=Xw("toStringTag");qg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Kw(r,Ng)&&$w(r,Ng,{configurable:!0,value:e})}});var Wr=h((zM,jg)=>{jg.exports={}});var zu=h((JM,Hg)=>{"use strict";var Zw=Vu().IteratorPrototype,Yw=Gn(),Qw=qr(),ex=Vn(),tx=Wr(),rx=function(){return this};Hg.exports=function(r,e,t,i){var s=e+" Iterator";return r.prototype=Yw(Zw,{next:Qw(+!i,t)}),ex(r,s,!1,!0),tx[s]=rx,r}});var Gg=h(($M,Wg)=>{var ix=J(),nx=String,sx=TypeError;Wg.exports=function(r){if(typeof r=="object"||ix(r))return r;throw sx("Can't set "+nx(r)+" as a prototype")}});var zg=h((KM,Vg)=>{var ox=z(),ax=$e(),dx=Gg();Vg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=ox(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(s,o){return ax(s),dx(o),r?t(s,o):s.__proto__=o,s}}():void 0)});var $u=h((XM,rh)=>{"use strict";var lx=Wn(),ux=qe(),td=_r(),eh=wu(),cx=J(),mx=zu(),Jg=ju(),$g=zg(),px=Vn(),fx=Ga(),Ju=er(),gx=Pe(),Kg=Wr(),th=Vu(),hx=eh.PROPER,vx=eh.CONFIGURABLE,Xg=th.IteratorPrototype,rd=th.BUGGY_SAFARI_ITERATORS,zn=gx("iterator"),Zg="keys",Jn="values",Yg="entries",Qg=function(){return this};rh.exports=function(r,e,t,i,s,o,a){mx(t,e,i);var c=function(F){if(F===s&&b)return b;if(!rd&&F in v)return v[F];switch(F){case Zg:return function(){return new t(this,F)};case Jn:return function(){return new t(this,F)};case Yg:return function(){return new t(this,F)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,v=r.prototype,m=v[zn]||v["@@iterator"]||s&&v[s],b=!rd&&m||c(s),y=e=="Array"&&v.entries||m,C,w,A;if(y&&(C=Jg(y.call(new r)),C!==Object.prototype&&C.next&&(!td&&Jg(C)!==Xg&&($g?$g(C,Xg):cx(C[zn])||Ju(C,zn,Qg)),px(C,p,!0,!0),td&&(Kg[p]=Qg))),hx&&s==Jn&&m&&m.name!==Jn&&(!td&&vx?fx(v,"name",Jn):(f=!0,b=function(){return ux(m,this)})),s)if(w={values:c(Jn),keys:o?b:c(Zg),entries:c(Yg)},a)for(A in w)(rd||f||!(A in v))&&Ju(v,A,w[A]);else lx({target:e,proto:!0,forced:rd||f},w);return(!td||a)&&v[zn]!==b&&Ju(v,zn,b,{name:s}),Kg[e]=b,w}});var Ku=h((ZM,ih)=>{ih.exports=function(r,e){return{value:r,done:e}}});var ah=h(()=>{"use strict";var yx=eu().charAt,bx=Nn(),sh=jr(),kx=$u(),nh=Ku(),oh="String Iterator",Sx=sh.set,Px=sh.getterFor(oh);kx(String,"String",function(r){Sx(this,{type:oh,string:bx(r),index:0})},function(){var e=Px(this),t=e.string,i=e.index,s;return i>=t.length?nh(void 0,!0):(s=yx(t,i),e.index+=s.length,nh(s,!1))})});var Xu=h((eL,dh)=>{var Cx=ne(),Ix=Pe(),wx=_r(),xx=Ix("iterator");dh.exports=!Cx(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,s){e.delete("b"),t+=s+i}),wx&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[xx]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var uh=h((tL,lh)=>{var Ax=Da(),Tx=z();lh.exports=function(r){if(Ax(r)==="Function")return Tx(r)}});var id=h((rL,mh)=>{var ch=uh(),Ex=qa(),Rx=Ea(),Ox=ch(ch.bind);mh.exports=function(r,e){return Ex(r),e===void 0?r:Rx?Ox(r,e):function(){return r.apply(e,arguments)}}});var gh=h((iL,fh)=>{var ph=Ru(),Fx=Ke();fh.exports=function(r,e,t){return t.get&&ph(t.get,e,{getter:!0}),t.set&&ph(t.set,e,{setter:!0}),Fx.f(r,e,t)}});var Zu=h((nL,hh)=>{var Mx=ou(),Lx=TypeError;hh.exports=function(r,e){if(Mx(e,r))return r;throw Lx("Incorrect invocation")}});var kh=h((sL,bh)=>{"use strict";var vh=ue(),Ux=z(),Bx=qe(),Dx=ne(),Yu=Bu(),_x=Lu(),Nx=bu(),qx=Dn(),jx=Su(),Gr=Object.assign,yh=Object.defineProperty,Hx=Ux([].concat);bh.exports=!Gr||Dx(function(){if(vh&&Gr({b:1},Gr(yh({},"a",{enumerable:!0,get:function(){yh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(s){e[s]=s}),Gr({},r)[t]!=7||Yu(Gr({},e)).join("")!=i})?function(e,t){for(var i=qx(e),s=arguments.length,o=1,a=_x.f,c=Nx.f;s>o;)for(var p=jx(arguments[o++]),f=a?Hx(Yu(p),a(p)):Yu(p),v=f.length,m=0,b;v>m;)b=f[m++],(!vh||Bx(c,p,b))&&(i[b]=p[b]);return i}:Gr});var Ch=h((oL,Ph)=>{var Wx=qe(),Sh=$e(),Gx=ja();Ph.exports=function(r,e,t){var i,s;Sh(r);try{if(i=Gx(r,"return"),!i){if(e==="throw")throw t;return t}i=Wx(i,r)}catch(o){s=!0,i=o}if(e==="throw")throw t;if(s)throw i;return Sh(i),t}});var wh=h((aL,Ih)=>{var Vx=$e(),zx=Ch();Ih.exports=function(r,e,t,i){try{return i?e(Vx(t)[0],t[1]):e(t)}catch(s){zx(r,"throw",s)}}});var Ah=h((dL,xh)=>{var Jx=Pe(),$x=Wr(),Kx=Jx("iterator"),Xx=Array.prototype;xh.exports=function(r){return r!==void 0&&($x.Array===r||Xx[Kx]===r)}});var Mh=h((lL,Fh)=>{var Zx=z(),Yx=ne(),Th=J(),Qx=_n(),eA=qn(),tA=Au(),Eh=function(){},rA=[],Rh=eA("Reflect","construct"),Qu=/^\s*(?:class|function)\b/,iA=Zx(Qu.exec),nA=!Qu.exec(Eh),$n=function(e){if(!Th(e))return!1;try{return Rh(Eh,rA,e),!0}catch{return!1}},Oh=function(e){if(!Th(e))return!1;switch(Qx(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return nA||!!iA(Qu,tA(e))}catch{return!0}};Oh.sham=!0;Fh.exports=!Rh||Yx(function(){var r;return $n($n.call)||!$n(Object)||!$n(function(){r=!0})||r})?Oh:$n});var ec=h((uL,Lh)=>{"use strict";var sA=Ha(),oA=Ke(),aA=qr();Lh.exports=function(r,e,t){var i=sA(e);i in r?oA.f(r,i,aA(0,t)):r[i]=t}});var nd=h((cL,Bh)=>{var dA=_n(),Uh=ja(),lA=La(),uA=Wr(),cA=Pe(),mA=cA("iterator");Bh.exports=function(r){if(!lA(r))return Uh(r,mA)||Uh(r,"@@iterator")||uA[dA(r)]}});var tc=h((mL,Dh)=>{var pA=qe(),fA=qa(),gA=$e(),hA=du(),vA=nd(),yA=TypeError;Dh.exports=function(r,e){var t=arguments.length<2?vA(r):e;if(fA(t))return gA(pA(t,r));throw yA(hA(r)+" is not iterable")}});var jh=h((pL,qh)=>{"use strict";var bA=id(),kA=qe(),SA=Dn(),PA=wh(),CA=Ah(),IA=Mh(),wA=Za(),_h=ec(),xA=tc(),AA=nd(),Nh=Array;qh.exports=function(e){var t=SA(e),i=IA(this),s=arguments.length,o=s>1?arguments[1]:void 0,a=o!==void 0;a&&(o=bA(o,s>2?arguments[2]:void 0));var c=AA(t),p=0,f,v,m,b,y,C;if(c&&!(this===Nh&&CA(c)))for(b=xA(t,c),y=b.next,v=i?new this:[];!(m=kA(y,b)).done;p++)C=a?PA(b,o,[m.value,p],!0):m.value,_h(v,p,C);else for(f=wA(t),v=i?new this(f):Nh(f);f>p;p++)C=a?o(t[p],p):t[p],_h(v,p,C);return v.length=p,v}});var rc=h((fL,Wh)=>{var Hh=Ou(),TA=Za(),EA=ec(),RA=Array,OA=Math.max;Wh.exports=function(r,e,t){for(var i=TA(r),s=Hh(e,i),o=Hh(t===void 0?i:t,i),a=RA(OA(o-s,0)),c=0;s<o;s++,c++)EA(a,c,r[s]);return a.length=c,a}});var Yh=h((gL,Zh)=>{var tr=z(),ic=2147483647,Kn=36,$h=1,oc=26,FA=38,MA=700,LA=72,UA=128,BA="-",DA=/[^\0-\u007E]/,Kh=/[.\u3002\uFF0E\uFF61]/g,Gh="Overflow: input needs wider integers to process",nc=Kn-$h,Vh=RangeError,_A=tr(Kh.exec),Vr=Math.floor,sc=String.fromCharCode,zh=tr("".charCodeAt),Xh=tr([].join),bt=tr([].push),NA=tr("".replace),qA=tr("".split),jA=tr("".toLowerCase),HA=function(r){for(var e=[],t=0,i=r.length;t<i;){var s=zh(r,t++);if(s>=55296&&s<=56319&&t<i){var o=zh(r,t++);(o&64512)==56320?bt(e,((s&1023)<<10)+(o&1023)+65536):(bt(e,s),t--)}else bt(e,s)}return e},Jh=function(r){return r+22+75*(r<26)},WA=function(r,e,t){var i=0;for(r=t?Vr(r/MA):r>>1,r+=Vr(r/e);r>nc*oc>>1;)r=Vr(r/nc),i+=Kn;return Vr(i+(nc+1)*r/(r+FA))},GA=function(r){var e=[];r=HA(r);var t=r.length,i=UA,s=0,o=LA,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&bt(e,sc(c));var p=e.length,f=p;for(p&&bt(e,BA);f<t;){var v=ic;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<v&&(v=c);var m=f+1;if(v-i>Vr((ic-s)/m))throw Vh(Gh);for(s+=(v-i)*m,i=v,a=0;a<r.length;a++){if(c=r[a],c<i&&++s>ic)throw Vh(Gh);if(c==i){for(var b=s,y=Kn;;){var C=y<=o?$h:y>=o+oc?oc:y-o;if(b<C)break;var w=b-C,A=Kn-C;bt(e,sc(Jh(C+w%A))),b=Vr(w/A),y+=Kn}bt(e,sc(Jh(b))),o=WA(s,m,f==p),s=0,f++}}s++,i++}return Xh(e,"")};Zh.exports=function(r){var e=[],t=qA(NA(jA(r),Kh,"."),"."),i,s;for(i=0;i<t.length;i++)s=t[i],bt(e,_A(DA,s)?"xn--"+GA(s):s);return Xh(e,".")}});var ac=h((hL,Qh)=>{var VA=TypeError;Qh.exports=function(r,e){if(r<e)throw VA("Not enough arguments");return r}});var tv=h((vL,ev)=>{var zA=Pe(),JA=Gn(),$A=Ke().f,dc=zA("unscopables"),lc=Array.prototype;lc[dc]==null&&$A(lc,dc,{configurable:!0,value:JA(null)});ev.exports=function(r){lc[dc][r]=!0}});var av=h((yL,ov)=>{"use strict";var KA=Hr(),uc=tv(),rv=Wr(),nv=jr(),XA=Ke().f,ZA=$u(),sd=Ku(),YA=_r(),QA=ue(),sv="Array Iterator",eT=nv.set,tT=nv.getterFor(sv);ov.exports=ZA(Array,"Array",function(r,e){eT(this,{type:sv,target:KA(r),index:0,kind:e})},function(){var r=tT(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,sd(void 0,!0)):t=="keys"?sd(i,!1):t=="values"?sd(e[i],!1):sd([i,e[i]],!1)},"values");var iv=rv.Arguments=rv.Array;uc("keys");uc("values");uc("entries");if(!YA&&QA&&iv.name!=="values")try{XA(iv,"name",{value:"values"})}catch{}});var lv=h((bL,dv)=>{var rT=er();dv.exports=function(r,e,t){for(var i in e)rT(r,i,e[i],t);return r}});var mv=h((kL,cv)=>{var uv=rc(),iT=Math.floor,cc=function(r,e){var t=r.length,i=iT(t/2);return t<8?nT(r,e):sT(r,cc(uv(r,0,i),e),cc(uv(r,i),e),e)},nT=function(r,e){for(var t=r.length,i=1,s,o;i<t;){for(o=i,s=r[i];o&&e(r[o-1],s)>0;)r[o]=r[--o];o!==i++&&(r[o]=s)}return r},sT=function(r,e,t,i){for(var s=e.length,o=t.length,a=0,c=0;a<s||c<o;)r[a+c]=a<s&&c<o?i(e[a],t[c])<=0?e[a++]:t[c++]:a<s?e[a++]:t[c++];return r};cv.exports=cc});var Sc=h((SL,Fv)=>{"use strict";av();var hc=Wn(),Jr=le(),od=qe(),Xe=z(),oT=ue(),Iv=Xu(),wv=er(),aT=lv(),dT=Vn(),lT=zu(),bc=jr(),xv=Zu(),mc=J(),uT=Se(),cT=id(),mT=_n(),pT=$e(),Av=yt(),ce=Nn(),fT=Gn(),pv=qr(),vc=tc(),gT=nd(),zr=ac(),hT=Pe(),vT=mv(),yT=hT("iterator"),Yn="URLSearchParams",Tv=Yn+"Iterator",Ev=bc.set,He=bc.getterFor(Yn),bT=bc.getterFor(Tv),kT=Object.getOwnPropertyDescriptor,kc=function(r){if(!oT)return Jr[r];var e=kT(Jr,r);return e&&e.value},fv=kc("fetch"),dd=kc("Request"),Xn=kc("Headers"),pc=dd&&dd.prototype,gv=Xn&&Xn.prototype,ST=Jr.RegExp,PT=Jr.TypeError,Rv=Jr.decodeURIComponent,CT=Jr.encodeURIComponent,IT=Xe("".charAt),hv=Xe([].join),rr=Xe([].push),yc=Xe("".replace),wT=Xe([].shift),vv=Xe([].splice),yv=Xe("".split),xT=Xe("".slice),AT=/\+/g,bv=Array(4),TT=function(r){return bv[r-1]||(bv[r-1]=ST("((?:%[\\da-f]{2}){"+r+"})","gi"))},ET=function(r){try{return Rv(r)}catch{return r}},kv=function(r){var e=yc(r,AT," "),t=4;try{return Rv(e)}catch{for(;t;)e=yc(e,TT(t--),ET);return e}},RT=/[!'()~]|%20/g,OT={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},FT=function(r){return OT[r]},Sv=function(r){return yc(CT(r),RT,FT)},fc=lT(function(e,t){Ev(this,{type:Tv,iterator:vc(He(e).entries),kind:t})},"Iterator",function(){var e=bT(this),t=e.kind,i=e.iterator.next(),s=i.value;return i.done||(i.value=t==="keys"?s.key:t==="values"?s.value:[s.key,s.value]),i},!0),Ov=function(r){this.entries=[],this.url=null,r!==void 0&&(Av(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?IT(r,0)==="?"?xT(r,1):r:ce(r)))};Ov.prototype={type:Yn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=gT(r),t,i,s,o,a,c,p;if(e)for(t=vc(r,e),i=t.next;!(s=od(i,t)).done;){if(o=vc(pT(s.value)),a=o.next,(c=od(a,o)).done||(p=od(a,o)).done||!od(a,o).done)throw PT("Expected sequence with length 2");rr(this.entries,{key:ce(c.value),value:ce(p.value)})}else for(var f in r)uT(r,f)&&rr(this.entries,{key:f,value:ce(r[f])})},parseQuery:function(r){if(r)for(var e=yv(r,"&"),t=0,i,s;t<e.length;)i=e[t++],i.length&&(s=yv(i,"="),rr(this.entries,{key:kv(wT(s)),value:kv(hv(s,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],rr(e,Sv(i.key)+"="+Sv(i.value));return hv(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ld=function(){xv(this,Zn);var e=arguments.length>0?arguments[0]:void 0;Ev(this,new Ov(e))},Zn=ld.prototype;aT(Zn,{append:function(e,t){zr(arguments.length,2);var i=He(this);rr(i.entries,{key:ce(e),value:ce(t)}),i.updateURL()},delete:function(r){zr(arguments.length,1);for(var e=He(this),t=e.entries,i=ce(r),s=0;s<t.length;)t[s].key===i?vv(t,s,1):s++;e.updateURL()},get:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=0;s<t.length;s++)if(t[s].key===i)return t[s].value;return null},getAll:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=[],o=0;o<t.length;o++)t[o].key===i&&rr(s,t[o].value);return s},has:function(e){zr(arguments.length,1);for(var t=He(this).entries,i=ce(e),s=0;s<t.length;)if(t[s++].key===i)return!0;return!1},set:function(e,t){zr(arguments.length,1);for(var i=He(this),s=i.entries,o=!1,a=ce(e),c=ce(t),p=0,f;p<s.length;p++)f=s[p],f.key===a&&(o?vv(s,p--,1):(o=!0,f.value=c));o||rr(s,{key:a,value:c}),i.updateURL()},sort:function(){var e=He(this);vT(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=He(this).entries,i=cT(e,arguments.length>1?arguments[1]:void 0),s=0,o;s<t.length;)o=t[s++],i(o.value,o.key,this)},keys:function(){return new fc(this,"keys")},values:function(){return new fc(this,"values")},entries:function(){return new fc(this,"entries")}},{enumerable:!0});wv(Zn,yT,Zn.entries,{name:"entries"});wv(Zn,"toString",function(){return He(this).serialize()},{enumerable:!0});dT(ld,Yn);hc({global:!0,constructor:!0,forced:!Iv},{URLSearchParams:ld});!Iv&&mc(Xn)&&(Pv=Xe(gv.has),Cv=Xe(gv.set),gc=function(r){if(Av(r)){var e=r.body,t;if(mT(e)===Yn)return t=r.headers?new Xn(r.headers):new Xn,Pv(t,"content-type")||Cv(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),fT(r,{body:pv(0,ce(e)),headers:pv(0,t)})}return r},mc(fv)&&hc({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return fv(e,arguments.length>1?gc(arguments[1]):{})}}),mc(dd)&&(ad=function(e){return xv(this,pc),new dd(e,arguments.length>1?gc(arguments[1]):{})},pc.constructor=ad,ad.prototype=pc,hc({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ad})));var Pv,Cv,gc,ad;Fv.exports={URLSearchParams:ld,getState:He}});var Zv=h(()=>{"use strict";ah();var MT=Wn(),Dc=ue(),LT=Xu(),_c=le(),Mv=id(),Ae=z(),fd=er(),Ce=gh(),UT=Zu(),Lc=Se(),Nc=kh(),$r=jh(),We=rc(),BT=eu().codeAt,DT=Yh(),st=Nn(),_T=Vn(),NT=ac(),Vv=Sc(),zv=jr(),qT=zv.set,gd=zv.getterFor("URL"),jT=Vv.URLSearchParams,HT=Vv.getState,Qn=_c.URL,Uc=_c.TypeError,hd=_c.parseInt,WT=Math.floor,Lv=Math.pow,xe=Ae("".charAt),Ge=Ae(/./.exec),ts=Ae([].join),GT=Ae(1 .toString),VT=Ae([].pop),Xr=Ae([].push),Uv=Ae("".replace),zT=Ae([].shift),JT=Ae("".split),is=Ae("".slice),vd=Ae("".toLowerCase),$T=Ae([].unshift),KT="Invalid authority",Pc="Invalid scheme",ir="Invalid host",Bv="Invalid port",Jv=/[a-z]/i,XT=/[\d+-.a-z]/i,Bc=/\d/,ZT=/^0x/i,YT=/^[0-7]+$/,QT=/^\d+$/,$v=/^[\da-f]+$/i,e0=/[\0\t\n\r #%/:<>?@[\\\]^|]/,t0=/[\0\t\n\r #/:<>?@[\\\]^|]/,r0=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,i0=/[\t\n\r]/g,Ie,n0=function(r){var e=JT(r,"."),t,i,s,o,a,c,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],s=0;s<t;s++){if(o=e[s],o=="")return r;if(a=10,o.length>1&&xe(o,0)=="0"&&(a=Ge(ZT,o)?16:8,o=is(o,a==8?1:2)),o==="")c=0;else{if(!Ge(a==10?QT:a==8?YT:$v,o))return r;c=hd(o,a)}Xr(i,c)}for(s=0;s<t;s++)if(c=i[s],s==t-1){if(c>=Lv(256,5-t))return null}else if(c>255)return null;for(p=VT(i),s=0;s<i.length;s++)p+=i[s]*Lv(256,3-s);return p},s0=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,s=0,o,a,c,p,f,v,m,b=function(){return xe(r,s)};if(b()==":"){if(xe(r,1)!=":")return;s+=2,t++,i=t}for(;b();){if(t==8)return;if(b()==":"){if(i!==null)return;s++,t++,i=t;continue}for(o=a=0;a<4&&Ge($v,b());)o=o*16+hd(b(),16),s++,a++;if(b()=="."){if(a==0||(s-=a,t>6))return;for(c=0;b();){if(p=null,c>0)if(b()=="."&&c<4)s++;else return;if(!Ge(Bc,b()))return;for(;Ge(Bc,b());){if(f=hd(b(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}if(p>255)return;s++}e[t]=e[t]*256+p,c++,(c==2||c==4)&&t++}if(c!=4)return;break}else if(b()==":"){if(s++,!b())return}else if(b())return;e[t++]=o}if(i!==null)for(v=t-i,t=7;t!=0&&v>0;)m=e[t],e[t--]=e[i+v-1],e[i+--v]=m;else if(t!=8)return;return e},o0=function(r){for(var e=null,t=1,i=null,s=0,o=0;o<8;o++)r[o]!==0?(s>t&&(e=i,t=s),i=null,s=0):(i===null&&(i=o),++s);return s>t&&(e=i,t=s),e},es=function(r){var e,t,i,s;if(typeof r=="number"){for(e=[],t=0;t<4;t++)$T(e,r%256),r=WT(r/256);return ts(e,".")}else if(typeof r=="object"){for(e="",i=o0(r),t=0;t<8;t++)s&&r[t]===0||(s&&(s=!1),i===t?(e+=t?":":"::",s=!0):(e+=GT(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},pd={},Kv=Nc({},pd,{" ":1,'"':1,"<":1,">":1,"`":1}),Xv=Nc({},Kv,{"#":1,"?":1,"{":1,"}":1}),Cc=Nc({},Xv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),kt=function(r,e){var t=BT(r,0);return t>32&&t<127&&!Lc(e,r)?r:encodeURIComponent(r)},ud={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rs=function(r,e){var t;return r.length==2&&Ge(Jv,xe(r,0))&&((t=xe(r,1))==":"||!e&&t=="|")},Dv=function(r){var e;return r.length>1&&rs(is(r,0,2))&&(r.length==2||(e=xe(r,2))==="/"||e==="\\"||e==="?"||e==="#")},a0=function(r){return r==="."||vd(r)==="%2e"},d0=function(r){return r=vd(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ic={},_v={},wc={},Nv={},qv={},xc={},jv={},Hv={},cd={},md={},Ac={},Tc={},Ec={},Rc={},Wv={},Oc={},Kr={},Ze={},Gv={},nr={},nt={},qc=function(r,e,t){var i=st(r),s,o,a;if(e){if(o=this.parse(i),o)throw Uc(o);this.searchParams=null}else{if(t!==void 0&&(s=new qc(t,!0)),o=this.parse(i,null,s),o)throw Uc(o);a=HT(new jT),a.bindURL(this),this.searchParams=a}};qc.prototype={type:"URL",parse:function(r,e,t){var i=this,s=e||Ic,o=0,a="",c=!1,p=!1,f=!1,v,m,b,y;for(r=st(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=Uv(r,r0,"")),r=Uv(r,i0,""),v=$r(r);o<=v.length;){switch(m=v[o],s){case Ic:if(m&&Ge(Jv,m))a+=vd(m),s=_v;else{if(e)return Pc;s=wc;continue}break;case _v:if(m&&(Ge(XT,m)||m=="+"||m=="-"||m=="."))a+=vd(m);else if(m==":"){if(e&&(i.isSpecial()!=Lc(ud,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&ud[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?s=Rc:i.isSpecial()&&t&&t.scheme==i.scheme?s=Nv:i.isSpecial()?s=Hv:v[o+1]=="/"?(s=qv,o++):(i.cannotBeABaseURL=!0,Xr(i.path,""),s=Gv)}else{if(e)return Pc;a="",s=wc,o=0;continue}break;case wc:if(!t||t.cannotBeABaseURL&&m!="#")return Pc;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=We(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,s=nt;break}s=t.scheme=="file"?Rc:xc;continue;case Nv:if(m=="/"&&v[o+1]=="/")s=cd,o++;else{s=xc;continue}break;case qv:if(m=="/"){s=md;break}else{s=Ze;continue}case xc:if(i.scheme=t.scheme,m==Ie)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())s=jv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query="",s=nr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.query=t.query,i.fragment="",s=nt;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=We(t.path),i.path.length--,s=Ze;continue}break;case jv:if(i.isSpecial()&&(m=="/"||m=="\\"))s=cd;else if(m=="/")s=md;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,s=Ze;continue}break;case Hv:if(s=cd,m!="/"||xe(a,o+1)!="/")continue;o++;break;case cd:if(m!="/"&&m!="\\"){s=md;continue}break;case md:if(m=="@"){c&&(a="%40"+a),c=!0,b=$r(a);for(var C=0;C<b.length;C++){var w=b[C];if(w==":"&&!f){f=!0;continue}var A=kt(w,Cc);f?i.password+=A:i.username+=A}a=""}else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return KT;o-=$r(a).length+1,a="",s=Ac}else a+=m;break;case Ac:case Tc:if(e&&i.scheme=="file"){s=Oc;continue}else if(m==":"&&!p){if(a=="")return ir;if(y=i.parseHost(a),y)return y;if(a="",s=Ec,e==Tc)return}else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return ir;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(y=i.parseHost(a),y)return y;if(a="",s=Kr,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case Ec:if(Ge(Bc,m))a+=m;else if(m==Ie||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var F=hd(a,10);if(F>65535)return Bv;i.port=i.isSpecial()&&F===ud[i.scheme]?null:F,a=""}if(e)return;s=Kr;continue}else return Bv;break;case Rc:if(i.scheme="file",m=="/"||m=="\\")s=Wv;else if(t&&t.scheme=="file")if(m==Ie)i.host=t.host,i.path=We(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=We(t.path),i.query="",s=nr;else if(m=="#")i.host=t.host,i.path=We(t.path),i.query=t.query,i.fragment="",s=nt;else{Dv(ts(We(v,o),""))||(i.host=t.host,i.path=We(t.path),i.shortenPath()),s=Ze;continue}else{s=Ze;continue}break;case Wv:if(m=="/"||m=="\\"){s=Oc;break}t&&t.scheme=="file"&&!Dv(ts(We(v,o),""))&&(rs(t.path[0],!0)?Xr(i.path,t.path[0]):i.host=t.host),s=Ze;continue;case Oc:if(m==Ie||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&rs(a))s=Ze;else if(a==""){if(i.host="",e)return;s=Kr}else{if(y=i.parseHost(a),y)return y;if(i.host=="localhost"&&(i.host=""),e)return;a="",s=Kr}continue}else a+=m;break;case Kr:if(i.isSpecial()){if(s=Ze,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",s=nr;else if(!e&&m=="#")i.fragment="",s=nt;else if(m!=Ie&&(s=Ze,m!="/"))continue;break;case Ze:if(m==Ie||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(d0(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&Xr(i.path,"")):a0(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&Xr(i.path,""):(i.scheme=="file"&&!i.path.length&&rs(a)&&(i.host&&(i.host=""),a=xe(a,0)+":"),Xr(i.path,a)),a="",i.scheme=="file"&&(m==Ie||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)zT(i.path);m=="?"?(i.query="",s=nr):m=="#"&&(i.fragment="",s=nt)}else a+=kt(m,Xv);break;case Gv:m=="?"?(i.query="",s=nr):m=="#"?(i.fragment="",s=nt):m!=Ie&&(i.path[0]+=kt(m,pd));break;case nr:!e&&m=="#"?(i.fragment="",s=nt):m!=Ie&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=kt(m,pd));break;case nt:m!=Ie&&(i.fragment+=kt(m,Kv));break}o++}},parseHost:function(r){var e,t,i;if(xe(r,0)=="["){if(xe(r,r.length-1)!="]"||(e=s0(is(r,1,-1)),!e))return ir;this.host=e}else if(this.isSpecial()){if(r=DT(r),Ge(e0,r)||(e=n0(r),e===null))return ir;this.host=e}else{if(Ge(t0,r))return ir;for(e="",t=$r(r),i=0;i<t.length;i++)e+=kt(t[i],pd);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return Lc(ud,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!rs(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,s=r.host,o=r.port,a=r.path,c=r.query,p=r.fragment,f=e+":";return s!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=es(s),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+ts(a,"/"):"",c!==null&&(f+="?"+c),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw Uc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new Zr(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+es(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(st(r)+":",Ic)},getUsername:function(){return this.username},setUsername:function(r){var e=$r(st(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=kt(e[t],Cc)}},getPassword:function(){return this.password},setPassword:function(r){var e=$r(st(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=kt(e[t],Cc)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?es(r):es(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Ac)},getHostname:function(){var r=this.host;return r===null?"":es(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Tc)},getPort:function(){var r=this.port;return r===null?"":st(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=st(r),r==""?this.port=null:this.parse(r,Ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+ts(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Kr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=st(r),r==""?this.query=null:(xe(r,0)=="?"&&(r=is(r,1)),this.query="",this.parse(r,nr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=st(r),r==""){this.fragment=null;return}xe(r,0)=="#"&&(r=is(r,1)),this.fragment="",this.parse(r,nt)},update:function(){this.query=this.searchParams.serialize()||null}};var Zr=function(e){var t=UT(this,Y),i=NT(arguments.length,1)>1?arguments[1]:void 0,s=qT(t,new qc(e,!1,i));Dc||(t.href=s.serialize(),t.origin=s.getOrigin(),t.protocol=s.getProtocol(),t.username=s.getUsername(),t.password=s.getPassword(),t.host=s.getHost(),t.hostname=s.getHostname(),t.port=s.getPort(),t.pathname=s.getPathname(),t.search=s.getSearch(),t.searchParams=s.getSearchParams(),t.hash=s.getHash())},Y=Zr.prototype,we=function(r,e){return{get:function(){return gd(this)[r]()},set:e&&function(t){return gd(this)[e](t)},configurable:!0,enumerable:!0}};Dc&&(Ce(Y,"href",we("serialize","setHref")),Ce(Y,"origin",we("getOrigin")),Ce(Y,"protocol",we("getProtocol","setProtocol")),Ce(Y,"username",we("getUsername","setUsername")),Ce(Y,"password",we("getPassword","setPassword")),Ce(Y,"host",we("getHost","setHost")),Ce(Y,"hostname",we("getHostname","setHostname")),Ce(Y,"port",we("getPort","setPort")),Ce(Y,"pathname",we("getPathname","setPathname")),Ce(Y,"search",we("getSearch","setSearch")),Ce(Y,"searchParams",we("getSearchParams")),Ce(Y,"hash",we("getHash","setHash")));fd(Y,"toJSON",function(){return gd(this).serialize()},{enumerable:!0});fd(Y,"toString",function(){return gd(this).serialize()},{enumerable:!0});Qn&&(Fc=Qn.createObjectURL,Mc=Qn.revokeObjectURL,Fc&&fd(Zr,"createObjectURL",Mv(Fc,Qn)),Mc&&fd(Zr,"revokeObjectURL",Mv(Mc,Qn)));var Fc,Mc;_T(Zr,"URL");MT({global:!0,constructor:!0,forced:!LT,sham:!Dc},{URL:Zr})});var Yv=h(()=>{Zv()});var Qv=h(()=>{"use strict";var l0=Wn(),u0=qe();l0({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return u0(URL.prototype.toString,this)}})});var ey=h(()=>{Sc()});var ry=h((RL,ty)=>{var c0=le();ty.exports=c0});var ny=h((OL,iy)=>{Yv();Qv();ey();var m0=ry();iy.exports=m0.URL});var fm=h((t_,mb)=>{var wE=Object.prototype.toString;mb.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return RE(e)?"generatorfunction":"function";if(xE(e))return"array";if(ME(e))return"buffer";if(FE(e))return"arguments";if(TE(e))return"date";if(AE(e))return"error";if(EE(e))return"regexp";switch(cb(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(OE(e))return"generator";switch(t=wE.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function cb(r){return typeof r.constructor=="function"?r.constructor.name:null}function xE(r){return Array.isArray?Array.isArray(r):r instanceof Array}function AE(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function TE(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function EE(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function RE(r,e){return cb(r)==="GeneratorFunction"}function OE(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function FE(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function ME(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var gb=h((r_,fb)=>{"use strict";var pb=Symbol.prototype.valueOf,LE=fm();function UE(r,e){switch(LE(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return NE(r);case"symbol":return qE(r);case"arraybuffer":return DE(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return _E(r);case"regexp":return BE(r);case"error":return Object.create(r);default:return r}}function BE(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function DE(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function _E(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function NE(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function qE(r){return pb?Object(pb.call(r)):{}}fb.exports=UE});var vb=h((i_,hb)=>{"use strict";hb.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var kb=h((n_,bb)=>{"use strict";var jE=vb();function yb(r){return jE(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}bb.exports=function(e){var t,i;return!(yb(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,yb(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Pb=h((s_,Sb)=>{"use strict";var HE=gb(),WE=fm(),GE=kb();function gm(r,e){switch(WE(r)){case"object":return VE(r,e);case"array":return zE(r,e);default:return HE(r)}}function VE(r,e){if(typeof e=="function")return e(r);if(e||GE(r)){let t=new r.constructor;for(let i in r)t[i]=gm(r[i],e);return t}return r}function zE(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=gm(r[i],e);return t}Sb.exports=gm});var Am=h((ys,Si)=>{var JE=200,xm="__lodash_hash_undefined__",Kd=1,Lb=2,Ub=9007199254740991,Hd="[object Arguments]",bm="[object Array]",$E="[object AsyncFunction]",Bb="[object Boolean]",Db="[object Date]",_b="[object Error]",Nb="[object Function]",KE="[object GeneratorFunction]",Wd="[object Map]",qb="[object Number]",XE="[object Null]",ki="[object Object]",Cb="[object Promise]",ZE="[object Proxy]",jb="[object RegExp]",Gd="[object Set]",Hb="[object String]",YE="[object Symbol]",QE="[object Undefined]",km="[object WeakMap]",Wb="[object ArrayBuffer]",Vd="[object DataView]",eR="[object Float32Array]",tR="[object Float64Array]",rR="[object Int8Array]",iR="[object Int16Array]",nR="[object Int32Array]",sR="[object Uint8Array]",oR="[object Uint8ClampedArray]",aR="[object Uint16Array]",dR="[object Uint32Array]",lR=/[\\^$.*+?()[\]{}|]/g,uR=/^\[object .+?Constructor\]$/,cR=/^(?:0|[1-9]\d*)$/,q={};q[eR]=q[tR]=q[rR]=q[iR]=q[nR]=q[sR]=q[oR]=q[aR]=q[dR]=!0;q[Hd]=q[bm]=q[Wb]=q[Bb]=q[Vd]=q[Db]=q[_b]=q[Nb]=q[Wd]=q[qb]=q[ki]=q[jb]=q[Gd]=q[Hb]=q[km]=!1;var Gb=typeof global=="object"&&global&&global.Object===Object&&global,mR=typeof self=="object"&&self&&self.Object===Object&&self,lt=Gb||mR||Function("return this")(),Vb=typeof ys=="object"&&ys&&!ys.nodeType&&ys,Ib=Vb&&typeof Si=="object"&&Si&&!Si.nodeType&&Si,zb=Ib&&Ib.exports===Vb,hm=zb&&Gb.process,wb=function(){try{return hm&&hm.binding&&hm.binding("util")}catch{}}(),xb=wb&&wb.isTypedArray;function pR(r,e){for(var t=-1,i=r==null?0:r.length,s=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[s++]=a)}return o}function fR(r,e){for(var t=-1,i=e.length,s=r.length;++t<i;)r[s+t]=e[t];return r}function gR(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function hR(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function vR(r){return function(e){return r(e)}}function yR(r,e){return r.has(e)}function bR(r,e){return r?.[e]}function kR(r){var e=-1,t=Array(r.size);return r.forEach(function(i,s){t[++e]=[s,i]}),t}function SR(r,e){return function(t){return r(e(t))}}function PR(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var CR=Array.prototype,IR=Function.prototype,Xd=Object.prototype,vm=lt["__core-js_shared__"],Jb=IR.toString,Ye=Xd.hasOwnProperty,Ab=function(){var r=/[^.]+$/.exec(vm&&vm.keys&&vm.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),$b=Xd.toString,wR=RegExp("^"+Jb.call(Ye).replace(lR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tb=zb?lt.Buffer:void 0,zd=lt.Symbol,Eb=lt.Uint8Array,Kb=Xd.propertyIsEnumerable,xR=CR.splice,fr=zd?zd.toStringTag:void 0,Rb=Object.getOwnPropertySymbols,AR=Tb?Tb.isBuffer:void 0,TR=SR(Object.keys,Object),Sm=Pi(lt,"DataView"),bs=Pi(lt,"Map"),Pm=Pi(lt,"Promise"),Cm=Pi(lt,"Set"),Im=Pi(lt,"WeakMap"),ks=Pi(Object,"create"),ER=vr(Sm),RR=vr(bs),OR=vr(Pm),FR=vr(Cm),MR=vr(Im),Ob=zd?zd.prototype:void 0,ym=Ob?Ob.valueOf:void 0;function gr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function LR(){this.__data__=ks?ks(null):{},this.size=0}function UR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function BR(r){var e=this.__data__;if(ks){var t=e[r];return t===xm?void 0:t}return Ye.call(e,r)?e[r]:void 0}function DR(r){var e=this.__data__;return ks?e[r]!==void 0:Ye.call(e,r)}function _R(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=ks&&e===void 0?xm:e,this}gr.prototype.clear=LR;gr.prototype.delete=UR;gr.prototype.get=BR;gr.prototype.has=DR;gr.prototype.set=_R;function ut(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function NR(){this.__data__=[],this.size=0}function qR(r){var e=this.__data__,t=Zd(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():xR.call(e,t,1),--this.size,!0}function jR(r){var e=this.__data__,t=Zd(e,r);return t<0?void 0:e[t][1]}function HR(r){return Zd(this.__data__,r)>-1}function WR(r,e){var t=this.__data__,i=Zd(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ut.prototype.clear=NR;ut.prototype.delete=qR;ut.prototype.get=jR;ut.prototype.has=HR;ut.prototype.set=WR;function hr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function GR(){this.size=0,this.__data__={hash:new gr,map:new(bs||ut),string:new gr}}function VR(r){var e=Yd(this,r).delete(r);return this.size-=e?1:0,e}function zR(r){return Yd(this,r).get(r)}function JR(r){return Yd(this,r).has(r)}function $R(r,e){var t=Yd(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}hr.prototype.clear=GR;hr.prototype.delete=VR;hr.prototype.get=zR;hr.prototype.has=JR;hr.prototype.set=$R;function Jd(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new hr;++e<t;)this.add(r[e])}function KR(r){return this.__data__.set(r,xm),this}function XR(r){return this.__data__.has(r)}Jd.prototype.add=Jd.prototype.push=KR;Jd.prototype.has=XR;function Rt(r){var e=this.__data__=new ut(r);this.size=e.size}function ZR(){this.__data__=new ut,this.size=0}function YR(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function QR(r){return this.__data__.get(r)}function eO(r){return this.__data__.has(r)}function tO(r,e){var t=this.__data__;if(t instanceof ut){var i=t.__data__;if(!bs||i.length<JE-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new hr(i)}return t.set(r,e),this.size=t.size,this}Rt.prototype.clear=ZR;Rt.prototype.delete=YR;Rt.prototype.get=QR;Rt.prototype.has=eO;Rt.prototype.set=tO;function rO(r,e){var t=$d(r),i=!t&&vO(r),s=!t&&!i&&wm(r),o=!t&&!i&&!s&&rk(r),a=t||i||s||o,c=a?hR(r.length,String):[],p=c.length;for(var f in r)(e||Ye.call(r,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||mO(f,p)))&&c.push(f);return c}function Zd(r,e){for(var t=r.length;t--;)if(Yb(r[t][0],e))return t;return-1}function iO(r,e,t){var i=e(r);return $d(r)?i:fR(i,t(r))}function Ps(r){return r==null?r===void 0?QE:XE:fr&&fr in Object(r)?uO(r):hO(r)}function Fb(r){return Ss(r)&&Ps(r)==Hd}function Xb(r,e,t,i,s){return r===e?!0:r==null||e==null||!Ss(r)&&!Ss(e)?r!==r&&e!==e:nO(r,e,t,i,Xb,s)}function nO(r,e,t,i,s,o){var a=$d(r),c=$d(e),p=a?bm:Et(r),f=c?bm:Et(e);p=p==Hd?ki:p,f=f==Hd?ki:f;var v=p==ki,m=f==ki,b=p==f;if(b&&wm(r)){if(!wm(e))return!1;a=!0,v=!1}if(b&&!v)return o||(o=new Rt),a||rk(r)?Zb(r,e,t,i,s,o):dO(r,e,p,t,i,s,o);if(!(t&Kd)){var y=v&&Ye.call(r,"__wrapped__"),C=m&&Ye.call(e,"__wrapped__");if(y||C){var w=y?r.value():r,A=C?e.value():e;return o||(o=new Rt),s(w,A,t,i,o)}}return b?(o||(o=new Rt),lO(r,e,t,i,s,o)):!1}function sO(r){if(!tk(r)||fO(r))return!1;var e=Qb(r)?wR:uR;return e.test(vr(r))}function oO(r){return Ss(r)&&ek(r.length)&&!!q[Ps(r)]}function aO(r){if(!gO(r))return TR(r);var e=[];for(var t in Object(r))Ye.call(r,t)&&t!="constructor"&&e.push(t);return e}function Zb(r,e,t,i,s,o){var a=t&Kd,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var v=-1,m=!0,b=t&Lb?new Jd:void 0;for(o.set(r,e),o.set(e,r);++v<c;){var y=r[v],C=e[v];if(i)var w=a?i(C,y,v,e,r,o):i(y,C,v,r,e,o);if(w!==void 0){if(w)continue;m=!1;break}if(b){if(!gR(e,function(A,F){if(!yR(b,F)&&(y===A||s(y,A,t,i,o)))return b.push(F)})){m=!1;break}}else if(!(y===C||s(y,C,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function dO(r,e,t,i,s,o,a){switch(t){case Vd:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Wb:return!(r.byteLength!=e.byteLength||!o(new Eb(r),new Eb(e)));case Bb:case Db:case qb:return Yb(+r,+e);case _b:return r.name==e.name&&r.message==e.message;case jb:case Hb:return r==e+"";case Wd:var c=kR;case Gd:var p=i&Kd;if(c||(c=PR),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=Lb,a.set(r,e);var v=Zb(c(r),c(e),i,s,o,a);return a.delete(r),v;case YE:if(ym)return ym.call(r)==ym.call(e)}return!1}function lO(r,e,t,i,s,o){var a=t&Kd,c=Mb(r),p=c.length,f=Mb(e),v=f.length;if(p!=v&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:Ye.call(e,b)))return!1}var y=o.get(r);if(y&&o.get(e))return y==e;var C=!0;o.set(r,e),o.set(e,r);for(var w=a;++m<p;){b=c[m];var A=r[b],F=e[b];if(i)var de=a?i(F,A,b,e,r,o):i(A,F,b,r,e,o);if(!(de===void 0?A===F||s(A,F,t,i,o):de)){C=!1;break}w||(w=b=="constructor")}if(C&&!w){var Un=r.constructor,Ta=e.constructor;Un!=Ta&&"constructor"in r&&"constructor"in e&&!(typeof Un=="function"&&Un instanceof Un&&typeof Ta=="function"&&Ta instanceof Ta)&&(C=!1)}return o.delete(r),o.delete(e),C}function Mb(r){return iO(r,kO,cO)}function Yd(r,e){var t=r.__data__;return pO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Pi(r,e){var t=bR(r,e);return sO(t)?t:void 0}function uO(r){var e=Ye.call(r,fr),t=r[fr];try{r[fr]=void 0;var i=!0}catch{}var s=$b.call(r);return i&&(e?r[fr]=t:delete r[fr]),s}var cO=Rb?function(r){return r==null?[]:(r=Object(r),pR(Rb(r),function(e){return Kb.call(r,e)}))}:SO,Et=Ps;(Sm&&Et(new Sm(new ArrayBuffer(1)))!=Vd||bs&&Et(new bs)!=Wd||Pm&&Et(Pm.resolve())!=Cb||Cm&&Et(new Cm)!=Gd||Im&&Et(new Im)!=km)&&(Et=function(r){var e=Ps(r),t=e==ki?r.constructor:void 0,i=t?vr(t):"";if(i)switch(i){case ER:return Vd;case RR:return Wd;case OR:return Cb;case FR:return Gd;case MR:return km}return e});function mO(r,e){return e=e??Ub,!!e&&(typeof r=="number"||cR.test(r))&&r>-1&&r%1==0&&r<e}function pO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function fO(r){return!!Ab&&Ab in r}function gO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xd;return r===t}function hO(r){return $b.call(r)}function vr(r){if(r!=null){try{return Jb.call(r)}catch{}try{return r+""}catch{}}return""}function Yb(r,e){return r===e||r!==r&&e!==e}var vO=Fb(function(){return arguments}())?Fb:function(r){return Ss(r)&&Ye.call(r,"callee")&&!Kb.call(r,"callee")},$d=Array.isArray;function yO(r){return r!=null&&ek(r.length)&&!Qb(r)}var wm=AR||PO;function bO(r,e){return Xb(r,e)}function Qb(r){if(!tk(r))return!1;var e=Ps(r);return e==Nb||e==KE||e==$E||e==ZE}function ek(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ub}function tk(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function Ss(r){return r!=null&&typeof r=="object"}var rk=xb?vR(xb):oO;function kO(r){return yO(r)?rO(r):aO(r)}function SO(){return[]}function PO(){return!1}Si.exports=bO});var DS=h(Pl=>{"use strict";Pl.byteLength=$O;Pl.toByteArray=XO;Pl.fromByteArray=QO;var et=[],Be=[],JO=typeof Uint8Array<"u"?Uint8Array:Array,tp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rr=0,US=tp.length;Rr<US;++Rr)et[Rr]=tp[Rr],Be[tp.charCodeAt(Rr)]=Rr;var Rr,US;Be["-".charCodeAt(0)]=62;Be["_".charCodeAt(0)]=63;function BS(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function $O(r){var e=BS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function KO(r,e,t){return(e+t)*3/4-t}function XO(r){var e,t=BS(r),i=t[0],s=t[1],o=new JO(KO(r,i,s)),a=0,c=s>0?i-4:i,p;for(p=0;p<c;p+=4)e=Be[r.charCodeAt(p)]<<18|Be[r.charCodeAt(p+1)]<<12|Be[r.charCodeAt(p+2)]<<6|Be[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return s===2&&(e=Be[r.charCodeAt(p)]<<2|Be[r.charCodeAt(p+1)]>>4,o[a++]=e&255),s===1&&(e=Be[r.charCodeAt(p)]<<10|Be[r.charCodeAt(p+1)]<<4|Be[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ZO(r){return et[r>>18&63]+et[r>>12&63]+et[r>>6&63]+et[r&63]}function YO(r,e,t){for(var i,s=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),s.push(ZO(i));return s.join("")}function QO(r){for(var e,t=r.length,i=t%3,s=[],o=16383,a=0,c=t-i;a<c;a+=o)s.push(YO(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],s.push(et[e>>2]+et[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],s.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"=")),s.join("")}});var hH=Bn(ny(),1);function g(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function sr(r,e){if(!r)throw Error(e)}var Q;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(Q||(Q={}));function St(r){return r.startsWith(Q.COMMENT)}function yd(r){return r.startsWith(Q.ACCOUNT)}function or(r){return r.startsWith(Q.LINK)}function sy(r){return r.startsWith(Q.MESSAGE)}function oy(r){return r.startsWith(Q.SUBREDDIT)}function ay(r){return r.startsWith(Q.AWARD)}function p0(r){sr(St(r),`Expected comment id to start with ${Q.COMMENT}, got ${r}}`)}function f0(r){sr(yd(r),`Expected account id to start with ${Q.ACCOUNT}, got ${r}}`)}function g0(r){sr(or(r),`Expected link id to start with ${Q.LINK}, got ${r}}`)}function h0(r){sr(sy(r),`Expected message id to start with ${Q.MESSAGE}, got ${r}}`)}function v0(r){sr(oy(r),`Expected subreddit id to start with ${Q.SUBREDDIT}, got ${r}}`)}function y0(r){sr(ay(r),`Expected award id to start with ${Q.AWARD}, got ${r}}`)}function Yr(r){return p0(r),r}function ee(r){return f0(r),r}function me(r){return g0(r),r}function b0(r){return h0(r),r}function Te(r){return v0(r),r}function k0(r){return y0(r),r}function pe(r){if(St(r))return Yr(r);if(yd(r))return ee(r);if(or(r))return me(r);if(sy(r))return b0(r);if(oy(r))return Te(r);if(ay(r))return k0(r);throw new Error(`Expected thing id to start with ${Object.values(Q).join(", ")} got ${r}}`)}function jc(r){return St(r)}import*as P from"@devvit/protos";var bd=class{constructor(e){}};var Hc=(t=>(t.Installation="installation",t.App="app",t))(Hc||{});function ar(r,e=new Set){for(let t of r){if(t.type==="group"){ar(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}S0(r)}function S0(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var Pt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var jL=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","brand-awareness","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as D0,GetFieldsResponse as _0}from"@devvit/protos";import{FormField as dr,FormFieldType as Ee}from"@devvit/protos";function ot(r){return r.map(e=>{switch(e.type){case"string":return P0(e);case"image":return C0(e);case"paragraph":return I0(e);case"number":return w0(e);case"select":return x0(e);case"boolean":return A0(e);case"group":return T0(e);default:throw new Error("Unknown field type.")}})}function P0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Ee.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret})}function C0(r){return dr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Ee.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function I0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Ee.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required})}function w0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Ee.NUMBER,helpText:r.helpText,label:r.label,required:r.required})}function x0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.SELECTION,selectionValue:{values:r.defaultValue}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Ee.SELECTION,helpText:r.helpText,label:r.label,required:r.required})}function A0(r){return dr.fromPartial({defaultValue:{fieldType:Ee.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Ee.BOOLEAN,helpText:r.helpText,label:r.label})}function T0(r){return dr.fromPartial({fieldType:Ee.GROUP,fieldConfig:{groupConfig:{fields:ot(r.fields)}},label:r.label,helpText:r.helpText})}function L(r,e){u.prototype[r]=e}import{ValidateFormResponse as B0}from"@devvit/protos";import{RealtimeSubscriptionStatus as ly}from"@devvit/protos";var B=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",TraceID:"devvit-trace-id",User:"devvit-user",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies",WebviewTemplate:"devvit-webview-template"}),dy;(function(r){r.Blocks="blocks",r.EmitSnapshots="emitSnapshots",r.EmitState="emitState",r.Realtime="realtime",r.Runtime="runtime",r.Surface="surface",r.UseAsync="useAsync",r.Payments="payments"})(dy||(dy={}));function uy(r){function e(t){let s=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[B.App]?.values[0];g(c,"useChannel - app is missing from Context");let p=r.metadata[B.Installation]?.values[0];g(p,"useChannel - installation is missing from Context");async function f(A){let F=o[s].channel;if(o[s].active)if(o[s].connected)await r.realtime.send(F,A);else throw Error(`Failed to send to channel '${F}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${F}`)}function v(){if(!o[s].active){let A=o[s].channel;o[s].active=!0,r.addRealtimeChannel(A)}}function m(){if(o[s].active){let A=o[s].channel;o[s].active=!1,r.removeRealtimeChannel(A)}}function b(A){return async()=>{let F;switch(A.status){case ly.REALTIME_SUBSCRIBED:o[s].connected=!0,F=t.onSubscribed?.();break;case ly.REALTIME_UNSUBSCRIBED:o[s].connected=!1,F=t.onUnsubscribed?.();break;default:F=t.onMessage(A.event?.data??{});break}await F}}let y={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:Pt.CHANNEL};s in o?y=o[s]:s in a&&(y=a[s]);let C=r.realtimeEvent;r.isInitialRender?y.active=!1:C&&y.active&&C.event.channel===y.channel&&(y.preventCallback||r.runHook(b(C)),r.rerenderIn(0)),o[s]=y,r.currentHookIndex++;let w=0;return y.active&&y.connected?w=2:y.active&&!y.connected?w=1:!y.active&&y.connected?w=3:!y.active&&!y.connected&&(w=4),{subscribe:v,unsubscribe:m,send:f,status:w}}return e}import{FormFieldType as Qr}from"@devvit/protos";function Wc(r){switch(r.fieldType){case Qr.STRING:return r.stringValue;case Qr.IMAGE:return r.stringValue;case Qr.PARAGRAPH:return r.stringValue;case Qr.NUMBER:return r.numberValue;case Qr.BOOLEAN:return r.boolValue;case Qr.SELECTION:return r.selectionValue?.values??[];default:return}}function Ct(r){return Object.keys(r).reduce((e,t)=>{let i=Wc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function cy(r){function e(t,i){let s=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${s}`,f={formKey:p,preventSubmit:!1,type:Pt.FORM};s in a?f=a[s]:s in c&&(f=c[s]),a[s]=f,r.forms.set(p,t);let v=r.formSubmittedEvent;return v&&!f.preventSubmit&&v.formId===p&&r.runHook(async()=>{let m=i(Ct(v.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[s].preventSubmit=!1,r.currentHookIndex++,p}return e}function my(r){function e(t,i){let s=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:Pt.INTERVAL};s in o?f=o[s]:s in a&&(f=a[s]);function v(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,y]of Object.entries(o))if(b!==s.toString()&&y?.type===Pt.INTERVAL&&y?.running)throw new Error("Only one useInterval hook may be running at a time");o[s]={running:!0,lastRun:o[s]?.lastRun??Date.now(),preventCallback:!1,type:Pt.INTERVAL},r.rerenderIn(p)}function m(){o[s].running=!1,o[s].lastRun=void 0,o[s].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[s]=f,r.currentHookIndex++,{start:v,stop:m}}return e}function py(r){function e(t){let i=r.currentHookIndex,s=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in s)return r.currentHookIndex++,[s[i],a];if(r.isInitialRender||!(i in o)){let c=t instanceof Function?t():t;if(c instanceof Promise)throw(async()=>{s[i]=await c,r.currentHookIndex=0})();s[i]=c}else s[i]=o[i];function a(c){if(r.isRendering)throw new Error("Cannot call setState while rendering.");s[i]=c instanceof Function?c(s[i]):c}return r.currentHookIndex++,[s[i],a]}return e}var Jc={now(){return new Date}};function fy(r){return`__autocache__${r}`}function gy(r){return`__lock__${r}`}var R0=300,O0=1e3,kd=5e3,Gc=3,hy=.1,vy=1e3,F0=3e4;function yy(r){if(r.error)throw new Error(r.error);return r.value}var It,wt,Re,ei,Pd,by,Cd,ky,Id,Sy,ns,Vc,wd,Py,xd,Cy,ss,zc,Ad,Iy,Sd=class{constructor(e,t,i=Jc){d(this,Pd);d(this,Cd);d(this,Id);d(this,ns);d(this,wd);d(this,xd);d(this,ss);d(this,Ad);d(this,It,void 0);d(this,wt,{});d(this,Re,void 0);d(this,ei,void 0);l(this,It,e),l(this,ei,t),l(this,Re,i)}async cache(e,t){l(this,wt,n(this,ei).__cache=n(this,ei).__cache??{}),S(this,Ad,Iy).call(this,t);let i=S(this,Pd,by).call(this,t.key);if(i!==void 0)return i;let s=await S(this,ss,zc).call(this,t.key),o=await S(this,Cd,ky).call(this,t,s,e);return yy(o)}};It=new WeakMap,wt=new WeakMap,Re=new WeakMap,ei=new WeakMap,Pd=new WeakSet,by=function(e){let t=n(this,wt)[e];if(t){let i=n(this,Re).now().getTime(),s=t?.error&&t?.errorTime&&t.errorCount<Gc&&Math.random()<hy&&t.errorTime+vy<i;if(t?.expires&&t.expires<i&&t.checkedAt+vy<i||s){delete n(this,wt)[e];return}else return yy(t)}},Cd=new WeakSet,ky=async function(e,t,i){let s=t?.expires,o=s?S(this,xd,Cy).call(this,s):1;return!t||t?.error&&t.errorCount<Gc&&hy>Math.random()||o>Math.random()?S(this,Id,Sy).call(this,e,t,i):t},Id=new WeakSet,Sy=async function(e,t,i){let s=gy(e.key),o=n(this,Re).now().getTime(),a=new Date(o+e.ttl/2);if(await n(this,It).set(s,"1",{expiration:a,nx:!0}))return S(this,wd,Py).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=n(this,Re).now();return S(this,ns,Vc).call(this,p,e.key,e.ttl)}},ns=new WeakSet,Vc=async function(e,t,i){let s=Math.min(i,O0),o=await S(this,ss,zc).call(this,t);if(o)return o;if(n(this,Re).now().getTime()-e.getTime()>=s)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,R0)),S(this,ns,Vc).call(this,e,t,i)},wd=new WeakSet,Py=async function(e,t,i,s){let o=n(this,Re).now().getTime()+s;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=n(this,Re).now().getTime(),t.errorCount++}return n(this,wt)[e]=t,await n(this,It).set(fy(e),JSON.stringify(t),{expiration:new Date(o+F0)}),t.error&&t.errorCount<Gc&&await n(this,It).del(gy(e)),t},xd=new WeakSet,Cy=function(e){let t=n(this,Re).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},ss=new WeakSet,zc=async function(e){let t=await n(this,It).get(fy(e));if(t){let i=JSON.parse(t);return i.checkedAt=n(this,Re).now().getTime(),n(this,wt)[e]=i,i}},Ad=new WeakSet,Iy=function(e){e.ttl<kd&&(console.warn(`Cache TTL cannot be less than ${kd} milliseconds! Updating ttl value of ${e.ttl} to ${kd}.`),e.ttl=kd)};function wy(r,e,t=Jc){let i=new Sd(r,e,t);return i.cache.bind(i)}var ti,ri,Td,xy,Ed,Ay,ii=class{constructor(){d(this,Td);d(this,Ed);d(this,ti,{});d(this,ri,{});l(this,ti,u.assets),l(this,ri,u.webviewAssets)}getURL(e,t){return typeof e=="string"?S(this,Td,xy).call(this,e,t??{webview:!1}):S(this,Ed,Ay).call(this,e,t??{webview:!1})}};ti=new WeakMap,ri=new WeakMap,Td=new WeakSet,xy=function(e,t){let i=t.webview?n(this,ri)[e]:n(this,ti)[e];if(i)return i;try{return new URL(e.slice(0,e.indexOf(","))),e}catch{return""}},Ed=new WeakSet,Ay=function(e,t){let i={},s=[],o=t.webview?n(this,ri):n(this,ti);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{new URL(a.slice(0,a.indexOf(","))),i[a]=a}catch{s.push(a)}else s=e;if(s.length>0)throw new Error(`The following assets were missing from the assets list: ${s.join(", ")}`);return i};var xt,ni=class{constructor(e){d(this,xt,void 0);l(this,xt,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},n(this,xt));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await u.kvStorePlugin.Put({messages:i},n(this,xt))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},n(this,xt))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},n(this,xt));return e}};xt=new WeakMap;var os,si=class{constructor(e){d(this,os,void 0);l(this,os,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,n(this,os));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};os=new WeakMap;var as,oi=class{constructor(e){d(this,as,void 0);l(this,as,e)}async add(e){await u.modLogPlugin.Add(e,n(this,as))}};as=new WeakMap;var ds,ai=class{constructor(e){d(this,ds,void 0);l(this,ds,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:t},n(this,ds))}};ds=new WeakMap;var k,ls,li=class{constructor(e){d(this,k,void 0);d(this,ls,void 0);l(this,k,e),l(this,ls,new Od(e))}get modMail(){return n(this,ls)}getSubredditById(e){return fe.getById(pe(e),n(this,k))}getSubredditByName(e){return fe.getByName(e,n(this,k))}addSubredditRemovalReason(e,t){return fe.addRemovalReason(e,t.title,t.message,n(this,k))}getSubredditRemovalReasons(e){return fe.getRemovalReasons(e,n(this,k))}getCurrentSubreddit(){return fe.getFromMetadata(n(this,k))}getPostById(e){return G.getById(pe(e),n(this,k))}submitPost(e){return G.submit(e,n(this,k))}crosspost(e){return G.crosspost(e,n(this,k))}getUserById(e){return I.getById(pe(e),n(this,k))}getCollectionById(e){return di.getCollectionById({collectionId:e},n(this,k))}createCollection(e){return di.create(e,n(this,k))}getCollectionsForSubreddit(e){return di.getCollectionsForSubreddit({subredditId:e},n(this,k))}getUserByUsername(e){return I.getByUsername(e,n(this,k))}getCurrentUser(){return I.getFromMetadata(B.User,n(this,k))}getAppUser(){return I.getFromMetadata(B.AppUser,n(this,k))}getSnoovatarUrl(e){return I.getSnoovatarUrl(e,n(this,k))}getCommentById(e){return $.getById(pe(e),n(this,k))}getComments(e){return $.getComments(e,n(this,k))}getCommentsByUser(e){return $.getCommentsByUser(e,n(this,k))}submitComment(e){return $.submit({...e,id:pe(e.id)},n(this,k))}getControversialPosts(e){return G.getControversialPosts(e,n(this,k))}getTopPosts(e){return G.getTopPosts(e,n(this,k))}getHotPosts(e){return G.getHotPosts(e,n(this,k))}getNewPosts(e){return G.getNewPosts(e,n(this,k))}getRisingPosts(e){return G.getRisingPosts(e,n(this,k))}getPostsByUser(e){return G.getPostsByUser(e,n(this,k))}getCommentsAndPostsByUser(e){return I.getOverview(e,n(this,k))}getModerationLog(e){return Rd(e,n(this,k))}getApprovedUsers(e){return I.getSubredditUsersByType({type:"contributors",...e},n(this,k))}approveUser(e,t){return I.createRelationship({username:e,subredditName:t,type:"contributor"},n(this,k))}removeUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"contributor"},n(this,k))}getWikiContributors(e){return I.getSubredditUsersByType({type:"wikicontributors",...e},n(this,k))}addWikiContributor(e,t){return I.createRelationship({username:e,subredditName:t,type:"wikicontributor"},n(this,k))}removeWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},n(this,k))}getBannedUsers(e){return I.getSubredditUsersByType({type:"banned",...e},n(this,k))}banUser(e){return I.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},n(this,k))}unbanUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"banned"},n(this,k))}getBannedWikiContributors(e){return I.getSubredditUsersByType({type:"wikibanned",...e},n(this,k))}banWikiContributor(e){return I.createRelationship({...e,type:"wikibanned"},n(this,k))}unbanWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikibanned"},n(this,k))}getModerators(e){return I.getSubredditUsersByType({type:"moderators",...e},n(this,k))}inviteModerator(e){return I.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},n(this,k))}revokeModeratorInvite(e,t){return I.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},n(this,k))}removeModerator(e,t){return I.removeRelationship({type:"moderator",subredditName:t,username:e},n(this,k))}setModeratorPermissions(e,t,i){return I.setModeratorPermissions(e,t,i,n(this,k))}getMutedUsers(e){return I.getSubredditUsersByType({type:"muted",...e},n(this,k))}muteUser(e){return I.createRelationship({...e,type:"muted"},n(this,k))}unmuteUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"muted"},n(this,k))}getModNotes(e){return Oe.get(e,n(this,k))}deleteModNote(e){return Oe.delete(e,n(this,k))}addModNote(e){let t={...e,redditId:e.redditId?pe(e.redditId):void 0};return Oe.add(t,n(this,k))}addRemovalNote(e){return Oe.addRemovalNote(e,n(this,k))}async sendPrivateMessage(e){return lr.send(e,n(this,k))}async sendPrivateMessageAsSubreddit(e){return lr.sendAsSubreddit(e,n(this,k))}async approve(e){if(St(e))return $.approve(e,n(this,k));if(or(e))return G.approve(e,n(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(St(e))return $.remove(e,t,n(this,k));if(or(e))return G.remove(e,t,n(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return se.getPostFlairTemplates(e,n(this,k))}async getUserFlairTemplates(e){return se.getUserFlairTemplates(e,n(this,k))}async createPostFlairTemplate(e){return se.createPostFlairTemplate(e,n(this,k))}async createUserFlairTemplate(e){return se.createUserFlairTemplate(e,n(this,k))}async editFlairTemplate(e){return se.editFlairTemplate(e,n(this,k))}async deleteFlairTemplate(e,t){return se.deleteFlairTemplate(e,t,n(this,k))}async setUserFlair(e){return Fe.setUserFlair(e,n(this,k))}async removeUserFlair(e,t){return Fe.removeUserFlair(e,t,n(this,k))}async setPostFlair(e){return Fe.setPostFlair(e,n(this,k))}async removePostFlair(e,t){return Fe.removePostFlair(e,me(t),n(this,k))}async getWidgets(e){return te.getWidgets(e,n(this,k))}async deleteWidget(e,t){return te.delete(e,t,n(this,k))}async addWidget(e){return te.add(e,n(this,k))}async reorderWidgets(e,t){return te.reorder(e,t,n(this,k))}async getWikiPage(e,t){return ge.getPage(e,t,n(this,k))}async getWikiPages(e){return ge.getPages(e,n(this,k))}async createWikiPage(e){return ge.createPage(e,n(this,k))}async updateWikiPage(e){return ge.updatePage(e,n(this,k))}getWikiPageRevisions(e){return ge.getPageRevisions(e,n(this,k))}async revertWikiPage(e,t,i){return ge.revertPage(e,t,i,n(this,k))}async getWikiPageSettings(e,t){return ge.getPageSettings(e,t,n(this,k))}async updateWikiPageSettings(e){return ge.updatePageSettings(e,n(this,k))}async addEditorToWikiPage(e,t,i){return ge.addEditor(e,t,i,n(this,k))}async removeEditorFromWikiPage(e,t,i){return ge.removeEditor(e,t,i,n(this,k))}getMessages(e){return lr.getMessages(e,n(this,k))}markAllMessagesAsRead(){return lr.markAllAsRead(n(this,k))}report(e,t){return u.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},n(this,k))}getModQueue(e){return fe.aboutLocation({...e,location:"modqueue"},n(this,k))}getReports(e){return fe.aboutLocation({...e,location:"reports"},n(this,k))}getSpam(e){return fe.aboutLocation({...e,location:"spam"},n(this,k))}getUnmoderated(e){return fe.aboutLocation({...e,location:"unmoderated"},n(this,k))}getEdited(e){return fe.aboutLocation({...e,location:"edited"},n(this,k))}getVaultByAddress(e){return Ry(e,n(this,k))}getVaultByUserId(e){return Oy(pe(e),n(this,k))}getSubredditLeaderboard(e){return Ey(e,n(this,k))}};k=new WeakMap,ls=new WeakMap;import{RedisKeyScope as $c}from"@devvit/protos";var E,R,O,Kc=class{constructor(e,t,i){d(this,E,void 0);d(this,R,void 0);d(this,O,void 0);l(this,E,e),l(this,R,t),l(this,O,i)}async get(e){return await n(this,E).Get({key:e,transactionId:n(this,R)},n(this,O)),this}async multi(){await n(this,E).Multi(n(this,R),n(this,O))}async set(e,t,i){let s;return i?.expiration&&(s=Math.floor((i.expiration.getTime()-Date.now())/1e3),s<1&&(s=1)),await n(this,E).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:s||0,transactionId:n(this,R)},n(this,O)),this}async del(...e){return await n(this,E).Del({keys:e,transactionId:n(this,R)},n(this,O)),this}async type(e){return await n(this,E).Type({key:e,transactionId:n(this,R)},n(this,O)),this}async exec(){let e=await n(this,E).Exec(n(this,R),n(this,O)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await n(this,E).Discard(n(this,R),n(this,O))}async watch(...e){return await n(this,E).Watch({keys:e,transactionId:n(this,R)},n(this,O)),this}async unwatch(){return await n(this,E).Unwatch(n(this,R),n(this,O)),this}async getRange(e,t,i){return await n(this,E).GetRange({key:e,start:t,end:i,transactionId:n(this,R)},n(this,O)),this}async setRange(e,t,i){return await n(this,E).SetRange({key:e,offset:t,value:i,transactionId:n(this,R)},n(this,O)),this}async strlen(e){return await n(this,E).Strlen({key:e,transactionId:n(this,R)},n(this,O)),this}async mget(e){return await n(this,E).MGet({keys:e,transactionId:n(this,R)},n(this,O)),this}async mset(e){let t=Object.entries(e).map(([i,s])=>({key:i,value:s}));return await n(this,E).MSet({kv:t,transactionId:n(this,R)},n(this,O)),this}async incrBy(e,t){return await n(this,E).IncrBy({key:e,value:t,transactionId:n(this,R)},n(this,O)),this}async expire(e,t){return await n(this,E).Expire({key:e,seconds:t,transactionId:n(this,R)},n(this,O)),this}async expireTime(e){return await n(this,E).ExpireTime({key:e,transactionId:n(this,R)},n(this,O)),this}async zAdd(e,...t){return await n(this,E).ZAdd({key:e,members:t,transactionId:n(this,R)},n(this,O)),this}async zScore(e,t){return await n(this,E).ZScore({key:{key:e,transactionId:n(this,R)},member:t},n(this,O)),this}async zRank(e,t){return await n(this,E).ZRank({key:{key:e,transactionId:n(this,R)},member:t},n(this,O)),this}async zIncrBy(e,t,i){return await n(this,E).ZIncrBy({key:e,member:t,value:i,transactionId:n(this,R)},n(this,O)),this}async zScan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,transactionId:n(this,R)};return await n(this,E).ZScan(o,n(this,O)),this}async zCard(e){return await n(this,E).ZCard({key:e,transactionId:n(this,R)},n(this,O)),this}async zRange(e,t,i,s){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return s?.reverse&&(o.rev=s.reverse),s?.by==="lex"?o.byLex=!0:s?.by==="score"&&(o.byScore=!0),await n(this,E).ZRange({key:{key:e,transactionId:n(this,R)},start:t+"",stop:i+"",...o},n(this,O)),this}async zRem(e,t){return await n(this,E).ZRem({key:{key:e,transactionId:n(this,R)},members:t},n(this,O)),this}async zRemRangeByLex(e,t,i){return await n(this,E).ZRemRangeByLex({key:{key:e,transactionId:n(this,R)},min:t,max:i},n(this,O)),this}async zRemRangeByRank(e,t,i){return await n(this,E).ZRemRangeByRank({key:{key:e,transactionId:n(this,R)},start:t,stop:i},n(this,O)),this}async zRemRangeByScore(e,t,i){return await n(this,E).ZRemRangeByScore({key:{key:e,transactionId:n(this,R)},min:t,max:i},n(this,O)),this}async hgetall(e){return await n(this,E).HGetAll({key:e,transactionId:n(this,R)},n(this,O)),this}async hget(e,t){return await n(this,E).HGet({key:e,field:t,transactionId:n(this,R)},n(this,O)),this}async hset(e,t){let i=Object.entries(t).map(([s,o])=>({field:s,value:o}));return await n(this,E).HSet({key:e,fv:i,transactionId:n(this,R)},n(this,O)),this}async hincrby(e,t,i){return await n(this,E).HIncrBy({key:e,field:t,value:i,transactionId:n(this,R)},n(this,O)),this}async hdel(e,t){return await n(this,E).HDel({key:e,fields:t,transactionId:n(this,R)},n(this,O)),this}async hscan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,transactionId:n(this,R)};return await n(this,E).HScan(o,n(this,O)),this}async hkeys(e){return await n(this,E).HKeys({key:e,transactionId:n(this,R)},n(this,O)),this}async hlen(e){return await n(this,E).HLen({key:e,transactionId:n(this,R)},n(this,O)),this}};E=new WeakMap,R=new WeakMap,O=new WeakMap;var M,ui,Xc=class Xc{constructor(e,t=void 0,i=$c.INSTALLATION){d(this,M,void 0);d(this,ui,void 0);l(this,M,e),l(this,ui,t),this.scope=i,this.global=i===$c.INSTALLATION?new Xc(n(this,M),n(this,ui),$c.GLOBAL):this}get storage(){return n(this,ui)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},n(this,M));return new Kc(this.storage,t,n(this,M))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},n(this,M));return t!==null?t.value??void 0:t}async set(e,t,i){let s;return i?.expiration&&(s=Math.floor((i.expiration.getTime()-Date.now())/1e3),s<1&&(s=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:s||0,scope:this.scope},n(this,M))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},n(this,M))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},n(this,M))).value}async getRange(e,t,i){let s=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},n(this,M));return s!==null?s.value:s}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},n(this,M))).value}async strlen(e){return(await this.storage.Strlen({key:e,scope:this.scope},n(this,M))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},n(this,M))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},n(this,M))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},n(this,M))).value}async zRange(e,t,i,s){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return s?.reverse&&(o.rev=s.reverse),s?.by==="lex"?o.byLex=!0:s?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},n(this,M))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},n(this,M))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},n(this,M))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},n(this,M))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},n(this,M))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},n(this,M));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},n(this,M));return i!==null?i.value:i}async zIncrBy(e,t,i){let s=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},n(this,M));return s!==null?s.value:s}async mget(e){let t=await this.storage.MGet({keys:e,scope:this.scope},n(this,M));return t!==null?t.values.map(i=>i||null):t}async mset(e){let t=Object.entries(e).map(([i,s])=>({key:i,value:s}));await this.storage.MSet({kv:t,scope:this.scope},n(this,M))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},n(this,M));return t!==null?t.value:t}async zScan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,scope:this.scope};return await this.storage.ZScan(o,n(this,M))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},n(this,M));return t!==null?t.value:t}async hget(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},n(this,M));return i!==null?i.value??void 0:i}async hset(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},n(this,M))).value}async hgetall(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},n(this,M));return t!==null?t.fieldValues:t}async hdel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},n(this,M))).value}async hscan(e,t,i,s){let o={key:e,cursor:t,pattern:i,count:s,scope:this.scope};return await this.storage.HScan(o,n(this,M))}async hkeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},n(this,M));return t!==null?t.keys:t}async hincrby(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},n(this,M))).value}async hlen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};M=new WeakMap,ui=new WeakMap;var ci=Xc;var ur,mi=class{constructor(e){d(this,ur,void 0);l(this,ur,e)}async runJob(e){return(await u.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},n(this,ur))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},n(this,ur))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},n(this,ur))).actions.map(t=>(g(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};ur=new WeakMap;var us,pi=class{constructor(e){d(this,us,void 0);l(this,us,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},n(this,us));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...Fy(t.installationSettings.settings,u.installationSettings),...Fy(t.appSettings.settings,u.appSettings)}}};us=new WeakMap;function Fy(r,e){let t=Object.keys(r).reduce((i,s)=>(i[s]=Wc(r[s]),i),{});return e&&My(t,e),t}function My(r,e){for(let t of e)t.type==="group"?My(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as Zc,Form as M0,ToastAppearance as Ly}from"@devvit/protos";var cr,fi,Fd=class{constructor(e){d(this,cr,[]);d(this,fi,void 0);l(this,fi,e)}showForm(e,t){let i=u.formDefinitions.get(e);if(!i&&n(this,fi)){let a=n(this,fi).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let s=i.form instanceof Function?i.form(t??{}):i.form,o=M0.fromPartial({id:e,title:s.title,acceptLabel:s.acceptLabel,cancelLabel:s.cancelLabel,shortDescription:s.description});ar(s.fields),o.fields=ot(s.fields),n(this,cr).push({type:Zc.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?Ly.SUCCESS:Ly.NEUTRAL}:t={text:e},n(this,cr).push({type:Zc.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),n(this,cr).push({type:Zc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return n(this,cr)}};cr=new WeakMap,fi=new WeakMap;function Me({metadata:r,ui:e,hooks:t,reconciler:i}){let s=new oi(r),o=new ni(r),a=new ci(r),c=wy(a,i?i.state:{}),p=new li(r),f=new mi(r),v=new pi(r),m=e?new Fd(i):void 0,b=new si(r),y=new ii,C=new ai(r),w=t&&i?py(i):void 0,A=t&&i?my(i):void 0,F=t&&i?cy(i):void 0,de=t&&i?uy(i):void 0;return{modLog:s,kvStore:o,redis:a,reddit:p,scheduler:f,settings:v,media:b,assets:y,realtime:C,get useForm(){return F??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return w??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return A??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return de??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!m)throw new Error("ui client is not available");return m}}}var Uy={name:"@devvit/public-api",version:"0.11.0-dev",license:"BSD-3-Clause",repository:{type:"git",url:"https://developers.reddit.com/"},type:"module",exports:{".":"./dist/index.js","./package.json":"./package.json","./*":"./dist/*"},main:"./dist/index.js",files:["dist/**"],scripts:{build:"yarn build:icon-types && yarn build:semantic-colors && tsc && cp -af devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin","build:icon-types":"make-icons src/types/icons.ts","build:min":"esbuild --bundle --sourcemap=linked --target=es2020 --format=esm --metafile=dist/meta.min.json --outfile=dist/public-api.min.js --external:@devvit/protos --minify src/index.ts","build:semantic-colors":"node scripts/make-semantic-colors.js","build:types":"api-extractor run && sed -ne '/declare global {/,$ p' src/devvit/Devvit.ts >> dist/public-api.d.ts","build:unmin":"esbuild --bundle --sourcemap=inline --target=es2020 --format=iife --metafile=dist/meta.json --outfile=dist/public-api.iife.js --global-name=devvitPublicAPI src/index.ts",clean:"rm -rf .turbo api-extractor coverage dist src/devvit/internals/semanticColors.ts src/types/icons.ts || :",clobber:"yarn clean && rm -rf node_modules",dev:"tsc -w","dev:build":"chokidar ./src --command 'yarn build' --ignore './src/types/icons.ts' --ignore './src/devvit/internals/semanticColors.ts'",lint:"redlint .","lint:fix":"yarn lint --fix",prepublishOnly:"publish-package-json",test:"yarn test:unit && yarn test:types && yarn test:size","test:size":"filesize","test:types":"tsc --noEmit","test:unit":"vitest run","test:unit-with-coverage":"vitest run --coverage"},types:"./dist/index.d.ts",dependencies:{"@devvit/protos":"0.11.0-dev","@devvit/shared-types":"0.11.0-dev","base64-js":"1.5.1","clone-deep":"4.0.1","core-js":"3.27.2","lodash.isequal":"4.5.0"},devDependencies:{"@ampproject/filesize":"4.3.0","@devvit/eslint-config":"0.11.0-dev","@devvit/repo-tools":"0.11.0-dev","@devvit/tsconfig":"0.11.0-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"11.3.3","@types/clone-deep":"4.0.1","@types/core-js":"2.5.6","@types/lodash.isequal":"4.5.6","@vitest/coverage-c8":"0.32.0","chokidar-cli":"3.0.0",esbuild:"0.18.12",eslint:"8.9.0",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"255 KB"}},source:"./src/index.ts"};function oe(r,e,t){let i=r[B.Subreddit]?.values[0];g(i,"subreddit is missing from Context");let s=r[B.AppUser]?.values[0],o=r[B.User]?.values[0],a=U0(r);return{get appAccountId(){return g(s,"appAccountId is missing from Context"),s},subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:s,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}function U0(r){let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0},t={};for(let s in e)t[s.toLowerCase()]=s;let i={};for(let s of(r[B.Debug]?.values??[]).join().split(",")){let[o,a]=s.split("=");o&&(o=o.trim(),a=a?.trim(),o.toLowerCase()in t&&(o=t[o.toLowerCase()]),i[o]??(i[o]=a||`${!0}`))}return r[B.Debug]&&console.info(`[api] @devvit/public-api v${Uy.version} ${Object.entries(i).map(([s,o])=>`${s}=${o}`).join(" ")}`),{...i,metadata:r}}async function Md(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=B0.fromPartial({success:!0,errors:{}}),s=Ct(r.fieldValues),o=e.flatMap(a=>a.type==="group"?a.fields:a);return await Promise.all(o.map(async a=>{let c=a.name;if(c&&a.type!=="group"&&a.onValidate){let p=s[c],f=a.onValidate,v=Object.assign(Me({metadata:t}),oe(t)),m=await f({value:p,isEditing:r.editing},v);m&&(i.success=!1,i.errors[c]=m)}})),i}async function N0(){if(!u.appSettings)throw new Error("App settings were not defined.");return _0.fromPartial({fields:{fields:ot(u.appSettings)}})}async function q0(r,e){return Md(r,u.appSettings,e)}function By(r){r.provides(D0),L("GetAppSettingsFields",N0),L("ValidateAppForm",q0)}import{CustomPostDefinition as J0}from"@devvit/protos";import{BlockRenderEventType as cm,EffectType as tb}from"@devvit/protos";function gi(r){return r.__effects}function Dy(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as um,BlockAnimationDirection as $y,BlockAnimationLoopMode as Ky,BlockAnimationType as Xy,BlockAvatarBackground as Zy,BlockAvatarFacing as Yy,BlockAvatarSize as At,BlockBorderWidth as Bd,BlockButtonAppearance as Tt,BlockButtonSize as rm,BlockFullSnooSize as vi,BlockGap as Dd,BlockHorizontalAlignment as im,BlockIconSize as _d,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as nm,BlockSpacerSize as Nd,BlockStackDirection as sm,BlockTextOutline as om,BlockTextOverflow as am,BlockTextSize as yi,BlockTextStyle as dm,BlockTextWeight as Qy,BlockType as Le,BlockVerticalAlignment as lm}from"@devvit/protos";var Yc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var _y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ny=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),qy=r=>r in Yc,Qc=r=>r in _y,jy=r=>!!r.match(/^rgba?\(.*/),Hy=r=>!!r.match(/^hsla?\(.*/),Wy=(r,e="light")=>{if(Qc(r))return Ld(r);let i=Yc[r];return typeof i=="string"?i:i[e]},Ld=r=>_y[r]??r,Gy=r=>{let[e,t,i,s]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(s){let p=parseFloat(s),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as Ud}from"@devvit/protos";var em={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:Ud.UNRECOGNIZED,alignment:void 0}};function zy(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:s}=j0(r?.grow,e.direction,e.alignment),o=t?.height?.value?.value||t?.height?.min?.value||Vy(2,i,s,e.hasHeight),a=t?.width?.value?.value||t?.width?.min?.value||Vy(1,i,s,e.hasWidth);return{hasHeight:!!o,hasWidth:!!a}}function Vy(r,e,t,i){return e===r&&i||t===r&&i}function j0(r,e,t){let i=e===Ud.STACK_VERTICAL||e===Ud.UNRECOGNIZED,s=e===Ud.STACK_HORIZONTAL,o=0;s&&r?o=1:i&&r&&(o=2);let a=t===void 0||t.horizontal===void 0,c=t===void 0||t.vertical===void 0,p=s?!!c:i?!!a:!1,f=0;return s&&p?f=2:i&&p&&(f=1),{growDirection:o,stretchDirection:f}}import{BlockSizeUnit as mr,BlockStackDirection as Jy}from"@devvit/protos";function hi(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:mr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=mr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=mr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function H0(r,e){return(r.width?.value?.unit===mr.SIZE_UNIT_PERCENT||r.width?.min?.unit===mr.SIZE_UNIT_PERCENT)&&e.direction===Jy.STACK_HORIZONTAL&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===mr.SIZE_UNIT_PERCENT||r.height?.min?.unit===mr.SIZE_UNIT_PERCENT)&&e.direction===Jy.STACK_VERTICAL&&(e.hasHeight||(r.height=void 0)),r}function tm(r,e){if(r){let t=r.width!=null||r.minWidth!=null||r.maxWidth!=null,i=r.height!=null||r.minHeight!=null||r.maxHeight!=null;if(t||i||r.grow!=null){let s={width:t?{value:hi(r.width),min:hi(r.minWidth),max:hi(r.maxWidth)}:void 0,height:i?{value:hi(r.height),min:hi(r.minHeight),max:hi(r.maxHeight)}:void 0,grow:r.grow};return e.stackParentLayout&&(s=H0(s,e.stackParentLayout)),s}}}var eb="data-",W0=new Set(["onPress","onMessage"]),G0=new Map([["onPress",um.ACTION_CLICK],["onMessage",um.ACTION_WEBVIEW]]),fs,bi=class{constructor(e=()=>{}){d(this,fs,void 0);l(this,fs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let s=this.createBlocksElement({type:e,props:t,children:i},em);if(!s)throw new Error(`Could not create block of type ${e}`);return s}createBlocksElement({type:e,props:t,children:i},s){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,s,...i);case"vstack":return this.makeVStack(t,s,...i);case"zstack":return this.makeZStack(t,s,...i);case"text":return this.makeText(t,s,...i);case"button":return this.makeButton(t,s,...i);case"image":return this.makeImage(t,s);case"spacer":return this.makeSpacer(t,s);case"icon":return this.makeIcon(t,s);case"avatar":return this.makeAvatar(t,s);case"fullsnoo":return this.makeFullSnoo(t,s);case"animation":return this.makeAnimation(t,s);case"webview":return this.makeWebView(t,s);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ms.PADDING_NONE;case"xsmall":return ms.PADDING_XSMALL;case"small":return ms.PADDING_SMALL;case"medium":return ms.PADDING_MEDIUM;case"large":return ms.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ps.RADIUS_NONE;case"small":return ps.RADIUS_SMALL;case"medium":return ps.RADIUS_MEDIUM;case"large":return ps.RADIUS_LARGE;case"full":return ps.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return Dd.GAP_NONE;case"small":return Dd.GAP_SMALL;case"medium":return Dd.GAP_MEDIUM;case"large":return Dd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=lm.ALIGN_TOP:e.includes("middle")?t=lm.ALIGN_MIDDLE:e.includes("bottom")&&(t=lm.ALIGN_BOTTOM),e.includes("start")?i=im.ALIGN_START:e.includes("center")?i=im.ALIGN_CENTER:e.includes("end")&&(i=im.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,s){if(!e&&!t)return;let o;switch(e){case"none":o=Bd.BORDER_WIDTH_NONE;break;case"thin":o=Bd.BORDER_WIDTH_THIN;break;case"thick":o=Bd.BORDER_WIDTH_THICK;break;default:o=Bd.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",c=this.getThemedColors(a,i,s);return{width:o,color:c?.light,colors:c}}makeBlockTextSize(e){switch(e){case"xsmall":return yi.TEXT_SIZE_XSMALL;case"small":return yi.TEXT_SIZE_SMALL;case"medium":return yi.TEXT_SIZE_MEDIUM;case"large":return yi.TEXT_SIZE_LARGE;case"xlarge":return yi.TEXT_SIZE_XLARGE;case"xxlarge":return yi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return dm.TEXT_STYLE_BODY;case"metadata":return dm.TEXT_STYLE_METADATA;case"heading":return dm.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return om.TEXT_OUTLINE_NONE;case"thin":return om.TEXT_OUTLINE_THIN;case"thick":return om.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Qy.TEXT_WEIGHT_REGULAR;case"bold":return Qy.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return am.TEXT_OVERFLOW_CLIP;case"ellipsis":return am.TEXT_OVERFLOW_ELLIPSE}return am.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Tt.BUTTON_APPEARANCE_SECONDARY;case"primary":return Tt.BUTTON_APPEARANCE_PRIMARY;case"plain":return Tt.BUTTON_APPEARANCE_PLAIN;case"bordered":return Tt.BUTTON_APPEARANCE_BORDERED;case"media":return Tt.BUTTON_APPEARANCE_MEDIA;case"destructive":return Tt.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Tt.BUTTON_APPEARANCE_CAUTION;case"success":return Tt.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return rm.BUTTON_SIZE_SMALL;case"medium":return rm.BUTTON_SIZE_MEDIUM;case"large":return rm.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return cs.IMAGE_RESIZE_NONE;case"fit":return cs.IMAGE_RESIZE_FIT;case"fill":return cs.IMAGE_RESIZE_FILL;case"cover":return cs.IMAGE_RESIZE_COVER;case"scale-down":return cs.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return Nd.SPACER_XSMALL;case"small":return Nd.SPACER_SMALL;case"medium":return Nd.SPACER_MEDIUM;case"large":return Nd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return nm.SPACER_INVISIBLE;case"thin":return nm.SPACER_THIN;case"square":return nm.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return _d.ICON_SIZE_XSMALL;case"small":return _d.ICON_SIZE_SMALL;case"medium":return _d.ICON_SIZE_MEDIUM;case"large":return _d.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return At.AVATAR_SIZE_XXSMALL;case"xsmall":return At.AVATAR_SIZE_XSMALL;case"small":return At.AVATAR_SIZE_SMALL;case"medium":return At.AVATAR_SIZE_MEDIUM;case"large":return At.AVATAR_SIZE_LARGE;case"xlarge":return At.AVATAR_SIZE_XXLARGE;case"xxlarge":return At.AVATAR_SIZE_XXLARGE;case"xxxlarge":return At.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Yy.AVATAR_FACING_LEFT;case"right":return Yy.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return vi.FULLSNOO_XSMALL;case"small":return vi.FULLSNOO_SMALL;case"medium":return vi.FULLSNOO_MEDIUM;case"large":return vi.FULLSNOO_LARGE;case"xlarge":return vi.FULLSNOO_XLARGE;case"xxlarge":return vi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return Zy.AVATAR_BG_DARK;case"light":return Zy.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?Xy.ANIM_LOTTIE:Xy.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return $y.ANIM_DIR_BACKWARD;case"forward":return $y.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Ky.ANIM_LOOP_REPEAT;case"bounce":return Ky.ANIM_LOOP_BOUNCE}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(eb)).reduce((t,i)=>(t[i.substring(eb.length)]=e[i],t),{})}makeActions(e,t){let i=[],s=this.getDataSet(t);return W0.forEach(o=>{if(o in t){let a=t[o];i.push({type:G0.get(o)??um.UNRECOGNIZED,id:a.toString(),data:s})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),Ny(e)?e:qy(e)?Wy(e,t):Qc(e)?Ld(e):jy(e)?Gy(e):Hy(e)?e:(console.warn(`Could not parse color: ${e}.`),Ld("red"))}childrenToBlocks(e,t){return e.flatMap(i=>(typeof i!="string"?this.createBlocksElement(i,t):void 0)??[])}getThemedColors(e,t,i){let s=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!s||!o)){let c=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...c.map(p=>p[0]))}return s||(s=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),s||o?{light:s,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}resolveAssetUrl(e,t){return n(this,fs).call(this)?.getURL(e,t)??e}childrenToString(e){return e.map(t=>t.toString()).join("")}makeRoot(e,...t){return this.wrapRoot(e,this.childrenToBlocks(t,em))}wrapRoot(e,t){return this.makeBlock(Le.BLOCK_ROOT,{},{},{rootConfig:{children:t,height:this.makeRootHeight(u.customPostType?.height??e?.height??"regular")}})}makeStackBlock(e,t,i,s){let o=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor),a=this.makeBlockAlignment(t?.alignment),c=tm(t,i),p=zy(t,i.stackParentLayout,c);return this.makeBlock(Le.BLOCK_STACK,t,i,{stackConfig:{alignment:a,backgroundColor:o?.light,backgroundColors:o,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:this.childrenToBlocks(s,{stackParentLayout:{...p,direction:e,alignment:a}}),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}makeHStack(e,t,...i){return this.makeStackBlock(sm.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(sm.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(sm.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let s=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(Le.BLOCK_TEXT,e,t,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:s?.light,colors:s,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(i),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,t,...i){let s=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(Le.BLOCK_BUTTON,e,t,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(i),textColor:s?.light,textColors:s,disabled:e?.disabled}})}makeImage(e,t){return e&&this.makeBlock(Le.BLOCK_IMAGE,e,t,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:this.resolveAssetUrl(e.url),width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e,t){return this.makeBlock(Le.BLOCK_SPACER,e,t,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e,t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(Le.BLOCK_ICON,e,t,{iconConfig:{icon:e.name,color:i?.light,colors:i,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e,t){return e&&this.makeBlock(Le.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e,t){return e&&this.makeBlock(Le.BLOCK_FULLSNOO,e,t,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}makeAnimation(e,t){return e&&this.makeBlock(Le.BLOCK_ANIMATION,e,t,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:this.resolveAssetUrl(e.url),loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e,t){return e&&this.makeBlock(Le.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webview:!0}),state:e.state}})}makeBlock(e,t,i,s){return{type:e,sizes:tm(t,i),config:s,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t=e;if(t.type===Le.BLOCK_ROOT)return t.config?.rootConfig&&u.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t;let i=this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};fs=new WeakMap;function rb(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var ib=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=ib(i);return e+=`</${r.type}>`,e};function V0(r){return" ".repeat(r)}function z0(r){let e="",t=0,i=r.split(/>\s*</);for(let s=0;s<i.length;s++){let o=i[s];s===0&&(o=o.trim()),s===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=V0(t),s!==0&&(e+="<"),e+=o,s!==i.length-1&&(e+=`>
2
2
  `),!a&&o.indexOf("</")===-1&&o.charAt(o.length-1)!=="/"&&t++}return e}var qd,nb,pr,gs,hs,mm,vs,at=class{constructor(e,t,i,s,o){d(this,qd);d(this,pr);d(this,hs);this.renderState={};this.currentComponentKey=[];this.currentHookIndex=0;this.actions=new Map;this.forms=new Map;this.realtimeChannels=[];this.realtimeUpdated=!1;this.pendingHooks=[];this.isRendering=!1;this.transformer=new bi(()=>this.assets);this.effects=[];d(this,vs,!1);this.component=e,this.event=t,this.state={__renderState:{},...i},this.metadata=s,this.state.__realtimeChannels&&(this.realtimeChannels=this.state.__realtimeChannels);let a=Me({reconciler:this,hooks:!0,ui:!0,metadata:s});this.cache=a.cache,this.modLog=a.modLog,this.reddit=a.reddit,this.kvStore=a.kvStore,this.redis=a.redis,this.settings=a.settings,this.scheduler=a.scheduler,this.media=a.media,this.assets=a.assets,this.realtime=a.realtime,this.dimensions=o,this.ui=a.ui,this.hooks={useState:a.useState,useInterval:a.useInterval,useForm:a.useForm,useChannel:a.useChannel}}emitEffect(e,t){this.effects.push(t)}async render(){await this.reconcile(),this.isRendering=!0;let e=await this.buildBlocksUI();return this.isRendering=!1,e}makeUniqueActionID(e){let t=e,i=1;for(;this.actions.has(t);)t=`${e}.${i++}`;return t}async reconcile(){let e=S(this,pr,gs).call(this),t={type:this.component,props:e,children:[]},i=await this.processBlock(t);if(rb(i),this.transformer.createBlocksElementOrThrow(i),this.isUserActionRender&&this.blockRenderEventId){let s=this.actions.get(this.blockRenderEventId);s&&await s(this.event.data)}for(let s of this.pendingHooks)await s();this.buildNextState(),S(this,qd,nb).call(this)}async buildBlocksUI(){let e=S(this,pr,gs).call(this),t={type:this.component,props:e,children:[]},i=await this.renderElement(e,t);return this.transformer.ensureRootBlock(i)}async renderElement(e,t){let i=await this.processBlock(t);return rb(i),(u.debug.emitSnapshots||e.debug.emitSnapshots)&&console.debug(z0(ib(i))),(u.debug.emitState||e.debug.emitState)&&console.debug(JSON.stringify(this.state,void 0,2)),this.transformer.createBlocksElementOrThrow(i)}async processProps(e){let t=e.props??{},i=["onPress","onMessage"];for(let s of i)if(s in t){let o=t[s],a=o?.name,c=this.makeUniqueActionID(`${e.type}.${a??s}`);this.actions.set(c,o),t[s]=c}}async processBlock(e,t=Dy(),i=[]){let s=e;if(typeof s.type=="string"){let c=[];for(let m=0;m<s.children.length;m++){let b=s.children[m];b!=null&&c.push(await this.processBlock(b,t,[...i,`${s.type}.${m}`]))}let p=c.flat(),f=S(this,hs,mm).call(this,p);return await this.processProps(s),{type:s.type,props:s.props,children:f}}if(typeof s.type=="function"){let c=t(`${i.length?i.join("."):"root"}.${s.type.name.length?s.type.name:"anonymous"}`);this.currentComponentKey.push(c),this.renderState[c]||(this.renderState[c]={});let p=s.children.flatMap(m=>m),f={...S(this,pr,gs).call(this),...s.props,children:p},v;for(;v===void 0;)try{v=await s.type(f,S(this,pr,gs).call(this))}catch(m){if(m instanceof Promise)v=await m;else throw m}if(!this.isInitialRender){let m=this.getPreviousComponentState();if(Object.keys(m).length!==this.currentHookIndex)throw new Error("Invalid hook call. Hooks can only be called at the top-level of a function component. Make sure that you are not calling hooks inside loops, conditions, or nested functions.")}if(this.currentComponentKey.pop(),this.currentHookIndex=0,typeof v=="object")return this.processBlock(v,t,[...i,s.type.name])}if(typeof s=="string")return s;if(typeof s=="number")return`${s}`;let o=[],a="";return Array.isArray(s)?o=s:typeof s.type>"u"&&s.children&&(o=s.children,a="fragmentChild."),{type:"__fragment",props:void 0,children:await Promise.all(o.flatMap(async(c,p)=>await this.processBlock(c,t,[...i,`${a}${p}`])))}}getCurrentComponentKey(){if(!this.currentComponentKey.at(-1))throw new Error("Current component key is missing");return this.currentComponentKey}getCurrentComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.renderState[e]}getPreviousComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.state.__renderState[e]||(this.state.__renderState[e]={}),this.state.__renderState[e]}get isInitialRender(){return this.event?this.event.type===cm.RENDER_INITIAL:!1}get isUserActionRender(){return this.event?this.event.type===cm.RENDER_USER_ACTION:!1}get isEffectRender(){return this.event?this.event.type===cm.RENDER_EFFECT_EVENT:!1}get formSubmittedEvent(){return this.event?this.event.formSubmitted:!1}get blockRenderEventId(){return this.event?this.event.id:!1}get realtimeEvent(){if(!this.event)return!1;let e=this.event.realtimeEvent;return e?.event?.channel?e:!1}runHook(e){this.pendingHooks.push(e)}rerenderIn(e){n(this,vs)||(l(this,vs,!0),this.effects.push({type:tb.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:e/1e3}}))}addRealtimeChannel(e){this.realtimeChannels.push(e),this.realtimeUpdated=!0}removeRealtimeChannel(e){this.realtimeChannels=this.realtimeChannels.filter(t=>t!==e),this.realtimeUpdated=!0}get realtimeEffect(){return this.realtimeUpdated&&this.realtimeChannels.length>0?[{type:tb.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:this.realtimeChannels}}]:[]}getEffects(){return[...gi(this.ui),...this.effects,...this.realtimeEffect]}buildNextState(){for(let e of Object.keys(this.renderState))this.renderState[e]=Object.values(this.renderState[e]);this.state={__postData:this.state.__postData,__renderState:this.renderState,__cache:this.state.__cache,...this.realtimeChannels.length>0?{__realtimeChannels:this.realtimeChannels}:{}}}};qd=new WeakSet,nb=function(){this.actions.clear(),this.currentComponentKey=[],this.currentHookIndex=0,this.pendingHooks=[],this.realtimeChannels=[],this.realtimeUpdated=!1},pr=new WeakSet,gs=function(){let e={...oe(this.metadata,this.state.__postData?.thingId),modLog:this.modLog,reddit:this.reddit,cache:this.cache,kvStore:this.kvStore,redis:this.redis,settings:this.settings,scheduler:this.scheduler,media:this.media,assets:this.assets,realtime:this.realtime,ui:this.ui,dimensions:this.dimensions,uiEnvironment:{timezone:this.metadata[B.Timezone]?.values[0],locale:this.metadata[B.Language]?.values[0],dimensions:this.dimensions},...this.hooks};return e.debug.effects=this,e},hs=new WeakSet,mm=function(e){let t=[];for(let i of e)typeof i=="string"?t.push(i):i.type==="__fragment"?t.push(...S(this,hs,mm).call(this,i.children)):t.push(i);return t},vs=new WeakMap;async function $0(r,e){let t=u.customPostType;if(!t)throw new Error("Custom post type not registered");let i=new at((o,a)=>t.render(a),r.blocks,r.state,e,r.dimensions),s=await i.render();return{state:i.state,blocks:{ui:s},effects:i.getEffects()}}function sb(r){r.provides(J0),L("RenderPost",$0)}import{GetFieldsResponse as K0,InstallationSettingsDefinition as X0}from"@devvit/protos";async function Z0(){if(!u.installationSettings)throw new Error("Installation settings were not defined.");return K0.fromPartial({fields:{fields:ot(u.installationSettings)}})}async function Y0(r,e){return Md(r,u.installationSettings,e)}function ob(r){r.provides(X0),L("GetSettingsFields",Z0),L("ValidateForm",Y0)}import{ContextActionDefinition as Q0,ContextActionDescription as eE,ContextActionResponse as tE}from"@devvit/protos";var ab=r=>`menuItem.${r}`;function pm(r){return u.menuItems.find((e,t)=>ab(t)===r)}async function rE(r,e){let t=u.menuItems;if(!t.length)throw new Error("No menu items registered.");return{actions:t.map((s,o)=>eE.fromPartial({actionId:ab(o),name:s.label,description:s.description,contexts:{subreddit:s.location.includes("subreddit"),post:s.location.includes("post"),comment:s.location.includes("comment")},users:{loggedOut:s.forUserType?.includes("loggedOut"),member:s.forUserType?.includes("member"),moderator:s.forUserType?.includes("moderator")},postFilters:s.postFilter==="currentApp"?{currentApp:!0}:void 0}))}}async function iE(r,e){let t=pm(r.actionId);if(!t)throw new Error(`MenuItem ${r.actionId} not found`);let i=r.comment?.id&&`t1_${r.comment.id}`,s=r.post?.id&&`t3_${r.post.id}`,o=r.subreddit?.id&&`t5_${r.subreddit.id}`,a=i||s||o;g(a,"targetId is missing from ContextActionRequest");let c={targetId:a,location:r.comment?"comment":r.post?"post":"subreddit"},p=Object.assign(Me({ui:!0,metadata:e}),oe(e,s,i),{uiEnvironment:{timezone:e[B.Timezone]?.values[0],locale:e[B.Language]?.values[0]}});return await t.onPress(c,p),tE.fromPartial({effects:gi(p.ui)})}function db(r){r.provides(Q0),L("GetActions",rE),L("OnAction",iE)}function dt(r){return r?r===!0?!0:r.enabled:!1}import{SchedulerHandlerDefinition as nE}from"@devvit/protos";async function sE(r,e){let t=r.type,i=u.scheduledJobHandlers.get(t);if(!i)throw new Error(`Job ${t} not found`);let s={name:t,data:r.data},o=Object.assign(Me({metadata:e}),oe(e));await i(s,o)}function lb(r){r.provides(nE),L("HandleScheduledAction",sE)}import{HandlerResult as oE,OnAppInstallDefinition as aE,OnAppUpgradeDefinition as dE,OnCommentCreateDefinition as lE,OnCommentDeleteDefinition as uE,OnCommentReportDefinition as cE,OnCommentSubmitDefinition as mE,OnCommentUpdateDefinition as pE,OnModActionDefinition as fE,OnModMailDefinition as gE,OnPostCreateDefinition as hE,OnPostDeleteDefinition as vE,OnPostFlairUpdateDefinition as yE,OnPostReportDefinition as bE,OnPostSubmitDefinition as kE,OnPostUpdateDefinition as SE,OnPostNsfwUpdateDefinition as PE,OnPostSpoilerUpdateDefinition as CE}from"@devvit/protos";var jd;(function(r){function e(o,a){return o.length<=a?o:`${o.slice(0,a-1)}\u2026`}r.ellipsize=e;function t(o){return o[0]==null?o:`${o[0].toLocaleUpperCase()}${o.slice(1)}`}r.capitalize=t;function i(o){return o==null||/^\s*$/.test(o)}r.isBlank=i;function s(o){return o instanceof Error?`${o.stack||o.message||o.name}`:String(o)}r.caughtToString=s})(jd||(jd={}));function K(r,e){return g(e),async(t,i)=>{let s={...t,type:r},o=Object.assign(Me({metadata:i}),oe(i)),a=await Promise.allSettled(e.map(p=>p(s,o))),c=IE(a);if(c)throw c.err;return oE.fromPartial({})}}function ub(r){for(let e of u.triggerOnEventHandlers.keys())switch(e){case"PostSubmit":r.provides(kE),L("OnPostSubmit",K("PostSubmit",u.triggerOnEventHandlers.get(e)));break;case"PostCreate":r.provides(hE),L("OnPostCreate",K("PostCreate",u.triggerOnEventHandlers.get(e)));break;case"PostUpdate":r.provides(SE),L("OnPostUpdate",K("PostUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostReport":r.provides(bE),L("OnPostReport",K("PostReport",u.triggerOnEventHandlers.get(e)));break;case"PostDelete":r.provides(vE),L("OnPostDelete",K("PostDelete",u.triggerOnEventHandlers.get(e)));break;case"PostFlairUpdate":r.provides(yE),L("OnPostFlairUpdate",K("PostFlairUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentSubmit":r.provides(mE),L("OnCommentSubmit",K("CommentSubmit",u.triggerOnEventHandlers.get(e)));break;case"CommentCreate":r.provides(lE),L("OnCommentCreate",K("CommentCreate",u.triggerOnEventHandlers.get(e)));break;case"CommentUpdate":r.provides(pE),L("OnCommentUpdate",K("CommentUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentReport":r.provides(cE),L("OnCommentReport",K("CommentReport",u.triggerOnEventHandlers.get(e)));break;case"CommentDelete":r.provides(uE),L("OnCommentDelete",K("CommentDelete",u.triggerOnEventHandlers.get(e)));break;case"AppInstall":r.provides(aE),L("OnAppInstall",K("AppInstall",u.triggerOnEventHandlers.get(e)));break;case"AppUpgrade":r.provides(dE),L("OnAppUpgrade",K("AppUpgrade",u.triggerOnEventHandlers.get(e)));break;case"ModAction":r.provides(fE),L("OnModAction",K("ModAction",u.triggerOnEventHandlers.get(e)));break;case"ModMail":r.provides(gE),L("OnModMail",K("ModMail",u.triggerOnEventHandlers.get(e)));break;case"PostNsfwUpdate":r.provides(PE),L("OnPostNsfwUpdate",K("PostNsfwUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostSpoilerUpdate":r.provides(CE),L("OnPostSpoilerUpdate",K("PostSpoilerUpdate",u.triggerOnEventHandlers.get(e)));break;default:throw new Error(`Unknown trigger event: ${e}`)}}function IE(r){let e=r.reduce((t,i)=>i.status==="rejected"?[...t,i.reason]:t,[]);if(e.length!==0)return e.length===1?{err:e[0]}:{err:new Error(e.map(t=>jd.caughtToString(t)).join(`
3
3
  `))}}var ik=Bn(Pb(),1),nk=Bn(Am(),1);import{EffectType as CO,UIEventHandlerDefinition as IO}from"@devvit/protos";async function wO(r,e){let t=r.state??{},i=(0,ik.default)(t),s=Me({ui:!0,metadata:e});if(r.event?.formSubmitted&&r.event.formSubmitted.formId){let p=r.event.formSubmitted.formId;if(p.includes("form.hook.")&&u.customPostType){let y=new at((C,w)=>u.customPostType?.render(w)??null,r.event,r.state,e,void 0);return await y.reconcile(),{state:y.state,effects:y.getEffects()}}let f=u.formDefinitions.get(p);if(!f)throw new Error(`Form with key ${p} not found`);let v,m;if(i.__contextAction){let{actionId:y,thingId:C}=i.__contextAction,w=pm(y);w?.location==="post"?v=C:w?.location==="comment"&&(m=C)}let b=Object.assign(s,oe(e,v,m),{uiEnvironment:{timezone:e[B.Timezone]?.values[0],locale:e[B.Language]?.values[0]}});await f.onSubmit({values:Ct(r.event.formSubmitted.results)},b)}else if(r.event?.realtimeEvent){if(u.customPostType){let p=new at((f,v)=>u.customPostType?.render(v)??null,r.event,r.state,e,void 0);return await p.reconcile(),{state:p.state,effects:p.getEffects()}}}else if(r.event?.toastAction)throw new Error("Toast actions not yet implemented");let o=!(0,nk.default)(t,i),a=gi(s.ui),c=o?[...a,{type:CO.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:0}}]:a;return{state:i,effects:c}}function sk(r){r.provides(IO),L("HandleUIEvent",wO)}import{CustomPostDefinition as Ak}from"@devvit/protos";import{EffectType as Rm,Form as AO,ToastAppearance as dk}from"@devvit/protos";function ok(r){let e=r.match(/form\.hook\.(.+)\.0/);if(e?.[1])return e[1]}var Tm=class{constructor(e,t,i){this.state=null;this.hookId=e.hookId,this.form=t,this.onSubmit=i,this.onUIEvent=async s=>{s.formSubmitted&&await i(Ct(s.formSubmitted.results))}}};function Em(r,e){let t=Ve({namespace:"useForm"},i=>new Tm(i,r,e));return xO({id:t.hookId})}function xO(r){return`form.hook.${r.id}.0`}function ak(r,e){let t=ok(e);return r.getHook({id:t})}var Ot,Qd=class{constructor(e){d(this,Ot,void 0);l(this,Ot,e)}showForm(e,t){let i=ak(n(this,Ot),e);if(!i)throw new Error("Form does not exist. Make sure you have added it using useForm.");let s=i.form instanceof Function?i.form(t??{}):i.form,o=AO.fromPartial({id:e,title:s.title,acceptLabel:s.acceptLabel,cancelLabel:s.cancelLabel,shortDescription:s.description});ar(s.fields),o.fields=ot(s.fields),n(this,Ot).emitEffect(e,{type:Rm.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?dk.SUCCESS:dk.NEUTRAL}:t={text:e},n(this,Ot).emitEffect(e.toString(),{type:Rm.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),n(this,Ot).emitEffect(t,{type:Rm.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}};Ot=new WeakMap;import{EffectType as TO,RealtimeSubscriptionStatus as lk}from"@devvit/protos";var Ft,Qe,Mt,yr,Cs,Fm,el=class el{constructor(e,t){d(this,Cs);d(this,Ft,void 0);d(this,Qe,void 0);d(this,Mt,void 0);d(this,yr,void 0);l(this,Ft,t.context),l(this,Qe,!!t.context._devvitContext?.debug.realtime),l(this,yr,e),l(this,Mt,t.invalidate);let i=t.context.meta[B.App]?.values[0];if(!i)throw Error("useChannel missing app ID metadata");let s=t.context.meta[B.Installation]?.values[0];if(!s)throw Error("useChannel missing install ID from metadata");let o=`${i}:${s}:${e.name}`;if(Object.values(n(this,Ft).hooks).filter(c=>c instanceof el).some(c=>c.state.channel===o))throw Error(`useChannel channel names must be unique; "${o}" duplicated`);this.state={channel:o,connected:!1,subscribed:!1}}async onUIEvent(e){let t=e.realtimeEvent;if(!(!t||!this.state.subscribed))switch(t.status){case lk.REALTIME_SUBSCRIBED:n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" connected`),this.state.connected=!0,n(this,Mt).call(this),await n(this,yr).onSubscribed?.();break;case lk.REALTIME_UNSUBSCRIBED:n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" disconnected`),this.state.connected=!1,n(this,Mt).call(this),await n(this,yr).onUnsubscribed?.();break;default:n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" received message: ${JSON.stringify(e,void 0,2)}`),n(this,yr).onMessage(t.event?.data??{});break}}async send(e){if(n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" send message: ${JSON.stringify(e,void 0,2)}`),!this.state.subscribed||!this.state.connected)throw console.debug(`[realtime] "${this.state.channel}" send failed; channel not connected`),Error(`useChannel send failed; "${this.state.channel}" channel not connected`);await n(this,Ft).devvitContext.realtime.send(this.state.channel,e)}get status(){return this.state.subscribed&&this.state.connected?2:this.state.subscribed&&!this.state.connected?1:!this.state.subscribed&&this.state.connected?3:4}subscribe(){this.state.subscribed||(n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" subscribed`),this.state.subscribed=!0,n(this,Mt).call(this),S(this,Cs,Fm).call(this))}unsubscribe(){this.state.subscribed&&(n(this,Qe)&&console.debug(`[realtime] "${this.state.channel}" unsubscribed`),this.state.subscribed=!1,n(this,Mt).call(this),S(this,Cs,Fm).call(this))}};Ft=new WeakMap,Qe=new WeakMap,Mt=new WeakMap,yr=new WeakMap,Cs=new WeakSet,Fm=function(){let e=Object.values(n(this,Ft).hooks).filter(t=>t instanceof el&&t.state.subscribed).map(t=>t.state.channel);n(this,Ft).emitEffect(this.state.channel,{type:TO.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:e}})};var Om=el;function Mm(r){if(!r.name||/[^a-zA-Z0-9_]/.test(r.name))throw Error(`useChannel error: The name "${r.name}" you provided for the hook is invalid. Valid names can only contain letters, numbers, and underscores (_).`);let e=`useChannel:${r.name}`;return Ve({id:e,namespace:e},t=>new Om(r,t))}import{EffectType as Lm}from"@devvit/protos";function uk(r){return typeof r=="object"&&r!==null&&"__deleted"in r}var br,Ci=class Ci{constructor(e,t){d(this,br,void 0);this._segments=[];this._hooks={};this._prevHookId="";this._effects={};this._changed={};this._touched={};this._requeueEvents=[];this._rootProps={};this._generated={};this._undeliveredHandlers={};this.request=e,this.meta=t,l(this,br,e.state??{__cache:{}}),this._rootProps=e.props??{}}get devvitContext(){if(!this._devvitContext)throw new Error("Devvit context not available");return this._devvitContext}set devvitContext(e){this._devvitContext=e}get _changedState(){let e={__cache:n(this,br).__cache??{}};for(let i in this._changed)e[i]=this._state[i];let t=new Set(Object.keys(this._state));return Object.keys(this._hooks).forEach(i=>{i!=="__cache"&&t.delete(i)}),t.forEach(i=>{if(i==="__cache")return;let s={__deleted:!0};this._state[i]=e[i]=s}),e}get hooks(){return this._hooks}get _state(){return n(this,br)}set _state(e){this._changed={},this._hooks={},l(this,br,e)}push(e){this._segments.push({...e,next:0})}pop(){this._segments.pop()}addUndeliveredEventHandler(e,t){this._undeliveredHandlers[e]=t}addGlobalUndeliveredEventHandler(e,t){Ci.addGlobalUndeliveredEventHandler(e,t)}getHook(e){return this._hooks[e.id]}static addGlobalUndeliveredEventHandler(e,t){Ci._staticUndeliveredHandlers[e]=t}async handleUndeliveredEvent(e){let t={...Ci._staticUndeliveredHandlers,...this._undeliveredHandlers};for(let[i,s]of Object.entries(t))await s(e,this)}emitEffect(e,t){this._effects[e]=t}addToRequeueEvents(...e){this._devvitContext?.debug.blocks&&console.debug("[blocks] requeueing events",e);let t=e.reduce((i,s)=>(s.retry?i.retry.push(s):i.normal.push(s),i),{retry:[],normal:[]});this._requeueEvents=[...t.retry,...this._requeueEvents,...t.normal]}get effects(){return Object.values(this._effects)}nextHookId(e){e.key===void 0&&(e.key=this._segments[this._segments.length-1].next+++""),this.push(e);try{let t=[];for(let s=this._segments.length-1;s>=0;s--){let o=this._segments[s];if(o.id){t.unshift(o.id);break}let a=[];o.namespace&&a.push(o.namespace),o.key!==void 0&&o.key!==!1&&a.push(o.key),t.unshift(a.join("-"))}let i=t.join(".");if(this._generated[i]&&!e.shared)throw new Error(`Hook id ${i} already used, cannot register another hook with the same id`);return this._generated[i]=!0,this._prevHookId=i,i}finally{this.pop()}}};br=new WeakMap,Ci._staticUndeliveredHandlers={};var Ii=Ci;var Lt={};Ii.addGlobalUndeliveredEventHandler("intervals",async(r,e)=>{r.timer&&r.hook&&(delete Lt[r.hook],e.emitEffect("timers",{type:Lm.EFFECT_SET_INTERVALS,interval:{intervals:Lt}}))});var Ut,wi,Is,xi,Um=class{constructor(e,t,i){d(this,Ut,void 0);d(this,wi,void 0);d(this,Is,void 0);d(this,xi,void 0);this.state={duration:{seconds:0,nanos:0},running:!1};l(this,wi,i.invalidate),l(this,Ut,i.hookId),l(this,Is,e),l(this,xi,i.context);let s=Math.floor(t/1e3),o=t%1e3*1e6;this.state.duration={seconds:s,nanos:o}}onStateLoaded(){this.state.running?Lt[n(this,Ut)]={duration:this.state.duration}:delete Lt[n(this,Ut)]}async onUIEvent(e){await n(this,Is).call(this)}start(){Lt[n(this,Ut)]={duration:this.state.duration},this.state.running=!0,n(this,wi).call(this),n(this,xi).emitEffect("timers",{type:Lm.EFFECT_SET_INTERVALS,interval:{intervals:Lt}})}stop(){delete Lt[n(this,Ut)],this.state.running=!1,n(this,wi).call(this),n(this,xi).emitEffect("timers",{type:Lm.EFFECT_SET_INTERVALS,interval:{intervals:Lt}})}};Ut=new WeakMap,wi=new WeakMap,Is=new WeakMap,xi=new WeakMap;function Bm(r,e){let t=Ve({namespace:"useInterval"},i=>new Um(r,e,i));return{start:()=>t.start(),stop:()=>t.stop()}}var kr=class extends Error{};var ct,ws,Sr,Ai,Pr,Dm=class{constructor(e,t){this.state={value:null,load_state:"initial"};d(this,ct,void 0);d(this,ws,void 0);d(this,Sr,void 0);d(this,Ai,void 0);d(this,Pr,void 0);l(this,Sr,e),l(this,Ai,t.hookId),l(this,ct,t.invalidate),l(this,ws,t.context)}async onUIEvent(){if(this.state.load_state==="loading"&&n(this,Pr)){try{this.state.value=await n(this,Pr),this.state.load_state="loaded"}catch(e){this.state.load_state="error",console.error("Error loading async state: ",e)}n(this,ct).call(this)}else console.warn("Invalid state: ",this.state.load_state,n(this,Pr))}setter(e){this.state.value=e instanceof Function?e(this.state.value):e,this.state.load_state="loaded",n(this,ct).call(this)}onStateLoaded(){if(this.state.load_state==="loading")throw new kr;if(this.state.load_state==="initial"){let e;try{e=n(this,Sr)instanceof Function?n(this,Sr).call(this):n(this,Sr)}catch(t){console.log("error in loading async",t),this.state.load_state="error",n(this,ct).call(this);return}if(e instanceof Promise){l(this,Pr,e),this.state.load_state="loading";let t={asyncRequest:{requestId:n(this,Ai)},hook:n(this,Ai)};throw n(this,ws).addToRequeueEvents(t),n(this,ct).call(this),new kr}else this.state.value=e,this.state.load_state="loaded";n(this,ct).call(this)}}};ct=new WeakMap,ws=new WeakMap,Sr=new WeakMap,Ai=new WeakMap,Pr=new WeakMap;function _m(r){let e=Ve({namespace:"useState"},t=>new Dm(r,t));return[e.state.value,e.setter.bind(e)]}var Hm={now(){return new Date}};function ck(r){return`__autocache__${r}`}function mk(r){return`__lock__${r}`}var EO=300,RO=1e3,tl=5e3,Nm=3,pk=.1,fk=1e3,OO=3e4;function gk(r){if(r.error)throw new Error(r.error);return r.value}var Bt,Dt,Ue,Ti,il,hk,nl,vk,sl,yk,xs,qm,ol,bk,al,kk,As,jm,dl,Sk,rl=class{constructor(e,t,i=Hm){d(this,il);d(this,nl);d(this,sl);d(this,xs);d(this,ol);d(this,al);d(this,As);d(this,dl);d(this,Bt,void 0);d(this,Dt,{});d(this,Ue,void 0);d(this,Ti,void 0);l(this,Bt,e),l(this,Ti,t),l(this,Ue,i)}async cache(e,t){var a;(a=n(this,Ti)).__cache??(a.__cache={}),l(this,Dt,n(this,Ti).__cache),S(this,dl,Sk).call(this,t);let i=S(this,il,hk).call(this,t.key);if(i!==void 0)return i;let s=await S(this,As,jm).call(this,t.key),o=await S(this,nl,vk).call(this,t,s,e);return gk(o)}};Bt=new WeakMap,Dt=new WeakMap,Ue=new WeakMap,Ti=new WeakMap,il=new WeakSet,hk=function(e){let t=n(this,Dt)[e];if(t){let i=n(this,Ue).now().getTime(),s=t?.error&&t?.errorTime&&t.errorCount<Nm&&Math.random()<pk&&t.errorTime+fk<i;if(t?.expires&&t.expires<i&&t.checkedAt+fk<i||s){delete n(this,Dt)[e];return}else return gk(t)}},nl=new WeakSet,vk=async function(e,t,i){let s=t?.expires,o=s?S(this,al,kk).call(this,s):1;return!t||t?.error&&t.errorCount<Nm&&pk>Math.random()||o>Math.random()?S(this,sl,yk).call(this,e,t,i):t},sl=new WeakSet,yk=async function(e,t,i){let s=mk(e.key),o=n(this,Ue).now().getTime(),a=new Date(o+e.ttl/2);if(await n(this,Bt).set(s,"1",{expiration:a,nx:!0}))return S(this,ol,bk).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=n(this,Ue).now();return S(this,xs,qm).call(this,p,e.key,e.ttl)}},xs=new WeakSet,qm=async function(e,t,i){let s=Math.min(i,RO),o=await S(this,As,jm).call(this,t);if(o)return o;if(n(this,Ue).now().getTime()-e.getTime()>=s)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,EO)),S(this,xs,qm).call(this,e,t,i)},ol=new WeakSet,bk=async function(e,t,i,s){let o=n(this,Ue).now().getTime()+s;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=n(this,Ue).now().getTime(),t.errorCount++}return n(this,Dt)[e]=t,await n(this,Bt).set(ck(e),JSON.stringify(t),{expiration:new Date(o+OO)}),t.error&&t.errorCount<Nm&&await n(this,Bt).del(mk(e)),t},al=new WeakSet,kk=function(e){let t=n(this,Ue).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},As=new WeakSet,jm=async function(e){let t=await n(this,Bt).get(ck(e));if(t){let i=JSON.parse(t);return i.checkedAt=n(this,Ue).now().getTime(),n(this,Dt)[e]=i,i}},dl=new WeakSet,Sk=function(e){e.ttl<tl&&(console.warn(`Cache TTL cannot be less than ${tl} milliseconds! Updating ttl value of ${e.ttl} to ${tl}.`),e.ttl=tl)};function Pk(r,e,t=Hm){let i=new rl(r,e,t);return i.cache.bind(i)}var ll=class{buildContext(e,t,i){let s=new oi(i),o=new ni(i),a=new ci(i),c=new li(i),p=new mi(i),f=new pi(i),v=new Qd(e),m=new si(i),b=new ii,y=new ai(i),C=Pk(a,e._state),w={modLog:s,kvStore:o,redis:a,reddit:c,scheduler:p,settings:f,media:m,assets:b,realtime:y,ui:v,useState:_m,useChannel:Mm,useInterval:Bm,useForm:Em,cache:C,dimensions:t.env?.dimensions,uiEnvironment:{timezone:i[B.Timezone]?.values[0],locale:i[B.Language]?.values[0],dimensions:t.env?.dimensions}},A=oe(i,t.props?.postId);return A.debug.effects=e,{...A,...w}}};var he=null;function Ck(r){return JSON.parse(JSON.stringify(r))}function FO(r){if(!(r!==""&&!/[-.]/.test(r)))throw new Error(`Hook with namespace '${r}' is invalid. Hook namespaces cannot be empty string or contain dashes/dots because they are used as delimiters internally. Please update the hook namespace and try again.`)}function MO(r){return r.blocking||r.resize?!1:!r.hook}function Ve(r,e){if(!he)throw new Error("Hooks can only be declared at the top of a component. You cannot declare hooks outside of components or inside of event handlers. It's almost always a mistake to declare hooks inside of loops or conditionals.");FO(r.namespace);let t=he.nextHookId(r),i=he;i._touched[t]=!0;let s={hookId:t,invalidate:()=>{i._changed[t]=!0,i._state[t]=i?._hooks[t]?.state},context:he},o=he._state[t]===void 0||uk(he._state[t]);he._hooks[t]=he._hooks[t]??e(s);let a=he._hooks[t];return o||(a.state=he._state[t]),a.onStateLoaded?.(),o&&a.state!==void 0&&a.state!==null&&s.invalidate(),a}var LO=null,Ei,pl,Ts,re,ve,Ri,ul,fl,Ik,Es,Wm,gl,wk,Rs,Gm,Os,Vm,Oi,cl,Fs,zm,hl,xk,ml=class{constructor(e){d(this,re);d(this,Ri);d(this,fl);d(this,Es);d(this,gl);d(this,Rs);d(this,Os);d(this,Oi);d(this,Fs);d(this,hl);d(this,Ei,void 0);d(this,pl,new ll);d(this,Ts,new bi(()=>this._latestRenderContext?.devvitContext?.assets));this._latestRenderContext=null;n(this,re,ve)&&console.debug("[blocks] BlocksHandler v1"),l(this,Ei,e),LO=this}async handle(e,t){let i=new Ii(e,t),s=n(this,pl).buildContext(i,e,t);i.devvitContext=s;let o,a=e.events,p=!e.events?.length||a.some(y=>!y.async),f=a.some(y=>y.blocking),v,m,b=[...a];for(a.length===0&&a.push({}),n(this,re,ve)&&console.debug("[blocks] starting processing events");a.length>0;){n(this,re,ve)&&console.debug("[blocks] processing events loop iteration",a.length);let y=[];if(!a[0].async)y.push(a.shift());else for(;a[0]?.async;)y.push(a.shift());if(!y.length)throw Error("batch must have at least one event");try{if(y[0].async){let w=Ck(i._state);await S(this,fl,Ik).call(this,i,...y),i._state=w}else await S(this,gl,wk).call(this,i,...y)}catch(w){if(n(this,re,ve)&&console.debug("[blocks] caught in handler",w),i._latestRenderContent=void 0,m){i._state=m._state,i._changed=v,i._effects=m._effects;let A=b.map(F=>{let de={...F};return de.retry=!0,de});i.addToRequeueEvents(...A);break}else throw console.error("[blocks] unhandled error in handler",w),w}n(this,re,ve)&&console.debug("[blocks] remaining events",i._requeueEvents);let C=[];for(let w of i._requeueEvents){if(!p&&!w.async){n(this,re,ve)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch A",w),C.push(w);continue}if(p&&w.async&&!f){n(this,re,ve)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch B",w),C.push(w);continue}n(this,re,ve)&&console.debug("[blocks] reprocessing event in BlocksHandler",w),a.push(w)}i._requeueEvents=C,a.length>0&&(v={...i._changed},m={_state:Ck(i._state),_effects:{...i._effects}},b=[...a])}if(p){i._latestRenderContent||(i._latestRenderContent=S(this,Rs,Gm).call(this,n(this,Ei),i.request.props??{},i));let y=i._latestRenderContent;y&&(o=n(this,Ts).createBlocksElementOrThrow(y),o=n(this,Ts).ensureRootBlock(o))}return{state:i._changedState,effects:i.effects,blocks:o,events:i._requeueEvents}}};Ei=new WeakMap,pl=new WeakMap,Ts=new WeakMap,re=new WeakSet,ve=function(){return!!this._latestRenderContext?.devvitContext.debug.blocks},Ri=new WeakSet,ul=function(e,...t){e._touched={},S(this,Rs,Gm).call(this,n(this,Ei),e.request.props??{},e);for(let i in e._hooks)e._touched[i]||delete e._hooks[i]},fl=new WeakSet,Ik=async function(e,...t){S(this,Ri,ul).call(this,e,...t),await Promise.all(t.map(async i=>{if(!i.async)throw new Error("You can't mix main and other queues in one batch. This is likely a platform bug. Please file an issue in the Discord for someone to help! https://discord.com/channels/1050224141732687912/1115441897079574620");await S(this,Es,Wm).call(this,e,i)}))},Es=new WeakSet,Wm=async function(e,t){MO(t)&&console.warn("Received an event in #attemptHook that does not have an associated hook. This will cause the event to be undelivered and may cause bugs. Make sure that event passes a hook field. Event:",{event:t});let i=e._hooks[t.hook];if(i?.onUIEvent)try{await i.onUIEvent(t,e)}catch(s){throw console.error("Error in event handler",s),s}else await e.handleUndeliveredEvent(t)},gl=new WeakSet,wk=async function(e,...t){for(let i of t)n(this,re,ve)&&console.log("[blocks] handling main queue event",i),n(this,re,ve)&&console.log("[blocks] before",e._state),S(this,Ri,ul).call(this,e,i),await S(this,Es,Wm).call(this,e,i),n(this,re,ve)&&console.log("[blocks] after",e._state);S(this,Ri,ul).call(this,e)},Rs=new WeakSet,Gm=function(e,t,i){n(this,re,ve)&&console.debug("[blocks] renderRoot"),i._generated={},he=i,this._latestRenderContext=i;try{let s=S(this,Os,Vm).call(this,e,t,i);if(s.length!==1)throw new Error(`There can only be one root element, received: ${s.length}. Please wrap these elements in a <vstack></vstack> or <hstack></hstack> to continue. Fragments cannot be used as a root element.`);let o=s[0];if(o==="[object Promise]")throw new Error('Root elements cannot be asynchronous. To use data from an async endpoint, please use "const [data] = context.useState(async () => {/** your async code */})".');if(typeof o=="string")throw new Error("The root element must return a valid block, not a string. Try wrapping the element in a <text>your content</text> tag to continue.");return i._latestRenderContent=o,o}catch(s){if(s instanceof kr)return;throw s}finally{he=null}},Os=new WeakSet,Vm=function(e,t,i){i.push({namespace:e.name||"anonymous",...t});try{let s=e(t,i.devvitContext);return S(this,Fs,zm).call(this,s,i)}finally{i.pop()}},Oi=new WeakSet,cl=function(e,t){return e=e.flat(1/0),e.flatMap((i,s)=>(i&&typeof i=="object"&&"props"in i&&(i.props?.key||(i.props=i.props??{},i.props.key=`${s}`)),S(this,Fs,zm).call(this,i,t)))},Fs=new WeakSet,zm=function(e,t){if(Array.isArray(e))return S(this,Oi,cl).call(this,e,t);if(UO(e))if(e.type===void 0){t.push({namespace:"fragment",...e.props});let i=S(this,Oi,cl).call(this,e.children,t);return t.pop(),i}else if(typeof e.type=="function"){let i={...e.props,children:e.children};return S(this,Os,Vm).call(this,e.type,i,t)}else{t.push({namespace:e.type,...e.props});let i=S(this,Oi,cl).call(this,e.children,t),s=S(this,hl,xk).call(this,e.props??{});return t.pop(),[{type:e.type,children:i,props:s}]}else return[(e??"").toString()]},hl=new WeakSet,xk=function(e){let t={};for(let i in e)if(!(typeof e[i]>"u"))if(typeof e[i]=="function"){let s=Ve({namespace:i,key:!1},({hookId:o})=>({hookId:o,state:null,onUIEvent:e[i]}));t[i]=s.hookId,"captureHookRef"in e[i]&&e[i].captureHookRef()}else{let s=JSON.parse(JSON.stringify(e[i]));s!=null&&(t[i]=s)}return t};function UO(r){return typeof r=="object"&&r!=null&&"type"in r}var BO=[[Ak,Ak.methods.renderPostContent,(r,e)=>u.customPostType?.render(e)??null]];function DO(r){return async(e,t)=>new ml(r).handle(e,t)}function Tk(r){for(let[e,t,i]of BO)r.provides(e),L(t.name,DO(i))}var Fi,Ms,Mi,Cr,Ir,Li,Ui,wr,_t,Ls,Us,xr,_,U=class U extends bd{static configure(e){l(this,Mi,{...n(this,Mi),...e}),dt(e.http)&&this.use(P.HTTPDefinition),(dt(e.kvStore)||dt(e.redis))&&(this.use(P.KVStoreDefinition),this.use(P.RedisAPIDefinition)),dt(e.media)&&this.use(P.MediaServiceDefinition),dt(e.modLog)&&this.use(P.ModlogDefinition),dt(e.redditAPI)&&(this.use(P.FlairDefinition),this.use(P.GraphQLDefinition),this.use(P.LinksAndCommentsDefinition),this.use(P.ListingsDefinition),this.use(P.ModerationDefinition),this.use(P.ModNoteDefinition),this.use(P.NewModmailDefinition),this.use(P.PrivateMessagesDefinition),this.use(P.SubredditsDefinition),this.use(P.PostCollectionsDefinition),this.use(P.UsersDefinition),this.use(P.WidgetsDefinition),this.use(P.WikiDefinition),this.use(P.RedditAPIV2Definition)),dt(e.realtime)&&this.use(P.RealtimeDefinition)}static addMenuItem(e){n(this,Ui).push(e)}static addCustomPostType(e){l(this,Cr,e)}static createForm(e,t){let i=`form.${n(this,Ir).size}`;return n(this,Ir).set(i,{form:e,onSubmit:t}),i}static addSchedulerJob(e){if(n(this,_)[P.SchedulerDefinition.fullName]||this.use(P.SchedulerDefinition),n(this,wr).has(e.name))throw new Error(`Job ${e.name} is already defined`);n(this,wr).set(e.name,e.onRun)}static addSettings(e){ar(e);let t=e.filter(s=>s.type==="group"||!s.scope||s.scope==="installation"),i=e.filter(s=>s.type!=="group"&&s.scope==="app");t.length>0&&l(this,Li,t),i.length>0&&l(this,Fi,i),n(this,_)[P.SettingsDefinition.fullName]||this.use(P.SettingsDefinition)}static addTrigger(e){if("events"in e){for(let t of e.events)this.addTrigger({event:t,onEvent:(i,s)=>e.onEvent(i,s)});return this}return n(this,_t).has(e.event)?n(this,_t).get(e.event)?.push(e.onEvent):n(this,_t).set(e.event,[e.onEvent]),U}static provide(e){n(this,Us).push(e)}static use(e,t){n(this,xr)[e.fullName]={def:e,options:t??{},handler:void 0};let i={};for(let s of Object.values(e.methods))i[s.name]=(o,a)=>n(this,xr)[e.fullName].handler?.[s.name]?.(s.requestType?.fromPartial(o??{}),a);return n(this,_)[e.fullName]=i,i}static get redditAPIPlugins(){if(!dt(n(this,Mi).redditAPI))throw new Error("Reddit API is not enabled. You can enable it by passing `redditAPI: true` to `Devvit.configure`.");return{Flair:n(this,_)[P.FlairDefinition.fullName],GraphQL:n(this,_)[P.GraphQLDefinition.fullName],LinksAndComments:n(this,_)[P.LinksAndCommentsDefinition.fullName],Listings:n(this,_)[P.ListingsDefinition.fullName],Moderation:n(this,_)[P.ModerationDefinition.fullName],ModNote:n(this,_)[P.ModNoteDefinition.fullName],NewModmail:n(this,_)[P.NewModmailDefinition.fullName],PrivateMessages:n(this,_)[P.PrivateMessagesDefinition.fullName],Subreddits:n(this,_)[P.SubredditsDefinition.fullName],PostCollections:n(this,_)[P.PostCollectionsDefinition.fullName],Users:n(this,_)[P.UsersDefinition.fullName],Widgets:n(this,_)[P.WidgetsDefinition.fullName],Wiki:n(this,_)[P.WikiDefinition.fullName]}}static get modLogPlugin(){let e=n(this,_)[P.ModlogDefinition.fullName];if(!e)throw new Error("ModLog is not enabled. You can enable it by passing `modLog: true` to `Devvit.configure`");return e}static get schedulerPlugin(){let e=n(this,_)[P.SchedulerDefinition.fullName];if(!e)throw new Error("Scheduler is not enabled. You can enable it by calling `Devvit.addSchedulerJob` at the top level of your app.");return e}static get kvStorePlugin(){let e=n(this,_)[P.KVStoreDefinition.fullName];if(!e)throw new Error("Key Value Store is not enabled. You can enable it by passing `kvStore: true` to `Devvit.configure`");return e}static get redisPlugin(){let e=n(this,_)[P.RedisAPIDefinition.fullName];if(!e)throw new Error("Redis is not enabled. You can enable it by passing `redis: true` to `Devvit.configure`");return e}static get mediaPlugin(){let e=n(this,_)[P.MediaServiceDefinition.fullName];if(!e)throw new Error("MediaService is not enabled. You can enable it by passing `media: true` to `Devvit.configure`");return e}static get redditapiv2Plugin(){let e=n(this,_)[P.RedditAPIV2Definition.fullName];if(!e)throw new Error("RedditAPIV2 is not enabled. You can enable it by passing `apiV2: true` to `Devvit.configure`");return e}static get settingsPlugin(){let e=n(this,_)[P.SettingsDefinition.fullName];if(!e)throw new Error("Settings must first be configured with `Devvit.addSettings()` before they can be accessed");return e}static get realtimePlugin(){let e=n(this,_)[P.RealtimeDefinition.fullName];if(!e)throw new Error("Realtime is not enabled. You can enable it by passing `realtime: true` to `Devvit.configure`");return e}static get menuItems(){return n(this,Ui)}static get customPostType(){return n(this,Cr)}static get formDefinitions(){return n(this,Ir)}static get scheduledJobHandlers(){return n(this,wr)}static get installationSettings(){return n(this,Li)}static get appSettings(){return n(this,Fi)}static get triggerOnEventHandlers(){return n(this,_t)}static get assets(){return n(this,Ms)}static get webviewAssets(){return n(this,Ls)}constructor(e){super(e),l(U,Ms,e.assets??{}),l(U,Ls,e.webviewAssets??{});for(let t in n(U,xr)){let i=n(U,xr)[t];i.handler=e.use(i.def,i.options)}n(U,Ui).length>0&&db(e),n(U,wr).size>0&&lb(e),n(U,Cr)&&(sb(e),Tk(e)),(n(U,Cr)||n(U,Ir).size>0)&&sk(e),n(U,Li)&&ob(e),n(U,Fi)&&By(e),n(U,_t).size>0&&ub(e);for(let t of n(U,Us))e.provides(t)}};Fi=new WeakMap,Ms=new WeakMap,Mi=new WeakMap,Cr=new WeakMap,Ir=new WeakMap,Li=new WeakMap,Ui=new WeakMap,wr=new WeakMap,_t=new WeakMap,Ls=new WeakMap,Us=new WeakMap,xr=new WeakMap,_=new WeakMap,U.debug={},d(U,Fi,void 0),d(U,Ms,{}),d(U,Mi,{}),d(U,Cr,void 0),d(U,Ir,new Map),d(U,Li,void 0),d(U,Ui,[]),d(U,wr,new Map),d(U,_t,new Map),d(U,Ls,{}),d(U,Us,[]),d(U,xr,{}),d(U,_,{});var u=U;(e=>{function r(t,i,...s){return{type:t,props:i,children:s}}e.createElement=r})(u||(u={}));function V(r){let e=Object.getOwnPropertyDescriptors(r.constructor.prototype);for(let[t,i]of Object.entries(e))i.get&&Object.defineProperty(r,t,{...i,enumerable:!0})}var Jm;(function(r){r[r.bold=1]="bold",r[r.italic=2]="italic",r[r.underline=4]="underline",r[r.strikethrough=8]="strikethrough",r[r.subscript=16]="subscript",r[r.superscript=32]="superscript",r[r.monospace=64]="monospace"})(Jm||(Jm={}));var Ek="text",Rk="raw",Ok="br",Fk="link",Mk="c/",Lk="p/",Uk="r/",Bk="u/",Dk="@",_k="spoilertext",Nk="par",qk="h",jk="hr",Hk="blockquote",Wk="code",Gk="li",Vk="list",zk="L",Jk="R",$k="C",Kk="table",Xk="embed",Zk="img",Yk="gif",Qk="video";function eS(r){return{e:Yk,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function tS(r,e){let t={},i=[];return Object.assign(t,Bs(t,i),Ds(t,i),_s(t,i),js(t,i),Hs(t,i),Ws(t,i)),e(t),{e:Hk,c:i,...r.author&&{a:r.author}}}function rS(r,e){let t={},i=[];return Object.assign(t,Km(t,i)),e(t),{e:Wk,c:i,...r.language&&{l:r.language}}}function iS(r){return{e:Mk,t:r.permalink}}function nS(r,e){let t={},i=[];return Object.assign(t,Km(t,i),qs(t,i)),e(t),{e:qk,l:r.level,c:i}}function sS(r){return{e:Xk,u:r.sourceUrl,c:r.contentUrl,x:r.width,y:r.height}}function oS(){return{e:jk}}function aS(r){return{e:Zk,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function dS(){return{e:Ok}}function lS(r){return{e:Fk,t:r.text,u:r.url,...r.formatting&&{f:r.formatting},...r.tooltip&&{a:r.tooltip}}}function uS(r,e){let t={},i=[];return Object.assign(t,xS(t,i)),e(t),{e:Vk,o:r.ordered,c:i}}function cS(r){let e={},t=[];return Object.assign(e,Bs(e,t),Ds(e,t),_s(e,t),vl(e,t),js(e,t),Hs(e,t),Ws(e,t)),r(e),{e:Gk,c:t}}function mS(r){let e={},t=[];return Object.assign(e,yl(e,t),qs(e,t),$m(e,t),Xm(e,t),Ns(e,t)),r(e),{e:Nk,c:t}}function pS(r){return{e:Lk,t:r.permalink}}function fS(r){return{e:Rk,t:r}}function gS(r){let e={},t=[];return Object.assign(e,yl(e,t),qs(e,t),$m(e,t)),r(e),{e:_k,c:t}}function hS(r){return{e:Uk,t:r.subredditName,l:r.showPrefix}}function vS(r){let e={},t=[],i=[];return Object.assign(e,AS(e,t,i)),r(e),{e:Kk,h:t,c:i}}function yS(r){let[e,t]=wS();return r(e),{c:t}}function bS(r,e){let[t,i]=wS();e(t);let s;switch(r.columnAlignment){case"left":s=zk;break;case"right":s=Jk;break;case"center":s=$k;break}return{...s&&{a:s},...i&&{c:i}}}function kS(r){let e={},t=[];return Object.assign(e,TS(e,t)),r(e),t}function SS(r){return{e:Ek,t:r.text,...r.formatting&&{f:r.formatting}}}function PS(r){return{e:Bk,t:r.username,l:r.showPrefix}}function CS(r){return{e:Dk,t:r.username,l:r.showPrefix}}function IS(r){return{e:Qk,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur},...r.thumbnail&&{p:r.thumbnail},...r.convertToGif&&{gifify:r.convertToGif}}}function wS(){let r={},e=[];return Object.assign(r,yl(r,e),qs(r,e),Xm(r,e),Ns(r,e)),[r,e]}function Bs(r,e){return{blockQuote(t,i){return e.push(tS(t,i)),r}}}function Ds(r,e){return{codeBlock(t,i){return e.push(rS(t,i)),r}}}function ES(r,e){return{embed(t){return e.push(sS(t)),r}}}function _s(r,e){return{heading(t,i){return e.push(nS(t,i)),r}}}function vl(r,e){return{horizontalRule(){return e.push(oS()),r}}}function Ns(r,e){return{image(t){return e.push(aS(t)),r},animatedImage(t){return e.push(eS(t)),r}}}function $m(r,e){return{linebreak(){return e.push(dS()),r}}}function qs(r,e){return{link(t){return e.push(lS(t)),r},commentLink(t){return e.push(iS(t)),r},postLink(t){return e.push(pS(t)),r},subredditLink(t){return e.push(hS(t)),r},userLink(t){return e.push(PS(t)),r},userMention(t){return e.push(CS(t)),r}}}function js(r,e){return{list(t,i){return e.push(uS(t,i)),r}}}function xS(r,e){return{item(t){return e.push(cS(t)),r}}}function Hs(r,e){return{paragraph(t){return e.push(mS(t)),r}}}function Km(r,e){return{rawText(t){return e.push(fS(t)),r}}}function Xm(r,e){return{spoiler(t){return e.push(gS(t)),r}}}function AS(r,e,t){return{headerCell(i,s){return e.push(bS(i,s)),r},row(i){return t.push(kS(i)),r}}}function Ws(r,e){return{table(t){return e.push(vS(t)),r}}}function TS(r,e){return{cell(t){return e.push(yS(t)),r}}}function yl(r,e){return{text(t){return e.push(SS(t)),r}}}function RS(r,e){return{video(t){return e.push(IS(t)),r}}}var _O=function(r,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},NO=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},bl,Gs=class{constructor(){bl.set(this,void 0);let e=[];Object.assign(this,Hs(this,e),_s(this,e),vl(this,e),Bs(this,e),Ds(this,e),ES(this,e),js(this,e),Ws(this,e),Ns(this,e),RS(this,e)),_O(this,bl,{document:e},"f")}build(){return JSON.stringify(NO(this,bl,"f"))}paragraph(e){return this}heading(e,t){return this}horizontalRule(){return this}blockQuote(e,t){return this}codeBlock(e,t){return this}embed(e){return this}list(e,t){return this}table(e){return this}image(e){return this}animatedImage(e){return this}video(e){return this}};bl=new WeakMap;function Bi(r){let e;return r instanceof Gs?e=r.build():typeof r=="object"?e=JSON.stringify(r):e=r,e}var OS=100,FS=1/0,Ar,Tr,Nt,Di,_i,kl,j=class{constructor(e){d(this,_i);d(this,Ar,void 0);d(this,Tr,void 0);d(this,Nt,void 0);d(this,Di,!1);this.pageSize=OS;this.limit=FS;this.children=[];V(this),this._fetch=e.fetch,this.pageSize=e.pageSize??OS,this.limit=e.limit??FS,l(this,Tr,e.after),l(this,Ar,e.before),l(this,Nt,e.more),e.children&&(this.children=e.children)}get hasMore(){return!n(this,Di)||!!(n(this,Tr)||n(this,Ar)||n(this,Nt))}async*[Symbol.asyncIterator](){let e=0;for(;;){if(e===this.children.length)if(this.hasMore){if((await S(this,_i,kl).call(this)).length===0)break}else break;if(yield this.children[e],e++,e===this.limit)break}}setMore(e){l(this,Nt,e)}preventInitialFetch(){l(this,Di,!0)}async all(){for(;this.hasMore&&this.children.length<this.limit;)await S(this,_i,kl).call(this);return this.children.slice(0,this.limit)}async get(e){let t=e<=this.limit?e:this.limit;for(;this.hasMore&&this.children.length<t;)await S(this,_i,kl).call(this);return this.children.slice(0,t)}};Ar=new WeakMap,Tr=new WeakMap,Nt=new WeakMap,Di=new WeakMap,_i=new WeakSet,kl=async function(){if(!this.hasMore)throw new Error("This listing does not have any more items to load.");let{children:e,before:t,after:i,more:s}=await this._fetch({before:n(this,Ar),after:n(this,Tr),limit:this.pageSize,more:n(this,Nt)});return this.children.push(...e),l(this,Ar,t),l(this,Tr,i),l(this,Nt,s),l(this,Di,!0),e};function qO(r){try{return!0}catch{return!1}}function jO(r){try{return!0}catch{return!1}}var Vs,Zm,Oe=class{constructor(){}static get(e,t){let i=u.redditAPIPlugins.ModNote;return new j({hasMore:!0,before:e.before,limit:e.limit,pageSize:e.limit,fetch:async s=>{let o=await i.GetNotes({subreddit:e.subreddit,user:e.user,filter:e.filter,before:s.before,limit:s.limit},t);return{children:o.modNotes?.map(a=>S(this,Vs,Zm).call(this,a))||[],before:o.hasNextPage?o.endCursor:void 0,hasMore:o.hasNextPage}}})}static async delete(e,t){let i=u.redditAPIPlugins.ModNote,{deleted:s}=await i.DeleteNotes(e,t);return!!s}static async add(e,t){let s=await u.redditAPIPlugins.ModNote.PostNotes(e,t);if(!s?.created)throw new Error("Failed to create mod note");return S(this,Vs,Zm).call(this,s.created)}static async addRemovalNote(e,t){await u.redditAPIPlugins.ModNote.PostRemovalNote(e,t)}};Vs=new WeakSet,Zm=function(e){if(g(e.id,"Mod note ID is null or undefined"),g(e.createdAt,"Mod note createdAt is null or undefined"),g(e.type,"Mod note type is null or undefined"),g(e.subreddit,"Mod note subreddit is null or undefined"),g(e.subredditId,"Mod note subredditId is null or undefined"),g(e.operator,"Mod note operator is null or undefined"),g(e.operatorId,"Mod note operatorId is null or undefined"),g(e.user,"Mod note user is null or undefined"),g(e.userId,"Mod note userId is null or undefined"),g(e.userNoteData,"Mod note userNote is null or undefined"),g(e.modActionData,"Mod note modAction is null or undefined"),!qO(e.userNoteData?.label??""))throw new Error(`Invalid user note label: ${e.userNoteData?.label}`);if(!jO(e.type))throw new Error(`Invalid mod note type: ${e.type}`);return{id:e.id,user:{id:ee(e.userId??""),name:e.user},subreddit:{id:Te(e.subredditId??""),name:e.subreddit},operator:{id:ee(e.operatorId??""),name:e.operator},createdAt:new Date(e.createdAt*1e3),userNote:{note:e.userNoteData?.note,redditId:pe(e.userNoteData?.redditId??""),label:e.userNoteData?.label},type:e.type}},d(Oe,Vs);var qt=class{static queryWithQueryString(e,t){return u.redditAPIPlugins.GraphQL.Query({query:e},t)}static query(e,t,i,s){return u.redditAPIPlugins.GraphQL.PersistedQuery({operationName:e,id:t,variables:i},s)}};var MS=["all","wiki","posts","access","mail","config","flair","channels","chat_config","chat_community","chat_operator"];function HO(r,e,t=!1){let i=t?"%2b":"+";return e.map(s=>(r.includes(s)?i:"-")+s).join(",")}function Ym(r){return HO(r,MS,!0)}function LS(r){return r.filter(e=>MS.includes(e))}var WO=(t=>(t.User="USER_FLAIR",t.Post="LINK_FLAIR",t))(WO||{}),Er,Ni,qi,ji,Hi,Wi,Gi,Vi,zi,Ji,$i,Sl,ze=class ze{constructor(e,t,i){d(this,Er,void 0);d(this,Ni,void 0);d(this,qi,void 0);d(this,ji,void 0);d(this,Hi,void 0);d(this,Wi,void 0);d(this,Gi,void 0);d(this,Vi,void 0);d(this,zi,void 0);d(this,Ji,void 0);V(this),g(e.id),g(e.text),l(this,Er,e.id),l(this,Ni,t),l(this,qi,e.text),l(this,ji,GO(e.textColor)),l(this,Hi,VO(e.backgroundColor)),l(this,Wi,zO(e.allowableContent)),l(this,Gi,e.modOnly),l(this,Vi,e.maxEmojis),l(this,zi,e.textEditable),l(this,Ji,i)}get id(){return n(this,Er)}get text(){return n(this,qi)}get textColor(){return n(this,ji)}get backgroundColor(){return n(this,Hi)}get allowableContent(){return n(this,Wi)}get modOnly(){return n(this,Gi)}get maxEmojis(){return n(this,Vi)}get allowUserEdits(){return n(this,zi)}async delete(){return ze.deleteFlairTemplate(n(this,Er),n(this,Ni),n(this,Ji))}async edit(e){return ze.editFlairTemplate({id:n(this,Er),subredditName:n(this,Ni),text:e.text??n(this,qi),allowableContent:e.allowableContent??n(this,Wi),backgroundColor:e.backgroundColor??n(this,Hi),maxEmojis:e.maxEmojis??n(this,Vi),modOnly:e.modOnly??n(this,Gi),textColor:e.textColor??n(this,ji),allowUserEdits:e.allowUserEdits??n(this,zi)},n(this,Ji))}static async createPostFlairTemplate(e,t){var i;return S(i=ze,$i,Sl).call(i,{...e,flairType:"LINK_FLAIR"},t)}static async createUserFlairTemplate(e,t){var i;return S(i=ze,$i,Sl).call(i,{...e,flairType:"USER_FLAIR"},t)}static async editFlairTemplate(e,t){var i;return S(i=ze,$i,Sl).call(i,e,t)}static async getPostFlairTemplates(e,t){return(await u.redditAPIPlugins.Flair.LinkFlair({subreddit:e},t)).flair?.map(o=>new ze(o,e,t))||[]}static async getUserFlairTemplates(e,t){return(await u.redditAPIPlugins.Flair.UserFlair({subreddit:e},t)).flair?.map(o=>new ze(o,e,t))||[]}static async deleteFlairTemplate(e,t,i){await u.redditAPIPlugins.Flair.DeleteFlairTemplate({subreddit:e,flairTemplateId:t},i)}};Er=new WeakMap,Ni=new WeakMap,qi=new WeakMap,ji=new WeakMap,Hi=new WeakMap,Wi=new WeakMap,Gi=new WeakMap,Vi=new WeakMap,zi=new WeakMap,Ji=new WeakMap,$i=new WeakSet,Sl=async function(e,t){let{subredditName:i,allowableContent:s="all",backgroundColor:o="transparent",flairType:a="",maxEmojis:c=10,modOnly:p=!1,text:f,textColor:v="dark",allowUserEdits:m=!1,id:b=""}=e;if(p&&m)throw new Error("Cannot have a mod only flair that is editable by users");let C=await u.redditAPIPlugins.Flair.FlairTemplate({subreddit:i,allowableContent:s,backgroundColor:o,flairType:a,maxEmojis:c,modOnly:p,text:f,textColor:v,textEditable:m,flairTemplateId:b,cssClass:"",overrideCss:!1},t);return new ze(C,i,t)},d(ze,$i);var se=ze;function $s(r){return{flairCssClass:r.flairCssClass,user:r.user,flairText:r.flairText}}var zs,Qm,Js,ep,jt=class jt{static async getUserFlairBySubreddit(e,t){return u.redditAPIPlugins.Flair.FlairList(e,t)}static setUserFlair(e,t){var i;return S(i=jt,zs,Qm).call(i,e,t)}static setPostFlair(e,t){var i;return S(i=jt,zs,Qm).call(i,{...e,postId:me(e.postId)},t)}static async removePostFlair(e,t,i){var s;return S(s=jt,Js,ep).call(s,e,t,void 0,i)}static async removeUserFlair(e,t,i){var s;return S(s=jt,Js,ep).call(s,e,void 0,t,i)}};zs=new WeakSet,Qm=async function(e,t){await u.redditAPIPlugins.Flair.SelectFlair({subreddit:e.subredditName,flairTemplateId:e.flairTemplateId??"",text:e.text??"",name:e.username,link:e.postId,backgroundColor:e.backgroundColor??"",textColor:e.textColor??"dark",cssClass:e.cssClass??"",returnRtjson:"none"},t)},Js=new WeakSet,ep=async function(e,t,i,s){await u.redditAPIPlugins.Flair.SelectFlair({subreddit:e,name:i??"",link:t??"",flairTemplateId:"",backgroundColor:"",text:"",textColor:"",cssClass:"",returnRtjson:"none"},s)},d(jt,zs),d(jt,Js);var Fe=jt;function GO(r){if(g(r,"Flair text color is required"),r==="light"||r==="dark")return r;throw new Error(`Invalid flair text color: ${r}`)}function VO(r){if(g(r,"Flair background color is required"),r==="transparent"||/^#([A-Fa-f0-9]{6})$/.test(r))return r;throw new Error(`Invalid flair background color: ${r}`)}function zO(r){if(r==="all"||r==="text"||r==="emoji")return r;throw new Error(`Invalid allowable content: ${r}`)}import{Block as eF}from"@devvit/protos";var _S=Bn(DS(),1);var Ki,Xs,Xi,Zs,Ys,Qs,eo,to,Zi,ro,io,no,so,oo,ao,Ht,lo,uo,Or,Yi,Wt,Qi,en,tn,Fr,Gt,Vt,rn,zt,Jt,$t,mt,co,mo,nn,sn,D,N=class N{constructor(e,t){d(this,Ki,void 0);d(this,Xs,void 0);d(this,Xi,void 0);d(this,Zs,void 0);d(this,Ys,void 0);d(this,Qs,void 0);d(this,eo,void 0);d(this,to,void 0);d(this,Zi,void 0);d(this,ro,void 0);d(this,io,void 0);d(this,no,void 0);d(this,so,void 0);d(this,oo,void 0);d(this,ao,void 0);d(this,Ht,void 0);d(this,lo,void 0);d(this,uo,void 0);d(this,Or,void 0);d(this,Yi,void 0);d(this,Wt,void 0);d(this,Qi,void 0);d(this,en,void 0);d(this,tn,void 0);d(this,Fr,void 0);d(this,Gt,void 0);d(this,Vt,void 0);d(this,rn,void 0);d(this,zt,void 0);d(this,Jt,void 0);d(this,$t,void 0);d(this,mt,void 0);d(this,co,void 0);d(this,mo,void 0);d(this,nn,void 0);d(this,sn,void 0);d(this,D,void 0);V(this),g(e.id,"Post is missing id"),g(e.title,"Post is missing title"),g(e.createdUtc,"Post is missing created date"),g(e.author,"Post is missing author name"),g(e.subreddit,"Post is missing subreddit name"),g(e.subredditId,"Post is missing subreddit id"),g(e.url,"Post is missing url"),g(e.permalink,"Post is missing permalink"),l(this,Ki,me(`t3_${e.id}`)),l(this,Xi,e.author),l(this,Xs,e.authorFullname?ee(e.authorFullname):void 0),l(this,Ys,Te(e.subredditId)),l(this,Qs,e.subreddit),l(this,no,e.score??0),l(this,so,e.numComments??0),l(this,oo,e.numReports??0);let i=new Date(0);i.setUTCSeconds(e.createdUtc),l(this,Zs,i),l(this,to,e.title),l(this,Zi,e.selftext),l(this,ro,e.selftextHtml),l(this,io,e.url),l(this,eo,e.permalink),e.thumbnail&&e.thumbnail!=="self"&&e.thumbnail!=="nsfw"&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null&&l(this,ao,{url:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth}),l(this,Ht,e.approved??!1),l(this,lo,e.approvedAtUtc??0),l(this,uo,e.bannedAtUtc??0),l(this,Wt,e.removed??!1),l(this,Qi,e.removedBy),l(this,en,e.removedByCategory),l(this,Or,e.spam??!1),l(this,Yi,e.stickied??!1),l(this,tn,e.archived??!1),l(this,Fr,e.edited??!1),l(this,Gt,e.locked??!1),l(this,Vt,e.over18??!1),l(this,rn,e.quarantine??!1),l(this,zt,e.spoiler),l(this,Jt,e.hidden??!1),l(this,$t,e.ignoreReports??!1),l(this,mt,e.distinguished),l(this,mo,e.secureMedia),l(this,nn,(e.modReports??[]).map(([s])=>s)),l(this,sn,(e.userReports??[]).map(([s])=>s)),l(this,D,t),(e.linkFlairBackgroundColor||e.linkFlairCssClass||e.linkFlairText||e.linkFlairType||e.linkFlairTemplateId||e.linkFlairRichtext||e.linkFlairTextColor)&&l(this,co,{backgroundColor:e.linkFlairBackgroundColor,cssClass:e.linkFlairCssClass,text:e.linkFlairText,type:e.linkFlairType,templateId:e.linkFlairTemplateId,richtext:(e.linkFlairRichtext??[]).map(({e:s,t:o,a,u:c})=>({elementType:s,text:o,emojiRef:a,url:c})),textColor:e.linkFlairTextColor})}get id(){return n(this,Ki)}get authorId(){return n(this,Xs)}get authorName(){return n(this,Xi)}get subredditId(){return n(this,Ys)}get subredditName(){return n(this,Qs)}get permalink(){return n(this,eo)}get title(){return n(this,to)}get body(){return n(this,Zi)}get bodyHtml(){return n(this,ro)}get url(){return n(this,io)}get thumbnail(){return n(this,ao)}get createdAt(){return n(this,Zs)}get score(){return n(this,no)}get numberOfComments(){return n(this,so)}get numberOfReports(){return n(this,oo)}get approved(){return n(this,Ht)}get approvedAtUtc(){return n(this,lo)}get bannedAtUtc(){return n(this,uo)}get spam(){return n(this,Or)}get stickied(){return n(this,Yi)}get removed(){return n(this,Wt)}get removedBy(){return n(this,Qi)}get removedByCategory(){return n(this,en)}get archived(){return n(this,tn)}get edited(){return n(this,Fr)}get locked(){return n(this,Gt)}get nsfw(){return n(this,Vt)}get quarantined(){return n(this,rn)}get spoiler(){return n(this,zt)}get hidden(){return n(this,Jt)}get ignoringReports(){return n(this,$t)}get distinguishedBy(){return n(this,mt)}get comments(){return $.getComments({postId:this.id},n(this,D))}get flair(){return n(this,co)}get secureMedia(){return n(this,mo)}get userReportReasons(){return n(this,sn)}get modReportReasons(){return n(this,nn)}toJSON(){return{id:this.id,authorId:this.authorId,authorName:this.authorName,subredditId:this.subredditId,subredditName:this.subredditName,permalink:this.permalink,title:this.title,body:this.body,bodyHtml:this.bodyHtml,url:this.url,thumbnail:this.thumbnail,score:this.score,numberOfComments:this.numberOfComments,numberOfReports:this.numberOfReports,createdAt:this.createdAt,approved:this.approved,spam:this.spam,stickied:this.stickied,removed:this.removed,removedBy:n(this,Qi),removedByCategory:n(this,en),archived:this.archived,edited:this.edited,locked:this.locked,nsfw:this.nsfw,quarantined:this.quarantined,spoiler:this.spoiler,hidden:this.hidden,ignoringReports:this.ignoringReports,distinguishedBy:this.distinguishedBy,flair:this.flair,secureMedia:this.secureMedia,modReportReasons:n(this,nn),userReportReasons:n(this,sn)}}isApproved(){return n(this,Ht)}isSpam(){return n(this,Or)}isStickied(){return n(this,Yi)}isRemoved(){return n(this,Wt)}isArchived(){return n(this,tn)}isEdited(){return n(this,Fr)}isLocked(){return n(this,Gt)}isNsfw(){return n(this,Vt)}isQuarantined(){return n(this,rn)}isSpoiler(){return n(this,zt)}isHidden(){return n(this,Jt)}isIgnoringReports(){return n(this,$t)}isDistinguishedBy(){return n(this,mt)}async edit(e){let t=await N.edit({id:this.id,...e},n(this,D));l(this,Zi,t.body),l(this,Fr,t.edited)}async addComment(e){return $.submit({id:this.id,...e},n(this,D))}async delete(){return N.delete(this.id,n(this,D))}async approve(){await N.approve(this.id,n(this,D)),l(this,Ht,!0),l(this,Wt,!1)}async remove(e=!1){await N.remove(this.id,e,n(this,D)),l(this,Wt,!0),l(this,Or,e),l(this,Ht,!1)}async lock(){await N.lock(this.id,n(this,D)),l(this,Gt,!0)}async unlock(){await N.unlock(this.id,n(this,D)),l(this,Gt,!1)}async hide(){await N.hide(this.id,n(this,D)),l(this,Jt,!0)}async unhide(){await N.unhide(this.id,n(this,D)),l(this,Jt,!1)}async markAsNsfw(){await N.markAsNsfw(this.id,n(this,D)),l(this,Vt,!0)}async unmarkAsNsfw(){await N.unmarkAsNsfw(this.id,n(this,D)),l(this,Vt,!1)}async markAsSpoiler(){await N.markAsSpoiler(this.id,n(this,D)),l(this,zt,!0)}async unmarkAsSpoiler(){await N.unmarkAsSpoiler(this.id,n(this,D)),l(this,zt,!1)}async sticky(e){await N.sticky(this.id,e,n(this,D))}async unsticky(){await N.unsticky(this.id,n(this,D))}async distinguish(){let{distinguishedBy:e}=await N.distinguish(this.id,!1,n(this,D));l(this,mt,e)}async distinguishAsAdmin(){let{distinguishedBy:e}=await N.distinguish(this.id,!0,n(this,D));l(this,mt,e)}async undistinguish(){let{distinguishedBy:e}=await N.undistinguish(this.id,n(this,D));l(this,mt,e)}async ignoreReports(){await N.ignoreReports(this.id,n(this,D)),l(this,$t,!0)}async unignoreReports(){await N.unignoreReports(this.id,n(this,D)),l(this,$t,!1)}async getAuthor(){return I.getByUsername(n(this,Xi),n(this,D))}async crosspost(e){return N.crosspost({...e,postId:this.id},n(this,D))}addRemovalNote(e){return Oe.addRemovalNote({itemIds:[n(this,Ki)],...e},n(this,D))}static async getById(e,t){let i=u.redditAPIPlugins.LinksAndComments,s=or(e)?e:`t3_${e}`,o=await i.Info({subreddits:[],thingIds:[s]},t);if(!o.data?.children?.length)throw new Error("could not find post");let a=o.data.children[0];if(!a?.data)throw new Error("could not find post");return new N(a.data,t)}static async submit(e,t){let i=u.redditAPIPlugins.LinksAndComments,s;if("preview"in e){g(t,"Missing metadata in `SubmitPostOptions`");let c=await new at(()=>e.preview,void 0,{},t,void 0).buildBlocksUI(),p=eF.encode(c).finish();s=await i.Submit({kind:"custom",sr:e.subredditName,richtextJson:(0,_S.fromByteArray)(p),...e},t)}else s=await i.Submit({kind:"kind"in e?e.kind:"url"in e?"link":"self",sr:e.subredditName,richtextJson:"richtext"in e?Bi(e.richtext):void 0,...e},t);if("kind"in e&&["image","video","videogif"].includes(e.kind)&&!s.json?.data?.id&&"url"in e)throw new Error(`Post of ${e.kind} type with ${e.url} is being created asynchronously and should be updated in the subreddit soon.`);if(!s.json?.data?.id||s.json?.errors?.length)throw new Error(`failed to submit post - either post ID is empty or request failed with errors: ${s.json?.errors}`);return N.getById(`t3_${s.json.data.id}`,t)}static async crosspost(e,t){let i=u.redditAPIPlugins.LinksAndComments,{postId:s,subredditName:o,...a}=e,c=await i.Submit({kind:"crosspost",sr:o,crosspostFullname:me(s),...a},t);if(!c.json?.data?.id||c.json?.errors?.length)throw new Error("failed to crosspost post");return N.getById(`t3_${c.json.data.id}`,t)}static async edit(e,t){let i=u.redditAPIPlugins.LinksAndComments,{id:s}=e,o;if("richtext"in e&&(o=Bi(e.richtext)),(await i.EditUserText({thingId:s,text:"text"in e?e.text:"",richtextJson:o},t)).json?.errors?.length)throw new Error("Failed to edit post");return N.getById(s,t)}static async delete(e,t){await u.redditAPIPlugins.LinksAndComments.Del({id:e},t)}static async approve(e,t){await u.redditAPIPlugins.Moderation.Approve({id:e},t)}static async remove(e,t=!1,i){await u.redditAPIPlugins.Moderation.Remove({id:e,spam:t},i)}static async hide(e,t){await u.redditAPIPlugins.LinksAndComments.Hide({id:e},t)}static async unhide(e,t){await u.redditAPIPlugins.LinksAndComments.Unhide({id:e},t)}static async markAsNsfw(e,t){await u.redditAPIPlugins.LinksAndComments.MarkNSFW({id:e},t)}static async unmarkAsNsfw(e,t){await u.redditAPIPlugins.LinksAndComments.UnmarkNSFW({id:e},t)}static async markAsSpoiler(e,t){await u.redditAPIPlugins.LinksAndComments.Spoiler({id:e},t)}static async unmarkAsSpoiler(e,t){await u.redditAPIPlugins.LinksAndComments.Unspoiler({id:e},t)}static async sticky(e,t,i){await u.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!0,num:t},i)}static async unsticky(e,t){await u.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!1},t)}static async lock(e,t){await u.redditAPIPlugins.LinksAndComments.Lock({id:e},t)}static async unlock(e,t){await u.redditAPIPlugins.LinksAndComments.Unlock({id:e},t)}static async distinguish(e,t,i){let a=(await u.redditAPIPlugins.Moderation.Distinguish({id:e,how:t?"admin":"yes",sticky:!1},i)).json?.data?.things?.[0]?.data;return g(a),{distinguishedBy:a.distinguished}}static async undistinguish(e,t){let o=(await u.redditAPIPlugins.Moderation.Distinguish({id:e,how:"no",sticky:!1},t)).json?.data?.things?.[0]?.data;return g(o),{distinguishedBy:o.distinguished}}static async ignoreReports(e,t){await u.redditAPIPlugins.Moderation.IgnoreReports({id:e},t)}static async unignoreReports(e,t){await u.redditAPIPlugins.Moderation.UnignoreReports({id:e},t)}static getControversialPosts(e={},t){return this.getSortedPosts({...e,sort:"controversial"},t)}static getTopPosts(e={},t){return this.getSortedPosts({...e,sort:"top"},t)}static getSortedPosts(e,t){let i=u.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async s=>{let o=await i.Sort({show:"all",sort:e.sort,t:e.timeframe,subreddit:e.subredditName,...s},t);return Ks(o,t)}})}static getHotPosts(e={location:"GLOBAL"},t){let i=u.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async s=>{let o=await i.Hot({g:e.location,show:"all",subreddit:e.subredditName,...s},t);return Ks(o,t)}})}static getNewPosts(e,t){let i=u.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async s=>{let o=await i.New({show:"all",subreddit:e.subredditName,...s},t);return Ks(o,t)}})}static getRisingPosts(e,t){let i=u.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async s=>{let o=await i.Rising({show:"all",subreddit:e.subredditName,...s},t);return Ks(o,t)}})}static getPostsByUser(e,t){let i=u.redditAPIPlugins.Users;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,async fetch(s){let o=await i.UserWhere({username:e.username,where:"submitted",...s},t);return Ks(o,t)}})}};Ki=new WeakMap,Xs=new WeakMap,Xi=new WeakMap,Zs=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,eo=new WeakMap,to=new WeakMap,Zi=new WeakMap,ro=new WeakMap,io=new WeakMap,no=new WeakMap,so=new WeakMap,oo=new WeakMap,ao=new WeakMap,Ht=new WeakMap,lo=new WeakMap,uo=new WeakMap,Or=new WeakMap,Yi=new WeakMap,Wt=new WeakMap,Qi=new WeakMap,en=new WeakMap,tn=new WeakMap,Fr=new WeakMap,Gt=new WeakMap,Vt=new WeakMap,rn=new WeakMap,zt=new WeakMap,Jt=new WeakMap,$t=new WeakMap,mt=new WeakMap,co=new WeakMap,mo=new WeakMap,nn=new WeakMap,sn=new WeakMap,D=new WeakMap;var G=N;function Ks(r,e){if(!r.data?.children)throw new Error("Listing response is missing children");return{children:r.data.children.map(i=>new G(i.data,e)),before:r.data.before,after:r.data.after}}var po,on,fo,go,ho,vo,yo,Kt,bo,ko,pt,Mr=class Mr{constructor(e,t){d(this,po,void 0);d(this,on,void 0);d(this,fo,void 0);d(this,go,void 0);d(this,ho,void 0);d(this,vo,void 0);d(this,yo,void 0);d(this,Kt,new Map);d(this,bo,void 0);d(this,ko,void 0);d(this,pt,void 0);V(this),g(e.id,"User ID is missing or undefined"),g(e.name,"Username is missing or undefined"),g(e.createdUtc,"User is missing created date"),l(this,po,ee(yd(e.id)?e.id:`t2_${e.id}`)),l(this,on,e.name),l(this,vo,e.over18??!1),l(this,yo,e.isEmployee??!1);let i=new Date(0);if(i.setUTCSeconds(e.createdUtc),l(this,fo,i),l(this,go,e.linkKarma??0),l(this,ho,e.commentKarma??0),e.modPermissions)for(let[s,o]of Object.entries(e.modPermissions))n(this,Kt).set(s,LS(o));l(this,bo,new URL(e.subreddit?.url??"","https://www.reddit.com").toString()),l(this,ko,e.subreddit?.url??""),l(this,pt,t)}get id(){return n(this,po)}get username(){return n(this,on)}get createdAt(){return n(this,fo)}get linkKarma(){return n(this,go)}get commentKarma(){return n(this,ho)}get nsfw(){return n(this,vo)}get isAdmin(){return n(this,yo)}get modPermissions(){return n(this,Kt)}get url(){return n(this,bo)}get permalink(){return n(this,ko)}toJSON(){return{id:this.id,username:this.username,createdAt:this.createdAt,linkKarma:this.linkKarma,commentKarma:this.commentKarma,nsfw:this.nsfw,modPermissionsBySubreddit:Object.fromEntries(this.modPermissions)}}async getModPermissionsForSubreddit(e){if(n(this,Kt).has(e))return n(this,Kt).get(e);let t=await Mr.getSubredditUsersByType({subredditName:e,type:"moderators",username:this.username},n(this,pt)).all();if(t.length===0)return[];let i=t[0].modPermissions.get(e)??[];return i.length>0&&n(this,Kt).set(e,i),i}getComments(e){return $.getCommentsByUser({username:this.username,...e},n(this,pt))}getPosts(e){return G.getPostsByUser({username:this.username,...e},n(this,pt))}async getUserFlairBySubreddit(e){let t=await Fe.getUserFlairBySubreddit({subreddit:e,name:n(this,on)},n(this,pt));return t.users[0]?$s(t.users[0]):void 0}getSnoovatarUrl(){return Mr.getSnoovatarUrl(this.username,n(this,pt))}static async getById(e,t){let o=(await u.redditAPIPlugins.Users.UserDataByAccountIds({ids:e},t))?.users?.[e]?.name;return o==null?void 0:Mr.getByUsername(o,t)}static async getByUsername(e,t){let s=await u.redditAPIPlugins.Users.UserAbout({username:e},t);if(s.data?.id)return new Mr(s.data,t)}static async getFromMetadata(e,t){g(t);let i=t?.[e]?.values[0];return i?Mr.getById(ee(i),t):Promise.resolve(void 0)}static getSubredditUsersByType(e,t){let i=u.redditAPIPlugins.Subreddits;return new j({hasMore:!0,pageSize:e.pageSize,limit:e.limit,after:e.after,before:e.before,fetch:async s=>{let o=await i.AboutWhere({where:e.type,user:e.username,subreddit:e.subredditName,show:"all",...s},t);return rF(o,e.subredditName,t)}})}static async createRelationship(e,t){let i=u.redditAPIPlugins.Users,{type:s,subredditName:o,username:a,permissions:c,...p}=e,f=await i.Friend({type:s,subreddit:o,name:a,permissions:c?Ym(c):void 0,...p},t);if(f.json?.errors?.length)throw new Error(f.json.errors.join(`
4
4
  `))}static async removeRelationship(e,t){await u.redditAPIPlugins.Users.Unfriend({type:e.type,subreddit:e.subredditName,name:e.username},t)}static async setModeratorPermissions(e,t,i,s){let a=await u.redditAPIPlugins.Users.SetPermissions({subreddit:t,name:e,type:"moderator",permissions:Ym(i)},s);if(a.json?.errors?.length)throw new Error(a.json.errors.join(`