@devvit/ui-renderer 0.11.0-next-2024-10-07-d8062cd27.0 → 0.11.0-next-2024-10-07-02dcca49e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -177,7 +177,7 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
177
177
|
render() {
|
|
178
178
|
return html `
|
|
179
179
|
<faceplate-dialog
|
|
180
|
-
class="z-dialog w-[32rem] overflow-
|
|
180
|
+
class="z-dialog w-[32rem] overflow-auto"
|
|
181
181
|
@faceplate-close="${__classPrivateFieldGet(this, _DevvitFormDialog_onDialogClosed, "f")}"
|
|
182
182
|
>
|
|
183
183
|
<div
|
package/devvit-surface.min.js
CHANGED
|
@@ -620,7 +620,7 @@ button inline-flex`},fR=e=>{let{createElement:n}=Ge(),{attributes:i,selected:d,r
|
|
|
620
620
|
style="${d(t)}"
|
|
621
621
|
>
|
|
622
622
|
${r===he?"":r}
|
|
623
|
-
</div>`}else return r}var vc,mc,U5,zu=class extends Xt{constructor(){super(...arguments);Re(this,vc,window.matchMedia("(prefers-color-scheme: dark)"));Re(this,mc,()=>this.requestUpdate());Re(this,U5,()=>({stackDirection:we.UNRECOGNIZED}))}static get styles(){return[x5]}connectedCallback(){super.connectedCallback(),O(this,vc)?.addEventListener("change",O(this,mc))}disconnectedCallback(){super.disconnectedCallback(),O(this,vc)?.removeEventListener("change",O(this,mc))}render(){if(this.block&&this.block.type===ye.BLOCK_ROOT){let i={...O(this,U5).call(this),...this.renderContext?.()??{}};return St`<div class="${_o(this.class)}">${kp(this.block,i)}</div>`}return St`${cR({creative:St`<slot name="empty-state-image"></slot>`,title:ap("Whoops!",{desc:"Header for message to display when rendering fails"}),description:ap("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};vc=new WeakMap,mc=new WeakMap,U5=new WeakMap,on([Mn({attribute:!1})],zu.prototype,"block",2),on([Mn({attribute:!1})],zu.prototype,"renderContext",2),on([Mn()],zu.prototype,"class",2),zu=on([sR(),nl("devvit-blocks-renderer")],zu);var fN="ServerCallRequired";var Z5=class extends Error{constructor(n,i){super(fN),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function cN(e){return e?.message===fN}var G1=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",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies",WebviewTemplate:"devvit-webview-template"}),pN;(function(e){e.Blocks="blocks",e.EmitSnapshots="emitSnapshots",e.EmitState="emitState",e.Realtime="realtime",e.Runtime="runtime",e.Surface="surface",e.UseAsync="useAsync",e.Payments="payments",e.Bootstrap="bootstrap"})(pN||(pN={}));function hN(e,n){let i,d=0,r;return function(...t){return r=t,i??(i=setTimeout(()=>{d=Date.now(),i=void 0;let s=r;r=void 0,e.apply(this,s)},Math.max(0,n-(Date.now()-d)))),()=>{i!=null&&clearTimeout(i),i=void 0,r=void 0}}}function vN(e,n){if(!e)throw Error(n)}var q5;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(q5||(q5={}));function EM(e){return e.startsWith(q5.LINK)}function OM(e){vN(EM(e),`Expected link id to start with ${q5.LINK}, got ${e}}`)}function mN(e){return OM(e),e}function kN(e,n,i){let{width:d,height:r}=e.contentRect,s=n.getComputedStyle(i).fontSize.split("px")[0],f=s?parseFloat(s)/16:1;return{width:Math.round(d),height:Math.round(r),scale:n.devicePixelRatio,fontScale:f}}typeof ArrayBuffer.isView>"u"&&(ArrayBuffer.isView=function(e){return e!=null&&e.__proto__!=null&&e.__proto__.__proto__===Int8Array.prototype.__proto__});typeof Array.prototype.fill>"u"&&Object.defineProperty(Array.prototype,"fill",{value:function(e){if(this==null)throw new TypeError("this is null or not defined");for(var n=Object(this),i=n.length>>>0,d=arguments[1],r=d>>0,t=r<0?Math.max(i+r,0):Math.min(r,i),s=arguments[2],f=s===void 0?i:s>>0,p=f<0?Math.max(i+f,0):Math.min(f,i);t<p;)n[t]=e,t++;return n}});[Int8Array,Int16Array,Uint16Array,Int32Array,Float32Array,Float64Array].forEach(function(e){typeof e.prototype.fill>"u"&&Object.defineProperty(e.prototype,"fill",{value:Array.prototype.fill})});typeof Math.clz32>"u"&&(Math.clz32=function(e,n){return function(i){var d=i>>>0;return d===0?32:31-(e(d)/n|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(n,i){return(n&4294901760)*(i&65535)+(n&65535)*(i|0)|0});var _N=Math.clz32,gp=ArrayBuffer.isView,hn=Math.imul;Z(Bp,"CharSequence",To);Z(Lp,"Number",re);Z(Fp,"Unit",ei);Z(fl,"IntCompanionObject",ei);Z(Xi,"Collection",To);Z(go,"AbstractCollection",re,L,[Xi]);Z(Vr,"AbstractMutableCollection",re,go,[go,Xi]);Z(wc,"IteratorImpl",re);Z(pl,"List",To,L,[Xi]);Z(hr,"AbstractMutableList",re,Vr,[Vr,pl,Xi]);Z(Co,"Map",To);Z(vr,"AbstractMap",re,L,[Co]);Z(rl,"AbstractMutableMap",re,vr,[vr,Co]);Z(Y5,"Set",To,L,[Xi]);Z(dl,"AbstractMutableSet",re,Vr,[Vr,Y5,Xi]);Z(UN,"Companion",ei);Z(Dn,"ArrayList",re,hr,[hr,pl,Xi],bo);Z(Jr,"HashMap",re,rl,[rl,Co],$M);Z(mr,"HashMapEntrySetBase",re,dl,[Y5,Xi,dl]);Z(qp,"HashMapEntrySet",re,mr);Z(WN,"Companion",ei);Z(Xu,"Itr",re);Z(Cc,"EntriesItr",re,Xu);Z(Ao,"Entry",To);Z(Yu,"EntryRef",re,L,[Ao]);function PM(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o(),t=r,s;if(t!=null&&Hn(t,Ao)?s=this.w3(t):s=!1,!s){n=!1;break e}}n=!0}return n}Z(GN,"InternalMap",To);Z(Bi,"InternalHashMap",re,L,[GN],DN);Z(X5,"LinkedHashMap",re,Jr,[Jr,Co],gc);Z(Dr,"StringBuilder",re,L,[Bp],Hp);Z(jN,"Companion",ei);Z(ex,"Char",re);Z(nx,"Companion",ei);Z(mt,"Enum",re);Z(Q5,L,re);Z(cx,"Companion",ei);Z(Ee,"Long",re,Lp);Z(Ro,"Exception",re,Error,L,bx);Z(Li,"RuntimeException",re,Ro,L,Ix);Z(yl,"IllegalArgumentException",re,Li,L,Rx);Z(wl,"IndexOutOfBoundsException",re,Li,L,Nx);Z(Al,"IllegalStateException",re,Li,L,xx);Z(e4,"UnsupportedOperationException",re,Li,L,Cl);Z(gl,"NoSuchElementException",re,Li,L,Y1);Z(n4,"ConcurrentModificationException",re,Li,L,Kp);Z(bl,"ArithmeticException",re,Li,L,Ox);Z(i4,"NullPointerException",re,Li,L,Xp);Z(t4,"ClassCastException",re,Li,L,Yp);Z(Tl,"UninitializedPropertyAccessException",re,Li,L,Mx);Z(Q1,"Companion",ei);Z(Lx,"Companion",ei);Z(r4,"Companion",ei);Z(Ux,"Companion",ei);Z(Nn,"ArrayDeque",re,hr,L,xc);Z(zr,"EmptyList",ei,L,[pl]);Z(d4,"EmptyIterator",ei);Z(No,"ArrayAsCollection",re,L,[Xi]);Z(o4,"IntIterator",re);Z(qx,"Companion",ei);Z(gd,"IntProgression",re);Z(X1,"IntRange",re,gd);Z(a4,"IntProgressionIterator",re,o4);Z(n8,"Companion",ei);Z(vt,"Pair",re);function Bp(){}function Lp(){}function Fp(){}c(Fp).toString=function(){return"kotlin.Unit"};var Ue;function fl(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}c(fl).c=function(){return this.MIN_VALUE};c(fl).d=function(){return this.MAX_VALUE};c(fl).e=function(){return this.SIZE_BYTES};c(fl).f=function(){return this.SIZE_BITS};var Up;function MM(e){return e!==e}function _M(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-_N(e)|0)}return n}function BN(e){return EB(e)}function BM(e,n){return n}function LM(e,n){return hl(Array(n),null)}function G5(e){return MB([e])}function cl(e){var n;return e.toArray!==void 0?n=e.toArray():n=BN(e),n}function Fe(e,n,i,d,r){Ki.h(d,r,e.length);var t=r-d|0;if(Ki.h(i,i+t|0,n.length),gp(n)&&gp(e)){var s=e.subarray(d,r);n.set(s,i)}else if(e!==n||i<=d){var f=0;if(f<t)do{var p=f;f=f+1|0,n[i+p|0]=e[d+p|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var w=v;v=v+-1|0,n[i+w|0]=e[d+w|0]}while(0<=v)}}function FM(e){return e<0&&_B(),e}function Vr(){go.call(this)}c(Vr).j=function(e){this.k();for(var n=this.l();n.m();)if(Ze(n.o(),e))return n.n(),!0;return!1};c(Vr).p=function(e){this.k();for(var n=!1,i=e.l();i.m();){var d=i.o();this.i(d)&&(n=!0)}return n};c(Vr).toJSON=function(){return this.toArray()};c(Vr).k=function(){};function wc(e){this.w_1=e,this.u_1=0,this.v_1=-1}c(wc).m=function(){return this.u_1<this.w_1.q()};c(wc).o=function(){if(!this.m())throw Y1();var e=this,n=this.u_1;return this.u_1=n+1|0,e.v_1=n,this.w_1.x(this.v_1)};c(wc).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw Rc($r(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function hr(){Vr.call(this),this.y_1=0}c(hr).i=function(e){return this.k(),this.a1(this.q(),e),!0};c(hr).l=function(){return new wc(this)};c(hr).r=function(e){return this.b1(e)>=0};c(hr).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=i;break e}i=i+1|0}n=-1}return n};c(hr).equals=function(e){return e===this?!0:e!=null&&Hn(e,pl)?Ki.c1(this,e):!1};c(hr).hashCode=function(){return Ki.d1(this)};function rl(){vr.call(this),this.g1_1=null,this.h1_1=null}c(rl).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Ze(e,d)){var r=i.m1();return n.n(),r}}return null};c(rl).k=function(){};function dl(){Vr.call(this)}c(dl).equals=function(e){return e===this?!0:e!=null&&Hn(e,Y5)?Qp.s1(this,e):!1};c(dl).hashCode=function(){return Qp.t1(this)};function LN(e){if(!(e>=0)){var n="capacity must be non-negative.";throw Hr($r(n))}return hl(Array(e),null)}function FN(e,n){e[n]=null}function yN(e,n,i){e.fill(null,n,i)}function SN(e,n){return aB(e,n)}function UN(){bp=this;var e=this,n=Zp(0);n.w1_1=!0,e.x1_1=n}var bp;function UM(){return bp==null&&new UN,bp}function ZM(e){var n=[];return Dn.call(e,n),e}function bo(){return ZM(We(c(Dn)))}function qM(e,n){var i=[];if(Dn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw Hr($r(d))}return n}function Zp(e){return qM(e,We(c(Dn)))}function VM(e,n){var i=cl(e);return Dn.call(n,i),n}function ZN(e){return VM(e,We(c(Dn)))}function JM(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function qN(e,n){return Ki.y1(n,e.q()),n}function HM(e,n){return Ki.z1(n,e.q()),n}function Dn(e){UM(),hr.call(this),this.v1_1=e,this.w1_1=!1}c(Dn).q=function(){return this.v1_1.length};c(Dn).x=function(e){var n=this.v1_1[qN(this,e)];return n==null||n!=null?n:en()};c(Dn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};c(Dn).a1=function(e,n){this.k(),this.v1_1.splice(HM(this,e),0,n),this.y_1=this.y_1+1|0};c(Dn).p=function(e){if(this.k(),e.t())return!1;for(var n=JM(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=FM(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};c(Dn).z=function(e){this.k(),qN(this,e),this.y_1=this.y_1+1|0;var n;return e===W5(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};c(Dn).j=function(e){this.k();var n=0,i=this.v1_1.length-1|0;if(n<=i)do{var d=n;if(n=n+1|0,Ze(this.v1_1[d],e))return this.v1_1.splice(d,1),this.y_1=this.y_1+1|0,!0}while(n<=i);return!1};c(Dn).b1=function(e){return XN(this.v1_1,e)};c(Dn).toString=function(){return b_(this.v1_1)};c(Dn).a2=function(){return[].slice.call(this.v1_1)};c(Dn).toArray=function(){return this.a2()};c(Dn).k=function(){if(this.w1_1)throw Cl()};function DM(e,n){return rl.call(n),Jr.call(n),n.f2_1=e,n}function VN(e){return DM(DN(),e),e}function $M(){return VN(We(c(Jr)))}c(Jr).p1=function(e){return this.f2_1.h2(e)};c(Jr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new qp(this.f2_1);this.g2_1=i,n=i}else n=e;return n};c(Jr).r1=function(e){return this.f2_1.r1(e)};c(Jr).i1=function(e,n){return this.f2_1.i1(e,n)};c(Jr).j1=function(e){return this.f2_1.j1(e)};c(Jr).q=function(){return this.f2_1.q()};function Jr(){this.g2_1=null}function qp(e){mr.call(this,e)}c(qp).l=function(){return this.j2_1.k2()};function mr(e){dl.call(this),this.j2_1=e}c(mr).q=function(){return this.j2_1.q()};c(mr).t=function(){return this.j2_1.q()===0};c(mr).l2=function(e){return this.j2_1.n2(e)};c(mr).r=function(e){return e!=null&&Hn(e,Ao)?this.l2(e!=null&&Hn(e,Ao)?e:en()):!1};c(mr).m2=function(e){throw Cl()};c(mr).i=function(e){return this.m2(e!=null&&Hn(e,Ao)?e:en())};c(mr).p=function(e){throw Cl()};c(mr).s=function(e){return this.j2_1.o2(e)};c(mr).k=function(){return this.j2_1.k()};function JN(e,n){return _M(hn(J5(n,1),3))}function HN(e,n){return _N(n)+1|0}function WM(e){return GM(8,e),e}function DN(){return WM(We(c(Bi)))}function GM(e,n){return Bi.call(n,LN(e),null,new Int32Array(e),new Int32Array(JN(Ac,e)),2,0),n}function ol(e){return e.p2_1.length}function $t(e){return e.s2_1.length}function Vp(e){e.w2_1=e.w2_1+1|0}function zM(e,n){KM(e,n)?Jp(e,$t(e)):XM(e,e.u2_1+n|0)}function KM(e,n){var i=ol(e)-e.u2_1|0,d=e.u2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(ol(e)/4|0):!1}function XM(e,n){if(n<0)throw Ex("too many elements");if(n>ol(e)){var i=Ki.z2(ol(e),n);e.p2_1=SN(e.p2_1,i);var d=e,r=e.q2_1;d.q2_1=r==null?null:SN(r,i),e.r2_1=oB(e.r2_1,i);var t=JN(Ac,i);t>$t(e)&&Jp(e,t)}}function YM(e){var n=e.q2_1;if(n!=null)return n;var i=LN(ol(e));return e.q2_1=i,i}function z5(e,n){return n==null?0:hn(_n(n),-1640531527)>>>e.v2_1|0}function QM(e){for(var n=0,i=0,d=e.q2_1;n<e.u2_1;)e.r2_1[n]>=0&&(e.p2_1[i]=e.p2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;yN(e.p2_1,i,e.u2_1),d==null||yN(d,i,e.u2_1),e.u2_1=i}function Jp(e,n){Vp(e),e.u2_1>e.x2_1&&QM(e),n!==$t(e)?(e.s2_1=new Int32Array(n),e.v2_1=HN(Ac,n)):rB(e.s2_1,0,0,$t(e));for(var i=0;i<e.u2_1;){var d=i;if(i=d+1|0,!jM(e,d))throw Rc("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function jM(e,n){for(var i=z5(e,e.p2_1[n]),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return e.s2_1[i]=n+1|0,e.r2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=$t(e)-1|0)}}function K5(e,n){for(var i=z5(e,n),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return-1;if(r>0&&Ze(e.p2_1[r-1|0],n))return r-1|0;if(d=d-1|0,d<0)return-1;var t=i;i=t-1|0,t===0&&(i=$t(e)-1|0)}}function e_(e,n){e.k();e:for(;;)for(var i=z5(e,n),d=H5(hn(e.t2_1,2),$t(e)/2|0),r=0;;){var t=e.s2_1[i];if(t<=0){if(e.u2_1>=ol(e)){zM(e,1);continue e}var s=e.u2_1;e.u2_1=s+1|0;var f=s;return e.p2_1[f]=n,e.r2_1[f]=i,e.s2_1[i]=f+1|0,e.x2_1=e.x2_1+1|0,Vp(e),r>e.t2_1&&(e.t2_1=r),f}if(Ze(e.p2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){Jp(e,hn($t(e),2));continue e}var p=i;i=p-1|0,p===0&&(i=$t(e)-1|0)}}function n_(e,n){e.k();var i=K5(e,n);return i<0?-1:($N(e,i),i)}function $N(e,n){FN(e.p2_1,n),i_(e,e.r2_1[n]),e.r2_1[n]=-1,e.x2_1=e.x2_1-1|0,Vp(e)}function i_(e,n){for(var i=n,d=n,r=0,t=H5(hn(e.t2_1,2),$t(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=$t(e)-1|0),r=r+1|0,r>e.t2_1)return e.s2_1[d]=0,Ue;var f=e.s2_1[i];if(f===0)return e.s2_1[d]=0,Ue;if(f<0)e.s2_1[d]=-1,d=i,r=0;else{var p=z5(e,e.p2_1[f-1|0]);((p-i|0)&($t(e)-1|0))>=r&&(e.s2_1[d]=f,e.r2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.s2_1[d]=-1,Ue}}function t_(e,n){return e.x2_1===n.q()?e.o2(n.k1()):!1}function WN(){this.a3_1=-1640531527,this.b3_1=8,this.c3_1=2,this.d3_1=-1}var Ac;function Xu(e){this.e3_1=e,this.f3_1=0,this.g3_1=-1,this.h3_1=this.e3_1.w2_1,this.i3()}c(Xu).i3=function(){for(;this.f3_1<this.e3_1.u2_1&&this.e3_1.r2_1[this.f3_1]<0;)this.f3_1=this.f3_1+1|0};c(Xu).m=function(){return this.f3_1<this.e3_1.u2_1};c(Xu).n=function(){if(this.j3(),this.g3_1===-1){var e="Call next() before removing element from the iterator.";throw Rc($r(e))}this.e3_1.k(),$N(this.e3_1,this.g3_1),this.g3_1=-1,this.h3_1=this.e3_1.w2_1};c(Xu).j3=function(){if(this.e3_1.w2_1!==this.h3_1)throw Kp()};function Cc(e){Xu.call(this,e)}c(Cc).o=function(){if(this.j3(),this.f3_1>=this.e3_1.u2_1)throw Y1();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=new Yu(this.e3_1,this.g3_1);return this.i3(),i};c(Cc).o3=function(){if(this.f3_1>=this.e3_1.u2_1)throw Y1();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=this.e3_1.p2_1[this.g3_1],d=i==null?null:_n(i),r=d??0,t=ml(this.e3_1.q2_1)[this.g3_1],s=t==null?null:_n(t),f=r^(s??0);return this.i3(),f};c(Cc).p3=function(e){if(this.f3_1>=this.e3_1.u2_1)throw Y1();var n=this,i=this.f3_1;this.f3_1=i+1|0,n.g3_1=i;var d=this.e3_1.p2_1[this.g3_1];Ze(d,this.e3_1)?e.s3("(this Map)"):e.r3(d),e.t3(61);var r=ml(this.e3_1.q2_1)[this.g3_1];Ze(r,this.e3_1)?e.s3("(this Map)"):e.r3(r),this.i3()};function Yu(e,n){this.u3_1=e,this.v3_1=n}c(Yu).l1=function(){return this.u3_1.p2_1[this.v3_1]};c(Yu).m1=function(){return ml(this.u3_1.q2_1)[this.v3_1]};c(Yu).equals=function(e){var n,i;return e!=null&&Hn(e,Ao)?i=Ze(e.l1(),this.l1()):i=!1,i?n=Ze(e.m1(),this.m1()):n=!1,n};c(Yu).hashCode=function(){var e=this.l1(),n=e==null?null:_n(e),i=n??0,d=this.m1(),r=d==null?null:_n(d);return i^(r??0)};c(Yu).toString=function(){return""+this.l1()+"="+this.m1()};function Bi(e,n,i,d,r,t){this.p2_1=e,this.q2_1=n,this.r2_1=i,this.s2_1=d,this.t2_1=r,this.u2_1=t,this.v2_1=HN(Ac,$t(this)),this.w2_1=0,this.x2_1=0,this.y2_1=!1}c(Bi).q=function(){return this.x2_1};c(Bi).r1=function(e){var n=K5(this,e);return n<0?null:ml(this.q2_1)[n]};c(Bi).h2=function(e){return K5(this,e)>=0};c(Bi).i1=function(e,n){var i=e_(this,e),d=YM(this);if(i<0){var r=d[(-i|0)-1|0];return d[(-i|0)-1|0]=n,r}else return d[i]=n,null};c(Bi).j1=function(e){var n=n_(this,e);if(n<0)return null;var i=ml(this.q2_1),d=i[n];return FN(i,n),d};c(Bi).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&Hn(e,Co)?i=t_(this,e):i=!1,n=i}return n};c(Bi).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.o3()|0;return e};c(Bi).toString=function(){var e=o_(2+hn(this.x2_1,3)|0);e.s3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.s3(", "),i.p3(e),n=n+1|0;return e.s3("}"),e.toString()};c(Bi).k=function(){if(this.y2_1)throw Cl()};c(Bi).n2=function(e){var n=K5(this,e.l1());return n<0?!1:Ze(ml(this.q2_1)[n],e.m1())};c(Bi).w3=function(e){return this.n2(Hn(e,Ao)?e:en())};c(Bi).k2=function(){return new Cc(this)};function GN(){}function r_(e){return VN(e),X5.call(e),e}function gc(){return r_(We(c(X5)))}c(X5).k=function(){return this.f2_1.k()};function X5(){}function d_(e,n){return zN(n),n}function o_(e){return d_(e,We(c(Dr)))}function zN(e){return Dr.call(e,""),e}function Hp(){return zN(We(c(Dr)))}function Dr(e){this.q3_1=e!==void 0?e:""}c(Dr).a=function(){return this.q3_1.length};c(Dr).b=function(e){var n=this.q3_1,i;if(e>=0&&e<=Hx(n))i=al(n,e);else throw Sl("index: "+e+", length: "+this.a()+"}");return i};c(Dr).t3=function(e){return this.q3_1=this.q3_1+D5(e),this};c(Dr).d4=function(e){return this.q3_1=this.q3_1+bc(e),this};c(Dr).r3=function(e){return this.q3_1=this.q3_1+bc(e),this};c(Dr).s3=function(e){var n=this,i=this.q3_1;return n.q3_1=i+(e??"null"),this};c(Dr).toString=function(){return this.q3_1};function wN(e){var n=D5(e).toUpperCase();return n.length>1?e:al(n,0)}function a_(e,n,i,d,r,t){return t=t===L?!1:t,Wx(e,n,i,d,r,t)}function Dp(e){switch(e.length){case 0:return Gr();case 1:return G5(e[0]);default:return u_(e)}}function KN(e){return e.length-1|0}function u_(e){return ZN(PB(e))}function XN(e,n){if(n==null){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;if(i=i+1|0,e[r]==null)return r}while(i<=d)}else{var t=0,s=e.length-1|0;if(t<=s)do{var f=t;if(t=t+1|0,Ze(n,e[f]))return f}while(t<=s)}return-1}function l_(e,n){return XN(e,n)>=0}function s_(e,n,i,d,r,t,s){return n=n===L?", ":n,i=i===L?"":i,d=d===L?"":d,r=r===L?-1:r,t=t===L?"...":t,s=s===L?null:s,f_(e,Hp(),n,i,d,r,t,s).toString()}function f_(e,n,i,d,r,t,s,f){i=i===L?", ":i,d=d===L?"":d,r=r===L?"":r,t=t===L?-1:t,s=s===L?"...":s,f=f===L?null:f,n.d4(d);var p=0,v=0,w=e.length;e:for(;v<w;){var b=e[v];if(v=v+1|0,p=p+1|0,p>1&&n.d4(i),t<0||p<=t)Jx(n,b,f);else break e}return t>=0&&p>t&&n.d4(s),n.d4(r),n}function YN(e,n,i,d,r,t,s){return n=n===L?", ":n,i=i===L?"":i,d=d===L?"":d,r=r===L?-1:r,t=t===L?"...":t,s=s===L?null:s,c_(e,Hp(),n,i,d,r,t,s).toString()}function c_(e,n,i,d,r,t,s,f){i=i===L?", ":i,d=d===L?"":d,r=r===L?"":r,t=t===L?-1:t,s=s===L?"...":s,f=f===L?null:f,n.d4(d);var p=0,v=e.l();e:for(;v.m();){var w=v.o();if(p=p+1|0,p>1&&n.d4(i),t<0||p<=t)Jx(n,w,f);else break e}return t>=0&&p>t&&n.d4(s),n.d4(r),n}function QN(e){if(e.t())throw Nc("List is empty.");return e.x(0)}function J5(e,n){return e<n?n:e}function p_(e,n){return Vx.e4(e,n,-1)}function H5(e,n){return e>n?n:e}function h_(e){var n=e&65535;return n}function AN(e){return e}function D5(e){return String.fromCharCode(e)}function jN(){Tp=this,this.f4_1=0,this.g4_1=65535,this.h4_1=55296,this.i4_1=56319,this.j4_1=56320,this.k4_1=57343,this.l4_1=55296,this.m4_1=57343,this.n4_1=2,this.o4_1=16}var Tp;function CN(){return Tp==null&&new jN,Tp}function ex(){}function pl(){}function Xi(){}function Ao(){}function Co(){}function Y5(){}function nx(){}var v_;function mt(e,n){this.p4_1=e,this.q4_1=n}c(mt).r4=function(){return this.p4_1};c(mt).s4=function(){return this.q4_1};c(mt).t4=function(e){return R_(this.q4_1,e.q4_1)};c(mt).u4=function(e){return this.t4(e instanceof mt?e:en())};c(mt).equals=function(e){return this===e};c(mt).hashCode=function(){return x_(this)};c(mt).toString=function(){return this.p4_1};function bc(e){var n=e==null?null:$r(e);return n??"null"}function m_(e){for(var n=1,i=[],d=0,r=e.length;d<r;){var t=e[d];d=d+1|0;var s=n,f=t.prototype.$imask$,p=f??t.$imask$;p!=null&&(i.push(p),s=p.length);var v=t.$metadata$.iid,w;v==null?w=null:w=k_(v);var b=w;b!=null&&(i.push(b),s=Math.max(s,b.length)),s>n&&(n=s)}return y_(n,i)}function k_(e){var n=e>>5,i=new Int32Array(n+1|0),d=e&31,r=1<<d;return i[n]=i[n]|r,i}function y_(e,n){for(var i=0,d=new Int32Array(e);i<e;){for(var r=i,t=0,s=0,f=n.length;s<f;){var p=n[s];s=s+1|0,r<p.length&&(t=t|p[r])}d[r]=t,i=i+1|0}return d}function S_(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function hl(e,n){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;i=i+1|0,e[r]=n}while(r!==d);return e}function w_(e){return new Q5(e)}function Q5(e){this.w4_1=e,this.v4_1=0}c(Q5).m=function(){return this.v4_1!==this.w4_1.length};c(Q5).o=function(){var e;if(this.v4_1!==this.w4_1.length){var n=this.v4_1;this.v4_1=n+1|0,e=this.w4_1[n]}else throw Nc(""+this.v4_1);return e};function yp(){return vl(),ix}var ix;function tx(){return vl(),rx}var rx,A_;function Rp(){return vl(),dx}var dx;function ox(){return vl(),ax}var ax;function C_(){return vl(),ux}var ux;function g_(e){return vl(),(e|0)===e?Sx(e):(tx()[0]=e,hn(Rp()[C_()],31)+Rp()[ox()]|0)}var gN;function vl(){gN||(gN=!0,ix=new ArrayBuffer(8),rx=new Float64Array(yp()),A_=new Float32Array(yp()),dx=new Int32Array(yp()),tx()[0]=-1,ax=Rp()[0]!==0?1:0,ux=1-ox()|0)}function al(e,n){var i;if(lx(e)){var d=e.charCodeAt(n),r;CN();var t=0;if(d<AN(t))r=!0;else{CN();var s=65535;r=d>AN(s)}if(r)throw Hr("Invalid Char code: "+d);i=Q_(d)}else i=e.b(n);return i}function lx(e){return typeof e=="string"}function z1(e){var n;return lx(e)?n=e.length:n=e.a(),n}function b_(e){return s_(e,", ","[","]",L,L,T_)}function T_(e){return $r(e)}function R_(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=bN(e,n):n instanceof Ee?d=bN(e,n.z4()):d=TN(e,n),i=d;break;case"string":case"boolean":i=TN(e,n);break;default:i=N_(e,n);break}return i}function bN(e,n){var i;if(e<n)i=-1;else if(e>n)i=1;else if(e===n){var d;if(e!==0)d=0;else{var r=1/e,t;r===1/n?t=0:r<0?t=-1:t=1,d=t}i=d}else e!==e?i=n!==n?0:1:i=-1;return i}function TN(e,n){return e<n?-1:e>n?1:0}function N_(e,n){return e.u4(n)}function x_(e){return Np(e)}function Np(e){if(!("kotlinHashCodeValue$"in e)){var n=sx(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function sx(){return Math.random()*4294967296|0}function $r(e){var n;return e==null?n="null":eB(e)?n="[...]":typeof e.toString!="function"?n=I_(e):n=e.toString(),n}function I_(e){return Object.prototype.toString.call(e)}function _n(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():Np(e);break;case"function":i=Np(e);break;case"number":i=g_(e);break;case"boolean":i=E_(e);break;case"string":i=$p(String(e));break;case"bigint":i=O_(e);break;case"symbol":i=P_(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function E_(e){return e?1231:1237}function $p(e){var n=0,i=e.length,d=0,r=i-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e.charCodeAt(t);n=hn(n,31)+s|0}while(t!==r);return n}function O_(e){for(var n=BigInt(32),i=BigInt(4294967295),d=e<0?-e:e,r=0,t=e<0?-1:1;d!=0;){var s=Number(d&i);r=hn(31,r)+s|0,d=d>>n}return hn(r,t)}function P_(e){var n=M_(e)?__():B_(),i=n.get(e);if(i!==L)return i;var d=sx();return n.set(e,d),d}function M_(e){return Symbol.keyFor(e)!=L}function __(){return Sp===L&&(Sp=new Map),Sp}function B_(){return wp===L&&(wp=new WeakMap),wp}var Sp,wp;function Ze(e,n){if(e==null)return n==null;if(n==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(n);if(e!==e)return n!==n;if(typeof e=="number"&&typeof n=="number"){var i;if(e===n){var d;if(e!==0)d=!0;else{var r=1/e;d=r===1/n}i=d}else i=!1;return i}return e===n}function qe(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function c(e){return e.prototype}function $n(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function We(e){return Object.create(e)}function fx(e,n,i){Error.call(e),L_(e,n,i)}function L_(e,n,i){var d=Cx(Object.getPrototypeOf(e));if(!(d&1)){var r;if(n==null){var t;if(n!==null){var s=i==null?null:i.toString();t=s??L}else t=L;r=t}else r=n;e.message=r}d&2||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}function ml(e){var n;return e==null?F_():n=e,n}function F_(){throw Xp()}function en(){throw Yp()}function Tc(e){throw _x("lateinit property "+e+" has not been initialized")}function Wp(e){throw Hr(e)}function U_(e,n){for(var i=e.length,d=n.length,r=0,t=n;r<i&&r<d;){var s=r,f=r;r=f+1|0,t[s]=e[f]}return n}function Z_(e,n,i){var d=e.slice(0,n);e.$type$!==void 0&&(d.$type$=e.$type$);var r=e.length;if(n>r)for(d.length=n;r<n;){var t=r;r=t+1|0,d[t]=i}return d}function cx(){xp=this,this.a5_1=new Ee(0,-2147483648),this.b5_1=new Ee(-1,2147483647),this.c5_1=8,this.d5_1=64}var xp;function q_(){return xp==null&&new cx,xp}function Ee(e,n){q_(),Lp.call(this),this.x4_1=e,this.y4_1=n}c(Ee).e5=function(e){return j5(this,e)};c(Ee).u4=function(e){return this.e5(e instanceof Ee?e:en())};c(Ee).f5=function(e){return $5(this,e)};c(Ee).g5=function(e){return ul(this,e)};c(Ee).h5=function(e){return J_(this,e)};c(Ee).i5=function(){return this.j5().f5(new Ee(1,0))};c(Ee).j5=function(){return new Ee(~this.x4_1,~this.y4_1)};c(Ee).k5=function(){return this.x4_1};c(Ee).z4=function(){return Sc(this)};c(Ee).valueOf=function(){return this.z4()};c(Ee).equals=function(e){var n;return e instanceof Ee?n=qr(this,e):n=!1,n};c(Ee).hashCode=function(){return $_(this)};c(Ee).toString=function(){return Ip(this,10)};function wo(){return nn(),px}var px;function V5(){return nn(),hx}var hx;function RN(){return nn(),vx}var vx;function V_(){return nn(),mx}var mx;function Cd(){return nn(),kx}var kx;function NN(){return nn(),yx}var yx;function j5(e,n){if(nn(),qr(e,n))return 0;var i=pr(e),d=pr(n);return i&&!d?-1:!i&&d?1:pr(ul(e,n))?-1:1}function $5(e,n){nn();var i=e.y4_1>>>16|0,d=e.y4_1&65535,r=e.x4_1>>>16|0,t=e.x4_1&65535,s=n.y4_1>>>16|0,f=n.y4_1&65535,p=n.x4_1>>>16|0,v=n.x4_1&65535,w=0,b=0,g=0,_=0;return _=_+(t+v|0)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+(r+p|0)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(d+f|0)|0,w=w+(b>>>16|0)|0,b=b&65535,w=w+(i+s|0)|0,w=w&65535,new Ee(g<<16|_,w<<16|b)}function ul(e,n){return nn(),$5(e,n.i5())}function K1(e,n){if(nn(),Ku(e))return wo();if(Ku(n))return wo();if(qr(e,Cd()))return xN(n)?Cd():wo();if(qr(n,Cd()))return xN(e)?Cd():wo();if(pr(e)){var i;return pr(n)?i=K1(ht(e),ht(n)):i=ht(K1(ht(e),n)),i}else if(pr(n))return ht(K1(e,ht(n)));if(IN(e,NN())&&IN(n,NN()))return ll(Sc(e)*Sc(n));var d=e.y4_1>>>16|0,r=e.y4_1&65535,t=e.x4_1>>>16|0,s=e.x4_1&65535,f=n.y4_1>>>16|0,p=n.y4_1&65535,v=n.x4_1>>>16|0,w=n.x4_1&65535,b=0,g=0,_=0,X=0;return X=X+hn(s,w)|0,_=_+(X>>>16|0)|0,X=X&65535,_=_+hn(t,w)|0,g=g+(_>>>16|0)|0,_=_&65535,_=_+hn(s,v)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+hn(r,w)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+hn(t,v)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+hn(s,p)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(((hn(d,w)+hn(r,v)|0)+hn(t,p)|0)+hn(s,f)|0)|0,b=b&65535,new Ee(_<<16|X,b<<16|g)}function J_(e,n){if(nn(),Ku(n))throw zp("division by zero");if(Ku(e))return wo();if(qr(e,Cd())){if(qr(n,V5())||qr(n,RN()))return Cd();if(qr(n,Cd()))return V5();var i=D_(e,1),d=H_(i.h5(n),1);if(qr(d,wo()))return pr(n)?V5():RN();var r=ul(e,K1(n,d));return $5(d,r.h5(n))}else if(qr(n,Cd()))return wo();if(pr(e)){var t;return pr(n)?t=ht(e).h5(ht(n)):t=ht(ht(e).h5(n)),t}else if(pr(n))return ht(e.h5(ht(n)));for(var s=wo(),f=e;G_(f,n);){for(var p=Sc(f)/Sc(n),v=Math.max(1,Math.floor(p)),w=Math.ceil(Math.log(v)/Math.LN2),b=w<=48?1:Math.pow(2,w-48),g=ll(v),_=K1(g,n);pr(_)||W_(_,f);)v=v-b,g=ll(v),_=K1(g,n);Ku(g)&&(g=V5()),s=$5(s,g),f=ul(f,_)}return s}function H_(e,n){nn();var i=n&63;return i===0?e:i<32?new Ee(e.x4_1<<i,e.y4_1<<i|(e.x4_1>>>(32-i|0)|0)):new Ee(0,e.x4_1<<(i-32|0))}function D_(e,n){nn();var i=n&63;return i===0?e:i<32?new Ee(e.x4_1>>>i|0|e.y4_1<<(32-i|0),e.y4_1>>i):new Ee(e.y4_1>>(i-32|0),e.y4_1>=0?0:-1)}function Sc(e){return nn(),e.y4_1*4294967296+z_(e)}function qr(e,n){return nn(),e.y4_1===n.y4_1?e.x4_1===n.x4_1:!1}function $_(e){return nn(),e.x4_1^e.y4_1}function Ip(e,n){if(nn(),n<2||36<n)throw zp("radix out of range: "+n);if(Ku(e))return"0";if(pr(e))if(qr(e,Cd())){var i=yc(n),d=e.h5(i),r=ul(K1(d,i),e).k5(),t=Ip(d,n);return t+r.toString(n)}else return"-"+Ip(ht(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=ll(Math.pow(n,s)),p=e,v="";;){var w=p.h5(f),b=ul(p,K1(w,f)).k5(),g=b.toString(n);if(p=w,Ku(p))return g+v;for(;g.length<s;)g="0"+g;v=g+v}}function yc(e){return nn(),new Ee(e,e<0?-1:0)}function pr(e){return nn(),e.y4_1<0}function Ku(e){return nn(),e.y4_1===0?e.x4_1===0:!1}function xN(e){return nn(),(e.x4_1&1)===1}function ht(e){return nn(),e.i5()}function IN(e,n){return nn(),j5(e,n)<0}function ll(e){if(nn(),MM(e))return wo();if(e<=-9223372036854776e3)return Cd();if(e+1>=9223372036854776e3)return V_();if(e<0)return ht(ll(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Ee(i,d)}function W_(e,n){return nn(),j5(e,n)>0}function G_(e,n){return nn(),j5(e,n)>=0}function z_(e){return nn(),e.x4_1>=0?e.x4_1:4294967296+e.x4_1}var EN;function nn(){EN||(EN=!0,px=yc(0),hx=yc(1),vx=yc(-1),mx=new Ee(-1,2147483647),kx=new Ee(0,-2147483648),yx=yc(16777216))}function re(e,n,i,d,r){return Gp("class",e,n,i,d,r,null)}function Gp(e,n,i,d,r,t,s){var f=L;return{kind:e,simpleName:n,associatedObjectKey:d,associatedObjects:r,suspendArity:t,$kClass$:f,defaultConstructor:i,iid:s}}function Z(e,n,i,d,r,t,s,f,p){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,p??[]);if(e.$metadata$=v,r!=null){var w=v.iid!=null?e:e.prototype;w.$imask$=m_(r)}}function To(e,n,i,d,r){return Gp("interface",e,n,i,d,r,K_())}function K_(){return kc===L&&(kc=0),kc=kc+1|0,kc}var kc;function ei(e,n,i,d,r){return Gp("object",e,n,i,d,r,null)}function kl(e){var n=e.length,i=Array(n),d=0,r=n-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e[t];s!=null&&sl(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function Sx(e){var n;return e instanceof Ee?n=e.k5():n=X_(e),n}function X_(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function Y_(e){return e<<16>>16}function wx(e){var n;return e instanceof Ee?n=e:n=ll(e),n}function Q_(e){var n=Sx(e),i=Y_(n);return h_(i)}function j_(e,n){return new X1(e,n)}function eB(e){return Ax(e)?!0:gp(e)}function Ax(e){return Array.isArray(e)}function Hn(e,n){return nB(e,n.$metadata$.iid)}function nB(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return S_(r,n)}function sl(e){var n;return Ax(e)?n=!e.$type$:n=!1,n}function iB(e){return typeof e=="string"?!0:Hn(e,Bp)}function Cx(e){var n=e.constructor,i=n==null?null:n.$metadata$,d=i==null?null:i.errorInfo;if(d!=null)return d;var r=0;if(ON(e,"message")&&(r=r|1),ON(e,"cause")&&(r=r|2),r!==3){var t=tB(e);t!=Error.prototype&&(r=r|Cx(t))}return i!=null&&(i.errorInfo=r),r}function ON(e,n){return e.hasOwnProperty(n)}function tB(e){return Object.getPrototypeOf(e)}var L;function rB(e,n,i,d){i=i===L?0:i,d=d===L?e.length:d,Ki.h(i,d,e.length),e.fill(n,i,d)}function Ap(e,n,i,d){i=i===L?0:i,d=d===L?e.length:d,Ki.h(i,d,e.length),e.fill(n,i,d)}function dB(e){return new Dn(e)}function oB(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw Hr($r(i))}return U_(e,new Int32Array(n))}function aB(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw Hr($r(i))}return Z_(e,n,null)}function gx(e){return fx(e),Ro.call(e),e}function bx(){var e=gx(We(c(Ro)));return qe(e,bx),e}function Tx(e,n){return fx(n,e),Ro.call(n),n}function zp(e){var n=Tx(e,We(c(Ro)));return qe(n,zp),n}function Ro(){qe(this,Ro)}function uB(e){return Wr(e),yl.call(e),e}function Rx(){var e=uB(We(c(yl)));return qe(e,Rx),e}function lB(e,n){return Qu(e,n),yl.call(n),n}function Hr(e){var n=lB(e,We(c(yl)));return qe(n,Hr),n}function yl(){qe(this,yl)}function sB(e){return Wr(e),wl.call(e),e}function Nx(){var e=sB(We(c(wl)));return qe(e,Nx),e}function fB(e,n){return Qu(e,n),wl.call(n),n}function Sl(e){var n=fB(e,We(c(wl)));return qe(n,Sl),n}function wl(){qe(this,wl)}function cB(e){return Wr(e),Al.call(e),e}function xx(){var e=cB(We(c(Al)));return qe(e,xx),e}function pB(e,n){return Qu(e,n),Al.call(n),n}function Rc(e){var n=pB(e,We(c(Al)));return qe(n,Rc),n}function Al(){qe(this,Al)}function hB(e){return Wr(e),e4.call(e),e}function Cl(){var e=hB(We(c(e4)));return qe(e,Cl),e}function e4(){qe(this,e4)}function Wr(e){return gx(e),Li.call(e),e}function Ix(){var e=Wr(We(c(Li)));return qe(e,Ix),e}function Qu(e,n){return Tx(e,n),Li.call(n),n}function Ex(e){var n=Qu(e,We(c(Li)));return qe(n,Ex),n}function Li(){qe(this,Li)}function vB(e){return Wr(e),gl.call(e),e}function Y1(){var e=vB(We(c(gl)));return qe(e,Y1),e}function mB(e,n){return Qu(e,n),gl.call(n),n}function Nc(e){var n=mB(e,We(c(gl)));return qe(n,Nc),n}function gl(){qe(this,gl)}function kB(e){return Wr(e),n4.call(e),e}function Kp(){var e=kB(We(c(n4)));return qe(e,Kp),e}function n4(){qe(this,n4)}function yB(e){return Wr(e),bl.call(e),e}function Ox(){var e=yB(We(c(bl)));return qe(e,Ox),e}function SB(e,n){return Qu(e,n),bl.call(n),n}function Px(e){var n=SB(e,We(c(bl)));return qe(n,Px),n}function bl(){qe(this,bl)}function wB(e){return Wr(e),i4.call(e),e}function Xp(){var e=wB(We(c(i4)));return qe(e,Xp),e}function i4(){qe(this,i4)}function AB(e){return Wr(e),t4.call(e),e}function Yp(){var e=AB(We(c(t4)));return qe(e,Yp),e}function t4(){qe(this,t4)}function CB(e){return Wr(e),Tl.call(e),e}function Mx(){var e=CB(We(c(Tl)));return qe(e,Mx),e}function gB(e,n){return Qu(e,n),Tl.call(n),n}function _x(e){var n=gB(e,We(c(Tl)));return qe(n,_x),n}function Tl(){qe(this,Tl)}function bB(e){return function(n){return n===e?"(this Collection)":bc(n)}}function go(){}c(go).r=function(e){var n;e:{var i;if(Hn(this,Xi)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=!0;break e}}n=!1}return n};c(go).s=function(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.r(r)){n=!1;break e}}n=!0}return n};c(go).t=function(){return this.q()===0};c(go).toString=function(){return YN(this,", ","[","]",L,L,bB(this))};c(go).toArray=function(){return BN(this)};function Q1(){this.g_1=2147483639}c(Q1).y1=function(e,n){if(e<0||e>=n)throw Sl("index: "+e+", size: "+n)};c(Q1).z1=function(e,n){if(e<0||e>n)throw Sl("index: "+e+", size: "+n)};c(Q1).h=function(e,n,i){if(e<0||n>i)throw Sl("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw Hr("fromIndex: "+e+" > toIndex: "+n)};c(Q1).z2=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?Up.MAX_VALUE:2147483639),i};c(Q1).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=hn(31,n),t=d==null?null:_n(d);n=r+(t??0)|0}return n};c(Q1).c1=function(e,n){if(e.q()!==n.q())return!1;for(var i=n.l(),d=e.l();d.m();){var r=d.o(),t=i.o();if(!Ze(r,t))return!1}return!0};var Ki;function PN(e,n){return n===e?"(this Map)":bc(n)}function Bx(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Ze(r.l1(),n)){i=r;break e}}i=null}return i}function Lx(){}var TB;function RB(e){return function(n){return e.n5(n)}}function vr(){this.n1_1=null,this.o1_1=null}c(vr).p1=function(e){return Bx(this,e)!=null};c(vr).q1=function(e){if(!(e!=null&&Hn(e,Ao)))return!1;var n=e.l1(),i=e.m1(),d=(Hn(this,Co)?this:en()).r1(n);if(!Ze(i,d))return!1;var r;return d==null?r=!(Hn(this,Co)?this:en()).p1(n):r=!1,!r};c(vr).equals=function(e){if(e===this)return!0;if(!(e!=null&&Hn(e,Co))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(Hn(i,Xi)?d=i.t():d=!1,d){n=!0;break e}for(var r=i.l();r.m();){var t=r.o();if(!this.q1(t)){n=!1;break e}}n=!0}return n};c(vr).r1=function(e){var n=Bx(this,e);return n==null?null:n.m1()};c(vr).hashCode=function(){return _n(this.k1())};c(vr).q=function(){return this.k1().q()};c(vr).toString=function(){var e=this.k1();return YN(e,", ","{","}",L,L,RB(this))};c(vr).n5=function(e){return PN(this,e.l1())+"="+PN(this,e.m1())};function r4(){}c(r4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:_n(d);n=r+(t??0)|0}return n};c(r4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var Qp;function NB(e){return hr.call(e),Nn.call(e),e.q5_1=jp().s5_1,e}function xc(){return NB(We(c(Nn)))}function Ic(e,n){if(n<0)throw Rc("Deque is too big.");if(n<=e.q5_1.length)return Ue;if(e.q5_1===jp().s5_1){var i=e,d=J5(n,10);return i.q5_1=hl(Array(d),null),Ue}var r=Ki.z2(e.q5_1.length,n);xB(e,r)}function xB(e,n){var i=hl(Array(n),null),d=e.q5_1,r=e.p5_1,t=e.q5_1.length;Fe(d,i,0,r,t);var s=e.q5_1,f=e.q5_1.length-e.p5_1|0,p=e.p5_1;Fe(s,i,f,0,p),e.p5_1=0,e.q5_1=i}function Wt(e,n){return n>=e.q5_1.length?n-e.q5_1.length|0:n}function IB(e,n){return n<0?n+e.q5_1.length|0:n}function Fx(e,n){return n===KN(e.q5_1)?0:n+1|0}function Ep(e,n){return n===0?KN(e.q5_1):n-1|0}function Op(e,n,i){var d=i.l(),r=n,t=e.q5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.q5_1[s]=d.o()}while(r<t);var f=0,p=e.p5_1;if(f<p)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.q5_1[v]=d.o()}while(f<p);e.r5_1=e.r5_1+i.q()|0}function Ux(){Pp=this;var e=this;e.s5_1=[],this.t5_1=10}var Pp;function jp(){return Pp==null&&new Ux,Pp}c(Nn).q=function(){return this.r5_1};c(Nn).t=function(){return this.r5_1===0};c(Nn).u5=function(e){Ic(this,this.r5_1+1|0),this.p5_1=Ep(this,this.p5_1),this.q5_1[this.p5_1]=e,this.r5_1=this.r5_1+1|0};c(Nn).v5=function(e){Ic(this,this.r5_1+1|0);var n=this.q5_1,i=this.r5_1;n[Wt(this,this.p5_1+i|0)]=e,this.r5_1=this.r5_1+1|0};c(Nn).w5=function(){if(this.t())throw Nc("ArrayDeque is empty.");var e=this.p5_1,n=this.q5_1[e],i=n==null||n!=null?n:en();return this.q5_1[this.p5_1]=null,this.p5_1=Fx(this,this.p5_1),this.r5_1=this.r5_1-1|0,i};c(Nn).x5=function(){if(this.t())throw Nc("ArrayDeque is empty.");var e=W5(this),n=Wt(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:en();return this.q5_1[n]=null,this.r5_1=this.r5_1-1|0,d};c(Nn).i=function(e){return this.v5(e),!0};c(Nn).a1=function(e,n){if(Ki.z1(e,this.r5_1),e===this.r5_1)return this.v5(n),Ue;if(e===0)return this.u5(n),Ue;Ic(this,this.r5_1+1|0);var i=Wt(this,this.p5_1+e|0);if(e<(this.r5_1+1|0)>>1){var d=Ep(this,i),r=Ep(this,this.p5_1);if(d>=this.p5_1){this.q5_1[r]=this.q5_1[this.p5_1];var t=this.q5_1,s=this.q5_1,f=this.p5_1,p=this.p5_1+1|0,v=d+1|0;Fe(t,s,f,p,v)}else{var w=this.q5_1,b=this.q5_1,g=this.p5_1-1|0,_=this.p5_1,X=this.q5_1.length;Fe(w,b,g,_,X),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Se=this.q5_1,_e=this.q5_1,ri=d+1|0;Fe(Se,_e,0,1,ri)}this.q5_1[d]=n,this.p5_1=r}else{var bi=this.r5_1,ji=Wt(this,this.p5_1+bi|0);if(i<ji){var yt=this.q5_1,xd=this.q5_1,jr=i+1|0;Fe(yt,xd,jr,i,ji)}else{var ed=this.q5_1,Id=this.q5_1;Fe(ed,Id,1,0,ji),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var wr=this.q5_1,Ed=this.q5_1,nd=i+1|0,Mo=this.q5_1.length-1|0;Fe(wr,Ed,nd,i,Mo)}this.q5_1[i]=n}this.r5_1=this.r5_1+1|0};c(Nn).p=function(e){if(e.t())return!1;Ic(this,this.r5_1+e.q()|0);var n=this.r5_1,i=Wt(this,this.p5_1+n|0);return Op(this,i,e),!0};c(Nn).y5=function(e,n){if(Ki.z1(e,this.r5_1),n.t())return!1;if(e===this.r5_1)return this.p(n);Ic(this,this.r5_1+n.q()|0);var i=this.r5_1,d=Wt(this,this.p5_1+i|0),r=Wt(this,this.p5_1+e|0),t=n.q();if(e<(this.r5_1+1|0)>>1){var s=this.p5_1-t|0;if(r>=this.p5_1)if(s>=0){var f=this.q5_1,p=this.q5_1,v=s,w=this.p5_1;Fe(f,p,v,w,r)}else{s=s+this.q5_1.length|0;var b=r-this.p5_1|0,g=this.q5_1.length-s|0;if(g>=b){var _=this.q5_1,X=this.q5_1,Se=s,_e=this.p5_1;Fe(_,X,Se,_e,r)}else{var ri=this.q5_1,bi=this.q5_1,ji=s,yt=this.p5_1,xd=this.p5_1+g|0;Fe(ri,bi,ji,yt,xd);var jr=this.q5_1,ed=this.q5_1,Id=this.p5_1+g|0;Fe(jr,ed,0,Id,r)}}else{var wr=this.q5_1,Ed=this.q5_1,nd=s,Mo=this.p5_1,Pl=this.q5_1.length;if(Fe(wr,Ed,nd,Mo,Pl),t>=r){var s0=this.q5_1,f0=this.q5_1,Z4=this.q5_1.length-t|0;Fe(s0,f0,Z4,0,r)}else{var jI=this.q5_1,eE=this.q5_1,nE=this.q5_1.length-t|0;Fe(jI,eE,nE,0,t);var iE=this.q5_1,tE=this.q5_1;Fe(iE,tE,0,t,r)}}this.p5_1=s,Op(this,IB(this,r-t|0),n)}else{var uu=r+t|0;if(r<d)if((d+t|0)<=this.q5_1.length){var rE=this.q5_1,dE=this.q5_1;Fe(rE,dE,uu,r,d)}else if(uu>=this.q5_1.length){var oE=this.q5_1,aE=this.q5_1,uE=uu-this.q5_1.length|0;Fe(oE,aE,uE,r,d)}else{var V8=(d+t|0)-this.q5_1.length|0,lE=this.q5_1,sE=this.q5_1,fE=d-V8|0;Fe(lE,sE,0,fE,d);var cE=this.q5_1,pE=this.q5_1,hE=d-V8|0;Fe(cE,pE,uu,r,hE)}else{var vE=this.q5_1,mE=this.q5_1;if(Fe(vE,mE,t,0,d),uu>=this.q5_1.length){var kE=this.q5_1,yE=this.q5_1,SE=uu-this.q5_1.length|0,wE=this.q5_1.length;Fe(kE,yE,SE,r,wE)}else{var AE=this.q5_1,CE=this.q5_1,gE=this.q5_1.length-t|0,bE=this.q5_1.length;Fe(AE,CE,0,gE,bE);var TE=this.q5_1,RE=this.q5_1,NE=this.q5_1.length-t|0;Fe(TE,RE,uu,r,NE)}}Op(this,r,n)}return!0};c(Nn).x=function(e){Ki.y1(e,this.r5_1);var n=Wt(this,this.p5_1+e|0),i=this.q5_1[n];return i==null||i!=null?i:en()};c(Nn).r=function(e){return this.b1(e)!==-1};c(Nn).b1=function(e){var n=this.r5_1,i=Wt(this,this.p5_1+n|0);if(this.p5_1<i){var d=this.p5_1;if(d<i)do{var r=d;if(d=d+1|0,Ze(e,this.q5_1[r]))return r-this.p5_1|0}while(d<i)}else if(this.p5_1>=i){var t=this.p5_1,s=this.q5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Ze(e,this.q5_1[f]))return f-this.p5_1|0}while(t<s);var p=0;if(p<i)do{var v=p;if(p=p+1|0,Ze(e,this.q5_1[v]))return(v+this.q5_1.length|0)-this.p5_1|0}while(p<i)}return-1};c(Nn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};c(Nn).z=function(e){if(Ki.y1(e,this.r5_1),e===W5(this))return this.x5();if(e===0)return this.w5();var n=Wt(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:en();if(e<this.r5_1>>1){if(n>=this.p5_1){var r=this.q5_1,t=this.q5_1,s=this.p5_1+1|0,f=this.p5_1;Fe(r,t,s,f,n)}else{var p=this.q5_1,v=this.q5_1;Fe(p,v,1,0,n),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var w=this.q5_1,b=this.q5_1,g=this.p5_1+1|0,_=this.p5_1,X=this.q5_1.length-1|0;Fe(w,b,g,_,X)}this.q5_1[this.p5_1]=null,this.p5_1=Fx(this,this.p5_1)}else{var Se=W5(this),_e=Wt(this,this.p5_1+Se|0);if(n<=_e){var ri=this.q5_1,bi=this.q5_1,ji=n+1|0,yt=_e+1|0;Fe(ri,bi,n,ji,yt)}else{var xd=this.q5_1,jr=this.q5_1,ed=n+1|0,Id=this.q5_1.length;Fe(xd,jr,n,ed,Id),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var wr=this.q5_1,Ed=this.q5_1,nd=_e+1|0;Fe(wr,Ed,0,1,nd)}this.q5_1[_e]=null}return this.r5_1=this.r5_1-1|0,d};c(Nn).z5=function(){var e=this.r5_1,n=Wt(this,this.p5_1+e|0);this.p5_1<n?Ap(this.q5_1,null,this.p5_1,n):this.t()||(Ap(this.q5_1,null,this.p5_1,this.q5_1.length),Ap(this.q5_1,null,0,n)),this.p5_1=0,this.r5_1=0};c(Nn).a6=function(e){var n=e.length>=this.r5_1?e:LM(e,this.r5_1),i=sl(n)?n:en(),d=this.r5_1,r=Wt(this,this.p5_1+d|0);if(this.p5_1<r){var t=this.q5_1,s=this.p5_1;Fe(t,i,0,s,r)}else if(!this.t()){var f=this.q5_1,p=this.p5_1,v=this.q5_1.length;Fe(f,i,0,p,v);var w=this.q5_1,b=this.q5_1.length-this.p5_1|0;Fe(w,i,b,0,r)}var g=BM(this.r5_1,i);return sl(g)?g:en()};c(Nn).a2=function(){var e=this.r5_1,n=hl(Array(e),null);return this.a6(n)};c(Nn).toArray=function(){return this.a2()};function Nn(){jp(),this.p5_1=0,this.r5_1=0}function EB(e){if(e.t())return[];for(var n=e.q(),i=hl(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function Gr(){return OB()}function W5(e){return e.q()-1|0}function zr(){Mp=this,this.b6_1=new Ee(-1478467534,-1720727600)}c(zr).equals=function(e){var n;return e!=null&&Hn(e,pl)?n=e.t():n=!1,n};c(zr).hashCode=function(){return 1};c(zr).toString=function(){return"[]"};c(zr).q=function(){return 0};c(zr).t=function(){return!0};c(zr).c6=function(e){return e.t()};c(zr).s=function(e){return this.c6(e)};c(zr).x=function(e){throw Sl("Empty list doesn't contain element at index "+e+".")};c(zr).l=function(){return Zx};var Mp;function OB(){return Mp==null&&new zr,Mp}function d4(){}c(d4).m=function(){return!1};c(d4).o=function(){throw Y1()};var Zx;function PB(e){return new No(e,!1)}function MB(e){return e.length===0?bo():ZN(new No(e,!0))}function No(e,n){this.d6_1=e,this.e6_1=n}c(No).q=function(){return this.d6_1.length};c(No).t=function(){return this.d6_1.length===0};c(No).f6=function(e){return l_(this.d6_1,e)};c(No).g6=function(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.f6(r)){n=!1;break e}}n=!0}return n};c(No).s=function(e){return this.g6(e)};c(No).l=function(){return w_(this.d6_1)};function _B(){throw Px("Index overflow has happened.")}function e8(e,n){return e.p(dB(n))}function o4(){}c(o4).o=function(){return this.h6()};function BB(e,n,i){var d;if(i>0)d=e>=n?n:n-MN(n,e,i)|0;else if(i<0)d=e<=n?n:n+MN(e,n,-i|0)|0;else throw Hr("Step is zero.");return d}function MN(e,n,i){return Cp(Cp(e,i)-Cp(n,i)|0,i)}function Cp(e,n){var i=e%n|0;return i>=0?i:i+n|0}function qx(){_p=this,this.i6_1=new X1(1,0)}var _p;function LB(){return _p==null&&new qx,_p}function X1(e,n){LB(),gd.call(this,e,n,1)}c(X1).t=function(){return this.m6_1>this.n6_1};c(X1).equals=function(e){var n;return e instanceof X1?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1?this.n6_1===e.n6_1:!1:n=!1,n};c(X1).hashCode=function(){return this.t()?-1:hn(31,this.m6_1)+this.n6_1|0};c(X1).toString=function(){return""+this.m6_1+".."+this.n6_1};function a4(e,n,i){o4.call(this),this.p6_1=i,this.q6_1=n,this.r6_1=this.p6_1>0?e<=n:e>=n,this.s6_1=this.r6_1?e:this.q6_1}c(a4).m=function(){return this.r6_1};c(a4).h6=function(){var e=this.s6_1;if(e===this.q6_1){if(!this.r6_1)throw Y1();this.r6_1=!1}else this.s6_1=this.s6_1+this.p6_1|0;return e};function n8(){}c(n8).e4=function(e,n,i){return new gd(e,n,i)};var Vx;function gd(e,n,i){if(i===0)throw Hr("Step must be non-zero.");if(i===Up.MIN_VALUE)throw Hr("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.m6_1=e,this.n6_1=BB(e,n,i),this.o6_1=i}c(gd).l=function(){return new a4(this.m6_1,this.n6_1,this.o6_1)};c(gd).t=function(){return this.o6_1>0?this.m6_1>this.n6_1:this.m6_1<this.n6_1};c(gd).equals=function(e){var n;return e instanceof gd?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1&&this.n6_1===e.n6_1?this.o6_1===e.o6_1:!1:n=!1,n};c(gd).hashCode=function(){return this.t()?-1:hn(31,hn(31,this.m6_1)+this.n6_1|0)+this.o6_1|0};c(gd).toString=function(){return this.o6_1>0?""+this.m6_1+".."+this.n6_1+" step "+this.o6_1:""+this.m6_1+" downTo "+this.n6_1+" step "+(-this.o6_1|0)};function Jx(e,n,i){i!=null?e.d4(i(n)):n==null||iB(n)?e.d4(n):n instanceof ex?e.t3(n.t6_1):e.d4(bc(n))}function FB(e,n,i){if(i=i===L?!1:i,e===n)return!0;if(!i)return!1;var d=wN(e),r=wN(n),t;if(d===r)t=!0;else{var s=D5(d).toLowerCase(),f=al(s,0),p=D5(r).toLowerCase();t=f===al(p,0)}return t}function Hx(e){return z1(e)-1|0}function Dx(e,n,i){i=i===L?!1:i;var d;return typeof n=="string"?d=UB(e,n,L,i)>=0:d=$x(e,n,0,z1(e),i)>=0,d}function UB(e,n,i,d){i=i===L?0:i,d=d===L?!1:d;var r,t;return d?t=!0:t=typeof e!="string",t?r=$x(e,n,i,z1(e),d):r=e.indexOf(n,i),r}function $x(e,n,i,d,r,t){t=t===L?!1:t;var s=t?p_(H5(i,Hx(e)),J5(d,0)):j_(J5(i,0),H5(d,z1(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var p=s.m6_1,v=s.n6_1,w=s.o6_1;if(w>0&&p<=v||w<0&&v<=p)do{var b=p;if(p=p+w|0,a_(n,0,e,b,z1(n),r))return b}while(b!==v)}else{var g=s.m6_1,_=s.n6_1,X=s.o6_1;if(X>0&&g<=_||X<0&&_<=g)do{var Se=g;if(g=g+X|0,Wx(n,0,e,Se,z1(n),r))return Se}while(Se!==_)}return-1}function Wx(e,n,i,d,r,t){if(d<0||n<0||n>(z1(e)-r|0)||d>(z1(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!FB(al(e,n+f|0),al(i,d+f|0),t))return!1}while(s<r);return!0}function vt(e,n){this.u6_1=e,this.v6_1=n}c(vt).toString=function(){return"("+this.u6_1+", "+this.v6_1+")"};c(vt).hashCode=function(){var e=this.u6_1==null?0:_n(this.u6_1);return e=hn(e,31)+(this.v6_1==null?0:_n(this.v6_1))|0,e};c(vt).equals=function(e){if(this===e)return!0;if(!(e instanceof vt))return!1;var n=e instanceof vt?e:en();return!(!Ze(this.u6_1,n.u6_1)||!Ze(this.v6_1,n.v6_1))};function Gx(e,n){return new vt(e,n)}c(Bi).o2=PM;Ue=new Fp;Up=new fl;Ac=new WN;v_=new nx;Ki=new Q1;TB=new Lx;Qp=new r4;Zx=new d4;Vx=new n8;var xo=Math.imul;Z(r8,"OneAtATimeAssembler",re);Z(d8,"AllAtOnceAssembler",re);Z(Fi,"SubscribeCallbackParams",re);Z(Gt,"Mode",re,mt);Z(ju,"Callback",re);Z(a8,L,re);Z(yi,"DispatcherImpl",re);Z(Ui,"EmptyOptions",re,L,L,Ui);Z(xn,"DispatcherSnapshot",re);Z(ni,"EventScope",re,mt);Z(u8,"LocalEventsDeduper",re);Z(l8,"NoOpUnsubscriber",ei);Z(Bc,"BaseTrace",re);Z(Lc,"ErrorInfo",re);Z(uI,"PerformanceAnalyticsDelegate",To);Z(Oc,"NoOpPerformanceAnalyticsDelegate",re,L,[uI],Oc);Z(Fc,"RuntimeTrace",re,Bc);Z(nu,"Disabled",ei);Z(Uc,"NiceLogger",re);Z(eu,"NoOpLogger",re,L,L,eu);Z(Yi,"TimerDefinition",re);Z(v4,"Span",re);Z(s8,"Tracer",ei);Z(m4,"JsDispatcherImpl",re,yi);Z(k4,"JsRequestBuilderAdapter",re);Z(Pc,"JsonStateOperations",re,L,L,Pc);function r8(e,n){this.w6_1=e,this.x6_1=n}c(r8).y6=function(e,n){var i;if(e.t())i=Gr();else{for(var d=this.x6_1.list(),r=e.w5();Yx(r);){for(var t=0,s=d.length;t<s;){var f=d[t];if(t=t+1|0,f.id===r.hook)return this.w6_1.a7([""+n+" building batch of ",r]),G5(r)}if(!e.t())r=e.w5();else return Gr()}this.w6_1.a7([""+n+" building batch of ",r]),i=G5(r)}return i};function d8(e,n){this.b7_1=e,this.c7_1=n}c(d8).y6=function(e,n){var i;if(e.t())i=Gr();else{for(var d=this.c7_1.list(),r=bo(),t=e.l();t.m();){var s=t.o(),f;if(Yx(s)){var p;if(d.length===0)p=!1;else{var v;e:{for(var w=0,b=d.length;w<b;){var g=d[w];if(w=w+1|0,g.id===s.hook){v=g;break e}}v=null}p=v!=null}f=p}else f=!0;f&&r.i(s)}var _=r;e.z5(),this.b7_1.a7([""+n+" building batch of ",_]),i=_}return i};function Yx(e){var n=e.hook;return(n==null?null:Dx(n,"useInterval"))===!0}function Fi(e,n,i){this.request=e,this.response=n,this.mode=i}c(Fi).d7=function(){return this.request};c(Fi).e7=function(){return this.response};c(Fi).f7=function(){return this.mode};c(Fi).g7=function(){return this.request};c(Fi).h7=function(){return this.response};c(Fi).i7=function(){return this.mode};c(Fi).j7=function(e,n,i){return new Fi(e,n,i)};c(Fi).copy=function(e,n,i,d){return e=e===L?this.request:e,n=n===L?this.response:n,i=i===L?this.mode:i,this.j7(e,n,i)};c(Fi).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};c(Fi).hashCode=function(){var e=this.request==null?0:_n(this.request);return e=xo(e,31)+(this.response==null?0:_n(this.response))|0,e=xo(e,31)+this.mode.hashCode()|0,e};c(Fi).equals=function(e){if(this===e)return!0;if(!(e instanceof Fi))return!1;var n=e instanceof Fi?e:en();return!(!Ze(this.request,n.request)||!Ze(this.response,n.response)||!this.mode.equals(n.mode))};var Qx,jx,eI;function ZB(){return[bd(),Ec(),Td()]}function qB(e){switch(e){case"SYNC":return bd();case"ASYNC":return Ec();case"SPEC":return Td();default:l4(),Wp("No enum constant value.");break}}var zx;function l4(){if(zx)return Ue;zx=!0,Qx=new Gt("SYNC",0),jx=new Gt("ASYNC",1),eI=new Gt("SPEC",2)}function Gt(e,n){mt.call(this,e,n)}function bd(){return l4(),Qx}function Ec(){return l4(),jx}function Td(){return l4(),eI}function ju(e,n){this.m7_1=e,this.n7_1=n}c(ju).toString=function(){return"Callback(success="+this.m7_1+", failure="+this.n7_1+")"};c(ju).hashCode=function(){var e=_n(this.m7_1);return e=xo(e,31)+_n(this.n7_1)|0,e};c(ju).equals=function(e){if(this===e)return!0;if(!(e instanceof ju))return!1;var n=e instanceof ju?e:en();return!(!Ze(this.m7_1,n.m7_1)||!Ze(this.n7_1,n.n7_1))};function i8(e){var n=e.w7_1;if(n!=null)return n;Tc("assembler")}function e0(e){var n=e.d8_1;if(n!=null)return n;Tc("local")}function Mc(e){var n=e.e8_1;if(n!=null)return n;Tc("remote")}function s4(e){var n=e.f8_1;if(n!=null)return n;Tc("timers")}function nI(e){iI(e),e.k8_1=!0,e.t7_1.a7(["recalculateSpeculativeWork"]);var n=e.x7_1.l(),i=0;e:for(;n.m();){var d=i;i=i+1|0;var r=n.o();if(d===0||r.retry===!0||r.async===!0||r.scope.equals(j1()))continue e;if(e.z7_1.r5_1>10)break e;e.z7_1.i(r)}e.t7_1.a7(["Speculative queue size: "+e.z7_1.r5_1]),f4(e,e.z7_1)}function o8(e){e.t7_1.a7(["cancelSpeculation"]),e.k8_1=!1,iI(e)}function iI(e){e.z7_1.z5(),e.h8_1=e.q7_1.clone(e.state),e.i8_1=e.i8_1+1|0}function t8(e,n,i){if(n.t())return Ue;var d=QN(n),r=d.scope.equals(j1())?!0:QB(d.scope)?!e0(e).isReady():!1;i.equals(bd())&&(e.a8_1=!0);var t=e.p7_1.l8(i.equals(Td())?e.h8_1:e.state,n),s=r?Mc(e):e0(e),f=e.u7_1;e.u7_1=f+1|0;var p=f,v=e.i8_1,w=cI.m8("runtime_trace"),b=DB(e,i,r,w,n,p,v,t),g=new ju(b,$B(e,i,r,w,n,p));e.b8_1.i1(p,g),e.t7_1.a7(["Signpost: Handling "+u4(e,i,r)+" request"]),f4(e,t),s.handle(e.r7_1,t,g.m7_1,g.n7_1)}function u4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function tI(e,n){e.k8_1=e.j8_1,e.a8_1=!1,e.state=e.q7_1.clone(e.g8_1),e.y7_1.z5(),e.x7_1.z5(),e0(e).reset(),Mc(e).reset(),o8(e),n&&s4(e).clear()}function _c(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Ro){var t=s;e.t7_1.n8([t]),e.s7_1.errorHandler(t),r=n}else throw s;d=r}return d}function f4(e,n){e.s7_1.featureFlags.isVerboseLoggingEnabled&&e.t7_1.a7([n])}function VB(e){return function(){return e0(e).isReady()}}function JB(e,n,i,d){return function(){e.t7_1.a7(["Signpost: Initializing Dispatcher",n,i]),e.d8_1=n,e.e8_1=i,e.f8_1=d;var r=e,t;return e.s7_1.featureFlags.isUsingEverythingAssembler?t=new d8(e.t7_1,d):t=new r8(e.t7_1,d),r.w7_1=t,e.o8(),Ue}}function a8(e,n){this.p8_1=e,this.q8_1=n}c(a8).unsubscribe=function(){this.p8_1.c8_1.j(this.q8_1)};function HB(e,n){return function(){var i=typeof e=="function"?e:en();return n.c8_1.i(i),new a8(n,i)}}function DB(e,n,i,d,r,t,s,f){return function(p){e.t7_1.a7(["Signpost: Response success for "+u4(e,n,i)+" request"]),f4(e,p),d.u8(),lI(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q()),e.b8_1.j1(t);var v;if(n.equals(Td())&&e.i8_1!==s)return e.t7_1.a7(["throwing away stale speculative results"]),Ue;e.t7_1.a7(["Responding to "+u4(e,n,i)+" runtime result subscriptions"]);for(var w=e.c8_1.l();w.m();){var b=w.o();b(new Fi(f,p,n))}var g;n.equals(bd())?(e.state=e.q7_1.merge(e.state,p.state),e.a8_1=!1,g=Ue):n.equals(Td())&&(e.h8_1=e.q7_1.merge(e.h8_1,p.state),g=Ue),e.v8(Dp(p.replay),n);var _;return n.equals(bd())&&e.j8_1&&(nI(e),_=Ue),e.o8(),Ue}}function $B(e,n,i,d,r,t){return function(s){e.t7_1.a7(["Signpost: Response error for "+u4(e,n,i)+" request",s]),d.u8(),lI(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q());var f=e.s7_1.performanceAnalyticsDelegate,p=s.message;jB(f,p??"",i,""),e.b8_1.j1(t);var v;n.equals(bd())&&(e.a8_1=!1,v=Ue);var w;if(n.equals(Td()))return o8(e),e.o8(),Ue;for(var b=r,g=gc(),_=b.l();_.m();){var X=_.o(),Se=X.scope.equals(j1())?!1:X.retry!==!0,_e=g.r1(Se),ri;if(_e==null){var bi=bo();g.i1(Se,bi),ri=bi}else ri=_e;var ji=ri;ji.i(X)}var yt=g,xd,jr=yt.r1(!1);if(!(jr==null||jr.t())){var ed=yt.r1(!1),Id=ed??Gr(),wr=cl(Id);e.t7_1.a7(kl([["unretryable events",s],wr])),xd=e.s7_1.errorHandler(s)}var Ed,nd=yt.r1(!0);if(!(nd==null||nd.t())){var Mo=yt.r1(!0);if(Mo!=null)for(var Pl=Mo.l();Pl.m();){var s0=Pl.o();s0.retry=!0,s0.scope=j1()}var f0=yt.r1(!0);e.v8(f0??Gr(),n),n.equals(bd())&&e.j8_1&&nI(e),e.o8(),Ed=Ue}return Ue}}function WB(e,n){return function(){e.t7_1.a7(kl([["Signpost: Submitted events"],n]));for(var i=e.v7_1.w8(Dp(n)),d=i.l();d.m();){var r=d.o();r.async===!0?e.y7_1.i(r):(e.x7_1.i(r),e.a8_1&&e.k8_1&&e.z7_1.i(r))}return e.o8(),Ue}}function GB(e){return function(){return tI(e,!0),Ue}}function zB(e,n){return function(){e.state=e.q7_1.clone(n.state),e.y7_1.z5();var i=n.asyncQueue;e8(e.y7_1,sl(i)?i:en()),e.x7_1.z5();var d=n.syncQueue;return e8(e.x7_1,sl(d)?d:en()),o8(e),e0(e).resume(n.localSnapshot),Mc(e).resume(n.remoteSnapshot),s4(e).resumeAll(n.timerSnapshot),Ue}}function yi(e,n,i,d,r){d=d===L?"RenderPostContent":d,r=r===L?new Ui:r,this.o7_1=e,this.p7_1=n,this.q7_1=i,this.r7_1=d,this.s7_1=r,this.t7_1=new Uc(this.s7_1.logger),this.u7_1=0;var t=this;t.v7_1=new u8(VB(this),this.t7_1),this.x7_1=xc(),this.y7_1=xc(),this.z7_1=xc(),this.a8_1=!1;var s=this;s.b8_1=gc();var f=this;f.c8_1=bo(),this.g8_1=this.q7_1.clone(this.state),this.h8_1=this.q7_1.clone(this.g8_1),this.i8_1=0,this.j8_1=this.s7_1.featureFlags.isSpeculativeExecutionEnabled,this.k8_1=this.j8_1,this.t7_1.a7(["Signpost: Constructed KMP Dispatcher"])}c(yi).x8=function(e){this.o7_1=e};c(yi).y8=function(){return this.o7_1};c(yi).z8=function(){return this.x7_1};c(yi).a9=function(){return this.y7_1};c(yi).b9=function(){return this.z7_1};c(yi).init=function(e,n,i){_c(this,Ue,JB(this,e,n,i))};c(yi).subscribe=function(e){var n=aI;return _c(this,n,HB(e,this))};c(yi).o8=function(){if(this.t7_1.a7(["ticking","syncInFlight "+this.a8_1,"asyncQueue.size "+this.y7_1.r5_1,"syncQueue.size "+this.x7_1.r5_1,"speculativeQueue.size "+this.z7_1.r5_1]),!e0(this).isReady()&&!Mc(this).isReady()&&!(this.x7_1.t()&&this.y7_1.t()))return this.t7_1.c9(["ticking with events and no runtime, deferring..."]),Ue;if(this.a8_1){if(this.k8_1){var n=i8(this).y6(this.z7_1,Td());t8(this,n,Td())}}else{var e=i8(this).y6(this.x7_1,bd());t8(this,e,bd())}if(!this.y7_1.t()){for(;!this.y7_1.t();){var i=i8(this).y6(this.y7_1,Ec());t8(this,i,Ec())}this.o8()}};c(yi).v8=function(e,n){if(e.t()||n.equals(Td()))return Ue;this.t7_1.a7(["replaying "+e.q()+" events"]),f4(this,e);for(var i=gc(),d=e.l();d.m();){var r=d.o(),t=new vt(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var p=bo();i.i1(t,p),f=p}else f=s;var v=f;v.i(r)}var w=i,b=w.r1(new vt(!0,!0));this.y7_1.y5(0,b??Gr());var g=w.r1(new vt(!0,!1));this.y7_1.p(g??Gr());var _=w.r1(new vt(!1,!0));this.x7_1.y5(0,_??Gr());var X=w.r1(new vt(!1,!1));this.x7_1.p(X??Gr())};c(yi).submit=function(e){_c(this,Ue,WB(this,e))};c(yi).reset=function(){_c(this,Ue,GB(this))};c(yi).snapshot=function(){var e=this.q7_1.clone(this.state),n=this.x7_1,i=cl(n),d=this.y7_1,r=cl(d);return new xn(e,i,r,e0(this).snapshot(),Mc(this).snapshot(),s4(this).list())};c(yi).pause=function(){var e=this.snapshot();return s4(this).pauseAll(),tI(this,!1),e};c(yi).resume=function(e){_c(this,Ue,zB(this,e))};function KB(e){return Ue}function Ui(){this.d9_1=new eu;var e=this;e.e9_1=KB,this.f9_1=fI,this.g9_1=new Oc}c(Ui).h9=function(e){this.d9_1=e};c(Ui).i9=function(){return this.d9_1};c(Ui).j9=function(e){this.e9_1=e};c(Ui).k9=function(){return this.e9_1};c(Ui).l9=function(e){this.f9_1=e};c(Ui).m9=function(){return this.f9_1};c(Ui).n9=function(e){this.g9_1=e};c(Ui).o9=function(){return this.g9_1};function xn(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}c(xn).y8=function(){return this.state};c(xn).z8=function(){return this.syncQueue};c(xn).a9=function(){return this.asyncQueue};c(xn).p9=function(){return this.localSnapshot};c(xn).q9=function(){return this.remoteSnapshot};c(xn).r9=function(){return this.timerSnapshot};c(xn).g7=function(){return this.state};c(xn).h7=function(){return this.syncQueue};c(xn).i7=function(){return this.asyncQueue};c(xn).s9=function(){return this.localSnapshot};c(xn).t9=function(){return this.remoteSnapshot};c(xn).u9=function(){return this.timerSnapshot};c(xn).v9=function(e,n,i,d,r,t){return new xn(e,n,i,d,r,t)};c(xn).copy=function(e,n,i,d,r,t,s){return e=e===L?this.state:e,n=n===L?this.syncQueue:n,i=i===L?this.asyncQueue:i,d=d===L?this.localSnapshot:d,r=r===L?this.remoteSnapshot:r,t=t===L?this.timerSnapshot:t,this.v9(e,n,i,d,r,t)};c(xn).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+$r(this.syncQueue)+", asyncQueue="+$r(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};c(xn).hashCode=function(){var e=this.state==null?0:_n(this.state);return e=xo(e,31)+_n(this.syncQueue)|0,e=xo(e,31)+_n(this.asyncQueue)|0,e=xo(e,31)+(this.localSnapshot==null?0:_n(this.localSnapshot))|0,e=xo(e,31)+(this.remoteSnapshot==null?0:_n(this.remoteSnapshot))|0,e=xo(e,31)+(this.timerSnapshot==null?0:_n(this.timerSnapshot))|0,e};c(xn).equals=function(e){if(this===e)return!0;if(!(e instanceof xn))return!1;var n=e instanceof xn?e:en();return!(!Ze(this.state,n.state)||!Ze(this.syncQueue,n.syncQueue)||!Ze(this.asyncQueue,n.asyncQueue)||!Ze(this.localSnapshot,n.localSnapshot)||!Ze(this.remoteSnapshot,n.remoteSnapshot)||!Ze(this.timerSnapshot,n.timerSnapshot))};var rI,dI,oI;function XB(){return[p4(),h4(),j1()]}function YB(e){switch(e){case"ALL":return p4();case"LOCAL":return h4();case"REMOTE":return j1();default:c4(),Wp("No enum constant value.");break}}var Kx;function c4(){if(Kx)return Ue;Kx=!0,rI=new ni("ALL",0),dI=new ni("LOCAL",1),oI=new ni("REMOTE",2)}function ni(e,n){mt.call(this,e,n)}function QB(e){return e.equals(j1())?!0:e.equals(p4())}function p4(){return c4(),rI}function h4(){return c4(),dI}function j1(){return c4(),oI}function u8(e,n){this.y9_1=e,this.z9_1=n}c(u8).w8=function(e){var n;if(this.y9_1())n=e;else{for(var i=bo(),d=bo(),r=e.l();r.m();){var t=r.o();t.scope.equals(h4())?d.i(t):i.i(t)}var s=new vt(i,d);if(!s.v6_1.t()){var f=["Dropping "+s.v6_1.q()+" local events",s.v6_1];this.z9_1.a7([f])}n=s.u6_1}return n};function l8(){}c(l8).unsubscribe=function(){};var aI;function Bc(e,n){this.spanName=e,this.durationMs=n}c(Bc).aa=function(){return this.spanName};c(Bc).ba=function(){return this.durationMs};function Lc(e,n,i){this.message=e,this.origin=n,this.version=i}c(Lc).l5=function(){return this.message};c(Lc).ca=function(){return this.origin};c(Lc).da=function(){return this.version};function uI(){}function Oc(){}c(Oc).logRuntimeTrace=function(e){};c(Oc).logRuntimeError=function(e){};function lI(e,n,i,d,r){e.logRuntimeTrace(new Fc(n.r8_1,n.ea().toString(),d,sI(i),r))}function jB(e,n,i,d){e.logRuntimeError(new Lc(n,sI(i),d))}function sI(e){return e?"remote":"local"}function Fc(e,n,i,d,r){Bc.call(this,e,n),this.intent=i,this.target=d,this.eventCount=r}c(Fc).fa=function(){return this.intent};c(Fc).ga=function(){return this.target};c(Fc).ha=function(){return this.eventCount};function nu(){this.ia_1=!1,this.ja_1=!1,this.ka_1=!1}c(nu).la=function(){return this.ia_1};c(nu).ma=function(){return this.ja_1};c(nu).na=function(){return this.ka_1};var fI;function Uc(e){this.z6_1=e}c(Uc).n8=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.error(n)};c(Uc).c9=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.warn(n)};c(Uc).a7=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.debug(n)};function eu(){}c(eu).info=function(e){};c(eu).error=function(e){};c(eu).warn=function(e){};c(eu).debug=function(e){};c(eu).tag=function(){return""};function Yi(e,n){this.id=e,this.duration=n}c(Yi).oa=function(){return this.id};c(Yi).pa=function(){return this.duration};c(Yi).g7=function(){return this.id};c(Yi).h7=function(){return this.duration};c(Yi).qa=function(e,n){return new Yi(e,n)};c(Yi).copy=function(e,n,i){return e=e===L?this.id:e,n=n===L?this.duration:n,this.qa(e,n)};c(Yi).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};c(Yi).hashCode=function(){var e=$p(this.id);return e=xo(e,31)+this.duration|0,e};c(Yi).equals=function(e){if(this===e)return!0;if(!(e instanceof Yi))return!1;var n=e instanceof Yi?e:en();return!(this.id!==n.id||this.duration!==n.duration)};function v4(e,n){this.r8_1=e,this.s8_1=n,this.t8_1=new Ee(0,0)}c(v4).u8=function(){this.t8_1=pI()};c(v4).ea=function(){return this.t8_1.g5(this.s8_1)};function s8(){}c(s8).m8=function(e){return new v4(e,pI())};var cI;function m4(e,n,i,d){i=i===L?"RenderPostContent":i,d=d===L?new Ui:d,yi.call(this,e,new k4(n),new Pc,i,d),this.ob_1=i,this.pb_1=d}function k4(e){this.qb_1=e}c(k4).rb=function(e,n){var i=cl(n);return this.qb_1.build(e,i)};c(k4).l8=function(e,n){return this.rb(e!=null&&e!=null?e:en(),n)};function Xx(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:en())(e),d=Zp(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],p=Gx(f!=null&&typeof f=="string"?f:en(),s[1]);d.i(p)}return d}function Pc(){}c(Pc).clone=function(e){return JSON.parse(JSON.stringify(e))};c(Pc).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:en(),r=Xx(e).l();r.m();){var t=r.o();d[t.u6_1]=t.v6_1}for(var s=Xx(n).l();s.m();){var f=s.o();d[f.u6_1]=f.v6_1}return d};function pI(){return wx(new Date().getTime())}$n(c(Gt),"name",c(Gt).r4);$n(c(Gt),"ordinal",c(Gt).s4);$n(c(yi),"state",function(){return this.y8()},function(e){this.x8(e)});$n(c(Ui),"logger",function(){return this.i9()},function(e){this.h9(e)});$n(c(Ui),"errorHandler",function(){return this.k9()},function(e){this.j9(e)});$n(c(Ui),"featureFlags",function(){return this.m9()},function(e){this.l9(e)});$n(c(Ui),"performanceAnalyticsDelegate",function(){return this.o9()},function(e){this.n9(e)});$n(c(ni),"name",c(ni).r4);$n(c(ni),"ordinal",c(ni).s4);$n(c(nu),"isSpeculativeExecutionEnabled",function(){return this.la()});$n(c(nu),"isVerboseLoggingEnabled",function(){return this.ma()});$n(c(nu),"isUsingEverythingAssembler",function(){return this.na()});$n(c(m4),"state",function(){return this.y8()},function(e){this.x8(e)});aI=new l8;fI=new nu;cI=new s8;Gt.values=ZB;Gt.valueOf=qB;$n(Gt,"SYNC",bd);$n(Gt,"ASYNC",Ec);$n(Gt,"SPEC",Td);ni.values=XB;ni.valueOf=YB;$n(ni,"ALL",p4);$n(ni,"LOCAL",h4);$n(ni,"REMOTE",j1);var Kt=B(F(),1);var i0=B(F(),1);var Rd;(function(e){e[e.ENVIRONMENT_UNSPECIFIED=0]="ENVIRONMENT_UNSPECIFIED",e[e.ENVIRONMENT_SANDBOX=1]="ENVIRONMENT_SANDBOX",e[e.ENVIRONMENT_PRODUCTION=2]="ENVIRONMENT_PRODUCTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Rd||(Rd={}));function y4(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Rd.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Rd.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Rd.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Rd.UNRECOGNIZED}}function S4(e){switch(e){case Rd.ENVIRONMENT_UNSPECIFIED:return 0;case Rd.ENVIRONMENT_SANDBOX:return 1;case Rd.ENVIRONMENT_PRODUCTION:return 2;case Rd.UNRECOGNIZED:default:return-1}}var zt=B(F(),1);var tu;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(tu||(tu={}));function eL(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return tu.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return tu.GOLD;case-1:case"UNRECOGNIZED":default:return tu.UNRECOGNIZED}}function nL(e){switch(e){case tu.CURRENCY_UNSPECIFIED:return 0;case tu.GOLD:return 200;case tu.UNRECOGNIZED:default:return-1}}var Wn;(function(e){e[e.ACCOUNTING_TYPE_UNSPECIFIED=0]="ACCOUNTING_TYPE_UNSPECIFIED",e[e.ACCOUNTING_TYPE_INSTANT=1]="ACCOUNTING_TYPE_INSTANT",e[e.ACCOUNTING_TYPE_DURABLE=2]="ACCOUNTING_TYPE_DURABLE",e[e.ACCOUNTING_TYPE_CONSUMABLE=3]="ACCOUNTING_TYPE_CONSUMABLE",e[e.ACCOUNTING_TYPE_VALID_FOR_1D=4]="ACCOUNTING_TYPE_VALID_FOR_1D",e[e.ACCOUNTING_TYPE_VALID_FOR_7D=5]="ACCOUNTING_TYPE_VALID_FOR_7D",e[e.ACCOUNTING_TYPE_VALID_FOR_30D=6]="ACCOUNTING_TYPE_VALID_FOR_30D",e[e.ACCOUNTING_TYPE_VALID_FOR_1Y=7]="ACCOUNTING_TYPE_VALID_FOR_1Y",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wn||(Wn={}));function iL(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return Wn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return Wn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return Wn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return Wn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return Wn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return Wn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return Wn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return Wn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return Wn.UNRECOGNIZED}}function tL(e){switch(e){case Wn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case Wn.ACCOUNTING_TYPE_INSTANT:return 1;case Wn.ACCOUNTING_TYPE_DURABLE:return 2;case Wn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case Wn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case Wn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case Wn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case Wn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case Wn.UNRECOGNIZED:default:return-1}}function hI(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var Qi={$type:"devvit.payments.v1alpha.Product",encode(e,n=zt.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&iu.encode(e.price,n.uint32(42).fork()).ldelim(),e.environment!==0&&n.uint32(160).int32(e.environment),e.description!==""&&n.uint32(170).string(e.description),e.accountingType!==0&&n.uint32(184).int32(e.accountingType),Object.entries(e.productMetadata).forEach(([i,d])=>{Zc.encode({key:i,value:d},n.uint32(8018).fork()).ldelim()}),Object.entries(e.images).forEach(([i,d])=>{qc.encode({key:i,value:d},n.uint32(8026).fork()).ldelim()}),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=hI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1001:if(t!==8010)break;r.sku=i.string();continue;case 3:if(t!==26)break;r.name=i.string();continue;case 5:if(t!==42)break;r.price=iu.decode(i,i.uint32());continue;case 20:if(t!==160)break;r.environment=i.int32();continue;case 21:if(t!==170)break;r.description=i.string();continue;case 23:if(t!==184)break;r.accountingType=i.int32();continue;case 1002:if(t!==8018)break;let s=Zc.decode(i,i.uint32());s.value!==void 0&&(r.productMetadata[s.key]=s.value);continue;case 1003:if(t!==8026)break;let f=qc.decode(i,i.uint32());f.value!==void 0&&(r.images[f.key]=f.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{sku:kr(e.sku)?globalThis.String(e.sku):"",name:kr(e.name)?globalThis.String(e.name):"",price:kr(e.price)?iu.fromJSON(e.price):void 0,environment:kr(e.environment)?y4(e.environment):0,description:kr(e.description)?globalThis.String(e.description):"",accountingType:kr(e.accountingType)?iL(e.accountingType):0,productMetadata:yI(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:yI(e.images)?Object.entries(e.images).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.sku!==""&&(n.sku=e.sku),e.name!==""&&(n.name=e.name),e.price!==void 0&&(n.price=iu.toJSON(e.price)),e.environment!==0&&(n.environment=S4(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=tL(e.accountingType)),e.productMetadata){let i=Object.entries(e.productMetadata);i.length>0&&(n.productMetadata={},i.forEach(([d,r])=>{n.productMetadata[d]=r}))}if(e.images){let i=Object.entries(e.images);i.length>0&&(n.images={},i.forEach(([d,r])=>{n.images[d]=r}))}return n},create(e){return Qi.fromPartial(e??{})},fromPartial(e){let n=hI();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?iu.fromPartial(e.price):void 0,n.environment=e.environment??0,n.description=e.description??"",n.accountingType=e.accountingType??0,n.productMetadata=Object.entries(e.productMetadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.images=Object.entries(e.images??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(Qi.$type,Qi);function vI(){return{key:"",value:""}}var Zc={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=zt.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=vI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:kr(e.key)?globalThis.String(e.key):"",value:kr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Zc.fromPartial(e??{})},fromPartial(e){let n=vI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Zc.$type,Zc);function mI(){return{key:"",value:""}}var qc={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=zt.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=mI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:kr(e.key)?globalThis.String(e.key):"",value:kr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return qc.fromPartial(e??{})},fromPartial(e){let n=mI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(qc.$type,qc);function kI(){return{amount:0,currency:0}}var iu={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=zt.default.Writer.create()){return e.amount!==0&&n.uint32(8).int32(e.amount),e.currency!==0&&n.uint32(16).int32(e.currency),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=kI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.amount=i.int32();continue;case 2:if(t!==16)break;r.currency=i.int32();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{amount:kr(e.amount)?globalThis.Number(e.amount):0,currency:kr(e.currency)?eL(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=nL(e.currency)),n},create(e){return iu.fromPartial(e??{})},fromPartial(e){let n=kI();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(iu.$type,iu);function yI(e){return typeof e=="object"&&e!==null}function kr(e){return e!=null}var Si;(function(e){e[e.ORDER_STATUS_UNSPECIFIED=0]="ORDER_STATUS_UNSPECIFIED",e[e.ORDER_STATUS_NEW=1]="ORDER_STATUS_NEW",e[e.ORDER_STATUS_CREATED=2]="ORDER_STATUS_CREATED",e[e.ORDER_STATUS_PAID=3]="ORDER_STATUS_PAID",e[e.ORDER_STATUS_DELIVERED=4]="ORDER_STATUS_DELIVERED",e[e.ORDER_STATUS_CANCELED=5]="ORDER_STATUS_CANCELED",e[e.ORDER_STATUS_REVERTED=6]="ORDER_STATUS_REVERTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Si||(Si={}));function c8(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return Si.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return Si.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return Si.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return Si.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return Si.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return Si.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return Si.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return Si.UNRECOGNIZED}}function p8(e){switch(e){case Si.ORDER_STATUS_UNSPECIFIED:return 0;case Si.ORDER_STATUS_NEW:return 1;case Si.ORDER_STATUS_CREATED:return 2;case Si.ORDER_STATUS_PAID:return 3;case Si.ORDER_STATUS_DELIVERED:return 4;case Si.ORDER_STATUS_CANCELED:return 5;case Si.ORDER_STATUS_REVERTED:return 6;case Si.UNRECOGNIZED:default:return-1}}function SI(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var Gn={$type:"devvit.payments.v1alpha.Order",encode(e,n=i0.default.Writer.create()){e.id!==""&&n.uint32(10).string(e.id),e.status!==0&&n.uint32(16).int32(e.status),e.createdAt!==void 0&&ae.encode(AI(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&ae.encode(AI(e.updatedAt),n.uint32(34).fork()).ldelim();for(let i of e.products)Qi.encode(i,n.uint32(42).fork()).ldelim();return e.environment!==0&&n.uint32(64).int32(e.environment),Object.entries(e.metadata).forEach(([i,d])=>{Vc.encode({key:i,value:d},n.uint32(8010).fork()).ldelim()}),n},decode(e,n){let i=e instanceof i0.default.Reader?e:i0.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=SI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.id=i.string();continue;case 2:if(t!==16)break;r.status=i.int32();continue;case 3:if(t!==26)break;r.createdAt=f8(ae.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=f8(ae.decode(i,i.uint32()));continue;case 5:if(t!==42)break;r.products.push(Qi.decode(i,i.uint32()));continue;case 8:if(t!==64)break;r.environment=i.int32();continue;case 1001:if(t!==8010)break;let s=Vc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{id:n0(e.id)?globalThis.String(e.id):"",status:n0(e.status)?c8(e.status):0,createdAt:n0(e.createdAt)?CI(e.createdAt):void 0,updatedAt:n0(e.updatedAt)?CI(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>Qi.fromJSON(n)):[],environment:n0(e.environment)?y4(e.environment):0,metadata:rL(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.id!==""&&(n.id=e.id),e.status!==0&&(n.status=p8(e.status)),e.createdAt!==void 0&&(n.createdAt=e.createdAt.toISOString()),e.updatedAt!==void 0&&(n.updatedAt=e.updatedAt.toISOString()),e.products?.length&&(n.products=e.products.map(i=>Qi.toJSON(i))),e.environment!==0&&(n.environment=S4(e.environment)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return Gn.fromPartial(e??{})},fromPartial(e){let n=SI();return n.id=e.id??"",n.status=e.status??0,n.createdAt=e.createdAt??void 0,n.updatedAt=e.updatedAt??void 0,n.products=e.products?.map(i=>Qi.fromPartial(i))||[],n.environment=e.environment??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(Gn.$type,Gn);function wI(){return{key:"",value:""}}var Vc={$type:"devvit.payments.v1alpha.Order.MetadataEntry",encode(e,n=i0.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof i0.default.Reader?e:i0.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=wI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:n0(e.key)?globalThis.String(e.key):"",value:n0(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Vc.fromPartial(e??{})},fromPartial(e){let n=wI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Vc.$type,Vc);function AI(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function f8(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function CI(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):f8(ae.fromJSON(e))}function rL(e){return typeof e=="object"&&e!==null}function n0(e){return e!=null}function gI(){return{order:void 0}}var h8={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=Kt.default.Writer.create()){return e.order!==void 0&&Gn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=gI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Gn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:w4(e.order)?Gn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Gn.toJSON(e.order)),n},create(e){return h8.fromPartial(e??{})},fromPartial(e){let n=gI();return n.order=e.order!==void 0&&e.order!==null?Gn.fromPartial(e.order):void 0,n}};l.set(h8.$type,h8);function bI(){return{order:void 0}}var v8={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=Kt.default.Writer.create()){return e.order!==void 0&&Gn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=bI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Gn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:w4(e.order)?Gn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Gn.toJSON(e.order)),n},create(e){return v8.fromPartial(e??{})},fromPartial(e){let n=bI();return n.order=e.order!==void 0&&e.order!==null?Gn.fromPartial(e.order):void 0,n}};l.set(v8.$type,v8);function TI(){return{acknowledged:void 0,rejectionReason:void 0}}var m8={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=Kt.default.Writer.create()){return e.acknowledged!==void 0&&n.uint32(8).bool(e.acknowledged),e.rejectionReason!==void 0&&n.uint32(18).string(e.rejectionReason),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=TI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.acknowledged=i.bool();continue;case 2:if(t!==18)break;r.rejectionReason=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{acknowledged:w4(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:w4(e.rejectionReason)?globalThis.String(e.rejectionReason):void 0}},toJSON(e){let n={};return e.acknowledged!==void 0&&(n.acknowledged=e.acknowledged),e.rejectionReason!==void 0&&(n.rejectionReason=e.rejectionReason),n},create(e){return m8.fromPartial(e??{})},fromPartial(e){let n=TI();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(m8.$type,m8);function RI(){return{}}var k8={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=Kt.default.Writer.create()){return n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=RI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return k8.fromPartial(e??{})},fromPartial(e){return RI()}};l.set(k8.$type,k8);function w4(e){return e!=null}var Qe=B(F(),1);function NI(){return{skus:[],metadata:{}}}var y8={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=Qe.default.Writer.create()){for(let i of e.skus)n.uint32(10).string(i);return Object.entries(e.metadata).forEach(([i,d])=>{Jc.encode({key:i,value:d},n.uint32(18).fork()).ldelim()}),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=NI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.skus.push(i.string());continue;case 2:if(t!==18)break;let s=Jc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{skus:globalThis.Array.isArray(e?.skus)?e.skus.map(n=>globalThis.String(n)):[],metadata:UI(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.skus?.length&&(n.skus=e.skus),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return y8.fromPartial(e??{})},fromPartial(e){let n=NI();return n.skus=e.skus?.map(i=>i)||[],n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(y8.$type,y8);function xI(){return{key:"",value:""}}var Jc={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=Qe.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=xI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ci(e.key)?globalThis.String(e.key):"",value:Ci(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Jc.fromPartial(e??{})},fromPartial(e){let n=xI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Jc.$type,Jc);function II(){return{products:[]}}var S8={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=Qe.default.Writer.create()){for(let i of e.products)Qi.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=II();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.products.push(Qi.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{products:globalThis.Array.isArray(e?.products)?e.products.map(n=>Qi.fromJSON(n)):[]}},toJSON(e){let n={};return e.products?.length&&(n.products=e.products.map(i=>Qi.toJSON(i))),n},create(e){return S8.fromPartial(e??{})},fromPartial(e){let n=II();return n.products=e.products?.map(i=>Qi.fromPartial(i))||[],n}};l.set(S8.$type,S8);function EI(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var w8={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=Qe.default.Writer.create()){return e.start!==void 0&&ae.encode(LI(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&ae.encode(LI(e.end),n.uint32(18).fork()).ldelim(),e.limit!==0&&n.uint32(24).int32(e.limit),e.sku!==""&&n.uint32(34).string(e.sku),e.buyer!==""&&n.uint32(42).string(e.buyer),e.status!==0&&n.uint32(48).int32(e.status),Object.entries(e.metadata).forEach(([i,d])=>{Hc.encode({key:i,value:d},n.uint32(58).fork()).ldelim()}),e.cursor!==""&&n.uint32(66).string(e.cursor),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=EI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=b8(ae.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=b8(ae.decode(i,i.uint32()));continue;case 3:if(t!==24)break;r.limit=i.int32();continue;case 4:if(t!==34)break;r.sku=i.string();continue;case 5:if(t!==42)break;r.buyer=i.string();continue;case 6:if(t!==48)break;r.status=i.int32();continue;case 7:if(t!==58)break;let s=Hc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue;case 8:if(t!==66)break;r.cursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{start:Ci(e.start)?FI(e.start):void 0,end:Ci(e.end)?FI(e.end):void 0,limit:Ci(e.limit)?globalThis.Number(e.limit):0,sku:Ci(e.sku)?globalThis.String(e.sku):"",buyer:Ci(e.buyer)?globalThis.String(e.buyer):"",status:Ci(e.status)?c8(e.status):0,metadata:UI(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},cursor:Ci(e.cursor)?globalThis.String(e.cursor):""}},toJSON(e){let n={};if(e.start!==void 0&&(n.start=e.start.toISOString()),e.end!==void 0&&(n.end=e.end.toISOString()),e.limit!==0&&(n.limit=Math.round(e.limit)),e.sku!==""&&(n.sku=e.sku),e.buyer!==""&&(n.buyer=e.buyer),e.status!==0&&(n.status=p8(e.status)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return e.cursor!==""&&(n.cursor=e.cursor),n},create(e){return w8.fromPartial(e??{})},fromPartial(e){let n=EI();return n.start=e.start??void 0,n.end=e.end??void 0,n.limit=e.limit??0,n.sku=e.sku??"",n.buyer=e.buyer??"",n.status=e.status??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.cursor=e.cursor??"",n}};l.set(w8.$type,w8);function OI(){return{key:"",value:""}}var Hc={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=Qe.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=OI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ci(e.key)?globalThis.String(e.key):"",value:Ci(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Hc.fromPartial(e??{})},fromPartial(e){let n=OI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Hc.$type,Hc);function PI(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var ru={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=Qe.default.Writer.create()){return e.hasNextPage!==!1&&n.uint32(8).bool(e.hasNextPage),e.endCursor!==""&&n.uint32(18).string(e.endCursor),e.hasPreviousPage!==!1&&n.uint32(24).bool(e.hasPreviousPage),e.startCursor!==""&&n.uint32(34).string(e.startCursor),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=PI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.hasNextPage=i.bool();continue;case 2:if(t!==18)break;r.endCursor=i.string();continue;case 3:if(t!==24)break;r.hasPreviousPage=i.bool();continue;case 4:if(t!==34)break;r.startCursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{hasNextPage:Ci(e.hasNextPage)?globalThis.Boolean(e.hasNextPage):!1,endCursor:Ci(e.endCursor)?globalThis.String(e.endCursor):"",hasPreviousPage:Ci(e.hasPreviousPage)?globalThis.Boolean(e.hasPreviousPage):!1,startCursor:Ci(e.startCursor)?globalThis.String(e.startCursor):""}},toJSON(e){let n={};return e.hasNextPage!==!1&&(n.hasNextPage=e.hasNextPage),e.endCursor!==""&&(n.endCursor=e.endCursor),e.hasPreviousPage!==!1&&(n.hasPreviousPage=e.hasPreviousPage),e.startCursor!==""&&(n.startCursor=e.startCursor),n},create(e){return ru.fromPartial(e??{})},fromPartial(e){let n=PI();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(ru.$type,ru);function MI(){return{orders:[],pageInfo:void 0}}var A8={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=Qe.default.Writer.create()){for(let i of e.orders)Gn.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&ru.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=MI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orders.push(Gn.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=ru.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orders:globalThis.Array.isArray(e?.orders)?e.orders.map(n=>Gn.fromJSON(n)):[],pageInfo:Ci(e.pageInfo)?ru.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>Gn.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=ru.toJSON(e.pageInfo)),n},create(e){return A8.fromPartial(e??{})},fromPartial(e){let n=MI();return n.orders=e.orders?.map(i=>Gn.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?ru.fromPartial(e.pageInfo):void 0,n}};l.set(A8.$type,A8);function _I(){return{orderId:""}}var C8={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=Qe.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=_I();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orderId=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orderId:Ci(e.orderId)?globalThis.String(e.orderId):""}},toJSON(e){let n={};return e.orderId!==""&&(n.orderId=e.orderId),n},create(e){return C8.fromPartial(e??{})},fromPartial(e){let n=_I();return n.orderId=e.orderId??"",n}};l.set(C8.$type,C8);function BI(){return{}}var g8={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=Qe.default.Writer.create()){return n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=BI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return g8.fromPartial(e??{})},fromPartial(e){return BI()}};l.set(g8.$type,g8);function LI(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function b8(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function FI(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):b8(ae.fromJSON(e))}function UI(e){return typeof e=="object"&&e!==null}function Ci(e){return e!=null}var dL=e=>{switch(e){case Rn.ALL:return ni.ALL;case Rn.REMOTE:return ni.REMOTE;case Rn.LOCAL:return ni.LOCAL;case Rn.UNRECOGNIZED:return ni.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},Kr=class{constructor(n){this.scope=n.scope?dL(n.scope):ni.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},A4=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new Kr(i)),n.state&&(this.state=n.state)}},Dc=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new Kr(i)),n.state&&(this.state=n.state)}};function ZI(){var r,t;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(r=globalThis.devvit).debug??(r.debug={});let n={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0},i={};for(let s in n)i[s.toLowerCase()]=s;let d=[...e.searchParams].find(([s])=>s.toLowerCase()==="devvitdebug")?.[1];if(d!=null){d===""&&(d=Object.keys(n).filter(s=>s!=="emitSnapshots"&&s!=="emitState").join());for(let s of d.split(",")??[]){let[f,p]=s.split("=");f&&(f.toLowerCase()in i?f=i[f.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${f}"`),(t=globalThis.devvit.debug)[f]??(t[f]=p||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var Xr;(function(e){e.ENABLE_APP_LOGGING="enableAppLogging",e.ENABLE_DEBUG_LOGGING="enableDebugLogging",e.ENABLE_PLUGINS="enablePlugins",e.LOAD_BUNDLE="loadBundle",e.CALL="call",e.PLUGIN_RESPONSE="pluginResponse",e.QUIT="quit"})(Xr||(Xr={}));var yr;(function(e){e.READY="ready",e.PLUGINS_CONFIGURED="pluginsConfigured",e.BUNDLE_LOADED="bundleLoaded",e.BUNDLE_LOAD_FAILED="bundleLoadFailed",e.RETURN="return",e.ERROR="error",e.CIRCUIT_BREAKER="circuitBreaker",e.PLUGIN_CALL="pluginCall",e.UNHANDLED_REJECTION="unhandledRejection"})(yr||(yr={}));function T8(e){return e.hostname.split(".")[1]??e.hostname}function qI(e){return`${T8(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Zi=B(F(),1);function VI(){return{callState:void 0,connect:void 0}}var R8={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Zi.default.Writer.create()){return e.callState!==void 0&&ou.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&au.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=VI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=ou.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=au.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:C4(e.callState)?ou.fromJSON(e.callState):void 0,connect:C4(e.connect)?au.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=ou.toJSON(e.callState)),e.connect!==void 0&&(n.connect=au.toJSON(e.connect)),n},create(e){return R8.fromPartial(e??{})},fromPartial(e){let n=VI();return n.callState=e.callState!==void 0&&e.callState!==null?ou.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?au.fromPartial(e.connect):void 0,n}};l.set(R8.$type,R8);function JI(){return{appInstalled:void 0}}var $c={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Zi.default.Writer.create()){return e.appInstalled!==void 0&&du.encode(e.appInstalled,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=JI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.appInstalled=du.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:C4(e.appInstalled)?du.fromJSON(e.appInstalled):void 0}},toJSON(e){let n={};return e.appInstalled!==void 0&&(n.appInstalled=du.toJSON(e.appInstalled)),n},create(e){return $c.fromPartial(e??{})},fromPartial(e){let n=JI();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?du.fromPartial(e.appInstalled):void 0,n}};l.set($c.$type,$c);function HI(){return{}}var du={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Zi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=HI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return du.fromPartial(e??{})},fromPartial(e){return HI()}};l.set(du.$type,du);function DI(){return{logs:[]}}var ou={$type:"devvit.cli.PlaytestCallState",encode(e,n=Zi.default.Writer.create()){for(let i of e.logs)lt.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=DI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.logs.push(lt.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(n=>lt.fromJSON(n)):[]}},toJSON(e){let n={};return e.logs?.length&&(n.logs=e.logs.map(i=>lt.toJSON(i))),n},create(e){return ou.fromPartial(e??{})},fromPartial(e){let n=DI();return n.logs=e.logs?.map(i=>lt.fromPartial(i))||[],n}};l.set(ou.$type,ou);function $I(){return{url:""}}var au={$type:"devvit.cli.PlaytestConnect",encode(e,n=Zi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=$I();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.url=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{url:C4(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return au.fromPartial(e??{})},fromPartial(e){let n=$I();return n.url=e.url??"",n}};l.set(au.$type,au);function C4(e){return e!=null}var N8="playtest",WI="ws://localhost:5678";function GI(e){let n=x8();return n===""||n===e}function x8(){return globalThis.location?new URL(location.href).searchParams.get(N8)??void 0:void 0}var Ln=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Wc=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},Gc,Bn,I8,zI,E8,O8,P8,M8,oL=15e3,g4=class{constructor(){Gc.add(this),Bn.set(this,{type:"Init"}),E8.set(this,()=>{Ln(this,Bn,"f").type==="Opened"&&this.onState?.("Closed"),Wc(this,Bn,Ln(this,Gc,"m",zI).call(this),"f")}),O8.set(this,n=>{let i=$c.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),P8.set(this,()=>{if(Ln(this,Bn,"f").type!=="Opening")throw Error(`invalid transition from ${Ln(this,Bn,"f").type}`);this.onState?.("Opened"),Wc(this,Bn,{sock:Ln(this,Bn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),M8.set(this,()=>{Wc(this,Bn,Ln(this,Gc,"m",I8).call(this),"f")})}close(){"timer"in Ln(this,Bn,"f")&&clearTimeout(Ln(this,Bn,"f").timer),"sock"in Ln(this,Bn,"f")&&(Ln(this,Bn,"f").sock.onopen=null,Ln(this,Bn,"f").sock.onmessage=null,Ln(this,Bn,"f").sock.onclose=null,Ln(this,Bn,"f").sock.close()),Wc(this,Bn,{type:"Init"},"f")}open(){Ln(this,Bn,"f").type==="Init"&&Wc(this,Bn,Ln(this,Gc,"m",I8).call(this),"f")}send(n){"sock"in Ln(this,Bn,"f")?Ln(this,Bn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Bn=new WeakMap,E8=new WeakMap,O8=new WeakMap,P8=new WeakMap,M8=new WeakMap,Gc=new WeakSet,I8=function(){let n=new WebSocket(WI);return n.onclose=Ln(this,E8,"f"),n.onmessage=Ln(this,O8,"f"),n.onopen=Ln(this,P8,"f"),{sock:n,type:"Opening"}},zI=function(){return{timer:setTimeout(Ln(this,M8,"f"),oL),type:"Retrying"}};var ii=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},ce=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Nd,b4,ti,Rl,T4,Kc,Yr,Io,Nl,Il,Eo,_8,zc,R4,B8,KI,xl,L8,F8,aL={debug:gn.DEBUG,error:gn.ERROR,info:gn.INFO,log:gn.DEBUG,trace:gn.DEBUG,warn:gn.WARN},N4=class{constructor(n,i,d){Nd.add(this),b4.set(this,void 0),ti.set(this,void 0),Rl.set(this,!1),T4.set(this,0),Kc.set(this,void 0),Yr.set(this,{}),Io.set(this,void 0),Nl.set(this,()=>{}),Il.set(this,void 0),Eo.set(this,void 0),_8.set(this,x8()),zc.set(this,!1),R4.set(this,void 0),B8.set(this,r=>{let t=r.data,[s]=t;switch(s){case yr.READY:{let[,f]=t;ii(this,R4,f,"f"),ce(this,Il,"f")?.plugins?ce(this,Nd,"m",KI).call(this):ce(this,Nd,"m",L8).call(this);break}case yr.PLUGINS_CONFIGURED:ce(this,Nd,"m",L8).call(this);break;case yr.BUNDLE_LOADED:{let[,f]=t;ce(this,Nd,"m",xl).call(this,f),ii(this,Rl,!0,"f"),ce(this,Io,"f")?.resolve({metrics:{init:ce(this,R4,"f")}}),ii(this,Io,void 0,"f");break}case yr.BUNDLE_LOAD_FAILED:{let[,,f,p]=t;ce(this,Nd,"m",xl).call(this,p),ce(this,Io,"f")?.reject(f),ii(this,Io,void 0,"f");break}case yr.RETURN:{let[,f,p,v]=t;ce(this,Nd,"m",xl).call(this,v),ce(this,Yr,"f")[f]?.resolve(p),delete ce(this,Yr,"f")[f];break}case yr.ERROR:{let[,f,p,v]=t;ce(this,Nd,"m",xl).call(this,v),ce(this,Yr,"f")[f]?.reject(p),delete ce(this,Yr,"f")[f];break}case yr.CIRCUIT_BREAKER:{let[,f,p,v]=t;ce(this,Yr,"f")[f]?.reject(new Z5(p,v)),delete ce(this,Yr,"f")[f];break}case yr.PLUGIN_CALL:{let[,f,p,v,w,b]=t;ce(this,Il,"f")?.callback(f,p,v,w,b);break}case yr.UNHANDLED_REJECTION:{let[,,f,p]=t;ce(this,Nd,"m",xl).call(this,p),ce(this,Nl,"f").call(this,"UnhandledRejection",f);break}}}),F8.set(this,r=>{switch(r){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),ce(this,Eo,"f")?.close();let t=new URL(location.href);t.searchParams.set(N8,ce(this,_8,"f")??""),location.assign(t),location.reload();break}}}),ii(this,b4,n,"f"),i&&ii(this,Nl,i,"f"),d&&ii(this,Il,d,"f")}get ready(){return ce(this,Rl,"f")}get runtimeDebugLogging(){return ce(this,zc,"f")}set runtimeDebugLogging(n){n!==ce(this,zc,"f")&&(ii(this,zc,n,"f"),this.runtimeDebugLogging&&ce(this,ti,"f")?.postMessage([Xr.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(ce(this,ti,"f"))throw new Error("Bundle already loaded");let i=GI(T8(n));i&&(ii(this,Eo,new g4,"f"),ce(this,Eo,"f").onState=ce(this,F8,"f")),ce(this,Eo,"f")?.open();let d=new Worker(URL.createObjectURL(ce(this,b4,"f")),{name:`App: ${qI(n)}`,type:"module"});return d.onerror=r=>ce(this,Nl,"f").call(this,"Error",r.error),d.onmessageerror=r=>ce(this,Nl,"f").call(this,"MessageError",r.data),d.onmessage=ce(this,B8,"f"),ii(this,ti,d,"f"),ii(this,Kc,n,"f"),this.runtimeDebugLogging&&ce(this,ti,"f").postMessage([Xr.ENABLE_DEBUG_LOGGING]),i&&ce(this,ti,"f").postMessage([Xr.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ii(this,Io,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!ce(this,Rl,"f")||!ce(this,ti,"f"))throw new Error("No bundle loaded");let t=ii(this,T4,(r=ce(this,T4,"f"),++r),"f"),s=new Promise((f,p)=>{ce(this,Yr,"f")[t]={resolve:f,reject:p}});return ce(this,ti,"f").postMessage([Xr.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){ce(this,ti,"f")?.postMessage([Xr.PLUGIN_RESPONSE,n,i])}quit(){ce(this,Eo,"f")?.close(),ii(this,Eo,void 0,"f"),ii(this,Rl,!1,"f"),ce(this,ti,"f")&&(ce(this,ti,"f").postMessage([Xr.QUIT]),ce(this,ti,"f").onerror=null,ce(this,ti,"f").onmessageerror=null,ce(this,ti,"f").onmessage=null,ce(this,ti,"f").terminate()),ii(this,ti,void 0,"f");for(let{reject:n}of Object.values(ce(this,Yr,"f")))n(Error("worker terminated"));ii(this,Yr,{},"f"),ce(this,Io,"f")?.reject(Error("worker terminated")),ii(this,Io,void 0,"f")}};b4=new WeakMap,ti=new WeakMap,Rl=new WeakMap,T4=new WeakMap,Kc=new WeakMap,Yr=new WeakMap,Io=new WeakMap,Nl=new WeakMap,Il=new WeakMap,Eo=new WeakMap,_8=new WeakMap,zc=new WeakMap,R4=new WeakMap,B8=new WeakMap,F8=new WeakMap,Nd=new WeakSet,KI=function(){ce(this,ti,"f")?.postMessage([Xr.ENABLE_PLUGINS,ce(this,Il,"f")?.plugins??[]])},xl=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:aL[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};ce(this,Eo,"f")?.send({callState:d})},L8=function(){ce(this,ti,"f")?.postMessage([Xr.LOAD_BUNDLE,ce(this,Kc,"f")]),ii(this,Kc,void 0,"f")};var U8="RenderPostContent",uL=new Set([U8]);function XI(e){if(uL.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var El,Xc,x4=class{constructor(n){Re(this,El);Re(this,Xc);mn(this,El,n)}set env(n){mn(this,El,n)}set props(n){mn(this,Xc,n)}build(n,i){return new A4({state:n,events:i.map(d=>d.uiEvent),env:O(this,El),props:O(this,Xc)})}};El=new WeakMap,Xc=new WeakMap;var kt,Yc,O4,I4=class{constructor(){Re(this,kt);Re(this,Yc,!1);Re(this,O4,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===xu.fullName&&d===xu.methods.send.name&&O(this,kt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!O(this,kt)?.ready}set runtimeDebugLogging(n){mn(this,Yc,n),O(this,kt)&&(O(this,kt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),mn(this,kt,n?new N4(n,(i,d)=>console.error(i,d),{callback:O(this,O4),plugins:[]}):void 0),O(this,kt)&&(O(this,kt).runtimeDebugLogging=O(this,Yc))}unload(){O(this,kt)?.quit()}async load(n){this.unload();try{return await O(this,kt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!O(this,kt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),O(this,kt)?.call(XI(n),i.uiRequest,this.metadata).then(t=>d(new Dc(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};kt=new WeakMap,Yc=new WeakMap,O4=new WeakMap;var E4=class{isReady(){return!!this.remote}load(n){this.remote=n}handle(n,i,d,r){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[XI(n)](i.uiRequest,this.metadata).then(t=>d(new Dc(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var Oo,Po,Qc,P4=class{constructor(n){Re(this,Oo,new Map);Re(this,Po,new Map);Re(this,Qc);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),mn(this,Qc,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),O(this,Po).set(n.id,n),O(this,Oo).set(n.id,window.setInterval(()=>{O(this,Qc).submit([new Kr({scope:Rn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(O(this,Po));n.forEach(d=>{i.delete(d.id),O(this,Po).has(d.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",d),this.add(d))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",i);for(let[d]of i)this.remove(d)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let n of O(this,Oo).values())clearInterval(n);O(this,Oo).clear(),O(this,Po).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...O(this,Po).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of O(this,Oo).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),O(this,Po).delete(n),clearInterval(O(this,Oo).get(n)),O(this,Oo).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};Oo=new WeakMap,Po=new WeakMap,Qc=new WeakMap;var YI=e=>e.message==="ServerCallRequired",Z8=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){YI(n[0])||console.error(this.tag(),...n)}info(n){console.info(this.tag(),...n)}warn(n){console.warn(this.tag(),...n)}tag(){return"[kmp-dispatcher]"}},q8=class{constructor(){this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")}}logRuntimeError(n){YI(n)||console.error("[kmp-dispatcher-perf-analytics] error",n)}logRuntimeTrace(n){devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n)}};ZI();var lL=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},sL=["showToast","showForm","navigateToUrl","createOrder"],t0,r0,Sr,jc,d0,Qr,Ol,M4=class{constructor(n,i,d){Re(this,t0);Re(this,r0);Re(this,Sr);Re(this,jc);this.hasRendered=!1;Re(this,d0);Re(this,Qr);Re(this,Ol);mn(this,t0,new x4(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),mn(this,Sr,new m4(n??{},O(this,t0),U8,{logger:new Z8,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new q8,errorHandler:r=>this.onError?.(r)})),mn(this,r0,new P4(O(this,Sr))),mn(this,d0,new E4),mn(this,Qr,new I4),this.init()}get state(){return O(this,Sr).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[G1.Debug]={values:d}),O(this,Qr).metadata=i,O(this,d0).metadata=i}set onPluginCall(n){O(this,Qr).onPluginCall=n}set runtimeDebugLogging(n){O(this,Qr).runtimeDebugLogging=n}subscribe(n){mn(this,jc,O(this,Sr).subscribe((...i)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",i[0]);let[{response:d}]=i;d.uiResponse.effects.forEach(r=>{if(sL.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&O(this,r0).clear(),O(this,r0).apply(t.map(([s,f])=>new Yi(s,lL(f.duration))));return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(r,null,2)}`)}),n(...i)}))}submit(...n){O(this,Sr).submit(...n)}unsubscribe(){O(this,jc)?.unsubscribe()}init(){O(this,Sr).init(O(this,Qr),O(this,d0),O(this,r0))}togglePause(n){n?mn(this,Ol,O(this,Sr).pause()):O(this,Ol)&&O(this,Sr).resume(O(this,Ol))}resetAppState(){this.hasRendered=!1,O(this,Sr).reset()}setEnv(n){O(this,t0).env=n}setProps(n){O(this,t0).props=n}remoteLoad(...n){O(this,d0).load(...n)}async localLoad(...n){return O(this,Qr).reset(),await O(this,Qr).load(...n)}localLoadWorker(...n){O(this,Qr).setLocalSrc(...n)}};t0=new WeakMap,r0=new WeakMap,Sr=new WeakMap,jc=new WeakMap,d0=new WeakMap,Qr=new WeakMap,Ol=new WeakMap;function QI(e,n,i,d){let r=d.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(r.length<3)return"";let[t,s,f]=r;if(!n||!s||!f)return"";let p=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",p).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var o0,a0,u0,n3,vn,_4,B4,L4,F4,l0,e3,U4,gi=class extends Xt{constructor(){super();Re(this,l0);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webviewUrlTemplate="";this.disableAssetSandbox=!1;Re(this,o0);Re(this,a0);Re(this,u0);Re(this,n3,"");Re(this,vn);Re(this,_4,()=>({experimental:this.useExperimentalBlocks,resolveWebviewUrl:i=>this.disableAssetSandbox?i:QI(this.webviewUrlTemplate,this.metadata?.[G1.Subreddit]?.values?.[0],O(this,n3),i),onAction:i=>O(this,vn)?.submit([new Kr({scope:Rn.ALL,userAction:{actionId:i.id,data:i.data??{}},hook:i.id})]),stackDirection:we.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));Re(this,B4,i=>{cN(i)||console.error(i),Ml(this,l0,e3).call(this,"devvit-ui-error",{err:i,type:"Error"})});Re(this,L4,(i,d,r,t,s)=>{d===xu.fullName&&r===xu.methods.send.name&&Ml(this,l0,e3).call(this,"devvit-realtime-send",{event:t})});Re(this,F4,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,O(this,o0)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig=yd.fromPartial({})),this._rootBlock.config.rootConfig.height=O(this,o0)):mn(this,o0,this._rootBlock.config?.rootConfig?.height||mp))});Re(this,U4,i=>{Ml(this,l0,e3).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>O(this,vn)?.submit([new Kr(d)]),metadata:this.metadata})});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[x5]}async connectedCallback(){super.connectedCallback(),mn(this,vn,new M4({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[G1.Language]?.values?.[0],timezone:this.metadata?.[G1.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution})),O(this,vn).onPluginCall=O(this,L4),O(this,vn).onError=O(this,B4),O(this,vn).onUserAction=O(this,U4),O(this,vn).subscribe(i=>{O(this,F4).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),mn(this,a0,new ResizeObserver(hN(i=>{i.length!==0&&(this.dimensions=kN(i[0],window,document.body))},600))),O(this,a0).observe(this,{box:"content-box"}),mn(this,u0,new IntersectionObserver(i=>{i.forEach(d=>{O(this,vn)?.togglePause(!d.isIntersecting)})})),O(this,u0).observe(this)}disconnectedCallback(){O(this,a0)?.unobserve(this),O(this,a0)?.disconnect(),O(this,u0)?.unobserve(this),O(this,u0)?.disconnect(),O(this,vn)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?St`<div class="relative">
|
|
623
|
+
</div>`}else return r}var vc,mc,U5,zu=class extends Xt{constructor(){super(...arguments);Re(this,vc,window.matchMedia("(prefers-color-scheme: dark)"));Re(this,mc,()=>this.requestUpdate());Re(this,U5,()=>({stackDirection:we.UNRECOGNIZED}))}static get styles(){return[x5]}connectedCallback(){super.connectedCallback(),O(this,vc)?.addEventListener("change",O(this,mc))}disconnectedCallback(){super.disconnectedCallback(),O(this,vc)?.removeEventListener("change",O(this,mc))}render(){if(this.block&&this.block.type===ye.BLOCK_ROOT){let i={...O(this,U5).call(this),...this.renderContext?.()??{}};return St`<div class="${_o(this.class)}">${kp(this.block,i)}</div>`}return St`${cR({creative:St`<slot name="empty-state-image"></slot>`,title:ap("Whoops!",{desc:"Header for message to display when rendering fails"}),description:ap("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};vc=new WeakMap,mc=new WeakMap,U5=new WeakMap,on([Mn({attribute:!1})],zu.prototype,"block",2),on([Mn({attribute:!1})],zu.prototype,"renderContext",2),on([Mn()],zu.prototype,"class",2),zu=on([sR(),nl("devvit-blocks-renderer")],zu);var fN="ServerCallRequired";var Z5=class extends Error{constructor(n,i){super(fN),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function cN(e){return e?.message===fN}var G1=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",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies",WebviewTemplate:"devvit-webview-template"}),pN;(function(e){e.Blocks="blocks",e.EmitSnapshots="emitSnapshots",e.EmitState="emitState",e.Realtime="realtime",e.Runtime="runtime",e.Surface="surface",e.UseAsync="useAsync",e.Payments="payments",e.Bootstrap="bootstrap"})(pN||(pN={}));function hN(e,n){let i,d=0,r;return function(...t){return r=t,i??(i=setTimeout(()=>{d=Date.now(),i=void 0;let s=r;r=void 0,e.apply(this,s)},Math.max(0,n-(Date.now()-d)))),()=>{i!=null&&clearTimeout(i),i=void 0,r=void 0}}}function vN(e,n){if(!e)throw Error(n)}var q5;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(q5||(q5={}));function EM(e){return e.startsWith(q5.LINK)}function OM(e){vN(EM(e),`Expected link id to start with ${q5.LINK}, got ${e}}`)}function mN(e){return OM(e),e}function kN(e,n,i){let{width:d,height:r}=e.contentRect,s=n.getComputedStyle(i).fontSize.split("px")[0],f=s?parseFloat(s)/16:1;return{width:Math.round(d),height:Math.round(r),scale:n.devicePixelRatio,fontScale:f}}typeof ArrayBuffer.isView>"u"&&(ArrayBuffer.isView=function(e){return e!=null&&e.__proto__!=null&&e.__proto__.__proto__===Int8Array.prototype.__proto__});typeof Array.prototype.fill>"u"&&Object.defineProperty(Array.prototype,"fill",{value:function(e){if(this==null)throw new TypeError("this is null or not defined");for(var n=Object(this),i=n.length>>>0,d=arguments[1],r=d>>0,t=r<0?Math.max(i+r,0):Math.min(r,i),s=arguments[2],f=s===void 0?i:s>>0,p=f<0?Math.max(i+f,0):Math.min(f,i);t<p;)n[t]=e,t++;return n}});[Int8Array,Int16Array,Uint16Array,Int32Array,Float32Array,Float64Array].forEach(function(e){typeof e.prototype.fill>"u"&&Object.defineProperty(e.prototype,"fill",{value:Array.prototype.fill})});typeof Math.clz32>"u"&&(Math.clz32=function(e,n){return function(i){var d=i>>>0;return d===0?32:31-(e(d)/n|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(n,i){return(n&4294901760)*(i&65535)+(n&65535)*(i|0)|0});var _N=Math.clz32,gp=ArrayBuffer.isView,hn=Math.imul;Z(Bp,"CharSequence",To);Z(Lp,"Number",re);Z(Fp,"Unit",ei);Z(fl,"IntCompanionObject",ei);Z(Xi,"Collection",To);Z(go,"AbstractCollection",re,L,[Xi]);Z(Vr,"AbstractMutableCollection",re,go,[go,Xi]);Z(wc,"IteratorImpl",re);Z(pl,"List",To,L,[Xi]);Z(hr,"AbstractMutableList",re,Vr,[Vr,Xi,pl]);Z(Co,"Map",To);Z(vr,"AbstractMap",re,L,[Co]);Z(rl,"AbstractMutableMap",re,vr,[vr,Co]);Z(Y5,"Set",To,L,[Xi]);Z(dl,"AbstractMutableSet",re,Vr,[Vr,Xi,Y5]);Z(UN,"Companion",ei);Z(Dn,"ArrayList",re,hr,[hr,Xi,pl],bo);Z(Jr,"HashMap",re,rl,[rl,Co],$M);Z(mr,"HashMapEntrySetBase",re,dl,[Xi,Y5,dl]);Z(qp,"HashMapEntrySet",re,mr);Z(WN,"Companion",ei);Z(Xu,"Itr",re);Z(Cc,"EntriesItr",re,Xu);Z(Ao,"Entry",To);Z(Yu,"EntryRef",re,L,[Ao]);function PM(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o(),t=r,s;if(t!=null&&Hn(t,Ao)?s=this.w3(t):s=!1,!s){n=!1;break e}}n=!0}return n}Z(GN,"InternalMap",To);Z(Bi,"InternalHashMap",re,L,[GN],DN);Z(X5,"LinkedHashMap",re,Jr,[Jr,Co],gc);Z(Dr,"StringBuilder",re,L,[Bp],Hp);Z(jN,"Companion",ei);Z(ex,"Char",re);Z(nx,"Companion",ei);Z(mt,"Enum",re);Z(Q5,L,re);Z(cx,"Companion",ei);Z(Ee,"Long",re,Lp);Z(Ro,"Exception",re,Error,L,bx);Z(Li,"RuntimeException",re,Ro,L,Ix);Z(yl,"IllegalArgumentException",re,Li,L,Rx);Z(wl,"IndexOutOfBoundsException",re,Li,L,Nx);Z(Al,"IllegalStateException",re,Li,L,xx);Z(e4,"UnsupportedOperationException",re,Li,L,Cl);Z(gl,"NoSuchElementException",re,Li,L,Y1);Z(n4,"ConcurrentModificationException",re,Li,L,Kp);Z(bl,"ArithmeticException",re,Li,L,Ox);Z(i4,"NullPointerException",re,Li,L,Xp);Z(t4,"ClassCastException",re,Li,L,Yp);Z(Tl,"UninitializedPropertyAccessException",re,Li,L,Mx);Z(Q1,"Companion",ei);Z(Lx,"Companion",ei);Z(r4,"Companion",ei);Z(Ux,"Companion",ei);Z(Nn,"ArrayDeque",re,hr,L,xc);Z(zr,"EmptyList",ei,L,[pl]);Z(d4,"EmptyIterator",ei);Z(No,"ArrayAsCollection",re,L,[Xi]);Z(o4,"IntIterator",re);Z(qx,"Companion",ei);Z(gd,"IntProgression",re);Z(X1,"IntRange",re,gd);Z(a4,"IntProgressionIterator",re,o4);Z(n8,"Companion",ei);Z(vt,"Pair",re);function Bp(){}function Lp(){}function Fp(){}c(Fp).toString=function(){return"kotlin.Unit"};var Ue;function fl(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}c(fl).c=function(){return this.MIN_VALUE};c(fl).d=function(){return this.MAX_VALUE};c(fl).e=function(){return this.SIZE_BYTES};c(fl).f=function(){return this.SIZE_BITS};var Up;function MM(e){return e!==e}function _M(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-_N(e)|0)}return n}function BN(e){return EB(e)}function BM(e,n){return n}function LM(e,n){return hl(Array(n),null)}function G5(e){return MB([e])}function cl(e){var n;return e.toArray!==void 0?n=e.toArray():n=BN(e),n}function Fe(e,n,i,d,r){Ki.h(d,r,e.length);var t=r-d|0;if(Ki.h(i,i+t|0,n.length),gp(n)&&gp(e)){var s=e.subarray(d,r);n.set(s,i)}else if(e!==n||i<=d){var f=0;if(f<t)do{var p=f;f=f+1|0,n[i+p|0]=e[d+p|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var w=v;v=v+-1|0,n[i+w|0]=e[d+w|0]}while(0<=v)}}function FM(e){return e<0&&_B(),e}function Vr(){go.call(this)}c(Vr).j=function(e){this.k();for(var n=this.l();n.m();)if(Ze(n.o(),e))return n.n(),!0;return!1};c(Vr).p=function(e){this.k();for(var n=!1,i=e.l();i.m();){var d=i.o();this.i(d)&&(n=!0)}return n};c(Vr).toJSON=function(){return this.toArray()};c(Vr).k=function(){};function wc(e){this.w_1=e,this.u_1=0,this.v_1=-1}c(wc).m=function(){return this.u_1<this.w_1.q()};c(wc).o=function(){if(!this.m())throw Y1();var e=this,n=this.u_1;return this.u_1=n+1|0,e.v_1=n,this.w_1.x(this.v_1)};c(wc).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw Rc($r(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function hr(){Vr.call(this),this.y_1=0}c(hr).i=function(e){return this.k(),this.a1(this.q(),e),!0};c(hr).l=function(){return new wc(this)};c(hr).r=function(e){return this.b1(e)>=0};c(hr).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=i;break e}i=i+1|0}n=-1}return n};c(hr).equals=function(e){return e===this?!0:e!=null&&Hn(e,pl)?Ki.c1(this,e):!1};c(hr).hashCode=function(){return Ki.d1(this)};function rl(){vr.call(this),this.g1_1=null,this.h1_1=null}c(rl).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Ze(e,d)){var r=i.m1();return n.n(),r}}return null};c(rl).k=function(){};function dl(){Vr.call(this)}c(dl).equals=function(e){return e===this?!0:e!=null&&Hn(e,Y5)?Qp.s1(this,e):!1};c(dl).hashCode=function(){return Qp.t1(this)};function LN(e){if(!(e>=0)){var n="capacity must be non-negative.";throw Hr($r(n))}return hl(Array(e),null)}function FN(e,n){e[n]=null}function yN(e,n,i){e.fill(null,n,i)}function SN(e,n){return aB(e,n)}function UN(){bp=this;var e=this,n=Zp(0);n.w1_1=!0,e.x1_1=n}var bp;function UM(){return bp==null&&new UN,bp}function ZM(e){var n=[];return Dn.call(e,n),e}function bo(){return ZM(We(c(Dn)))}function qM(e,n){var i=[];if(Dn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw Hr($r(d))}return n}function Zp(e){return qM(e,We(c(Dn)))}function VM(e,n){var i=cl(e);return Dn.call(n,i),n}function ZN(e){return VM(e,We(c(Dn)))}function JM(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function qN(e,n){return Ki.y1(n,e.q()),n}function HM(e,n){return Ki.z1(n,e.q()),n}function Dn(e){UM(),hr.call(this),this.v1_1=e,this.w1_1=!1}c(Dn).q=function(){return this.v1_1.length};c(Dn).x=function(e){var n=this.v1_1[qN(this,e)];return n==null||n!=null?n:en()};c(Dn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};c(Dn).a1=function(e,n){this.k(),this.v1_1.splice(HM(this,e),0,n),this.y_1=this.y_1+1|0};c(Dn).p=function(e){if(this.k(),e.t())return!1;for(var n=JM(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=FM(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};c(Dn).z=function(e){this.k(),qN(this,e),this.y_1=this.y_1+1|0;var n;return e===W5(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};c(Dn).j=function(e){this.k();var n=0,i=this.v1_1.length-1|0;if(n<=i)do{var d=n;if(n=n+1|0,Ze(this.v1_1[d],e))return this.v1_1.splice(d,1),this.y_1=this.y_1+1|0,!0}while(n<=i);return!1};c(Dn).b1=function(e){return XN(this.v1_1,e)};c(Dn).toString=function(){return b_(this.v1_1)};c(Dn).a2=function(){return[].slice.call(this.v1_1)};c(Dn).toArray=function(){return this.a2()};c(Dn).k=function(){if(this.w1_1)throw Cl()};function DM(e,n){return rl.call(n),Jr.call(n),n.f2_1=e,n}function VN(e){return DM(DN(),e),e}function $M(){return VN(We(c(Jr)))}c(Jr).p1=function(e){return this.f2_1.h2(e)};c(Jr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new qp(this.f2_1);this.g2_1=i,n=i}else n=e;return n};c(Jr).r1=function(e){return this.f2_1.r1(e)};c(Jr).i1=function(e,n){return this.f2_1.i1(e,n)};c(Jr).j1=function(e){return this.f2_1.j1(e)};c(Jr).q=function(){return this.f2_1.q()};function Jr(){this.g2_1=null}function qp(e){mr.call(this,e)}c(qp).l=function(){return this.j2_1.k2()};function mr(e){dl.call(this),this.j2_1=e}c(mr).q=function(){return this.j2_1.q()};c(mr).t=function(){return this.j2_1.q()===0};c(mr).l2=function(e){return this.j2_1.n2(e)};c(mr).r=function(e){return e!=null&&Hn(e,Ao)?this.l2(e!=null&&Hn(e,Ao)?e:en()):!1};c(mr).m2=function(e){throw Cl()};c(mr).i=function(e){return this.m2(e!=null&&Hn(e,Ao)?e:en())};c(mr).p=function(e){throw Cl()};c(mr).s=function(e){return this.j2_1.o2(e)};c(mr).k=function(){return this.j2_1.k()};function JN(e,n){return _M(hn(J5(n,1),3))}function HN(e,n){return _N(n)+1|0}function WM(e){return GM(8,e),e}function DN(){return WM(We(c(Bi)))}function GM(e,n){return Bi.call(n,LN(e),null,new Int32Array(e),new Int32Array(JN(Ac,e)),2,0),n}function ol(e){return e.p2_1.length}function $t(e){return e.s2_1.length}function Vp(e){e.w2_1=e.w2_1+1|0}function zM(e,n){KM(e,n)?Jp(e,$t(e)):XM(e,e.u2_1+n|0)}function KM(e,n){var i=ol(e)-e.u2_1|0,d=e.u2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(ol(e)/4|0):!1}function XM(e,n){if(n<0)throw Ex("too many elements");if(n>ol(e)){var i=Ki.z2(ol(e),n);e.p2_1=SN(e.p2_1,i);var d=e,r=e.q2_1;d.q2_1=r==null?null:SN(r,i),e.r2_1=oB(e.r2_1,i);var t=JN(Ac,i);t>$t(e)&&Jp(e,t)}}function YM(e){var n=e.q2_1;if(n!=null)return n;var i=LN(ol(e));return e.q2_1=i,i}function z5(e,n){return n==null?0:hn(_n(n),-1640531527)>>>e.v2_1|0}function QM(e){for(var n=0,i=0,d=e.q2_1;n<e.u2_1;)e.r2_1[n]>=0&&(e.p2_1[i]=e.p2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;yN(e.p2_1,i,e.u2_1),d==null||yN(d,i,e.u2_1),e.u2_1=i}function Jp(e,n){Vp(e),e.u2_1>e.x2_1&&QM(e),n!==$t(e)?(e.s2_1=new Int32Array(n),e.v2_1=HN(Ac,n)):rB(e.s2_1,0,0,$t(e));for(var i=0;i<e.u2_1;){var d=i;if(i=d+1|0,!jM(e,d))throw Rc("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function jM(e,n){for(var i=z5(e,e.p2_1[n]),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return e.s2_1[i]=n+1|0,e.r2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=$t(e)-1|0)}}function K5(e,n){for(var i=z5(e,n),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return-1;if(r>0&&Ze(e.p2_1[r-1|0],n))return r-1|0;if(d=d-1|0,d<0)return-1;var t=i;i=t-1|0,t===0&&(i=$t(e)-1|0)}}function e_(e,n){e.k();e:for(;;)for(var i=z5(e,n),d=H5(hn(e.t2_1,2),$t(e)/2|0),r=0;;){var t=e.s2_1[i];if(t<=0){if(e.u2_1>=ol(e)){zM(e,1);continue e}var s=e.u2_1;e.u2_1=s+1|0;var f=s;return e.p2_1[f]=n,e.r2_1[f]=i,e.s2_1[i]=f+1|0,e.x2_1=e.x2_1+1|0,Vp(e),r>e.t2_1&&(e.t2_1=r),f}if(Ze(e.p2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){Jp(e,hn($t(e),2));continue e}var p=i;i=p-1|0,p===0&&(i=$t(e)-1|0)}}function n_(e,n){e.k();var i=K5(e,n);return i<0?-1:($N(e,i),i)}function $N(e,n){FN(e.p2_1,n),i_(e,e.r2_1[n]),e.r2_1[n]=-1,e.x2_1=e.x2_1-1|0,Vp(e)}function i_(e,n){for(var i=n,d=n,r=0,t=H5(hn(e.t2_1,2),$t(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=$t(e)-1|0),r=r+1|0,r>e.t2_1)return e.s2_1[d]=0,Ue;var f=e.s2_1[i];if(f===0)return e.s2_1[d]=0,Ue;if(f<0)e.s2_1[d]=-1,d=i,r=0;else{var p=z5(e,e.p2_1[f-1|0]);((p-i|0)&($t(e)-1|0))>=r&&(e.s2_1[d]=f,e.r2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.s2_1[d]=-1,Ue}}function t_(e,n){return e.x2_1===n.q()?e.o2(n.k1()):!1}function WN(){this.a3_1=-1640531527,this.b3_1=8,this.c3_1=2,this.d3_1=-1}var Ac;function Xu(e){this.e3_1=e,this.f3_1=0,this.g3_1=-1,this.h3_1=this.e3_1.w2_1,this.i3()}c(Xu).i3=function(){for(;this.f3_1<this.e3_1.u2_1&&this.e3_1.r2_1[this.f3_1]<0;)this.f3_1=this.f3_1+1|0};c(Xu).m=function(){return this.f3_1<this.e3_1.u2_1};c(Xu).n=function(){if(this.j3(),this.g3_1===-1){var e="Call next() before removing element from the iterator.";throw Rc($r(e))}this.e3_1.k(),$N(this.e3_1,this.g3_1),this.g3_1=-1,this.h3_1=this.e3_1.w2_1};c(Xu).j3=function(){if(this.e3_1.w2_1!==this.h3_1)throw Kp()};function Cc(e){Xu.call(this,e)}c(Cc).o=function(){if(this.j3(),this.f3_1>=this.e3_1.u2_1)throw Y1();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=new Yu(this.e3_1,this.g3_1);return this.i3(),i};c(Cc).o3=function(){if(this.f3_1>=this.e3_1.u2_1)throw Y1();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=this.e3_1.p2_1[this.g3_1],d=i==null?null:_n(i),r=d??0,t=ml(this.e3_1.q2_1)[this.g3_1],s=t==null?null:_n(t),f=r^(s??0);return this.i3(),f};c(Cc).p3=function(e){if(this.f3_1>=this.e3_1.u2_1)throw Y1();var n=this,i=this.f3_1;this.f3_1=i+1|0,n.g3_1=i;var d=this.e3_1.p2_1[this.g3_1];Ze(d,this.e3_1)?e.s3("(this Map)"):e.r3(d),e.t3(61);var r=ml(this.e3_1.q2_1)[this.g3_1];Ze(r,this.e3_1)?e.s3("(this Map)"):e.r3(r),this.i3()};function Yu(e,n){this.u3_1=e,this.v3_1=n}c(Yu).l1=function(){return this.u3_1.p2_1[this.v3_1]};c(Yu).m1=function(){return ml(this.u3_1.q2_1)[this.v3_1]};c(Yu).equals=function(e){var n,i;return e!=null&&Hn(e,Ao)?i=Ze(e.l1(),this.l1()):i=!1,i?n=Ze(e.m1(),this.m1()):n=!1,n};c(Yu).hashCode=function(){var e=this.l1(),n=e==null?null:_n(e),i=n??0,d=this.m1(),r=d==null?null:_n(d);return i^(r??0)};c(Yu).toString=function(){return""+this.l1()+"="+this.m1()};function Bi(e,n,i,d,r,t){this.p2_1=e,this.q2_1=n,this.r2_1=i,this.s2_1=d,this.t2_1=r,this.u2_1=t,this.v2_1=HN(Ac,$t(this)),this.w2_1=0,this.x2_1=0,this.y2_1=!1}c(Bi).q=function(){return this.x2_1};c(Bi).r1=function(e){var n=K5(this,e);return n<0?null:ml(this.q2_1)[n]};c(Bi).h2=function(e){return K5(this,e)>=0};c(Bi).i1=function(e,n){var i=e_(this,e),d=YM(this);if(i<0){var r=d[(-i|0)-1|0];return d[(-i|0)-1|0]=n,r}else return d[i]=n,null};c(Bi).j1=function(e){var n=n_(this,e);if(n<0)return null;var i=ml(this.q2_1),d=i[n];return FN(i,n),d};c(Bi).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&Hn(e,Co)?i=t_(this,e):i=!1,n=i}return n};c(Bi).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.o3()|0;return e};c(Bi).toString=function(){var e=o_(2+hn(this.x2_1,3)|0);e.s3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.s3(", "),i.p3(e),n=n+1|0;return e.s3("}"),e.toString()};c(Bi).k=function(){if(this.y2_1)throw Cl()};c(Bi).n2=function(e){var n=K5(this,e.l1());return n<0?!1:Ze(ml(this.q2_1)[n],e.m1())};c(Bi).w3=function(e){return this.n2(Hn(e,Ao)?e:en())};c(Bi).k2=function(){return new Cc(this)};function GN(){}function r_(e){return VN(e),X5.call(e),e}function gc(){return r_(We(c(X5)))}c(X5).k=function(){return this.f2_1.k()};function X5(){}function d_(e,n){return zN(n),n}function o_(e){return d_(e,We(c(Dr)))}function zN(e){return Dr.call(e,""),e}function Hp(){return zN(We(c(Dr)))}function Dr(e){this.q3_1=e!==void 0?e:""}c(Dr).a=function(){return this.q3_1.length};c(Dr).b=function(e){var n=this.q3_1,i;if(e>=0&&e<=Hx(n))i=al(n,e);else throw Sl("index: "+e+", length: "+this.a()+"}");return i};c(Dr).t3=function(e){return this.q3_1=this.q3_1+D5(e),this};c(Dr).d4=function(e){return this.q3_1=this.q3_1+bc(e),this};c(Dr).r3=function(e){return this.q3_1=this.q3_1+bc(e),this};c(Dr).s3=function(e){var n=this,i=this.q3_1;return n.q3_1=i+(e??"null"),this};c(Dr).toString=function(){return this.q3_1};function wN(e){var n=D5(e).toUpperCase();return n.length>1?e:al(n,0)}function a_(e,n,i,d,r,t){return t=t===L?!1:t,Wx(e,n,i,d,r,t)}function Dp(e){switch(e.length){case 0:return Gr();case 1:return G5(e[0]);default:return u_(e)}}function KN(e){return e.length-1|0}function u_(e){return ZN(PB(e))}function XN(e,n){if(n==null){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;if(i=i+1|0,e[r]==null)return r}while(i<=d)}else{var t=0,s=e.length-1|0;if(t<=s)do{var f=t;if(t=t+1|0,Ze(n,e[f]))return f}while(t<=s)}return-1}function l_(e,n){return XN(e,n)>=0}function s_(e,n,i,d,r,t,s){return n=n===L?", ":n,i=i===L?"":i,d=d===L?"":d,r=r===L?-1:r,t=t===L?"...":t,s=s===L?null:s,f_(e,Hp(),n,i,d,r,t,s).toString()}function f_(e,n,i,d,r,t,s,f){i=i===L?", ":i,d=d===L?"":d,r=r===L?"":r,t=t===L?-1:t,s=s===L?"...":s,f=f===L?null:f,n.d4(d);var p=0,v=0,w=e.length;e:for(;v<w;){var b=e[v];if(v=v+1|0,p=p+1|0,p>1&&n.d4(i),t<0||p<=t)Jx(n,b,f);else break e}return t>=0&&p>t&&n.d4(s),n.d4(r),n}function YN(e,n,i,d,r,t,s){return n=n===L?", ":n,i=i===L?"":i,d=d===L?"":d,r=r===L?-1:r,t=t===L?"...":t,s=s===L?null:s,c_(e,Hp(),n,i,d,r,t,s).toString()}function c_(e,n,i,d,r,t,s,f){i=i===L?", ":i,d=d===L?"":d,r=r===L?"":r,t=t===L?-1:t,s=s===L?"...":s,f=f===L?null:f,n.d4(d);var p=0,v=e.l();e:for(;v.m();){var w=v.o();if(p=p+1|0,p>1&&n.d4(i),t<0||p<=t)Jx(n,w,f);else break e}return t>=0&&p>t&&n.d4(s),n.d4(r),n}function QN(e){if(e.t())throw Nc("List is empty.");return e.x(0)}function J5(e,n){return e<n?n:e}function p_(e,n){return Vx.e4(e,n,-1)}function H5(e,n){return e>n?n:e}function h_(e){var n=e&65535;return n}function AN(e){return e}function D5(e){return String.fromCharCode(e)}function jN(){Tp=this,this.f4_1=0,this.g4_1=65535,this.h4_1=55296,this.i4_1=56319,this.j4_1=56320,this.k4_1=57343,this.l4_1=55296,this.m4_1=57343,this.n4_1=2,this.o4_1=16}var Tp;function CN(){return Tp==null&&new jN,Tp}function ex(){}function pl(){}function Xi(){}function Ao(){}function Co(){}function Y5(){}function nx(){}var v_;function mt(e,n){this.p4_1=e,this.q4_1=n}c(mt).r4=function(){return this.p4_1};c(mt).s4=function(){return this.q4_1};c(mt).t4=function(e){return R_(this.q4_1,e.q4_1)};c(mt).u4=function(e){return this.t4(e instanceof mt?e:en())};c(mt).equals=function(e){return this===e};c(mt).hashCode=function(){return x_(this)};c(mt).toString=function(){return this.p4_1};function bc(e){var n=e==null?null:$r(e);return n??"null"}function m_(e){for(var n=1,i=[],d=0,r=e.length;d<r;){var t=e[d];d=d+1|0;var s=n,f=t.prototype.$imask$,p=f??t.$imask$;p!=null&&(i.push(p),s=p.length);var v=t.$metadata$.iid,w;v==null?w=null:w=k_(v);var b=w;b!=null&&(i.push(b),s=Math.max(s,b.length)),s>n&&(n=s)}return y_(n,i)}function k_(e){var n=e>>5,i=new Int32Array(n+1|0),d=e&31,r=1<<d;return i[n]=i[n]|r,i}function y_(e,n){for(var i=0,d=new Int32Array(e);i<e;){for(var r=i,t=0,s=0,f=n.length;s<f;){var p=n[s];s=s+1|0,r<p.length&&(t=t|p[r])}d[r]=t,i=i+1|0}return d}function S_(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function hl(e,n){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;i=i+1|0,e[r]=n}while(r!==d);return e}function w_(e){return new Q5(e)}function Q5(e){this.w4_1=e,this.v4_1=0}c(Q5).m=function(){return this.v4_1!==this.w4_1.length};c(Q5).o=function(){var e;if(this.v4_1!==this.w4_1.length){var n=this.v4_1;this.v4_1=n+1|0,e=this.w4_1[n]}else throw Nc(""+this.v4_1);return e};function yp(){return vl(),ix}var ix;function tx(){return vl(),rx}var rx,A_;function Rp(){return vl(),dx}var dx;function ox(){return vl(),ax}var ax;function C_(){return vl(),ux}var ux;function g_(e){return vl(),(e|0)===e?Sx(e):(tx()[0]=e,hn(Rp()[C_()],31)+Rp()[ox()]|0)}var gN;function vl(){gN||(gN=!0,ix=new ArrayBuffer(8),rx=new Float64Array(yp()),A_=new Float32Array(yp()),dx=new Int32Array(yp()),tx()[0]=-1,ax=Rp()[0]!==0?1:0,ux=1-ox()|0)}function al(e,n){var i;if(lx(e)){var d=e.charCodeAt(n),r;CN();var t=0;if(d<AN(t))r=!0;else{CN();var s=65535;r=d>AN(s)}if(r)throw Hr("Invalid Char code: "+d);i=Q_(d)}else i=e.b(n);return i}function lx(e){return typeof e=="string"}function z1(e){var n;return lx(e)?n=e.length:n=e.a(),n}function b_(e){return s_(e,", ","[","]",L,L,T_)}function T_(e){return $r(e)}function R_(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=bN(e,n):n instanceof Ee?d=bN(e,n.z4()):d=TN(e,n),i=d;break;case"string":case"boolean":i=TN(e,n);break;default:i=N_(e,n);break}return i}function bN(e,n){var i;if(e<n)i=-1;else if(e>n)i=1;else if(e===n){var d;if(e!==0)d=0;else{var r=1/e,t;r===1/n?t=0:r<0?t=-1:t=1,d=t}i=d}else e!==e?i=n!==n?0:1:i=-1;return i}function TN(e,n){return e<n?-1:e>n?1:0}function N_(e,n){return e.u4(n)}function x_(e){return Np(e)}function Np(e){if(!("kotlinHashCodeValue$"in e)){var n=sx(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function sx(){return Math.random()*4294967296|0}function $r(e){var n;return e==null?n="null":eB(e)?n="[...]":typeof e.toString!="function"?n=I_(e):n=e.toString(),n}function I_(e){return Object.prototype.toString.call(e)}function _n(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():Np(e);break;case"function":i=Np(e);break;case"number":i=g_(e);break;case"boolean":i=E_(e);break;case"string":i=$p(String(e));break;case"bigint":i=O_(e);break;case"symbol":i=P_(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function E_(e){return e?1231:1237}function $p(e){var n=0,i=e.length,d=0,r=i-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e.charCodeAt(t);n=hn(n,31)+s|0}while(t!==r);return n}function O_(e){for(var n=BigInt(32),i=BigInt(4294967295),d=e<0?-e:e,r=0,t=e<0?-1:1;d!=0;){var s=Number(d&i);r=hn(31,r)+s|0,d=d>>n}return hn(r,t)}function P_(e){var n=M_(e)?__():B_(),i=n.get(e);if(i!==L)return i;var d=sx();return n.set(e,d),d}function M_(e){return Symbol.keyFor(e)!=L}function __(){return Sp===L&&(Sp=new Map),Sp}function B_(){return wp===L&&(wp=new WeakMap),wp}var Sp,wp;function Ze(e,n){if(e==null)return n==null;if(n==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(n);if(e!==e)return n!==n;if(typeof e=="number"&&typeof n=="number"){var i;if(e===n){var d;if(e!==0)d=!0;else{var r=1/e;d=r===1/n}i=d}else i=!1;return i}return e===n}function qe(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function c(e){return e.prototype}function $n(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function We(e){return Object.create(e)}function fx(e,n,i){Error.call(e),L_(e,n,i)}function L_(e,n,i){var d=Cx(Object.getPrototypeOf(e));if(!(d&1)){var r;if(n==null){var t;if(n!==null){var s=i==null?null:i.toString();t=s??L}else t=L;r=t}else r=n;e.message=r}d&2||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}function ml(e){var n;return e==null?F_():n=e,n}function F_(){throw Xp()}function en(){throw Yp()}function Tc(e){throw _x("lateinit property "+e+" has not been initialized")}function Wp(e){throw Hr(e)}function U_(e,n){for(var i=e.length,d=n.length,r=0,t=n;r<i&&r<d;){var s=r,f=r;r=f+1|0,t[s]=e[f]}return n}function Z_(e,n,i){var d=e.slice(0,n);e.$type$!==void 0&&(d.$type$=e.$type$);var r=e.length;if(n>r)for(d.length=n;r<n;){var t=r;r=t+1|0,d[t]=i}return d}function cx(){xp=this,this.a5_1=new Ee(0,-2147483648),this.b5_1=new Ee(-1,2147483647),this.c5_1=8,this.d5_1=64}var xp;function q_(){return xp==null&&new cx,xp}function Ee(e,n){q_(),Lp.call(this),this.x4_1=e,this.y4_1=n}c(Ee).e5=function(e){return j5(this,e)};c(Ee).u4=function(e){return this.e5(e instanceof Ee?e:en())};c(Ee).f5=function(e){return $5(this,e)};c(Ee).g5=function(e){return ul(this,e)};c(Ee).h5=function(e){return J_(this,e)};c(Ee).i5=function(){return this.j5().f5(new Ee(1,0))};c(Ee).j5=function(){return new Ee(~this.x4_1,~this.y4_1)};c(Ee).k5=function(){return this.x4_1};c(Ee).z4=function(){return Sc(this)};c(Ee).valueOf=function(){return this.z4()};c(Ee).equals=function(e){var n;return e instanceof Ee?n=qr(this,e):n=!1,n};c(Ee).hashCode=function(){return $_(this)};c(Ee).toString=function(){return Ip(this,10)};function wo(){return nn(),px}var px;function V5(){return nn(),hx}var hx;function RN(){return nn(),vx}var vx;function V_(){return nn(),mx}var mx;function Cd(){return nn(),kx}var kx;function NN(){return nn(),yx}var yx;function j5(e,n){if(nn(),qr(e,n))return 0;var i=pr(e),d=pr(n);return i&&!d?-1:!i&&d?1:pr(ul(e,n))?-1:1}function $5(e,n){nn();var i=e.y4_1>>>16|0,d=e.y4_1&65535,r=e.x4_1>>>16|0,t=e.x4_1&65535,s=n.y4_1>>>16|0,f=n.y4_1&65535,p=n.x4_1>>>16|0,v=n.x4_1&65535,w=0,b=0,g=0,_=0;return _=_+(t+v|0)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+(r+p|0)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(d+f|0)|0,w=w+(b>>>16|0)|0,b=b&65535,w=w+(i+s|0)|0,w=w&65535,new Ee(g<<16|_,w<<16|b)}function ul(e,n){return nn(),$5(e,n.i5())}function K1(e,n){if(nn(),Ku(e))return wo();if(Ku(n))return wo();if(qr(e,Cd()))return xN(n)?Cd():wo();if(qr(n,Cd()))return xN(e)?Cd():wo();if(pr(e)){var i;return pr(n)?i=K1(ht(e),ht(n)):i=ht(K1(ht(e),n)),i}else if(pr(n))return ht(K1(e,ht(n)));if(IN(e,NN())&&IN(n,NN()))return ll(Sc(e)*Sc(n));var d=e.y4_1>>>16|0,r=e.y4_1&65535,t=e.x4_1>>>16|0,s=e.x4_1&65535,f=n.y4_1>>>16|0,p=n.y4_1&65535,v=n.x4_1>>>16|0,w=n.x4_1&65535,b=0,g=0,_=0,X=0;return X=X+hn(s,w)|0,_=_+(X>>>16|0)|0,X=X&65535,_=_+hn(t,w)|0,g=g+(_>>>16|0)|0,_=_&65535,_=_+hn(s,v)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+hn(r,w)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+hn(t,v)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+hn(s,p)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(((hn(d,w)+hn(r,v)|0)+hn(t,p)|0)+hn(s,f)|0)|0,b=b&65535,new Ee(_<<16|X,b<<16|g)}function J_(e,n){if(nn(),Ku(n))throw zp("division by zero");if(Ku(e))return wo();if(qr(e,Cd())){if(qr(n,V5())||qr(n,RN()))return Cd();if(qr(n,Cd()))return V5();var i=D_(e,1),d=H_(i.h5(n),1);if(qr(d,wo()))return pr(n)?V5():RN();var r=ul(e,K1(n,d));return $5(d,r.h5(n))}else if(qr(n,Cd()))return wo();if(pr(e)){var t;return pr(n)?t=ht(e).h5(ht(n)):t=ht(ht(e).h5(n)),t}else if(pr(n))return ht(e.h5(ht(n)));for(var s=wo(),f=e;G_(f,n);){for(var p=Sc(f)/Sc(n),v=Math.max(1,Math.floor(p)),w=Math.ceil(Math.log(v)/Math.LN2),b=w<=48?1:Math.pow(2,w-48),g=ll(v),_=K1(g,n);pr(_)||W_(_,f);)v=v-b,g=ll(v),_=K1(g,n);Ku(g)&&(g=V5()),s=$5(s,g),f=ul(f,_)}return s}function H_(e,n){nn();var i=n&63;return i===0?e:i<32?new Ee(e.x4_1<<i,e.y4_1<<i|(e.x4_1>>>(32-i|0)|0)):new Ee(0,e.x4_1<<(i-32|0))}function D_(e,n){nn();var i=n&63;return i===0?e:i<32?new Ee(e.x4_1>>>i|0|e.y4_1<<(32-i|0),e.y4_1>>i):new Ee(e.y4_1>>(i-32|0),e.y4_1>=0?0:-1)}function Sc(e){return nn(),e.y4_1*4294967296+z_(e)}function qr(e,n){return nn(),e.y4_1===n.y4_1?e.x4_1===n.x4_1:!1}function $_(e){return nn(),e.x4_1^e.y4_1}function Ip(e,n){if(nn(),n<2||36<n)throw zp("radix out of range: "+n);if(Ku(e))return"0";if(pr(e))if(qr(e,Cd())){var i=yc(n),d=e.h5(i),r=ul(K1(d,i),e).k5(),t=Ip(d,n);return t+r.toString(n)}else return"-"+Ip(ht(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=ll(Math.pow(n,s)),p=e,v="";;){var w=p.h5(f),b=ul(p,K1(w,f)).k5(),g=b.toString(n);if(p=w,Ku(p))return g+v;for(;g.length<s;)g="0"+g;v=g+v}}function yc(e){return nn(),new Ee(e,e<0?-1:0)}function pr(e){return nn(),e.y4_1<0}function Ku(e){return nn(),e.y4_1===0?e.x4_1===0:!1}function xN(e){return nn(),(e.x4_1&1)===1}function ht(e){return nn(),e.i5()}function IN(e,n){return nn(),j5(e,n)<0}function ll(e){if(nn(),MM(e))return wo();if(e<=-9223372036854776e3)return Cd();if(e+1>=9223372036854776e3)return V_();if(e<0)return ht(ll(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Ee(i,d)}function W_(e,n){return nn(),j5(e,n)>0}function G_(e,n){return nn(),j5(e,n)>=0}function z_(e){return nn(),e.x4_1>=0?e.x4_1:4294967296+e.x4_1}var EN;function nn(){EN||(EN=!0,px=yc(0),hx=yc(1),vx=yc(-1),mx=new Ee(-1,2147483647),kx=new Ee(0,-2147483648),yx=yc(16777216))}function re(e,n,i,d,r){return Gp("class",e,n,i,d,r,null)}function Gp(e,n,i,d,r,t,s){var f=L;return{kind:e,simpleName:n,associatedObjectKey:d,associatedObjects:r,suspendArity:t,$kClass$:f,defaultConstructor:i,iid:s}}function Z(e,n,i,d,r,t,s,f,p){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,p??[]);if(e.$metadata$=v,r!=null){var w=v.iid!=null?e:e.prototype;w.$imask$=m_(r)}}function To(e,n,i,d,r){return Gp("interface",e,n,i,d,r,K_())}function K_(){return kc===L&&(kc=0),kc=kc+1|0,kc}var kc;function ei(e,n,i,d,r){return Gp("object",e,n,i,d,r,null)}function kl(e){var n=e.length,i=Array(n),d=0,r=n-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e[t];s!=null&&sl(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function Sx(e){var n;return e instanceof Ee?n=e.k5():n=X_(e),n}function X_(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function Y_(e){return e<<16>>16}function wx(e){var n;return e instanceof Ee?n=e:n=ll(e),n}function Q_(e){var n=Sx(e),i=Y_(n);return h_(i)}function j_(e,n){return new X1(e,n)}function eB(e){return Ax(e)?!0:gp(e)}function Ax(e){return Array.isArray(e)}function Hn(e,n){return nB(e,n.$metadata$.iid)}function nB(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return S_(r,n)}function sl(e){var n;return Ax(e)?n=!e.$type$:n=!1,n}function iB(e){return typeof e=="string"?!0:Hn(e,Bp)}function Cx(e){var n=e.constructor,i=n==null?null:n.$metadata$,d=i==null?null:i.errorInfo;if(d!=null)return d;var r=0;if(ON(e,"message")&&(r=r|1),ON(e,"cause")&&(r=r|2),r!==3){var t=tB(e);t!=Error.prototype&&(r=r|Cx(t))}return i!=null&&(i.errorInfo=r),r}function ON(e,n){return e.hasOwnProperty(n)}function tB(e){return Object.getPrototypeOf(e)}var L;function rB(e,n,i,d){i=i===L?0:i,d=d===L?e.length:d,Ki.h(i,d,e.length),e.fill(n,i,d)}function Ap(e,n,i,d){i=i===L?0:i,d=d===L?e.length:d,Ki.h(i,d,e.length),e.fill(n,i,d)}function dB(e){return new Dn(e)}function oB(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw Hr($r(i))}return U_(e,new Int32Array(n))}function aB(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw Hr($r(i))}return Z_(e,n,null)}function gx(e){return fx(e),Ro.call(e),e}function bx(){var e=gx(We(c(Ro)));return qe(e,bx),e}function Tx(e,n){return fx(n,e),Ro.call(n),n}function zp(e){var n=Tx(e,We(c(Ro)));return qe(n,zp),n}function Ro(){qe(this,Ro)}function uB(e){return Wr(e),yl.call(e),e}function Rx(){var e=uB(We(c(yl)));return qe(e,Rx),e}function lB(e,n){return Qu(e,n),yl.call(n),n}function Hr(e){var n=lB(e,We(c(yl)));return qe(n,Hr),n}function yl(){qe(this,yl)}function sB(e){return Wr(e),wl.call(e),e}function Nx(){var e=sB(We(c(wl)));return qe(e,Nx),e}function fB(e,n){return Qu(e,n),wl.call(n),n}function Sl(e){var n=fB(e,We(c(wl)));return qe(n,Sl),n}function wl(){qe(this,wl)}function cB(e){return Wr(e),Al.call(e),e}function xx(){var e=cB(We(c(Al)));return qe(e,xx),e}function pB(e,n){return Qu(e,n),Al.call(n),n}function Rc(e){var n=pB(e,We(c(Al)));return qe(n,Rc),n}function Al(){qe(this,Al)}function hB(e){return Wr(e),e4.call(e),e}function Cl(){var e=hB(We(c(e4)));return qe(e,Cl),e}function e4(){qe(this,e4)}function Wr(e){return gx(e),Li.call(e),e}function Ix(){var e=Wr(We(c(Li)));return qe(e,Ix),e}function Qu(e,n){return Tx(e,n),Li.call(n),n}function Ex(e){var n=Qu(e,We(c(Li)));return qe(n,Ex),n}function Li(){qe(this,Li)}function vB(e){return Wr(e),gl.call(e),e}function Y1(){var e=vB(We(c(gl)));return qe(e,Y1),e}function mB(e,n){return Qu(e,n),gl.call(n),n}function Nc(e){var n=mB(e,We(c(gl)));return qe(n,Nc),n}function gl(){qe(this,gl)}function kB(e){return Wr(e),n4.call(e),e}function Kp(){var e=kB(We(c(n4)));return qe(e,Kp),e}function n4(){qe(this,n4)}function yB(e){return Wr(e),bl.call(e),e}function Ox(){var e=yB(We(c(bl)));return qe(e,Ox),e}function SB(e,n){return Qu(e,n),bl.call(n),n}function Px(e){var n=SB(e,We(c(bl)));return qe(n,Px),n}function bl(){qe(this,bl)}function wB(e){return Wr(e),i4.call(e),e}function Xp(){var e=wB(We(c(i4)));return qe(e,Xp),e}function i4(){qe(this,i4)}function AB(e){return Wr(e),t4.call(e),e}function Yp(){var e=AB(We(c(t4)));return qe(e,Yp),e}function t4(){qe(this,t4)}function CB(e){return Wr(e),Tl.call(e),e}function Mx(){var e=CB(We(c(Tl)));return qe(e,Mx),e}function gB(e,n){return Qu(e,n),Tl.call(n),n}function _x(e){var n=gB(e,We(c(Tl)));return qe(n,_x),n}function Tl(){qe(this,Tl)}function bB(e){return function(n){return n===e?"(this Collection)":bc(n)}}function go(){}c(go).r=function(e){var n;e:{var i;if(Hn(this,Xi)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=!0;break e}}n=!1}return n};c(go).s=function(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.r(r)){n=!1;break e}}n=!0}return n};c(go).t=function(){return this.q()===0};c(go).toString=function(){return YN(this,", ","[","]",L,L,bB(this))};c(go).toArray=function(){return BN(this)};function Q1(){this.g_1=2147483639}c(Q1).y1=function(e,n){if(e<0||e>=n)throw Sl("index: "+e+", size: "+n)};c(Q1).z1=function(e,n){if(e<0||e>n)throw Sl("index: "+e+", size: "+n)};c(Q1).h=function(e,n,i){if(e<0||n>i)throw Sl("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw Hr("fromIndex: "+e+" > toIndex: "+n)};c(Q1).z2=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?Up.MAX_VALUE:2147483639),i};c(Q1).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=hn(31,n),t=d==null?null:_n(d);n=r+(t??0)|0}return n};c(Q1).c1=function(e,n){if(e.q()!==n.q())return!1;for(var i=n.l(),d=e.l();d.m();){var r=d.o(),t=i.o();if(!Ze(r,t))return!1}return!0};var Ki;function PN(e,n){return n===e?"(this Map)":bc(n)}function Bx(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Ze(r.l1(),n)){i=r;break e}}i=null}return i}function Lx(){}var TB;function RB(e){return function(n){return e.n5(n)}}function vr(){this.n1_1=null,this.o1_1=null}c(vr).p1=function(e){return Bx(this,e)!=null};c(vr).q1=function(e){if(!(e!=null&&Hn(e,Ao)))return!1;var n=e.l1(),i=e.m1(),d=(Hn(this,Co)?this:en()).r1(n);if(!Ze(i,d))return!1;var r;return d==null?r=!(Hn(this,Co)?this:en()).p1(n):r=!1,!r};c(vr).equals=function(e){if(e===this)return!0;if(!(e!=null&&Hn(e,Co))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(Hn(i,Xi)?d=i.t():d=!1,d){n=!0;break e}for(var r=i.l();r.m();){var t=r.o();if(!this.q1(t)){n=!1;break e}}n=!0}return n};c(vr).r1=function(e){var n=Bx(this,e);return n==null?null:n.m1()};c(vr).hashCode=function(){return _n(this.k1())};c(vr).q=function(){return this.k1().q()};c(vr).toString=function(){var e=this.k1();return YN(e,", ","{","}",L,L,RB(this))};c(vr).n5=function(e){return PN(this,e.l1())+"="+PN(this,e.m1())};function r4(){}c(r4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:_n(d);n=r+(t??0)|0}return n};c(r4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var Qp;function NB(e){return hr.call(e),Nn.call(e),e.q5_1=jp().s5_1,e}function xc(){return NB(We(c(Nn)))}function Ic(e,n){if(n<0)throw Rc("Deque is too big.");if(n<=e.q5_1.length)return Ue;if(e.q5_1===jp().s5_1){var i=e,d=J5(n,10);return i.q5_1=hl(Array(d),null),Ue}var r=Ki.z2(e.q5_1.length,n);xB(e,r)}function xB(e,n){var i=hl(Array(n),null),d=e.q5_1,r=e.p5_1,t=e.q5_1.length;Fe(d,i,0,r,t);var s=e.q5_1,f=e.q5_1.length-e.p5_1|0,p=e.p5_1;Fe(s,i,f,0,p),e.p5_1=0,e.q5_1=i}function Wt(e,n){return n>=e.q5_1.length?n-e.q5_1.length|0:n}function IB(e,n){return n<0?n+e.q5_1.length|0:n}function Fx(e,n){return n===KN(e.q5_1)?0:n+1|0}function Ep(e,n){return n===0?KN(e.q5_1):n-1|0}function Op(e,n,i){var d=i.l(),r=n,t=e.q5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.q5_1[s]=d.o()}while(r<t);var f=0,p=e.p5_1;if(f<p)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.q5_1[v]=d.o()}while(f<p);e.r5_1=e.r5_1+i.q()|0}function Ux(){Pp=this;var e=this;e.s5_1=[],this.t5_1=10}var Pp;function jp(){return Pp==null&&new Ux,Pp}c(Nn).q=function(){return this.r5_1};c(Nn).t=function(){return this.r5_1===0};c(Nn).u5=function(e){Ic(this,this.r5_1+1|0),this.p5_1=Ep(this,this.p5_1),this.q5_1[this.p5_1]=e,this.r5_1=this.r5_1+1|0};c(Nn).v5=function(e){Ic(this,this.r5_1+1|0);var n=this.q5_1,i=this.r5_1;n[Wt(this,this.p5_1+i|0)]=e,this.r5_1=this.r5_1+1|0};c(Nn).w5=function(){if(this.t())throw Nc("ArrayDeque is empty.");var e=this.p5_1,n=this.q5_1[e],i=n==null||n!=null?n:en();return this.q5_1[this.p5_1]=null,this.p5_1=Fx(this,this.p5_1),this.r5_1=this.r5_1-1|0,i};c(Nn).x5=function(){if(this.t())throw Nc("ArrayDeque is empty.");var e=W5(this),n=Wt(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:en();return this.q5_1[n]=null,this.r5_1=this.r5_1-1|0,d};c(Nn).i=function(e){return this.v5(e),!0};c(Nn).a1=function(e,n){if(Ki.z1(e,this.r5_1),e===this.r5_1)return this.v5(n),Ue;if(e===0)return this.u5(n),Ue;Ic(this,this.r5_1+1|0);var i=Wt(this,this.p5_1+e|0);if(e<(this.r5_1+1|0)>>1){var d=Ep(this,i),r=Ep(this,this.p5_1);if(d>=this.p5_1){this.q5_1[r]=this.q5_1[this.p5_1];var t=this.q5_1,s=this.q5_1,f=this.p5_1,p=this.p5_1+1|0,v=d+1|0;Fe(t,s,f,p,v)}else{var w=this.q5_1,b=this.q5_1,g=this.p5_1-1|0,_=this.p5_1,X=this.q5_1.length;Fe(w,b,g,_,X),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Se=this.q5_1,_e=this.q5_1,ri=d+1|0;Fe(Se,_e,0,1,ri)}this.q5_1[d]=n,this.p5_1=r}else{var bi=this.r5_1,ji=Wt(this,this.p5_1+bi|0);if(i<ji){var yt=this.q5_1,xd=this.q5_1,jr=i+1|0;Fe(yt,xd,jr,i,ji)}else{var ed=this.q5_1,Id=this.q5_1;Fe(ed,Id,1,0,ji),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var wr=this.q5_1,Ed=this.q5_1,nd=i+1|0,Mo=this.q5_1.length-1|0;Fe(wr,Ed,nd,i,Mo)}this.q5_1[i]=n}this.r5_1=this.r5_1+1|0};c(Nn).p=function(e){if(e.t())return!1;Ic(this,this.r5_1+e.q()|0);var n=this.r5_1,i=Wt(this,this.p5_1+n|0);return Op(this,i,e),!0};c(Nn).y5=function(e,n){if(Ki.z1(e,this.r5_1),n.t())return!1;if(e===this.r5_1)return this.p(n);Ic(this,this.r5_1+n.q()|0);var i=this.r5_1,d=Wt(this,this.p5_1+i|0),r=Wt(this,this.p5_1+e|0),t=n.q();if(e<(this.r5_1+1|0)>>1){var s=this.p5_1-t|0;if(r>=this.p5_1)if(s>=0){var f=this.q5_1,p=this.q5_1,v=s,w=this.p5_1;Fe(f,p,v,w,r)}else{s=s+this.q5_1.length|0;var b=r-this.p5_1|0,g=this.q5_1.length-s|0;if(g>=b){var _=this.q5_1,X=this.q5_1,Se=s,_e=this.p5_1;Fe(_,X,Se,_e,r)}else{var ri=this.q5_1,bi=this.q5_1,ji=s,yt=this.p5_1,xd=this.p5_1+g|0;Fe(ri,bi,ji,yt,xd);var jr=this.q5_1,ed=this.q5_1,Id=this.p5_1+g|0;Fe(jr,ed,0,Id,r)}}else{var wr=this.q5_1,Ed=this.q5_1,nd=s,Mo=this.p5_1,Pl=this.q5_1.length;if(Fe(wr,Ed,nd,Mo,Pl),t>=r){var s0=this.q5_1,f0=this.q5_1,Z4=this.q5_1.length-t|0;Fe(s0,f0,Z4,0,r)}else{var jI=this.q5_1,eE=this.q5_1,nE=this.q5_1.length-t|0;Fe(jI,eE,nE,0,t);var iE=this.q5_1,tE=this.q5_1;Fe(iE,tE,0,t,r)}}this.p5_1=s,Op(this,IB(this,r-t|0),n)}else{var uu=r+t|0;if(r<d)if((d+t|0)<=this.q5_1.length){var rE=this.q5_1,dE=this.q5_1;Fe(rE,dE,uu,r,d)}else if(uu>=this.q5_1.length){var oE=this.q5_1,aE=this.q5_1,uE=uu-this.q5_1.length|0;Fe(oE,aE,uE,r,d)}else{var V8=(d+t|0)-this.q5_1.length|0,lE=this.q5_1,sE=this.q5_1,fE=d-V8|0;Fe(lE,sE,0,fE,d);var cE=this.q5_1,pE=this.q5_1,hE=d-V8|0;Fe(cE,pE,uu,r,hE)}else{var vE=this.q5_1,mE=this.q5_1;if(Fe(vE,mE,t,0,d),uu>=this.q5_1.length){var kE=this.q5_1,yE=this.q5_1,SE=uu-this.q5_1.length|0,wE=this.q5_1.length;Fe(kE,yE,SE,r,wE)}else{var AE=this.q5_1,CE=this.q5_1,gE=this.q5_1.length-t|0,bE=this.q5_1.length;Fe(AE,CE,0,gE,bE);var TE=this.q5_1,RE=this.q5_1,NE=this.q5_1.length-t|0;Fe(TE,RE,uu,r,NE)}}Op(this,r,n)}return!0};c(Nn).x=function(e){Ki.y1(e,this.r5_1);var n=Wt(this,this.p5_1+e|0),i=this.q5_1[n];return i==null||i!=null?i:en()};c(Nn).r=function(e){return this.b1(e)!==-1};c(Nn).b1=function(e){var n=this.r5_1,i=Wt(this,this.p5_1+n|0);if(this.p5_1<i){var d=this.p5_1;if(d<i)do{var r=d;if(d=d+1|0,Ze(e,this.q5_1[r]))return r-this.p5_1|0}while(d<i)}else if(this.p5_1>=i){var t=this.p5_1,s=this.q5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Ze(e,this.q5_1[f]))return f-this.p5_1|0}while(t<s);var p=0;if(p<i)do{var v=p;if(p=p+1|0,Ze(e,this.q5_1[v]))return(v+this.q5_1.length|0)-this.p5_1|0}while(p<i)}return-1};c(Nn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};c(Nn).z=function(e){if(Ki.y1(e,this.r5_1),e===W5(this))return this.x5();if(e===0)return this.w5();var n=Wt(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:en();if(e<this.r5_1>>1){if(n>=this.p5_1){var r=this.q5_1,t=this.q5_1,s=this.p5_1+1|0,f=this.p5_1;Fe(r,t,s,f,n)}else{var p=this.q5_1,v=this.q5_1;Fe(p,v,1,0,n),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var w=this.q5_1,b=this.q5_1,g=this.p5_1+1|0,_=this.p5_1,X=this.q5_1.length-1|0;Fe(w,b,g,_,X)}this.q5_1[this.p5_1]=null,this.p5_1=Fx(this,this.p5_1)}else{var Se=W5(this),_e=Wt(this,this.p5_1+Se|0);if(n<=_e){var ri=this.q5_1,bi=this.q5_1,ji=n+1|0,yt=_e+1|0;Fe(ri,bi,n,ji,yt)}else{var xd=this.q5_1,jr=this.q5_1,ed=n+1|0,Id=this.q5_1.length;Fe(xd,jr,n,ed,Id),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var wr=this.q5_1,Ed=this.q5_1,nd=_e+1|0;Fe(wr,Ed,0,1,nd)}this.q5_1[_e]=null}return this.r5_1=this.r5_1-1|0,d};c(Nn).z5=function(){var e=this.r5_1,n=Wt(this,this.p5_1+e|0);this.p5_1<n?Ap(this.q5_1,null,this.p5_1,n):this.t()||(Ap(this.q5_1,null,this.p5_1,this.q5_1.length),Ap(this.q5_1,null,0,n)),this.p5_1=0,this.r5_1=0};c(Nn).a6=function(e){var n=e.length>=this.r5_1?e:LM(e,this.r5_1),i=sl(n)?n:en(),d=this.r5_1,r=Wt(this,this.p5_1+d|0);if(this.p5_1<r){var t=this.q5_1,s=this.p5_1;Fe(t,i,0,s,r)}else if(!this.t()){var f=this.q5_1,p=this.p5_1,v=this.q5_1.length;Fe(f,i,0,p,v);var w=this.q5_1,b=this.q5_1.length-this.p5_1|0;Fe(w,i,b,0,r)}var g=BM(this.r5_1,i);return sl(g)?g:en()};c(Nn).a2=function(){var e=this.r5_1,n=hl(Array(e),null);return this.a6(n)};c(Nn).toArray=function(){return this.a2()};function Nn(){jp(),this.p5_1=0,this.r5_1=0}function EB(e){if(e.t())return[];for(var n=e.q(),i=hl(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function Gr(){return OB()}function W5(e){return e.q()-1|0}function zr(){Mp=this,this.b6_1=new Ee(-1478467534,-1720727600)}c(zr).equals=function(e){var n;return e!=null&&Hn(e,pl)?n=e.t():n=!1,n};c(zr).hashCode=function(){return 1};c(zr).toString=function(){return"[]"};c(zr).q=function(){return 0};c(zr).t=function(){return!0};c(zr).c6=function(e){return e.t()};c(zr).s=function(e){return this.c6(e)};c(zr).x=function(e){throw Sl("Empty list doesn't contain element at index "+e+".")};c(zr).l=function(){return Zx};var Mp;function OB(){return Mp==null&&new zr,Mp}function d4(){}c(d4).m=function(){return!1};c(d4).o=function(){throw Y1()};var Zx;function PB(e){return new No(e,!1)}function MB(e){return e.length===0?bo():ZN(new No(e,!0))}function No(e,n){this.d6_1=e,this.e6_1=n}c(No).q=function(){return this.d6_1.length};c(No).t=function(){return this.d6_1.length===0};c(No).f6=function(e){return l_(this.d6_1,e)};c(No).g6=function(e){var n;e:{var i;if(Hn(e,Xi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.f6(r)){n=!1;break e}}n=!0}return n};c(No).s=function(e){return this.g6(e)};c(No).l=function(){return w_(this.d6_1)};function _B(){throw Px("Index overflow has happened.")}function e8(e,n){return e.p(dB(n))}function o4(){}c(o4).o=function(){return this.h6()};function BB(e,n,i){var d;if(i>0)d=e>=n?n:n-MN(n,e,i)|0;else if(i<0)d=e<=n?n:n+MN(e,n,-i|0)|0;else throw Hr("Step is zero.");return d}function MN(e,n,i){return Cp(Cp(e,i)-Cp(n,i)|0,i)}function Cp(e,n){var i=e%n|0;return i>=0?i:i+n|0}function qx(){_p=this,this.i6_1=new X1(1,0)}var _p;function LB(){return _p==null&&new qx,_p}function X1(e,n){LB(),gd.call(this,e,n,1)}c(X1).t=function(){return this.m6_1>this.n6_1};c(X1).equals=function(e){var n;return e instanceof X1?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1?this.n6_1===e.n6_1:!1:n=!1,n};c(X1).hashCode=function(){return this.t()?-1:hn(31,this.m6_1)+this.n6_1|0};c(X1).toString=function(){return""+this.m6_1+".."+this.n6_1};function a4(e,n,i){o4.call(this),this.p6_1=i,this.q6_1=n,this.r6_1=this.p6_1>0?e<=n:e>=n,this.s6_1=this.r6_1?e:this.q6_1}c(a4).m=function(){return this.r6_1};c(a4).h6=function(){var e=this.s6_1;if(e===this.q6_1){if(!this.r6_1)throw Y1();this.r6_1=!1}else this.s6_1=this.s6_1+this.p6_1|0;return e};function n8(){}c(n8).e4=function(e,n,i){return new gd(e,n,i)};var Vx;function gd(e,n,i){if(i===0)throw Hr("Step must be non-zero.");if(i===Up.MIN_VALUE)throw Hr("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.m6_1=e,this.n6_1=BB(e,n,i),this.o6_1=i}c(gd).l=function(){return new a4(this.m6_1,this.n6_1,this.o6_1)};c(gd).t=function(){return this.o6_1>0?this.m6_1>this.n6_1:this.m6_1<this.n6_1};c(gd).equals=function(e){var n;return e instanceof gd?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1&&this.n6_1===e.n6_1?this.o6_1===e.o6_1:!1:n=!1,n};c(gd).hashCode=function(){return this.t()?-1:hn(31,hn(31,this.m6_1)+this.n6_1|0)+this.o6_1|0};c(gd).toString=function(){return this.o6_1>0?""+this.m6_1+".."+this.n6_1+" step "+this.o6_1:""+this.m6_1+" downTo "+this.n6_1+" step "+(-this.o6_1|0)};function Jx(e,n,i){i!=null?e.d4(i(n)):n==null||iB(n)?e.d4(n):n instanceof ex?e.t3(n.t6_1):e.d4(bc(n))}function FB(e,n,i){if(i=i===L?!1:i,e===n)return!0;if(!i)return!1;var d=wN(e),r=wN(n),t;if(d===r)t=!0;else{var s=D5(d).toLowerCase(),f=al(s,0),p=D5(r).toLowerCase();t=f===al(p,0)}return t}function Hx(e){return z1(e)-1|0}function Dx(e,n,i){i=i===L?!1:i;var d;return typeof n=="string"?d=UB(e,n,L,i)>=0:d=$x(e,n,0,z1(e),i)>=0,d}function UB(e,n,i,d){i=i===L?0:i,d=d===L?!1:d;var r,t;return d?t=!0:t=typeof e!="string",t?r=$x(e,n,i,z1(e),d):r=e.indexOf(n,i),r}function $x(e,n,i,d,r,t){t=t===L?!1:t;var s=t?p_(H5(i,Hx(e)),J5(d,0)):j_(J5(i,0),H5(d,z1(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var p=s.m6_1,v=s.n6_1,w=s.o6_1;if(w>0&&p<=v||w<0&&v<=p)do{var b=p;if(p=p+w|0,a_(n,0,e,b,z1(n),r))return b}while(b!==v)}else{var g=s.m6_1,_=s.n6_1,X=s.o6_1;if(X>0&&g<=_||X<0&&_<=g)do{var Se=g;if(g=g+X|0,Wx(n,0,e,Se,z1(n),r))return Se}while(Se!==_)}return-1}function Wx(e,n,i,d,r,t){if(d<0||n<0||n>(z1(e)-r|0)||d>(z1(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!FB(al(e,n+f|0),al(i,d+f|0),t))return!1}while(s<r);return!0}function vt(e,n){this.u6_1=e,this.v6_1=n}c(vt).toString=function(){return"("+this.u6_1+", "+this.v6_1+")"};c(vt).hashCode=function(){var e=this.u6_1==null?0:_n(this.u6_1);return e=hn(e,31)+(this.v6_1==null?0:_n(this.v6_1))|0,e};c(vt).equals=function(e){if(this===e)return!0;if(!(e instanceof vt))return!1;var n=e instanceof vt?e:en();return!(!Ze(this.u6_1,n.u6_1)||!Ze(this.v6_1,n.v6_1))};function Gx(e,n){return new vt(e,n)}c(Bi).o2=PM;Ue=new Fp;Up=new fl;Ac=new WN;v_=new nx;Ki=new Q1;TB=new Lx;Qp=new r4;Zx=new d4;Vx=new n8;var xo=Math.imul;Z(r8,"OneAtATimeAssembler",re);Z(d8,"AllAtOnceAssembler",re);Z(Fi,"SubscribeCallbackParams",re);Z(Gt,"Mode",re,mt);Z(ju,"Callback",re);Z(a8,L,re);Z(yi,"DispatcherImpl",re);Z(Ui,"EmptyOptions",re,L,L,Ui);Z(xn,"DispatcherSnapshot",re);Z(ni,"EventScope",re,mt);Z(u8,"LocalEventsDeduper",re);Z(l8,"NoOpUnsubscriber",ei);Z(Bc,"BaseTrace",re);Z(Lc,"ErrorInfo",re);Z(uI,"PerformanceAnalyticsDelegate",To);Z(Oc,"NoOpPerformanceAnalyticsDelegate",re,L,[uI],Oc);Z(Fc,"RuntimeTrace",re,Bc);Z(nu,"Disabled",ei);Z(Uc,"NiceLogger",re);Z(eu,"NoOpLogger",re,L,L,eu);Z(Yi,"TimerDefinition",re);Z(v4,"Span",re);Z(s8,"Tracer",ei);Z(m4,"JsDispatcherImpl",re,yi);Z(k4,"JsRequestBuilderAdapter",re);Z(Pc,"JsonStateOperations",re,L,L,Pc);function r8(e,n){this.w6_1=e,this.x6_1=n}c(r8).y6=function(e,n){var i;if(e.t())i=Gr();else{for(var d=this.x6_1.list(),r=e.w5();Yx(r);){for(var t=0,s=d.length;t<s;){var f=d[t];if(t=t+1|0,f.id===r.hook)return this.w6_1.a7([""+n+" building batch of ",r]),G5(r)}if(!e.t())r=e.w5();else return Gr()}this.w6_1.a7([""+n+" building batch of ",r]),i=G5(r)}return i};function d8(e,n){this.b7_1=e,this.c7_1=n}c(d8).y6=function(e,n){var i;if(e.t())i=Gr();else{for(var d=this.c7_1.list(),r=bo(),t=e.l();t.m();){var s=t.o(),f;if(Yx(s)){var p;if(d.length===0)p=!1;else{var v;e:{for(var w=0,b=d.length;w<b;){var g=d[w];if(w=w+1|0,g.id===s.hook){v=g;break e}}v=null}p=v!=null}f=p}else f=!0;f&&r.i(s)}var _=r;e.z5(),this.b7_1.a7([""+n+" building batch of ",_]),i=_}return i};function Yx(e){var n=e.hook;return(n==null?null:Dx(n,"useInterval"))===!0}function Fi(e,n,i){this.request=e,this.response=n,this.mode=i}c(Fi).d7=function(){return this.request};c(Fi).e7=function(){return this.response};c(Fi).f7=function(){return this.mode};c(Fi).g7=function(){return this.request};c(Fi).h7=function(){return this.response};c(Fi).i7=function(){return this.mode};c(Fi).j7=function(e,n,i){return new Fi(e,n,i)};c(Fi).copy=function(e,n,i,d){return e=e===L?this.request:e,n=n===L?this.response:n,i=i===L?this.mode:i,this.j7(e,n,i)};c(Fi).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};c(Fi).hashCode=function(){var e=this.request==null?0:_n(this.request);return e=xo(e,31)+(this.response==null?0:_n(this.response))|0,e=xo(e,31)+this.mode.hashCode()|0,e};c(Fi).equals=function(e){if(this===e)return!0;if(!(e instanceof Fi))return!1;var n=e instanceof Fi?e:en();return!(!Ze(this.request,n.request)||!Ze(this.response,n.response)||!this.mode.equals(n.mode))};var Qx,jx,eI;function ZB(){return[bd(),Ec(),Td()]}function qB(e){switch(e){case"SYNC":return bd();case"ASYNC":return Ec();case"SPEC":return Td();default:l4(),Wp("No enum constant value.");break}}var zx;function l4(){if(zx)return Ue;zx=!0,Qx=new Gt("SYNC",0),jx=new Gt("ASYNC",1),eI=new Gt("SPEC",2)}function Gt(e,n){mt.call(this,e,n)}function bd(){return l4(),Qx}function Ec(){return l4(),jx}function Td(){return l4(),eI}function ju(e,n){this.m7_1=e,this.n7_1=n}c(ju).toString=function(){return"Callback(success="+this.m7_1+", failure="+this.n7_1+")"};c(ju).hashCode=function(){var e=_n(this.m7_1);return e=xo(e,31)+_n(this.n7_1)|0,e};c(ju).equals=function(e){if(this===e)return!0;if(!(e instanceof ju))return!1;var n=e instanceof ju?e:en();return!(!Ze(this.m7_1,n.m7_1)||!Ze(this.n7_1,n.n7_1))};function i8(e){var n=e.w7_1;if(n!=null)return n;Tc("assembler")}function e0(e){var n=e.d8_1;if(n!=null)return n;Tc("local")}function Mc(e){var n=e.e8_1;if(n!=null)return n;Tc("remote")}function s4(e){var n=e.f8_1;if(n!=null)return n;Tc("timers")}function nI(e){iI(e),e.k8_1=!0,e.t7_1.a7(["recalculateSpeculativeWork"]);var n=e.x7_1.l(),i=0;e:for(;n.m();){var d=i;i=i+1|0;var r=n.o();if(d===0||r.retry===!0||r.async===!0||r.scope.equals(j1()))continue e;if(e.z7_1.r5_1>10)break e;e.z7_1.i(r)}e.t7_1.a7(["Speculative queue size: "+e.z7_1.r5_1]),f4(e,e.z7_1)}function o8(e){e.t7_1.a7(["cancelSpeculation"]),e.k8_1=!1,iI(e)}function iI(e){e.z7_1.z5(),e.h8_1=e.q7_1.clone(e.state),e.i8_1=e.i8_1+1|0}function t8(e,n,i){if(n.t())return Ue;var d=QN(n),r=d.scope.equals(j1())?!0:QB(d.scope)?!e0(e).isReady():!1;i.equals(bd())&&(e.a8_1=!0);var t=e.p7_1.l8(i.equals(Td())?e.h8_1:e.state,n),s=r?Mc(e):e0(e),f=e.u7_1;e.u7_1=f+1|0;var p=f,v=e.i8_1,w=cI.m8("runtime_trace"),b=DB(e,i,r,w,n,p,v,t),g=new ju(b,$B(e,i,r,w,n,p));e.b8_1.i1(p,g),e.t7_1.a7(["Signpost: Handling "+u4(e,i,r)+" request"]),f4(e,t),s.handle(e.r7_1,t,g.m7_1,g.n7_1)}function u4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function tI(e,n){e.k8_1=e.j8_1,e.a8_1=!1,e.state=e.q7_1.clone(e.g8_1),e.y7_1.z5(),e.x7_1.z5(),e0(e).reset(),Mc(e).reset(),o8(e),n&&s4(e).clear()}function _c(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Ro){var t=s;e.t7_1.n8([t]),e.s7_1.errorHandler(t),r=n}else throw s;d=r}return d}function f4(e,n){e.s7_1.featureFlags.isVerboseLoggingEnabled&&e.t7_1.a7([n])}function VB(e){return function(){return e0(e).isReady()}}function JB(e,n,i,d){return function(){e.t7_1.a7(["Signpost: Initializing Dispatcher",n,i]),e.d8_1=n,e.e8_1=i,e.f8_1=d;var r=e,t;return e.s7_1.featureFlags.isUsingEverythingAssembler?t=new d8(e.t7_1,d):t=new r8(e.t7_1,d),r.w7_1=t,e.o8(),Ue}}function a8(e,n){this.p8_1=e,this.q8_1=n}c(a8).unsubscribe=function(){this.p8_1.c8_1.j(this.q8_1)};function HB(e,n){return function(){var i=typeof e=="function"?e:en();return n.c8_1.i(i),new a8(n,i)}}function DB(e,n,i,d,r,t,s,f){return function(p){e.t7_1.a7(["Signpost: Response success for "+u4(e,n,i)+" request"]),f4(e,p),d.u8(),lI(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q()),e.b8_1.j1(t);var v;if(n.equals(Td())&&e.i8_1!==s)return e.t7_1.a7(["throwing away stale speculative results"]),Ue;e.t7_1.a7(["Responding to "+u4(e,n,i)+" runtime result subscriptions"]);for(var w=e.c8_1.l();w.m();){var b=w.o();b(new Fi(f,p,n))}var g;n.equals(bd())?(e.state=e.q7_1.merge(e.state,p.state),e.a8_1=!1,g=Ue):n.equals(Td())&&(e.h8_1=e.q7_1.merge(e.h8_1,p.state),g=Ue),e.v8(Dp(p.replay),n);var _;return n.equals(bd())&&e.j8_1&&(nI(e),_=Ue),e.o8(),Ue}}function $B(e,n,i,d,r,t){return function(s){e.t7_1.a7(["Signpost: Response error for "+u4(e,n,i)+" request",s]),d.u8(),lI(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q());var f=e.s7_1.performanceAnalyticsDelegate,p=s.message;jB(f,p??"",i,""),e.b8_1.j1(t);var v;n.equals(bd())&&(e.a8_1=!1,v=Ue);var w;if(n.equals(Td()))return o8(e),e.o8(),Ue;for(var b=r,g=gc(),_=b.l();_.m();){var X=_.o(),Se=X.scope.equals(j1())?!1:X.retry!==!0,_e=g.r1(Se),ri;if(_e==null){var bi=bo();g.i1(Se,bi),ri=bi}else ri=_e;var ji=ri;ji.i(X)}var yt=g,xd,jr=yt.r1(!1);if(!(jr==null||jr.t())){var ed=yt.r1(!1),Id=ed??Gr(),wr=cl(Id);e.t7_1.a7(kl([["unretryable events",s],wr])),xd=e.s7_1.errorHandler(s)}var Ed,nd=yt.r1(!0);if(!(nd==null||nd.t())){var Mo=yt.r1(!0);if(Mo!=null)for(var Pl=Mo.l();Pl.m();){var s0=Pl.o();s0.retry=!0,s0.scope=j1()}var f0=yt.r1(!0);e.v8(f0??Gr(),n),n.equals(bd())&&e.j8_1&&nI(e),e.o8(),Ed=Ue}return Ue}}function WB(e,n){return function(){e.t7_1.a7(kl([["Signpost: Submitted events"],n]));for(var i=e.v7_1.w8(Dp(n)),d=i.l();d.m();){var r=d.o();r.async===!0?e.y7_1.i(r):(e.x7_1.i(r),e.a8_1&&e.k8_1&&e.z7_1.i(r))}return e.o8(),Ue}}function GB(e){return function(){return tI(e,!0),Ue}}function zB(e,n){return function(){e.state=e.q7_1.clone(n.state),e.y7_1.z5();var i=n.asyncQueue;e8(e.y7_1,sl(i)?i:en()),e.x7_1.z5();var d=n.syncQueue;return e8(e.x7_1,sl(d)?d:en()),o8(e),e0(e).resume(n.localSnapshot),Mc(e).resume(n.remoteSnapshot),s4(e).resumeAll(n.timerSnapshot),Ue}}function yi(e,n,i,d,r){d=d===L?"RenderPostContent":d,r=r===L?new Ui:r,this.o7_1=e,this.p7_1=n,this.q7_1=i,this.r7_1=d,this.s7_1=r,this.t7_1=new Uc(this.s7_1.logger),this.u7_1=0;var t=this;t.v7_1=new u8(VB(this),this.t7_1),this.x7_1=xc(),this.y7_1=xc(),this.z7_1=xc(),this.a8_1=!1;var s=this;s.b8_1=gc();var f=this;f.c8_1=bo(),this.g8_1=this.q7_1.clone(this.state),this.h8_1=this.q7_1.clone(this.g8_1),this.i8_1=0,this.j8_1=this.s7_1.featureFlags.isSpeculativeExecutionEnabled,this.k8_1=this.j8_1,this.t7_1.a7(["Signpost: Constructed KMP Dispatcher"])}c(yi).x8=function(e){this.o7_1=e};c(yi).y8=function(){return this.o7_1};c(yi).z8=function(){return this.x7_1};c(yi).a9=function(){return this.y7_1};c(yi).b9=function(){return this.z7_1};c(yi).init=function(e,n,i){_c(this,Ue,JB(this,e,n,i))};c(yi).subscribe=function(e){var n=aI;return _c(this,n,HB(e,this))};c(yi).o8=function(){if(this.t7_1.a7(["ticking","syncInFlight "+this.a8_1,"asyncQueue.size "+this.y7_1.r5_1,"syncQueue.size "+this.x7_1.r5_1,"speculativeQueue.size "+this.z7_1.r5_1]),!e0(this).isReady()&&!Mc(this).isReady()&&!(this.x7_1.t()&&this.y7_1.t()))return this.t7_1.c9(["ticking with events and no runtime, deferring..."]),Ue;if(this.a8_1){if(this.k8_1){var n=i8(this).y6(this.z7_1,Td());t8(this,n,Td())}}else{var e=i8(this).y6(this.x7_1,bd());t8(this,e,bd())}if(!this.y7_1.t()){for(;!this.y7_1.t();){var i=i8(this).y6(this.y7_1,Ec());t8(this,i,Ec())}this.o8()}};c(yi).v8=function(e,n){if(e.t()||n.equals(Td()))return Ue;this.t7_1.a7(["replaying "+e.q()+" events"]),f4(this,e);for(var i=gc(),d=e.l();d.m();){var r=d.o(),t=new vt(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var p=bo();i.i1(t,p),f=p}else f=s;var v=f;v.i(r)}var w=i,b=w.r1(new vt(!0,!0));this.y7_1.y5(0,b??Gr());var g=w.r1(new vt(!0,!1));this.y7_1.p(g??Gr());var _=w.r1(new vt(!1,!0));this.x7_1.y5(0,_??Gr());var X=w.r1(new vt(!1,!1));this.x7_1.p(X??Gr())};c(yi).submit=function(e){_c(this,Ue,WB(this,e))};c(yi).reset=function(){_c(this,Ue,GB(this))};c(yi).snapshot=function(){var e=this.q7_1.clone(this.state),n=this.x7_1,i=cl(n),d=this.y7_1,r=cl(d);return new xn(e,i,r,e0(this).snapshot(),Mc(this).snapshot(),s4(this).list())};c(yi).pause=function(){var e=this.snapshot();return s4(this).pauseAll(),tI(this,!1),e};c(yi).resume=function(e){_c(this,Ue,zB(this,e))};function KB(e){return Ue}function Ui(){this.d9_1=new eu;var e=this;e.e9_1=KB,this.f9_1=fI,this.g9_1=new Oc}c(Ui).h9=function(e){this.d9_1=e};c(Ui).i9=function(){return this.d9_1};c(Ui).j9=function(e){this.e9_1=e};c(Ui).k9=function(){return this.e9_1};c(Ui).l9=function(e){this.f9_1=e};c(Ui).m9=function(){return this.f9_1};c(Ui).n9=function(e){this.g9_1=e};c(Ui).o9=function(){return this.g9_1};function xn(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}c(xn).y8=function(){return this.state};c(xn).z8=function(){return this.syncQueue};c(xn).a9=function(){return this.asyncQueue};c(xn).p9=function(){return this.localSnapshot};c(xn).q9=function(){return this.remoteSnapshot};c(xn).r9=function(){return this.timerSnapshot};c(xn).g7=function(){return this.state};c(xn).h7=function(){return this.syncQueue};c(xn).i7=function(){return this.asyncQueue};c(xn).s9=function(){return this.localSnapshot};c(xn).t9=function(){return this.remoteSnapshot};c(xn).u9=function(){return this.timerSnapshot};c(xn).v9=function(e,n,i,d,r,t){return new xn(e,n,i,d,r,t)};c(xn).copy=function(e,n,i,d,r,t,s){return e=e===L?this.state:e,n=n===L?this.syncQueue:n,i=i===L?this.asyncQueue:i,d=d===L?this.localSnapshot:d,r=r===L?this.remoteSnapshot:r,t=t===L?this.timerSnapshot:t,this.v9(e,n,i,d,r,t)};c(xn).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+$r(this.syncQueue)+", asyncQueue="+$r(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};c(xn).hashCode=function(){var e=this.state==null?0:_n(this.state);return e=xo(e,31)+_n(this.syncQueue)|0,e=xo(e,31)+_n(this.asyncQueue)|0,e=xo(e,31)+(this.localSnapshot==null?0:_n(this.localSnapshot))|0,e=xo(e,31)+(this.remoteSnapshot==null?0:_n(this.remoteSnapshot))|0,e=xo(e,31)+(this.timerSnapshot==null?0:_n(this.timerSnapshot))|0,e};c(xn).equals=function(e){if(this===e)return!0;if(!(e instanceof xn))return!1;var n=e instanceof xn?e:en();return!(!Ze(this.state,n.state)||!Ze(this.syncQueue,n.syncQueue)||!Ze(this.asyncQueue,n.asyncQueue)||!Ze(this.localSnapshot,n.localSnapshot)||!Ze(this.remoteSnapshot,n.remoteSnapshot)||!Ze(this.timerSnapshot,n.timerSnapshot))};var rI,dI,oI;function XB(){return[p4(),h4(),j1()]}function YB(e){switch(e){case"ALL":return p4();case"LOCAL":return h4();case"REMOTE":return j1();default:c4(),Wp("No enum constant value.");break}}var Kx;function c4(){if(Kx)return Ue;Kx=!0,rI=new ni("ALL",0),dI=new ni("LOCAL",1),oI=new ni("REMOTE",2)}function ni(e,n){mt.call(this,e,n)}function QB(e){return e.equals(j1())?!0:e.equals(p4())}function p4(){return c4(),rI}function h4(){return c4(),dI}function j1(){return c4(),oI}function u8(e,n){this.y9_1=e,this.z9_1=n}c(u8).w8=function(e){var n;if(this.y9_1())n=e;else{for(var i=bo(),d=bo(),r=e.l();r.m();){var t=r.o();t.scope.equals(h4())?d.i(t):i.i(t)}var s=new vt(i,d);if(!s.v6_1.t()){var f=["Dropping "+s.v6_1.q()+" local events",s.v6_1];this.z9_1.a7([f])}n=s.u6_1}return n};function l8(){}c(l8).unsubscribe=function(){};var aI;function Bc(e,n){this.spanName=e,this.durationMs=n}c(Bc).aa=function(){return this.spanName};c(Bc).ba=function(){return this.durationMs};function Lc(e,n,i){this.message=e,this.origin=n,this.version=i}c(Lc).l5=function(){return this.message};c(Lc).ca=function(){return this.origin};c(Lc).da=function(){return this.version};function uI(){}function Oc(){}c(Oc).logRuntimeTrace=function(e){};c(Oc).logRuntimeError=function(e){};function lI(e,n,i,d,r){e.logRuntimeTrace(new Fc(n.r8_1,n.ea().toString(),d,sI(i),r))}function jB(e,n,i,d){e.logRuntimeError(new Lc(n,sI(i),d))}function sI(e){return e?"remote":"local"}function Fc(e,n,i,d,r){Bc.call(this,e,n),this.intent=i,this.target=d,this.eventCount=r}c(Fc).fa=function(){return this.intent};c(Fc).ga=function(){return this.target};c(Fc).ha=function(){return this.eventCount};function nu(){this.ia_1=!1,this.ja_1=!1,this.ka_1=!1}c(nu).la=function(){return this.ia_1};c(nu).ma=function(){return this.ja_1};c(nu).na=function(){return this.ka_1};var fI;function Uc(e){this.z6_1=e}c(Uc).n8=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.error(n)};c(Uc).c9=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.warn(n)};c(Uc).a7=function(e){var n=kl([[this.z6_1.tag()],e]);this.z6_1.debug(n)};function eu(){}c(eu).info=function(e){};c(eu).error=function(e){};c(eu).warn=function(e){};c(eu).debug=function(e){};c(eu).tag=function(){return""};function Yi(e,n){this.id=e,this.duration=n}c(Yi).oa=function(){return this.id};c(Yi).pa=function(){return this.duration};c(Yi).g7=function(){return this.id};c(Yi).h7=function(){return this.duration};c(Yi).qa=function(e,n){return new Yi(e,n)};c(Yi).copy=function(e,n,i){return e=e===L?this.id:e,n=n===L?this.duration:n,this.qa(e,n)};c(Yi).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};c(Yi).hashCode=function(){var e=$p(this.id);return e=xo(e,31)+this.duration|0,e};c(Yi).equals=function(e){if(this===e)return!0;if(!(e instanceof Yi))return!1;var n=e instanceof Yi?e:en();return!(this.id!==n.id||this.duration!==n.duration)};function v4(e,n){this.r8_1=e,this.s8_1=n,this.t8_1=new Ee(0,0)}c(v4).u8=function(){this.t8_1=pI()};c(v4).ea=function(){return this.t8_1.g5(this.s8_1)};function s8(){}c(s8).m8=function(e){return new v4(e,pI())};var cI;function m4(e,n,i,d){i=i===L?"RenderPostContent":i,d=d===L?new Ui:d,yi.call(this,e,new k4(n),new Pc,i,d),this.ob_1=i,this.pb_1=d}function k4(e){this.qb_1=e}c(k4).rb=function(e,n){var i=cl(n);return this.qb_1.build(e,i)};c(k4).l8=function(e,n){return this.rb(e!=null&&e!=null?e:en(),n)};function Xx(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:en())(e),d=Zp(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],p=Gx(f!=null&&typeof f=="string"?f:en(),s[1]);d.i(p)}return d}function Pc(){}c(Pc).clone=function(e){return JSON.parse(JSON.stringify(e))};c(Pc).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:en(),r=Xx(e).l();r.m();){var t=r.o();d[t.u6_1]=t.v6_1}for(var s=Xx(n).l();s.m();){var f=s.o();d[f.u6_1]=f.v6_1}return d};function pI(){return wx(new Date().getTime())}$n(c(Gt),"name",c(Gt).r4);$n(c(Gt),"ordinal",c(Gt).s4);$n(c(yi),"state",function(){return this.y8()},function(e){this.x8(e)});$n(c(Ui),"logger",function(){return this.i9()},function(e){this.h9(e)});$n(c(Ui),"errorHandler",function(){return this.k9()},function(e){this.j9(e)});$n(c(Ui),"featureFlags",function(){return this.m9()},function(e){this.l9(e)});$n(c(Ui),"performanceAnalyticsDelegate",function(){return this.o9()},function(e){this.n9(e)});$n(c(ni),"name",c(ni).r4);$n(c(ni),"ordinal",c(ni).s4);$n(c(nu),"isSpeculativeExecutionEnabled",function(){return this.la()});$n(c(nu),"isVerboseLoggingEnabled",function(){return this.ma()});$n(c(nu),"isUsingEverythingAssembler",function(){return this.na()});$n(c(m4),"state",function(){return this.y8()},function(e){this.x8(e)});aI=new l8;fI=new nu;cI=new s8;Gt.values=ZB;Gt.valueOf=qB;$n(Gt,"SYNC",bd);$n(Gt,"ASYNC",Ec);$n(Gt,"SPEC",Td);ni.values=XB;ni.valueOf=YB;$n(ni,"ALL",p4);$n(ni,"LOCAL",h4);$n(ni,"REMOTE",j1);var Kt=B(F(),1);var i0=B(F(),1);var Rd;(function(e){e[e.ENVIRONMENT_UNSPECIFIED=0]="ENVIRONMENT_UNSPECIFIED",e[e.ENVIRONMENT_SANDBOX=1]="ENVIRONMENT_SANDBOX",e[e.ENVIRONMENT_PRODUCTION=2]="ENVIRONMENT_PRODUCTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Rd||(Rd={}));function y4(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Rd.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Rd.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Rd.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Rd.UNRECOGNIZED}}function S4(e){switch(e){case Rd.ENVIRONMENT_UNSPECIFIED:return 0;case Rd.ENVIRONMENT_SANDBOX:return 1;case Rd.ENVIRONMENT_PRODUCTION:return 2;case Rd.UNRECOGNIZED:default:return-1}}var zt=B(F(),1);var tu;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(tu||(tu={}));function eL(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return tu.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return tu.GOLD;case-1:case"UNRECOGNIZED":default:return tu.UNRECOGNIZED}}function nL(e){switch(e){case tu.CURRENCY_UNSPECIFIED:return 0;case tu.GOLD:return 200;case tu.UNRECOGNIZED:default:return-1}}var Wn;(function(e){e[e.ACCOUNTING_TYPE_UNSPECIFIED=0]="ACCOUNTING_TYPE_UNSPECIFIED",e[e.ACCOUNTING_TYPE_INSTANT=1]="ACCOUNTING_TYPE_INSTANT",e[e.ACCOUNTING_TYPE_DURABLE=2]="ACCOUNTING_TYPE_DURABLE",e[e.ACCOUNTING_TYPE_CONSUMABLE=3]="ACCOUNTING_TYPE_CONSUMABLE",e[e.ACCOUNTING_TYPE_VALID_FOR_1D=4]="ACCOUNTING_TYPE_VALID_FOR_1D",e[e.ACCOUNTING_TYPE_VALID_FOR_7D=5]="ACCOUNTING_TYPE_VALID_FOR_7D",e[e.ACCOUNTING_TYPE_VALID_FOR_30D=6]="ACCOUNTING_TYPE_VALID_FOR_30D",e[e.ACCOUNTING_TYPE_VALID_FOR_1Y=7]="ACCOUNTING_TYPE_VALID_FOR_1Y",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wn||(Wn={}));function iL(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return Wn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return Wn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return Wn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return Wn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return Wn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return Wn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return Wn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return Wn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return Wn.UNRECOGNIZED}}function tL(e){switch(e){case Wn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case Wn.ACCOUNTING_TYPE_INSTANT:return 1;case Wn.ACCOUNTING_TYPE_DURABLE:return 2;case Wn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case Wn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case Wn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case Wn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case Wn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case Wn.UNRECOGNIZED:default:return-1}}function hI(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var Qi={$type:"devvit.payments.v1alpha.Product",encode(e,n=zt.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&iu.encode(e.price,n.uint32(42).fork()).ldelim(),e.environment!==0&&n.uint32(160).int32(e.environment),e.description!==""&&n.uint32(170).string(e.description),e.accountingType!==0&&n.uint32(184).int32(e.accountingType),Object.entries(e.productMetadata).forEach(([i,d])=>{Zc.encode({key:i,value:d},n.uint32(8018).fork()).ldelim()}),Object.entries(e.images).forEach(([i,d])=>{qc.encode({key:i,value:d},n.uint32(8026).fork()).ldelim()}),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=hI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1001:if(t!==8010)break;r.sku=i.string();continue;case 3:if(t!==26)break;r.name=i.string();continue;case 5:if(t!==42)break;r.price=iu.decode(i,i.uint32());continue;case 20:if(t!==160)break;r.environment=i.int32();continue;case 21:if(t!==170)break;r.description=i.string();continue;case 23:if(t!==184)break;r.accountingType=i.int32();continue;case 1002:if(t!==8018)break;let s=Zc.decode(i,i.uint32());s.value!==void 0&&(r.productMetadata[s.key]=s.value);continue;case 1003:if(t!==8026)break;let f=qc.decode(i,i.uint32());f.value!==void 0&&(r.images[f.key]=f.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{sku:kr(e.sku)?globalThis.String(e.sku):"",name:kr(e.name)?globalThis.String(e.name):"",price:kr(e.price)?iu.fromJSON(e.price):void 0,environment:kr(e.environment)?y4(e.environment):0,description:kr(e.description)?globalThis.String(e.description):"",accountingType:kr(e.accountingType)?iL(e.accountingType):0,productMetadata:yI(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:yI(e.images)?Object.entries(e.images).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.sku!==""&&(n.sku=e.sku),e.name!==""&&(n.name=e.name),e.price!==void 0&&(n.price=iu.toJSON(e.price)),e.environment!==0&&(n.environment=S4(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=tL(e.accountingType)),e.productMetadata){let i=Object.entries(e.productMetadata);i.length>0&&(n.productMetadata={},i.forEach(([d,r])=>{n.productMetadata[d]=r}))}if(e.images){let i=Object.entries(e.images);i.length>0&&(n.images={},i.forEach(([d,r])=>{n.images[d]=r}))}return n},create(e){return Qi.fromPartial(e??{})},fromPartial(e){let n=hI();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?iu.fromPartial(e.price):void 0,n.environment=e.environment??0,n.description=e.description??"",n.accountingType=e.accountingType??0,n.productMetadata=Object.entries(e.productMetadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.images=Object.entries(e.images??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(Qi.$type,Qi);function vI(){return{key:"",value:""}}var Zc={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=zt.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=vI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:kr(e.key)?globalThis.String(e.key):"",value:kr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Zc.fromPartial(e??{})},fromPartial(e){let n=vI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Zc.$type,Zc);function mI(){return{key:"",value:""}}var qc={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=zt.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=mI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:kr(e.key)?globalThis.String(e.key):"",value:kr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return qc.fromPartial(e??{})},fromPartial(e){let n=mI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(qc.$type,qc);function kI(){return{amount:0,currency:0}}var iu={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=zt.default.Writer.create()){return e.amount!==0&&n.uint32(8).int32(e.amount),e.currency!==0&&n.uint32(16).int32(e.currency),n},decode(e,n){let i=e instanceof zt.default.Reader?e:zt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=kI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.amount=i.int32();continue;case 2:if(t!==16)break;r.currency=i.int32();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{amount:kr(e.amount)?globalThis.Number(e.amount):0,currency:kr(e.currency)?eL(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=nL(e.currency)),n},create(e){return iu.fromPartial(e??{})},fromPartial(e){let n=kI();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(iu.$type,iu);function yI(e){return typeof e=="object"&&e!==null}function kr(e){return e!=null}var Si;(function(e){e[e.ORDER_STATUS_UNSPECIFIED=0]="ORDER_STATUS_UNSPECIFIED",e[e.ORDER_STATUS_NEW=1]="ORDER_STATUS_NEW",e[e.ORDER_STATUS_CREATED=2]="ORDER_STATUS_CREATED",e[e.ORDER_STATUS_PAID=3]="ORDER_STATUS_PAID",e[e.ORDER_STATUS_DELIVERED=4]="ORDER_STATUS_DELIVERED",e[e.ORDER_STATUS_CANCELED=5]="ORDER_STATUS_CANCELED",e[e.ORDER_STATUS_REVERTED=6]="ORDER_STATUS_REVERTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Si||(Si={}));function c8(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return Si.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return Si.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return Si.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return Si.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return Si.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return Si.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return Si.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return Si.UNRECOGNIZED}}function p8(e){switch(e){case Si.ORDER_STATUS_UNSPECIFIED:return 0;case Si.ORDER_STATUS_NEW:return 1;case Si.ORDER_STATUS_CREATED:return 2;case Si.ORDER_STATUS_PAID:return 3;case Si.ORDER_STATUS_DELIVERED:return 4;case Si.ORDER_STATUS_CANCELED:return 5;case Si.ORDER_STATUS_REVERTED:return 6;case Si.UNRECOGNIZED:default:return-1}}function SI(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var Gn={$type:"devvit.payments.v1alpha.Order",encode(e,n=i0.default.Writer.create()){e.id!==""&&n.uint32(10).string(e.id),e.status!==0&&n.uint32(16).int32(e.status),e.createdAt!==void 0&&ae.encode(AI(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&ae.encode(AI(e.updatedAt),n.uint32(34).fork()).ldelim();for(let i of e.products)Qi.encode(i,n.uint32(42).fork()).ldelim();return e.environment!==0&&n.uint32(64).int32(e.environment),Object.entries(e.metadata).forEach(([i,d])=>{Vc.encode({key:i,value:d},n.uint32(8010).fork()).ldelim()}),n},decode(e,n){let i=e instanceof i0.default.Reader?e:i0.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=SI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.id=i.string();continue;case 2:if(t!==16)break;r.status=i.int32();continue;case 3:if(t!==26)break;r.createdAt=f8(ae.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=f8(ae.decode(i,i.uint32()));continue;case 5:if(t!==42)break;r.products.push(Qi.decode(i,i.uint32()));continue;case 8:if(t!==64)break;r.environment=i.int32();continue;case 1001:if(t!==8010)break;let s=Vc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{id:n0(e.id)?globalThis.String(e.id):"",status:n0(e.status)?c8(e.status):0,createdAt:n0(e.createdAt)?CI(e.createdAt):void 0,updatedAt:n0(e.updatedAt)?CI(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>Qi.fromJSON(n)):[],environment:n0(e.environment)?y4(e.environment):0,metadata:rL(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.id!==""&&(n.id=e.id),e.status!==0&&(n.status=p8(e.status)),e.createdAt!==void 0&&(n.createdAt=e.createdAt.toISOString()),e.updatedAt!==void 0&&(n.updatedAt=e.updatedAt.toISOString()),e.products?.length&&(n.products=e.products.map(i=>Qi.toJSON(i))),e.environment!==0&&(n.environment=S4(e.environment)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return Gn.fromPartial(e??{})},fromPartial(e){let n=SI();return n.id=e.id??"",n.status=e.status??0,n.createdAt=e.createdAt??void 0,n.updatedAt=e.updatedAt??void 0,n.products=e.products?.map(i=>Qi.fromPartial(i))||[],n.environment=e.environment??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(Gn.$type,Gn);function wI(){return{key:"",value:""}}var Vc={$type:"devvit.payments.v1alpha.Order.MetadataEntry",encode(e,n=i0.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof i0.default.Reader?e:i0.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=wI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:n0(e.key)?globalThis.String(e.key):"",value:n0(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Vc.fromPartial(e??{})},fromPartial(e){let n=wI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Vc.$type,Vc);function AI(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function f8(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function CI(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):f8(ae.fromJSON(e))}function rL(e){return typeof e=="object"&&e!==null}function n0(e){return e!=null}function gI(){return{order:void 0}}var h8={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=Kt.default.Writer.create()){return e.order!==void 0&&Gn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=gI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Gn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:w4(e.order)?Gn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Gn.toJSON(e.order)),n},create(e){return h8.fromPartial(e??{})},fromPartial(e){let n=gI();return n.order=e.order!==void 0&&e.order!==null?Gn.fromPartial(e.order):void 0,n}};l.set(h8.$type,h8);function bI(){return{order:void 0}}var v8={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=Kt.default.Writer.create()){return e.order!==void 0&&Gn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=bI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Gn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:w4(e.order)?Gn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Gn.toJSON(e.order)),n},create(e){return v8.fromPartial(e??{})},fromPartial(e){let n=bI();return n.order=e.order!==void 0&&e.order!==null?Gn.fromPartial(e.order):void 0,n}};l.set(v8.$type,v8);function TI(){return{acknowledged:void 0,rejectionReason:void 0}}var m8={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=Kt.default.Writer.create()){return e.acknowledged!==void 0&&n.uint32(8).bool(e.acknowledged),e.rejectionReason!==void 0&&n.uint32(18).string(e.rejectionReason),n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=TI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.acknowledged=i.bool();continue;case 2:if(t!==18)break;r.rejectionReason=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{acknowledged:w4(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:w4(e.rejectionReason)?globalThis.String(e.rejectionReason):void 0}},toJSON(e){let n={};return e.acknowledged!==void 0&&(n.acknowledged=e.acknowledged),e.rejectionReason!==void 0&&(n.rejectionReason=e.rejectionReason),n},create(e){return m8.fromPartial(e??{})},fromPartial(e){let n=TI();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(m8.$type,m8);function RI(){return{}}var k8={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=Kt.default.Writer.create()){return n},decode(e,n){let i=e instanceof Kt.default.Reader?e:Kt.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=RI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return k8.fromPartial(e??{})},fromPartial(e){return RI()}};l.set(k8.$type,k8);function w4(e){return e!=null}var Qe=B(F(),1);function NI(){return{skus:[],metadata:{}}}var y8={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=Qe.default.Writer.create()){for(let i of e.skus)n.uint32(10).string(i);return Object.entries(e.metadata).forEach(([i,d])=>{Jc.encode({key:i,value:d},n.uint32(18).fork()).ldelim()}),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=NI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.skus.push(i.string());continue;case 2:if(t!==18)break;let s=Jc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{skus:globalThis.Array.isArray(e?.skus)?e.skus.map(n=>globalThis.String(n)):[],metadata:UI(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.skus?.length&&(n.skus=e.skus),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return y8.fromPartial(e??{})},fromPartial(e){let n=NI();return n.skus=e.skus?.map(i=>i)||[],n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(y8.$type,y8);function xI(){return{key:"",value:""}}var Jc={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=Qe.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=xI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ci(e.key)?globalThis.String(e.key):"",value:Ci(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Jc.fromPartial(e??{})},fromPartial(e){let n=xI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Jc.$type,Jc);function II(){return{products:[]}}var S8={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=Qe.default.Writer.create()){for(let i of e.products)Qi.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=II();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.products.push(Qi.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{products:globalThis.Array.isArray(e?.products)?e.products.map(n=>Qi.fromJSON(n)):[]}},toJSON(e){let n={};return e.products?.length&&(n.products=e.products.map(i=>Qi.toJSON(i))),n},create(e){return S8.fromPartial(e??{})},fromPartial(e){let n=II();return n.products=e.products?.map(i=>Qi.fromPartial(i))||[],n}};l.set(S8.$type,S8);function EI(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var w8={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=Qe.default.Writer.create()){return e.start!==void 0&&ae.encode(LI(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&ae.encode(LI(e.end),n.uint32(18).fork()).ldelim(),e.limit!==0&&n.uint32(24).int32(e.limit),e.sku!==""&&n.uint32(34).string(e.sku),e.buyer!==""&&n.uint32(42).string(e.buyer),e.status!==0&&n.uint32(48).int32(e.status),Object.entries(e.metadata).forEach(([i,d])=>{Hc.encode({key:i,value:d},n.uint32(58).fork()).ldelim()}),e.cursor!==""&&n.uint32(66).string(e.cursor),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=EI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=b8(ae.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=b8(ae.decode(i,i.uint32()));continue;case 3:if(t!==24)break;r.limit=i.int32();continue;case 4:if(t!==34)break;r.sku=i.string();continue;case 5:if(t!==42)break;r.buyer=i.string();continue;case 6:if(t!==48)break;r.status=i.int32();continue;case 7:if(t!==58)break;let s=Hc.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue;case 8:if(t!==66)break;r.cursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{start:Ci(e.start)?FI(e.start):void 0,end:Ci(e.end)?FI(e.end):void 0,limit:Ci(e.limit)?globalThis.Number(e.limit):0,sku:Ci(e.sku)?globalThis.String(e.sku):"",buyer:Ci(e.buyer)?globalThis.String(e.buyer):"",status:Ci(e.status)?c8(e.status):0,metadata:UI(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},cursor:Ci(e.cursor)?globalThis.String(e.cursor):""}},toJSON(e){let n={};if(e.start!==void 0&&(n.start=e.start.toISOString()),e.end!==void 0&&(n.end=e.end.toISOString()),e.limit!==0&&(n.limit=Math.round(e.limit)),e.sku!==""&&(n.sku=e.sku),e.buyer!==""&&(n.buyer=e.buyer),e.status!==0&&(n.status=p8(e.status)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return e.cursor!==""&&(n.cursor=e.cursor),n},create(e){return w8.fromPartial(e??{})},fromPartial(e){let n=EI();return n.start=e.start??void 0,n.end=e.end??void 0,n.limit=e.limit??0,n.sku=e.sku??"",n.buyer=e.buyer??"",n.status=e.status??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.cursor=e.cursor??"",n}};l.set(w8.$type,w8);function OI(){return{key:"",value:""}}var Hc={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=Qe.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=OI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ci(e.key)?globalThis.String(e.key):"",value:Ci(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Hc.fromPartial(e??{})},fromPartial(e){let n=OI();return n.key=e.key??"",n.value=e.value??"",n}};l.set(Hc.$type,Hc);function PI(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var ru={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=Qe.default.Writer.create()){return e.hasNextPage!==!1&&n.uint32(8).bool(e.hasNextPage),e.endCursor!==""&&n.uint32(18).string(e.endCursor),e.hasPreviousPage!==!1&&n.uint32(24).bool(e.hasPreviousPage),e.startCursor!==""&&n.uint32(34).string(e.startCursor),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=PI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.hasNextPage=i.bool();continue;case 2:if(t!==18)break;r.endCursor=i.string();continue;case 3:if(t!==24)break;r.hasPreviousPage=i.bool();continue;case 4:if(t!==34)break;r.startCursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{hasNextPage:Ci(e.hasNextPage)?globalThis.Boolean(e.hasNextPage):!1,endCursor:Ci(e.endCursor)?globalThis.String(e.endCursor):"",hasPreviousPage:Ci(e.hasPreviousPage)?globalThis.Boolean(e.hasPreviousPage):!1,startCursor:Ci(e.startCursor)?globalThis.String(e.startCursor):""}},toJSON(e){let n={};return e.hasNextPage!==!1&&(n.hasNextPage=e.hasNextPage),e.endCursor!==""&&(n.endCursor=e.endCursor),e.hasPreviousPage!==!1&&(n.hasPreviousPage=e.hasPreviousPage),e.startCursor!==""&&(n.startCursor=e.startCursor),n},create(e){return ru.fromPartial(e??{})},fromPartial(e){let n=PI();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(ru.$type,ru);function MI(){return{orders:[],pageInfo:void 0}}var A8={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=Qe.default.Writer.create()){for(let i of e.orders)Gn.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&ru.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=MI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orders.push(Gn.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=ru.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orders:globalThis.Array.isArray(e?.orders)?e.orders.map(n=>Gn.fromJSON(n)):[],pageInfo:Ci(e.pageInfo)?ru.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>Gn.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=ru.toJSON(e.pageInfo)),n},create(e){return A8.fromPartial(e??{})},fromPartial(e){let n=MI();return n.orders=e.orders?.map(i=>Gn.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?ru.fromPartial(e.pageInfo):void 0,n}};l.set(A8.$type,A8);function _I(){return{orderId:""}}var C8={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=Qe.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=_I();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orderId=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orderId:Ci(e.orderId)?globalThis.String(e.orderId):""}},toJSON(e){let n={};return e.orderId!==""&&(n.orderId=e.orderId),n},create(e){return C8.fromPartial(e??{})},fromPartial(e){let n=_I();return n.orderId=e.orderId??"",n}};l.set(C8.$type,C8);function BI(){return{}}var g8={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=Qe.default.Writer.create()){return n},decode(e,n){let i=e instanceof Qe.default.Reader?e:Qe.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=BI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return g8.fromPartial(e??{})},fromPartial(e){return BI()}};l.set(g8.$type,g8);function LI(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function b8(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function FI(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):b8(ae.fromJSON(e))}function UI(e){return typeof e=="object"&&e!==null}function Ci(e){return e!=null}var dL=e=>{switch(e){case Rn.ALL:return ni.ALL;case Rn.REMOTE:return ni.REMOTE;case Rn.LOCAL:return ni.LOCAL;case Rn.UNRECOGNIZED:return ni.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},Kr=class{constructor(n){this.scope=n.scope?dL(n.scope):ni.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},A4=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new Kr(i)),n.state&&(this.state=n.state)}},Dc=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new Kr(i)),n.state&&(this.state=n.state)}};function ZI(){var r,t;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(r=globalThis.devvit).debug??(r.debug={});let n={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0},i={};for(let s in n)i[s.toLowerCase()]=s;let d=[...e.searchParams].find(([s])=>s.toLowerCase()==="devvitdebug")?.[1];if(d!=null){d===""&&(d=Object.keys(n).filter(s=>s!=="emitSnapshots"&&s!=="emitState").join());for(let s of d.split(",")??[]){let[f,p]=s.split("=");f&&(f.toLowerCase()in i?f=i[f.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${f}"`),(t=globalThis.devvit.debug)[f]??(t[f]=p||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var Xr;(function(e){e.ENABLE_APP_LOGGING="enableAppLogging",e.ENABLE_DEBUG_LOGGING="enableDebugLogging",e.ENABLE_PLUGINS="enablePlugins",e.LOAD_BUNDLE="loadBundle",e.CALL="call",e.PLUGIN_RESPONSE="pluginResponse",e.QUIT="quit"})(Xr||(Xr={}));var yr;(function(e){e.READY="ready",e.PLUGINS_CONFIGURED="pluginsConfigured",e.BUNDLE_LOADED="bundleLoaded",e.BUNDLE_LOAD_FAILED="bundleLoadFailed",e.RETURN="return",e.ERROR="error",e.CIRCUIT_BREAKER="circuitBreaker",e.PLUGIN_CALL="pluginCall",e.UNHANDLED_REJECTION="unhandledRejection"})(yr||(yr={}));function T8(e){return e.hostname.split(".")[1]??e.hostname}function qI(e){return`${T8(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Zi=B(F(),1);function VI(){return{callState:void 0,connect:void 0}}var R8={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Zi.default.Writer.create()){return e.callState!==void 0&&ou.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&au.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=VI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=ou.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=au.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:C4(e.callState)?ou.fromJSON(e.callState):void 0,connect:C4(e.connect)?au.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=ou.toJSON(e.callState)),e.connect!==void 0&&(n.connect=au.toJSON(e.connect)),n},create(e){return R8.fromPartial(e??{})},fromPartial(e){let n=VI();return n.callState=e.callState!==void 0&&e.callState!==null?ou.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?au.fromPartial(e.connect):void 0,n}};l.set(R8.$type,R8);function JI(){return{appInstalled:void 0}}var $c={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Zi.default.Writer.create()){return e.appInstalled!==void 0&&du.encode(e.appInstalled,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=JI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.appInstalled=du.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:C4(e.appInstalled)?du.fromJSON(e.appInstalled):void 0}},toJSON(e){let n={};return e.appInstalled!==void 0&&(n.appInstalled=du.toJSON(e.appInstalled)),n},create(e){return $c.fromPartial(e??{})},fromPartial(e){let n=JI();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?du.fromPartial(e.appInstalled):void 0,n}};l.set($c.$type,$c);function HI(){return{}}var du={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Zi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=HI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return du.fromPartial(e??{})},fromPartial(e){return HI()}};l.set(du.$type,du);function DI(){return{logs:[]}}var ou={$type:"devvit.cli.PlaytestCallState",encode(e,n=Zi.default.Writer.create()){for(let i of e.logs)lt.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=DI();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.logs.push(lt.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(n=>lt.fromJSON(n)):[]}},toJSON(e){let n={};return e.logs?.length&&(n.logs=e.logs.map(i=>lt.toJSON(i))),n},create(e){return ou.fromPartial(e??{})},fromPartial(e){let n=DI();return n.logs=e.logs?.map(i=>lt.fromPartial(i))||[],n}};l.set(ou.$type,ou);function $I(){return{url:""}}var au={$type:"devvit.cli.PlaytestConnect",encode(e,n=Zi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Zi.default.Reader?e:Zi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=$I();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.url=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{url:C4(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return au.fromPartial(e??{})},fromPartial(e){let n=$I();return n.url=e.url??"",n}};l.set(au.$type,au);function C4(e){return e!=null}var N8="playtest",WI="ws://localhost:5678";function GI(e){let n=x8();return n===""||n===e}function x8(){return globalThis.location?new URL(location.href).searchParams.get(N8)??void 0:void 0}var Ln=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Wc=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},Gc,Bn,I8,zI,E8,O8,P8,M8,oL=15e3,g4=class{constructor(){Gc.add(this),Bn.set(this,{type:"Init"}),E8.set(this,()=>{Ln(this,Bn,"f").type==="Opened"&&this.onState?.("Closed"),Wc(this,Bn,Ln(this,Gc,"m",zI).call(this),"f")}),O8.set(this,n=>{let i=$c.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),P8.set(this,()=>{if(Ln(this,Bn,"f").type!=="Opening")throw Error(`invalid transition from ${Ln(this,Bn,"f").type}`);this.onState?.("Opened"),Wc(this,Bn,{sock:Ln(this,Bn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),M8.set(this,()=>{Wc(this,Bn,Ln(this,Gc,"m",I8).call(this),"f")})}close(){"timer"in Ln(this,Bn,"f")&&clearTimeout(Ln(this,Bn,"f").timer),"sock"in Ln(this,Bn,"f")&&(Ln(this,Bn,"f").sock.onopen=null,Ln(this,Bn,"f").sock.onmessage=null,Ln(this,Bn,"f").sock.onclose=null,Ln(this,Bn,"f").sock.close()),Wc(this,Bn,{type:"Init"},"f")}open(){Ln(this,Bn,"f").type==="Init"&&Wc(this,Bn,Ln(this,Gc,"m",I8).call(this),"f")}send(n){"sock"in Ln(this,Bn,"f")?Ln(this,Bn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Bn=new WeakMap,E8=new WeakMap,O8=new WeakMap,P8=new WeakMap,M8=new WeakMap,Gc=new WeakSet,I8=function(){let n=new WebSocket(WI);return n.onclose=Ln(this,E8,"f"),n.onmessage=Ln(this,O8,"f"),n.onopen=Ln(this,P8,"f"),{sock:n,type:"Opening"}},zI=function(){return{timer:setTimeout(Ln(this,M8,"f"),oL),type:"Retrying"}};var ii=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},ce=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Nd,b4,ti,Rl,T4,Kc,Yr,Io,Nl,Il,Eo,_8,zc,R4,B8,KI,xl,L8,F8,aL={debug:gn.DEBUG,error:gn.ERROR,info:gn.INFO,log:gn.DEBUG,trace:gn.DEBUG,warn:gn.WARN},N4=class{constructor(n,i,d){Nd.add(this),b4.set(this,void 0),ti.set(this,void 0),Rl.set(this,!1),T4.set(this,0),Kc.set(this,void 0),Yr.set(this,{}),Io.set(this,void 0),Nl.set(this,()=>{}),Il.set(this,void 0),Eo.set(this,void 0),_8.set(this,x8()),zc.set(this,!1),R4.set(this,void 0),B8.set(this,r=>{let t=r.data,[s]=t;switch(s){case yr.READY:{let[,f]=t;ii(this,R4,f,"f"),ce(this,Il,"f")?.plugins?ce(this,Nd,"m",KI).call(this):ce(this,Nd,"m",L8).call(this);break}case yr.PLUGINS_CONFIGURED:ce(this,Nd,"m",L8).call(this);break;case yr.BUNDLE_LOADED:{let[,f]=t;ce(this,Nd,"m",xl).call(this,f),ii(this,Rl,!0,"f"),ce(this,Io,"f")?.resolve({metrics:{init:ce(this,R4,"f")}}),ii(this,Io,void 0,"f");break}case yr.BUNDLE_LOAD_FAILED:{let[,,f,p]=t;ce(this,Nd,"m",xl).call(this,p),ce(this,Io,"f")?.reject(f),ii(this,Io,void 0,"f");break}case yr.RETURN:{let[,f,p,v]=t;ce(this,Nd,"m",xl).call(this,v),ce(this,Yr,"f")[f]?.resolve(p),delete ce(this,Yr,"f")[f];break}case yr.ERROR:{let[,f,p,v]=t;ce(this,Nd,"m",xl).call(this,v),ce(this,Yr,"f")[f]?.reject(p),delete ce(this,Yr,"f")[f];break}case yr.CIRCUIT_BREAKER:{let[,f,p,v]=t;ce(this,Yr,"f")[f]?.reject(new Z5(p,v)),delete ce(this,Yr,"f")[f];break}case yr.PLUGIN_CALL:{let[,f,p,v,w,b]=t;ce(this,Il,"f")?.callback(f,p,v,w,b);break}case yr.UNHANDLED_REJECTION:{let[,,f,p]=t;ce(this,Nd,"m",xl).call(this,p),ce(this,Nl,"f").call(this,"UnhandledRejection",f);break}}}),F8.set(this,r=>{switch(r){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),ce(this,Eo,"f")?.close();let t=new URL(location.href);t.searchParams.set(N8,ce(this,_8,"f")??""),location.assign(t),location.reload();break}}}),ii(this,b4,n,"f"),i&&ii(this,Nl,i,"f"),d&&ii(this,Il,d,"f")}get ready(){return ce(this,Rl,"f")}get runtimeDebugLogging(){return ce(this,zc,"f")}set runtimeDebugLogging(n){n!==ce(this,zc,"f")&&(ii(this,zc,n,"f"),this.runtimeDebugLogging&&ce(this,ti,"f")?.postMessage([Xr.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(ce(this,ti,"f"))throw new Error("Bundle already loaded");let i=GI(T8(n));i&&(ii(this,Eo,new g4,"f"),ce(this,Eo,"f").onState=ce(this,F8,"f")),ce(this,Eo,"f")?.open();let d=new Worker(URL.createObjectURL(ce(this,b4,"f")),{name:`App: ${qI(n)}`,type:"module"});return d.onerror=r=>ce(this,Nl,"f").call(this,"Error",r.error),d.onmessageerror=r=>ce(this,Nl,"f").call(this,"MessageError",r.data),d.onmessage=ce(this,B8,"f"),ii(this,ti,d,"f"),ii(this,Kc,n,"f"),this.runtimeDebugLogging&&ce(this,ti,"f").postMessage([Xr.ENABLE_DEBUG_LOGGING]),i&&ce(this,ti,"f").postMessage([Xr.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ii(this,Io,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!ce(this,Rl,"f")||!ce(this,ti,"f"))throw new Error("No bundle loaded");let t=ii(this,T4,(r=ce(this,T4,"f"),++r),"f"),s=new Promise((f,p)=>{ce(this,Yr,"f")[t]={resolve:f,reject:p}});return ce(this,ti,"f").postMessage([Xr.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){ce(this,ti,"f")?.postMessage([Xr.PLUGIN_RESPONSE,n,i])}quit(){ce(this,Eo,"f")?.close(),ii(this,Eo,void 0,"f"),ii(this,Rl,!1,"f"),ce(this,ti,"f")&&(ce(this,ti,"f").postMessage([Xr.QUIT]),ce(this,ti,"f").onerror=null,ce(this,ti,"f").onmessageerror=null,ce(this,ti,"f").onmessage=null,ce(this,ti,"f").terminate()),ii(this,ti,void 0,"f");for(let{reject:n}of Object.values(ce(this,Yr,"f")))n(Error("worker terminated"));ii(this,Yr,{},"f"),ce(this,Io,"f")?.reject(Error("worker terminated")),ii(this,Io,void 0,"f")}};b4=new WeakMap,ti=new WeakMap,Rl=new WeakMap,T4=new WeakMap,Kc=new WeakMap,Yr=new WeakMap,Io=new WeakMap,Nl=new WeakMap,Il=new WeakMap,Eo=new WeakMap,_8=new WeakMap,zc=new WeakMap,R4=new WeakMap,B8=new WeakMap,F8=new WeakMap,Nd=new WeakSet,KI=function(){ce(this,ti,"f")?.postMessage([Xr.ENABLE_PLUGINS,ce(this,Il,"f")?.plugins??[]])},xl=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:aL[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};ce(this,Eo,"f")?.send({callState:d})},L8=function(){ce(this,ti,"f")?.postMessage([Xr.LOAD_BUNDLE,ce(this,Kc,"f")]),ii(this,Kc,void 0,"f")};var U8="RenderPostContent",uL=new Set([U8]);function XI(e){if(uL.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var El,Xc,x4=class{constructor(n){Re(this,El);Re(this,Xc);mn(this,El,n)}set env(n){mn(this,El,n)}set props(n){mn(this,Xc,n)}build(n,i){return new A4({state:n,events:i.map(d=>d.uiEvent),env:O(this,El),props:O(this,Xc)})}};El=new WeakMap,Xc=new WeakMap;var kt,Yc,O4,I4=class{constructor(){Re(this,kt);Re(this,Yc,!1);Re(this,O4,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===xu.fullName&&d===xu.methods.send.name&&O(this,kt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!O(this,kt)?.ready}set runtimeDebugLogging(n){mn(this,Yc,n),O(this,kt)&&(O(this,kt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),mn(this,kt,n?new N4(n,(i,d)=>console.error(i,d),{callback:O(this,O4),plugins:[]}):void 0),O(this,kt)&&(O(this,kt).runtimeDebugLogging=O(this,Yc))}unload(){O(this,kt)?.quit()}async load(n){this.unload();try{return await O(this,kt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!O(this,kt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),O(this,kt)?.call(XI(n),i.uiRequest,this.metadata).then(t=>d(new Dc(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};kt=new WeakMap,Yc=new WeakMap,O4=new WeakMap;var E4=class{isReady(){return!!this.remote}load(n){this.remote=n}handle(n,i,d,r){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[XI(n)](i.uiRequest,this.metadata).then(t=>d(new Dc(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var Oo,Po,Qc,P4=class{constructor(n){Re(this,Oo,new Map);Re(this,Po,new Map);Re(this,Qc);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),mn(this,Qc,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),O(this,Po).set(n.id,n),O(this,Oo).set(n.id,window.setInterval(()=>{O(this,Qc).submit([new Kr({scope:Rn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(O(this,Po));n.forEach(d=>{i.delete(d.id),O(this,Po).has(d.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",d),this.add(d))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",i);for(let[d]of i)this.remove(d)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let n of O(this,Oo).values())clearInterval(n);O(this,Oo).clear(),O(this,Po).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...O(this,Po).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of O(this,Oo).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),O(this,Po).delete(n),clearInterval(O(this,Oo).get(n)),O(this,Oo).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};Oo=new WeakMap,Po=new WeakMap,Qc=new WeakMap;var YI=e=>e.message==="ServerCallRequired",Z8=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){YI(n[0])||console.error(this.tag(),...n)}info(n){console.info(this.tag(),...n)}warn(n){console.warn(this.tag(),...n)}tag(){return"[kmp-dispatcher]"}},q8=class{constructor(){this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")}}logRuntimeError(n){YI(n)||console.error("[kmp-dispatcher-perf-analytics] error",n)}logRuntimeTrace(n){devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n)}};ZI();var lL=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},sL=["showToast","showForm","navigateToUrl","createOrder"],t0,r0,Sr,jc,d0,Qr,Ol,M4=class{constructor(n,i,d){Re(this,t0);Re(this,r0);Re(this,Sr);Re(this,jc);this.hasRendered=!1;Re(this,d0);Re(this,Qr);Re(this,Ol);mn(this,t0,new x4(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),mn(this,Sr,new m4(n??{},O(this,t0),U8,{logger:new Z8,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new q8,errorHandler:r=>this.onError?.(r)})),mn(this,r0,new P4(O(this,Sr))),mn(this,d0,new E4),mn(this,Qr,new I4),this.init()}get state(){return O(this,Sr).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[G1.Debug]={values:d}),O(this,Qr).metadata=i,O(this,d0).metadata=i}set onPluginCall(n){O(this,Qr).onPluginCall=n}set runtimeDebugLogging(n){O(this,Qr).runtimeDebugLogging=n}subscribe(n){mn(this,jc,O(this,Sr).subscribe((...i)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",i[0]);let[{response:d}]=i;d.uiResponse.effects.forEach(r=>{if(sL.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&O(this,r0).clear(),O(this,r0).apply(t.map(([s,f])=>new Yi(s,lL(f.duration))));return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(r,null,2)}`)}),n(...i)}))}submit(...n){O(this,Sr).submit(...n)}unsubscribe(){O(this,jc)?.unsubscribe()}init(){O(this,Sr).init(O(this,Qr),O(this,d0),O(this,r0))}togglePause(n){n?mn(this,Ol,O(this,Sr).pause()):O(this,Ol)&&O(this,Sr).resume(O(this,Ol))}resetAppState(){this.hasRendered=!1,O(this,Sr).reset()}setEnv(n){O(this,t0).env=n}setProps(n){O(this,t0).props=n}remoteLoad(...n){O(this,d0).load(...n)}async localLoad(...n){return O(this,Qr).reset(),await O(this,Qr).load(...n)}localLoadWorker(...n){O(this,Qr).setLocalSrc(...n)}};t0=new WeakMap,r0=new WeakMap,Sr=new WeakMap,jc=new WeakMap,d0=new WeakMap,Qr=new WeakMap,Ol=new WeakMap;function QI(e,n,i,d){let r=d.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(r.length<3)return"";let[t,s,f]=r;if(!n||!s||!f)return"";let p=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",p).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var o0,a0,u0,n3,vn,_4,B4,L4,F4,l0,e3,U4,gi=class extends Xt{constructor(){super();Re(this,l0);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webviewUrlTemplate="";this.disableAssetSandbox=!1;Re(this,o0);Re(this,a0);Re(this,u0);Re(this,n3,"");Re(this,vn);Re(this,_4,()=>({experimental:this.useExperimentalBlocks,resolveWebviewUrl:i=>this.disableAssetSandbox?i:QI(this.webviewUrlTemplate,this.metadata?.[G1.Subreddit]?.values?.[0],O(this,n3),i),onAction:i=>O(this,vn)?.submit([new Kr({scope:Rn.ALL,userAction:{actionId:i.id,data:i.data??{}},hook:i.id})]),stackDirection:we.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));Re(this,B4,i=>{cN(i)||console.error(i),Ml(this,l0,e3).call(this,"devvit-ui-error",{err:i,type:"Error"})});Re(this,L4,(i,d,r,t,s)=>{d===xu.fullName&&r===xu.methods.send.name&&Ml(this,l0,e3).call(this,"devvit-realtime-send",{event:t})});Re(this,F4,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,O(this,o0)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig=yd.fromPartial({})),this._rootBlock.config.rootConfig.height=O(this,o0)):mn(this,o0,this._rootBlock.config?.rootConfig?.height||mp))});Re(this,U4,i=>{Ml(this,l0,e3).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>O(this,vn)?.submit([new Kr(d)]),metadata:this.metadata})});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[x5]}async connectedCallback(){super.connectedCallback(),mn(this,vn,new M4({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[G1.Language]?.values?.[0],timezone:this.metadata?.[G1.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution})),O(this,vn).onPluginCall=O(this,L4),O(this,vn).onError=O(this,B4),O(this,vn).onUserAction=O(this,U4),O(this,vn).subscribe(i=>{O(this,F4).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),mn(this,a0,new ResizeObserver(hN(i=>{i.length!==0&&(this.dimensions=kN(i[0],window,document.body))},600))),O(this,a0).observe(this,{box:"content-box"}),mn(this,u0,new IntersectionObserver(i=>{i.forEach(d=>{O(this,vn)?.togglePause(!d.isIntersecting)})})),O(this,u0).observe(this)}disconnectedCallback(){O(this,a0)?.unobserve(this),O(this,a0)?.disconnect(),O(this,u0)?.unobserve(this),O(this,u0)?.disconnect(),O(this,vn)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?St`<div class="relative">
|
|
624
624
|
<devvit-blocks-renderer
|
|
625
625
|
class="${this.scheme??""}"
|
|
626
626
|
.block="${this._rootBlock}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/ui-renderer",
|
|
3
|
-
"version": "0.11.0-next-2024-10-07-
|
|
3
|
+
"version": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
},
|
|
60
60
|
"types": "./index.d.ts",
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@devvit/multiplatform": "0.0.1-
|
|
63
|
-
"@devvit/protos": "0.11.0-next-2024-10-07-
|
|
64
|
-
"@devvit/runtime-lite": "0.11.0-next-2024-10-07-
|
|
65
|
-
"@devvit/shared-types": "0.11.0-next-2024-10-07-
|
|
62
|
+
"@devvit/multiplatform": "0.0.1-20241007-2990961f",
|
|
63
|
+
"@devvit/protos": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
64
|
+
"@devvit/runtime-lite": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
65
|
+
"@devvit/shared-types": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
66
66
|
"nice-grpc-web": "3.3.3",
|
|
67
67
|
"p-queue": "7.3.4",
|
|
68
68
|
"rxjs": "7.8.1"
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@ampproject/filesize": "4.3.0",
|
|
91
|
-
"@devvit/eslint-config": "0.11.0-next-2024-10-07-
|
|
92
|
-
"@devvit/public-api": "0.11.0-next-2024-10-07-
|
|
93
|
-
"@devvit/repo-tools": "0.11.0-next-2024-10-07-
|
|
94
|
-
"@devvit/tsconfig": "0.11.0-next-2024-10-07-
|
|
91
|
+
"@devvit/eslint-config": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
92
|
+
"@devvit/public-api": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
93
|
+
"@devvit/repo-tools": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
94
|
+
"@devvit/tsconfig": "0.11.0-next-2024-10-07-02dcca49e.0",
|
|
95
95
|
"@lit-labs/ssr": "^2.2.3",
|
|
96
96
|
"@lit/localize": "0.11.4",
|
|
97
97
|
"@open-wc/testing-helpers": "2.3.0",
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
"source": "./src/index.ts",
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "f80f24720913e746a196a92cdc3aeac136fcdc51"
|
|
142
142
|
}
|