@mushi-mushi/web 1.31.0 → 1.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -265
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){'use strict';var yu=Object.defineProperty;var qe=(t,e)=>()=>(t&&(e=t(t=0)),e);var jt=(t,e)=>{for(var r in e)yu(t,r,{get:e[r],enumerable:true});};function vu(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Yi(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(`${r}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){let r=e&&`"${e}" `;throw new RangeError(`${r}expected integer >= 0, got ${t}`)}}function Wt(t,e,r=""){let n=vu(t),i=t?.length,o=e!==void 0;if(!n||o){let a=r&&`"${r}" `,s="",u=n?`length=${i}`:`type=${typeof t}`,d=a+"expected Uint8Array"+s+", got "+u;throw n?new RangeError(d):new TypeError(d)}return t}function Xi(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(Yi(t.outputLen),Yi(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function xt(t,e=true){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function yr(t,e){Wt(t,void 0,"digestInto() output");let r=e.outputLen;if(t.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function je(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function vr(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ae(t,e){return t<<32-e|t>>>e}function at(t,e={}){let r=(i,o)=>t(o).update(i).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=i=>t(i),Object.assign(r,e),Object.freeze(r)}var ut,wr=qe(()=>{ut=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});});function Ji(t,e,r){return t&e^~t&r}function Qi(t,e,r){return t&e^t&r^e&r}var Vt,We,Ve,oe,se,Zi=qe(()=>{wr();Vt=class{blockLen;outputLen;canXOF=false;padOffset;isLE;buffer;view;finished=false;length=0;pos=0;destroyed=false;constructor(e,r,n,i){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=vr(this.buffer);}update(e){xt(this),Wt(e);let{view:r,buffer:n,blockLen:i}=this,o=e.length;for(let a=0;a<o;){let s=Math.min(i-this.pos,o-a);if(s===i){let u=vr(e);for(;i<=o-a;a+=i)this.process(u,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===i&&(this.process(r,0),this.pos=0);}return this.length+=e.length,this.roundClean(),this}digestInto(e){xt(this),yr(e,this),this.finished=true;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:a}=this;r[a++]=128,je(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let h=a;h<i;h++)r[h]=0;n.setBigUint64(i-8,BigInt(this.length*8),o),this.process(n,0);let s=vr(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let d=u/4,p=this.get();if(d>p.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<d;h++)s.setUint32(4*h,p[h],o);}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=o,e.length=i,e.pos=s,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}},We=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ve=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),oe=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),se=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);});function wu(t,e=false){return e?{h:Number(t&Sr),l:Number(t>>eo&Sr)}:{h:Number(t>>eo&Sr)|0,l:Number(t&Sr)|0}}function to(t,e=false){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=wu(t[o],e);[n[o],i[o]]=[a,s];}return [n,i]}function Pe(t,e,r,n){let i=(e>>>0)+(n>>>0);return {h:t+r+(i/2**32|0)|0,l:i|0}}var Sr,eo,pn,hn,lt,ct,Kt,zt,ro,no,io,oo,so,ao,uo=qe(()=>{Sr=BigInt(4294967295),eo=BigInt(32);pn=(t,e,r)=>t>>>r,hn=(t,e,r)=>t<<32-r|e>>>r,lt=(t,e,r)=>t>>>r|e<<32-r,ct=(t,e,r)=>t<<32-r|e>>>r,Kt=(t,e,r)=>t<<64-r|e>>>r-32,zt=(t,e,r)=>t>>>r-32|e<<64-r;ro=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),no=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,io=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),oo=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,so=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),ao=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;});var fn={};jt(fn,{_SHA224:()=>kr,_SHA256:()=>Rr,_SHA384:()=>Cr,_SHA512:()=>_r,_SHA512_224:()=>Tr,_SHA512_256:()=>Ar,sha224:()=>Cu,sha256:()=>_u,sha384:()=>Au,sha512:()=>Tu,sha512_224:()=>Mu,sha512_256:()=>Iu});var xu,Je,xr,Rr,kr,lo,Ru,ku,Qe,Ze,Rt,_r,Cr,le,ce,Tr,Ar,_u,Cu,Tu,Au,Iu,Mu,mn=qe(()=>{Zi();uo();wr();xu=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Je=new Uint32Array(64),xr=class extends Vt{constructor(e){super(64,e,8,false);}get(){let{A:e,B:r,C:n,D:i,E:o,F:a,G:s,H:u}=this;return [e,r,n,i,o,a,s,u]}set(e,r,n,i,o,a,s,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0;}process(e,r){for(let h=0;h<16;h++,r+=4)Je[h]=e.getUint32(r,false);for(let h=16;h<64;h++){let k=Je[h-15],S=Je[h-2],T=Ae(k,7)^Ae(k,18)^k>>>3,E=Ae(S,17)^Ae(S,19)^S>>>10;Je[h]=E+Je[h-7]+T+Je[h-16]|0;}let{A:n,B:i,C:o,D:a,E:s,F:u,G:d,H:p}=this;for(let h=0;h<64;h++){let k=Ae(s,6)^Ae(s,11)^Ae(s,25),S=p+k+Ji(s,u,d)+xu[h]+Je[h]|0,E=(Ae(n,2)^Ae(n,13)^Ae(n,22))+Qi(n,i,o)|0;p=d,d=u,u=s,s=a+S|0,a=o,o=i,i=n,n=S+E|0;}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(n,i,o,a,s,u,d,p);}roundClean(){je(Je);}destroy(){this.destroyed=true,this.set(0,0,0,0,0,0,0,0),je(this.buffer);}},Rr=class extends xr{A=We[0]|0;B=We[1]|0;C=We[2]|0;D=We[3]|0;E=We[4]|0;F=We[5]|0;G=We[6]|0;H=We[7]|0;constructor(){super(32);}},kr=class extends xr{A=Ve[0]|0;B=Ve[1]|0;C=Ve[2]|0;D=Ve[3]|0;E=Ve[4]|0;F=Ve[5]|0;G=Ve[6]|0;H=Ve[7]|0;constructor(){super(28);}},lo=to(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ru=lo[0],ku=lo[1],Qe=new Uint32Array(80),Ze=new Uint32Array(80),Rt=class extends Vt{constructor(e){super(128,e,16,false);}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:s,Dl:u,Eh:d,El:p,Fh:h,Fl:k,Gh:S,Gl:T,Hh:E,Hl:w}=this;return [e,r,n,i,o,a,s,u,d,p,h,k,S,T,E,w]}set(e,r,n,i,o,a,s,u,d,p,h,k,S,T,E,w){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=d|0,this.El=p|0,this.Fh=h|0,this.Fl=k|0,this.Gh=S|0,this.Gl=T|0,this.Hh=E|0,this.Hl=w|0;}process(e,r){for(let x=0;x<16;x++,r+=4)Qe[x]=e.getUint32(r),Ze[x]=e.getUint32(r+=4);for(let x=16;x<80;x++){let f=Qe[x-15]|0,g=Ze[x-15]|0,m=lt(f,g,1)^lt(f,g,8)^pn(f,g,7),b=ct(f,g,1)^ct(f,g,8)^hn(f,g,7),C=Qe[x-2]|0,P=Ze[x-2]|0,v=lt(C,P,19)^Kt(C,P,61)^pn(C,P,6),K=ct(C,P,19)^zt(C,P,61)^hn(C,P,6),Y=io(b,K,Ze[x-7],Ze[x-16]),ne=oo(Y,m,v,Qe[x-7],Qe[x-16]);Qe[x]=ne|0,Ze[x]=Y|0;}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:s,Cl:u,Dh:d,Dl:p,Eh:h,El:k,Fh:S,Fl:T,Gh:E,Gl:w,Hh:L,Hl:M}=this;for(let x=0;x<80;x++){let f=lt(h,k,14)^lt(h,k,18)^Kt(h,k,41),g=ct(h,k,14)^ct(h,k,18)^zt(h,k,41),m=h&S^~h&E,b=k&T^~k&w,C=so(M,g,b,ku[x],Ze[x]),P=ao(C,L,f,m,Ru[x],Qe[x]),v=C|0,K=lt(n,i,28)^Kt(n,i,34)^Kt(n,i,39),Y=ct(n,i,28)^zt(n,i,34)^zt(n,i,39),ne=n&o^n&s^o&s,j=i&a^i&u^a&u;L=E|0,M=w|0,E=S|0,w=T|0,S=h|0,T=k|0,{h,l:k}=Pe(d|0,p|0,P|0,v|0),d=s|0,p=u|0,s=o|0,u=a|0,o=n|0,a=i|0;let ke=ro(v,Y,j);n=no(ke,P,K,ne),i=ke|0;}(({h:n,l:i}=Pe(this.Ah|0,this.Al|0,n|0,i|0))),{h:o,l:a}=Pe(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Pe(this.Ch|0,this.Cl|0,s|0,u|0),{h:d,l:p}=Pe(this.Dh|0,this.Dl|0,d|0,p|0),{h,l:k}=Pe(this.Eh|0,this.El|0,h|0,k|0),{h:S,l:T}=Pe(this.Fh|0,this.Fl|0,S|0,T|0),{h:E,l:w}=Pe(this.Gh|0,this.Gl|0,E|0,w|0),{h:L,l:M}=Pe(this.Hh|0,this.Hl|0,L|0,M|0),this.set(n,i,o,a,s,u,d,p,h,k,S,T,E,w,L,M);}roundClean(){je(Qe,Ze);}destroy(){this.destroyed=true,je(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);}},_r=class extends Rt{Ah=se[0]|0;Al=se[1]|0;Bh=se[2]|0;Bl=se[3]|0;Ch=se[4]|0;Cl=se[5]|0;Dh=se[6]|0;Dl=se[7]|0;Eh=se[8]|0;El=se[9]|0;Fh=se[10]|0;Fl=se[11]|0;Gh=se[12]|0;Gl=se[13]|0;Hh=se[14]|0;Hl=se[15]|0;constructor(){super(64);}},Cr=class extends Rt{Ah=oe[0]|0;Al=oe[1]|0;Bh=oe[2]|0;Bl=oe[3]|0;Ch=oe[4]|0;Cl=oe[5]|0;Dh=oe[6]|0;Dl=oe[7]|0;Eh=oe[8]|0;El=oe[9]|0;Fh=oe[10]|0;Fl=oe[11]|0;Gh=oe[12]|0;Gl=oe[13]|0;Hh=oe[14]|0;Hl=oe[15]|0;constructor(){super(48);}},le=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ce=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),Tr=class extends Rt{Ah=le[0]|0;Al=le[1]|0;Bh=le[2]|0;Bl=le[3]|0;Ch=le[4]|0;Cl=le[5]|0;Dh=le[6]|0;Dl=le[7]|0;Eh=le[8]|0;El=le[9]|0;Fh=le[10]|0;Fl=le[11]|0;Gh=le[12]|0;Gl=le[13]|0;Hh=le[14]|0;Hl=le[15]|0;constructor(){super(28);}},Ar=class extends Rt{Ah=ce[0]|0;Al=ce[1]|0;Bh=ce[2]|0;Bl=ce[3]|0;Ch=ce[4]|0;Cl=ce[5]|0;Dh=ce[6]|0;Dl=ce[7]|0;Eh=ce[8]|0;El=ce[9]|0;Fh=ce[10]|0;Fl=ce[11]|0;Gh=ce[12]|0;Gl=ce[13]|0;Hh=ce[14]|0;Hl=ce[15]|0;constructor(){super(32);}},_u=at(()=>new Rr,ut(1)),Cu=at(()=>new kr,ut(4)),Tu=at(()=>new _r,ut(3)),Au=at(()=>new Cr,ut(2)),Iu=at(()=>new Ar,ut(6)),Mu=at(()=>new Tr,ut(5));});var co={};jt(co,{_HMAC:()=>Gt,hmac:()=>Lu});var Gt,Lu,po=qe(()=>{wr();Gt=class{oHash;iHash;blockLen;outputLen;canXOF=false;finished=false;destroyed=false;constructor(e,r){if(Xi(e),Wt(r,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),je(i);}update(e){return xt(this),this.iHash.update(e),this}digestInto(e){xt(this),yr(e,this),this.finished=true;let r=e.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy();}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:s}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=a,e.outputLen=s,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=true,this.oHash.destroy(),this.iHash.destroy();}},Lu=(()=>{let t=((e,r,n)=>new Gt(e,r).update(n).digest());return t.create=(e,r)=>new Gt(e,r),t})();});function rd(t){let e=(t??"").toLowerCase().split(/[-_]/)[0];return zc.includes(e)?e:"en"}function yt(t="en"){return td[rd(t)]}function ar(t,e={}){return t.replace(/\{(\w+)\}/g,(r,n)=>{let i=e[n];return i==null?"":String(i)})}function nd(t){return Kc.includes(t)}function id(t){let e=(t.user_category??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return e==="feature"||e==="feature_request"||e==="idea"}function Pt(t,e="en"){let r=yt(e),n=(t.status??"").trim(),i=nd(n)?Gc[n]:"received",o=t.fixed_in_version?.trim()||null;(n==="fixed"||n==="resolved")&&o&&(i="fixed_version"),(t.awaiting_reporter||t.awaiting_reporter_at)&&Gs.has(i)&&(i="waiting");let s=id(t),u=r.status[i],d=r.detail[i];s&&(i==="received"?u=r.idea.received:i==="reviewing"||i==="reviewing_again"?u=r.idea.reviewing:i==="fixing"?u=r.idea.fixing:i==="fixed_version"?u=r.idea.shippedVersion:(i==="fixed_next"||i==="fixed")&&(u=r.idea.shipped));let p=t.closed_reason??null;i==="closed"&&(d=p&&p!=="spam"&&p in r.closedReason?r.closedReason[p]:r.closedReason.none);let h=t.group_bucket??"none",k=Gs.has(i)||i==="waiting"?h==="few"?r.others.few:h==="many"?r.others.many:null:null;return {key:i,label:ar(u,{version:o}),tone:Yc[i],detail:ar(d,{version:o}),canVerify:i==="fixed_next"||i==="fixed_version"||i==="fixed",othersNote:k,hidden:i==="closed"&&p==="spam"}}function od(t,e={},r="en"){let n=yt(r);if(t==="comment")return e.text??"";if(t==="closed"){let i=e.closed_reason??"";return i&&i!=="spam"&&i in n.closedReason?n.closedReason[i]:n.closedReason.none}return t==="reporter_comment"?e.text??n.timeline.reporter_comment:ar(n.timeline[t],{text:e.text,version:e.version})}function Kn(t){return t.kind==="comment"||t.kind==="reporter_comment"||t.kind==="info_requested"}function Ys(t,e="en"){return t.custom||!Xc.includes(t.kind)?t.text:od(t.kind,{text:t.body??null,version:t.version??null,closed_reason:t.closed_reason??null},e)}function Xs(t,e="en"){let r=yt(e).ui,n=t.unread_total===1?t.latest[0]?.kind:null;return n==="comment"||n==="info_requested"?r.toastReplied:n==="fixed"||n==="released"?r.toastFixed:r.updates.replace("{n}",String(t.unread_total))}function Js(t){return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(t.trim())}var Kc,zc,Gc,Yc,Xc,Jc,Qc,Zc,ed,td,Gs,Vr=qe(()=>{Kc=["new","pending","submitted","queued","classified","grouped","fixing","fixed","dismissed","triaged","in_progress","resolved","verified","reopened"],zc=["en","ja","es","th"],Gc={new:"received",pending:"received",submitted:"received",queued:"received",classified:"reviewing",triaged:"reviewing",grouped:"reviewing",reopened:"reviewing_again",fixing:"fixing",in_progress:"fixing",verified:"verified",fixed:"fixed_next",resolved:"fixed",dismissed:"closed"},Yc={received:"neutral",reviewing:"info",reviewing_again:"info",fixing:"progress",verified:"success-muted",fixed_next:"success",fixed_version:"success",fixed:"success",closed:"muted",waiting:"attention"},Xc=["received","reviewing","duplicate_linked","info_requested","comment","reporter_comment","fix_started","fixed","released","verified","reopened","closed"],Jc={status:{received:"Received",reviewing:"Looking into it",reviewing_again:"Looking into it again",fixing:"Fix in progress",verified:"Confirmed fixed",fixed_next:"Fixed \u2014 coming in the next update",fixed_version:"Fixed in v{version}",fixed:"Fixed",closed:"Closed",waiting:"Waiting on you"},detail:{received:"We got it.",reviewing:"The developer has it on their list.",reviewing_again:"Thanks \u2014 we reopened it.",fixing:"A fix is being worked on.",verified:"You confirmed the fix. Thank you!",fixed_next:"It ships in the next release.",fixed_version:"Update to v{version}. Does it work for you now?",fixed:"Does it work for you now?",closed:"Closed.",waiting:"The developer asked a question \u2014 reply below."},idea:{received:"Thanks for the idea",reviewing:"Under consideration",fixing:"Being built",shipped:"Shipped",shippedVersion:"Shipped in v{version}"},closedReason:{duplicate:"Same as an earlier report \u2014 we'll update you there.",not_reproducible:"We couldn't reproduce it. Reply if it happens again.",wont_fix:"We decided not to change this.",working_as_intended:"This is expected behaviour.",none:"Closed."},others:{few:"You and a few others reported this",many:"Many people reported this"},timeline:{received:"You reported this",reviewing:"The developer is looking into it",duplicate_linked:"Same as an existing report \u2014 we'll update you there",info_requested:"The developer asked: {text}",reporter_comment:"You",fix_started:"A fix is in progress",fixed:"Fixed \u2014 coming in the next update",released:"Shipped in v{version} \u2014 update to get it",verified:"You confirmed it's fixed",reopened:"Reopened"},categories:{bug:"Bug",slow:"Slow",visual:"Looks wrong",confusing:"Confusing",idea:"Idea"},ui:{yes:"Yes",notYet:"Not yet",empty:"Nothing yet \u2014 your reports will show up here with updates.",loadError:"Couldn't load updates",retry:"Retry",sending:"Sending\u2026",sent:"Sent",sendFailed:"Failed",noReplies:"No developer replies yet.",you:"You",developer:"Developer",addWords:"Add a few words",developerReplied:"Developer replied: \u201C{text}\u201D",updates:"{n} updates on your reports",receipt:"Sent. We'll let you know here when there's news.",trackIt:"Track it",done:"Done",emailOptIn:"Get updates by email",emailPlaceholder:"you@example.com",emailSubmit:"Email me updates",emailCheckInbox:"Check your inbox and tap the link to confirm.",emailInvalid:"That does not look like an email address.",emailFailed:"Couldn't set up email updates. Try again later.",toastReplied:"The developer replied to your report",toastFixed:"Your bug is fixed",view:"View"}},Qc={status:{received:"\u53D7\u3051\u4ED8\u3051\u307E\u3057\u305F",reviewing:"\u78BA\u8A8D\u4E2D",reviewing_again:"\u518D\u78BA\u8A8D\u4E2D",fixing:"\u4FEE\u6B63\u4E2D",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u6E08\u307F",fixed_next:"\u4FEE\u6B63\u6E08\u307F \u2014 \u6B21\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u53CD\u6620",fixed_version:"v{version} \u3067\u4FEE\u6B63\u6E08\u307F",fixed:"\u4FEE\u6B63\u6E08\u307F",closed:"\u7D42\u4E86",waiting:"\u3042\u306A\u305F\u306E\u8FD4\u4FE1\u5F85\u3061"},detail:{received:"\u5831\u544A\u3092\u53D7\u3051\u53D6\u308A\u307E\u3057\u305F\u3002",reviewing:"\u958B\u767A\u8005\u304C\u5BFE\u5FDC\u30EA\u30B9\u30C8\u306B\u5165\u308C\u307E\u3057\u305F\u3002",reviewing_again:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002\u518D\u5EA6\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059\u3002",fixing:"\u4FEE\u6B63\u306B\u53D6\u308A\u7D44\u3093\u3067\u3044\u307E\u3059\u3002",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u3044\u305F\u3060\u304D\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01",fixed_next:"\u6B21\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u53CD\u6620\u3055\u308C\u307E\u3059\u3002",fixed_version:"v{version} \u306B\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u89E3\u6C7A\u3057\u307E\u3057\u305F\u304B\uFF1F",fixed:"\u89E3\u6C7A\u3057\u307E\u3057\u305F\u304B\uFF1F",closed:"\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002",waiting:"\u958B\u767A\u8005\u304B\u3089\u8CEA\u554F\u304C\u3042\u308A\u307E\u3059\u3002\u4E0B\u304B\u3089\u8FD4\u4FE1\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},idea:{received:"\u30A2\u30A4\u30C7\u30A2\u3092\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059",reviewing:"\u691C\u8A0E\u4E2D",fixing:"\u958B\u767A\u4E2D",shipped:"\u30EA\u30EA\u30FC\u30B9\u6E08\u307F",shippedVersion:"v{version} \u3067\u30EA\u30EA\u30FC\u30B9\u6E08\u307F"},closedReason:{duplicate:"\u4EE5\u524D\u306E\u5831\u544A\u3068\u540C\u3058\u5185\u5BB9\u3067\u3059\u3002\u305D\u3061\u3089\u3067\u9032\u6357\u3092\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002",not_reproducible:"\u518D\u73FE\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u767A\u3057\u305F\u3089\u8FD4\u4FE1\u3057\u3066\u304F\u3060\u3055\u3044\u3002",wont_fix:"\u3053\u306E\u70B9\u306F\u5909\u66F4\u3057\u306A\u3044\u3053\u3068\u306B\u3057\u307E\u3057\u305F\u3002",working_as_intended:"\u3053\u308C\u306F\u60F3\u5B9A\u3069\u304A\u308A\u306E\u52D5\u4F5C\u3067\u3059\u3002",none:"\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002"},others:{few:"\u3042\u306A\u305F\u3092\u542B\u3081\u6570\u4EBA\u304C\u5831\u544A\u3057\u3066\u3044\u307E\u3059",many:"\u591A\u304F\u306E\u4EBA\u304C\u5831\u544A\u3057\u3066\u3044\u307E\u3059"},timeline:{received:"\u3042\u306A\u305F\u304C\u5831\u544A\u3057\u307E\u3057\u305F",reviewing:"\u958B\u767A\u8005\u304C\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059",duplicate_linked:"\u65E2\u5B58\u306E\u5831\u544A\u3068\u540C\u3058\u5185\u5BB9\u3067\u3059\u3002\u305D\u3061\u3089\u3067\u9032\u6357\u3092\u304A\u77E5\u3089\u305B\u3057\u307E\u3059",info_requested:"\u958B\u767A\u8005\u304B\u3089\u306E\u8CEA\u554F: {text}",reporter_comment:"\u3042\u306A\u305F",fix_started:"\u4FEE\u6B63\u4E2D\u3067\u3059",fixed:"\u4FEE\u6B63\u6E08\u307F \u2014 \u6B21\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u53CD\u6620",released:"v{version} \u3067\u30EA\u30EA\u30FC\u30B9 \u2014 \u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u3057\u307E\u3057\u305F",reopened:"\u518D\u30AA\u30FC\u30D7\u30F3\u3057\u307E\u3057\u305F"},categories:{bug:"\u30D0\u30B0",slow:"\u9045\u3044",visual:"\u8868\u793A\u304C\u304A\u304B\u3057\u3044",confusing:"\u308F\u304B\u308A\u306B\u304F\u3044",idea:"\u30A2\u30A4\u30C7\u30A2"},ui:{yes:"\u306F\u3044",notYet:"\u307E\u3060",empty:"\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002\u5831\u544A\u3059\u308B\u3068\u3053\u3053\u306B\u9032\u6357\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002",loadError:"\u66F4\u65B0\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",retry:"\u518D\u8A66\u884C",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"\u9001\u4FE1\u3057\u307E\u3057\u305F",sendFailed:"\u9001\u4FE1\u5931\u6557",noReplies:"\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",you:"\u3042\u306A\u305F",developer:"\u958B\u767A\u8005",addWords:"\u3082\u3046\u5C11\u3057\u8A73\u3057\u304F\u66F8\u3044\u3066\u304F\u3060\u3055\u3044",developerReplied:"\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1:\u300C{text}\u300D",updates:"\u3042\u306A\u305F\u306E\u5831\u544A\u306B {n} \u4EF6\u306E\u66F4\u65B0\u304C\u3042\u308A\u307E\u3059",receipt:"\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002\u9032\u5C55\u304C\u3042\u308C\u3070\u3053\u3053\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002",trackIt:"\u7D4C\u904E\u3092\u898B\u308B",done:"\u9589\u3058\u308B",emailOptIn:"\u30E1\u30FC\u30EB\u3067\u66F4\u65B0\u3092\u53D7\u3051\u53D6\u308B",emailPlaceholder:"you@example.com",emailSubmit:"\u30E1\u30FC\u30EB\u3067\u53D7\u3051\u53D6\u308B",emailCheckInbox:"\u53D7\u4FE1\u30C8\u30EC\u30A4\u306E\u30E1\u30FC\u30EB\u306E\u30EA\u30F3\u30AF\u3092\u30BF\u30C3\u30D7\u3057\u3066\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",emailInvalid:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002",emailFailed:"\u30E1\u30FC\u30EB\u901A\u77E5\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",toastReplied:"\u958B\u767A\u8005\u304C\u3042\u306A\u305F\u306E\u5831\u544A\u306B\u8FD4\u4FE1\u3057\u307E\u3057\u305F",toastFixed:"\u3042\u306A\u305F\u304C\u5831\u544A\u3057\u305F\u4E0D\u5177\u5408\u304C\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F",view:"\u898B\u308B"}},Zc={status:{received:"Recibido",reviewing:"Lo estamos revisando",reviewing_again:"Lo revisamos de nuevo",fixing:"Correcci\xF3n en curso",verified:"Correcci\xF3n confirmada",fixed_next:"Corregido \u2014 llega en la pr\xF3xima actualizaci\xF3n",fixed_version:"Corregido en v{version}",fixed:"Corregido",closed:"Cerrado",waiting:"Esperando tu respuesta"},detail:{received:"Lo recibimos.",reviewing:"El desarrollador lo tiene en su lista.",reviewing_again:"Gracias, lo reabrimos.",fixing:"Se est\xE1 trabajando en una correcci\xF3n.",verified:"Confirmaste la correcci\xF3n. \xA1Gracias!",fixed_next:"Llega en la pr\xF3xima versi\xF3n.",fixed_version:"Actualiza a v{version}. \xBFYa funciona?",fixed:"\xBFYa funciona?",closed:"Cerrado.",waiting:"El desarrollador hizo una pregunta: responde abajo."},idea:{received:"Gracias por la idea",reviewing:"En consideraci\xF3n",fixing:"En desarrollo",shipped:"Publicado",shippedVersion:"Publicado en v{version}"},closedReason:{duplicate:"Es igual a un reporte anterior; te avisaremos all\xED.",not_reproducible:"No pudimos reproducirlo. Responde si vuelve a pasar.",wont_fix:"Decidimos no cambiar esto.",working_as_intended:"Este es el comportamiento esperado.",none:"Cerrado."},others:{few:"T\xFA y algunas personas m\xE1s reportaron esto",many:"Muchas personas reportaron esto"},timeline:{received:"Reportaste esto",reviewing:"El desarrollador lo est\xE1 revisando",duplicate_linked:"Es igual a un reporte existente; te avisaremos all\xED",info_requested:"El desarrollador pregunt\xF3: {text}",reporter_comment:"T\xFA",fix_started:"Hay una correcci\xF3n en curso",fixed:"Corregido \u2014 llega en la pr\xF3xima actualizaci\xF3n",released:"Publicado en v{version}: actualiza para tenerlo",verified:"Confirmaste que est\xE1 corregido",reopened:"Reabierto"},categories:{bug:"Error",slow:"Lento",visual:"Se ve mal",confusing:"Confuso",idea:"Idea"},ui:{yes:"S\xED",notYet:"Todav\xEDa no",empty:"Nada todav\xEDa: tus reportes aparecer\xE1n aqu\xED con novedades.",loadError:"No se pudieron cargar las novedades",retry:"Reintentar",sending:"Enviando\u2026",sent:"Enviado",sendFailed:"Error al enviar",noReplies:"El desarrollador a\xFAn no ha respondido.",you:"T\xFA",developer:"Desarrollador",addWords:"Agrega algunas palabras",developerReplied:"El desarrollador respondi\xF3: \u201C{text}\u201D",updates:"{n} novedades en tus reportes",receipt:"Enviado. Te avisaremos aqu\xED cuando haya novedades.",trackIt:"Seguirlo",done:"Listo",emailOptIn:"Recibir novedades por correo",emailPlaceholder:"tu@ejemplo.com",emailSubmit:"Enviarme novedades",emailCheckInbox:"Revisa tu correo y toca el enlace para confirmar.",emailInvalid:"Eso no parece un correo electr\xF3nico.",emailFailed:"No pudimos activar las novedades por correo. Int\xE9ntalo m\xE1s tarde.",toastReplied:"El desarrollador respondi\xF3 a tu reporte",toastFixed:"Tu error est\xE1 corregido",view:"Ver"}},ed={status:{received:"\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E41\u0E25\u0E49\u0E27",reviewing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A",reviewing_again:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E27\u0E48\u0E32\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",fixed_next:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27 \u2014 \u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E16\u0E31\u0E14\u0E44\u0E1B",fixed_version:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27\u0E43\u0E19 v{version}",fixed:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",closed:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27",waiting:"\u0E23\u0E2D\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E04\u0E38\u0E13"},detail:{received:"\u0E40\u0E23\u0E32\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E41\u0E25\u0E49\u0E27",reviewing:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E43\u0E2A\u0E48\u0E44\u0E27\u0E49\u0E43\u0E19\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E41\u0E25\u0E49\u0E27",reviewing_again:"\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13 \u2014 \u0E40\u0E23\u0E32\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E41\u0E25\u0E49\u0E27",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E04\u0E38\u0E13\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02\u0E41\u0E25\u0E49\u0E27 \u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13!",fixed_next:"\u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E23\u0E38\u0E48\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B",fixed_version:"\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E40\u0E1B\u0E47\u0E19 v{version} \u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E43\u0E0A\u0E49\u0E44\u0E14\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E22\u0E31\u0E07?",fixed:"\u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E43\u0E0A\u0E49\u0E44\u0E14\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E22\u0E31\u0E07?",closed:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27",waiting:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E21\u0E35\u0E04\u0E33\u0E16\u0E32\u0E21 \u2014 \u0E15\u0E2D\u0E1A\u0E14\u0E49\u0E32\u0E19\u0E25\u0E48\u0E32\u0E07"},idea:{received:"\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22",reviewing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E1E\u0E34\u0E08\u0E32\u0E23\u0E13\u0E32",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E23\u0E49\u0E32\u0E07",shipped:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",shippedVersion:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27\u0E43\u0E19 v{version}"},closedReason:{duplicate:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E01\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32 \u2014 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E19\u0E31\u0E48\u0E19",not_reproducible:"\u0E40\u0E23\u0E32\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E40\u0E01\u0E34\u0E14\u0E0B\u0E49\u0E33\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A\u0E2B\u0E32\u0E01\u0E40\u0E01\u0E34\u0E14\u0E02\u0E36\u0E49\u0E19\u0E2D\u0E35\u0E01",wont_fix:"\u0E40\u0E23\u0E32\u0E15\u0E31\u0E14\u0E2A\u0E34\u0E19\u0E43\u0E08\u0E44\u0E21\u0E48\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E2A\u0E48\u0E27\u0E19\u0E19\u0E35\u0E49",working_as_intended:"\u0E19\u0E35\u0E48\u0E40\u0E1B\u0E47\u0E19\u0E01\u0E32\u0E23\u0E17\u0E33\u0E07\u0E32\u0E19\u0E15\u0E32\u0E21\u0E17\u0E35\u0E48\u0E15\u0E31\u0E49\u0E07\u0E43\u0E08\u0E44\u0E27\u0E49",none:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27"},others:{few:"\u0E04\u0E38\u0E13\u0E41\u0E25\u0E30\u0E2D\u0E35\u0E01\u0E44\u0E21\u0E48\u0E01\u0E35\u0E48\u0E04\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",many:"\u0E21\u0E35\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49"},timeline:{received:"\u0E04\u0E38\u0E13\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",reviewing:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A",duplicate_linked:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E01\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48 \u2014 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E19\u0E31\u0E48\u0E19",info_requested:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E16\u0E32\u0E21\u0E27\u0E48\u0E32: {text}",reporter_comment:"\u0E04\u0E38\u0E13",fix_started:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02",fixed:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27 \u2014 \u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E16\u0E31\u0E14\u0E44\u0E1B",released:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E43\u0E19 v{version} \u2014 \u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E04\u0E38\u0E13\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E27\u0E48\u0E32\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",reopened:"\u0E40\u0E1B\u0E34\u0E14\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"},categories:{bug:"\u0E1A\u0E31\u0E4A\u0E01",slow:"\u0E0A\u0E49\u0E32",visual:"\u0E41\u0E2A\u0E14\u0E07\u0E1C\u0E25\u0E1C\u0E34\u0E14",confusing:"\u0E2A\u0E31\u0E1A\u0E2A\u0E19",idea:"\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22"},ui:{yes:"\u0E43\u0E0A\u0E48",notYet:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48",empty:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35 \u2014 \u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E08\u0E30\u0E41\u0E2A\u0E14\u0E07\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32",loadError:"\u0E42\u0E2B\u0E25\u0E14\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49",retry:"\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",sending:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",sent:"\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27",sendFailed:"\u0E2A\u0E48\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",noReplies:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32",you:"\u0E04\u0E38\u0E13",developer:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32",addWords:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E2D\u0E35\u0E01\u0E40\u0E25\u0E47\u0E01\u0E19\u0E49\u0E2D\u0E22",developerReplied:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E15\u0E2D\u0E1A\u0E27\u0E48\u0E32: \u201C{text}\u201D",updates:"\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32 {n} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E43\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",receipt:"\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E38\u0E13\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32",trackIt:"\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21",done:"\u0E40\u0E2A\u0E23\u0E47\u0E08",emailOptIn:"\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25",emailPlaceholder:"you@example.com",emailSubmit:"\u0E2A\u0E48\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25",emailCheckInbox:"\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E25\u0E48\u0E2D\u0E07\u0E08\u0E14\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E25\u0E49\u0E27\u0E41\u0E15\u0E30\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19",emailInvalid:"\u0E14\u0E39\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E08\u0E30\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",emailFailed:"\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 \u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E20\u0E32\u0E22\u0E2B\u0E25\u0E31\u0E07",toastReplied:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E41\u0E25\u0E49\u0E27",toastFixed:"\u0E1A\u0E31\u0E4A\u0E01\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02\u0E41\u0E25\u0E49\u0E27",view:"\u0E14\u0E39"}},td={en:Jc,ja:Qc,es:Zc,th:ed};Gs=new Set(["received","reviewing","reviewing_again","fixing"]);});var ba={};jt(ba,{accountView:()=>Ld,assistantView:()=>Ad,crossAppView:()=>Pd,detailView:()=>Td,initViews:()=>vd,leaderboardView:()=>Md,pickUpdateToast:()=>wd,renderOptIns:()=>ma,reportsView:()=>kd,roadmapView:()=>Id});function vd(t){({esc:_,btn:pe,renderHeader:$e,chipLabel:ha,skeleton:Dt,formatRelativeTime:ur,renderAppIconHtml:fa}=t);}function wd(t,e,r){let n=t.filter(d=>(d.unread_count??0)>0&&!Pt(d,e).hidden),i=n.reduce((d,p)=>d+(p.unread_count??0),0);if(!i)return null;if(n.length>1)return {text:ar(yt(e).ui.updates,{n:i}),reportId:null};let o=n[0],a=Pt(o,e),s=a.key==="fixing"||a.canVerify||!o.last_admin_reply_at&&a.key!=="waiting",u=o.title??o.summary??void 0;return {text:s?a.label:r,reportId:o.id,...u?{detail:u}:{}}}function ma(t){let e=t.locale.panel,r=[];if(t.channels.email&&t.callbacks.onReporterEmailOptIn){let n=t.rc.ui;t.emailState==="saved"?r.push(`<p class="mushi-note" role="status">\u2709 ${_(n.emailCheckInbox)}</p>`):(r.push(`<label class="mushi-check"><input type="checkbox" data-action="email-optin"${t.emailOptInOpen?" checked":""} /> ${_(n.emailOptIn)}</label>`),t.emailOptInOpen&&r.push(`<div class="mushi-inline-form"><input type="email" class="mushi-input" data-role="optin-email" autocomplete="email" aria-label="${_(n.emailOptIn)}" placeholder="${_(n.emailPlaceholder)}" value="${_(t.channels.emailPrefill)}" />${pe("save-email",_(n.emailSubmit),"mushi-btn",t.emailState==="saving"?' aria-busy="true"':"")}</div>${t.emailState==="invalid"||t.emailState==="error"?`<p class="mushi-note mushi-error-inline" role="alert">${_(t.emailState==="invalid"?n.emailInvalid:n.emailFailed)}</p>`:""}`));}return t.channels.push&&t.callbacks.onReporterPushSubscribe&&(r.push(t.pushState==="on"?`<p class="mushi-note" role="status">\u{1F514} ${_(e.notifyOn)}</p>`:pe("notify-me",`\u{1F514} ${_(e.notifyMe)}`,"mushi-btn",t.pushState==="asking"?' aria-busy="true"':"")),t.pushState==="error"&&r.push(`<p class="mushi-note mushi-error-inline" role="alert">${_(t.rc.ui.sendFailed)}</p>`)),r.length?`<div class="mushi-optins">${r.join("")}</div>`:""}function Xn(t,e){return `<span class="mushi-pill mushi-tone-${e}">${_(t)}</span>`}function ga(t){return t.title??t.summary??t.description??`#${t.id.slice(0,8)}`}function Sd(t,e){let r=(e??"").toLowerCase();return !r||r==="other"?"":ha(t,r==="feature_request"?"idea":r)}function xd(t){let e=r=>Date.parse(r.last_event_at??r.created_at)||0;return [...t].sort((r,n)=>+((n.unread_count??0)>0)-+((r.unread_count??0)>0)||e(n)-e(r))}function Rd(t,e){let r=Pt(e,t.lang);if(r.hidden)return "";let n=(e.unread_count??0)>0,i=[Sd(t,e.user_category),e.page,r.othersNote].filter(Boolean).map(s=>_(String(s))).join(" \xB7 "),o=e.last_event_preview&&(n||r.key==="waiting")?t.rc.ui.developerReplied.replace("{text}",e.last_event_preview):r.canVerify&&r.key!=="fixed_next"?r.detail:"",a=ga(e);return `<button type="button" class="mushi-report-row${n?" unread":""}" data-report-id="${_(e.id)}" aria-label="${_(`${r.label}: ${a}`)}"><span class="mushi-row-top">${Xn(r.label,r.tone)}<span class="mushi-row-title">${_(a)}</span><span class="mushi-row-when">${_(ur(e.last_event_at??e.created_at))}</span></span>${i?`<span class="mushi-row-meta">${i}</span>`:""}${o?`<span class="mushi-row-news">${_(o)}</span>`:""}</button>`}function kd(t){let e=t.rc,r=xd(t.reporterReports).map(i=>Rd(t,i)).join(""),n=t.reporterError?`<p class="mushi-error-inline" role="alert">${_(e.ui.loadError)} ${pe("retry-list",_(e.ui.retry),"mushi-link-btn")}</p>${r}`:r||(t.listLoading?Dt(t.locale.flows.reports.loading):`<p class="mushi-empty">${_(e.ui.empty)}</p>`);return {header:$e(t,t.locale.flows.reports.title,true),lead:"",body:`<div class="mushi-report-list">${n}</div>`,footer:""}}function _d(t,e){let r=t.rc,n=[];if(t.timeline)for(let i of t.timeline){let o=i.kind==="reporter_comment";n.push({kind:i.kind,at:i.at,text:Kn(i)?i.body??i.text:Ys(i,t.lang),talk:Kn(i),mine:o,who:o?r.ui.you:r.ui.developer});}else {e&&n.push({kind:"received",at:e.created_at,text:r.timeline.received});for(let i of t.reporterComments){let o=i.author_kind==="reporter";n.push({kind:o?"reporter_comment":"comment",at:i.created_at,text:i.body,talk:true,mine:o,who:o?r.ui.you:i.author_name??r.ui.developer});}}n.sort((i,o)=>(Date.parse(i.at)||0)-(Date.parse(o.at)||0));for(let i of t.pendingReplies)n.push({kind:"reporter_comment",at:"",text:i.body,who:r.ui.you,talk:true,mine:true,pending:i});return n}function Cd(t,e){let r=e.at?`<time datetime="${_(e.at)}">${_(ur(e.at))}</time>`:"";if(!e.talk)return `<li class="mushi-event"><span>${_(e.text)}</span>${r}</li>`;let n=!!e.mine,i=e.pending?e.pending.state==="sending"?`<span class="mushi-bubble-state">${_(t.rc.ui.sending)}</span>`:`<span class="mushi-bubble-state mushi-error-inline">${_(t.rc.ui.sendFailed)} \xB7 ${pe("retry-reply",_(t.rc.ui.retry),"mushi-link-btn",` data-value="${e.pending.id}"`)}</span>`:r;return `<li class="mushi-bubble ${n?"mine":"dev"}"><strong>${_(e.who??"")}</strong><p>${_(e.text)}</p>${i}</li>`}function Td(t){let e=t.rc,r=t.reporterReports.find(h=>h.id===t.selectedReportId),n=Pt(r??{status:"new"},t.lang),i=[r?.page,r?.app_version?`v${r.app_version}`:"",r?ur(r.created_at):""].filter(Boolean).map(h=>_(String(h))).join(" \xB7 "),o=`<div class="mushi-thread-summary"><p class="mushi-card-status">${Xn(n.label,n.tone)}</p><p class="mushi-note">${_(n.detail)}${n.othersNote?` ${_(n.othersNote)}.`:""}</p><p class="mushi-summary-text">${_(r?r.description??ga(r):`#${(t.selectedReportId??"").slice(0,8)}`)}</p>${r?.screenshot_thumb_url?`<img class="mushi-card-thumb" src="${_(r.screenshot_thumb_url)}" alt="" />`:""}${i?`<p class="mushi-note">${i}</p>`:""}</div>`,a=_d(t,r),s=a.some(h=>h.talk&&!h.mine),u;t.threadLoading&&a.length<=1&&!t.pendingReplies.length?u=Dt(t.locale.flows.thread.loading):u=`${t.threadError?`<p class="mushi-error-inline" role="alert">${_(e.ui.loadError)} ${pe("retry-thread",_(e.ui.retry),"mushi-link-btn")}</p>`:""}<ol class="mushi-timeline">${a.map(h=>Cd(t,h)).join("")}</ol>${!s&&!t.threadError&&!t.threadLoading?`<p class="mushi-empty">${_(e.ui.noReplies)}</p>`:""}`;let d=t.actionPending?' disabled aria-busy="true"':"",p=n.canVerify?`<div class="mushi-verify" role="group" aria-label="${_(n.detail)}">${pe("reporter-confirms",_(e.ui.yes),"mushi-btn",d)}${pe("reporter-not-fixed",_(e.ui.notYet),"mushi-btn",d)}</div>`:"";return {header:$e(t,t.locale.panel.reportTitle,true),lead:o,body:`<div class="mushi-thread">${u}</div>${ma(t)}`,footer:`${p}${t.actionError?`<p class="mushi-error-inline mushi-thread-action-error" role="alert">${_(t.actionError)}</p>`:""}<div class="mushi-thread-composer"><textarea class="mushi-input mushi-reply" data-role="reporter-reply" rows="1" maxlength="2000" placeholder="${_(t.locale.flows.thread.replyPlaceholder)}" aria-label="${_(t.locale.flows.thread.replyPlaceholder)}"></textarea>${pe("reporter-reply","\u2191","mushi-submit mushi-send",` aria-label="${_(t.locale.panel.send)}"`)}</div>`}}function Ad(t){let e=t.locale.assistant,r=t.callbacks.assistantGreeting||e.defaultGreeting,n=d=>d.length?`<div class="mushi-chips">${d.map(p=>`<button type="button" class="mushi-chip mushi-chip-sm" data-action="assistant-suggest" data-value="${_(p)}">${_(p)}</button>`).join("")}</div>`:"",i=(d,p="mushi-link-btn")=>pe("assistant-report",_(d),p),o=t.assistantTurns.length===0?`<p class="mushi-assistant-greeting">${_(r)}</p>${n(t.callbacks.assistantSuggestions??[])}`:t.assistantTurns.map(d=>`<div class="mushi-assistant-msg ${d.role==="user"?"mine":"dev"}">${_(d.text)}</div>${n(d.options??[])}${d.offerReport?i(e.fileReportCta,"mushi-btn"):""}`).join(""),a=t.assistantSending?`<div class="mushi-assistant-msg dev" role="status" aria-live="polite">${_(e.thinking)}</div>`:"",s=t.assistantError?`<p class="mushi-error-inline" role="alert">${_(t.assistantError)} ${i(e.fileReportCta)}</p>`:"",u=t.assistantTurns.length&&!t.assistantSending&&!t.assistantError?i(e.stillStuckCta):"";return {header:$e(t,t.callbacks.assistantLabel||e.defaultLabel,true),lead:"",body:`<div class="mushi-assistant-log">${o}${a}${s}${u}</div>`,footer:`<form class="mushi-thread-composer" data-action="assistant-send"><textarea class="mushi-input mushi-reply mushi-assistant-input" rows="1" placeholder="${_(e.inputPlaceholder)}" aria-label="${_(e.inputPlaceholder)}"${t.assistantSending?" disabled":""}></textarea><button type="submit" class="mushi-submit mushi-send" aria-label="${_(e.sendAriaLabel)}"${t.assistantSending?" disabled":""}>\u2191</button></form>`}}function Id(t){let e=t.locale.flows.roadmap,r=t.featureBoard.map(n=>{let i=String(n.id??""),o=!!n.my_vote,a=n.shipped_at?e.shipped:String(n.status_label??n.status??"open");return `<div class="mushi-report-row mushi-roadmap-row"><span class="mushi-row-top"><span class="mushi-row-title">${_(String(n.subject??e.untitled))}</span></span><span class="mushi-row-meta">${_(a)} \xB7 ${_(e.voteCount.replace("{n}",String(Number(n.vote_count??0))))}</span>${t.callbacks.onFeatureBoardVote?`<button type="button" class="mushi-btn" data-vote-id="${_(i)}" aria-pressed="${o}">${_(o?e.voted:e.vote)}</button>`:""}</div>`}).join("");return {header:$e(t,e.title,true),lead:"",body:`${t.reporterError?`<p class="mushi-error-inline" role="alert">${_(t.reporterError)}</p>`:""}${r||(t.listLoading?Dt(e.loading):`<p class="mushi-empty">${_(e.empty)}</p>`)}`,footer:""}}function Md(t){let e=t.locale.flows.leaderboard,r=t.globalLeaderboard!==null||t.globalLeaderboardLoading,n=r?t.globalLeaderboard??[]:t.leaderboardEntries??[],i=r?t.globalLeaderboardLoading:t.leaderboardLoading,o=n.map((s,u)=>{let d=s.rank||u+1;return `<li class="mushi-lb-row${t.testerReputation&&s.tester_id===t.testerReputation.tester_id?" me":""}"><span>#${d}</span><span class="mushi-row-title">${_(s.public_handle??s.display_name??e.anon)}</span><span>${(s.points_30d??s.total_points).toLocaleString()} pts</span></li>`}).join(""),a=t.testerReputation?.rank;return {header:$e(t,e.title,true),lead:"",body:`${i?Dt(e.loading):""}${!i&&!n.length?`<p class="mushi-empty">${_(e.empty)}</p>`:""}<ol class="mushi-lb">${o}</ol>${a?`<p class="mushi-note">${_(e.myRank.replace("{rank}",String(a)))}</p>`:t.testerJwt?"":pe("open-account",_(e.signInPrompt),"mushi-link-btn")}<p class="mushi-note">${_(e.footer)}</p>`,footer:""}}function Ld(t){let e=t.locale.flows.account,r=t.testerInfo;if(r){let n=r.public_handle??r.display_name??t.locale.flows.leaderboard.anon,i=t.testerReputation,o=i?e.rankSummary.replace("{rank}",String(i.rank??"\u2014")).replace("{points}",(i.points_30d??0).toLocaleString()):"";return {header:$e(t,e.title,true),lead:"",body:`<div class="mushi-thread-summary"><p class="mushi-summary-text">${_(n)}</p>${o?`<p class="mushi-note">${_(o)}</p>`:""}</div>${pe("open-cross-app-reports",_(e.crossAppReports),"mushi-menu-item")}${pe("open-global-leaderboard",_(e.viewLeaderboard),"mushi-menu-item")}${pe("sign-out-tester",_(e.signOut),"mushi-link-btn")}`,footer:""}}return t.magicLinkSent?{header:$e(t,e.checkEmailTitle,true),lead:"",body:`<p class="mushi-note">${_(e.magicLinkSent.replace("{email}",t.magicLinkEmail))}</p>${pe("resend-magic-link",_(e.resendEmail),"mushi-link-btn")}${t.magicLinkError?`<p class="mushi-error-inline" role="alert">${_(t.magicLinkError)}</p>`:""}`,footer:""}:{header:$e(t,e.joinTitle,true),lead:"",body:`<p class="mushi-note">${_(e.signInPrompt)}</p><input type="email" class="mushi-input" data-role="magic-link-email" aria-label="${_(e.emailLabel)}" placeholder="${_(e.emailPlaceholder)}" autocomplete="email" value="${_(t.magicLinkEmail)}" />${t.magicLinkError?`<p class="mushi-error-inline" role="alert">${_(t.magicLinkError)}</p>`:""}`,footer:`<span></span>${pe("send-magic-link",_(t.magicLinkSending?e.sending:e.sendLink),"mushi-submit",t.magicLinkSending?' aria-busy="true"':"")}`}}function Pd(t){let e=t.locale.flows.crossApp,r=t.crossAppReports??[],n=new Map;for(let o of r){let a=o.project_id??"unknown";n.has(a)||n.set(a,{name:o.app_name??e.unknownApp,slug:o.app_slug??null,domain:o.app_domain??null,reports:[]}),n.get(a).reports.push(o);}let i=[...n.entries()].map(([o,a])=>`<section class="mushi-xapp-group"><h3 class="mushi-xapp-app-name">${fa({projectId:o,appName:a.name,appSlug:a.slug,appDomain:a.domain})} ${_(a.name)}</h3>${a.reports.map(s=>{let u=Pt(s,t.lang);return `<div class="mushi-report-row"><span class="mushi-row-top">${Xn(u.label,u.tone)}<span class="mushi-row-title">${_(s.title??`#${s.short_id??s.id.slice(0,8)}`)}</span><span class="mushi-row-when">${_(ur(s.created_at))}</span></span></div>`}).join("")}</section>`).join("");return {header:$e(t,e.title,true),lead:"",body:`${t.crossAppLoading?Dt(e.loading):""}${!t.crossAppLoading&&!r.length?`<p class="mushi-empty">${_(e.empty)}</p>`:""}${i}`,footer:""}}var _,pe,$e,ha,Dt,ur,fa,Ea=qe(()=>{Vr();});var ou={};jt(ou,{grabMaskedTabFrame:()=>jp});async function jp(t,e){let r=await t,n=r.getVideoTracks?.()[0]?.getSettings?.().displaySurface;if(n&&n!=="browser")throw r.getTracks().forEach(s=>s.stop()),Object.assign(new Error("Only this tab can be captured"),{name:"NotAllowedError"});let i=e.join(","),o=document.createElement("style");o.setAttribute("data-mushi-capture-mask",""),o.textContent=`:is(${i}){background:#000!important;color:transparent!important;-webkit-text-fill-color:transparent!important;text-shadow:none!important}:is(${i}) *{visibility:hidden!important}`,document.head.appendChild(o);let a=document.createElement("video");try{a.muted=!0,a.srcObject=r,await a.play(),await new Promise(u=>setTimeout(u,150));let s=document.createElement("canvas");return s.width=a.videoWidth,s.height=a.videoHeight,s.getContext("2d")?.drawImage(a,0,0),s.toDataURL("image/jpeg",.7)}finally{r.getTracks().forEach(s=>s.stop()),a.srcObject=null,o.remove();}}var su=qe(()=>{});var au={};jt(au,{createScreenshotAnnotation:()=>Wp});function Wp(t,e){return new Promise((r,n)=>{let i=new Image;i.onload=()=>{let o=document.createElement("div");o.style.position="relative",o.style.display="inline-block",o.style.maxWidth="100%";let a=document.createElement("canvas"),s=document.createElement("canvas"),u=Math.min(1,720/i.width),d=Math.round(i.width*u),p=Math.round(i.height*u);for(let g of [a,s])g.width=d,g.height=p,g.style.width="100%",g.style.height="auto",g.style.display="block";s.style.position="absolute",s.style.left="0",s.style.top="0",s.style.cursor="crosshair";let h=a.getContext("2d"),k=s.getContext("2d");if(!h||!k){n(new Error("Canvas not supported"));return}h.drawImage(i,0,0,d,p),o.appendChild(a),o.appendChild(s),e.appendChild(o);let S="highlight",T=false,E=null,w=[],L=g=>{let m=s.getBoundingClientRect(),b="touches"in g?g.touches[0]??g.changedTouches[0]:null,C=b?b.clientX:g.clientX,P=b?b.clientY:g.clientY;return {x:(C-m.left)/m.width*d,y:(P-m.top)/m.height*p}},M=()=>{k.clearRect(0,0,d,p);for(let g of w)if(g.tool==="highlight"&&g.points.length>=2){let[m,b]=g.points;k.fillStyle="rgba(255, 230, 0, 0.35)",k.fillRect(Math.min(m.x,b.x),Math.min(m.y,b.y),Math.abs(b.x-m.x),Math.abs(b.y-m.y));}else if(g.tool==="arrow"&&g.points.length>=2){let[m,b]=g.points;k.strokeStyle="#ef4444",k.lineWidth=3,k.beginPath(),k.moveTo(m.x,m.y),k.lineTo(b.x,b.y),k.stroke();}},x=g=>{T=true,E=L(g);},f=g=>{if(!T||!E)return;T=false;let m=L(g);if(S==="blur"){let b=Math.min(E.x,m.x),C=Math.min(E.y,m.y),P=Math.abs(m.x-E.x),v=Math.abs(m.y-E.y);P>=1&&v>=1&&(h.filter="blur(8px)",h.drawImage(a,b,C,P,v,b,C,P,v),h.filter="none");}else w.push({tool:S,points:[E,m]});E=null,M();};s.addEventListener("mousedown",x),s.addEventListener("mouseup",f),s.addEventListener("touchstart",x,{passive:true}),s.addEventListener("touchend",f),r({canvas:a,setTool(g){S=g;},getDataUrl(){let g=document.createElement("canvas");g.width=d,g.height=p;let m=g.getContext("2d");return m?(m.drawImage(a,0,0),m.drawImage(s,0,0),g.toDataURL("image/jpeg",.85)):t},destroy(){s.removeEventListener("mousedown",x),s.removeEventListener("mouseup",f),s.removeEventListener("touchstart",x),s.removeEventListener("touchend",f),o.remove();}});},i.onerror=()=>n(new Error("Failed to load screenshot")),i.src=t;})}var uu=qe(()=>{});var Pu=4194304,Lo=1.5*1024*1024;function Du(t){try{return JSON.stringify(t)}catch{return null}}function $u(t,e=Pu){let r=Du(t);if(r===null)return {ok:false,bytes:0,maxBytes:e,serializeFailed:true,reason:"Report could not be serialized (circular reference in metadata?)"};let n=new TextEncoder().encode(r).length;return n<=e?{ok:true,bytes:n,maxBytes:e}:{ok:false,bytes:n,maxBytes:e,reason:`Report payload ${ho(n)} exceeds limit ${ho(e)}`}}function ho(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function Po(){try{let r=globalThis.crypto?.subtle;if(r&&typeof r.digest=="function"&&typeof r.importKey=="function"&&typeof r.sign=="function")return r}catch{}return null}function $r(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}async function nr(t){let e=Po();if(e){let n=await e.digest("SHA-256",new TextEncoder().encode(t));return $r(new Uint8Array(n))}let{sha256:r}=await Promise.resolve().then(()=>(mn(),fn));return $r(r(new TextEncoder().encode(t)))}async function Ou(t,e){let r=Po();if(r){let a=await r.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},false,["sign"]),s=await r.sign("HMAC",a,new TextEncoder().encode(e));return $r(new Uint8Array(s))}let{hmac:n}=await Promise.resolve().then(()=>(po(),co)),{sha256:i}=await Promise.resolve().then(()=>(mn(),fn)),o=n(i,new TextEncoder().encode(t),new TextEncoder().encode(e));return $r(o)}var Hu=60*1024;function Bu(t){return {mushiBeacon:true,path:t.path,headers:t.headers,body:t.body}}function Fu(t,e=typeof location<"u"?location.origin:""){if(!t)return false;if(t.startsWith("/"))return true;if(!e)return false;try{return new URL(t,e).origin===e}catch{return false}}function Nu(t){try{let e=t.startsWith("/")?new URL(t,"https://tunnel.local"):new URL(t);return `${e.pathname}${e.search}`}catch{return t}}function Uu(t){let e=t.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(e)try{return e(t.url,{method:"POST",headers:{"Content-Type":"application/json",...t.headers},body:t.body,keepalive:!0}),!0}catch{}let r=t.sendBeacon??(typeof navigator<"u"?navigator.sendBeacon?.bind(navigator):void 0);if(!r||!Fu(t.url))return false;let n=t.body;try{n=JSON.parse(t.body);}catch{n=t.body;}let i=JSON.stringify(Bu({path:t.path??Nu(t.url),headers:t.headers,body:n}));if(i.length>Hu)return false;try{return r(t.url,new Blob([i],{type:"application/json"}))}catch{return false}}var Do=false;function $o(){Do=true;}function qu(){return Do}var Sn=null;function Oo(){return Sn?Uu(Sn):false}var fo=false,ju="X-Mushi-User-Token",Wu="X-Mushi-Project",Vu="X-Mushi-SDK-Package",Ku="X-Mushi-SDK-Version";function zu(t){let e={"Content-Type":"application/json","X-Mushi-Api-Key":t.apiKey,[Wu]:t.projectId};return t.sdkPackage&&(e[Vu]=t.sdkPackage),t.sdkVersion&&(e[Ku]=t.sdkVersion),t.userToken&&(e[ju]=t.userToken),t.internalKind&&(e[Br]=t.internalKind),e}var Yt="https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api",Br="X-Mushi-Internal",ir="__mushiInternal";function Gu(t,e){let r=e?.trim();return r?r.replace(/\/$/,""):(t??Yt).replace(/\/$/,"")}var Yu=1e4,Xu=2,Ju=4,Qu=3e4,Zu=1e4;function Ho(t){let{projectId:e,apiKey:r,apiEndpoint:n=Yt,tunnel:i,timeout:o=Yu,maxRetries:a=Xu,getUserToken:s,sdkPackage:u,sdkVersion:d,circuitBreaker:p}=t,h=Gu(n,i),k=p?.enabled!==false,S=Math.max(1,p?.threshold??Ju),T=Math.max(1e3,p?.cooldownMs??Qu),E=0,w=0,L=()=>k&&w>Date.now(),M=()=>{E=0,w=0;},x=()=>{k&&(E+=1,E>=S&&(w=Date.now()+T));};async function f(m,b,C,P=a,v,K){let Y=v!=="reporter-poll";if(Y&&L())return {ok:false,error:{code:"CIRCUIT_OPEN",message:"Endpoint temporarily unavailable; retrying later."}};let ne=`${h}${b}`,j=new AbortController,ke=setTimeout(()=>j.abort(),o),Be=s?.()??null,me={...zu({apiKey:r,projectId:e,sdkPackage:u,sdkVersion:d,userToken:Be,internalKind:v}),...K},J=C?JSON.stringify(C):void 0;J&&m!=="GET"&&v!=="reporter-poll"&&(Sn={url:ne,headers:me,body:J,path:b});try{let O=await fetch(ne,{method:m,headers:me,body:J,keepalive:qu(),signal:j.signal,...v?{[ir]:v}:{}});if(clearTimeout(ke),O.status===307||O.status===308){let _e=O.headers.get("Location");if(_e&&P>0){let Ce=_e.replace(/\/v1\/.*$/,"").replace(/\/$/,"");if(Ce!==h)return h=Ce,f(m,b,C,P-1,v,K)}}if(!O.ok){let _e=await O.json().catch(()=>({}));if((O.status===401||O.status===403)&&!fo){fo=!0;let H=h===Yt?"Get the correct values at: https://kensaur.us/mushi-mushi/admin/projects":"Get the correct values from your Mushi console's Projects page.";console.error(`[Mushi] Credentials rejected (HTTP ${O.status}). Check your Project ID and API key scope (must be "report:write"). `+H);}let Ce=O.status===429,Le=O.status>=500||Ce,A=Ce?el(O.headers.get("Retry-After")):null,R=A===null||A<=Zu;return Le&&P>0&&R?(await mo(A??go(a-P)),f(m,b,C,P-1,v,K)):(Y&&(Le?x():M()),{ok:!1,error:{code:_e.error?.code||`HTTP_${O.status}`,message:_e.error?.message||_e.message||`HTTP ${O.status} error`,status:O.status}})}let G=await O.json(),re=G&&typeof G=="object"&&"ok"in G&&"data"in G?G.data:G;return Y&&M(),{ok:!0,data:re}}catch(O){return clearTimeout(ke),P>0&&tl(O)?(await mo(go(a-P)),f(m,b,C,P-1,v,K)):(Y&&x(),{ok:false,error:{code:"NETWORK_ERROR",message:O instanceof Error?O.message:"Unknown network error"}})}}async function g(m,b,C,P){try{let v=await nr(C),K=String(Date.now());return await f(m,b,P,a,"reporter-poll",{"X-Reporter-Token-Hash":v,"X-Reporter-Ts":K,"X-Reporter-Hmac":await Ou(r,`${e}.${K}.${v}`)})}catch(v){return {ok:false,error:{code:"NETWORK_ERROR",message:v instanceof Error?v.message:"Unknown error"}}}}return {async submitReport(m){let b=$u(m);return b.ok?f("POST","/v1/reports",m,a,"report-submit"):{ok:false,error:{code:b.serializeFailed?"SERIALIZE_FAILED":"PAYLOAD_TOO_LARGE",message:b.reason??"Report payload exceeds size limit"}}},async getReportStatus(m){return f("GET",`/v1/reports/${m}/status`,void 0,a,"report-status")},async getSdkConfig(){return f("GET","/v1/sdk/config",void 0,a,"sdk-config")},async askAssistant(m){return f("POST","/v1/sdk/assistant",{message:m.message,threadId:m.threadId??null,context:m.context??null},1,"community")},async getLatestSdkVersion(m){let b=new URLSearchParams({package:m}).toString();return f("GET",`/v1/sdk/latest-version?${b}`,void 0,a,"sdk-config")},async postDiscoveryEvent(m){return f("POST","/v1/sdk/discovery",m,1,"discovery")},async listReporterReports(m){return g("GET","/v1/reporter/reports",m)},reporterRequest:g,async listReporterComments(m,b){return g("GET",`/v1/reporter/reports/${m}/comments`,b)},async replyToReporterReport(m,b,C,P){return g("POST",`/v1/reporter/reports/${m}/reply`,b,{body:C,...P?{feedback_signal:P}:{}})},async reopenReporterReport(m,b,C){return g("POST",`/v1/reporter/reports/${m}/reopen`,b,{note:C??""})},async listNotifications(m,b){let C=new URLSearchParams;b?.since&&C.set("since",b.since),b?.limit&&C.set("limit",String(b.limit));let P=C.size?`?${C.toString()}`:"";return g("GET",`/v1/notifications${P}`,m)},async markNotificationRead(m,b){return g("POST",`/v1/notifications/${m}/read`,b,{})},async listReporterFeatureBoard(m){return g("GET","/v1/reporter/feature-board",m)},async voteReporterFeatureBoard(m,b){return g("POST",`/v1/reporter/feature-board/${m}/vote`,b,{})},async postSessionEvent(m){return f("POST","/v1/sdk/session",m,1,"discovery")},async postProductEvents(m){return f("POST","/v1/sdk/events",m,1,"discovery")},async submitActivity(m,b,C){return f("POST","/v1/sdk/activity",{user_id:m,user_traits:C?.userTraits,opted_in:C?.optedIn,reporter_token_hash:C?.reporterTokenHash,...C?.hostJwt?{host_jwt:C.hostJwt}:{},events:b},1,"discovery")},async getMyPoints(m){return f("GET",`/v1/sdk/me/points?userId=${encodeURIComponent(m)}`,void 0,1,"reporter-poll")},async getMyTier(m){return f("GET",`/v1/sdk/me/tier?userId=${encodeURIComponent(m)}`,void 0,1,"reporter-poll")},async getMyHistory(m,b){let C=new URLSearchParams({userId:m,...b?.limit?{limit:String(b.limit)}:{}});return f("GET",`/v1/sdk/me/history?${C}`,void 0,1,"reporter-poll")},async getHallOfFame(m=10){return f("GET",`/v1/sdk/hall-of-fame?limit=${m}`,void 0,1,"reporter-poll")},async sendMagicLink(m){return f("POST","/v1/tester/magic-link",{email:m},1,"community")},async linkReporterToken(m,b){return f("POST","/v1/tester/link-reporter",{reporter_token_hash:m},1,"community",{Authorization:`Bearer ${b}`})},async getCrossAppReports(m,b){let C=new URLSearchParams;b?.limit&&C.set("limit",String(b.limit)),b?.offset&&C.set("offset",String(b.offset));let P=C.size?`?${C.toString()}`:"";return f("GET",`/v1/tester/cross-app-reports${P}`,void 0,1,"community",{Authorization:`Bearer ${m}`})},async getMyReputation(m){return f("GET","/v1/tester/reputation",void 0,1,"community",{Authorization:`Bearer ${m}`})},async getPublicLeaderboard(m=20){return f("GET",`/v1/public/tester-leaderboard?limit=${m}`,void 0,1,"reporter-poll")},async getTesterStatus(m){return f("GET","/v1/me/tester-status",void 0,1,"community",{Authorization:`Bearer ${m}`})}}}function mo(t){return new Promise(e=>setTimeout(e,t))}function go(t){return Math.min(1e3*2**t+Math.random()*500,1e4)}function el(t,e=Date.now()){if(!t)return null;let r=t.trim();if(!r)return null;let n=Number(r);if(Number.isFinite(n))return n<0?null:n*1e3;let i=Date.parse(r);return Number.isNaN(i)?null:Math.max(i-e,0)}function tl(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof TypeError}function gn(t,e){if(!t||!e||e.length===0)return false;for(let r of e){if(typeof r=="string"){if(t.includes(r))return true;continue}try{if(r.test(t))return !0}catch{}}return false}function or(t){if(gn(t.message,t.ignoreErrors))return true;let e=t.filename?.trim()||"";return !!(e&&gn(e,t.denyUrls)||t.allowUrls&&t.allowUrls.length>0&&(!e||!gn(e,t.allowUrls)))}function bn(...t){return t.find(e=>e!==void 0&&e!=="")}function Se(t){try{let e=undefined;return typeof e=="object"&&e!==null?e[t]:void 0}catch{return}}function Ke(t){try{return t()}catch{return}}function Ln(){let t=bn(Se("VITE_MUSHI_PROJECT_ID"),Se("NEXT_PUBLIC_MUSHI_PROJECT_ID"),Se("NUXT_PUBLIC_MUSHI_PROJECT_ID"),Se("EXPO_PUBLIC_MUSHI_PROJECT_ID"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_PROJECT_ID),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_PROJECT_ID),Ke(()=>process.env.MUSHI_PROJECT_ID)),e=bn(Se("VITE_MUSHI_API_KEY"),Se("NEXT_PUBLIC_MUSHI_API_KEY"),Se("NUXT_PUBLIC_MUSHI_API_KEY"),Se("EXPO_PUBLIC_MUSHI_API_KEY"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_API_KEY),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_API_KEY),Ke(()=>process.env.MUSHI_API_KEY)),r=bn(Se("VITE_MUSHI_API_ENDPOINT"),Se("NEXT_PUBLIC_MUSHI_API_ENDPOINT"),Se("NUXT_PUBLIC_MUSHI_API_ENDPOINT"),Se("EXPO_PUBLIC_MUSHI_API_ENDPOINT"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_API_ENDPOINT),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_API_ENDPOINT),Ke(()=>process.env.MUSHI_API_ENDPOINT)),n={};return t&&(n.projectId=t),e&&(n.apiKey=e),r&&(n.apiEndpoint=r),n}var rl=["VITE_","NEXT_PUBLIC_","NUXT_PUBLIC_","EXPO_PUBLIC_",""],nl={projectId:"MUSHI_PROJECT_ID",apiKey:"MUSHI_API_KEY"};function Bo(){let t=Ln(),e=[];if(t.projectId||e.push("projectId"),t.apiKey||e.push("apiKey"),e.length===0)return {resolved:t,missing:e,nearMisses:[],message:null};let r=(()=>{try{let s=undefined;return typeof s=="object"&&s!==null?s:null}catch{return null}})(),n=(()=>{try{return typeof process<"u"&&process.env?process.env:null}catch{return null}})(),i=[];for(let s of e)for(let u of rl){let d=`${u}${nl[s]}`;r&&r[d]?i.push({field:s,key:d,via:"import.meta.env"}):n&&n[d]&&i.push({field:s,key:d,via:"process.env"});}let o=r?"VITE_MUSHI_*":"NEXT_PUBLIC_MUSHI_* (Next.js), EXPO_PUBLIC_MUSHI_* (Expo), or MUSHI_* (Node / React Native)",a=[`[mushi] Missing ${e.join(" and ")} \u2014 the SDK will not initialize.`];for(let s of i)a.push(`[mushi] Found ${s.key} in ${s.via}, but this runtime did not resolve it \u2014 it is either the wrong prefix for your bundler or not exposed to the client bundle.`);return a.push(`[mushi] This runtime reads: ${o}. Set the matching variable(s) and restart your dev server.`),i.length===0&&a.push("[mushi] If you already set the variable, check the prefix: a mis-prefixed var is stripped from client bundles and resolves to undefined with no error."),{resolved:t,missing:e,nearMisses:i,message:a.join(`
|
|
1
|
+
(function(){'use strict';var yu=Object.defineProperty;var qe=(t,e)=>()=>(t&&(e=t(t=0)),e);var jt=(t,e)=>{for(var r in e)yu(t,r,{get:e[r],enumerable:true});};function vu(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Yi(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(`${r}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){let r=e&&`"${e}" `;throw new RangeError(`${r}expected integer >= 0, got ${t}`)}}function Wt(t,e,r=""){let n=vu(t),i=t?.length,o=e!==void 0;if(!n||o){let a=r&&`"${r}" `,s="",u=n?`length=${i}`:`type=${typeof t}`,d=a+"expected Uint8Array"+s+", got "+u;throw n?new RangeError(d):new TypeError(d)}return t}function Xi(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(Yi(t.outputLen),Yi(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function xt(t,e=true){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function yr(t,e){Wt(t,void 0,"digestInto() output");let r=e.outputLen;if(t.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function je(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function vr(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ae(t,e){return t<<32-e|t>>>e}function at(t,e={}){let r=(i,o)=>t(o).update(i).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=i=>t(i),Object.assign(r,e),Object.freeze(r)}var ut,wr=qe(()=>{ut=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});});function Ji(t,e,r){return t&e^~t&r}function Qi(t,e,r){return t&e^t&r^e&r}var Vt,We,Ve,oe,se,Zi=qe(()=>{wr();Vt=class{blockLen;outputLen;canXOF=false;padOffset;isLE;buffer;view;finished=false;length=0;pos=0;destroyed=false;constructor(e,r,n,i){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=vr(this.buffer);}update(e){xt(this),Wt(e);let{view:r,buffer:n,blockLen:i}=this,o=e.length;for(let a=0;a<o;){let s=Math.min(i-this.pos,o-a);if(s===i){let u=vr(e);for(;i<=o-a;a+=i)this.process(u,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===i&&(this.process(r,0),this.pos=0);}return this.length+=e.length,this.roundClean(),this}digestInto(e){xt(this),yr(e,this),this.finished=true;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:a}=this;r[a++]=128,je(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let h=a;h<i;h++)r[h]=0;n.setBigUint64(i-8,BigInt(this.length*8),o),this.process(n,0);let s=vr(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let d=u/4,p=this.get();if(d>p.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<d;h++)s.setUint32(4*h,p[h],o);}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=o,e.length=i,e.pos=s,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}},We=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ve=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),oe=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),se=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);});function wu(t,e=false){return e?{h:Number(t&Sr),l:Number(t>>eo&Sr)}:{h:Number(t>>eo&Sr)|0,l:Number(t&Sr)|0}}function to(t,e=false){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=wu(t[o],e);[n[o],i[o]]=[a,s];}return [n,i]}function Pe(t,e,r,n){let i=(e>>>0)+(n>>>0);return {h:t+r+(i/2**32|0)|0,l:i|0}}var Sr,eo,pn,hn,lt,ct,Kt,zt,ro,no,io,oo,so,ao,uo=qe(()=>{Sr=BigInt(4294967295),eo=BigInt(32);pn=(t,e,r)=>t>>>r,hn=(t,e,r)=>t<<32-r|e>>>r,lt=(t,e,r)=>t>>>r|e<<32-r,ct=(t,e,r)=>t<<32-r|e>>>r,Kt=(t,e,r)=>t<<64-r|e>>>r-32,zt=(t,e,r)=>t>>>r-32|e<<64-r;ro=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),no=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,io=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),oo=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,so=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),ao=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;});var fn={};jt(fn,{_SHA224:()=>kr,_SHA256:()=>Rr,_SHA384:()=>Cr,_SHA512:()=>_r,_SHA512_224:()=>Tr,_SHA512_256:()=>Ar,sha224:()=>Cu,sha256:()=>_u,sha384:()=>Au,sha512:()=>Tu,sha512_224:()=>Mu,sha512_256:()=>Iu});var xu,Je,xr,Rr,kr,lo,Ru,ku,Qe,Ze,Rt,_r,Cr,le,ce,Tr,Ar,_u,Cu,Tu,Au,Iu,Mu,mn=qe(()=>{Zi();uo();wr();xu=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Je=new Uint32Array(64),xr=class extends Vt{constructor(e){super(64,e,8,false);}get(){let{A:e,B:r,C:n,D:i,E:o,F:a,G:s,H:u}=this;return [e,r,n,i,o,a,s,u]}set(e,r,n,i,o,a,s,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0;}process(e,r){for(let h=0;h<16;h++,r+=4)Je[h]=e.getUint32(r,false);for(let h=16;h<64;h++){let k=Je[h-15],S=Je[h-2],T=Ae(k,7)^Ae(k,18)^k>>>3,E=Ae(S,17)^Ae(S,19)^S>>>10;Je[h]=E+Je[h-7]+T+Je[h-16]|0;}let{A:n,B:i,C:o,D:a,E:s,F:u,G:d,H:p}=this;for(let h=0;h<64;h++){let k=Ae(s,6)^Ae(s,11)^Ae(s,25),S=p+k+Ji(s,u,d)+xu[h]+Je[h]|0,E=(Ae(n,2)^Ae(n,13)^Ae(n,22))+Qi(n,i,o)|0;p=d,d=u,u=s,s=a+S|0,a=o,o=i,i=n,n=S+E|0;}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(n,i,o,a,s,u,d,p);}roundClean(){je(Je);}destroy(){this.destroyed=true,this.set(0,0,0,0,0,0,0,0),je(this.buffer);}},Rr=class extends xr{A=We[0]|0;B=We[1]|0;C=We[2]|0;D=We[3]|0;E=We[4]|0;F=We[5]|0;G=We[6]|0;H=We[7]|0;constructor(){super(32);}},kr=class extends xr{A=Ve[0]|0;B=Ve[1]|0;C=Ve[2]|0;D=Ve[3]|0;E=Ve[4]|0;F=Ve[5]|0;G=Ve[6]|0;H=Ve[7]|0;constructor(){super(28);}},lo=to(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ru=lo[0],ku=lo[1],Qe=new Uint32Array(80),Ze=new Uint32Array(80),Rt=class extends Vt{constructor(e){super(128,e,16,false);}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:s,Dl:u,Eh:d,El:p,Fh:h,Fl:k,Gh:S,Gl:T,Hh:E,Hl:w}=this;return [e,r,n,i,o,a,s,u,d,p,h,k,S,T,E,w]}set(e,r,n,i,o,a,s,u,d,p,h,k,S,T,E,w){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=d|0,this.El=p|0,this.Fh=h|0,this.Fl=k|0,this.Gh=S|0,this.Gl=T|0,this.Hh=E|0,this.Hl=w|0;}process(e,r){for(let x=0;x<16;x++,r+=4)Qe[x]=e.getUint32(r),Ze[x]=e.getUint32(r+=4);for(let x=16;x<80;x++){let f=Qe[x-15]|0,g=Ze[x-15]|0,m=lt(f,g,1)^lt(f,g,8)^pn(f,g,7),b=ct(f,g,1)^ct(f,g,8)^hn(f,g,7),C=Qe[x-2]|0,P=Ze[x-2]|0,v=lt(C,P,19)^Kt(C,P,61)^pn(C,P,6),K=ct(C,P,19)^zt(C,P,61)^hn(C,P,6),Y=io(b,K,Ze[x-7],Ze[x-16]),ne=oo(Y,m,v,Qe[x-7],Qe[x-16]);Qe[x]=ne|0,Ze[x]=Y|0;}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:s,Cl:u,Dh:d,Dl:p,Eh:h,El:k,Fh:S,Fl:T,Gh:E,Gl:w,Hh:L,Hl:M}=this;for(let x=0;x<80;x++){let f=lt(h,k,14)^lt(h,k,18)^Kt(h,k,41),g=ct(h,k,14)^ct(h,k,18)^zt(h,k,41),m=h&S^~h&E,b=k&T^~k&w,C=so(M,g,b,ku[x],Ze[x]),P=ao(C,L,f,m,Ru[x],Qe[x]),v=C|0,K=lt(n,i,28)^Kt(n,i,34)^Kt(n,i,39),Y=ct(n,i,28)^zt(n,i,34)^zt(n,i,39),ne=n&o^n&s^o&s,j=i&a^i&u^a&u;L=E|0,M=w|0,E=S|0,w=T|0,S=h|0,T=k|0,{h,l:k}=Pe(d|0,p|0,P|0,v|0),d=s|0,p=u|0,s=o|0,u=a|0,o=n|0,a=i|0;let ke=ro(v,Y,j);n=no(ke,P,K,ne),i=ke|0;}(({h:n,l:i}=Pe(this.Ah|0,this.Al|0,n|0,i|0))),{h:o,l:a}=Pe(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Pe(this.Ch|0,this.Cl|0,s|0,u|0),{h:d,l:p}=Pe(this.Dh|0,this.Dl|0,d|0,p|0),{h,l:k}=Pe(this.Eh|0,this.El|0,h|0,k|0),{h:S,l:T}=Pe(this.Fh|0,this.Fl|0,S|0,T|0),{h:E,l:w}=Pe(this.Gh|0,this.Gl|0,E|0,w|0),{h:L,l:M}=Pe(this.Hh|0,this.Hl|0,L|0,M|0),this.set(n,i,o,a,s,u,d,p,h,k,S,T,E,w,L,M);}roundClean(){je(Qe,Ze);}destroy(){this.destroyed=true,je(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);}},_r=class extends Rt{Ah=se[0]|0;Al=se[1]|0;Bh=se[2]|0;Bl=se[3]|0;Ch=se[4]|0;Cl=se[5]|0;Dh=se[6]|0;Dl=se[7]|0;Eh=se[8]|0;El=se[9]|0;Fh=se[10]|0;Fl=se[11]|0;Gh=se[12]|0;Gl=se[13]|0;Hh=se[14]|0;Hl=se[15]|0;constructor(){super(64);}},Cr=class extends Rt{Ah=oe[0]|0;Al=oe[1]|0;Bh=oe[2]|0;Bl=oe[3]|0;Ch=oe[4]|0;Cl=oe[5]|0;Dh=oe[6]|0;Dl=oe[7]|0;Eh=oe[8]|0;El=oe[9]|0;Fh=oe[10]|0;Fl=oe[11]|0;Gh=oe[12]|0;Gl=oe[13]|0;Hh=oe[14]|0;Hl=oe[15]|0;constructor(){super(48);}},le=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ce=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),Tr=class extends Rt{Ah=le[0]|0;Al=le[1]|0;Bh=le[2]|0;Bl=le[3]|0;Ch=le[4]|0;Cl=le[5]|0;Dh=le[6]|0;Dl=le[7]|0;Eh=le[8]|0;El=le[9]|0;Fh=le[10]|0;Fl=le[11]|0;Gh=le[12]|0;Gl=le[13]|0;Hh=le[14]|0;Hl=le[15]|0;constructor(){super(28);}},Ar=class extends Rt{Ah=ce[0]|0;Al=ce[1]|0;Bh=ce[2]|0;Bl=ce[3]|0;Ch=ce[4]|0;Cl=ce[5]|0;Dh=ce[6]|0;Dl=ce[7]|0;Eh=ce[8]|0;El=ce[9]|0;Fh=ce[10]|0;Fl=ce[11]|0;Gh=ce[12]|0;Gl=ce[13]|0;Hh=ce[14]|0;Hl=ce[15]|0;constructor(){super(32);}},_u=at(()=>new Rr,ut(1)),Cu=at(()=>new kr,ut(4)),Tu=at(()=>new _r,ut(3)),Au=at(()=>new Cr,ut(2)),Iu=at(()=>new Ar,ut(6)),Mu=at(()=>new Tr,ut(5));});var co={};jt(co,{_HMAC:()=>Gt,hmac:()=>Lu});var Gt,Lu,po=qe(()=>{wr();Gt=class{oHash;iHash;blockLen;outputLen;canXOF=false;finished=false;destroyed=false;constructor(e,r){if(Xi(e),Wt(r,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),je(i);}update(e){return xt(this),this.iHash.update(e),this}digestInto(e){xt(this),yr(e,this),this.finished=true;let r=e.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy();}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:s}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=a,e.outputLen=s,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=true,this.oHash.destroy(),this.iHash.destroy();}},Lu=(()=>{let t=((e,r,n)=>new Gt(e,r).update(n).digest());return t.create=(e,r)=>new Gt(e,r),t})();});function rd(t){let e=(t??"").toLowerCase().split(/[-_]/)[0];return zc.includes(e)?e:"en"}function yt(t="en"){return td[rd(t)]}function ar(t,e={}){return t.replace(/\{(\w+)\}/g,(r,n)=>{let i=e[n];return i==null?"":String(i)})}function nd(t){return Kc.includes(t)}function id(t){let e=(t.user_category??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return e==="feature"||e==="feature_request"||e==="idea"}function Pt(t,e="en"){let r=yt(e),n=(t.status??"").trim(),i=nd(n)?Gc[n]:"received",o=t.fixed_in_version?.trim()||null;(n==="fixed"||n==="resolved")&&o&&(i="fixed_version"),(t.awaiting_reporter||t.awaiting_reporter_at)&&Gs.has(i)&&(i="waiting");let s=id(t),u=r.status[i],d=r.detail[i];s&&(i==="received"?u=r.idea.received:i==="reviewing"||i==="reviewing_again"?u=r.idea.reviewing:i==="fixing"?u=r.idea.fixing:i==="fixed_version"?u=r.idea.shippedVersion:(i==="fixed_next"||i==="fixed")&&(u=r.idea.shipped));let p=t.closed_reason??null;i==="closed"&&(d=p&&p!=="spam"&&p in r.closedReason?r.closedReason[p]:r.closedReason.none);let h=t.group_bucket??"none",k=Gs.has(i)||i==="waiting"?h==="few"?r.others.few:h==="many"?r.others.many:null:null;return {key:i,label:ar(u,{version:o}),tone:Yc[i],detail:ar(d,{version:o}),canVerify:i==="fixed_next"||i==="fixed_version"||i==="fixed",othersNote:k,hidden:i==="closed"&&p==="spam"}}function od(t,e={},r="en"){let n=yt(r);if(t==="comment")return e.text??"";if(t==="closed"){let i=e.closed_reason??"";return i&&i!=="spam"&&i in n.closedReason?n.closedReason[i]:n.closedReason.none}return t==="reporter_comment"?e.text??n.timeline.reporter_comment:ar(n.timeline[t],{text:e.text,version:e.version})}function Kn(t){return t.kind==="comment"||t.kind==="reporter_comment"||t.kind==="info_requested"}function Ys(t,e="en"){return t.custom||!Xc.includes(t.kind)?t.text:od(t.kind,{text:t.body??null,version:t.version??null,closed_reason:t.closed_reason??null},e)}function Xs(t,e="en"){let r=yt(e).ui,n=t.unread_total===1?t.latest[0]?.kind:null;return n==="comment"||n==="info_requested"?r.toastReplied:n==="fixed"||n==="released"?r.toastFixed:r.updates.replace("{n}",String(t.unread_total))}function Js(t){return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(t.trim())}var Kc,zc,Gc,Yc,Xc,Jc,Qc,Zc,ed,td,Gs,Vr=qe(()=>{Kc=["new","pending","submitted","queued","classified","grouped","fixing","fixed","dismissed","triaged","in_progress","resolved","verified","reopened"],zc=["en","ja","es","th"],Gc={new:"received",pending:"received",submitted:"received",queued:"received",classified:"reviewing",triaged:"reviewing",grouped:"reviewing",reopened:"reviewing_again",fixing:"fixing",in_progress:"fixing",verified:"verified",fixed:"fixed_next",resolved:"fixed",dismissed:"closed"},Yc={received:"neutral",reviewing:"info",reviewing_again:"info",fixing:"progress",verified:"success-muted",fixed_next:"success",fixed_version:"success",fixed:"success",closed:"muted",waiting:"attention"},Xc=["received","reviewing","duplicate_linked","info_requested","comment","reporter_comment","fix_started","fixed","released","verified","reopened","closed"],Jc={status:{received:"Received",reviewing:"Looking into it",reviewing_again:"Looking into it again",fixing:"Fix in progress",verified:"Confirmed fixed",fixed_next:"Fixed \u2014 coming in the next update",fixed_version:"Fixed in v{version}",fixed:"Fixed",closed:"Closed",waiting:"Waiting on you"},detail:{received:"We got it.",reviewing:"The developer has it on their list.",reviewing_again:"Thanks \u2014 we reopened it.",fixing:"A fix is being worked on.",verified:"You confirmed the fix. Thank you!",fixed_next:"It ships in the next release.",fixed_version:"Update to v{version}. Does it work for you now?",fixed:"Does it work for you now?",closed:"Closed.",waiting:"The developer asked a question \u2014 reply below."},idea:{received:"Thanks for the idea",reviewing:"Under consideration",fixing:"Being built",shipped:"Shipped",shippedVersion:"Shipped in v{version}"},closedReason:{duplicate:"Same as an earlier report \u2014 we'll update you there.",not_reproducible:"We couldn't reproduce it. Reply if it happens again.",wont_fix:"We decided not to change this.",working_as_intended:"This is expected behaviour.",none:"Closed."},others:{few:"You and a few others reported this",many:"Many people reported this"},timeline:{received:"You reported this",reviewing:"The developer is looking into it",duplicate_linked:"Same as an existing report \u2014 we'll update you there",info_requested:"The developer asked: {text}",reporter_comment:"You",fix_started:"A fix is in progress",fixed:"Fixed \u2014 coming in the next update",released:"Shipped in v{version} \u2014 update to get it",verified:"You confirmed it's fixed",reopened:"Reopened"},categories:{bug:"Bug",slow:"Slow",visual:"Looks wrong",confusing:"Confusing",idea:"Idea"},ui:{yes:"Yes",notYet:"Not yet",empty:"Nothing yet \u2014 your reports will show up here with updates.",loadError:"Couldn't load updates",retry:"Retry",sending:"Sending\u2026",sent:"Sent",sendFailed:"Failed",noReplies:"No developer replies yet.",you:"You",developer:"Developer",addWords:"Add a few words",developerReplied:"Developer replied: \u201C{text}\u201D",updates:"{n} updates on your reports",receipt:"Sent. We'll let you know here when there's news.",trackIt:"Track it",done:"Done",emailOptIn:"Get updates by email",emailPlaceholder:"you@example.com",emailSubmit:"Email me updates",emailCheckInbox:"Check your inbox and tap the link to confirm.",emailInvalid:"That does not look like an email address.",emailFailed:"Couldn't set up email updates. Try again later.",toastReplied:"The developer replied to your report",toastFixed:"Your bug is fixed",view:"View"}},Qc={status:{received:"\u53D7\u3051\u4ED8\u3051\u307E\u3057\u305F",reviewing:"\u78BA\u8A8D\u4E2D",reviewing_again:"\u518D\u78BA\u8A8D\u4E2D",fixing:"\u4FEE\u6B63\u4E2D",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u6E08\u307F",fixed_next:"\u4FEE\u6B63\u6E08\u307F \u2014 \u6B21\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u53CD\u6620",fixed_version:"v{version} \u3067\u4FEE\u6B63\u6E08\u307F",fixed:"\u4FEE\u6B63\u6E08\u307F",closed:"\u7D42\u4E86",waiting:"\u3042\u306A\u305F\u306E\u8FD4\u4FE1\u5F85\u3061"},detail:{received:"\u5831\u544A\u3092\u53D7\u3051\u53D6\u308A\u307E\u3057\u305F\u3002",reviewing:"\u958B\u767A\u8005\u304C\u5BFE\u5FDC\u30EA\u30B9\u30C8\u306B\u5165\u308C\u307E\u3057\u305F\u3002",reviewing_again:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002\u518D\u5EA6\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059\u3002",fixing:"\u4FEE\u6B63\u306B\u53D6\u308A\u7D44\u3093\u3067\u3044\u307E\u3059\u3002",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u3044\u305F\u3060\u304D\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01",fixed_next:"\u6B21\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u53CD\u6620\u3055\u308C\u307E\u3059\u3002",fixed_version:"v{version} \u306B\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u89E3\u6C7A\u3057\u307E\u3057\u305F\u304B\uFF1F",fixed:"\u89E3\u6C7A\u3057\u307E\u3057\u305F\u304B\uFF1F",closed:"\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002",waiting:"\u958B\u767A\u8005\u304B\u3089\u8CEA\u554F\u304C\u3042\u308A\u307E\u3059\u3002\u4E0B\u304B\u3089\u8FD4\u4FE1\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},idea:{received:"\u30A2\u30A4\u30C7\u30A2\u3092\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059",reviewing:"\u691C\u8A0E\u4E2D",fixing:"\u958B\u767A\u4E2D",shipped:"\u30EA\u30EA\u30FC\u30B9\u6E08\u307F",shippedVersion:"v{version} \u3067\u30EA\u30EA\u30FC\u30B9\u6E08\u307F"},closedReason:{duplicate:"\u4EE5\u524D\u306E\u5831\u544A\u3068\u540C\u3058\u5185\u5BB9\u3067\u3059\u3002\u305D\u3061\u3089\u3067\u9032\u6357\u3092\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002",not_reproducible:"\u518D\u73FE\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u767A\u3057\u305F\u3089\u8FD4\u4FE1\u3057\u3066\u304F\u3060\u3055\u3044\u3002",wont_fix:"\u3053\u306E\u70B9\u306F\u5909\u66F4\u3057\u306A\u3044\u3053\u3068\u306B\u3057\u307E\u3057\u305F\u3002",working_as_intended:"\u3053\u308C\u306F\u60F3\u5B9A\u3069\u304A\u308A\u306E\u52D5\u4F5C\u3067\u3059\u3002",none:"\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002"},others:{few:"\u3042\u306A\u305F\u3092\u542B\u3081\u6570\u4EBA\u304C\u5831\u544A\u3057\u3066\u3044\u307E\u3059",many:"\u591A\u304F\u306E\u4EBA\u304C\u5831\u544A\u3057\u3066\u3044\u307E\u3059"},timeline:{received:"\u3042\u306A\u305F\u304C\u5831\u544A\u3057\u307E\u3057\u305F",reviewing:"\u958B\u767A\u8005\u304C\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059",duplicate_linked:"\u65E2\u5B58\u306E\u5831\u544A\u3068\u540C\u3058\u5185\u5BB9\u3067\u3059\u3002\u305D\u3061\u3089\u3067\u9032\u6357\u3092\u304A\u77E5\u3089\u305B\u3057\u307E\u3059",info_requested:"\u958B\u767A\u8005\u304B\u3089\u306E\u8CEA\u554F: {text}",reporter_comment:"\u3042\u306A\u305F",fix_started:"\u4FEE\u6B63\u4E2D\u3067\u3059",fixed:"\u4FEE\u6B63\u6E08\u307F \u2014 \u6B21\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3067\u53CD\u6620",released:"v{version} \u3067\u30EA\u30EA\u30FC\u30B9 \u2014 \u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044",verified:"\u4FEE\u6B63\u3092\u78BA\u8A8D\u3057\u307E\u3057\u305F",reopened:"\u518D\u30AA\u30FC\u30D7\u30F3\u3057\u307E\u3057\u305F"},categories:{bug:"\u30D0\u30B0",slow:"\u9045\u3044",visual:"\u8868\u793A\u304C\u304A\u304B\u3057\u3044",confusing:"\u308F\u304B\u308A\u306B\u304F\u3044",idea:"\u30A2\u30A4\u30C7\u30A2"},ui:{yes:"\u306F\u3044",notYet:"\u307E\u3060",empty:"\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002\u5831\u544A\u3059\u308B\u3068\u3053\u3053\u306B\u9032\u6357\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002",loadError:"\u66F4\u65B0\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",retry:"\u518D\u8A66\u884C",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"\u9001\u4FE1\u3057\u307E\u3057\u305F",sendFailed:"\u9001\u4FE1\u5931\u6557",noReplies:"\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",you:"\u3042\u306A\u305F",developer:"\u958B\u767A\u8005",addWords:"\u3082\u3046\u5C11\u3057\u8A73\u3057\u304F\u66F8\u3044\u3066\u304F\u3060\u3055\u3044",developerReplied:"\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1:\u300C{text}\u300D",updates:"\u3042\u306A\u305F\u306E\u5831\u544A\u306B {n} \u4EF6\u306E\u66F4\u65B0\u304C\u3042\u308A\u307E\u3059",receipt:"\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002\u9032\u5C55\u304C\u3042\u308C\u3070\u3053\u3053\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002",trackIt:"\u7D4C\u904E\u3092\u898B\u308B",done:"\u9589\u3058\u308B",emailOptIn:"\u30E1\u30FC\u30EB\u3067\u66F4\u65B0\u3092\u53D7\u3051\u53D6\u308B",emailPlaceholder:"you@example.com",emailSubmit:"\u30E1\u30FC\u30EB\u3067\u53D7\u3051\u53D6\u308B",emailCheckInbox:"\u53D7\u4FE1\u30C8\u30EC\u30A4\u306E\u30E1\u30FC\u30EB\u306E\u30EA\u30F3\u30AF\u3092\u30BF\u30C3\u30D7\u3057\u3066\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",emailInvalid:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002",emailFailed:"\u30E1\u30FC\u30EB\u901A\u77E5\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",toastReplied:"\u958B\u767A\u8005\u304C\u3042\u306A\u305F\u306E\u5831\u544A\u306B\u8FD4\u4FE1\u3057\u307E\u3057\u305F",toastFixed:"\u3042\u306A\u305F\u304C\u5831\u544A\u3057\u305F\u4E0D\u5177\u5408\u304C\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F",view:"\u898B\u308B"}},Zc={status:{received:"Recibido",reviewing:"Lo estamos revisando",reviewing_again:"Lo revisamos de nuevo",fixing:"Correcci\xF3n en curso",verified:"Correcci\xF3n confirmada",fixed_next:"Corregido \u2014 llega en la pr\xF3xima actualizaci\xF3n",fixed_version:"Corregido en v{version}",fixed:"Corregido",closed:"Cerrado",waiting:"Esperando tu respuesta"},detail:{received:"Lo recibimos.",reviewing:"El desarrollador lo tiene en su lista.",reviewing_again:"Gracias, lo reabrimos.",fixing:"Se est\xE1 trabajando en una correcci\xF3n.",verified:"Confirmaste la correcci\xF3n. \xA1Gracias!",fixed_next:"Llega en la pr\xF3xima versi\xF3n.",fixed_version:"Actualiza a v{version}. \xBFYa funciona?",fixed:"\xBFYa funciona?",closed:"Cerrado.",waiting:"El desarrollador hizo una pregunta: responde abajo."},idea:{received:"Gracias por la idea",reviewing:"En consideraci\xF3n",fixing:"En desarrollo",shipped:"Publicado",shippedVersion:"Publicado en v{version}"},closedReason:{duplicate:"Es igual a un reporte anterior; te avisaremos all\xED.",not_reproducible:"No pudimos reproducirlo. Responde si vuelve a pasar.",wont_fix:"Decidimos no cambiar esto.",working_as_intended:"Este es el comportamiento esperado.",none:"Cerrado."},others:{few:"T\xFA y algunas personas m\xE1s reportaron esto",many:"Muchas personas reportaron esto"},timeline:{received:"Reportaste esto",reviewing:"El desarrollador lo est\xE1 revisando",duplicate_linked:"Es igual a un reporte existente; te avisaremos all\xED",info_requested:"El desarrollador pregunt\xF3: {text}",reporter_comment:"T\xFA",fix_started:"Hay una correcci\xF3n en curso",fixed:"Corregido \u2014 llega en la pr\xF3xima actualizaci\xF3n",released:"Publicado en v{version}: actualiza para tenerlo",verified:"Confirmaste que est\xE1 corregido",reopened:"Reabierto"},categories:{bug:"Error",slow:"Lento",visual:"Se ve mal",confusing:"Confuso",idea:"Idea"},ui:{yes:"S\xED",notYet:"Todav\xEDa no",empty:"Nada todav\xEDa: tus reportes aparecer\xE1n aqu\xED con novedades.",loadError:"No se pudieron cargar las novedades",retry:"Reintentar",sending:"Enviando\u2026",sent:"Enviado",sendFailed:"Error al enviar",noReplies:"El desarrollador a\xFAn no ha respondido.",you:"T\xFA",developer:"Desarrollador",addWords:"Agrega algunas palabras",developerReplied:"El desarrollador respondi\xF3: \u201C{text}\u201D",updates:"{n} novedades en tus reportes",receipt:"Enviado. Te avisaremos aqu\xED cuando haya novedades.",trackIt:"Seguirlo",done:"Listo",emailOptIn:"Recibir novedades por correo",emailPlaceholder:"tu@ejemplo.com",emailSubmit:"Enviarme novedades",emailCheckInbox:"Revisa tu correo y toca el enlace para confirmar.",emailInvalid:"Eso no parece un correo electr\xF3nico.",emailFailed:"No pudimos activar las novedades por correo. Int\xE9ntalo m\xE1s tarde.",toastReplied:"El desarrollador respondi\xF3 a tu reporte",toastFixed:"Tu error est\xE1 corregido",view:"Ver"}},ed={status:{received:"\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E41\u0E25\u0E49\u0E27",reviewing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A",reviewing_again:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E27\u0E48\u0E32\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",fixed_next:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27 \u2014 \u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E16\u0E31\u0E14\u0E44\u0E1B",fixed_version:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27\u0E43\u0E19 v{version}",fixed:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",closed:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27",waiting:"\u0E23\u0E2D\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E04\u0E38\u0E13"},detail:{received:"\u0E40\u0E23\u0E32\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E41\u0E25\u0E49\u0E27",reviewing:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E43\u0E2A\u0E48\u0E44\u0E27\u0E49\u0E43\u0E19\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E41\u0E25\u0E49\u0E27",reviewing_again:"\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13 \u2014 \u0E40\u0E23\u0E32\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E41\u0E25\u0E49\u0E27",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E04\u0E38\u0E13\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02\u0E41\u0E25\u0E49\u0E27 \u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13!",fixed_next:"\u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E23\u0E38\u0E48\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B",fixed_version:"\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E40\u0E1B\u0E47\u0E19 v{version} \u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E43\u0E0A\u0E49\u0E44\u0E14\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E22\u0E31\u0E07?",fixed:"\u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E43\u0E0A\u0E49\u0E44\u0E14\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E22\u0E31\u0E07?",closed:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27",waiting:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E21\u0E35\u0E04\u0E33\u0E16\u0E32\u0E21 \u2014 \u0E15\u0E2D\u0E1A\u0E14\u0E49\u0E32\u0E19\u0E25\u0E48\u0E32\u0E07"},idea:{received:"\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22",reviewing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E1E\u0E34\u0E08\u0E32\u0E23\u0E13\u0E32",fixing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E23\u0E49\u0E32\u0E07",shipped:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",shippedVersion:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27\u0E43\u0E19 v{version}"},closedReason:{duplicate:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E01\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32 \u2014 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E19\u0E31\u0E48\u0E19",not_reproducible:"\u0E40\u0E23\u0E32\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E40\u0E01\u0E34\u0E14\u0E0B\u0E49\u0E33\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A\u0E2B\u0E32\u0E01\u0E40\u0E01\u0E34\u0E14\u0E02\u0E36\u0E49\u0E19\u0E2D\u0E35\u0E01",wont_fix:"\u0E40\u0E23\u0E32\u0E15\u0E31\u0E14\u0E2A\u0E34\u0E19\u0E43\u0E08\u0E44\u0E21\u0E48\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E2A\u0E48\u0E27\u0E19\u0E19\u0E35\u0E49",working_as_intended:"\u0E19\u0E35\u0E48\u0E40\u0E1B\u0E47\u0E19\u0E01\u0E32\u0E23\u0E17\u0E33\u0E07\u0E32\u0E19\u0E15\u0E32\u0E21\u0E17\u0E35\u0E48\u0E15\u0E31\u0E49\u0E07\u0E43\u0E08\u0E44\u0E27\u0E49",none:"\u0E1B\u0E34\u0E14\u0E41\u0E25\u0E49\u0E27"},others:{few:"\u0E04\u0E38\u0E13\u0E41\u0E25\u0E30\u0E2D\u0E35\u0E01\u0E44\u0E21\u0E48\u0E01\u0E35\u0E48\u0E04\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",many:"\u0E21\u0E35\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49"},timeline:{received:"\u0E04\u0E38\u0E13\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",reviewing:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A",duplicate_linked:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E01\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48 \u2014 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E35\u0E48\u0E19\u0E31\u0E48\u0E19",info_requested:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E16\u0E32\u0E21\u0E27\u0E48\u0E32: {text}",reporter_comment:"\u0E04\u0E38\u0E13",fix_started:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E41\u0E01\u0E49\u0E44\u0E02",fixed:"\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27 \u2014 \u0E08\u0E30\u0E21\u0E32\u0E43\u0E19\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E16\u0E31\u0E14\u0E44\u0E1B",released:"\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E43\u0E19 v{version} \u2014 \u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02",verified:"\u0E04\u0E38\u0E13\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E27\u0E48\u0E32\u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",reopened:"\u0E40\u0E1B\u0E34\u0E14\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"},categories:{bug:"\u0E1A\u0E31\u0E4A\u0E01",slow:"\u0E0A\u0E49\u0E32",visual:"\u0E41\u0E2A\u0E14\u0E07\u0E1C\u0E25\u0E1C\u0E34\u0E14",confusing:"\u0E2A\u0E31\u0E1A\u0E2A\u0E19",idea:"\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22"},ui:{yes:"\u0E43\u0E0A\u0E48",notYet:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48",empty:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35 \u2014 \u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E08\u0E30\u0E41\u0E2A\u0E14\u0E07\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32",loadError:"\u0E42\u0E2B\u0E25\u0E14\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49",retry:"\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",sending:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",sent:"\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27",sendFailed:"\u0E2A\u0E48\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",noReplies:"\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32",you:"\u0E04\u0E38\u0E13",developer:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32",addWords:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E2D\u0E35\u0E01\u0E40\u0E25\u0E47\u0E01\u0E19\u0E49\u0E2D\u0E22",developerReplied:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E15\u0E2D\u0E1A\u0E27\u0E48\u0E32: \u201C{text}\u201D",updates:"\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32 {n} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E43\u0E19\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",receipt:"\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E41\u0E08\u0E49\u0E07\u0E04\u0E38\u0E13\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32",trackIt:"\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21",done:"\u0E40\u0E2A\u0E23\u0E47\u0E08",emailOptIn:"\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25",emailPlaceholder:"you@example.com",emailSubmit:"\u0E2A\u0E48\u0E07\u0E04\u0E27\u0E32\u0E21\u0E04\u0E37\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25",emailCheckInbox:"\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E25\u0E48\u0E2D\u0E07\u0E08\u0E14\u0E2B\u0E21\u0E32\u0E22\u0E41\u0E25\u0E49\u0E27\u0E41\u0E15\u0E30\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19",emailInvalid:"\u0E14\u0E39\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E08\u0E30\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",emailFailed:"\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E17\u0E32\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 \u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E20\u0E32\u0E22\u0E2B\u0E25\u0E31\u0E07",toastReplied:"\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E41\u0E25\u0E49\u0E27",toastFixed:"\u0E1A\u0E31\u0E4A\u0E01\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02\u0E41\u0E25\u0E49\u0E27",view:"\u0E14\u0E39"}},td={en:Jc,ja:Qc,es:Zc,th:ed};Gs=new Set(["received","reviewing","reviewing_again","fixing"]);});var ba={};jt(ba,{accountView:()=>Ld,assistantView:()=>Ad,crossAppView:()=>Pd,detailView:()=>Td,initViews:()=>vd,leaderboardView:()=>Md,pickUpdateToast:()=>wd,renderOptIns:()=>ma,reportsView:()=>kd,roadmapView:()=>Id});function vd(t){({esc:_,btn:pe,renderHeader:$e,chipLabel:ha,skeleton:Dt,formatRelativeTime:ur,renderAppIconHtml:fa}=t);}function wd(t,e,r){let n=t.filter(d=>(d.unread_count??0)>0&&!Pt(d,e).hidden),i=n.reduce((d,p)=>d+(p.unread_count??0),0);if(!i)return null;if(n.length>1)return {text:ar(yt(e).ui.updates,{n:i}),reportId:null};let o=n[0],a=Pt(o,e),s=a.key==="fixing"||a.canVerify||!o.last_admin_reply_at&&a.key!=="waiting",u=o.title??o.summary??void 0;return {text:s?a.label:r,reportId:o.id,...u?{detail:u}:{}}}function ma(t){let e=t.locale.panel,r=[];if(t.channels.email&&t.callbacks.onReporterEmailOptIn){let n=t.rc.ui;t.emailState==="saved"?r.push(`<p class="mushi-note" role="status">\u2709 ${_(n.emailCheckInbox)}</p>`):(r.push(`<label class="mushi-check"><input type="checkbox" data-action="email-optin"${t.emailOptInOpen?" checked":""} /> ${_(n.emailOptIn)}</label>`),t.emailOptInOpen&&r.push(`<div class="mushi-inline-form"><input type="email" class="mushi-input" data-role="optin-email" autocomplete="email" aria-label="${_(n.emailOptIn)}" placeholder="${_(n.emailPlaceholder)}" value="${_(t.channels.emailPrefill)}" />${pe("save-email",_(n.emailSubmit),"mushi-btn",t.emailState==="saving"?' aria-busy="true"':"")}</div>${t.emailState==="invalid"||t.emailState==="error"?`<p class="mushi-note mushi-error-inline" role="alert">${_(t.emailState==="invalid"?n.emailInvalid:n.emailFailed)}</p>`:""}`));}return t.channels.push&&t.callbacks.onReporterPushSubscribe&&(r.push(t.pushState==="on"?`<p class="mushi-note" role="status">\u{1F514} ${_(e.notifyOn)}</p>`:pe("notify-me",`\u{1F514} ${_(e.notifyMe)}`,"mushi-btn",t.pushState==="asking"?' aria-busy="true"':"")),t.pushState==="error"&&r.push(`<p class="mushi-note mushi-error-inline" role="alert">${_(t.rc.ui.sendFailed)}</p>`)),r.length?`<div class="mushi-optins">${r.join("")}</div>`:""}function Xn(t,e){return `<span class="mushi-pill mushi-tone-${e}">${_(t)}</span>`}function ga(t){return t.title??t.summary??t.description??`#${t.id.slice(0,8)}`}function Sd(t,e){let r=(e??"").toLowerCase();return !r||r==="other"?"":ha(t,r==="feature_request"?"idea":r)}function xd(t){let e=r=>Date.parse(r.last_event_at??r.created_at)||0;return [...t].sort((r,n)=>+((n.unread_count??0)>0)-+((r.unread_count??0)>0)||e(n)-e(r))}function Rd(t,e){let r=Pt(e,t.lang);if(r.hidden)return "";let n=(e.unread_count??0)>0,i=[Sd(t,e.user_category),e.page,r.othersNote].filter(Boolean).map(s=>_(String(s))).join(" \xB7 "),o=e.last_event_preview&&(n||r.key==="waiting")?t.rc.ui.developerReplied.replace("{text}",e.last_event_preview):r.canVerify&&r.key!=="fixed_next"?r.detail:"",a=ga(e);return `<button type="button" class="mushi-report-row${n?" unread":""}" data-report-id="${_(e.id)}" aria-label="${_(`${r.label}: ${a}`)}"><span class="mushi-row-top">${Xn(r.label,r.tone)}<span class="mushi-row-title">${_(a)}</span><span class="mushi-row-when">${_(ur(e.last_event_at??e.created_at))}</span></span>${i?`<span class="mushi-row-meta">${i}</span>`:""}${o?`<span class="mushi-row-news">${_(o)}</span>`:""}</button>`}function kd(t){let e=t.rc,r=xd(t.reporterReports).map(i=>Rd(t,i)).join(""),n=t.reporterError?`<p class="mushi-error-inline" role="alert">${_(e.ui.loadError)} ${pe("retry-list",_(e.ui.retry),"mushi-link-btn")}</p>${r}`:r||(t.listLoading?Dt(t.locale.flows.reports.loading):`<p class="mushi-empty">${_(e.ui.empty)}</p>`);return {header:$e(t,t.locale.flows.reports.title,true),lead:"",body:`<div class="mushi-report-list">${n}</div>`,footer:""}}function _d(t,e){let r=t.rc,n=[];if(t.timeline)for(let i of t.timeline){let o=i.kind==="reporter_comment";n.push({kind:i.kind,at:i.at,text:Kn(i)?i.body??i.text:Ys(i,t.lang),talk:Kn(i),mine:o,who:o?r.ui.you:r.ui.developer});}else {e&&n.push({kind:"received",at:e.created_at,text:r.timeline.received});for(let i of t.reporterComments){let o=i.author_kind==="reporter";n.push({kind:o?"reporter_comment":"comment",at:i.created_at,text:i.body,talk:true,mine:o,who:o?r.ui.you:i.author_name??r.ui.developer});}}n.sort((i,o)=>(Date.parse(i.at)||0)-(Date.parse(o.at)||0));for(let i of t.pendingReplies)n.push({kind:"reporter_comment",at:"",text:i.body,who:r.ui.you,talk:true,mine:true,pending:i});return n}function Cd(t,e){let r=e.at?`<time datetime="${_(e.at)}">${_(ur(e.at))}</time>`:"";if(!e.talk)return `<li class="mushi-event"><span>${_(e.text)}</span>${r}</li>`;let n=!!e.mine,i=e.pending?e.pending.state==="sending"?`<span class="mushi-bubble-state">${_(t.rc.ui.sending)}</span>`:`<span class="mushi-bubble-state mushi-error-inline">${_(t.rc.ui.sendFailed)} \xB7 ${pe("retry-reply",_(t.rc.ui.retry),"mushi-link-btn",` data-value="${e.pending.id}"`)}</span>`:r;return `<li class="mushi-bubble ${n?"mine":"dev"}"><strong>${_(e.who??"")}</strong><p>${_(e.text)}</p>${i}</li>`}function Td(t){let e=t.rc,r=t.reporterReports.find(h=>h.id===t.selectedReportId),n=Pt(r??{status:"new"},t.lang),i=[r?.page,r?.app_version?`v${r.app_version}`:"",r?ur(r.created_at):""].filter(Boolean).map(h=>_(String(h))).join(" \xB7 "),o=`<div class="mushi-thread-summary"><p class="mushi-card-status">${Xn(n.label,n.tone)}</p><p class="mushi-note">${_(n.detail)}${n.othersNote?` ${_(n.othersNote)}.`:""}</p><p class="mushi-summary-text">${_(r?r.description??ga(r):`#${(t.selectedReportId??"").slice(0,8)}`)}</p>${r?.screenshot_thumb_url?`<img class="mushi-card-thumb" src="${_(r.screenshot_thumb_url)}" alt="" />`:""}${i?`<p class="mushi-note">${i}</p>`:""}</div>`,a=_d(t,r),s=a.some(h=>h.talk&&!h.mine),u;t.threadLoading&&a.length<=1&&!t.pendingReplies.length?u=Dt(t.locale.flows.thread.loading):u=`${t.threadError?`<p class="mushi-error-inline" role="alert">${_(e.ui.loadError)} ${pe("retry-thread",_(e.ui.retry),"mushi-link-btn")}</p>`:""}<ol class="mushi-timeline">${a.map(h=>Cd(t,h)).join("")}</ol>${!s&&!t.threadError&&!t.threadLoading?`<p class="mushi-empty">${_(e.ui.noReplies)}</p>`:""}`;let d=t.actionPending?' disabled aria-busy="true"':"",p=n.canVerify?`<div class="mushi-verify" role="group" aria-label="${_(n.detail)}">${pe("reporter-confirms",_(e.ui.yes),"mushi-btn",d)}${pe("reporter-not-fixed",_(e.ui.notYet),"mushi-btn",d)}</div>`:"";return {header:$e(t,t.locale.panel.reportTitle,true),lead:o,body:`<div class="mushi-thread">${u}</div>${ma(t)}`,footer:`${p}${t.actionError?`<p class="mushi-error-inline mushi-thread-action-error" role="alert">${_(t.actionError)}</p>`:""}<div class="mushi-thread-composer"><textarea class="mushi-input mushi-reply" data-role="reporter-reply" rows="1" maxlength="2000" placeholder="${_(t.locale.flows.thread.replyPlaceholder)}" aria-label="${_(t.locale.flows.thread.replyPlaceholder)}"></textarea>${pe("reporter-reply","\u2191","mushi-submit mushi-send",` aria-label="${_(t.locale.panel.send)}"`)}</div>`}}function Ad(t){let e=t.locale.assistant,r=t.callbacks.assistantGreeting||e.defaultGreeting,n=d=>d.length?`<div class="mushi-chips">${d.map(p=>`<button type="button" class="mushi-chip mushi-chip-sm" data-action="assistant-suggest" data-value="${_(p)}">${_(p)}</button>`).join("")}</div>`:"",i=(d,p="mushi-link-btn")=>pe("assistant-report",_(d),p),o=t.assistantTurns.length===0?`<p class="mushi-assistant-greeting">${_(r)}</p>${n(t.callbacks.assistantSuggestions??[])}`:t.assistantTurns.map(d=>`<div class="mushi-assistant-msg ${d.role==="user"?"mine":"dev"}">${_(d.text)}</div>${n(d.options??[])}${d.offerReport?i(e.fileReportCta,"mushi-btn"):""}`).join(""),a=t.assistantSending?`<div class="mushi-assistant-msg dev" role="status" aria-live="polite">${_(e.thinking)}</div>`:"",s=t.assistantError?`<p class="mushi-error-inline" role="alert">${_(t.assistantError)} ${i(e.fileReportCta)}</p>`:"",u=t.assistantTurns.length&&!t.assistantSending&&!t.assistantError?i(e.stillStuckCta):"";return {header:$e(t,t.callbacks.assistantLabel||e.defaultLabel,true),lead:"",body:`<div class="mushi-assistant-log">${o}${a}${s}${u}</div>`,footer:`<form class="mushi-thread-composer" data-action="assistant-send"><textarea class="mushi-input mushi-reply mushi-assistant-input" rows="1" placeholder="${_(e.inputPlaceholder)}" aria-label="${_(e.inputPlaceholder)}"${t.assistantSending?" disabled":""}></textarea><button type="submit" class="mushi-submit mushi-send" aria-label="${_(e.sendAriaLabel)}"${t.assistantSending?" disabled":""}>\u2191</button></form>`}}function Id(t){let e=t.locale.flows.roadmap,r=t.featureBoard.map(n=>{let i=String(n.id??""),o=!!n.my_vote,a=n.shipped_at?e.shipped:String(n.status_label??n.status??"open");return `<div class="mushi-report-row mushi-roadmap-row"><span class="mushi-row-top"><span class="mushi-row-title">${_(String(n.subject??e.untitled))}</span></span><span class="mushi-row-meta">${_(a)} \xB7 ${_(e.voteCount.replace("{n}",String(Number(n.vote_count??0))))}</span>${t.callbacks.onFeatureBoardVote?`<button type="button" class="mushi-btn" data-vote-id="${_(i)}" aria-pressed="${o}">${_(o?e.voted:e.vote)}</button>`:""}</div>`}).join("");return {header:$e(t,e.title,true),lead:"",body:`${t.reporterError?`<p class="mushi-error-inline" role="alert">${_(t.reporterError)}</p>`:""}${r||(t.listLoading?Dt(e.loading):`<p class="mushi-empty">${_(e.empty)}</p>`)}`,footer:""}}function Md(t){let e=t.locale.flows.leaderboard,r=t.globalLeaderboard!==null||t.globalLeaderboardLoading,n=r?t.globalLeaderboard??[]:t.leaderboardEntries??[],i=r?t.globalLeaderboardLoading:t.leaderboardLoading,o=n.map((s,u)=>{let d=s.rank||u+1;return `<li class="mushi-lb-row${t.testerReputation&&s.tester_id===t.testerReputation.tester_id?" me":""}"><span>#${d}</span><span class="mushi-row-title">${_(s.public_handle??s.display_name??e.anon)}</span><span>${(s.points_30d??s.total_points).toLocaleString()} pts</span></li>`}).join(""),a=t.testerReputation?.rank;return {header:$e(t,e.title,true),lead:"",body:`${i?Dt(e.loading):""}${!i&&!n.length?`<p class="mushi-empty">${_(e.empty)}</p>`:""}<ol class="mushi-lb">${o}</ol>${a?`<p class="mushi-note">${_(e.myRank.replace("{rank}",String(a)))}</p>`:t.testerJwt?"":pe("open-account",_(e.signInPrompt),"mushi-link-btn")}<p class="mushi-note">${_(e.footer)}</p>`,footer:""}}function Ld(t){let e=t.locale.flows.account,r=t.testerInfo;if(r){let n=r.public_handle??r.display_name??t.locale.flows.leaderboard.anon,i=t.testerReputation,o=i?e.rankSummary.replace("{rank}",String(i.rank??"\u2014")).replace("{points}",(i.points_30d??0).toLocaleString()):"";return {header:$e(t,e.title,true),lead:"",body:`<div class="mushi-thread-summary"><p class="mushi-summary-text">${_(n)}</p>${o?`<p class="mushi-note">${_(o)}</p>`:""}</div>${pe("open-cross-app-reports",_(e.crossAppReports),"mushi-menu-item")}${pe("open-global-leaderboard",_(e.viewLeaderboard),"mushi-menu-item")}${pe("sign-out-tester",_(e.signOut),"mushi-link-btn")}`,footer:""}}return t.magicLinkSent?{header:$e(t,e.checkEmailTitle,true),lead:"",body:`<p class="mushi-note">${_(e.magicLinkSent.replace("{email}",t.magicLinkEmail))}</p>${pe("resend-magic-link",_(e.resendEmail),"mushi-link-btn")}${t.magicLinkError?`<p class="mushi-error-inline" role="alert">${_(t.magicLinkError)}</p>`:""}`,footer:""}:{header:$e(t,e.joinTitle,true),lead:"",body:`<p class="mushi-note">${_(e.signInPrompt)}</p><input type="email" class="mushi-input" data-role="magic-link-email" aria-label="${_(e.emailLabel)}" placeholder="${_(e.emailPlaceholder)}" autocomplete="email" value="${_(t.magicLinkEmail)}" />${t.magicLinkError?`<p class="mushi-error-inline" role="alert">${_(t.magicLinkError)}</p>`:""}`,footer:`<span></span>${pe("send-magic-link",_(t.magicLinkSending?e.sending:e.sendLink),"mushi-submit",t.magicLinkSending?' aria-busy="true"':"")}`}}function Pd(t){let e=t.locale.flows.crossApp,r=t.crossAppReports??[],n=new Map;for(let o of r){let a=o.project_id??"unknown";n.has(a)||n.set(a,{name:o.app_name??e.unknownApp,slug:o.app_slug??null,domain:o.app_domain??null,reports:[]}),n.get(a).reports.push(o);}let i=[...n.entries()].map(([o,a])=>`<section class="mushi-xapp-group"><h3 class="mushi-xapp-app-name">${fa({projectId:o,appName:a.name,appSlug:a.slug,appDomain:a.domain})} ${_(a.name)}</h3>${a.reports.map(s=>{let u=Pt(s,t.lang);return `<div class="mushi-report-row"><span class="mushi-row-top">${Xn(u.label,u.tone)}<span class="mushi-row-title">${_(s.title??`#${s.short_id??s.id.slice(0,8)}`)}</span><span class="mushi-row-when">${_(ur(s.created_at))}</span></span></div>`}).join("")}</section>`).join("");return {header:$e(t,e.title,true),lead:"",body:`${t.crossAppLoading?Dt(e.loading):""}${!t.crossAppLoading&&!r.length?`<p class="mushi-empty">${_(e.empty)}</p>`:""}${i}`,footer:""}}var _,pe,$e,ha,Dt,ur,fa,Ea=qe(()=>{Vr();});var ou={};jt(ou,{grabMaskedTabFrame:()=>Wp});async function Wp(t,e){let r=await t,n=r.getVideoTracks?.()[0]?.getSettings?.().displaySurface;if(n&&n!=="browser")throw r.getTracks().forEach(s=>s.stop()),Object.assign(new Error("Only this tab can be captured"),{name:"NotAllowedError"});let i=e.join(","),o=document.createElement("style");o.setAttribute("data-mushi-capture-mask",""),o.textContent=`:is(${i}){background:#000!important;color:transparent!important;-webkit-text-fill-color:transparent!important;text-shadow:none!important}:is(${i}) *{visibility:hidden!important}`,document.head.appendChild(o);let a=document.createElement("video");try{a.muted=!0,a.srcObject=r,await a.play(),await new Promise(u=>setTimeout(u,150));let s=document.createElement("canvas");return s.width=a.videoWidth,s.height=a.videoHeight,s.getContext("2d")?.drawImage(a,0,0),s.toDataURL("image/jpeg",.7)}finally{r.getTracks().forEach(s=>s.stop()),a.srcObject=null,o.remove();}}var su=qe(()=>{});var au={};jt(au,{createScreenshotAnnotation:()=>Vp});function Vp(t,e){return new Promise((r,n)=>{let i=new Image;i.onload=()=>{let o=document.createElement("div");o.style.position="relative",o.style.display="inline-block",o.style.maxWidth="100%";let a=document.createElement("canvas"),s=document.createElement("canvas"),u=Math.min(1,720/i.width),d=Math.round(i.width*u),p=Math.round(i.height*u);for(let g of [a,s])g.width=d,g.height=p,g.style.width="100%",g.style.height="auto",g.style.display="block";s.style.position="absolute",s.style.left="0",s.style.top="0",s.style.cursor="crosshair";let h=a.getContext("2d"),k=s.getContext("2d");if(!h||!k){n(new Error("Canvas not supported"));return}h.drawImage(i,0,0,d,p),o.appendChild(a),o.appendChild(s),e.appendChild(o);let S="highlight",T=false,E=null,w=[],L=g=>{let m=s.getBoundingClientRect(),b="touches"in g?g.touches[0]??g.changedTouches[0]:null,C=b?b.clientX:g.clientX,P=b?b.clientY:g.clientY;return {x:(C-m.left)/m.width*d,y:(P-m.top)/m.height*p}},M=()=>{k.clearRect(0,0,d,p);for(let g of w)if(g.tool==="highlight"&&g.points.length>=2){let[m,b]=g.points;k.fillStyle="rgba(255, 230, 0, 0.35)",k.fillRect(Math.min(m.x,b.x),Math.min(m.y,b.y),Math.abs(b.x-m.x),Math.abs(b.y-m.y));}else if(g.tool==="arrow"&&g.points.length>=2){let[m,b]=g.points;k.strokeStyle="#ef4444",k.lineWidth=3,k.beginPath(),k.moveTo(m.x,m.y),k.lineTo(b.x,b.y),k.stroke();}},x=g=>{T=true,E=L(g);},f=g=>{if(!T||!E)return;T=false;let m=L(g);if(S==="blur"){let b=Math.min(E.x,m.x),C=Math.min(E.y,m.y),P=Math.abs(m.x-E.x),v=Math.abs(m.y-E.y);P>=1&&v>=1&&(h.filter="blur(8px)",h.drawImage(a,b,C,P,v,b,C,P,v),h.filter="none");}else w.push({tool:S,points:[E,m]});E=null,M();};s.addEventListener("mousedown",x),s.addEventListener("mouseup",f),s.addEventListener("touchstart",x,{passive:true}),s.addEventListener("touchend",f),r({canvas:a,setTool(g){S=g;},getDataUrl(){let g=document.createElement("canvas");g.width=d,g.height=p;let m=g.getContext("2d");return m?(m.drawImage(a,0,0),m.drawImage(s,0,0),g.toDataURL("image/jpeg",.85)):t},destroy(){s.removeEventListener("mousedown",x),s.removeEventListener("mouseup",f),s.removeEventListener("touchstart",x),s.removeEventListener("touchend",f),o.remove();}});},i.onerror=()=>n(new Error("Failed to load screenshot")),i.src=t;})}var uu=qe(()=>{});var Pu=4194304,Lo=1.5*1024*1024;function Du(t){try{return JSON.stringify(t)}catch{return null}}function $u(t,e=Pu){let r=Du(t);if(r===null)return {ok:false,bytes:0,maxBytes:e,serializeFailed:true,reason:"Report could not be serialized (circular reference in metadata?)"};let n=new TextEncoder().encode(r).length;return n<=e?{ok:true,bytes:n,maxBytes:e}:{ok:false,bytes:n,maxBytes:e,reason:`Report payload ${ho(n)} exceeds limit ${ho(e)}`}}function ho(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function Po(){try{let r=globalThis.crypto?.subtle;if(r&&typeof r.digest=="function"&&typeof r.importKey=="function"&&typeof r.sign=="function")return r}catch{}return null}function $r(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}async function nr(t){let e=Po();if(e){let n=await e.digest("SHA-256",new TextEncoder().encode(t));return $r(new Uint8Array(n))}let{sha256:r}=await Promise.resolve().then(()=>(mn(),fn));return $r(r(new TextEncoder().encode(t)))}async function Ou(t,e){let r=Po();if(r){let a=await r.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},false,["sign"]),s=await r.sign("HMAC",a,new TextEncoder().encode(e));return $r(new Uint8Array(s))}let{hmac:n}=await Promise.resolve().then(()=>(po(),co)),{sha256:i}=await Promise.resolve().then(()=>(mn(),fn)),o=n(i,new TextEncoder().encode(t),new TextEncoder().encode(e));return $r(o)}var Hu=60*1024;function Bu(t){return {mushiBeacon:true,path:t.path,headers:t.headers,body:t.body}}function Fu(t,e=typeof location<"u"?location.origin:""){if(!t)return false;if(t.startsWith("/"))return true;if(!e)return false;try{return new URL(t,e).origin===e}catch{return false}}function Nu(t){try{let e=t.startsWith("/")?new URL(t,"https://tunnel.local"):new URL(t);return `${e.pathname}${e.search}`}catch{return t}}function Uu(t){let e=t.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(e)try{return e(t.url,{method:"POST",headers:{"Content-Type":"application/json",...t.headers},body:t.body,keepalive:!0}),!0}catch{}let r=t.sendBeacon??(typeof navigator<"u"?navigator.sendBeacon?.bind(navigator):void 0);if(!r||!Fu(t.url))return false;let n=t.body;try{n=JSON.parse(t.body);}catch{n=t.body;}let i=JSON.stringify(Bu({path:t.path??Nu(t.url),headers:t.headers,body:n}));if(i.length>Hu)return false;try{return r(t.url,new Blob([i],{type:"application/json"}))}catch{return false}}var Do=false;function $o(){Do=true;}function qu(){return Do}var Sn=null;function Oo(){return Sn?Uu(Sn):false}var fo=false,ju="X-Mushi-User-Token",Wu="X-Mushi-Project",Vu="X-Mushi-SDK-Package",Ku="X-Mushi-SDK-Version";function zu(t){let e={"Content-Type":"application/json","X-Mushi-Api-Key":t.apiKey,[Wu]:t.projectId};return t.sdkPackage&&(e[Vu]=t.sdkPackage),t.sdkVersion&&(e[Ku]=t.sdkVersion),t.userToken&&(e[ju]=t.userToken),t.internalKind&&(e[Br]=t.internalKind),e}var Yt="https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api",Br="X-Mushi-Internal",ir="__mushiInternal";function Gu(t,e){let r=e?.trim();return r?r.replace(/\/$/,""):(t??Yt).replace(/\/$/,"")}var Yu=1e4,Xu=2,Ju=4,Qu=3e4,Zu=1e4;function Ho(t){let{projectId:e,apiKey:r,apiEndpoint:n=Yt,tunnel:i,timeout:o=Yu,maxRetries:a=Xu,getUserToken:s,sdkPackage:u,sdkVersion:d,circuitBreaker:p}=t,h=Gu(n,i),k=p?.enabled!==false,S=Math.max(1,p?.threshold??Ju),T=Math.max(1e3,p?.cooldownMs??Qu),E=0,w=0,L=()=>k&&w>Date.now(),M=()=>{E=0,w=0;},x=()=>{k&&(E+=1,E>=S&&(w=Date.now()+T));};async function f(m,b,C,P=a,v,K){let Y=v!=="reporter-poll";if(Y&&L())return {ok:false,error:{code:"CIRCUIT_OPEN",message:"Endpoint temporarily unavailable; retrying later."}};let ne=`${h}${b}`,j=new AbortController,ke=setTimeout(()=>j.abort(),o),Be=s?.()??null,me={...zu({apiKey:r,projectId:e,sdkPackage:u,sdkVersion:d,userToken:Be,internalKind:v}),...K},J=C?JSON.stringify(C):void 0;J&&m!=="GET"&&v!=="reporter-poll"&&(Sn={url:ne,headers:me,body:J,path:b});try{let O=await fetch(ne,{method:m,headers:me,body:J,keepalive:qu(),signal:j.signal,...v?{[ir]:v}:{}});if(clearTimeout(ke),O.status===307||O.status===308){let _e=O.headers.get("Location");if(_e&&P>0){let Ce=_e.replace(/\/v1\/.*$/,"").replace(/\/$/,"");if(Ce!==h)return h=Ce,f(m,b,C,P-1,v,K)}}if(!O.ok){let _e=await O.json().catch(()=>({}));if((O.status===401||O.status===403)&&!fo){fo=!0;let H=h===Yt?"Get the correct values at: https://kensaur.us/mushi-mushi/admin/projects":"Get the correct values from your Mushi console's Projects page.";console.error(`[Mushi] Credentials rejected (HTTP ${O.status}). Check your Project ID and API key scope (must be "report:write"). `+H);}let Ce=O.status===429,Le=O.status>=500||Ce,A=Ce?el(O.headers.get("Retry-After")):null,R=A===null||A<=Zu;return Le&&P>0&&R?(await mo(A??go(a-P)),f(m,b,C,P-1,v,K)):(Y&&(Le?x():M()),{ok:!1,error:{code:_e.error?.code||`HTTP_${O.status}`,message:_e.error?.message||_e.message||`HTTP ${O.status} error`,status:O.status}})}let G=await O.json(),re=G&&typeof G=="object"&&"ok"in G&&"data"in G?G.data:G;return Y&&M(),{ok:!0,data:re}}catch(O){return clearTimeout(ke),P>0&&tl(O)?(await mo(go(a-P)),f(m,b,C,P-1,v,K)):(Y&&x(),{ok:false,error:{code:"NETWORK_ERROR",message:O instanceof Error?O.message:"Unknown network error"}})}}async function g(m,b,C,P){try{let v=await nr(C),K=String(Date.now());return await f(m,b,P,a,"reporter-poll",{"X-Reporter-Token-Hash":v,"X-Reporter-Ts":K,"X-Reporter-Hmac":await Ou(r,`${e}.${K}.${v}`)})}catch(v){return {ok:false,error:{code:"NETWORK_ERROR",message:v instanceof Error?v.message:"Unknown error"}}}}return {async submitReport(m){let b=$u(m);return b.ok?f("POST","/v1/reports",m,a,"report-submit"):{ok:false,error:{code:b.serializeFailed?"SERIALIZE_FAILED":"PAYLOAD_TOO_LARGE",message:b.reason??"Report payload exceeds size limit"}}},async getReportStatus(m){return f("GET",`/v1/reports/${m}/status`,void 0,a,"report-status")},async getSdkConfig(){return f("GET","/v1/sdk/config",void 0,a,"sdk-config")},async askAssistant(m){return f("POST","/v1/sdk/assistant",{message:m.message,threadId:m.threadId??null,context:m.context??null},1,"community")},async getLatestSdkVersion(m){let b=new URLSearchParams({package:m}).toString();return f("GET",`/v1/sdk/latest-version?${b}`,void 0,a,"sdk-config")},async postDiscoveryEvent(m){return f("POST","/v1/sdk/discovery",m,1,"discovery")},async listReporterReports(m){return g("GET","/v1/reporter/reports",m)},reporterRequest:g,async listReporterComments(m,b){return g("GET",`/v1/reporter/reports/${m}/comments`,b)},async replyToReporterReport(m,b,C,P){return g("POST",`/v1/reporter/reports/${m}/reply`,b,{body:C,...P?{feedback_signal:P}:{}})},async reopenReporterReport(m,b,C){return g("POST",`/v1/reporter/reports/${m}/reopen`,b,{note:C??""})},async listNotifications(m,b){let C=new URLSearchParams;b?.since&&C.set("since",b.since),b?.limit&&C.set("limit",String(b.limit));let P=C.size?`?${C.toString()}`:"";return g("GET",`/v1/notifications${P}`,m)},async markNotificationRead(m,b){return g("POST",`/v1/notifications/${m}/read`,b,{})},async listReporterFeatureBoard(m){return g("GET","/v1/reporter/feature-board",m)},async voteReporterFeatureBoard(m,b){return g("POST",`/v1/reporter/feature-board/${m}/vote`,b,{})},async postSessionEvent(m){return f("POST","/v1/sdk/session",m,1,"discovery")},async postProductEvents(m){return f("POST","/v1/sdk/events",m,1,"discovery")},async submitActivity(m,b,C){return f("POST","/v1/sdk/activity",{user_id:m,user_traits:C?.userTraits,opted_in:C?.optedIn,reporter_token_hash:C?.reporterTokenHash,...C?.hostJwt?{host_jwt:C.hostJwt}:{},events:b},1,"discovery")},async getMyPoints(m){return f("GET",`/v1/sdk/me/points?userId=${encodeURIComponent(m)}`,void 0,1,"reporter-poll")},async getMyTier(m){return f("GET",`/v1/sdk/me/tier?userId=${encodeURIComponent(m)}`,void 0,1,"reporter-poll")},async getMyHistory(m,b){let C=new URLSearchParams({userId:m,...b?.limit?{limit:String(b.limit)}:{}});return f("GET",`/v1/sdk/me/history?${C}`,void 0,1,"reporter-poll")},async getHallOfFame(m=10){return f("GET",`/v1/sdk/hall-of-fame?limit=${m}`,void 0,1,"reporter-poll")},async sendMagicLink(m){return f("POST","/v1/tester/magic-link",{email:m},1,"community")},async linkReporterToken(m,b){return f("POST","/v1/tester/link-reporter",{reporter_token_hash:m},1,"community",{Authorization:`Bearer ${b}`})},async getCrossAppReports(m,b){let C=new URLSearchParams;b?.limit&&C.set("limit",String(b.limit)),b?.offset&&C.set("offset",String(b.offset));let P=C.size?`?${C.toString()}`:"";return f("GET",`/v1/tester/cross-app-reports${P}`,void 0,1,"community",{Authorization:`Bearer ${m}`})},async getMyReputation(m){return f("GET","/v1/tester/reputation",void 0,1,"community",{Authorization:`Bearer ${m}`})},async getPublicLeaderboard(m=20){return f("GET",`/v1/public/tester-leaderboard?limit=${m}`,void 0,1,"reporter-poll")},async getTesterStatus(m){return f("GET","/v1/me/tester-status",void 0,1,"community",{Authorization:`Bearer ${m}`})}}}function mo(t){return new Promise(e=>setTimeout(e,t))}function go(t){return Math.min(1e3*2**t+Math.random()*500,1e4)}function el(t,e=Date.now()){if(!t)return null;let r=t.trim();if(!r)return null;let n=Number(r);if(Number.isFinite(n))return n<0?null:n*1e3;let i=Date.parse(r);return Number.isNaN(i)?null:Math.max(i-e,0)}function tl(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof TypeError}function gn(t,e){if(!t||!e||e.length===0)return false;for(let r of e){if(typeof r=="string"){if(t.includes(r))return true;continue}try{if(r.test(t))return !0}catch{}}return false}function or(t){if(gn(t.message,t.ignoreErrors))return true;let e=t.filename?.trim()||"";return !!(e&&gn(e,t.denyUrls)||t.allowUrls&&t.allowUrls.length>0&&(!e||!gn(e,t.allowUrls)))}function bn(...t){return t.find(e=>e!==void 0&&e!=="")}function Se(t){try{let e=undefined;return typeof e=="object"&&e!==null?e[t]:void 0}catch{return}}function Ke(t){try{return t()}catch{return}}function Ln(){let t=bn(Se("VITE_MUSHI_PROJECT_ID"),Se("NEXT_PUBLIC_MUSHI_PROJECT_ID"),Se("NUXT_PUBLIC_MUSHI_PROJECT_ID"),Se("EXPO_PUBLIC_MUSHI_PROJECT_ID"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_PROJECT_ID),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_PROJECT_ID),Ke(()=>process.env.MUSHI_PROJECT_ID)),e=bn(Se("VITE_MUSHI_API_KEY"),Se("NEXT_PUBLIC_MUSHI_API_KEY"),Se("NUXT_PUBLIC_MUSHI_API_KEY"),Se("EXPO_PUBLIC_MUSHI_API_KEY"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_API_KEY),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_API_KEY),Ke(()=>process.env.MUSHI_API_KEY)),r=bn(Se("VITE_MUSHI_API_ENDPOINT"),Se("NEXT_PUBLIC_MUSHI_API_ENDPOINT"),Se("NUXT_PUBLIC_MUSHI_API_ENDPOINT"),Se("EXPO_PUBLIC_MUSHI_API_ENDPOINT"),Ke(()=>process.env.NEXT_PUBLIC_MUSHI_API_ENDPOINT),Ke(()=>process.env.EXPO_PUBLIC_MUSHI_API_ENDPOINT),Ke(()=>process.env.MUSHI_API_ENDPOINT)),n={};return t&&(n.projectId=t),e&&(n.apiKey=e),r&&(n.apiEndpoint=r),n}var rl=["VITE_","NEXT_PUBLIC_","NUXT_PUBLIC_","EXPO_PUBLIC_",""],nl={projectId:"MUSHI_PROJECT_ID",apiKey:"MUSHI_API_KEY"};function Bo(){let t=Ln(),e=[];if(t.projectId||e.push("projectId"),t.apiKey||e.push("apiKey"),e.length===0)return {resolved:t,missing:e,nearMisses:[],message:null};let r=(()=>{try{let s=undefined;return typeof s=="object"&&s!==null?s:null}catch{return null}})(),n=(()=>{try{return typeof process<"u"&&process.env?process.env:null}catch{return null}})(),i=[];for(let s of e)for(let u of rl){let d=`${u}${nl[s]}`;r&&r[d]?i.push({field:s,key:d,via:"import.meta.env"}):n&&n[d]&&i.push({field:s,key:d,via:"process.env"});}let o=r?"VITE_MUSHI_*":"NEXT_PUBLIC_MUSHI_* (Next.js), EXPO_PUBLIC_MUSHI_* (Expo), or MUSHI_* (Node / React Native)",a=[`[mushi] Missing ${e.join(" and ")} \u2014 the SDK will not initialize.`];for(let s of i)a.push(`[mushi] Found ${s.key} in ${s.via}, but this runtime did not resolve it \u2014 it is either the wrong prefix for your bundler or not exposed to the client bundle.`);return a.push(`[mushi] This runtime reads: ${o}. Set the matching variable(s) and restart your dev server.`),i.length===0&&a.push("[mushi] If you already set the variable, check the prefix: a mis-prefixed var is stripped from client bundles and resolves to undefined with no error."),{resolved:t,missing:e,nearMisses:i,message:a.join(`
|
|
2
2
|
`)}}var bo=["production-calm","beta-loud","internal-debug","manual-only","minimal","standard","full"],il=["projectId","apiKey","apiEndpoint","tunnel","timeout","maxRetries","circuitBreaker","preset","runtimeConfig","analytics","trackSessions","sentry","widget","notifications","capture","privacy","proactive","preFilter","integrations","offline","rewards","assistant","debug","enabled","appVersion","sampleRate","replaySampleRate","replaysOnErrorSampleRate","beforeSend","beforeSendFeedback","ignoreErrors","denyUrls","allowUrls","onCrashedLastRun"];function ol(t){switch(t){case "manual-only":return {widget:{trigger:"manual",outdatedBanner:"console-only"},capture:{console:true,network:true,performance:false,screenshot:"on-report",elementSelector:false},proactive:{rageClick:false,longTask:false,apiCascade:false,errorBoundary:false}};case "beta-loud":return {widget:{trigger:"auto",outdatedBanner:"banner"},capture:{console:true,network:true,performance:true,screenshot:"auto",elementSelector:true},proactive:{rageClick:true,longTask:true,apiCascade:true,errorBoundary:true}};case "internal-debug":return {widget:{trigger:"auto",outdatedBanner:"banner",brandFooter:true},capture:{console:true,network:true,performance:true,screenshot:"auto",elementSelector:true},proactive:{rageClick:true,longTask:true,apiCascade:true,errorBoundary:true,cooldown:{maxProactivePerSession:10,dismissCooldownHours:0,suppressAfterDismissals:99}}};case "production-calm":return {widget:{trigger:"auto",outdatedBanner:"console-only"},capture:{console:true,network:true,performance:false,screenshot:"on-report",elementSelector:false},proactive:{rageClick:false,longTask:false,apiCascade:false,errorBoundary:false}};case "minimal":return {widget:{trigger:"auto"},capture:{console:true,network:false,performance:false,screenshot:"on-report",replay:"off",elementSelector:false},proactive:{rageClick:false,longTask:false,apiCascade:false,errorBoundary:false}};case "full":return {widget:{trigger:"auto"},capture:{console:true,network:true,performance:true,screenshot:"auto",replay:"lite",elementSelector:true},proactive:{rageClick:true,longTask:true,apiCascade:true,errorBoundary:true}};default:return}}function Fo(t){let e=ol(t.preset);return e?{...t,widget:{...e.widget,...t.widget},capture:{...e.capture,...t.capture},proactive:{...e.proactive,...t.proactive,cooldown:{...e.proactive?.cooldown,...t.proactive?.cooldown}}}:t}function sl(){let t=e=>e==="1"||e==="true";try{if(typeof process<"u"&&process.env&&t(process.env.MUSHI_SILENT))return !0}catch{}try{let e=undefined;if(e&&typeof e=="object"&&(t(e.MUSHI_SILENT)||t(e.VITE_MUSHI_SILENT)))return !0}catch{}return false}function No(t){try{if(sl()||!t||typeof t!="object")return;let e=Object.keys(t).filter(r=>!il.includes(r));e.length>0&&console.error(`[mushi] Unknown config key${e.length>1?"s":""}: ${e.map(r=>`\`${r}\``).join(", ")} \u2014 check for typos (see MushiConfig). Ignored.`),t.preset!==void 0&&!bo.includes(t.preset)&&console.error(`[mushi] Unknown preset \`${String(t.preset)}\` \u2014 expected one of ${bo.map(r=>`'${r}'`).join(", ")}. Preset ignored.`);}catch{}}var al=10,ul=2e3,ll=[/^(.)\1{10,}$/,/^[A-Z\s!?]{20,}$/,/^[\d\s]+$/,/^[^a-zA-Z\u00C0-\u024F\u4E00-\u9FFF\u3040-\u309F\u30A0-\u30FF]{10,}$/,/^(asdf|qwerty|lorem ipsum)[.,!?\s]*$/i],cl=/^[bcdfghjklmnpqrstvwxz]{6,}/i;function Uo(t={}){let{enabled:e=true,blockObviousSpam:r=true,minDescriptionLength:n=al,maxDescriptionLength:i=ul}=t;function o(s){if(!e)return {passed:true};let u=s.trim();if(u.length<n)return {passed:false,reason:`Too short (min ${n} characters)`};if(u.length>i)return {passed:false,reason:`Too long (max ${i} characters)`};if(r){for(let p of ll)if(p.test(u))return {passed:false,reason:"Detected as spam"};if(cl.test(u))return {passed:false,reason:"Detected as gibberish"};if(u.split(/\s+/).filter(p=>p.length>1).length<2)return {passed:false,reason:"Description needs at least 2 words"}}return {passed:true}}function a(s){let u=s.trim();return u.length<=i?u:u.slice(0,i)+"..."}return {check:o,truncate:a}}var Eo={debug:10,info:20,warn:30,error:40,fatal:50,silent:99},dl={debug:"DBG",info:"INF",warn:"WRN",error:"ERR",fatal:"FTL"},Ee={reset:"\x1B[0m",dim:"\x1B[2m",bold:"\x1B[1m",cyan:"\x1B[36m",green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",white:"\x1B[37m",bgRed:"\x1B[41m"},pl={debug:Ee.dim,info:Ee.green,warn:Ee.yellow,error:Ee.red,fatal:`${Ee.bgRed}${Ee.white}${Ee.bold}`};function hl(){try{if(typeof globalThis.Deno<"u")return "json"}catch{}let t=typeof globalThis.process<"u"?globalThis.process:void 0;if(t?.env){if(t.env.NODE_ENV==="production"||t.env.LOG_FORMAT==="json")return "json";if(t.env.LOG_FORMAT==="pretty"||t.stdout?.isTTY)return "pretty"}return typeof globalThis.window<"u"?"pretty":"json"}function fl(t){let e=[];for(let[r,n]of Object.entries(t))n!=null&&(typeof n=="object"?e.push(`${r}=${JSON.stringify(n)}`):e.push(`${r}=${String(n)}`));return e.join(" ")}function ml(t){let{ts:e,level:r,scope:n,msg:i,...o}=t,a=e.slice(11,23),s=pl[r]??"",u=dl[r]??r.toUpperCase(),d=Object.keys(o).length>0?` ${Ee.dim}${fl(o)}${Ee.reset}`:"";return `${Ee.dim}${a}${Ee.reset} ${s}${u}${Ee.reset} ${Ee.cyan}[${n}]${Ee.reset} ${i}${d}`}function gl(t){return JSON.stringify(t)}function bl(t){return t==="stderr"?(e,r)=>{console.error(r);}:(e,r)=>{switch(e){case "error":case "fatal":console.error(r);break;case "warn":console.warn(r);break;default:console.log(r);}}}function qo(t,e,r,n,i){let o=e;function a(s,u,d){if(Eo[s]<Eo[o])return;let p={ts:new Date().toISOString(),level:s,scope:t,msg:u,...r,...d};i(s,n(p));}return {debug:(s,u)=>a("debug",s,u),info:(s,u)=>a("info",s,u),warn:(s,u)=>a("warn",s,u),error:(s,u)=>a("error",s,u),fatal:(s,u)=>a("fatal",s,u),child(s,u){return qo(`${t}:${s}`,o,{...r,...u},n,i)},setLevel(s){o=s;}}}function Tt(t){let{scope:e,level:r="info",meta:n={},format:i="auto",destination:o="stdout"}=t,s=(i==="auto"?hl():i)==="json"?gl:ml,u=bl(o);return qo(e,r,n,s,u)}var Pn={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},fatal:()=>{},child:()=>Pn,setLevel:()=>{}},El="mushi-mushi-keyring",dt="keys",jo="offline-queue/v1",Ir=null,Mr=null;function yl(){return typeof globalThis<"u"&&typeof globalThis.crypto<"u"&&typeof globalThis.crypto.subtle<"u"&&typeof indexedDB<"u"}function Wo(){return new Promise((t,e)=>{let r=indexedDB.open(El,1);r.onupgradeneeded=()=>{try{let n=r.result;if(!n)return;n.objectStoreNames.contains(dt)||n.createObjectStore(dt);}catch{}},r.onsuccess=()=>{let n=r.result;if(!n||!n.objectStoreNames.contains(dt)){try{n?.close();}catch{}e(new Error("key object store unavailable"));return}t(n);},r.onerror=()=>e(r.error);})}async function vl(){let t=await Wo();return new Promise((e,r)=>{let i=t.transaction(dt,"readonly").objectStore(dt).get(jo);i.onsuccess=()=>e(i.result??null),i.onerror=()=>r(i.error);})}async function wl(t){let e=await Wo();return new Promise((r,n)=>{let i=e.transaction(dt,"readwrite");i.objectStore(dt).put(t,jo),i.oncomplete=()=>r(),i.onerror=()=>n(i.error);})}async function Vo(){if(Ir)return Ir;if(Mr)return Mr;if(!yl())throw new Error("Web Crypto + IndexedDB required for offline queue encryption");return Mr=(async()=>{let t=await vl();if(t)return Ir=t,t;let e=await crypto.subtle.generateKey({name:"AES-GCM",length:256},false,["encrypt","decrypt"]);return await wl(e),Ir=e,e})(),Mr}function yo(t){let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e)}function vo(t){let e=atob(t),r=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}async function Sl(t){let e=await Vo(),r=crypto.getRandomValues(new Uint8Array(12)),n=new TextEncoder().encode(JSON.stringify(t)),i=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,n));return {_mme:1,iv:yo(r),ct:yo(i)}}function xl(t){return !!t&&typeof t=="object"&&t._mme===1&&typeof t.iv=="string"&&typeof t.ct=="string"}async function Rl(t){let e=await Vo(),r=vo(t.iv),n=vo(t.ct),i=await crypto.subtle.decrypt({name:"AES-GCM",iv:r},e,n);return JSON.parse(new TextDecoder().decode(i))}var xe=Tt({scope:"mushi:queue",level:"warn"}),kl="mushi-mushi",fe="offline-reports",_l=1,En="mushi_offline_queue",Cl=10,Tl=6e4,Al=3e4,Il=8,Ml=1440*60*1e3;function Ko(t={}){let{enabled:e=true,maxQueueSize:r=50,syncOnReconnect:n=true,encryptAtRest:i=true}=t,o=null,a=null,s=null,u=null,d=null;async function p(A){let R=new Date().toISOString();if(!i)return {...A,queuedAt:R};try{let H=await Sl(A);return {id:A.id,queuedAt:R,payload:H}}catch(H){return xe.warn("Offline queue: encryption failed, storing plaintext",{err:String(H)}),{...A,queuedAt:R}}}async function h(A){if(k(A))try{return await Rl(A.payload)}catch(R){return xe.warn("Offline queue: decrypt failed, dropping row",{err:String(R),id:A.id}),null}return A}function k(A){return !!A.payload&&xl(A.payload)}function S(A){let R=A.attempts;return typeof R=="number"&&Number.isFinite(R)?R:0}function T(A,R){let H=A.queuedAt;if(!H)return false;let F=Date.parse(H);return Number.isNaN(F)?false:R-F>Ml}function E(){return s||(typeof indexedDB<"u"?s="indexeddb":typeof localStorage<"u"?s="localstorage":s="none",s)}function w(){return new Promise((A,R)=>{let H=indexedDB.open(kl,_l);H.onupgradeneeded=()=>{try{let F=H.result;if(!F)return;F.objectStoreNames.contains(fe)||F.createObjectStore(fe,{keyPath:"id"});}catch{}},H.onsuccess=()=>{let F=H.result;if(!F||!F.objectStoreNames.contains(fe)){s="localstorage";try{F?.close();}catch{}R(new Error("queue object store unavailable"));return}A(F);},H.onerror=()=>{s="localstorage",R(H.error);};})}async function L(A){let R=await w(),H=await p(A);return new Promise((F,U)=>{let X=R.transaction(fe,"readwrite");X.objectStore(fe).put(H),X.oncomplete=()=>F(),X.onerror=()=>U(X.error);})}async function M(){let A=await w();return new Promise((R,H)=>{let U=A.transaction(fe,"readonly").objectStore(fe).getAll();U.onsuccess=()=>R(U.result),U.onerror=()=>H(U.error);})}async function x(A){let R=await w();return new Promise((H,F)=>{let U=R.transaction(fe,"readwrite");U.objectStore(fe).delete(A),U.oncomplete=()=>H(),U.onerror=()=>F(U.error);})}async function f(A){let R=await w();return new Promise((H,F)=>{let U=R.transaction(fe,"readwrite");U.objectStore(fe).put(A),U.oncomplete=()=>H(),U.onerror=()=>F(U.error);})}async function g(){let A=await w();return new Promise((R,H)=>{let U=A.transaction(fe,"readonly").objectStore(fe).count();U.onsuccess=()=>R(U.result),U.onerror=()=>H(U.error);})}async function m(){let A=await w();return new Promise((R,H)=>{let F=A.transaction(fe,"readwrite");F.objectStore(fe).clear(),F.oncomplete=()=>R(),F.onerror=()=>H(F.error);})}function b(){try{let A=localStorage.getItem(En);return A?JSON.parse(A):[]}catch{return []}}function C(A){try{localStorage.setItem(En,JSON.stringify(A));}catch{}}async function P(A){let R=b(),H=await p(A),F=R.findIndex(U=>U.id===A.id);F>=0?R[F]=H:R.push(H),C(R);}function v(A){let R=b().filter(H=>H.id!==A);C(R);}function K(A){let R=b(),H=R.findIndex(F=>F.id===A.id);H>=0&&(R[H]=A,C(R));}async function Y(A,R){try{A==="indexeddb"?await x(R):v(R);}catch(H){xe.debug("Offline queue: row removal failed (will age out)",{id:R,err:String(H)});}}async function ne(A,R){try{return A==="indexeddb"?await f(R):K(R),!0}catch(H){return xe.debug("Offline queue: row persist failed",{id:R.id,err:String(H)}),false}}async function j(){let A=E();if(A==="none")return {backend:A,rows:[]};if(A==="indexeddb")try{return {backend:A,rows:await M()}}catch{s="localstorage";}return {backend:"localstorage",rows:b()}}async function ke(A){let R=E();if(R==="none")return xe.debug("Offline queue: no storage backend, dropping report",{id:A.id}),R;if(R==="indexeddb")try{return await L(A),R}catch{s="localstorage";}return await P(A),"localstorage"}async function Be(A){if(!e)return;if(await re()>=r){xe.warn("Offline queue full \u2014 dropping report",{maxQueueSize:r});return}await ke(A);}function me(A){return Math.min(1e3*2**A+Math.random()*500,Tl)}function J(A){return new Promise(R=>setTimeout(R,A))}async function O(A){let{backend:R,rows:H}=await j(),F=H,U=Date.now(),X=[];for(let he of F)if(T(he,U)){let ie=he.id;await Y(R,ie),xe.debug("Offline queue: evicting stale report",{id:ie});}else X.push(he);F=X;let Xe=F.slice(0,Cl),Fe=0,it=0;for(let he=0;he<Xe.length;he++){let ie=Xe[he],ge=ie.id,Nt=await h(ie);if(!Nt){await Y(R,ge),it++;continue}let z=await A.submitReport(Nt);if(z.ok){await Y(R,ge),Fe++;continue}if(it++,z.error?.code==="CIRCUIT_OPEN"){xe.debug("Offline queue: circuit open, deferring the rest of the batch",{id:ge,remaining:Xe.length-he});break}let Ut=z.error?.code==="HTTP_400"||z.error?.code==="HTTP_413"||z.error?.code==="HTTP_422"||z.error?.code==="INGEST_ERROR"||z.error?.code==="VALIDATION_ERROR"||z.error?.code==="PAYLOAD_TOO_LARGE"||z.error?.code==="SERIALIZE_FAILED"||typeof z.error?.message=="string"&&/invalid payload|description must be at least|validation/i.test(z.error.message),ot=!Ut&&(z.error?.code==="NETWORK_ERROR"||z.error?.code==="HTTP_403"||z.error?.code==="HTTP_429"||z.error?.code==="HTTP_502"||z.error?.code==="HTTP_503"||z.error?.code==="HTTP_504"||typeof z.error?.code=="string"&&z.error.code.startsWith("HTTP_5"));if(Ut)await Y(R,ge);else {let st=S(ie)+1;st>=Il?(await Y(R,ge),xe.warn("Offline queue: giving up on report after repeated failures",{id:ge,attempts:st,code:z.error?.code})):(ie.attempts=st,await ne(R,ie)?xe.debug("Offline queue: delivery failed, will retry",{id:ge,attempts:st,code:z.error?.code,classified:ot?"transient":"unclassified"}):(await Y(R,ge),xe.warn("Offline queue: dropping report (attempt counter unpersistable)",{id:ge,code:z.error?.code})));}he<Xe.length-1&&await J(me(he));}return {sent:Fe,failed:it}}function G(A){if(!e)return Promise.resolve({sent:0,failed:0});if(u)return d||(d=u.catch(()=>{}).then(()=>(d=null,G(A)))),d;let R=O(A).finally(()=>{u===R&&(u=null);});return u=R,R}async function re(){if(E()==="indexeddb")try{return await g()}catch{s="localstorage";}return b().length}async function _e(){if(E()==="indexeddb")try{await m();}catch{}try{localStorage.removeItem(En);}catch{}}function Ce(A){if(!e||!n||typeof window>"u")return;o&&Le();let R=()=>{navigator.onLine&&G(A).catch(H=>{xe.warn("Offline queue auto-flush failed",{err:String(H)});});};window.addEventListener("online",R),a=setInterval(()=>{re().then(H=>{H>0&&R();});},Al),o=()=>{window.removeEventListener("online",R),a&&(clearInterval(a),a=null);};}function Le(){o?.(),o=null;}return {enqueue:Be,flush:G,size:re,clear:_e,startAutoSync:Ce,stopAutoSync:Le}}function Dn(){let t=typeof navigator<"u"?navigator:void 0,e=typeof window<"u"?window:void 0,r=typeof document<"u"?document:void 0,n=typeof screen<"u"?screen:void 0;Pl(t);let i=t&&"connection"in t?t.connection:void 0,o=e,a=!!o?.Capacitor,s=!!o?.cordova,u=t?.product==="ReactNative"||typeof globalThis.HermesInternal<"u",d=a||s||u?{...a?{capacitor:true}:{},...s?{cordova:true}:{},...u?{reactNative:true}:{}}:void 0;return {userAgent:t?.userAgent??"unknown",platform:t?.platform??"unknown",language:t?.language??"en",viewport:{width:e?.innerWidth??0,height:e?.innerHeight??0},url:e?.location?.href??"",referrer:r?.referrer??"",timestamp:new Date().toISOString(),timezone:Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone??"UTC",connection:i?{effectiveType:i.effectiveType,downlink:i.downlink,rtt:i.rtt}:void 0,deviceMemory:t?.deviceMemory,hardwareConcurrency:t?.hardwareConcurrency,route:e?.location?.pathname,nearestTestid:Ll(r),userAgentData:$l(t),screen:Ol(n,e),prefersColorScheme:Hl(e),prefersReducedMotion:Re(e,"(prefers-reduced-motion: reduce)"),prefersReducedData:Re(e,"(prefers-reduced-data: reduce)"),prefersContrast:Bl(e),forcedColors:Re(e,"(forced-colors: active)"),online:typeof t?.onLine=="boolean"?t.onLine:void 0,displayMode:Fl(e),documentTitle:r?.title?.slice(0,200),buildId:Nl(r),pageLoadTiming:Ul(e),...d?{native:d}:{}}}function Ll(t){if(!t)return;let e=t.activeElement??null,r=0;for(;e&&r<20;){let n=e.getAttribute?.("data-testid");if(n)return n;e=e.parentElement,r++;}}var Ie=null,wo=false;function Pl(t){if(wo)return;let e=t?.userAgentData;e?.getHighEntropyValues&&(wo=true,e.getHighEntropyValues(["architecture","bitness","model","platformVersion","uaFullVersion","fullVersionList"]).then(r=>{Ie=r;}).catch(()=>{}));}function Dl(t){if(!t?.length)return;let e=t.filter(n=>!/not.?a.?brand/i.test(n.brand));return e.length===0?void 0:e.find(n=>!/chromium|google chrome/i.test(n.brand))??e[0]}function $l(t){let e=t?.userAgentData;if(!e&&!Ie)return;let r=Ie?.fullVersionList,n=Dl(r??e?.brands),i={};return n&&(i.browser=n.brand,i.browserVersion=n.version),e?.platform&&(i.os=e.platform),Ie?.platformVersion&&(i.osVersion=Ie.platformVersion),typeof e?.mobile=="boolean"&&(i.mobile=e.mobile),Ie?.model&&(i.model=Ie.model),Ie?.architecture&&(i.architecture=Ie.architecture),Ie?.bitness&&(i.bitness=Ie.bitness),Object.keys(i).length===0?void 0:i}function Ol(t,e){if(!t&&!e)return;let r={};typeof t?.width=="number"&&(r.width=t.width),typeof t?.height=="number"&&(r.height=t.height),typeof e?.devicePixelRatio=="number"&&(r.devicePixelRatio=e.devicePixelRatio),typeof t?.colorDepth=="number"&&(r.colorDepth=t.colorDepth);let n=t?.orientation?.type;return n&&(r.orientation=n),Object.keys(r).length===0?void 0:r}function Re(t,e){if(t?.matchMedia)try{return t.matchMedia(e).matches}catch{return}}function Hl(t){if(t?.matchMedia)return Re(t,"(prefers-color-scheme: dark)")?"dark":Re(t,"(prefers-color-scheme: light)")?"light":"no-preference"}function Bl(t){if(t?.matchMedia)return Re(t,"(prefers-contrast: more)")?"more":Re(t,"(prefers-contrast: less)")?"less":Re(t,"(prefers-contrast: custom)")?"custom":"no-preference"}function Fl(t){if(t?.matchMedia){if(Re(t,"(display-mode: fullscreen)"))return "fullscreen";if(Re(t,"(display-mode: standalone)"))return "standalone";if(Re(t,"(display-mode: minimal-ui)"))return "minimal-ui";if(Re(t,"(display-mode: browser)"))return "browser"}}function Nl(t){if(!t)return;let r=t.querySelector?.('meta[name="mushi:build"]')?.content?.trim();if(r)return r.slice(0,64)}function Ul(t){let e=t?.performance;if(!e?.getEntriesByType)return;let r;try{r=e.getEntriesByType("navigation")[0];}catch{return}if(!r)return;let n=r.startTime??0,i={};return r.domContentLoadedEventEnd>0&&(i.domContentLoadedMs=Math.round(r.domContentLoadedEventEnd-n)),r.loadEventEnd>0&&(i.loadCompleteMs=Math.round(r.loadEventEnd-n)),r.responseStart>0&&(i.timeToFirstByteMs=Math.round(r.responseStart-n)),typeof r.type=="string"&&(i.navigationType=r.type),Object.keys(i).length===0?void 0:i}var yn="mushi_reporter_token";function ql(t){return `mushi:reporter-token:${t}`}function So(){if(typeof crypto<"u"&&crypto.randomUUID)return `mushi_${crypto.randomUUID()}`;let t=new Uint8Array(16);if(typeof crypto<"u")crypto.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);return `mushi_${Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}`}function vn(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(t);return e&&e.length>0?e:null}catch{return null}}function xo(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem(t,e);}catch{}}function te(t){if(!t){let o=vn(yn);if(o)return o;let a=So();return xo(yn,a),a}let e=ql(t),r=vn(e);if(r)return r;let i=vn(yn)??So();return xo(e,i),i}function $n(){let t=typeof crypto<"u"?crypto:void 0;if(t?.randomUUID)return t.randomUUID();let e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return `${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}var Ro="mushi_fingerprint_hash";function jl(){let t=typeof navigator<"u"?navigator:void 0,e=typeof screen<"u"?screen:void 0,r=typeof window<"u"?window:void 0;return {userAgent:t?.userAgent??"unknown",platform:t?.platform??"unknown",language:t?.language??"en",timezone:Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone??"UTC",screenWidth:e?.width??0,screenHeight:e?.height??0,pixelRatio:r?.devicePixelRatio??1,deviceMemory:t?.deviceMemory,hardwareConcurrency:t?.hardwareConcurrency}}async function Wl(t){if(typeof crypto<"u"&&crypto.subtle){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return `fbk_${(e>>>0).toString(16).padStart(8,"0")}`}async function zo(){if(typeof localStorage<"u"){let n=localStorage.getItem(Ro);if(n)return n}let t=jl(),e=JSON.stringify(t),r=await Wl(e);if(typeof localStorage<"u")try{localStorage.setItem(Ro,r);}catch{}return r}var ko="mushi_session_id",Lr=null;function bt(){if(Lr)return Lr;if(typeof sessionStorage<"u"){let e=sessionStorage.getItem(ko);if(e)return Lr=e,e}let t=Vl();if(Lr=t,typeof sessionStorage<"u")try{sessionStorage.setItem(ko,t);}catch{}return t}function Vl(){return `ms_${Date.now().toString(36)}_${Kl()}`}function Kl(){let t=typeof crypto<"u"?crypto:void 0,e=new Uint8Array(4);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);let r=0;for(let n of e)r=r*256+n>>>0;return r.toString(36).padStart(6,"0").slice(0,6)}var zl=/HeadlessChrome|PhantomJS|Lighthouse|\bbot\b|bot[/-]|crawler|spider/i;function Go(t){return "mushi_events_consent_"+t}var xn=new Set;function Gl(){if(typeof navigator>"u")return false;let t=navigator;if(t.globalPrivacyControl===true)return true;let e=typeof window<"u"?window.doNotTrack:void 0,r=t.doNotTrack??t.msDoNotTrack??e;return r==="1"||r==="yes"}function Yl(){return typeof navigator>"u"?false:navigator.webdriver===true?true:zl.test(navigator.userAgent??"")}function Yo(t){return t?.enabled===false?"disabled":t?.respectDoNotTrack!==false&&Gl()?"dnt":t?.excludeBots!==false&&Yl()?"automation":null}function Xl(t){if(!t)return null;try{let e=localStorage.getItem(Go(t));return e==="granted"||e==="denied"?e:null}catch{return null}}function Jl(t,e){if(t)try{localStorage.setItem(Go(t),e);}catch{}}function Xo(t,e){let r=Xl(t);return e?.consent==="required"?r??"pending":r==="denied"?"denied":"granted"}function Ql(t,e){Jl(t,e);for(let r of [...xn])try{r(e);}catch{}}function Jo(t){return xn.add(t),()=>{xn.delete(t);}}var Zl=6e4,Xt=null,Qo,On=null,Zo=null,Hn=0,Pr=null,Jt=false,Qt=false,Rn=false,kn=null;function ec(){return new Date().toISOString()}function mt(){return typeof window>"u"?"":window.location.pathname}function tc(){if(typeof document>"u"||!document.referrer)return null;try{return new URL(document.referrer).origin}catch{return null}}function rc(){return typeof navigator>"u"?null:navigator.userAgent??null}function Zt(t,e){return {kind:t,session_id:bt(),ts:ec(),page_view_count:Hn,reporter_token_hash:Zo,user_id_hash:On,user_agent:rc(),sdk_version:Qo,...e}}function er(t){!Xt||!Qt||Xt.postSessionEvent(t).catch(()=>{});}function _n(t){Qt&&(Hn+=1,er(Zt("page_view",{route:t})));}function _o(){Qt||!Jt||(Qt=true,Rn||(Rn=true,Hn=1,er(Zt("session_start",{route:mt(),referrer:tc()}))),Pr=setInterval(()=>{er(Zt("session_heartbeat",{route:mt()}));},Zl));}function es(){Qt=false,Pr!=null&&(clearInterval(Pr),Pr=null);}function ts(t){if(Jt||typeof window>"u"||Yo(t.analytics)!==null)return;Jt=true,Xt=t.client,Qo=t.sdkVersion,Zo=t.reporterToken??t.reporterTokenHash??null,On=t.userIdHash??null;let e=()=>{typeof document<"u"&&document.visibilityState==="hidden"&&er(Zt("session_end",{route:mt()}));};typeof document<"u"&&document.addEventListener("visibilitychange",e,{passive:true}),window.addEventListener("pagehide",()=>{er(Zt("session_end",{route:mt()}));},{passive:true}),kn=Jo(r=>{r==="granted"?_o():es();}),Xo(t.projectId??"",t.analytics)==="granted"&&_o();}function Bn(t){!Jt||!Xt||_n(mt());}function rs(t){On=t;}function ns(){es(),kn?.(),kn=null,Jt=false,Rn=false,Xt=null;}var ic=/^[a-z][a-z0-9_]{1,63}$/,pt={maxKeys:40,maxKeyLength:64,maxValueLength:256,maxBytes:8192,maxClientBatch:20,maxServerBatch:50,maxEventNamesPerProject:200},oc="$",sc=/(email|phone|password|passwd|token|secret|ssn|address|credit|card|iban)/i;function uc(t){return typeof t=="string"&&ic.test(t)}function To(t,e={}){let r={},n=[];if(!t||typeof t!="object"||Array.isArray(t))return {properties:r,dropped:n};let i=new Set(e.allowlist??[]),o=0;for(let[a,s]of Object.entries(t)){if(o>=pt.maxKeys){n.push(a);continue}let u=a.slice(0,pt.maxKeyLength);if(u.startsWith(oc)&&!e.allowReserved){n.push(u);continue}if(sc.test(u)&&!i.has(u)){n.push(u);continue}let d;if(s===null||typeof s=="boolean")d=s;else if(typeof s=="number")d=Number.isFinite(s)?s:null;else if(typeof s=="string"){let p=s.slice(0,pt.maxValueLength);d=e.scrub?e.scrub(p):p;}else if(s instanceof Date)d=s.toISOString();else {n.push(u);continue}r[u]=d,o+=1;}return {properties:r,dropped:n}}function lc(t){try{return JSON.stringify(t).length<=pt.maxBytes}catch{return false}}var Or=null,tr="",ht=null,Fr=null,Fn=null,is,et=Nn(),Cn,Tn,De=[],kt=[],ye="granted",rr=true,Dr=null,gt=false,wn=false,ft=false,An=null,cc=50,os=200,dc=1440*60*1e3;function Nn(){return {sampleRate:1,autoPageviews:false,flushIntervalMs:5e3,surface:"web",propertyAllowlist:[]}}function ss(){return new Date().toISOString()}function Hr(){return "mushi_events_spill_"+tr}function pc(t){return t===void 0||t===429||t>=500}function In(){return "mushi_analytics_id_"+tr}function hc(){try{let t=localStorage.getItem(In());if(t)return t}catch{}return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"a-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function fc(){if(ht)try{localStorage.getItem(In())!==ht&&localStorage.setItem(In(),ht);}catch{}}function mc(t){let e=2166136261;for(let r=0;r<t.length;r+=1)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return (e>>>0)/4294967296}function Mn(){try{let t=localStorage.getItem(Hr());if(!t)return [];let e=JSON.parse(t);return !e||Date.now()-e.at>dc?(localStorage.removeItem(Hr()),[]):Array.isArray(e.events)?e.events.slice(0,os):[]}catch{return []}}function _t(t){try{if(t.length===0){localStorage.removeItem(Hr());return}localStorage.setItem(Hr(),JSON.stringify({at:Date.now(),events:t.slice(-os)}));}catch{}}function as(){let t=Mn();return t.length>0&&_t([]),t}function gc(t){return {anon_id:ht,user_id:Fr,user_traits:Fn,session_id:Tn?Tn():null,sdk_version:is,surface:et.surface,events:t}}async function tt(){if(!Or||wn||ye!=="granted"||De.length===0&&!ft)return;wn=true,fc();let t=De.splice(0,pt.maxServerBatch);ft&&(t.unshift({name:"identify",ts:ss(),properties:{}}),ft=false);try{let e=await Or.postProductEvents(gc(t));e.ok?_t([]):pc(e.error?.status)&&_t([...Mn(),...t.filter(r=>r.name!=="identify")]);}catch{_t([...Mn(),...t.filter(e=>e.name!=="identify")]);}finally{wn=false;}De.length>=pt.maxClientBatch&&tt();}function bc(t){return ye==="denied"?false:ye==="pending"?kt.length>=cc?false:(kt.push(t),true):(De.push(t),De.length>=pt.maxClientBatch&&tt(),true)}function Ec(t){if(t==="denied"){ye="denied",De=[],kt=[],ft=false,_t([]);return}let e=ye==="pending";ye="granted",e&&(De.push(...as(),...kt),kt=[]),(De.length>0||ft)&&tt();}function yc(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r]=n);return e}function us(){return !gt||ye==="denied"?null:ht}function ls(t){if(gt||typeof window>"u")return;let e=t.config??{};if(et={...Nn(),...yc(e),propertyAllowlist:e.propertyAllowlist??[]},tr=t.projectId,Yo(e)!==null)return;gt=true,Or=t.client,ht=t.anonId??hc(),Fr=t.userId??null,is=t.sdkVersion,Cn=t.scrub,Tn=t.getSessionId;let r=Math.min(1,Math.max(0,et.sampleRate));if(rr=r>=1?true:r<=0?false:mc(ht??"anon")<r,!rr)return;ye=Xo(tr,e),ye==="granted"?De.push(...as()):ye==="denied"&&_t([]),An=Jo(Ec);let n=Math.max(1e3,et.flushIntervalMs);Dr=setInterval(()=>{tt();},n);let i=()=>{typeof document<"u"&&document.visibilityState==="hidden"&&tt();};typeof document<"u"&&document.addEventListener("visibilitychange",i,{passive:true}),window.addEventListener("pagehide",()=>{tt();},{passive:true}),et.autoPageviews&&vc();}function Ct(t,e,r){if(!gt||!rr||!uc(t))return false;let{properties:n}=To(e,{allowlist:et.propertyAllowlist,scrub:Cn}),i=n;if(r?.reserved){let{properties:o}=To(r.reserved,{allowReserved:true,scrub:Cn});i={...n,...o};}return i.$surface=et.surface,typeof location<"u"&&i.$route===void 0&&(i.$route=location.pathname),lc(i)?bc({name:t,ts:r?.ts??ss(),properties:i,...r?.dedupKey?{dedup_key:r.dedupKey}:{}}):false}function cs(t){gt||(ye=t),Ql(tr,t);}function ds(t,e){Fr=t,Fn=e??null,!(!gt||!rr||!t||ye==="denied")&&(ft=true,ye==="granted"&&tt());}function ps(){return tt()}function hs(){Dr!=null&&(clearInterval(Dr),Dr=null),An?.(),An=null,gt=false,Or=null,De=[],kt=[],ye="granted",rr=true,ft=false,Fr=null,Fn=null,et=Nn();}var Ao=false;function vc(){if(Ao||typeof history>"u")return;Ao=true;let t=history.pushState;history.pushState=function(...e){let r=t.apply(this,e);return Ct("page_view"),r},window.addEventListener("popstate",()=>{Ct("page_view");},{passive:true});}var wc=10,Sc=1,xc=5e3;function fs(t={}){let{maxBurst:e=wc,refillRate:r=Sc,refillIntervalMs:n=xc}=t,i=e,o=Date.now();function a(){let p=Date.now(),h=p-o,k=Math.floor(h/n);k>0&&(i=Math.min(e,i+k*r),o=p);}function s(){return a(),i>0?(i--,true):false}function u(){i=e,o=Date.now();}function d(){return a(),i}return {tryConsume:s,reset:u,availableTokens:d}}var Rc={patterns:[{id:"ssn",configKey:"ssns",source:"\\b\\d{3}-\\d{2}-\\d{4}\\b",replacement:"[REDACTED_SSN]"},{id:"creditCard",configKey:"creditCards",source:"\\b(?:\\d[ -]*){12,18}\\d\\b",replacement:"[REDACTED_CC]"},{id:"awsAccessKey",configKey:"secretTokens",source:"\\b(?:AKIA|ASIA)[0-9A-Z]{16}\\b",replacement:"[REDACTED_AWS_KEY]"},{id:"awsSecretKey",configKey:"secretTokens",source:`(?:aws_secret_access_key|secret_access_key)["'\\s:=]+[A-Za-z0-9/+=]{40}\\b`,caseInsensitive:true,replacement:"aws_secret_access_key=[REDACTED_AWS_SECRET]"},{id:"stripeSecretKey",configKey:"secretTokens",source:"\\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{24,}\\b",replacement:"[REDACTED_STRIPE_KEY]"},{id:"stripePublishableKey",configKey:"secretTokens",source:"\\bpk_(?:live|test)_[A-Za-z0-9]{24,}\\b",replacement:"[REDACTED_STRIPE_PK]"},{id:"slackToken",configKey:"secretTokens",source:"\\bxox[abpor]-[A-Za-z0-9-]{10,}\\b",replacement:"[REDACTED_SLACK_TOKEN]"},{id:"githubPatClassic",configKey:"secretTokens",source:"\\bghp_[A-Za-z0-9]{36}\\b",replacement:"[REDACTED_GITHUB_PAT]"},{id:"githubPatFineGrained",configKey:"secretTokens",source:"\\bgithub_pat_[A-Za-z0-9_]{80,}\\b",replacement:"[REDACTED_GITHUB_PAT]"},{id:"openaiKey",configKey:"secretTokens",source:"\\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\\b",replacement:"[REDACTED_OPENAI_KEY]"},{id:"anthropicKey",configKey:"secretTokens",source:"\\bsk-ant-[A-Za-z0-9_-]{20,}\\b",replacement:"[REDACTED_ANTHROPIC_KEY]"},{id:"googleKey",configKey:"secretTokens",source:"\\bAIza[0-9A-Za-z_-]{35}\\b",replacement:"[REDACTED_GOOGLE_KEY]"},{id:"jwt",configKey:"secretTokens",source:"\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b",replacement:"[REDACTED_JWT]"},{id:"email",configKey:"emails",source:"\\b[A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}\\b",replacement:"[REDACTED_EMAIL]"},{id:"phone",configKey:"phones",source:"(?:\\+\\d{1,3}[\\s.-])?\\(?\\d{2,4}\\)?[\\s.-]\\d{3,4}[\\s.-]\\d{3,4}\\b",replacement:"[REDACTED_PHONE]"},{id:"ipv4",configKey:"ipAddresses",source:"\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b",replacement:"[REDACTED_IP]",defaultOn:false},{id:"ipv6",configKey:"ipv6",source:"\\b(?:[A-Fa-f0-9]{1,4}:){2,7}[A-Fa-f0-9]{0,4}\\b",replacement:"[REDACTED_IPV6]",defaultOn:false}]},ms=Rc.patterns,kc=ms.map(t=>({key:t.configKey,regex:new RegExp(t.source,t.caseInsensitive?"gi":"g"),replacement:t.replacement})),_c=ms.reduce((t,e)=>(t[e.configKey]=e.defaultOn!==false,t),{});function Un(t={}){let e={..._c,...t},r=kc.filter(o=>e[o.key]);function n(o){if(!o)return o;let a=o;for(let{regex:s,replacement:u}of r)a=a.replace(new RegExp(s.source,s.flags),u);return a}function i(o,a){let s={...o};for(let u of a)typeof s[u]=="string"&&(s[u]=n(s[u]));return s}return {scrub:n,scrubObject:i}}var Cc=/token|jwt|passw|pwd|secret|api[-_]?key|apikey|auth|session|signature|email|phone|ssn/i,Tc=/^(?:key|code|sig)$/i;function Ac(t){let e=t;try{e=decodeURIComponent(t);}catch{}return Cc.test(e)||Tc.test(e)}function Ic(t,e){return t.split("&").map(r=>{let n=r.indexOf("=");if(n===-1)return r;let i=r.slice(0,n),o=r.slice(n+1);if(o.length===0)return r;if(Ac(i))return `${i}=[Scrubbed]`;let a=o;try{a=decodeURIComponent(o);}catch{}let s=e(a);return s!==a?`${i}=${encodeURIComponent(s)}`:r}).join("&")}function sr(t,e){if(!t||!t.includes("?")&&!t.includes("#"))return t;let{scrub:r}=Un(e),n=o=>{let a=o.indexOf("?");return a===-1?o:o.slice(0,a+1)+Ic(o.slice(a+1),r)},i=t.indexOf("#");return i===-1?n(t):n(t.slice(0,i))+n(t.slice(i))}var Mc=50,Lc=500;function gs(t={}){let e=Math.max(1,t.max??Mc),r=Math.max(50,t.maxMessageLength??Lc),n=[];return {add(i){let o=typeof i.timestamp=="number"?i.timestamp:Date.now(),a=typeof i.message=="string"&&i.message.length>r?`${i.message.slice(0,r)}\u2026`:i.message,s={timestamp:o,category:i.category,level:i.level??"info",message:a??"",...i.data?{data:i.data}:{}};for(n.push(s);n.length>e;)n.shift();},getAll(){return n.slice()},clear(){n=[];},size(){return n.length}}}var Io=8*1024,Pc=1e3;function bs(t){if(t instanceof Error){let e=t.name||"Error",r=t.message||String(t),n=typeof t.stack=="string"&&t.stack.length>0?t.stack.slice(0,Io):void 0,i=t.cause;return {name:e,message:r,...n?{stack:n}:{},...i!==void 0?{cause:i instanceof Error?i.message:i}:{}}}if(typeof t=="string")return {name:"Error",message:t};if(t&&typeof t=="object"){let e=t,r=typeof e.name=="string"?e.name:"Error",n=typeof e.message=="string"?e.message:(()=>{try{return JSON.stringify(e).slice(0,Pc)}catch{return String(e)}})(),i=typeof e.stack=="string"?e.stack.slice(0,Io):void 0;return {name:r,message:n,...i?{stack:i}:{}}}return t===void 0?{name:"Error",message:"unknown"}:{name:"Error",message:String(t)}}var de={paper:"#F8F4ED",paperRaised:"#FFFFFF",ink:"#0E0D0B",inkMuted:"#5C5852",inkFaint:"#9A9489",inkDim:"#6E6760",rule:"rgba(14,13,11,0.10)",ruleStrong:"rgba(14,13,11,0.16)",accent:"#E03C2C",accentWash:"rgba(224,60,44,0.08)",accentInk:"#7A1F15",ok:"#2D7A55",danger:"#B83232"},Dc={paper:"#0F0E0C",paperRaised:"#1A1815",ink:"#F2EBDD",inkMuted:"#928B7E",inkFaint:"#5A5650",inkDim:"#7A7268",rule:"rgba(242,235,221,0.10)",ruleStrong:"rgba(242,235,221,0.18)",accent:"#FF5A47",accentWash:"rgba(255,90,71,0.12)",accentInk:"#FFE5E0",ok:"#3A9E6E",danger:"#E05555"},qn={free:de.inkMuted,explorer:"#2563EB",contributor:"#7C3AED",champion:"#D97706",default:de.accent},Nr={bg:"#0FFF50",fg:"#0a1a0a",border:"#00C43A"},Es="#FAF7F0",ys="#ffffff";var jn={light:"#9A2A1E",dark:"#7A1F15"},Wn={light:"#B52F1F",dark:"#C4321E"},vs={light:{sent:{fg:"#1E4A8C",bg:"rgba(30,74,140,0.08)",border:"rgba(30,74,140,0.16)"},review:{fg:"#8A5A00",bg:"rgba(180,120,0,0.10)",border:"rgba(180,120,0,0.18)"},fixing:{fg:"#9A3D12",bg:"rgba(224,60,44,0.10)",border:"rgba(224,60,44,0.18)"},fixed:{fg:"#1F6B3A",bg:"rgba(31,107,58,0.10)",border:"rgba(31,107,58,0.18)"}},dark:{sent:{fg:"#A8C4FF",bg:"rgba(120,160,255,0.12)",border:"rgba(120,160,255,0.22)"},review:{fg:"#FFD27A",bg:"rgba(255,190,90,0.12)",border:"rgba(255,190,90,0.22)"},fixing:{fg:"#FFB899",bg:"rgba(255,120,60,0.12)",border:"rgba(255,120,60,0.24)"},fixed:{fg:"#8FE3B0",bg:"rgba(80,200,130,0.12)",border:"rgba(80,200,130,0.22)"}}};function Vn(t){return t==="dark"?Dc:de}var ws={comfy:12},Ss={control:4},Ur={fontDisplay:"'Iowan Old Style', 'Palatino Linotype', 'Palatino', 'Book Antiqua', 'Cambria', Georgia, 'Times New Roman', serif",fontBody:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', sans-serif",fontMono:"ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace"},At={base:99999,banner:99998,panel:1e5,overlay:2147483647},qr={easeStamp:"cubic-bezier(0.22, 1, 0.36, 1)",durationFast:200},xs={instant:120,panel:300};var It={bannerHeight:36,fabSize:52,edgeTabWidth:32,gutter:24,panelWidth:360,panelMaxHeight:480,panelSheetBreakpoint:480};function Mo(t){return /^#[0-9a-fA-F]{3,8}$/.test(t)?t:""}function Rs(t,e="",r=""){let n=Vn(t),i=Mo(e),o=Mo(r),a=i||n.accent,s=i?t==="dark"?`${a}1F`:`${a}14`:n.accentWash,u=o||n.accentInk;return {accent:a,accentWash:s,accentInk:u}}function $c(t){let e=t.length%4===0?"":"=".repeat(4-t.length%4),r=t.replace(/-/g,"+").replace(/_/g,"/")+e;if(typeof atob=="function")return atob(r);let n=globalThis.Buffer;return n?n.from(r,"base64").toString("binary"):""}function ks(t){if(typeof t!="string")return null;let e=t.split(".");if(e.length!==3)return null;try{let r=$c(e[1]),n=JSON.parse(r),i=typeof n.projectId=="string"?n.projectId:void 0,o=typeof n.sub=="string"?n.sub:void 0;return !i||!o?null:{projectId:i,sub:o,...typeof n.email=="string"?{email:n.email}:{},...typeof n.name=="string"?{name:n.name}:{},...typeof n.iat=="number"?{iat:n.iat}:{},...typeof n.exp=="number"?{exp:n.exp}:{}}}catch{return null}}var Oc=new Set(["kensaur.us","www.kensaur.us"]),Hc={"glot-it":"glot.it",glotit:"glot.it","solo-boss-cloud":"solo-boss.kensaur.us","mushi-mushi":"kensaur.us","how-to-talk-to-girls":"talk.kensaur.us",htttg:"talk.kensaur.us",tsumagoi:"tsumagoi.kensaur.us"},Bc={"mushi-mushi":"https://kensaur.us/mushi-mushi/admin/favicon.svg","solo-boss-cloud":"https://solo-boss.kensaur.us/favicon.svg","glot-it":"https://kensaur.us/glot-it/apple-touch-icon.png",glotit:"https://kensaur.us/glot-it/apple-touch-icon.png","the-wanting-mind":"https://kensaur.us/the-wanting-mind/pwa-512x512.png","how-to-talk-to-girls":"https://talk.kensaur.us/pwa-192.png",htttg:"https://talk.kensaur.us/pwa-192.png",tsumagoi:"https://tsumagoi.kensaur.us/apple-touch-icon.png","help-her-take-photo":"https://kensaur.us/help-her-take-photo/assets/apple-touch-icon.png","yen-yen":"https://kensaur.us/yen-yen/icon.svg"},Fc=["www.google.com","icons.duckduckgo.com","icon.horse"];function _s(t){try{let e=new URL(t).hostname.toLowerCase();return Fc.some(r=>e===r||e.endsWith(`.${r}`))}catch{return false}}function Nc(t,e=32){return [`https://${t}/favicon.svg`,`https://${t}/favicon.ico`,`https://${t}/favicon-32x32.png`,`https://${t}/apple-touch-icon.png`]}function Cs(t){let e=[],r=i=>{let o=i?.trim().toLowerCase();!o||e.includes(o)||e.push(o);};r(qc(t.repo_url)),r(Hc[t.project_slug.toLowerCase()]);let n=t.sdk_origin?Uc(t.sdk_origin):null;return n&&!Oc.has(n)&&r(n),e}function Ts(t,e=32){if(t.icon_url?.trim())return [t.icon_url.trim()];let r=new Set,n=[],i=a=>{!a||r.has(a)||_s(a)||(r.add(a),n.push(a));},o=Bc[t.project_slug.toLowerCase()];o&&i(o);for(let a of Cs(t))for(let s of Nc(a,e))i(s);return n}function Uc(t){let e=t.trim();if(!e||/^(capacitor|file|content|app):/i.test(e))return null;try{let n=new URL(e.includes("://")?e:`https://${e}`).hostname.toLowerCase();return n==="localhost"||n==="127.0.0.1"||n.endsWith(".local")?null:n}catch{return null}}function qc(t){if(!t?.trim())return null;try{let e=new URL(t.trim()),r=e.hostname.toLowerCase(),n=e.pathname.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);if(n.length<2)return null;let i=n[1].replace(/\.git$/i,"").toLowerCase();return /^[a-z0-9][a-z0-9.-]*\.[a-z]{2,}$/i.test(i)||r==="github.com"&&i.endsWith(".github.io")?i:r!=="github.com"&&r!=="www.github.com"?r:null}catch{return null}}function As(t){return Cs(t)[0]??null}function Is(t){if(typeof document>"u"||!t.complete||t.naturalWidth===0||t.naturalHeight===0)return false;try{let e=document.createElement("canvas"),r=t.naturalWidth,n=t.naturalHeight;e.width=r,e.height=n;let i=e.getContext("2d");if(!i)return !1;i.drawImage(t,0,0);let{data:o}=i.getImageData(0,0,r,n),a=0,s=0,u=0;for(let p=0;p<o.length;p+=4){let h=o[p],k=o[p+1],S=o[p+2];if(o[p+3]<128)continue;a++;let E=Math.max(h,k,S),w=Math.min(h,k,S),L=E-w;u=Math.max(u,L),s+=L;}return a===0?!0:s/a<14&&u<24}catch{return _s(t.src)}}function Ms(t){let e=t.trim().split(/[\s._-]+/).filter(Boolean);return e.length>=2?`${e[0][0]??""}${e[1][0]??""}`.toUpperCase():(t.replace(/[^a-zA-Z0-9]/g,"").slice(0,2)||t.slice(0,2)||"?").toUpperCase()}function Ls(){if(typeof document>"u")return null;let t=['link[rel="icon"]','link[rel="shortcut icon"]','link[rel="apple-touch-icon"]'];for(let e of t){let n=document.querySelector(e)?.href;if(n&&jc(n))return n}return null}function jc(t){try{let e=typeof location<"u"?location.href:void 0,r=new URL(t,e).protocol;return r==="http:"||r==="https:"}catch{return false}}async function Ds(t,e=Lo){if(!t.startsWith("data:image/")||Ps(t)<=e)return t;if(typeof document>"u")return null;let r=new Image;await new Promise((o,a)=>{r.onload=()=>o(),r.onerror=()=>a(new Error("screenshot_decode_failed")),r.src=t;});let n=[.65,.5,.35,.25],i=[1,.85,.7,.55,.4];for(let o of i){let a=document.createElement("canvas"),s=Math.max(1,Math.round(r.naturalWidth*o)),u=Math.max(1,Math.round(r.naturalHeight*o));a.width=s,a.height=u;let d=a.getContext("2d");if(d){d.drawImage(r,0,0,s,u);for(let p of n){let h=a.toDataURL("image/jpeg",p);if(Ps(h)<=e)return h}}}return null}function Ps(t){let e=t.indexOf(",");if(e<0)return t.length;let r=t.slice(e+1);return Math.ceil(r.length*3/4)}var jr="mushi-assistant-session-v1";function $s(){try{if(typeof sessionStorage>"u")return null;let t=sessionStorage.getItem(jr);if(!t)return null;let e=JSON.parse(t);if(!e||typeof e!="object")return null;let r=e,n=Array.isArray(r.turns)?r.turns:null;if(!n)return null;let i=[];for(let a of n){if(!a||typeof a!="object")continue;let s=a;if(s.role!=="user"&&s.role!=="assistant"||typeof s.text!="string")continue;let u={role:s.role,text:s.text};if(Array.isArray(s.options)){let d=s.options.filter(p=>typeof p=="string");d.length&&(u.options=d);}s.offerReport===!0&&(u.offerReport=!0),i.push(u);}let o=typeof r.threadId=="string"&&r.threadId.length>0?r.threadId:null;return {turns:i,threadId:o}}catch{return null}}function Os(t){try{if(typeof sessionStorage>"u")return;if(!t.turns.length&&!t.threadId){sessionStorage.removeItem(jr);return}sessionStorage.setItem(jr,JSON.stringify(t));}catch{}}function Hs(){try{if(typeof sessionStorage>"u")return;sessionStorage.removeItem(jr);}catch{}}var Bs="Feature request";function Fs(t){let e=Date.parse(t);if(Number.isNaN(e))return "";let r=Date.now()-e;if(r<0)return "just now";let n=Math.floor(r/1e3);if(n<60)return "just now";let i=Math.floor(n/60);if(i<60)return `${i}m ago`;let o=Math.floor(i/60);if(o<24)return `${o}h ago`;let a=Math.floor(o/24);if(a<7)return `${a}d ago`;let s=Math.floor(a/7);return s<5?`${s}w ago`:new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}var Wc="https://kensaur.us/mushi-mushi/",Vc="utm_source=widget&utm_medium=powered-by";function Ns(t){let e=`${Wc}?${Vc}`;return t&&/^[0-9a-f]{6,64}$/.test(t)?`${e}&ref=${t}`:e}function Us(t){return (t.metaKey||t.ctrlKey)&&t.key==="Enter"}function qs(t){return /Mac|iPhone|iPad|iPod/i.test(t)?"\u2318":"Ctrl"}function js(){return typeof navigator>"u"?"":navigator.userAgentData?.platform||navigator.platform||navigator.userAgent||""}function Ws(t,e,r){if(t==="banner")return true;if(t==="console-only"||t==="off")return false;if(e)return true;if(!r)return false;let n=r.hostname.replace(/^\[|\]$/g,"");return r.protocol==="file:"||n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="0.0.0.0"||n.endsWith(".localhost")||n.endsWith(".local")}function Mt(t,e){return new Promise((r,n)=>{let i=setTimeout(()=>n(new Error("Timed out")),e);t.then(o=>{clearTimeout(i),r(o);},o=>{clearTimeout(i),n(o);});})}var Lt=15e3,Wr=4e3;function Vs(t,e){let r={month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"};try{return t.toLocaleString(e,r)}catch{return t.toLocaleString(void 0,r)}}function Et(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ks(t){let e=t.appDomain??As({project_id:t.projectId,project_name:t.appName,project_slug:t.appSlug??""}),r=Et(Ms(t.appName)),n=Ts({project_id:t.projectId,project_name:t.appName,project_slug:t.appSlug??"",sdk_origin:t.appDomain?`https://${t.appDomain}`:null});return n.length?`<span class="mushi-app-icon" data-mushi-favicon data-candidates="${Et(JSON.stringify(n))}" data-initials="${r}" aria-hidden="true" title="${Et(e??t.appName)}">
|
|
3
3
|
<img class="mushi-app-icon-img" src="${Et(n[0])}" alt="" referrerpolicy="no-referrer" width="16" height="16" />
|
|
4
4
|
<span class="mushi-app-icon-initials" hidden>${r}</span>
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
z-index: 2147483647;
|
|
93
93
|
cursor: crosshair;
|
|
94
94
|
background: transparent;
|
|
95
|
-
`,document.body.appendChild(f),f}function p(f,g){let m=document.elementsFromPoint(f,g),b=null;for(let P of m)if(!(P===r||P===e)){if(P.id==="mushi-mushi-widget"||P.closest("#mushi-mushi-widget"))return null;b=P;break}let C=0;for(;b?.shadowRoot&&C<20;){let P=b.shadowRoot.elementFromPoint(f,g);if(!P||P===b)break;b=P,C++;}return b}function h(f){if(!e)return;let g=f.getBoundingClientRect();e.style.left=`${g.left}px`,e.style.top=`${g.top}px`,e.style.width=`${g.width}px`,e.style.height=`${g.height}px`,e.style.display="block";}function k(f){let g=p(f.clientX,f.clientY);if(!g){n=null,e&&(e.style.display="none");return}n=g,h(g);}function S(f){f.preventDefault(),f.stopPropagation();}function T(f){f.preventDefault(),f.stopPropagation();let g=p(f.clientX,f.clientY);g&&L(s(g));}function E(f){f.key==="Escape"&&L(null);}function w(){n?.isConnected&&h(n);}function L(f){x(),i?.(f),i=null;}function M(){return t&&x(),new Promise(f=>{i=f,t=true,e=u(),r=d(),r.addEventListener("mousemove",k),r.addEventListener("click",T),r.addEventListener("pointerdown",S),r.addEventListener("mousedown",S),r.addEventListener("mouseup",S),document.addEventListener("keydown",E,true),window.addEventListener("scroll",w,{capture:true,passive:true});})}function x(){t&&(t=false,n=null,document.removeEventListener("keydown",E,true),window.removeEventListener("scroll",w,{capture:true}),r&&(r.remove(),r=null),e&&(e.remove(),e=null));}return {activate:M,deactivate:x,isActive:()=>t}}var Ga=120;function ki(){let t=[],e=()=>n("hashchange");n("initial");function r(a){t.push(a),t.length>Ga&&t.shift();}function n(a){typeof location>"u"||r({ts:Date.now(),kind:"route",payload:{source:a,route:sr(`${location.pathname}${location.search}${location.hash}`),href:sr(location.href)}});}function i(a){let s=a.target instanceof Element?a.target:null;if(!s)return;let u=s.closest('button,a,[role="button"],input,textarea,select,[data-mushi-track]')??s;r({ts:Date.now(),kind:"click",payload:{tag:u.tagName.toLowerCase(),id:u.id||void 0,text:Sp(u)}});}let o=Me({onPush:()=>n("pushState"),onReplace:()=>n("replaceState"),onPop:()=>n("popstate")});return window.addEventListener("hashchange",e),document.addEventListener("click",i,true),{setScreen(a){r({ts:Date.now(),kind:"screen",payload:a});},getEntries(a={}){return [...t,...(a.consoleLogs??[]).map(u=>({ts:u.timestamp,kind:"log",payload:{level:u.level,message:u.message}})),...(a.networkLogs??[]).map(u=>({ts:u.timestamp,kind:"request",payload:{method:u.method,url:u.url,status:u.status,duration:u.duration,error:u.error}}))].sort((u,d)=>u.ts-d.ts).slice(-Ga)},clear(){t.length=0;},destroy(){o(),window.removeEventListener("hashchange",e),document.removeEventListener("click",i,true);}}}function Sp(t){let e=(t.textContent??"").replace(/\s+/g," ").trim();return e?e.slice(0,80):void 0}var xp=6e4,Rp=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,kp=/^[0-9a-f]{20,}$/i,_p=/^\d+$/,Cp=/^[a-z0-9]{16,}$/i;function Ya(t){return t.length===0?t:Rp.test(t)||kp.test(t)||_p.test(t)||Cp.test(t)&&/\d/.test(t)?"[id]":t}function Tp(t,e,r){if(e.startsWith("#/")){let n=e.slice(1),i=n.indexOf("?"),o=i===-1?n:n.slice(0,i),a=r?.map(s=>s.startsWith("/#/")?s.slice(2):s);return "/#"+_i(o,a)}return _i(t,r)}function _i(t,e){let r=t.length>1&&t.endsWith("/")?t.slice(0,-1):t;if(e?.length){let n=Ap(r,e);if(n)return n}return "/"+r.split("/").filter(n=>n.length>0).map(Ya).join("/")}function Ap(t,e){let r=t.split("/").filter(i=>i.length>0),n=[...e].sort((i,o)=>o.split("/").length-i.split("/").length);for(let i of n){let o=i.split("/").filter(s=>s.length>0);if(o.length!==r.length)continue;let a=true;for(let s=0;s<o.length;s++){let u=o[s],d=r[s];if(!(u.startsWith("[")&&u.endsWith("]"))&&!u.startsWith(":")&&u!==d){a=false;break}}if(a)return "/"+o.join("/")}return null}function Ip(){if(typeof document>"u")return [];let t=new Set,e=document.querySelectorAll("[data-testid]");for(let r of Array.from(e)){let n=r.getAttribute("data-testid");n&&n.length>0&&n.length<120&&t.add(n);}return Array.from(t).sort()}function Mp(){if(typeof window>"u")return [];try{let t=new Set,e=i=>{new URLSearchParams(i).forEach((o,a)=>t.add(a));};e(window.location.search);let r=window.location.hash,n=r.indexOf("?");return r.startsWith("#/")&&n!==-1&&e(r.slice(n+1)),Array.from(t).sort()}catch{return []}}function Lp(){if(typeof document>"u")return null;let t=i=>(i??"").replace(/\s+/g," ").trim().slice(0,200),e=t(document.querySelector("h1")?.textContent);if(e)return e;let r=t(document.title);return r||t(document.querySelector("main")?.textContent)||null}async function Pp(t){if(!t||typeof crypto>"u"||!crypto.subtle)return null;try{let e=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),i="";for(let o=0;o<n.length;o++)i+=n[o].toString(16).padStart(2,"0");return i}catch{return null}}function Ci(t){let{config:e,getRecentNetworkPaths:r,getUserId:n,getSessionId:i,onEvent:o}=t,a=e.throttleMs??xp,s=e.captureDomSummary!==false,u=e.userIdSource??"auto",d=new Map,p=null,h=null;async function k(){if(typeof window>"u")return;let L=Tp(window.location.pathname,window.location.hash,e.routeTemplates),M=Date.now(),x=d.get(L)??0;if(M-x<a)return;d.set(L,M);let f=null;u==="auto"?f=n()??i():u==="session-only"&&(f=i());let g={route:L,page_title:typeof document<"u"&&(document.title||"").slice(0,300)||null,dom_summary:s?Lp():null,testids:Ip(),network_paths:r().slice(-50),query_param_keys:Mp(),user_id_hash:await Pp(f),observed_at:new Date().toISOString()};o(g);}function S(){h||(h=setTimeout(()=>{h=null,k();},100));}function T(){if(typeof window>"u")return;let L=window.location.hash.startsWith("#/")?window.location.hash:"",M=window.location.pathname+window.location.search+L;M!==p&&(p=M,S());}if(typeof window>"u")return {destroy:()=>{},flushNow:()=>{}};let E=()=>T(),w=Me({onPush:E,onReplace:E,onPop:E});return window.addEventListener("hashchange",E),S(),{destroy(){w(),window.removeEventListener("hashchange",E),h&&(clearTimeout(h),h=null),d.clear();},flushNow(){d.clear(),k();}}}var Dp=3e4,Ai=400,$p=4,Op=2;function Xa(t,e,r){let n=u=>u.timestamp,i=u=>u.type===Op,o=u=>u.type===$p,a=Date.now()-e,s=0;for(let u=0;u<t.length;u++){let d=n(t[u]);if(typeof d=="number"&&d>=a)break;i(t[u])&&(s=o(t[u-1])?u-1:u);}if(t.length-s>r){for(let u=s+1;u<t.length;u++)if(i(t[u])&&t.length-u<=r){s=o(t[u-1])?u-1:u;break}}s>0&&t.splice(0,s);}function Ja(t){let e=[],r=false,n=o=>{if(!r)return;let a=o.target instanceof Element?o.target:null,s=a?.tagName?.toLowerCase()??"unknown",u=a?.closest("[data-testid]")?.getAttribute("data-testid")??void 0;e.push({type:"lite_click",timestamp:Date.now(),data:{tag:s,testId:u}}),e.length>Ai&&e.shift();},i=()=>{r=false,document.removeEventListener("click",n,true);};return {start(){r||(r=true,document.addEventListener("click",n,true));},stop:i,flush(){let o=Date.now()-t;return e.filter(a=>a.timestamp>=o)},destroy(){i(),e.length=0;}}}var Hp=['input[type="password"]',"[data-mushi-redact]"],Oe=null,Qa=false;function Ti(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.record=="function"?e:e.default&&typeof e.default.record=="function"?e.default:null}async function Bp(t){if(Oe)return Oe;if(typeof t=="function")try{if(Oe=Ti(await t()),Oe)return Oe}catch{}if(Oe=Ti(globalThis.rrweb),Oe)return Oe;try{return Oe=Ti(await import('rrweb')),Oe}catch{return null}}async function Za(t){let e=t.maxDurationMs??Dp;if(t.mode==="lite")return Ja(e);let r=await Bp(t.loadRrweb);if(!r?.record)return Qa||(Qa=true,Tt({scope:"mushi"}).warn("capture.replay is 'rrweb' but rrweb could not be loaded, so replay is recording clicks only. Install rrweb and pass capture: { rrweb: () => import('rrweb') }.")),Ja(e);let n=r.record,i=[],o=null,a=false,s=[...new Set([...Hp,...t.redactSelectors??[]])],u=()=>{o?.(),o=null,a=false;};return {start(){a||(a=true,o=n({emit(d){i.push(d),Xa(i,e,Ai);},maskAllInputs:true,maskTextSelector:"*",blockSelector:s.join(","),checkoutEveryNms:e,sampling:{mousemove:false,mouseInteraction:true,scroll:150,media:800}})??null);},stop:u,flush(){return Xa(i,e,Ai),[...i]},destroy(){u(),i.length=0;}}}function eu(){try{let t=globalThis;return t.Sentry?t.Sentry:void 0}catch{return}}function Fp(){try{return globalThis.__SENTRY_REPLAY__}catch{return}}function Np(){try{let t=globalThis,e=t.__SENTRY__,r=t.Sentry;return e?.version==="9"||r&&typeof r.lastEventId=="function"?e?.version==="9"?"v9":"v8":e?.version==="8"?"v8":r&&typeof r.getCurrentHub=="function"?"v7":"unknown"}catch{return "unknown"}}function Ii(t,e={}){let r=Math.max(0,e.breadcrumbsLimit??30),n={},i=eu();if(!i)return n;n.sdk=Np();try{let s=i;if(typeof s.lastEventId=="function")n.eventId=s.lastEventId()??void 0;else {let d=i.getCurrentHub?.()?.getScope?.();n.eventId=d?.getLastEventId?.()??void 0;}}catch{}let o;try{let s=i;typeof s.getCurrentScope=="function"?o=s.getCurrentScope():o=i.getCurrentHub?.()?.getScope?.();}catch{}if(o){try{let s=o.getUser?.();s&&(n.user={id:typeof s.id=="string"?s.id:void 0,email:typeof s.email=="string"?s.email:void 0,username:typeof s.username=="string"?s.username:void 0,ip_address:typeof s.ip_address=="string"?s.ip_address:void 0});}catch{}try{let s=o.getTags?.();if(s&&typeof s=="object"){let u={};for(let[d,p]of Object.entries(s))(typeof p=="string"||typeof p=="number"||typeof p=="boolean")&&(u[d]=p);Object.keys(u).length>0&&(n.tags=u);}}catch{}try{n.transactionName=o.getTransactionName?.()??o.getTransaction?.()?.name??void 0;}catch{}try{n.sessionId=o.getSession?.()?.sid??void 0;}catch{}try{let s=o.getBreadcrumbs?.()??o._breadcrumbs??[];if(Array.isArray(s)&&s.length>0){let u=s.slice(-r);n.breadcrumbs=u.map(d=>{let p=d;return {timestamp:typeof p.timestamp=="number"?p.timestamp<1e12?Math.round(p.timestamp*1e3):p.timestamp:void 0,category:typeof p.category=="string"?p.category:void 0,level:typeof p.level=="string"?p.level:void 0,message:typeof p.message=="string"?p.message:void 0,type:typeof p.type=="string"?p.type:void 0,data:p.data&&typeof p.data=="object"?p.data:void 0}});}}catch{}}try{let s=i,u;if(typeof s.getActiveSpan=="function"?u=s.getActiveSpan():o?.getSpan&&(u=o.getSpan()),u){let d=u.spanContext?.();n.traceId=d?.traceId??u.traceId??void 0,n.spanId=d?.spanId??u.spanId??void 0;}}catch{}let a;try{let s=i;typeof s.getClient=="function"?a=s.getClient():a=i.getCurrentHub?.()?.getClient?.();}catch{}if(a){try{let s=a.getOptions?.();s?.release&&(n.release=s.release),s?.environment&&(n.environment=s.environment);}catch{}try{let s=a.getDsn?.();if(s?.host&&s?.projectId&&n.eventId){let u=s.host.replace(/^o\d+\./,"");n.issueUrl=`https://${u}/issues/?query=${encodeURIComponent(n.eventId)}`;}}catch{}}try{let u=i.getReplay?.()??Fp();n.replayId=u?.getReplayId?.()??void 0;}catch{}return n}function Mi(t,e={}){let r=eu();if(r){try{let n=r;typeof n.setTag=="function"&&(n.setTag("mushi.report_id",t),e.reportUrl&&n.setTag("mushi.report_url",e.reportUrl)),typeof n.setContext=="function"&&n.setContext("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{},captured_at:new Date().toISOString()}),typeof n.addBreadcrumb=="function"&&n.addBreadcrumb({category:"mushi",type:"info",level:"info",message:`Mushi report submitted (${t})`,data:{report_id:t,...e.reportUrl?{url:e.reportUrl}:{}}});}catch{}try{let i=r.getCurrentHub?.()?.getScope?.();i&&(i.setTag?.("mushi.report_id",t),e.reportUrl&&i.setTag?.("mushi.report_url",e.reportUrl),i.setContext?.("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{}}));}catch{}}}var Up=["/login","/logout","/signup","/sso/*","/auth/*"];function ru(t,e={}){let r=[];if(e.rageClick!==false){let E=function(w){let L=Date.now();if(w.target===T){if(S.push(L),S=S.filter(M=>L-M<500),S.length>=3){let M=w.target;t.onTrigger("rage_click",{element:M.tagName,id:M.id,text:M.textContent?.slice(0,50)}),S=[];}}else T=w.target,S=[L];};let S=[],T=null;document.addEventListener("click",E,true),r.push(()=>document.removeEventListener("click",E,true));}if(e.longTask!==false&&typeof PerformanceObserver<"u")try{let S=new PerformanceObserver(T=>{for(let E of T.getEntries())E.duration>5e3&&t.onTrigger("long_task",{duration:Math.round(E.duration),startTime:Math.round(E.startTime)});});S.observe({entryTypes:["longtask"]}),r.push(()=>S.disconnect());}catch{}let n=qp(e.apiCascade);if(n.enabled){let S=[],T=globalThis.fetch;globalThis.fetch=async function(...E){let[w,L]=E,M=tn(w),x=!!rn(w,L)||gr(M,{apiEndpoint:e.apiEndpoint,ignoreUrls:n.ignoreUrls});try{let f=await T.apply(this,E);return !x&&!f.ok&&f.status>=400&&tu(S,t),f}catch(f){throw x||tu(S,t),f}},r.push(()=>{globalThis.fetch=T;});}if((e.pageDwell===true||typeof e.pageDwell=="object"&&e.pageDwell!==null)&&typeof window<"u"){let M=function(b){return E.some(C=>C.endsWith("/*")?b.startsWith(C.slice(0,-2)):b===C||b.startsWith(C+"/"))},x=function(){let b=window.location?.pathname??"";M(b)||t.onTrigger("page_dwell",{thresholdMs:T,path:b});},f=function(){w&&clearTimeout(w);let b=window.location?.pathname??"";M(b)||(w=setTimeout(x,T));},g=function(){let b=window.location?.pathname??"";b!==L&&(L=b,f());};let S=typeof e.pageDwell=="object"?e.pageDwell??{}:{},T=S.thresholdMs||300*1e3,E=S.excludeRoutes!==void 0?S.excludeRoutes:Up,w=null,L=window.location?.pathname??"";f();let m=Me({onPush:g,onReplace:g,onPop:g});r.push(()=>{w&&clearTimeout(w),m();});}if((e.firstSession===true||typeof e.firstSession=="object"&&e.firstSession!==null)&&typeof window<"u"){let S=typeof e.firstSession=="object"?e.firstSession??{}:{},T=S.delayMs??45*1e3,E=S.storageKey??(e.projectId?`mushi:${e.projectId}:firstSessionShown`:"mushi:firstSessionShown"),w=false;try{w=window.localStorage?.getItem(E)==="1";}catch{}if(!w){let L=setTimeout(()=>{try{window.localStorage?.setItem(E,"1");}catch{}t.onTrigger("first_session",{delayMs:T});},T);r.push(()=>clearTimeout(L));}}if(e.errorBoundary){let S=function(E){or({message:E.message,filename:E.filename,ignoreErrors:e.ignoreErrors,denyUrls:e.denyUrls,allowUrls:e.allowUrls})||t.onTrigger("error_boundary",{message:E.message,filename:E.filename,lineno:E.lineno,colno:E.colno});},T=function(E){let w=E.reason instanceof Error?E.reason.message:String(E.reason);or({message:w,ignoreErrors:e.ignoreErrors,denyUrls:e.denyUrls,allowUrls:e.allowUrls})||t.onTrigger("error_boundary",{message:w,type:"unhandled_rejection"});};window.addEventListener("error",S),window.addEventListener("unhandledrejection",T),r.push(()=>{window.removeEventListener("error",S),window.removeEventListener("unhandledrejection",T);});}return {destroy(){r.forEach(S=>S());}}}function qp(t){return t===false?{enabled:false,ignoreUrls:[]}:t&&typeof t=="object"?{enabled:t.enabled!==false,ignoreUrls:t.ignoreUrls??[]}:{enabled:true,ignoreUrls:[]}}function tu(t,e){let r=Date.now();t.push(r);let n=t.filter(i=>r-i<1e4);n.length>=3&&(e.onTrigger("api_cascade",{failureCount:n.length,windowMs:1e4}),t.length=0);}var nu="mushi:lastDismiss",nn="mushi:consecDismiss",Li="mushi:lastShown";function on(t){try{return localStorage.getItem(t)}catch{return null}}function sn(t,e){try{localStorage.setItem(t,e);}catch{}}function iu(t={}){let e=t.maxProactivePerSession??2,r=t.dismissCooldownHours??24,n=t.suppressAfterDismissals??3,i=(t.reshowCooldownMinutes??30)*60*1e3,o=0,a=new Set;function s(h){let k=Date.now();if(parseInt(on(nn)??"0",10)>=n)return false;let T=on(nu);if(T&&k-parseInt(T,10)<r*60*60*1e3)return false;if(i>0&&o===0){let E=on(Li);if(E&&k-parseInt(E,10)<i)return false}return o>=e||a.has(h)?false:(a.add(h),o++,sn(Li,String(k)),true)}function u(){sn(nu,String(Date.now()));let h=parseInt(on(nn)??"0",10);sn(nn,String(h+1));}function d(){sn(nn,"0");}function p(){o=0,a.clear();try{localStorage.removeItem(Li);}catch{}}return {shouldShow:s,recordDismissal:u,recordSubmission:d,reset:p}}var Ye="@mushi-mushi/web",we="1.31.0";function lu(t,e){if(t.appVersion)return t.appVersion;let r=t.integrations?.vercel?.analyticsId;return r||e?.buildId}var He=null,an=class{constructor(){}static init(e){if(He)return Tt({scope:"mushi",level:"warn",format:"pretty"}).warn("Already initialized \u2014 call destroy() first to reinitialize"),He;if(typeof document>"u"||typeof window>"u")return du();let r={...Ln(),...e};if(!r.projectId||!r.apiKey){let n=Bo();throw new Error(n.message??"[mushi] projectId and apiKey are required \u2014 set NEXT_PUBLIC_MUSHI_* / VITE_MUSHI_* / MUSHI_* or pass them explicitly")}return r.enabled===false?du():(He=Vp(r),He)}static getInstance(){return He}static destroy(){He?.destroy(),He=null;}static diagnose(){return He?.diagnose()??Di()}};function Vp(t){No(t);let e=Fo(t),r=e.projectId,n=()=>te(r),i=e,o=t.debug??false?Tt({scope:"mushi",level:"debug",format:"pretty"}):Pn,a=null,s=null,u=Ho({projectId:e.projectId,apiKey:e.apiKey,...e.apiEndpoint?{apiEndpoint:e.apiEndpoint}:{},...typeof e.timeout=="number"?{timeout:e.timeout}:{},...typeof e.maxRetries=="number"?{maxRetries:e.maxRetries}:{},...e.circuitBreaker?{circuitBreaker:e.circuitBreaker}:{},...e.tunnel?{tunnel:e.tunnel}:{},getUserToken:()=>a,sdkPackage:Ye,sdkVersion:we}),d=null;if(e.trackSessions!==false){ts({client:u,sdkVersion:we,reporterToken:te(e.projectId)??null,projectId:e.projectId,analytics:e.analytics});try{d=Me({onPush:()=>Bn(),onPop:()=>Bn()});}catch{}}let p=Uo(e.preFilter),h=Ko(e.offline),k=fs({maxBurst:10,refillRate:1,refillIntervalMs:5e3}),S=Un();ls({client:u,projectId:e.projectId,sdkVersion:we,config:e.analytics,scrub:l=>S.scrub(l),getSessionId:bt});function T(l){return l.map(c=>{let y={...c};if(typeof c.message=="string"&&(y.message=S.scrub(c.message)),c.data&&typeof c.data=="object"){let I={};for(let[$,N]of Object.entries(c.data))I[$]=typeof N=="string"?S.scrub(N):N;y.data=I;}return y})}function E(l){return l&&l.map(c=>({...c,message:S.scrub(c.message),...c.stack?{stack:S.scrub(c.stack)}:{}}))}function w(l){if(!l)return;let c={};for(let[y,I]of Object.entries(l))c[y]=typeof I=="string"?S.scrub(I):I;return c}let L=null,M=null,x=null,f=null,g=null,m=null,b=ki(),C=null,P=0,v,K=`mushi:tester-jwt:${e.projectId}`;function Y(){try{return typeof localStorage<"u"?localStorage.getItem(K):null}catch{return null}}function j(){try{typeof localStorage<"u"&&localStorage.removeItem(K);}catch{}}async function ke(l){let c=await u.getTesterStatus(l);if(!c.ok||!c.data){j();return}let y=c.data;if(!y.is_tester||!y.tester_id){j();return}v.setTesterSession(l,{id:y.tester_id,public_handle:y.public_handle??null,display_name:y.display_name??null});let I=await u.getMyReputation(l);if(I.ok&&I.data){let $=I.data;$.reputation&&v.setTesterReputation($.reputation);}}function Be(){if(i.capture?.console!==false?L??=bi():(L?.destroy(),L=null),i.capture?.network!==false){let B={apiEndpoint:Pi(i),ignoreUrls:i.capture?.ignoreUrls,tracePropagation:i.capture?.tracePropagation,sessionId:bt()};M?M.updateOptions(B):M=gi(B);}else M?.destroy(),M=null;if(i.capture?.performance!==false?x??=xi():(x?.destroy(),x=null),i.capture?.screenshot!=="off"){let B={privacy:i.privacy,onFailed:Z=>v.setScreenshotError(true,Z)};i.capture?.screenshotProvider?f=null:f?f.updateOptions(B):f=wi(B);}else f=null;!f&&!i.capture?.screenshotProvider&&(O=null),v.setAllowScreenshotRemove(i.privacy?.allowUserRemoveScreenshot!==false),i.capture?.elementSelector!==false?g??=Ri():(g?.deactivate(),g=null,G=null),v.setCaptureAvailability({screenshot:(!!f||!!i.capture?.screenshotProvider)&&i.capture?.screenshot!=="off",element:!!g});let l=i.capture?.discoverInventory,c=l===true?{}:l&&typeof l=="object"?l:null;c!=null&&c.enabled!==false?(m?.destroy(),m=Ci({config:c,getRecentNetworkPaths:()=>M?M.getEntries().map(B=>{try{let Z=new URL(B.url,typeof window<"u"?window.location.href:"http://localhost");return Z.host&&typeof window<"u"&&Z.host!==window.location.host?null:Z.pathname}catch{return null}}).filter(B=>B!=null&&B.length>0&&B.length<200):[],getUserId:()=>R?.id??null,getSessionId:bt,onEvent:B=>{u.postDiscoveryEvent({...B,sdk_version:we}).catch(Z=>{o.debug("discovery emit failed",{err:String(Z)});});}})):(m?.destroy(),m=null);let I=i.capture?.replay??"off",$=i.replaySampleRate??1,N=$>=1||Math.random()<$,Q=i.replaysOnErrorSampleRate??0,ue=!N&&Q>0&&Math.random()<Q;if((I==="rrweb"||I==="lite")&&(N||ue)){let B=++P;Za({mode:I,loadRrweb:e.capture?.rrweb,redactSelectors:i.privacy?.redactSelectors}).then(Z=>{if(B!==P){Z.destroy();return}C?.destroy(),C=Z,C.start();});}else P++,C?.destroy(),C=null;}let me=new Map;function J(l,c){me.get(l)?.forEach(y=>y({type:l,data:c}));}let O=null,G=null,re=null,_e=false,Ce=true,Le=null,A=null,R=null,H=null,F={},U={},X=gs({max:50});X.add({category:"lifecycle",level:"info",message:"Mushi SDK init",data:{projectId:e.projectId,sdkVersion:we}});let Xe=null;Xe=th(X);let Fe=false,it=false,he=new Set,ie=Ra(u);async function ge(){let l=await ie.getUpdates(n()),c=l.ok?l.data??null:null;if(c)for(let y of he)try{y(c);}catch{}return c}function Nt(){v.refreshReporterInboxQuiet(),he.size&&ge();}function z(){Le&&clearInterval(Le),Le=null,A&&typeof document<"u"&&document.removeEventListener("visibilitychange",A),A=null;}function Ut(){if(z(),!Ce)return;let l=5*6e4,c=()=>{typeof document<"u"&&document.visibilityState==="hidden"||ii(r)&&Nt();};Le=setInterval(c,l),typeof document<"u"&&(A=()=>{document.visibilityState==="visible"&&c();},document.addEventListener("visibilitychange",A)),c();}let ot=null;function st(){let l=i.notifications??e.notifications;v.setReporterChannels({email:!!ot?.emailEnabled&&l?.email!==false,push:!!(ot?.pushEnabled&&ot.vapidPublicKey)&&!!l?.webPush,emailPrefill:l?.emailFromIdentity?R?.email??"":""});}let St=[];function fu(){if(!ii(r))return;let l=globalThis.requestIdleCallback;if(l?l(()=>{v.preloadViews();},{timeout:8e3}):setTimeout(()=>{v.preloadViews();},3e3),e.notifications?.toast===false||!Sa(r))return;let c=async()=>{let I=await ge(),$=I&&typeof I.unread_total=="number"&&Array.isArray(I.latest)?I:null;if($&&!$.unread_total)return;await v.refreshReporterInboxQuiet(),($?v.showUpdatesFeedToast($,St):await v.showUpdatesToast(St))&&xa(r);},y=globalThis.requestIdleCallback;y?y(()=>{c();},{timeout:5e3}):setTimeout(()=>{c();},2e3);}async function mu(l){let c=te(r),y=await ie.markReportRead(l,c);if(y.ok)return y.data?.unread_total??null;let I=await u.listNotifications(c,{limit:50});if(!I.ok)return null;let $=(I.data?.notifications??[]).filter(N=>{let Q=N.payload??{};return !N.read_at&&(Q.reportId===l||N.report_id===l)});return await Promise.all($.map(N=>u.markNotificationRead(String(N.id),c))),null}function Oi(l,c){if(!i.rewards?.enabled)return;let y={client:u,config:i.rewards,projectId:r,userId:l,traits:c,reporterToken:n()};Ha(y),i.rewards.showInWidget!==false&&u.getMyPoints(l).then(I=>{if(!I.ok)return;let $=I.data;v.setRewardsState({tier:$.tier?{slug:$.tier.slug??"free",displayName:$.tier.display_name??"Free",pointsThreshold:$.tier.points_threshold??0}:null,nextTier:$.next_tier?{displayName:$.next_tier.display_name??"",pointsThreshold:$.next_tier.points_threshold??0}:null,totalPoints:$.total_points??0,pointsForReport:$.report_submit_pts??50});}).catch(()=>{});}async function Hi(){if(Fe)return null;it=false;let l=i.capture?.screenshotProvider;if(l){Fe=true;try{let $=await l();if($)return $}catch($){o.warn("screenshotProvider threw, falling back to built-in capturer",{error:$ instanceof Error?$.message:String($)}),it=$ instanceof Error&&($.name==="NotAllowedError"||$.name==="SecurityError"||/permission|denied/i.test($.message));}finally{Fe=false;}}if(!f)return null;Fe=true;let c=v.getIsOpen();c&&v.hidePanel();let y=document.getElementById("mushi-mushi-widget"),I=y?.style.visibility??"";y&&(y.style.visibility="hidden"),await new Promise($=>{requestAnimationFrame(()=>requestAnimationFrame(()=>$()));});try{return await f.take()}finally{Fe=false,y&&(y.style.visibility=I),c&&v.showPanel();}}async function Bi(l){let c=i.capture?.screenshot;!(f||i.capture?.screenshotProvider)||c==="off"||O||l==="open"&&c!=="auto"||l==="submit"&&c!=="on-report"&&c!=="auto"||(o.debug("Auto-capturing screenshot",{when:l,mode:c}),O=await Hi(),v.setScreenshotAttached(O!==null),v.setScreenshotPreview(O));}let un=nr(r).then(l=>l.slice(0,12)).catch(()=>null);v=new Yr(e.widget,{onSubmit:async({category:l,userCategory:c,description:y,intent:I})=>(o.info("Report submitted",{category:l,userCategory:c,intent:I}),qt?.recordSubmission(),await Bi("submit"),await bu(l,y,I,c)??{reportId:null,queuedOffline:true}),onOpen:()=>{o.debug("Widget opened"),Bi("open"),C?.start(),J("widget:opened");},onBrandFooterImpression:()=>{un.then(l=>{Ct("loop_impression",{placement:"widget"},l?{reserved:{$ref:l}}:void 0);});},onBrandFooterClick:()=>{un.then(l=>(Ct("loop_click",{placement:"widget"},l?{reserved:{$ref:l}}:void 0),ps()));},onClose:()=>{o.debug("Widget closed"),re&&(qt?.recordDismissal(),J("proactive:dismissed",{type:re})),O=null,G=null,re=null,J("widget:closed");},onScreenshotRequest:async()=>{if(!(!!f||!!i.capture?.screenshotProvider)||i.capture?.screenshot==="off"){o.warn("Screenshot requested but capture is disabled"),v.setScreenshotError(true,"unsupported");return}if(!Fe){o.debug("Taking screenshot"),v.setScreenshotCapturing(true);try{O=await Hi();}catch(c){o.warn("Screenshot capture threw",{error:c instanceof Error?c.message:String(c)}),O=null;}v.setScreenshotAttached(O!==null),v.setScreenshotPreview(O),O===null&&v.setScreenshotError(true,it?"permission":void 0);}},onScreenshotShareTabRequest:typeof navigator<"u"&&typeof navigator.mediaDevices?.getDisplayMedia=="function"?()=>{let l=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:false,preferCurrentTab:true,selfBrowserSurface:"include"});l.catch(()=>{}),v.setScreenshotCapturing(true);let c=document.getElementById("mushi-mushi-widget");c&&(c.style.visibility="hidden");let y=i.privacy;Promise.resolve().then(()=>(su(),ou)).then(I=>I.grabMaskedTabFrame(l,[Si,"[data-mushi-redact]",...y?.redactSelectors??[],...y?.maskSelectors??[],...y?.blockSelectors??[]]),I=>{throw l.then($=>$.getTracks().forEach(N=>N.stop()),()=>{}),I}).then(I=>{O=I,v.setScreenshotAttached(true),v.setScreenshotPreview(I);}).catch(I=>{o.warn("Tab capture failed",{error:I instanceof Error?I.name:String(I)}),v.setScreenshotError(true,I instanceof Error&&I.name==="NotAllowedError"?"permission":"error");}).finally(()=>{c&&(c.style.visibility="");});}:void 0,onScreenshotRemove:()=>{o.debug("Screenshot attachment removed"),O=null,v.setScreenshotAttached(false);},onScreenshotAnnotateRequest:async l=>{if(!O||l.childElementCount>0)return;let c;try{let{createScreenshotAnnotation:Q}=await Promise.resolve().then(()=>(uu(),au));c=await Q(O,l);}catch(Q){o.warn("Screenshot annotation failed",{error:Q instanceof Error?Q.message:String(Q)});return}let y=document.createElement("div");y.className="mushi-annotate-toolbar";let I=Q=>{(O=c.getDataUrl(),v.setScreenshotAttached(true),v.setScreenshotPreview(O)),c.destroy(),y.remove();},$=[{id:"highlight",label:"\u270F\uFE0F Highlight"},{id:"blur",label:"\u{1F512} Blur"},{id:"arrow",label:"\u2197\uFE0F Arrow"}];for(let Q of $){let ue=document.createElement("button");ue.type="button",ue.className="mushi-attach-btn",ue.dataset.tool=Q.id,ue.textContent=Q.label,ue.addEventListener("click",()=>{c.setTool(Q.id),y.querySelectorAll("button[data-tool]").forEach(B=>B.classList.remove("active")),ue.classList.add("active");}),y.appendChild(ue);}y.querySelector('button[data-tool="highlight"]')?.classList.add("active");let N=document.createElement("button");N.type="button",N.className="mushi-attach-btn",N.textContent="\u2713 Done",N.addEventListener("click",()=>I()),y.appendChild(N),l.insertBefore(y,l.firstChild);},onElementSelectorRequest:async()=>{if(!g||i.capture?.elementSelector===false){o.warn("Element selector requested but it is disabled/unavailable"),v.setElementError(true);return}o.debug("Element selector activated"),v.setElementCapturing(true),v.hidePanel();try{let l=await g.activate();l?(G=l,v.setElementSelected(!0),o.debug("Element selected",{tagName:l.tagName,xpath:l.xpath})):v.setElementCapturing(!1);}catch(l){o.warn("Element selector threw",{error:l instanceof Error?l.message:String(l)}),v.setElementError(true);}finally{v.showPanel();}},async onReporterReportsRequest(){let l=await u.listReporterReports(te(r));if(!l.ok)throw new Error(l.error?.message??"Could not load reports");return St=l.data?.reports??[],St.length&&ni(r),St},onReporterMarkRead:l=>mu(l),async onReporterReportRequest(l){let c=await ie.getReport(l,te(r));return c.ok&&c.data?{report:c.data.report,timeline:c.data.timeline}:null},async onReporterEmailOptIn(l){let c=await ie.setPrefs(te(r),{email:l,channels:{email:true}});if(!c.ok)throw new Error(c.error?.code??"EMAIL_OPT_IN_FAILED")},async onReporterPushSubscribe(){let l=await cn.subscribeReporterPush();if(!l.ok)throw new Error(l.reason)},async onReporterCommentsRequest(l){let c=await u.listReporterComments(l,te(r));if(!c.ok)throw new Error(c.error?.message??"Could not load thread");return c.data?.comments??[]},async onReporterReply(l,c){let y=await u.replyToReporterReport(l,te(r),c);if(!y.ok)throw new Error(y.error?.message??"Could not send reply")},async onReporterFeedback(l,c,y){let I=await u.replyToReporterReport(l,te(r),y??"",c);if(!I.ok)throw new Error(I.error?.message??"Could not send feedback");return I.data?.feedback??null},async onReporterReopen(l,c){let y=await u.reopenReporterReport(l,te(r),c);if(!y.ok)throw new Error(y.error?.message??"Could not reopen report");return y.data?.outcome??null},async onFeatureBoardRequest(){let l=await u.listReporterFeatureBoard(te(r));if(!l.ok)throw new Error(l.error?.message??"Could not load community ideas");return l.data?.tickets??[]},async onFeatureBoardVote(l){let c=await u.voteReporterFeatureBoard(l,te(r));if(!c.ok)throw new Error(c.error?.message??"Could not vote");return c.data??{voted:true,action:"added"}},onLeaderboardOpen(){v.setLeaderboard(null,true),Fa(10).then(l=>{v.setLeaderboard(l,false);});},async onMushiSignIn(l){let c=await u.sendMagicLink(l);if(!c.ok)throw new Error(c.error?.message??"Could not send sign-in link");return {ok:true}},async onGlobalLeaderboardOpen(){v.setGlobalLeaderboard(null,true);try{let l=Y(),c=await u.getPublicLeaderboard(50),I=(c.ok?c.data?.leaderboard??[]:[]).map($=>({tester_id:$.tester_id,rank:$.rank,public_handle:$.public_handle,display_name:$.display_name,points_30d:$.points_30d,total_points:$.total_points??0,badge:$.badge_slug}));if(v.setGlobalLeaderboard(I,!1),l){let $=await u.getMyReputation(l);if($.ok&&$.data){let N=$.data;N.reputation&&v.setTesterReputation(N.reputation);}}}catch{v.setGlobalLeaderboard([],false);}},async onCrossAppReportsOpen(){let l=Y();if(!l){v.setCrossAppReports([],false);return}try{let c=await u.getCrossAppReports(l),y=c.ok?c.data?.reports??[]:[];v.setCrossAppReports(y,!1);}catch{v.setCrossAppReports([],false);}},onTesterSignOut(){j();},assistantEnabled:e.assistant?.enabled===true,...e.assistant?.label?{assistantLabel:e.assistant.label}:{},...e.assistant?.greeting?{assistantGreeting:e.assistant.greeting}:{},...e.assistant?.suggestions?{assistantSuggestions:e.assistant.suggestions}:{},async onAssistantAsk(l,c){let y=await u.askAssistant({message:l,threadId:c,context:s});return y.ok?y.data??null:null}}),un.then(l=>v.setBrandRef(l)),Be(),typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>v.mount()):v.mount());let Fi=Y();Fi&&ke(Fi).catch(()=>j());let Ni=null,qt=null,ee=i.proactive;ee&&(ee.rageClick!==false||ee.longTask!==false||ee.apiCascade!==false||ee.errorBoundary===true||ee.pageDwell||ee.firstSession)&&typeof document<"u"&&(qt=iu(ee?.cooldown),Ni=ru({onTrigger:(l,c)=>{if(typeof navigator<"u"&&!navigator.onLine){o.debug("Proactive trigger suppressed: offline",{type:l});return}if(!qt.shouldShow(l)){o.debug("Proactive trigger suppressed by fatigue prevention",{type:l});return}o.info("Proactive trigger fired",{type:l,context:c}),re=l,J("proactive:triggered",{type:l,context:c}),l==="first_session"?v.pulseTrigger?.():v.open();}},{rageClick:ee?.rageClick,longTask:ee?.longTask,apiCascade:ee?.apiCascade,apiEndpoint:Pi(i),errorBoundary:ee?.errorBoundary,ignoreErrors:i.ignoreErrors,denyUrls:i.denyUrls,allowUrls:i.allowUrls,pageDwell:ee?.pageDwell,firstSession:ee?.firstSession,projectId:e.projectId}),o.debug("Proactive triggers enabled",{rageClick:ee?.rageClick!==false,longTask:ee?.longTask!==false,apiCascade:ee?.apiCascade!==false,errorBoundary:ee?.errorBoundary===true,pageDwell:!!ee?.pageDwell,firstSession:!!ee?.firstSession})),h.startAutoSync(u),h.flush(u).then(l=>{l.sent>0&&o.info("Synced offline reports",{sent:l.sent});});function ln(l){if(_e=true,Ce=l.reporterNotificationsEnabled!==false,ot=l.enabled===false?null:l.reporter??null,st(),l.enabled===false){i=e,Jp(t.projectId),Be(),v.updateConfig(i.widget),z(),o.debug("Runtime SDK config disabled; using bootstrap config",{version:l.version});return}i=_a(i,l,e),Be(),l.widget&&v.updateConfig(i.widget),Ce?Ut():z(),o.debug("Applied runtime SDK config",{version:l.version});}if(Kp(t)){let l=Yp(t.projectId);l&&ln(l),u.getSdkConfig().then(c=>{c.ok&&c.data?(Xp(t.projectId,c.data),ln(c.data)):c.error&&o.debug("Runtime SDK config unavailable",c.error);}).catch(c=>{o.debug("Runtime SDK config fetch failed",{error:c instanceof Error?c.message:String(c)});});}else o.debug("Runtime SDK config disabled via runtimeConfig:false; using static bootstrap config");gu(),Ut(),fu(),o.info("Initialized",{projectId:t.projectId});async function gu(){if(i.widget?.outdatedBanner==="off")return;let l=Qp(Ye);l&&Ui(l);let c=await u.getLatestSdkVersion(Ye);!c.ok||!c.data||(Zp(Ye,c.data),Ui(c.data));}function Ui(l){let c=l.latest,y=!!(c&&eh(we,c));if(!y&&!l.deprecated)return;let I=l.deprecationMessage??(y?`Update ${Ye} to ${c}.`:null);o.warn("Mushi SDK is outdated",{package:Ye,current:we,latest:c,deprecated:l.deprecated,message:I}),Ws(i.widget?.outdatedBanner,!!i.debug,typeof location>"u"?void 0:location)&&v.setSdkFreshness({latest:c,current:we,deprecated:l.deprecated,message:I});}async function bu(l,c,y,I){let $=p.check(c);if(!$.passed){o.info("Report blocked by pre-filter",{reason:$.reason});return}let N=t.preFilter?.wasmClassifier;if(N)try{let q=await N.classify({description:c,category:l,url:typeof location<"u"?location.href:void 0,hasScreenshot:O!==null,hasSelectedElement:G!==null,hasNetworkErrors:M?.getEntries()?.some(be=>be.status>=400||!!be.error)??!1,hasConsoleErrors:L?.getEntries()?.some(be=>be.level==="error")??!1,proactiveTrigger:re??void 0});if(q.verdict==="block"){o.info("Report blocked by on-device classifier",{modelId:q.modelId,confidence:q.confidence,reason:q.reason});return}o.debug("On-device classifier verdict",{...q});}catch(q){o.warn("On-device classifier threw \u2014 falling through to server",{error:q instanceof Error?q.message:String(q)});}if(re!==null&&t.sampleRate!==void 0&&t.sampleRate<1&&(t.sampleRate<=0||Math.random()>t.sampleRate)){o.debug("Report dropped by sampleRate",{sampleRate:t.sampleRate,trigger:re});return}if(!k.tryConsume()){o.warn("Report throttled \u2014 rate limit exceeded");return}let ue=S.scrub(p.truncate(c)),B=t.sentry?Ii(t.sentry):void 0,Z=await zo().catch(()=>null),Ne=i.capture?.console===false?void 0:E(L?.getEntries()),Ue=i.capture?.network===false?void 0:M?.getEntries(),br=T(X.getAll()),Wi=w(Object.keys(U).length>0?{...U}:void 0),Vi=B?{...B,...B.breadcrumbs?{breadcrumbs:T(B.breadcrumbs)}:{},...B.tags?{tags:w(B.tags)}:{}}:void 0,Ki=O?await Ds(O).catch(()=>null):null,Er=false;O&&!Ki&&(Er=true,o.warn("Screenshot dropped \u2014 could not compress under wire budget"));let zi=Dn(),Te={id:$n(),projectId:t.projectId,category:l,...I?{userCategory:I}:{},description:ue,userIntent:y,environment:zi,consoleLogs:Ne,networkLogs:Ue,performanceMetrics:i.capture?.performance===false?void 0:x?.getMetrics(),timeline:b.getEntries({consoleLogs:Ne,networkLogs:Ue}),screenshotDataUrl:Ki??void 0,selectedElement:G??void 0,...C?{replayEvents:C.flush()}:{},metadata:{...F,...R?{user:R}:{},...B?.release?{sentryRelease:B.release}:{}},sessionId:bt(),reporterToken:te(r),...Z?{fingerprintHash:Z}:{},appVersion:lu(i,zi),sdkPackage:Ye,sdkVersion:we,proactiveTrigger:re??void 0,...br.length>0?{breadcrumbs:br}:{},...Wi?{tags:Wi}:{},...Vi?{sentryContext:Vi}:{},sentryEventId:B?.eventId,sentryReplayId:B?.replayId,createdAt:new Date().toISOString()};if(X.add({category:"lifecycle",level:"info",message:`Mushi report submitting (${l})`,data:{reportId:Te.id,category:l}}),t.integrations?.custom){let q={addMetadata(be,dn){Te.metadata[be]=dn;},setCategory(be){Te.category=be;},setDescription(be){Te.description=be;}};t.integrations.custom(q);}let W=Te,Gi=t.beforeSend??t.beforeSendFeedback;if(Gi)try{let q=await Promise.race([Promise.resolve(Gi(Te)),new Promise(be=>setTimeout(()=>be(Te),2e3))]);if(q===null){o.info("Report dropped by beforeSend hook",{reportId:Te.id});return}W=q;}catch(q){o.warn("beforeSend hook threw \u2014 sending unmodified report",{error:q instanceof Error?q.message:String(q)});}if(J("report:submitted",{reportId:W.id}),typeof navigator<"u"&&!navigator.onLine)return await h.enqueue(W),o.info("Offline \u2014 report queued",{reportId:W.id}),J("report:queued",{reportId:W.id}),{reportId:null,queuedOffline:true,failureKind:"offline"};let V=await u.submitReport(W);if(!V.ok&&V.error?.code==="PAYLOAD_TOO_LARGE"&&(Array.isArray(W.replayEvents)&&W.replayEvents.length>0&&(o.warn("Report too large \u2014 dropping replay buffer and retrying",{reportId:W.id}),W={...W,replayEvents:void 0},V=await u.submitReport(W)),!V.ok&&V.error?.code==="PAYLOAD_TOO_LARGE"&&W.screenshotDataUrl&&(o.warn("Report still too large \u2014 dropping screenshot and retrying",{reportId:W.id}),Er=true,W={...W,screenshotDataUrl:void 0},V=await u.submitReport(W))),V.ok){if(o.info("Report sent",{reportId:V.data?.reportId}),J("report:sent",{reportId:V.data?.reportId}),ni(r),Nt(),V.data?.cursorAgentId){let q=V.data;J("report:dispatched",{reportId:q.reportId,agentId:q.cursorAgentId,fixId:q.fixId});}X.add({category:"lifecycle",level:"info",message:`Mushi report sent (${V.data?.reportId??Te.id})`}),Ft({action:"report_submit",metadata:{category:l,reportId:V.data?.reportId??Te.id}});try{t.sentry&&V.data?.reportId&&Mi(V.data.reportId);}catch{}}else {if(V.error?.code==="PAYLOAD_TOO_LARGE"||V.error?.code==="SERIALIZE_FAILED")return o.warn("Report exceeds size limit after degradation \u2014 dropping",{reportId:W.id,error:V.error}),J("report:failed",{reportId:W.id,error:V.error}),X.add({category:"lifecycle",level:"error",message:`Mushi report dropped \u2014 payload too large (${W.id})`}),O=null,G=null,re=null,{reportId:null,queuedOffline:false,failureKind:"permanent",screenshotDropped:Er};{let q=V.error?.code??"",be=q==="HTTP_429"||q.includes("RATE_LIMIT"),dn=q==="HTTP_401"||q.includes("UNAUTHORIZED")||q.includes("INVALID_API_KEY")||q.includes("MISSING_API_KEY"),Eu=q==="HTTP_403"||q.includes("QUOTA")||q.includes("FORBIDDEN")||q==="feature_not_in_plan";if(dn||Eu)return o.warn("Report rejected \u2014 credentials/quota",{reportId:W.id,error:V.error}),J("report:failed",{reportId:W.id,error:V.error}),O=null,G=null,re=null,{reportId:null,queuedOffline:false,failureKind:"quota"};if(be)return o.warn("Report rate-limited \u2014 queued for retry",{reportId:W.id,error:V.error}),await h.enqueue(W),J("report:failed",{reportId:W.id,error:V.error}),O=null,G=null,re=null,{reportId:null,queuedOffline:true,failureKind:"rate_limited"};o.warn("Report failed, queuing for retry",{reportId:W.id,error:V.error}),await h.enqueue(W),J("report:failed",{reportId:W.id,error:V.error}),X.add({category:"lifecycle",level:"warning",message:`Mushi report queued for retry (${W.id})`});}}return O=null,G=null,re=null,V?.ok?{reportId:V.data?.reportId??Te.id,queuedOffline:false,screenshotDropped:Er}:{reportId:null,queuedOffline:true,failureKind:"retrying"}}let cn={report(l){v.open(l);},on(l,c){return me.has(l)||me.set(l,new Set),me.get(l).add(c),()=>me.get(l)?.delete(c)},setUser(l){R=l;},setMetadata(l,c){F[l]=c;},setScreen(l){b.setScreen(l);},isOpen(){return v.getIsOpen()},open(){v.open();},openWith(l){v.open({category:l});},show(){v.showTrigger();},hide(){v.hideTrigger();},attachTo(l,c){return v.attachTo(l,c)},setTrigger(l){v.setTrigger(l);},openReporter(){v.openReporter();},close(){v.close();},updateConfig(l){ln(l);},diagnose(){return zp({apiEndpoint:Pi(i),widgetMounted:v.getIsMounted(),runtimeConfigLoaded:_e,captureScreenshotAvailable:f!==null,captureNetworkIntercepting:M!==null,widgetDiagnostics:v.getWidgetDiagnostics()})},destroy(){Ni?.destroy(),qt?.reset(),hs(),v.destroy(),L?.destroy(),M?.destroy(),x?.destroy(),g?.deactivate(),Na(),Xe?.(),Xe=null,m?.destroy(),m=null,b.destroy(),Aa(),C?.destroy(),C=null,h.stopAutoSync(),z(),d?.(),d=null,ns(),X.clear(),me.clear(),He=null,o.debug("Destroyed");},async captureEvent(l){if(!k.tryConsume())return o.warn("captureEvent throttled \u2014 rate limit exceeded"),null;let c=S.scrub(p.truncate(l.description)),y=l.category??"bug",I=t.sentry?Ii(t.sentry):void 0,$=T(X.getAll()),N=w(Object.keys(U).length===0&&!l.tags?void 0:{...U,...l.tags??{}}),Q=I?{...I,...I.breadcrumbs?{breadcrumbs:T(I.breadcrumbs)}:{},...I.tags?{tags:w(I.tags)}:{}}:void 0,ue=Dn(),B={id:$n(),projectId:t.projectId,category:y,description:c,environment:ue,timeline:b.getEntries(),metadata:{...l.metadata??{},...R?{user:R}:{},...l.error?{error:l.error}:{},...l.severity?{severity:l.severity}:{},...l.component?{component:l.component}:{},...l.source?{source:l.source}:{source:"captureEvent"}},...$.length>0?{breadcrumbs:$}:{},...N&&Object.keys(N).length>0?{tags:N}:{},...Q?{sentryContext:Q}:{},sessionId:bt(),reporterToken:te(r),appVersion:lu(i,ue),sdkPackage:Ye,sdkVersion:we,sentryEventId:I?.eventId,sentryReplayId:I?.replayId,createdAt:new Date().toISOString()},Z=B;if(i.beforeSendFeedback)try{let Ue=await Promise.race([Promise.resolve(i.beforeSendFeedback(B)),new Promise(br=>setTimeout(()=>br(B),2e3))]);if(Ue===null)return o.info("captureEvent dropped by beforeSendFeedback hook",{reportId:B.id}),null;Z=Ue;}catch(Ue){o.warn("captureEvent beforeSendFeedback threw \u2014 sending unmodified report",{error:Ue instanceof Error?Ue.message:String(Ue)});}if(J("report:submitted",{reportId:Z.id}),typeof navigator<"u"&&!navigator.onLine)return await h.enqueue(Z),J("report:queued",{reportId:Z.id}),null;let Ne=await u.submitReport(Z);if(Ne.ok){J("report:sent",{reportId:Ne.data?.reportId});try{t.sentry&&Ne.data?.reportId&&Mi(Ne.data.reportId);}catch{}return Ne.data?.reportId??null}return await h.enqueue(Z),J("report:failed",{reportId:Z.id,error:Ne.error}),null},async captureException(l,c){let y=bs(l),I=typeof c?.metadata?.filename=="string"?c.metadata.filename:void 0;if(or({message:y.message,filename:I,ignoreErrors:i.ignoreErrors,denyUrls:i.denyUrls,allowUrls:i.allowUrls}))return null;X.add({category:"lifecycle",level:"error",message:`Mushi.captureException(${y.name}): ${y.message}`,...y.stack?{data:{stack:y.stack.slice(0,500)}}:{}});let $=c?.description?.trim()||`${y.name}: ${y.message}`||"Uncaught exception";return cn.captureEvent({description:$,category:c?.category??"bug",severity:c?.severity??"high",...c?.component?{component:c.component}:{},...c?.tags?{tags:c.tags}:{},source:c?.source??"captureException",error:{name:y.name,message:y.message,...y.stack?{stack:y.stack}:{}},metadata:{...c?.metadata??{},...y.cause?{cause:y.cause}:{}}})},identify(l,c){let y=`${l}::${c?JSON.stringify(c):""}`;if(y!==H){if(H=y,R={id:l,...c?.email?{email:c.email}:{},...c?.name?{name:c.name}:{}},v.setIdentifiedUser(R.name||R.email?{name:R.name,email:R.email}:null),st(),c)for(let[I,$]of Object.entries(c))I!=="email"&&I!=="name"&&(F[`user.${I}`]=$);X.add({category:"lifecycle",level:"info",message:`Mushi.identify(${l})`}),ds(l,c??null),Oi(l,c?{email:c.email,name:c.name,provider:c.provider}:void 0);}},identifyWithToken(l){if(a=l&&typeof l=="string"?l:null,a){let c=ks(a);if(c?.sub){if(R?.id===c.sub){X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken() refreshed"});return}rs(c.sub),R={id:c.sub,...c.email?{email:c.email}:{},...c.name?{name:c.name}:{}},v.setIdentifiedUser(R.name||R.email?{name:R.name,email:R.email}:null),Oi(R.id,{email:R.email,name:R.name});}X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken()"});}else R=null,H=null,v.setIdentifiedUser(null),X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken(null)"});},publishPageContext(l){s=l&&l.route?l:null;},openAssistant(){v.openAssistantTab();},addBreadcrumb(l){X.add(l);},getBreadcrumbs(){return X.getAll()},setTag(l,c){typeof l!="string"||l.length===0||(U[l]=c);},setTags(l){if(!(!l||typeof l!="object"))for(let[c,y]of Object.entries(l))typeof c=="string"&&c.length>0&&(U[c]=y);},clearTag(l){if(typeof l=="string"&&l.length>0){delete U[l];return}for(let c of Object.keys(U))delete U[c];},async getReputation(){if(!R?.id)return null;let l=await u.getMyPoints(R.id);return l.ok?{totalPoints:l.data.total_points??0,points30d:l.data.points_30d??0,reputation:1,confirmedBugs:0,totalReports:0}:null},async getTier(){return R?.id?Ba(R.id):null},recordActivity(l,c){i.rewards?.enabled&&Ft({action:l,metadata:c});},track(l,c){return Ct(l,c)},setConsent(l){cs(l);},getAnonymousId(){return us()},pulseTrigger(){v.pulseTrigger?.();},async listMyReports(){let l=await u.listReporterReports(te(r));return l.ok?l.data?.reports??[]:[]},async listMyComments(l){let c=await u.listReporterComments(l,te(r));return c.ok?c.data?.comments??[]:[]},async replyToReport(l,c){let y=await u.replyToReporterReport(l,te(r),c);return y.ok?y.data?.comment??null:null},async submitFeedbackSignal(l,c,y){let I=await u.replyToReporterReport(l,te(r),y??"",c);return I.ok?I.data?.feedback??null:null},async reopenReport(l,c){let y=await u.reopenReporterReport(l,te(r),c);return y.ok?y.data?.outcome??null:null},openMyReports(){v.recorderOpenMyReports();},getReporterUpdates:ge,async markReportRead(l){let c=await ie.markReportRead(l,n());return c.ok?c.data?.unread_total??0:null},onReporterUpdate(l){return he.add(l),ge(),()=>{he.delete(l);}},async getNotificationPrefs(){let l=await ie.getPrefs(n());return l.ok?l.data??null:null},setNotificationPrefs:l=>ie.setPrefs(n(),l),async subscribeReporterPush(){let l=i.notifications?.webPush,c=ot?.vapidPublicKey??null;if(l&&!c){let y=await u.getSdkConfig();c=y.ok?y.data?.reporter?.vapidPublicKey??null:null;}return ka(ie,n(),l?l.serviceWorkerPath:null,c)},async getHallOfFame(l=20){let c=await u.getHallOfFame(l);return c.ok?c.data?.data??[]:[]}};if(typeof globalThis<"u"&&(e.debug??false)&&Ca(v),typeof window<"u"&&typeof localStorage<"u"){let l="mushi:last-run",c=null;try{let y=localStorage.getItem(l);c=y===null?null:y==="unfinished",localStorage.setItem(l,"unfinished");}catch{c=null;}try{window.addEventListener("pagehide",()=>{try{localStorage.setItem(l,"clean");}catch{}$o(),Oo();});}catch{}if(typeof e.onCrashedLastRun=="function")try{e.onCrashedLastRun(c);}catch(y){o.warn("onCrashedLastRun hook threw",{error:y instanceof Error?y.message:String(y)});}}let qi={on:()=>{},onReporterUpdate:()=>{},isOpen:false,getBreadcrumbs:[],captureEvent:null,captureException:null,getReputation:null,getTier:null,listMyReports:[],listMyComments:[],getHallOfFame:[],replyToReport:null,submitFeedbackSignal:null,reopenReport:null},ji=(l,c)=>{let y=c instanceof Error?c.message:String(c);o.debug(`Mushi.${l}() failed (swallowed)`,{error:y});try{X.add({category:"custom",level:"warning",message:`mushi.${l}() threw`,data:{error:y}});}catch{}};return (l=>new Proxy(l,{get(c,y,I){let $=Reflect.get(c,y,I);if(typeof $!="function")return $;let N=String(y),Q=()=>N==="diagnose"?Di():N in qi?qi[N]:void 0;return (...ue)=>{try{let B=$.apply(c,ue);return B&&typeof B.then=="function"?B.catch(Z=>(ji(N,Z),Q())):B}catch(B){return ji(N,B),Q()}}}}))(cn)}function Pi(t){return t.apiEndpoint??Yt}function Kp(t){return t.runtimeConfig!==false}async function zp(t){let e=await Gp(t.apiEndpoint);return {apiEndpointReachable:e.reachable,cspAllowsEndpoint:e.cspAllowed,widgetMounted:t.widgetMounted,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:t.runtimeConfigLoaded,captureScreenshotAvailable:t.captureScreenshotAvailable,captureNetworkIntercepting:t.captureNetworkIntercepting,sdkVersion:we,widgetHostPointerSafe:t.widgetDiagnostics?.widgetHostPointerSafe??false,widgetHostBounds:t.widgetDiagnostics?.widgetHostBounds??null,widgetSuppressed:t.widgetDiagnostics?.widgetSuppressed??false,bannerRendered:t.widgetDiagnostics?.bannerRendered??false}}async function Di(){return {apiEndpointReachable:false,cspAllowsEndpoint:false,widgetMounted:false,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:false,captureScreenshotAvailable:false,captureNetworkIntercepting:false,sdkVersion:we,widgetHostPointerSafe:false,widgetHostBounds:null,widgetSuppressed:false,bannerRendered:false}}async function Gp(t){if(typeof fetch>"u")return {reachable:false,cspAllowed:false};let e=typeof AbortController<"u"?new AbortController:null,r=e?setTimeout(()=>e.abort(),3e3):null;try{return {reachable:(await fetch(`${t.replace(/\/$/,"")}/health`,{method:"GET",cache:"no-store",...e?{signal:e.signal}:{},[ir]:"diagnose"})).ok,cspAllowed:!0}}catch{return {reachable:false,cspAllowed:false}}finally{r&&clearTimeout(r);}}function $i(t){return `mushi:sdk-config:${t}`}function hu(t){return `mushi:sdk-version:${t}`}function Yp(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem($i(t));return e?JSON.parse(e).config??null:null}catch{return null}}function Xp(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem($i(t),JSON.stringify({cachedAt:Date.now(),config:e}));}catch{}}function Jp(t){if(!(typeof localStorage>"u"))try{localStorage.removeItem($i(t));}catch{}}function Qp(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(hu(t));if(!e)return null;let r=JSON.parse(e);return !r.data||!r.cachedAt||Date.now()-r.cachedAt>864e5?null:r.data}catch{return null}}function Zp(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem(hu(t),JSON.stringify({cachedAt:Date.now(),data:e}));}catch{}}function eh(t,e){let r=cu(t),n=cu(e);for(let i=0;i<Math.max(r.length,n.length);i++){let o=r[i]??0,a=n[i]??0;if(o<a)return true;if(o>a)return false}return false}function cu(t){return t.split(/[.-]/).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e))}function du(){return {report:()=>{},on:()=>()=>{},setUser:()=>{},setMetadata:()=>{},setScreen:()=>{},isOpen:()=>false,open:()=>{},close:()=>{},updateConfig:()=>{},diagnose:Di,openWith:()=>{},show:()=>{},hide:()=>{},attachTo:()=>()=>{},setTrigger:()=>{},openReporter:()=>{},destroy:()=>{He=null;},captureEvent:async()=>null,captureException:async()=>null,identify:()=>{},identifyWithToken:()=>{},publishPageContext:()=>{},openAssistant:()=>{},addBreadcrumb:()=>{},getBreadcrumbs:()=>[],setTag:()=>{},setTags:()=>{},clearTag:()=>{},getReputation:async()=>null,getTier:async()=>null,recordActivity:()=>{},track:()=>false,setConsent:()=>{},getAnonymousId:()=>null,pulseTrigger:()=>{},listMyReports:async()=>[],listMyComments:async()=>[],replyToReport:async()=>null,submitFeedbackSignal:async()=>null,reopenReport:async()=>null,openMyReports:()=>{},getHallOfFame:async()=>[],getReporterUpdates:async()=>null,markReportRead:async()=>null,onReporterUpdate:()=>()=>{},getNotificationPrefs:async()=>null,setNotificationPrefs:async()=>({ok:false}),subscribeReporterPush:async()=>({ok:false,reason:"off"})}}function th(t){if(typeof window>"u")return ()=>{};let e=[];try{let r=i=>{t.add({category:"navigation",level:"info",message:`${i}: ${window.location.pathname}`,data:{url:window.location.href,kind:i}});},n=Me({onPush:()=>r("pushState"),onReplace:()=>r("replaceState"),onPop:()=>r("popstate")});e.push(n);}catch{}try{let r=console.error,n=console.warn,i=function(...a){try{t.add({category:"console",level:"error",message:a.map(pu).join(" ")});}catch{}return r.apply(this,a)},o=function(...a){try{t.add({category:"console",level:"warning",message:a.map(pu).join(" ")});}catch{}return n.apply(this,a)};console.error=i,console.warn=o,e.push(()=>{console.error===i&&(console.error=r),console.warn===o&&(console.warn=n);});}catch{}try{let r=n=>{try{let i=n.target;if(!(i instanceof Element))return;let o=i,a=0;for(;o&&a<10;){let s=o.getAttribute("data-testid");if(s){let u=(o.textContent??"").trim().slice(0,80);t.add({category:"ui.click",level:"info",message:`clicked ${s}${u?` \u2014 ${u}`:""}`,data:{testid:s,tag:o.tagName.toLowerCase()}});return}o=o.parentElement,a++;}}catch{}};document.addEventListener("click",r,{passive:!0,capture:!0}),e.push(()=>document.removeEventListener("click",r,!0));}catch{}return ()=>{for(let r of e)try{r();}catch{}}}function pu(t){try{if(t instanceof Error)return `${t.name}: ${t.message}`;if(typeof t=="object"&&t!==null){let r=JSON.stringify(t);return r.length>200?`${r.slice(0,200)}\u2026`:r}let e=String(t);return e.length>200?`${e.slice(0,200)}\u2026`:e}catch{return `[${typeof t}]`}}function rh(){let t=document.currentScript;if(t&&t.dataset&&t.dataset.project)return t;let e=Array.from(document.querySelectorAll("script[data-project][data-key]"));return e.length>0?e[e.length-1]:null}function nh(t){let e=t.project?.trim(),r=t.key?.trim();if(!e||!r)return null;let n={};t.trigger&&(n.trigger=t.trigger),t.theme&&(n.theme=t.theme),t.position&&(n.position=t.position),t.triggerText&&(n.triggerText=t.triggerText);let i=t.bannerVariant,o=t.bannerPosition;(i||o)&&(n.bannerConfig={...i?{variant:i}:{},...o?{position:o}:{}});let a={projectId:e,apiKey:r};return t.endpoint&&(a.apiEndpoint=t.endpoint),t.debug==="true"&&(a.debug=true),Object.keys(n).length>0&&(a.widget=n),a}function ih(){if(typeof document>"u"||typeof window>"u")return;let t=window;if(t.__mushiLoaderInit)return;let e=rh();if(!e)return;let r=nh(e.dataset);if(r){t.__mushiLoaderInit=true;try{an.init(r);}catch{}}}ih();
|
|
95
|
+
`,document.body.appendChild(f),f}function p(f,g){let m=document.elementsFromPoint(f,g),b=null;for(let P of m)if(!(P===r||P===e)){if(P.id==="mushi-mushi-widget"||P.closest("#mushi-mushi-widget"))return null;b=P;break}let C=0;for(;b?.shadowRoot&&C<20;){let P=b.shadowRoot.elementFromPoint(f,g);if(!P||P===b)break;b=P,C++;}return b}function h(f){if(!e)return;let g=f.getBoundingClientRect();e.style.left=`${g.left}px`,e.style.top=`${g.top}px`,e.style.width=`${g.width}px`,e.style.height=`${g.height}px`,e.style.display="block";}function k(f){let g=p(f.clientX,f.clientY);if(!g){n=null,e&&(e.style.display="none");return}n=g,h(g);}function S(f){f.preventDefault(),f.stopPropagation();}function T(f){f.preventDefault(),f.stopPropagation();let g=p(f.clientX,f.clientY);g&&L(s(g));}function E(f){f.key==="Escape"&&L(null);}function w(){n?.isConnected&&h(n);}function L(f){x(),i?.(f),i=null;}function M(){return t&&x(),new Promise(f=>{i=f,t=true,e=u(),r=d(),r.addEventListener("mousemove",k),r.addEventListener("click",T),r.addEventListener("pointerdown",S),r.addEventListener("mousedown",S),r.addEventListener("mouseup",S),document.addEventListener("keydown",E,true),window.addEventListener("scroll",w,{capture:true,passive:true});})}function x(){t&&(t=false,n=null,document.removeEventListener("keydown",E,true),window.removeEventListener("scroll",w,{capture:true}),r&&(r.remove(),r=null),e&&(e.remove(),e=null));}return {activate:M,deactivate:x,isActive:()=>t}}var Ga=120;function ki(){let t=[],e=()=>n("hashchange");n("initial");function r(a){t.push(a),t.length>Ga&&t.shift();}function n(a){typeof location>"u"||r({ts:Date.now(),kind:"route",payload:{source:a,route:sr(`${location.pathname}${location.search}${location.hash}`),href:sr(location.href)}});}function i(a){let s=a.target instanceof Element?a.target:null;if(!s)return;let u=s.closest('button,a,[role="button"],input,textarea,select,[data-mushi-track]')??s;r({ts:Date.now(),kind:"click",payload:{tag:u.tagName.toLowerCase(),id:u.id||void 0,text:Sp(u)}});}let o=Me({onPush:()=>n("pushState"),onReplace:()=>n("replaceState"),onPop:()=>n("popstate")});return window.addEventListener("hashchange",e),document.addEventListener("click",i,true),{setScreen(a){r({ts:Date.now(),kind:"screen",payload:a});},getEntries(a={}){return [...t,...(a.consoleLogs??[]).map(u=>({ts:u.timestamp,kind:"log",payload:{level:u.level,message:u.message}})),...(a.networkLogs??[]).map(u=>({ts:u.timestamp,kind:"request",payload:{method:u.method,url:u.url,status:u.status,duration:u.duration,error:u.error}}))].sort((u,d)=>u.ts-d.ts).slice(-Ga)},clear(){t.length=0;},destroy(){o(),window.removeEventListener("hashchange",e),document.removeEventListener("click",i,true);}}}function Sp(t){let e=(t.textContent??"").replace(/\s+/g," ").trim();return e?e.slice(0,80):void 0}var xp=6e4,Rp=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,kp=/^[0-9a-f]{20,}$/i,_p=/^\d+$/,Cp=/^[a-z0-9]{16,}$/i;function Ya(t){return t.length===0?t:Rp.test(t)||kp.test(t)||_p.test(t)||Cp.test(t)&&/\d/.test(t)?"[id]":t}function Tp(t,e,r){if(e.startsWith("#/")){let n=e.slice(1),i=n.indexOf("?"),o=i===-1?n:n.slice(0,i),a=r?.map(s=>s.startsWith("/#/")?s.slice(2):s);return "/#"+_i(o,a)}return _i(t,r)}function _i(t,e){let r=t.length>1&&t.endsWith("/")?t.slice(0,-1):t;if(e?.length){let n=Ap(r,e);if(n)return n}return "/"+r.split("/").filter(n=>n.length>0).map(Ya).join("/")}function Ap(t,e){let r=t.split("/").filter(i=>i.length>0),n=[...e].sort((i,o)=>o.split("/").length-i.split("/").length);for(let i of n){let o=i.split("/").filter(s=>s.length>0);if(o.length!==r.length)continue;let a=true;for(let s=0;s<o.length;s++){let u=o[s],d=r[s];if(!(u.startsWith("[")&&u.endsWith("]"))&&!u.startsWith(":")&&u!==d){a=false;break}}if(a)return "/"+o.join("/")}return null}function Ip(){if(typeof document>"u")return [];let t=new Set,e=document.querySelectorAll("[data-testid]");for(let r of Array.from(e)){let n=r.getAttribute("data-testid");n&&n.length>0&&n.length<120&&t.add(n);}return Array.from(t).sort()}function Mp(){if(typeof window>"u")return [];try{let t=new Set,e=i=>{new URLSearchParams(i).forEach((o,a)=>t.add(a));};e(window.location.search);let r=window.location.hash,n=r.indexOf("?");return r.startsWith("#/")&&n!==-1&&e(r.slice(n+1)),Array.from(t).sort()}catch{return []}}function Lp(){if(typeof document>"u")return null;let t=i=>(i??"").replace(/\s+/g," ").trim().slice(0,200),e=t(document.querySelector("h1")?.textContent);if(e)return e;let r=t(document.title);return r||t(document.querySelector("main")?.textContent)||null}async function Pp(t){if(!t||typeof crypto>"u"||!crypto.subtle)return null;try{let e=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),i="";for(let o=0;o<n.length;o++)i+=n[o].toString(16).padStart(2,"0");return i}catch{return null}}function Ci(t){let{config:e,getRecentNetworkPaths:r,getUserId:n,getSessionId:i,onEvent:o}=t,a=e.throttleMs??xp,s=e.captureDomSummary!==false,u=e.userIdSource??"auto",d=new Map,p=null,h=null;async function k(){if(typeof window>"u")return;let L=Tp(window.location.pathname,window.location.hash,e.routeTemplates),M=Date.now(),x=d.get(L)??0;if(M-x<a)return;d.set(L,M);let f=null;u==="auto"?f=n()??i():u==="session-only"&&(f=i());let g={route:L,page_title:typeof document<"u"&&(document.title||"").slice(0,300)||null,dom_summary:s?Lp():null,testids:Ip(),network_paths:r().slice(-50),query_param_keys:Mp(),user_id_hash:await Pp(f),observed_at:new Date().toISOString()};o(g);}function S(){h||(h=setTimeout(()=>{h=null,k();},100));}function T(){if(typeof window>"u")return;let L=window.location.hash.startsWith("#/")?window.location.hash:"",M=window.location.pathname+window.location.search+L;M!==p&&(p=M,S());}if(typeof window>"u")return {destroy:()=>{},flushNow:()=>{}};let E=()=>T(),w=Me({onPush:E,onReplace:E,onPop:E});return window.addEventListener("hashchange",E),S(),{destroy(){w(),window.removeEventListener("hashchange",E),h&&(clearTimeout(h),h=null),d.clear();},flushNow(){d.clear(),k();}}}var Dp=3e4,Ai=400,$p=4,Op=2;function Xa(t,e,r){let n=u=>u.timestamp,i=u=>u.type===Op,o=u=>u.type===$p,a=Date.now()-e,s=0;for(let u=0;u<t.length;u++){let d=n(t[u]);if(typeof d=="number"&&d>=a)break;i(t[u])&&(s=o(t[u-1])?u-1:u);}if(t.length-s>r){for(let u=s+1;u<t.length;u++)if(i(t[u])&&t.length-u<=r){s=o(t[u-1])?u-1:u;break}}s>0&&t.splice(0,s);}function Ja(t){let e=[],r=false,n=o=>{if(!r)return;let a=o.target instanceof Element?o.target:null,s=a?.tagName?.toLowerCase()??"unknown",u=a?.closest("[data-testid]")?.getAttribute("data-testid")??void 0;e.push({type:"lite_click",timestamp:Date.now(),data:{tag:s,testId:u}}),e.length>Ai&&e.shift();},i=()=>{r=false,document.removeEventListener("click",n,true);};return {start(){r||(r=true,document.addEventListener("click",n,true));},stop:i,flush(){let o=Date.now()-t;return e.filter(a=>a.timestamp>=o)},destroy(){i(),e.length=0;}}}var Hp=['input[type="password"]',"[data-mushi-redact]"],Bp="rrweb",Oe=null,Qa=false;function Ti(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.record=="function"?e:e.default&&typeof e.default.record=="function"?e.default:null}async function Fp(t){if(Oe)return Oe;if(typeof t=="function")try{if(Oe=Ti(await t()),Oe)return Oe}catch{}if(Oe=Ti(globalThis.rrweb),Oe)return Oe;try{let e=globalThis.__MUSHI_RRWEB_SPECIFIER__||Bp;return Oe=Ti(await import(e)),Oe}catch{return null}}async function Za(t){let e=t.maxDurationMs??Dp;if(t.mode==="lite")return Ja(e);let r=await Fp(t.loadRrweb);if(!r?.record)return Qa||(Qa=true,Tt({scope:"mushi"}).warn("capture.replay is 'rrweb' but rrweb could not be loaded, so replay is recording clicks only. Install rrweb and pass capture: { rrweb: () => import('rrweb') }.")),Ja(e);let n=r.record,i=[],o=null,a=false,s=[...new Set([...Hp,...t.redactSelectors??[]])],u=()=>{o?.(),o=null,a=false;};return {start(){a||(a=true,o=n({emit(d){i.push(d),Xa(i,e,Ai);},maskAllInputs:true,maskTextSelector:"*",blockSelector:s.join(","),checkoutEveryNms:e,sampling:{mousemove:false,mouseInteraction:true,scroll:150,media:800}})??null);},stop:u,flush(){return Xa(i,e,Ai),[...i]},destroy(){u(),i.length=0;}}}function eu(){try{let t=globalThis;return t.Sentry?t.Sentry:void 0}catch{return}}function Np(){try{return globalThis.__SENTRY_REPLAY__}catch{return}}function Up(){try{let t=globalThis,e=t.__SENTRY__,r=t.Sentry;return e?.version==="9"||r&&typeof r.lastEventId=="function"?e?.version==="9"?"v9":"v8":e?.version==="8"?"v8":r&&typeof r.getCurrentHub=="function"?"v7":"unknown"}catch{return "unknown"}}function Ii(t,e={}){let r=Math.max(0,e.breadcrumbsLimit??30),n={},i=eu();if(!i)return n;n.sdk=Up();try{let s=i;if(typeof s.lastEventId=="function")n.eventId=s.lastEventId()??void 0;else {let d=i.getCurrentHub?.()?.getScope?.();n.eventId=d?.getLastEventId?.()??void 0;}}catch{}let o;try{let s=i;typeof s.getCurrentScope=="function"?o=s.getCurrentScope():o=i.getCurrentHub?.()?.getScope?.();}catch{}if(o){try{let s=o.getUser?.();s&&(n.user={id:typeof s.id=="string"?s.id:void 0,email:typeof s.email=="string"?s.email:void 0,username:typeof s.username=="string"?s.username:void 0,ip_address:typeof s.ip_address=="string"?s.ip_address:void 0});}catch{}try{let s=o.getTags?.();if(s&&typeof s=="object"){let u={};for(let[d,p]of Object.entries(s))(typeof p=="string"||typeof p=="number"||typeof p=="boolean")&&(u[d]=p);Object.keys(u).length>0&&(n.tags=u);}}catch{}try{n.transactionName=o.getTransactionName?.()??o.getTransaction?.()?.name??void 0;}catch{}try{n.sessionId=o.getSession?.()?.sid??void 0;}catch{}try{let s=o.getBreadcrumbs?.()??o._breadcrumbs??[];if(Array.isArray(s)&&s.length>0){let u=s.slice(-r);n.breadcrumbs=u.map(d=>{let p=d;return {timestamp:typeof p.timestamp=="number"?p.timestamp<1e12?Math.round(p.timestamp*1e3):p.timestamp:void 0,category:typeof p.category=="string"?p.category:void 0,level:typeof p.level=="string"?p.level:void 0,message:typeof p.message=="string"?p.message:void 0,type:typeof p.type=="string"?p.type:void 0,data:p.data&&typeof p.data=="object"?p.data:void 0}});}}catch{}}try{let s=i,u;if(typeof s.getActiveSpan=="function"?u=s.getActiveSpan():o?.getSpan&&(u=o.getSpan()),u){let d=u.spanContext?.();n.traceId=d?.traceId??u.traceId??void 0,n.spanId=d?.spanId??u.spanId??void 0;}}catch{}let a;try{let s=i;typeof s.getClient=="function"?a=s.getClient():a=i.getCurrentHub?.()?.getClient?.();}catch{}if(a){try{let s=a.getOptions?.();s?.release&&(n.release=s.release),s?.environment&&(n.environment=s.environment);}catch{}try{let s=a.getDsn?.();if(s?.host&&s?.projectId&&n.eventId){let u=s.host.replace(/^o\d+\./,"");n.issueUrl=`https://${u}/issues/?query=${encodeURIComponent(n.eventId)}`;}}catch{}}try{let u=i.getReplay?.()??Np();n.replayId=u?.getReplayId?.()??void 0;}catch{}return n}function Mi(t,e={}){let r=eu();if(r){try{let n=r;typeof n.setTag=="function"&&(n.setTag("mushi.report_id",t),e.reportUrl&&n.setTag("mushi.report_url",e.reportUrl)),typeof n.setContext=="function"&&n.setContext("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{},captured_at:new Date().toISOString()}),typeof n.addBreadcrumb=="function"&&n.addBreadcrumb({category:"mushi",type:"info",level:"info",message:`Mushi report submitted (${t})`,data:{report_id:t,...e.reportUrl?{url:e.reportUrl}:{}}});}catch{}try{let i=r.getCurrentHub?.()?.getScope?.();i&&(i.setTag?.("mushi.report_id",t),e.reportUrl&&i.setTag?.("mushi.report_url",e.reportUrl),i.setContext?.("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{}}));}catch{}}}var qp=["/login","/logout","/signup","/sso/*","/auth/*"];function ru(t,e={}){let r=[];if(e.rageClick!==false){let E=function(w){let L=Date.now();if(w.target===T){if(S.push(L),S=S.filter(M=>L-M<500),S.length>=3){let M=w.target;t.onTrigger("rage_click",{element:M.tagName,id:M.id,text:M.textContent?.slice(0,50)}),S=[];}}else T=w.target,S=[L];};let S=[],T=null;document.addEventListener("click",E,true),r.push(()=>document.removeEventListener("click",E,true));}if(e.longTask!==false&&typeof PerformanceObserver<"u")try{let S=new PerformanceObserver(T=>{for(let E of T.getEntries())E.duration>5e3&&t.onTrigger("long_task",{duration:Math.round(E.duration),startTime:Math.round(E.startTime)});});S.observe({entryTypes:["longtask"]}),r.push(()=>S.disconnect());}catch{}let n=jp(e.apiCascade);if(n.enabled){let S=[],T=globalThis.fetch;globalThis.fetch=async function(...E){let[w,L]=E,M=tn(w),x=!!rn(w,L)||gr(M,{apiEndpoint:e.apiEndpoint,ignoreUrls:n.ignoreUrls});try{let f=await T.apply(this,E);return !x&&!f.ok&&f.status>=400&&tu(S,t),f}catch(f){throw x||tu(S,t),f}},r.push(()=>{globalThis.fetch=T;});}if((e.pageDwell===true||typeof e.pageDwell=="object"&&e.pageDwell!==null)&&typeof window<"u"){let M=function(b){return E.some(C=>C.endsWith("/*")?b.startsWith(C.slice(0,-2)):b===C||b.startsWith(C+"/"))},x=function(){let b=window.location?.pathname??"";M(b)||t.onTrigger("page_dwell",{thresholdMs:T,path:b});},f=function(){w&&clearTimeout(w);let b=window.location?.pathname??"";M(b)||(w=setTimeout(x,T));},g=function(){let b=window.location?.pathname??"";b!==L&&(L=b,f());};let S=typeof e.pageDwell=="object"?e.pageDwell??{}:{},T=S.thresholdMs||300*1e3,E=S.excludeRoutes!==void 0?S.excludeRoutes:qp,w=null,L=window.location?.pathname??"";f();let m=Me({onPush:g,onReplace:g,onPop:g});r.push(()=>{w&&clearTimeout(w),m();});}if((e.firstSession===true||typeof e.firstSession=="object"&&e.firstSession!==null)&&typeof window<"u"){let S=typeof e.firstSession=="object"?e.firstSession??{}:{},T=S.delayMs??45*1e3,E=S.storageKey??(e.projectId?`mushi:${e.projectId}:firstSessionShown`:"mushi:firstSessionShown"),w=false;try{w=window.localStorage?.getItem(E)==="1";}catch{}if(!w){let L=setTimeout(()=>{try{window.localStorage?.setItem(E,"1");}catch{}t.onTrigger("first_session",{delayMs:T});},T);r.push(()=>clearTimeout(L));}}if(e.errorBoundary){let S=function(E){or({message:E.message,filename:E.filename,ignoreErrors:e.ignoreErrors,denyUrls:e.denyUrls,allowUrls:e.allowUrls})||t.onTrigger("error_boundary",{message:E.message,filename:E.filename,lineno:E.lineno,colno:E.colno});},T=function(E){let w=E.reason instanceof Error?E.reason.message:String(E.reason);or({message:w,ignoreErrors:e.ignoreErrors,denyUrls:e.denyUrls,allowUrls:e.allowUrls})||t.onTrigger("error_boundary",{message:w,type:"unhandled_rejection"});};window.addEventListener("error",S),window.addEventListener("unhandledrejection",T),r.push(()=>{window.removeEventListener("error",S),window.removeEventListener("unhandledrejection",T);});}return {destroy(){r.forEach(S=>S());}}}function jp(t){return t===false?{enabled:false,ignoreUrls:[]}:t&&typeof t=="object"?{enabled:t.enabled!==false,ignoreUrls:t.ignoreUrls??[]}:{enabled:true,ignoreUrls:[]}}function tu(t,e){let r=Date.now();t.push(r);let n=t.filter(i=>r-i<1e4);n.length>=3&&(e.onTrigger("api_cascade",{failureCount:n.length,windowMs:1e4}),t.length=0);}var nu="mushi:lastDismiss",nn="mushi:consecDismiss",Li="mushi:lastShown";function on(t){try{return localStorage.getItem(t)}catch{return null}}function sn(t,e){try{localStorage.setItem(t,e);}catch{}}function iu(t={}){let e=t.maxProactivePerSession??2,r=t.dismissCooldownHours??24,n=t.suppressAfterDismissals??3,i=(t.reshowCooldownMinutes??30)*60*1e3,o=0,a=new Set;function s(h){let k=Date.now();if(parseInt(on(nn)??"0",10)>=n)return false;let T=on(nu);if(T&&k-parseInt(T,10)<r*60*60*1e3)return false;if(i>0&&o===0){let E=on(Li);if(E&&k-parseInt(E,10)<i)return false}return o>=e||a.has(h)?false:(a.add(h),o++,sn(Li,String(k)),true)}function u(){sn(nu,String(Date.now()));let h=parseInt(on(nn)??"0",10);sn(nn,String(h+1));}function d(){sn(nn,"0");}function p(){o=0,a.clear();try{localStorage.removeItem(Li);}catch{}}return {shouldShow:s,recordDismissal:u,recordSubmission:d,reset:p}}var Ye="@mushi-mushi/web",we="1.31.2";function lu(t,e){if(t.appVersion)return t.appVersion;let r=t.integrations?.vercel?.analyticsId;return r||e?.buildId}var He=null,an=class{constructor(){}static init(e){if(He)return Tt({scope:"mushi",level:"warn",format:"pretty"}).warn("Already initialized \u2014 call destroy() first to reinitialize"),He;if(typeof document>"u"||typeof window>"u")return du();let r={...Ln(),...e};if(!r.projectId||!r.apiKey){let n=Bo();throw new Error(n.message??"[mushi] projectId and apiKey are required \u2014 set NEXT_PUBLIC_MUSHI_* / VITE_MUSHI_* / MUSHI_* or pass them explicitly")}return r.enabled===false?du():(He=Kp(r),He)}static getInstance(){return He}static destroy(){He?.destroy(),He=null;}static diagnose(){return He?.diagnose()??Di()}};function Kp(t){No(t);let e=Fo(t),r=e.projectId,n=()=>te(r),i=e,o=t.debug??false?Tt({scope:"mushi",level:"debug",format:"pretty"}):Pn,a=null,s=null,u=Ho({projectId:e.projectId,apiKey:e.apiKey,...e.apiEndpoint?{apiEndpoint:e.apiEndpoint}:{},...typeof e.timeout=="number"?{timeout:e.timeout}:{},...typeof e.maxRetries=="number"?{maxRetries:e.maxRetries}:{},...e.circuitBreaker?{circuitBreaker:e.circuitBreaker}:{},...e.tunnel?{tunnel:e.tunnel}:{},getUserToken:()=>a,sdkPackage:Ye,sdkVersion:we}),d=null;if(e.trackSessions!==false){ts({client:u,sdkVersion:we,reporterToken:te(e.projectId)??null,projectId:e.projectId,analytics:e.analytics});try{d=Me({onPush:()=>Bn(),onPop:()=>Bn()});}catch{}}let p=Uo(e.preFilter),h=Ko(e.offline),k=fs({maxBurst:10,refillRate:1,refillIntervalMs:5e3}),S=Un();ls({client:u,projectId:e.projectId,sdkVersion:we,config:e.analytics,scrub:l=>S.scrub(l),getSessionId:bt});function T(l){return l.map(c=>{let y={...c};if(typeof c.message=="string"&&(y.message=S.scrub(c.message)),c.data&&typeof c.data=="object"){let I={};for(let[$,N]of Object.entries(c.data))I[$]=typeof N=="string"?S.scrub(N):N;y.data=I;}return y})}function E(l){return l&&l.map(c=>({...c,message:S.scrub(c.message),...c.stack?{stack:S.scrub(c.stack)}:{}}))}function w(l){if(!l)return;let c={};for(let[y,I]of Object.entries(l))c[y]=typeof I=="string"?S.scrub(I):I;return c}let L=null,M=null,x=null,f=null,g=null,m=null,b=ki(),C=null,P=0,v,K=`mushi:tester-jwt:${e.projectId}`;function Y(){try{return typeof localStorage<"u"?localStorage.getItem(K):null}catch{return null}}function j(){try{typeof localStorage<"u"&&localStorage.removeItem(K);}catch{}}async function ke(l){let c=await u.getTesterStatus(l);if(!c.ok||!c.data){j();return}let y=c.data;if(!y.is_tester||!y.tester_id){j();return}v.setTesterSession(l,{id:y.tester_id,public_handle:y.public_handle??null,display_name:y.display_name??null});let I=await u.getMyReputation(l);if(I.ok&&I.data){let $=I.data;$.reputation&&v.setTesterReputation($.reputation);}}function Be(){if(i.capture?.console!==false?L??=bi():(L?.destroy(),L=null),i.capture?.network!==false){let B={apiEndpoint:Pi(i),ignoreUrls:i.capture?.ignoreUrls,tracePropagation:i.capture?.tracePropagation,sessionId:bt()};M?M.updateOptions(B):M=gi(B);}else M?.destroy(),M=null;if(i.capture?.performance!==false?x??=xi():(x?.destroy(),x=null),i.capture?.screenshot!=="off"){let B={privacy:i.privacy,onFailed:Z=>v.setScreenshotError(true,Z)};i.capture?.screenshotProvider?f=null:f?f.updateOptions(B):f=wi(B);}else f=null;!f&&!i.capture?.screenshotProvider&&(O=null),v.setAllowScreenshotRemove(i.privacy?.allowUserRemoveScreenshot!==false),i.capture?.elementSelector!==false?g??=Ri():(g?.deactivate(),g=null,G=null),v.setCaptureAvailability({screenshot:(!!f||!!i.capture?.screenshotProvider)&&i.capture?.screenshot!=="off",element:!!g});let l=i.capture?.discoverInventory,c=l===true?{}:l&&typeof l=="object"?l:null;c!=null&&c.enabled!==false?(m?.destroy(),m=Ci({config:c,getRecentNetworkPaths:()=>M?M.getEntries().map(B=>{try{let Z=new URL(B.url,typeof window<"u"?window.location.href:"http://localhost");return Z.host&&typeof window<"u"&&Z.host!==window.location.host?null:Z.pathname}catch{return null}}).filter(B=>B!=null&&B.length>0&&B.length<200):[],getUserId:()=>R?.id??null,getSessionId:bt,onEvent:B=>{u.postDiscoveryEvent({...B,sdk_version:we}).catch(Z=>{o.debug("discovery emit failed",{err:String(Z)});});}})):(m?.destroy(),m=null);let I=i.capture?.replay??"off",$=i.replaySampleRate??1,N=$>=1||Math.random()<$,Q=i.replaysOnErrorSampleRate??0,ue=!N&&Q>0&&Math.random()<Q;if((I==="rrweb"||I==="lite")&&(N||ue)){let B=++P;Za({mode:I,loadRrweb:e.capture?.rrweb,redactSelectors:i.privacy?.redactSelectors}).then(Z=>{if(B!==P){Z.destroy();return}C?.destroy(),C=Z,C.start();});}else P++,C?.destroy(),C=null;}let me=new Map;function J(l,c){me.get(l)?.forEach(y=>y({type:l,data:c}));}let O=null,G=null,re=null,_e=false,Ce=true,Le=null,A=null,R=null,H=null,F={},U={},X=gs({max:50});X.add({category:"lifecycle",level:"info",message:"Mushi SDK init",data:{projectId:e.projectId,sdkVersion:we}});let Xe=null;Xe=rh(X);let Fe=false,it=false,he=new Set,ie=Ra(u);async function ge(){let l=await ie.getUpdates(n()),c=l.ok?l.data??null:null;if(c)for(let y of he)try{y(c);}catch{}return c}function Nt(){v.refreshReporterInboxQuiet(),he.size&&ge();}function z(){Le&&clearInterval(Le),Le=null,A&&typeof document<"u"&&document.removeEventListener("visibilitychange",A),A=null;}function Ut(){if(z(),!Ce)return;let l=5*6e4,c=()=>{typeof document<"u"&&document.visibilityState==="hidden"||ii(r)&&Nt();};Le=setInterval(c,l),typeof document<"u"&&(A=()=>{document.visibilityState==="visible"&&c();},document.addEventListener("visibilitychange",A)),c();}let ot=null;function st(){let l=i.notifications??e.notifications;v.setReporterChannels({email:!!ot?.emailEnabled&&l?.email!==false,push:!!(ot?.pushEnabled&&ot.vapidPublicKey)&&!!l?.webPush,emailPrefill:l?.emailFromIdentity?R?.email??"":""});}let St=[];function fu(){if(!ii(r))return;let l=globalThis.requestIdleCallback;if(l?l(()=>{v.preloadViews();},{timeout:8e3}):setTimeout(()=>{v.preloadViews();},3e3),e.notifications?.toast===false||!Sa(r))return;let c=async()=>{let I=await ge(),$=I&&typeof I.unread_total=="number"&&Array.isArray(I.latest)?I:null;if($&&!$.unread_total)return;await v.refreshReporterInboxQuiet(),($?v.showUpdatesFeedToast($,St):await v.showUpdatesToast(St))&&xa(r);},y=globalThis.requestIdleCallback;y?y(()=>{c();},{timeout:5e3}):setTimeout(()=>{c();},2e3);}async function mu(l){let c=te(r),y=await ie.markReportRead(l,c);if(y.ok)return y.data?.unread_total??null;let I=await u.listNotifications(c,{limit:50});if(!I.ok)return null;let $=(I.data?.notifications??[]).filter(N=>{let Q=N.payload??{};return !N.read_at&&(Q.reportId===l||N.report_id===l)});return await Promise.all($.map(N=>u.markNotificationRead(String(N.id),c))),null}function Oi(l,c){if(!i.rewards?.enabled)return;let y={client:u,config:i.rewards,projectId:r,userId:l,traits:c,reporterToken:n()};Ha(y),i.rewards.showInWidget!==false&&u.getMyPoints(l).then(I=>{if(!I.ok)return;let $=I.data;v.setRewardsState({tier:$.tier?{slug:$.tier.slug??"free",displayName:$.tier.display_name??"Free",pointsThreshold:$.tier.points_threshold??0}:null,nextTier:$.next_tier?{displayName:$.next_tier.display_name??"",pointsThreshold:$.next_tier.points_threshold??0}:null,totalPoints:$.total_points??0,pointsForReport:$.report_submit_pts??50});}).catch(()=>{});}async function Hi(){if(Fe)return null;it=false;let l=i.capture?.screenshotProvider;if(l){Fe=true;try{let $=await l();if($)return $}catch($){o.warn("screenshotProvider threw, falling back to built-in capturer",{error:$ instanceof Error?$.message:String($)}),it=$ instanceof Error&&($.name==="NotAllowedError"||$.name==="SecurityError"||/permission|denied/i.test($.message));}finally{Fe=false;}}if(!f)return null;Fe=true;let c=v.getIsOpen();c&&v.hidePanel();let y=document.getElementById("mushi-mushi-widget"),I=y?.style.visibility??"";y&&(y.style.visibility="hidden"),await new Promise($=>{requestAnimationFrame(()=>requestAnimationFrame(()=>$()));});try{return await f.take()}finally{Fe=false,y&&(y.style.visibility=I),c&&v.showPanel();}}async function Bi(l){let c=i.capture?.screenshot;!(f||i.capture?.screenshotProvider)||c==="off"||O||l==="open"&&c!=="auto"||l==="submit"&&c!=="on-report"&&c!=="auto"||(o.debug("Auto-capturing screenshot",{when:l,mode:c}),O=await Hi(),v.setScreenshotAttached(O!==null),v.setScreenshotPreview(O));}let un=nr(r).then(l=>l.slice(0,12)).catch(()=>null);v=new Yr(e.widget,{onSubmit:async({category:l,userCategory:c,description:y,intent:I})=>(o.info("Report submitted",{category:l,userCategory:c,intent:I}),qt?.recordSubmission(),await Bi("submit"),await bu(l,y,I,c)??{reportId:null,queuedOffline:true}),onOpen:()=>{o.debug("Widget opened"),Bi("open"),C?.start(),J("widget:opened");},onBrandFooterImpression:()=>{un.then(l=>{Ct("loop_impression",{placement:"widget"},l?{reserved:{$ref:l}}:void 0);});},onBrandFooterClick:()=>{un.then(l=>(Ct("loop_click",{placement:"widget"},l?{reserved:{$ref:l}}:void 0),ps()));},onClose:()=>{o.debug("Widget closed"),re&&(qt?.recordDismissal(),J("proactive:dismissed",{type:re})),O=null,G=null,re=null,J("widget:closed");},onScreenshotRequest:async()=>{if(!(!!f||!!i.capture?.screenshotProvider)||i.capture?.screenshot==="off"){o.warn("Screenshot requested but capture is disabled"),v.setScreenshotError(true,"unsupported");return}if(!Fe){o.debug("Taking screenshot"),v.setScreenshotCapturing(true);try{O=await Hi();}catch(c){o.warn("Screenshot capture threw",{error:c instanceof Error?c.message:String(c)}),O=null;}v.setScreenshotAttached(O!==null),v.setScreenshotPreview(O),O===null&&v.setScreenshotError(true,it?"permission":void 0);}},onScreenshotShareTabRequest:typeof navigator<"u"&&typeof navigator.mediaDevices?.getDisplayMedia=="function"?()=>{let l=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:false,preferCurrentTab:true,selfBrowserSurface:"include"});l.catch(()=>{}),v.setScreenshotCapturing(true);let c=document.getElementById("mushi-mushi-widget");c&&(c.style.visibility="hidden");let y=i.privacy;Promise.resolve().then(()=>(su(),ou)).then(I=>I.grabMaskedTabFrame(l,[Si,"[data-mushi-redact]",...y?.redactSelectors??[],...y?.maskSelectors??[],...y?.blockSelectors??[]]),I=>{throw l.then($=>$.getTracks().forEach(N=>N.stop()),()=>{}),I}).then(I=>{O=I,v.setScreenshotAttached(true),v.setScreenshotPreview(I);}).catch(I=>{o.warn("Tab capture failed",{error:I instanceof Error?I.name:String(I)}),v.setScreenshotError(true,I instanceof Error&&I.name==="NotAllowedError"?"permission":"error");}).finally(()=>{c&&(c.style.visibility="");});}:void 0,onScreenshotRemove:()=>{o.debug("Screenshot attachment removed"),O=null,v.setScreenshotAttached(false);},onScreenshotAnnotateRequest:async l=>{if(!O||l.childElementCount>0)return;let c;try{let{createScreenshotAnnotation:Q}=await Promise.resolve().then(()=>(uu(),au));c=await Q(O,l);}catch(Q){o.warn("Screenshot annotation failed",{error:Q instanceof Error?Q.message:String(Q)});return}let y=document.createElement("div");y.className="mushi-annotate-toolbar";let I=Q=>{(O=c.getDataUrl(),v.setScreenshotAttached(true),v.setScreenshotPreview(O)),c.destroy(),y.remove();},$=[{id:"highlight",label:"\u270F\uFE0F Highlight"},{id:"blur",label:"\u{1F512} Blur"},{id:"arrow",label:"\u2197\uFE0F Arrow"}];for(let Q of $){let ue=document.createElement("button");ue.type="button",ue.className="mushi-attach-btn",ue.dataset.tool=Q.id,ue.textContent=Q.label,ue.addEventListener("click",()=>{c.setTool(Q.id),y.querySelectorAll("button[data-tool]").forEach(B=>B.classList.remove("active")),ue.classList.add("active");}),y.appendChild(ue);}y.querySelector('button[data-tool="highlight"]')?.classList.add("active");let N=document.createElement("button");N.type="button",N.className="mushi-attach-btn",N.textContent="\u2713 Done",N.addEventListener("click",()=>I()),y.appendChild(N),l.insertBefore(y,l.firstChild);},onElementSelectorRequest:async()=>{if(!g||i.capture?.elementSelector===false){o.warn("Element selector requested but it is disabled/unavailable"),v.setElementError(true);return}o.debug("Element selector activated"),v.setElementCapturing(true),v.hidePanel();try{let l=await g.activate();l?(G=l,v.setElementSelected(!0),o.debug("Element selected",{tagName:l.tagName,xpath:l.xpath})):v.setElementCapturing(!1);}catch(l){o.warn("Element selector threw",{error:l instanceof Error?l.message:String(l)}),v.setElementError(true);}finally{v.showPanel();}},async onReporterReportsRequest(){let l=await u.listReporterReports(te(r));if(!l.ok)throw new Error(l.error?.message??"Could not load reports");return St=l.data?.reports??[],St.length&&ni(r),St},onReporterMarkRead:l=>mu(l),async onReporterReportRequest(l){let c=await ie.getReport(l,te(r));return c.ok&&c.data?{report:c.data.report,timeline:c.data.timeline}:null},async onReporterEmailOptIn(l){let c=await ie.setPrefs(te(r),{email:l,channels:{email:true}});if(!c.ok)throw new Error(c.error?.code??"EMAIL_OPT_IN_FAILED")},async onReporterPushSubscribe(){let l=await cn.subscribeReporterPush();if(!l.ok)throw new Error(l.reason)},async onReporterCommentsRequest(l){let c=await u.listReporterComments(l,te(r));if(!c.ok)throw new Error(c.error?.message??"Could not load thread");return c.data?.comments??[]},async onReporterReply(l,c){let y=await u.replyToReporterReport(l,te(r),c);if(!y.ok)throw new Error(y.error?.message??"Could not send reply")},async onReporterFeedback(l,c,y){let I=await u.replyToReporterReport(l,te(r),y??"",c);if(!I.ok)throw new Error(I.error?.message??"Could not send feedback");return I.data?.feedback??null},async onReporterReopen(l,c){let y=await u.reopenReporterReport(l,te(r),c);if(!y.ok)throw new Error(y.error?.message??"Could not reopen report");return y.data?.outcome??null},async onFeatureBoardRequest(){let l=await u.listReporterFeatureBoard(te(r));if(!l.ok)throw new Error(l.error?.message??"Could not load community ideas");return l.data?.tickets??[]},async onFeatureBoardVote(l){let c=await u.voteReporterFeatureBoard(l,te(r));if(!c.ok)throw new Error(c.error?.message??"Could not vote");return c.data??{voted:true,action:"added"}},onLeaderboardOpen(){v.setLeaderboard(null,true),Fa(10).then(l=>{v.setLeaderboard(l,false);});},async onMushiSignIn(l){let c=await u.sendMagicLink(l);if(!c.ok)throw new Error(c.error?.message??"Could not send sign-in link");return {ok:true}},async onGlobalLeaderboardOpen(){v.setGlobalLeaderboard(null,true);try{let l=Y(),c=await u.getPublicLeaderboard(50),I=(c.ok?c.data?.leaderboard??[]:[]).map($=>({tester_id:$.tester_id,rank:$.rank,public_handle:$.public_handle,display_name:$.display_name,points_30d:$.points_30d,total_points:$.total_points??0,badge:$.badge_slug}));if(v.setGlobalLeaderboard(I,!1),l){let $=await u.getMyReputation(l);if($.ok&&$.data){let N=$.data;N.reputation&&v.setTesterReputation(N.reputation);}}}catch{v.setGlobalLeaderboard([],false);}},async onCrossAppReportsOpen(){let l=Y();if(!l){v.setCrossAppReports([],false);return}try{let c=await u.getCrossAppReports(l),y=c.ok?c.data?.reports??[]:[];v.setCrossAppReports(y,!1);}catch{v.setCrossAppReports([],false);}},onTesterSignOut(){j();},assistantEnabled:e.assistant?.enabled===true,...e.assistant?.label?{assistantLabel:e.assistant.label}:{},...e.assistant?.greeting?{assistantGreeting:e.assistant.greeting}:{},...e.assistant?.suggestions?{assistantSuggestions:e.assistant.suggestions}:{},async onAssistantAsk(l,c){let y=await u.askAssistant({message:l,threadId:c,context:s});return y.ok?y.data??null:null}}),un.then(l=>v.setBrandRef(l)),Be(),typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>v.mount()):v.mount());let Fi=Y();Fi&&ke(Fi).catch(()=>j());let Ni=null,qt=null,ee=i.proactive;ee&&(ee.rageClick!==false||ee.longTask!==false||ee.apiCascade!==false||ee.errorBoundary===true||ee.pageDwell||ee.firstSession)&&typeof document<"u"&&(qt=iu(ee?.cooldown),Ni=ru({onTrigger:(l,c)=>{if(typeof navigator<"u"&&!navigator.onLine){o.debug("Proactive trigger suppressed: offline",{type:l});return}if(!qt.shouldShow(l)){o.debug("Proactive trigger suppressed by fatigue prevention",{type:l});return}o.info("Proactive trigger fired",{type:l,context:c}),re=l,J("proactive:triggered",{type:l,context:c}),l==="first_session"?v.pulseTrigger?.():v.open();}},{rageClick:ee?.rageClick,longTask:ee?.longTask,apiCascade:ee?.apiCascade,apiEndpoint:Pi(i),errorBoundary:ee?.errorBoundary,ignoreErrors:i.ignoreErrors,denyUrls:i.denyUrls,allowUrls:i.allowUrls,pageDwell:ee?.pageDwell,firstSession:ee?.firstSession,projectId:e.projectId}),o.debug("Proactive triggers enabled",{rageClick:ee?.rageClick!==false,longTask:ee?.longTask!==false,apiCascade:ee?.apiCascade!==false,errorBoundary:ee?.errorBoundary===true,pageDwell:!!ee?.pageDwell,firstSession:!!ee?.firstSession})),h.startAutoSync(u),h.flush(u).then(l=>{l.sent>0&&o.info("Synced offline reports",{sent:l.sent});});function ln(l){if(_e=true,Ce=l.reporterNotificationsEnabled!==false,ot=l.enabled===false?null:l.reporter??null,st(),l.enabled===false){i=e,Qp(t.projectId),Be(),v.updateConfig(i.widget),z(),o.debug("Runtime SDK config disabled; using bootstrap config",{version:l.version});return}i=_a(i,l,e),Be(),l.widget&&v.updateConfig(i.widget),Ce?Ut():z(),o.debug("Applied runtime SDK config",{version:l.version});}if(zp(t)){let l=Xp(t.projectId);l&&ln(l),u.getSdkConfig().then(c=>{c.ok&&c.data?(Jp(t.projectId,c.data),ln(c.data)):c.error&&o.debug("Runtime SDK config unavailable",c.error);}).catch(c=>{o.debug("Runtime SDK config fetch failed",{error:c instanceof Error?c.message:String(c)});});}else o.debug("Runtime SDK config disabled via runtimeConfig:false; using static bootstrap config");gu(),Ut(),fu(),o.info("Initialized",{projectId:t.projectId});async function gu(){if(i.widget?.outdatedBanner==="off")return;let l=Zp(Ye);l&&Ui(l);let c=await u.getLatestSdkVersion(Ye);!c.ok||!c.data||(eh(Ye,c.data),Ui(c.data));}function Ui(l){let c=l.latest,y=!!(c&&th(we,c));if(!y&&!l.deprecated)return;let I=l.deprecationMessage??(y?`Update ${Ye} to ${c}.`:null);o.warn("Mushi SDK is outdated",{package:Ye,current:we,latest:c,deprecated:l.deprecated,message:I}),Ws(i.widget?.outdatedBanner,!!i.debug,typeof location>"u"?void 0:location)&&v.setSdkFreshness({latest:c,current:we,deprecated:l.deprecated,message:I});}async function bu(l,c,y,I){let $=p.check(c);if(!$.passed){o.info("Report blocked by pre-filter",{reason:$.reason});return}let N=t.preFilter?.wasmClassifier;if(N)try{let q=await N.classify({description:c,category:l,url:typeof location<"u"?location.href:void 0,hasScreenshot:O!==null,hasSelectedElement:G!==null,hasNetworkErrors:M?.getEntries()?.some(be=>be.status>=400||!!be.error)??!1,hasConsoleErrors:L?.getEntries()?.some(be=>be.level==="error")??!1,proactiveTrigger:re??void 0});if(q.verdict==="block"){o.info("Report blocked by on-device classifier",{modelId:q.modelId,confidence:q.confidence,reason:q.reason});return}o.debug("On-device classifier verdict",{...q});}catch(q){o.warn("On-device classifier threw \u2014 falling through to server",{error:q instanceof Error?q.message:String(q)});}if(re!==null&&t.sampleRate!==void 0&&t.sampleRate<1&&(t.sampleRate<=0||Math.random()>t.sampleRate)){o.debug("Report dropped by sampleRate",{sampleRate:t.sampleRate,trigger:re});return}if(!k.tryConsume()){o.warn("Report throttled \u2014 rate limit exceeded");return}let ue=S.scrub(p.truncate(c)),B=t.sentry?Ii(t.sentry):void 0,Z=await zo().catch(()=>null),Ne=i.capture?.console===false?void 0:E(L?.getEntries()),Ue=i.capture?.network===false?void 0:M?.getEntries(),br=T(X.getAll()),Wi=w(Object.keys(U).length>0?{...U}:void 0),Vi=B?{...B,...B.breadcrumbs?{breadcrumbs:T(B.breadcrumbs)}:{},...B.tags?{tags:w(B.tags)}:{}}:void 0,Ki=O?await Ds(O).catch(()=>null):null,Er=false;O&&!Ki&&(Er=true,o.warn("Screenshot dropped \u2014 could not compress under wire budget"));let zi=Dn(),Te={id:$n(),projectId:t.projectId,category:l,...I?{userCategory:I}:{},description:ue,userIntent:y,environment:zi,consoleLogs:Ne,networkLogs:Ue,performanceMetrics:i.capture?.performance===false?void 0:x?.getMetrics(),timeline:b.getEntries({consoleLogs:Ne,networkLogs:Ue}),screenshotDataUrl:Ki??void 0,selectedElement:G??void 0,...C?{replayEvents:C.flush()}:{},metadata:{...F,...R?{user:R}:{},...B?.release?{sentryRelease:B.release}:{}},sessionId:bt(),reporterToken:te(r),...Z?{fingerprintHash:Z}:{},appVersion:lu(i,zi),sdkPackage:Ye,sdkVersion:we,proactiveTrigger:re??void 0,...br.length>0?{breadcrumbs:br}:{},...Wi?{tags:Wi}:{},...Vi?{sentryContext:Vi}:{},sentryEventId:B?.eventId,sentryReplayId:B?.replayId,createdAt:new Date().toISOString()};if(X.add({category:"lifecycle",level:"info",message:`Mushi report submitting (${l})`,data:{reportId:Te.id,category:l}}),t.integrations?.custom){let q={addMetadata(be,dn){Te.metadata[be]=dn;},setCategory(be){Te.category=be;},setDescription(be){Te.description=be;}};t.integrations.custom(q);}let W=Te,Gi=t.beforeSend??t.beforeSendFeedback;if(Gi)try{let q=await Promise.race([Promise.resolve(Gi(Te)),new Promise(be=>setTimeout(()=>be(Te),2e3))]);if(q===null){o.info("Report dropped by beforeSend hook",{reportId:Te.id});return}W=q;}catch(q){o.warn("beforeSend hook threw \u2014 sending unmodified report",{error:q instanceof Error?q.message:String(q)});}if(J("report:submitted",{reportId:W.id}),typeof navigator<"u"&&!navigator.onLine)return await h.enqueue(W),o.info("Offline \u2014 report queued",{reportId:W.id}),J("report:queued",{reportId:W.id}),{reportId:null,queuedOffline:true,failureKind:"offline"};let V=await u.submitReport(W);if(!V.ok&&V.error?.code==="PAYLOAD_TOO_LARGE"&&(Array.isArray(W.replayEvents)&&W.replayEvents.length>0&&(o.warn("Report too large \u2014 dropping replay buffer and retrying",{reportId:W.id}),W={...W,replayEvents:void 0},V=await u.submitReport(W)),!V.ok&&V.error?.code==="PAYLOAD_TOO_LARGE"&&W.screenshotDataUrl&&(o.warn("Report still too large \u2014 dropping screenshot and retrying",{reportId:W.id}),Er=true,W={...W,screenshotDataUrl:void 0},V=await u.submitReport(W))),V.ok){if(o.info("Report sent",{reportId:V.data?.reportId}),J("report:sent",{reportId:V.data?.reportId}),ni(r),Nt(),V.data?.cursorAgentId){let q=V.data;J("report:dispatched",{reportId:q.reportId,agentId:q.cursorAgentId,fixId:q.fixId});}X.add({category:"lifecycle",level:"info",message:`Mushi report sent (${V.data?.reportId??Te.id})`}),Ft({action:"report_submit",metadata:{category:l,reportId:V.data?.reportId??Te.id}});try{t.sentry&&V.data?.reportId&&Mi(V.data.reportId);}catch{}}else {if(V.error?.code==="PAYLOAD_TOO_LARGE"||V.error?.code==="SERIALIZE_FAILED")return o.warn("Report exceeds size limit after degradation \u2014 dropping",{reportId:W.id,error:V.error}),J("report:failed",{reportId:W.id,error:V.error}),X.add({category:"lifecycle",level:"error",message:`Mushi report dropped \u2014 payload too large (${W.id})`}),O=null,G=null,re=null,{reportId:null,queuedOffline:false,failureKind:"permanent",screenshotDropped:Er};{let q=V.error?.code??"",be=q==="HTTP_429"||q.includes("RATE_LIMIT"),dn=q==="HTTP_401"||q.includes("UNAUTHORIZED")||q.includes("INVALID_API_KEY")||q.includes("MISSING_API_KEY"),Eu=q==="HTTP_403"||q.includes("QUOTA")||q.includes("FORBIDDEN")||q==="feature_not_in_plan";if(dn||Eu)return o.warn("Report rejected \u2014 credentials/quota",{reportId:W.id,error:V.error}),J("report:failed",{reportId:W.id,error:V.error}),O=null,G=null,re=null,{reportId:null,queuedOffline:false,failureKind:"quota"};if(be)return o.warn("Report rate-limited \u2014 queued for retry",{reportId:W.id,error:V.error}),await h.enqueue(W),J("report:failed",{reportId:W.id,error:V.error}),O=null,G=null,re=null,{reportId:null,queuedOffline:true,failureKind:"rate_limited"};o.warn("Report failed, queuing for retry",{reportId:W.id,error:V.error}),await h.enqueue(W),J("report:failed",{reportId:W.id,error:V.error}),X.add({category:"lifecycle",level:"warning",message:`Mushi report queued for retry (${W.id})`});}}return O=null,G=null,re=null,V?.ok?{reportId:V.data?.reportId??Te.id,queuedOffline:false,screenshotDropped:Er}:{reportId:null,queuedOffline:true,failureKind:"retrying"}}let cn={report(l){v.open(l);},on(l,c){return me.has(l)||me.set(l,new Set),me.get(l).add(c),()=>me.get(l)?.delete(c)},setUser(l){R=l;},setMetadata(l,c){F[l]=c;},setScreen(l){b.setScreen(l);},isOpen(){return v.getIsOpen()},open(){v.open();},openWith(l){v.open({category:l});},show(){v.showTrigger();},hide(){v.hideTrigger();},attachTo(l,c){return v.attachTo(l,c)},setTrigger(l){v.setTrigger(l);},openReporter(){v.openReporter();},close(){v.close();},updateConfig(l){ln(l);},diagnose(){return Gp({apiEndpoint:Pi(i),widgetMounted:v.getIsMounted(),runtimeConfigLoaded:_e,captureScreenshotAvailable:f!==null,captureNetworkIntercepting:M!==null,widgetDiagnostics:v.getWidgetDiagnostics()})},destroy(){Ni?.destroy(),qt?.reset(),hs(),v.destroy(),L?.destroy(),M?.destroy(),x?.destroy(),g?.deactivate(),Na(),Xe?.(),Xe=null,m?.destroy(),m=null,b.destroy(),Aa(),C?.destroy(),C=null,h.stopAutoSync(),z(),d?.(),d=null,ns(),X.clear(),me.clear(),He=null,o.debug("Destroyed");},async captureEvent(l){if(!k.tryConsume())return o.warn("captureEvent throttled \u2014 rate limit exceeded"),null;let c=S.scrub(p.truncate(l.description)),y=l.category??"bug",I=t.sentry?Ii(t.sentry):void 0,$=T(X.getAll()),N=w(Object.keys(U).length===0&&!l.tags?void 0:{...U,...l.tags??{}}),Q=I?{...I,...I.breadcrumbs?{breadcrumbs:T(I.breadcrumbs)}:{},...I.tags?{tags:w(I.tags)}:{}}:void 0,ue=Dn(),B={id:$n(),projectId:t.projectId,category:y,description:c,environment:ue,timeline:b.getEntries(),metadata:{...l.metadata??{},...R?{user:R}:{},...l.error?{error:l.error}:{},...l.severity?{severity:l.severity}:{},...l.component?{component:l.component}:{},...l.source?{source:l.source}:{source:"captureEvent"}},...$.length>0?{breadcrumbs:$}:{},...N&&Object.keys(N).length>0?{tags:N}:{},...Q?{sentryContext:Q}:{},sessionId:bt(),reporterToken:te(r),appVersion:lu(i,ue),sdkPackage:Ye,sdkVersion:we,sentryEventId:I?.eventId,sentryReplayId:I?.replayId,createdAt:new Date().toISOString()},Z=B;if(i.beforeSendFeedback)try{let Ue=await Promise.race([Promise.resolve(i.beforeSendFeedback(B)),new Promise(br=>setTimeout(()=>br(B),2e3))]);if(Ue===null)return o.info("captureEvent dropped by beforeSendFeedback hook",{reportId:B.id}),null;Z=Ue;}catch(Ue){o.warn("captureEvent beforeSendFeedback threw \u2014 sending unmodified report",{error:Ue instanceof Error?Ue.message:String(Ue)});}if(J("report:submitted",{reportId:Z.id}),typeof navigator<"u"&&!navigator.onLine)return await h.enqueue(Z),J("report:queued",{reportId:Z.id}),null;let Ne=await u.submitReport(Z);if(Ne.ok){J("report:sent",{reportId:Ne.data?.reportId});try{t.sentry&&Ne.data?.reportId&&Mi(Ne.data.reportId);}catch{}return Ne.data?.reportId??null}return await h.enqueue(Z),J("report:failed",{reportId:Z.id,error:Ne.error}),null},async captureException(l,c){let y=bs(l),I=typeof c?.metadata?.filename=="string"?c.metadata.filename:void 0;if(or({message:y.message,filename:I,ignoreErrors:i.ignoreErrors,denyUrls:i.denyUrls,allowUrls:i.allowUrls}))return null;X.add({category:"lifecycle",level:"error",message:`Mushi.captureException(${y.name}): ${y.message}`,...y.stack?{data:{stack:y.stack.slice(0,500)}}:{}});let $=c?.description?.trim()||`${y.name}: ${y.message}`||"Uncaught exception";return cn.captureEvent({description:$,category:c?.category??"bug",severity:c?.severity??"high",...c?.component?{component:c.component}:{},...c?.tags?{tags:c.tags}:{},source:c?.source??"captureException",error:{name:y.name,message:y.message,...y.stack?{stack:y.stack}:{}},metadata:{...c?.metadata??{},...y.cause?{cause:y.cause}:{}}})},identify(l,c){let y=`${l}::${c?JSON.stringify(c):""}`;if(y!==H){if(H=y,R={id:l,...c?.email?{email:c.email}:{},...c?.name?{name:c.name}:{}},v.setIdentifiedUser(R.name||R.email?{name:R.name,email:R.email}:null),st(),c)for(let[I,$]of Object.entries(c))I!=="email"&&I!=="name"&&(F[`user.${I}`]=$);X.add({category:"lifecycle",level:"info",message:`Mushi.identify(${l})`}),ds(l,c??null),Oi(l,c?{email:c.email,name:c.name,provider:c.provider}:void 0);}},identifyWithToken(l){if(a=l&&typeof l=="string"?l:null,a){let c=ks(a);if(c?.sub){if(R?.id===c.sub){X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken() refreshed"});return}rs(c.sub),R={id:c.sub,...c.email?{email:c.email}:{},...c.name?{name:c.name}:{}},v.setIdentifiedUser(R.name||R.email?{name:R.name,email:R.email}:null),Oi(R.id,{email:R.email,name:R.name});}X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken()"});}else R=null,H=null,v.setIdentifiedUser(null),X.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken(null)"});},publishPageContext(l){s=l&&l.route?l:null;},openAssistant(){v.openAssistantTab();},addBreadcrumb(l){X.add(l);},getBreadcrumbs(){return X.getAll()},setTag(l,c){typeof l!="string"||l.length===0||(U[l]=c);},setTags(l){if(!(!l||typeof l!="object"))for(let[c,y]of Object.entries(l))typeof c=="string"&&c.length>0&&(U[c]=y);},clearTag(l){if(typeof l=="string"&&l.length>0){delete U[l];return}for(let c of Object.keys(U))delete U[c];},async getReputation(){if(!R?.id)return null;let l=await u.getMyPoints(R.id);return l.ok?{totalPoints:l.data.total_points??0,points30d:l.data.points_30d??0,reputation:1,confirmedBugs:0,totalReports:0}:null},async getTier(){return R?.id?Ba(R.id):null},recordActivity(l,c){i.rewards?.enabled&&Ft({action:l,metadata:c});},track(l,c){return Ct(l,c)},setConsent(l){cs(l);},getAnonymousId(){return us()},pulseTrigger(){v.pulseTrigger?.();},async listMyReports(){let l=await u.listReporterReports(te(r));return l.ok?l.data?.reports??[]:[]},async listMyComments(l){let c=await u.listReporterComments(l,te(r));return c.ok?c.data?.comments??[]:[]},async replyToReport(l,c){let y=await u.replyToReporterReport(l,te(r),c);return y.ok?y.data?.comment??null:null},async submitFeedbackSignal(l,c,y){let I=await u.replyToReporterReport(l,te(r),y??"",c);return I.ok?I.data?.feedback??null:null},async reopenReport(l,c){let y=await u.reopenReporterReport(l,te(r),c);return y.ok?y.data?.outcome??null:null},openMyReports(){v.recorderOpenMyReports();},getReporterUpdates:ge,async markReportRead(l){let c=await ie.markReportRead(l,n());return c.ok?c.data?.unread_total??0:null},onReporterUpdate(l){return he.add(l),ge(),()=>{he.delete(l);}},async getNotificationPrefs(){let l=await ie.getPrefs(n());return l.ok?l.data??null:null},setNotificationPrefs:l=>ie.setPrefs(n(),l),async subscribeReporterPush(){let l=i.notifications?.webPush,c=ot?.vapidPublicKey??null;if(l&&!c){let y=await u.getSdkConfig();c=y.ok?y.data?.reporter?.vapidPublicKey??null:null;}return ka(ie,n(),l?l.serviceWorkerPath:null,c)},async getHallOfFame(l=20){let c=await u.getHallOfFame(l);return c.ok?c.data?.data??[]:[]}};if(typeof globalThis<"u"&&(e.debug??false)&&Ca(v),typeof window<"u"&&typeof localStorage<"u"){let l="mushi:last-run",c=null;try{let y=localStorage.getItem(l);c=y===null?null:y==="unfinished",localStorage.setItem(l,"unfinished");}catch{c=null;}try{window.addEventListener("pagehide",()=>{try{localStorage.setItem(l,"clean");}catch{}$o(),Oo();});}catch{}if(typeof e.onCrashedLastRun=="function")try{e.onCrashedLastRun(c);}catch(y){o.warn("onCrashedLastRun hook threw",{error:y instanceof Error?y.message:String(y)});}}let qi={on:()=>{},onReporterUpdate:()=>{},isOpen:false,getBreadcrumbs:[],captureEvent:null,captureException:null,getReputation:null,getTier:null,listMyReports:[],listMyComments:[],getHallOfFame:[],replyToReport:null,submitFeedbackSignal:null,reopenReport:null},ji=(l,c)=>{let y=c instanceof Error?c.message:String(c);o.debug(`Mushi.${l}() failed (swallowed)`,{error:y});try{X.add({category:"custom",level:"warning",message:`mushi.${l}() threw`,data:{error:y}});}catch{}};return (l=>new Proxy(l,{get(c,y,I){let $=Reflect.get(c,y,I);if(typeof $!="function")return $;let N=String(y),Q=()=>N==="diagnose"?Di():N in qi?qi[N]:void 0;return (...ue)=>{try{let B=$.apply(c,ue);return B&&typeof B.then=="function"?B.catch(Z=>(ji(N,Z),Q())):B}catch(B){return ji(N,B),Q()}}}}))(cn)}function Pi(t){return t.apiEndpoint??Yt}function zp(t){return t.runtimeConfig!==false}async function Gp(t){let e=await Yp(t.apiEndpoint);return {apiEndpointReachable:e.reachable,cspAllowsEndpoint:e.cspAllowed,widgetMounted:t.widgetMounted,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:t.runtimeConfigLoaded,captureScreenshotAvailable:t.captureScreenshotAvailable,captureNetworkIntercepting:t.captureNetworkIntercepting,sdkVersion:we,widgetHostPointerSafe:t.widgetDiagnostics?.widgetHostPointerSafe??false,widgetHostBounds:t.widgetDiagnostics?.widgetHostBounds??null,widgetSuppressed:t.widgetDiagnostics?.widgetSuppressed??false,bannerRendered:t.widgetDiagnostics?.bannerRendered??false}}async function Di(){return {apiEndpointReachable:false,cspAllowsEndpoint:false,widgetMounted:false,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:false,captureScreenshotAvailable:false,captureNetworkIntercepting:false,sdkVersion:we,widgetHostPointerSafe:false,widgetHostBounds:null,widgetSuppressed:false,bannerRendered:false}}async function Yp(t){if(typeof fetch>"u")return {reachable:false,cspAllowed:false};let e=typeof AbortController<"u"?new AbortController:null,r=e?setTimeout(()=>e.abort(),3e3):null;try{return {reachable:(await fetch(`${t.replace(/\/$/,"")}/health`,{method:"GET",cache:"no-store",...e?{signal:e.signal}:{},[ir]:"diagnose"})).ok,cspAllowed:!0}}catch{return {reachable:false,cspAllowed:false}}finally{r&&clearTimeout(r);}}function $i(t){return `mushi:sdk-config:${t}`}function hu(t){return `mushi:sdk-version:${t}`}function Xp(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem($i(t));return e?JSON.parse(e).config??null:null}catch{return null}}function Jp(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem($i(t),JSON.stringify({cachedAt:Date.now(),config:e}));}catch{}}function Qp(t){if(!(typeof localStorage>"u"))try{localStorage.removeItem($i(t));}catch{}}function Zp(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(hu(t));if(!e)return null;let r=JSON.parse(e);return !r.data||!r.cachedAt||Date.now()-r.cachedAt>864e5?null:r.data}catch{return null}}function eh(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem(hu(t),JSON.stringify({cachedAt:Date.now(),data:e}));}catch{}}function th(t,e){let r=cu(t),n=cu(e);for(let i=0;i<Math.max(r.length,n.length);i++){let o=r[i]??0,a=n[i]??0;if(o<a)return true;if(o>a)return false}return false}function cu(t){return t.split(/[.-]/).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e))}function du(){return {report:()=>{},on:()=>()=>{},setUser:()=>{},setMetadata:()=>{},setScreen:()=>{},isOpen:()=>false,open:()=>{},close:()=>{},updateConfig:()=>{},diagnose:Di,openWith:()=>{},show:()=>{},hide:()=>{},attachTo:()=>()=>{},setTrigger:()=>{},openReporter:()=>{},destroy:()=>{He=null;},captureEvent:async()=>null,captureException:async()=>null,identify:()=>{},identifyWithToken:()=>{},publishPageContext:()=>{},openAssistant:()=>{},addBreadcrumb:()=>{},getBreadcrumbs:()=>[],setTag:()=>{},setTags:()=>{},clearTag:()=>{},getReputation:async()=>null,getTier:async()=>null,recordActivity:()=>{},track:()=>false,setConsent:()=>{},getAnonymousId:()=>null,pulseTrigger:()=>{},listMyReports:async()=>[],listMyComments:async()=>[],replyToReport:async()=>null,submitFeedbackSignal:async()=>null,reopenReport:async()=>null,openMyReports:()=>{},getHallOfFame:async()=>[],getReporterUpdates:async()=>null,markReportRead:async()=>null,onReporterUpdate:()=>()=>{},getNotificationPrefs:async()=>null,setNotificationPrefs:async()=>({ok:false}),subscribeReporterPush:async()=>({ok:false,reason:"off"})}}function rh(t){if(typeof window>"u")return ()=>{};let e=[];try{let r=i=>{t.add({category:"navigation",level:"info",message:`${i}: ${window.location.pathname}`,data:{url:window.location.href,kind:i}});},n=Me({onPush:()=>r("pushState"),onReplace:()=>r("replaceState"),onPop:()=>r("popstate")});e.push(n);}catch{}try{let r=console.error,n=console.warn,i=function(...a){try{t.add({category:"console",level:"error",message:a.map(pu).join(" ")});}catch{}return r.apply(this,a)},o=function(...a){try{t.add({category:"console",level:"warning",message:a.map(pu).join(" ")});}catch{}return n.apply(this,a)};console.error=i,console.warn=o,e.push(()=>{console.error===i&&(console.error=r),console.warn===o&&(console.warn=n);});}catch{}try{let r=n=>{try{let i=n.target;if(!(i instanceof Element))return;let o=i,a=0;for(;o&&a<10;){let s=o.getAttribute("data-testid");if(s){let u=(o.textContent??"").trim().slice(0,80);t.add({category:"ui.click",level:"info",message:`clicked ${s}${u?` \u2014 ${u}`:""}`,data:{testid:s,tag:o.tagName.toLowerCase()}});return}o=o.parentElement,a++;}}catch{}};document.addEventListener("click",r,{passive:!0,capture:!0}),e.push(()=>document.removeEventListener("click",r,!0));}catch{}return ()=>{for(let r of e)try{r();}catch{}}}function pu(t){try{if(t instanceof Error)return `${t.name}: ${t.message}`;if(typeof t=="object"&&t!==null){let r=JSON.stringify(t);return r.length>200?`${r.slice(0,200)}\u2026`:r}let e=String(t);return e.length>200?`${e.slice(0,200)}\u2026`:e}catch{return `[${typeof t}]`}}function nh(){let t=document.currentScript;if(t&&t.dataset&&t.dataset.project)return t;let e=Array.from(document.querySelectorAll("script[data-project][data-key]"));return e.length>0?e[e.length-1]:null}function ih(t){let e=t.project?.trim(),r=t.key?.trim();if(!e||!r)return null;let n={};t.trigger&&(n.trigger=t.trigger),t.theme&&(n.theme=t.theme),t.position&&(n.position=t.position),t.triggerText&&(n.triggerText=t.triggerText);let i=t.bannerVariant,o=t.bannerPosition;(i||o)&&(n.bannerConfig={...i?{variant:i}:{},...o?{position:o}:{}});let a={projectId:e,apiKey:r};return t.endpoint&&(a.apiEndpoint=t.endpoint),t.debug==="true"&&(a.debug=true),Object.keys(n).length>0&&(a.widget=n),a}function oh(){if(typeof document>"u"||typeof window>"u")return;let t=window;if(t.__mushiLoaderInit)return;let e=nh();if(!e)return;let r=ih(e.dataset);if(r){t.__mushiLoaderInit=true;try{an.init(r);}catch{}}}oh();
|
|
96
96
|
})();
|