65 lines
728 KiB
JavaScript
65 lines
728 KiB
JavaScript
import{u as i,v as e,w as gc,x as fc,y as Qh,z as Hs,D as Ho,H as or,I as lr,J as am,K as dt,L as Jh,N as Zh,O as eg,Q as tg,U as sg,V as ng,W as rg,X as pc,Y as ag,Z as ig,_ as og,$ as im,a0 as om,a1 as Ss,a2 as ws,a3 as lg,a4 as Wo,a5 as xc,a6 as jc,a7 as lm,a8 as cg,a9 as cm,aa as ug,ab as dg,ac as mg,ad as um,ae as ua,af as dm,ag as hg,ah as gg,ai as qo,aj as mm,ak as fg,al as pg,am as xg,an as jg,ao as Ig,ap as Ic,aq as bc,ar as bg,as as Ci,at as Eg,au as Cg,av as vg,aw as Ng,ax as _g,ay as tu,az as Sg,aA as wg,aB as Tg,aC as yg,aD as Rg,aE as cl,aF as ul,aG as dl,aH as Og}from"./vendor-CZE3qWoT.js";import{N as Yr,a as Ec,H as oi,M as ve,T as Ut,R as te,b as Ke,A as oa,c as Wt,G as kg,d as Q,D as Ag,C as Ht,e as Dg,f as Ve,g as Pg,h as to,i as vn,j as Us,k as Cc,l as so,E as Lg,m as su,n as Ms,F as Ji,o as Wa,p as gt,q as qa,S as li,r as Ca,s as Mg,t as hm,u as za,v as Ug,w as Fg,x as Vg,y as no,z as Rs,B as Mn,O as gm,V as At,I as ml,P as da,J as Gt,K as Qs,L as fm,U as Gg,Q as hl,W as pm,X as qn,Y as Bg,Z as Hg,_ as Wg,$ as qg,a0 as zg,a1 as Yg,a2 as $g,a3 as Kg,a4 as Xg,a5 as Qg,a6 as Jg,a7 as Zg,a8 as xm,a9 as ef,aa as tf,ab as sf,ac as nf,ad as rf,ae as af,af as of,ag as lf,ah as cf,ai as uf,aj as df,ak as mf,al as hf,am as gf,an as zl,ao as ff,ap as jm,aq as pf,ar as xf,as as jf,at as If,au as bf,av as Ef,aw as Cf,ax as vf,ay as Nf,az as _f,aA as Sf,aB as wf,aC as Tf,aD as Im,aE as yf,aF as Rf,aG as Of,aH as nu,aI as kf,aJ as Af,aK as Df,aL as zo,aM as Pf,aN as Lf,aO as bm,aP as Mf,aQ as Uf,aR as ro,aS as Lt,aT as fa,aU as Em,aV as Cm,aW as Ff,aX as Vf,aY as Gf,aZ as Bf,a_ as Hf,a$ as Wf,b0 as qf,b1 as zf,b2 as Yf,b3 as Na,b4 as vc,b5 as ru,b6 as $f,b7 as vm,b8 as Kf,b9 as Xf,ba as Qf,bb as Jf,bc as Zf,bd as ep,be as tp,bf as sp,bg as np,bh as rp,bi as ap,bj as ip,bk as op,bl as lp,bm as cp,bn as up,bo as dp,bp as mp,bq as hp,br as gp,bs as fp,bt as pp,bu as xp,bv as jp,bw as Ip,bx as bp,by as Ep,bz as Cp,bA as vp,bB as Nm,bC as Yl,bD as Np,bE as _m,bF as _p,bG as Sp,bH as wp,bI as Tp,bJ as yp,bK as Rp,bL as Op,bM as kp,bN as Ap,bO as Dp,bP as Pp,bQ as Lp,bR as Mp,bS as Up,bT as Fp,bU as Vp,bV as Gp,bW as Bp,bX as Hp,bY as Wp,bZ as qp,b_ as zp,b$ as Yp,c0 as $p,c1 as Kp,c2 as Xp,c3 as Qp,c4 as Jp,c5 as Zp,c6 as ex,c7 as tx,c8 as sx,c9 as nx,ca as rx,cb as Sm,cc as wm,cd as ao,ce as ax,cf as ix,cg as Ya,ch as Tm,ci as nt,cj as ox,ck as lx,cl as cx,cm as ux,cn as dx,co as mx,cp as hx,cq as gx,cr as fx,cs as px,ct as xx,cu as gl,cv as jx,cw as Ix,cx as bx,cy as Ex,cz as Cx,cA as vx,cB as Nx,cC as au,cD as _x,cE as Sx,cF as Cr,cG as wx,cH as Tx,cI as ys,cJ as Ct,cK as Bs,cL as yx,cM as Rx,cN as Ox,cO as vi,cP as ye,cQ as kx,cR as Vt,cS as Ax,cT as Dx,cU as Px,cV as Lx,cW as Mx,cX as Ux,cY as Fx,cZ as Vx,c_ as Gx,c$ as Bx,d0 as Hx,d1 as Wx,d2 as qx,d3 as zx,d4 as Yx,d5 as $x,d6 as Kx,d7 as $l,d8 as Xx,d9 as Qx,da as Jx,db as ym,dc as Zx,dd as ej,de as iu,df as tj,dg as sj,dh as nj,di as rj,dj as Kl,dk as aj,dl as ij,dm as oj,dn as lj,dp as ou,dq as Ni,dr as cj,ds as uj,dt as dj,du as mj,dv as Rm,dw as hj,dx as Om,dy as gj,dz as km,dA as fj,dB as pj,dC as xj,dD as jj,dE as lu,dF as Ds,dG as Am,dH as _a,dI as gn,dJ as cu,dK as uu,dL as vt,dM as Vs,dN as Ij,dO as bj,dP as Ej,dQ as Cj,dR as fl,dS as vj,dT as du,dU as mu,dV as Nj,dW as pl,dX as xl,dY as _j,dZ as Sj,d_ as _i,d$ as wj,e0 as Dm,e1 as Tj,e2 as yj,e3 as Rj,e4 as Oj,e5 as kj,e6 as Aj,e7 as Dj,e8 as Pj,e9 as Lj,ea as Mj,eb as jl,ec as Uj,ed as Fj,ee as Vj,ef as Gj,eg as Bj,eh as Hj,ei as Pm,ej as Wj,ek as qj,el as zj,em as Yj,en as $j,eo as Sa,ep as Kj,eq as Xj,er as Qj,es as Jj,et as hu,eu as Zj,ev as eI,ew as tI,ex as sI,ey as nI,ez as rI,eA as gu,eB as aI,eC as iI,eD as oI,eE as lI,eF as cI,eG as uI,eH as dI,eI as mI,eJ as hI,eK as gI,eL as fI,eM as pI,eN as xI,eO as Lm,eP as jI,eQ as II,eR as Mm,eS as bI,eT as EI,eU as CI,eV as vI,eW as NI,eX as _I,eY as SI,eZ as wI,e_ as TI,e$ as yI,f0 as RI,f1 as OI,f2 as kI,f3 as AI,f4 as DI,f5 as Nc,f6 as ci,f7 as PI,f8 as Il,f9 as LI,fa as fu,fb as MI,fc as UI,fd as ds,fe as FI,ff as VI,fg as GI,fh as BI,fi as HI,fj as WI,fk as qI,fl as zI,fm as YI,fn as $I,fo as KI,fp as XI,fq as QI,fr as JI,fs as ZI,ft as eb,fu as pu,fv as Um,fw as Fm,fx as tb,fy as sb,fz as nb,fA as rb,fB as ab,fC as ib,fD as ob,fE as lb,fF as cb,fG as en,fH as ub,fI as db,fJ as mb,fK as hb,fL as gb,fM as fb,fN as pb,fO as xb,fP as jb,fQ as Ib,fR as bb,fS as Eb,fT as Cb,fU as vb,fV as Nb,fW as _b,fX as Sb,fY as wb,fZ as xu,f_ as Tb,f$ as yb,g0 as Rb,g1 as Ob,g2 as kb,g3 as Ab,g4 as Si,g5 as ju,g6 as Db,g7 as Pb,g8 as Lb,g9 as wi,ga as Vm,gb as Mb,gc as bl,gd as Ub,ge as Fb,gf as Vb,gg as Gm,gh as Gb,gi as Bb,gj as Hb,gk as Wb,gl as qb,gm as zb,gn as Yb,go as $b,gp as Kb,gq as Xb,gr as Qb,gs as Jb,gt as Zb,gu as eE,gv as yr,gw as tE,gx as Iu,gy as sE,gz as nE,gA as rE,gB as Bm,gC as aE,gD as iE,gE as oE,gF as lE,gG as cE,gH as uE,gI as dE,gJ as mE,gK as hE,gL as gE,gM as fE,gN as pE,gO as xE,gP as jE,gQ as IE,gR as Hm,gS as bE,gT as Wm,gU as EE,gV as CE,gW as vE,gX as NE,gY as Ln,gZ as El,g_ as _E,g$ as SE,h0 as wE,h1 as bu,h2 as TE,h3 as yE,h4 as _c,h5 as qm,h6 as Js,h7 as RE,h8 as OE,h9 as kE,ha as zm,hb as Ym,hc as AE,hd as DE,he as PE,hf as $m,hg as LE,hh as ME,hi as UE,hj as FE,hk as VE,hl as GE,hm as BE,hn as HE,ho as WE,hp as qE,hq as zE,hr as YE,hs as $E,ht as Ti,hu as jt,hv as KE,hw as Cl,hx as Eu,hy as XE,hz as QE,hA as JE,hB as ZE,hC as eC,hD as tC,hE as sC,hF as nC,hG as rC,hH as aC,hI as iC,hJ as oC,hK as lC,hL as cC,hM as uC,hN as dC,hO as Cu,hP as mC,hQ as on,hR as yi}from"./nitro-renderer-CT4aL_Iz.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=s(r);fetch(r.href,a)}})();const A=o=>{const{ref:t=null,innerRef:s=null,display:n=null,fit:r=!1,fitV:a=!1,grow:l=!1,shrink:c=!1,fullWidth:m=!1,fullHeight:h=!1,overflow:u=null,position:g=null,float:f=null,pointer:p=!1,visible:x=null,textColor:I=null,classNames:j=[],className:E="",style:C={},children:b=null,...S}=o,_=i.useMemo(()=>{const k=[];return n&&n.length&&k.push("d-"+n),(r||m)&&k.push("w-100"),(r||h)&&k.push("h-100"),a&&k.push("vw-100","vh-100"),l&&k.push("flex-grow-1"),c&&k.push("flex-shrink-0"),u&&k.push("overflow-"+u),g&&k.push("position-"+g),f&&k.push("float-"+f),p&&k.push("cursor-pointer"),x!==null&&k.push(x?"visible":"invisible"),I&&k.push("text-"+I),j.length&&k.push(...j),k},[n,r,a,l,c,m,h,u,g,f,p,x,I,j]),T=i.useMemo(()=>{let k=_.join(" ");return E.length&&(k+=" "+E),k.trim()},[_,E]),P=i.useMemo(()=>{let k={};return Object.keys(C).length&&(k={...k,...C}),k},[C]);return e.jsx("div",{ref:s,className:T,style:P,...S,children:b})},Km=i.createContext({isCssGrid:!1}),hC=o=>e.jsx(Km.Provider,{value:o.value,children:o.children}),gC=()=>i.useContext(Km),ne=o=>{const{inline:t=!1,gap:s=2,maxContent:n=!1,columnCount:r=0,center:a=!1,alignSelf:l=null,alignItems:c=null,justifyContent:m=null,fullHeight:h=!0,classNames:u=[],style:g={},...f}=o,p=i.useMemo(()=>{const I=[];return t?I.push("inline-grid"):I.push("grid"),s?I.push("gap-"+s):s===0&&I.push("gap-0"),n&&I.push("flex-basis-max-content"),l&&I.push("align-self-"+l),c&&I.push("align-items-"+c),m&&I.push("justify-content-"+m),!c&&!m&&a&&I.push("align-items-center","justify-content-center"),u.length&&I.push(...u),I},[t,s,n,l,c,m,a,u]),x=i.useMemo(()=>{let I={};return r&&(I["--bs-columns"]=r.toString()),Object.keys(g).length&&(I={...I,...g}),I},[r,g]);return e.jsx(hC,{value:{isCssGrid:!0},children:e.jsx(A,{fullHeight:h,classNames:p,style:x,...f})})},Pe=o=>{const{columnMinWidth:t=40,columnMinHeight:s=40,columnCount:n=0,fullHeight:r=!1,maxContent:a=!0,overflow:l="auto",style:c={},...m}=o,h=i.useMemo(()=>{let u={};return u["--nitro-grid-column-min-height"]=s+"px",n>1&&(u.gridTemplateColumns=`repeat(auto-fill, minmax(${t}px, 1fr))`),Object.keys(c).length&&(u={...u,...c}),u},[t,s,n,c]);return e.jsx(ne,{columnCount:n,fullHeight:r,overflow:l,style:h,...m})},w=o=>{const{display:t="flex",column:s=void 0,reverse:n=!1,gap:r=null,center:a=!1,alignSelf:l=null,alignItems:c=null,justifyContent:m=null,classNames:h=[],...u}=o,g=i.useMemo(()=>{const f=[];return s?n?f.push("flex-column-reverse"):f.push("flex-column"):n&&f.push("flex-row-reverse"),r&&f.push("gap-"+r),l&&f.push("align-self-"+l),c&&f.push("align-items-"+c),m&&f.push("justify-content-"+m),!c&&!m&&a&&f.push("align-items-center","justify-content-center"),h.length&&f.push(...h),f},[s,n,r,a,l,c,m,h]);return e.jsx(A,{display:t,classNames:g,...u})},L=o=>{const{variant:t="primary",size:s="sm",active:n=!1,disabled:r=!1,classNames:a=[],outline:l=!1,tp:c=!1,...m}=o,h=i.useMemo(()=>{const u=["btn"];return l&&t?u.push("btn-outline-"+t):t&&u.push("btn-"+t),c&&u.push("btn-transparent"),s&&u.push("btn-"+s),n&&u.push("active"),r&&u.push("disabled"),a.length&&u.push(...a),u},[t,s,n,r,a,l]);return e.jsx(w,{center:!0,classNames:h,...m})},En=o=>{const{classNames:t=[],...s}=o,n=i.useMemo(()=>{const r=["btn-group"];return t.length&&r.push(...t),r},[t]);return e.jsx(A,{classNames:n,...s})},Xm=i.createContext({closers:null,setClosers:null,closeAll:null}),fC=o=>e.jsx(Xm.Provider,{...o}),pC=()=>i.useContext(Xm),io=o=>{const{alignItems:t="center",gap:s=1,children:n=null,...r}=o;return e.jsx(w,{alignItems:t,gap:s,...r,children:n})},oo=o=>{const{headerText:t="",isExpanded:s=!1,gap:n=0,classNames:r=[],children:a=null,...l}=o,[c,m]=i.useState(!1),{setClosers:h=null,closeAll:u=null}=pC(),g=()=>{u(),m(x=>!x)},f=i.useCallback(()=>m(!1),[]),p=i.useMemo(()=>{const x=["nitro-card-accordion-set"];return c&&x.push("active"),r&&r.length&&x.push(...r),x},[c,r]);return i.useEffect(()=>{m(s)},[s]),i.useEffect(()=>{const x=f;return h(I=>{const j=[...I];return j.push(x),j}),()=>{h(I=>{const j=[...I],E=j.indexOf(x);return E>=0&&j.splice(E,1),j})}},[f,h]),e.jsxs(N,{classNames:p,gap:n,...l,children:[e.jsxs(w,{pointer:!0,justifyContent:"between",className:"nitro-card-accordion-set-header px-2 py-1",onClick:g,children:[e.jsx(v,{children:t}),c&&e.jsx(gc,{className:"fa-icon"}),!c&&e.jsx(fc,{className:"fa-icon"})]}),c&&e.jsx(N,{fullHeight:!0,overflow:"auto",gap:0,className:"nitro-card-accordion-set-content",children:a})]})},xC=o=>{const{...t}=o,[s,n]=i.useState([]),r=i.useCallback(()=>{for(const a of s)a()},[s]);return e.jsx(fC,{value:{closers:s,setClosers:n,closeAll:r},children:e.jsx(N,{gap:0,...t})})},se=o=>{const{overflow:t="auto",classNames:s=[],...n}=o,r=i.useMemo(()=>{const a=["container-fluid","content-area"];return s.length&&a.push(...s),a},[s]);return e.jsx(N,{classNames:r,overflow:t,...n})},jC=i.createContext({theme:null}),IC=o=>e.jsx(jC.Provider,{value:o.value,children:o.children}),re=o=>{const{headerText:t=null,isGalleryPhoto:s=!1,noCloseButton:n=!1,isInfoToHabboPages:r=!1,hideButtonClose:a=!1,onReportPhoto:l=null,onClickInfoHabboPages:c=null,onCloseClick:m=null,justifyContent:h="center",alignItems:u="center",classNames:g=[],children:f=null,...p}=o,x=i.useMemo(()=>{const j=["drag-handler","container-fluid","nitro-card-header"];return g.length&&j.push(...g),j},[g]),I=j=>{j.stopPropagation(),j.nativeEvent.stopImmediatePropagation()};return e.jsx(N,{center:!0,position:"relative",classNames:x,...p,children:e.jsxs(w,{fullWidth:!0,center:!0,className:"nitro-card-header-holder",children:[e.jsx("span",{className:"nitro-card-header-text",children:t}),s&&e.jsx(A,{position:"absolute",className:"end-4 nitro-card-header-report-camera",onClick:l,children:e.jsx(Qh,{className:"fa-icon"})}),r&&e.jsx(A,{position:"absolute",className:"end-6 nitro-card-header-info-habbopages",onClick:c}),e.jsx(w,{center:!0,position:"absolute",className:"end-2 nitro-card-header-close",onMouseDownCapture:I,onClick:m,children:!a&&e.jsx(Hs,{className:"fa-icon w-12 h-12"})})]})})},Qm=o=>{const{justifyContent:t="center",classNames:s=[],variant:n="muted",...r}=o,a=i.useMemo(()=>{const l=["container-fluid","p-1"];return s.length&&l.push(...s),l.push("bg-"+n),l},[s,n]);return e.jsx(w,{justifyContent:t,classNames:a,...r})};function Ce(){return Yr.instance}function ft(o){Ce().addLinkEventTracker(o)}function St(){return Ce().avatar}function vu(o){return St().structureData.getPalette(o)}function Nu(o){return St().structureData.getSetType(o)}function wa(){return Ce().cameraManager}function bC(){return Ce().core}function EC(){return bC().configuration}function Z(o){o=o.startsWith("event:")?o.substring(6):o,Ce().createLinkEvent(o)}function $a(){var o;return(o=Ce())==null?void 0:o.communication}function K(o,t=null){return Ec.getValue(o,t)}function Xl(){var o;return(o=$a())==null?void 0:o.connection}function Jm(){return Ce().localization}const Pr=o=>{!o||!o.length||(o.startsWith("http")?oi.openWebPage(o):Z(o))};function pt(o){Ce().removeLinkEventTracker(o)}function H(){return Ce().roomEngine}let vl=!1,Ri=0,Oi=0;const ki=(o,t=1)=>{const s=o.clientX,n=o.clientY;let r=o.type;switch(r===ve.MOUSE_CLICK&&(Ri&&(Oi=1,Ri>=Date.now()-300&&Oi++),Ri=Date.now(),Oi===2&&(vl||(r=ve.DOUBLE_CLICK),Oi=0,Ri=null)),r){case ve.MOUSE_CLICK:break;case ve.DOUBLE_CLICK:break;case ve.MOUSE_MOVE:vl=!0;break;case ve.MOUSE_DOWN:vl=!1;break;case ve.MOUSE_UP:break;case ve.RIGHT_CLICK:break;default:return}H().dispatchMouseEvent(t,s,n,r,o.altKey,o.ctrlKey||o.metaKey,o.shiftKey,!1)};let Nl=!1,Ai=0,Di=0;const Pi=(o,t=1,s=!1,n=!1,r=!1,a=!1)=>{let l=0,c=0;o.touches[0]?(l=o.touches[0].clientX,c=o.touches[0].clientY):o.changedTouches[0]&&(l=o.changedTouches[0].clientX,c=o.changedTouches[0].clientY);let m=o.type;switch(s&&(m=Ut.TOUCH_LONG),(m===ve.MOUSE_CLICK||m===Ut.TOUCH_END)&&(m=ve.MOUSE_CLICK,Ai&&(Di=1,Ai>=Date.now()-300&&Di++),Ai=Date.now(),Di===2&&(Nl||(m=ve.DOUBLE_CLICK),Di=0,Ai=null)),m){case ve.MOUSE_CLICK:break;case ve.DOUBLE_CLICK:break;case Ut.TOUCH_START:m=ve.MOUSE_DOWN,Nl=!1;break;case Ut.TOUCH_MOVE:m=ve.MOUSE_MOVE,Nl=!0;break;case Ut.TOUCH_END:m=ve.MOUSE_UP;break;case Ut.TOUCH_LONG:m=ve.MOUSE_DOWN_LONG;break;default:return}m===Ut.TOUCH_START&&H().dispatchMouseEvent(t,l,c,m,n,r,a,!1),H().dispatchMouseEvent(t,l,c,m,n,r,a,!1)};function Xt(o){if(!o||!o.model)return!1;const t=G().userId,s=o.model.getValue(te.FURNITURE_OWNER_ID);return t===s}function Ka(o,t,s){return o?o.isRoomOwner||o.controllerLevel>=Ke.GUEST||G().isModerator||Xt(H().getRoomObject(o.roomId,t,s)):!1}function Lr(){return Ce().roomSessionManager}function vr(o,t=null){Lr().createSession(o,t)}function CC(){const o=Mr();return o?o.model.getValue(te.FIGURE_CAN_STAND_UP):oa.POSTURE_STAND}function _l(){const o=Mr();if(!o)return!1;const s=o.model.getValue(te.FIGURE_EFFECT);return!(s===29||s===30||s===185)}function G(){return Ce().sessionDataManager}function Cs(){return K("hc.disabled",!1)?Wt.VIP:G().clubLevel}const Fn=class Fn{};Fn.OKAY=0,Fn.MISSING_OFFER=1,Fn.FURNI_LIMIT_REACHED=2,Fn.NOT_IN_ROOM=3,Fn.NOT_ROOM_OWNER=4,Fn.GUILD_ROOM=5,Fn.VISITORS_IN_ROOM=6;let Un=Fn;class vC{constructor(t,s,n){this._depth=0,this._localization="",this._pageId=-1,this._pageName="",this._iconId=0,this._depth=s,this._parent=n,this._localization=t.localization,this._pageId=t.pageId,this._pageName=t.pageName,this._iconId=t.icon,this._children=[],this._offerIds=t.offerIds,this._isVisible=t.visible,this._isActive=!1,this._isOpen=!1}activate(){this._isActive=!0}deactivate(){this._isActive=!1}open(){this._isOpen=!0}close(){this._isOpen=!1}addChild(t){t&&this._children.push(t)}get depth(){return this._depth}get isBranch(){return this._children.length>0}get isLeaf(){return this._children.length===0}get localization(){return this._localization}get pageId(){return this._pageId}get pageName(){return this._pageName}get iconId(){return this._iconId}get children(){return this._children}get offerIds(){return this._offerIds}get parent(){return this._parent}get isVisible(){return this._isVisible}get isActive(){return this._isActive}get isOpen(){return this._isOpen}}const Co=class Co{constructor(t,s,n,r,a,l=-1){this._pageId=t,this._layoutCode=s,this._localization=n,this._offers=r,this._acceptSeasonCurrencyAsCredits=a;for(const c of r)c.page=this;l===-1?this._mode=Co.MODE_NORMAL:this._mode=l}get pageId(){return this._pageId}get layoutCode(){return this._layoutCode}get localization(){return this._localization}get offers(){return this._offers}get acceptSeasonCurrencyAsCredits(){return this._acceptSeasonCurrencyAsCredits}get mode(){return this._mode}};Co.MODE_NORMAL=0;let lo=Co;const mt=class mt{};mt.DUCKET_INFO="ducket_info",mt.CREDITS="credits",mt.AVATAR_EFFECTS="avatar_effects",mt.HC_MEMBERSHIP="hc_membership",mt.CLUB_GIFTS="club_gifts",mt.LIMITED_SOLD="limited_sold",mt.PET_ACCESSORIES="pet_accessories",mt.TRAX_SONGS="trax_songs",mt.NEW_ADDITIONS="new_additions",mt.QUEST_SHELL="quest_shell",mt.QUEST_SNOWFLAKES="quest_snowflakes",mt.VAL_QUESTS="val_quests",mt.GUILD_CUSTOM_FURNI="guild_custom_furni",mt.GIFT_SHOP="gift_shop",mt.HORSE_STYLES="horse_styles",mt.HORSE_SHOE="horse_shoe",mt.SET_EASTER="set_easter",mt.ECOTRON_TRANSFORM="ecotron_transform",mt.LOYALTY_INFO="loyalty_info",mt.ROOM_BUNDLES="room_bundles",mt.ROOM_BUNDLES_MOBILE="room_bundles_mobile",mt.HABBO_CLUB_DESKTOP="habbo_club_desktop",mt.MOBILE_SUBSCRIPTIONS="mobile_subscriptions";let co=mt;class NC{constructor(t,s){this.breed=t,this.palettes=s}}const Vn=class Vn{};Vn.NONE=0,Vn.CONFIRM=1,Vn.PURCHASE=2,Vn.NO_CREDITS=3,Vn.NO_POINTS=4,Vn.SOLD_OUT=5,Vn.FAILED=6;let tt=Vn;const vo=class vo{};vo.NORMAL="NORMAL",vo.BUILDER="BUILDERS_CLUB";let Gs=vo;const _C=o=>"",SC=o=>"",_u=(o,t)=>{const s=o.get(t),n=[];if(s&&s.length)for(const r of s)r.isVisible&&n.push(r);return n},Zm=(o,t,s,n)=>{if(s.isVisible&&s.pageId>0){let r=!1;const a=[s.pageName,s.localization].join(" ").toLowerCase().replace(/ /gi,"");if(a.indexOf(o)>-1&&(n.push(s),r=!0),!r){for(const l of t)if(a.indexOf(l)>=0){n.push(s);break}}}for(const r of s.children)Zm(o,t,r,n)};function wC(o){if(!o.length)return 0;let t=o.length-1;for(;t>=0&&!isNaN(parseInt(o.charAt(t)));)t--;return t>0?parseInt(o.substring(t+1)):-1}function TC(o,t){switch(o){case 0:return[[16743226],[16750435],[16764339],[16094464],[16498012],[16704690],[15586304],[16115545],[16513201],[8694111],[11585939],[14413767],[6664599],[9553845],[12971486],[8358322],[10002885],[13292268],[10780600],[12623573],[14403561],[12418717],[14327229],[15517403],[14515069],[15764368],[16366271],[11250603],[13948116],[16777215],[14256481],[14656129],[15848130],[14005087],[14337152],[15918540],[15118118],[15531929],[9764857],[11258085]];case 1:return[[16743226],[16750435],[16764339],[16094464],[16498012],[16704690],[15586304],[16115545],[16513201],[8694111],[11585939],[14413767],[6664599],[9553845],[12971486],[8358322],[10002885],[13292268],[10780600],[12623573],[14403561],[12418717],[14327229],[15517403],[14515069],[15764368],[16366271],[11250603],[13948116],[16777215],[14256481],[14656129],[15848130],[14005087],[14337152],[15918540],[15118118],[15531929],[9764857],[11258085]];case 2:return[[16579283],[15378351],[8830016],[15257125],[9340985],[8949607],[6198292],[8703620],[9889626],[8972045],[12161285],[13162269],[8620113],[12616503],[8628101],[13827840],[9764857]];case 3:return[[16777215],[15658734],[14540253]];case 4:return[[16777215],[16053490],[15464440],[16248792],[15396319],[15007487]];case 5:return[[16777215],[15658734],[14540253]];case 6:return[[16777215],[15658734],[14540253],[16767177],[16770205],[16751331]];case 7:return[[13421772],[11447982],[16751331],[10149119],[16763290],[16743786]];default:{const s=[];for(const n of t){const r=H().getPetColorResult(o,n.paletteId);r&&(r.primaryColor===r.secondaryColor?s.push([r.primaryColor]):s.push([r.primaryColor,r.secondaryColor]))}return s}}}const un=class un{};un.WALL="i",un.FLOOR="s",un.EFFECT="e",un.HABBO_CLUB="h",un.BADGE="b",un.GAME_TOKEN="GAME_TOKEN",un.PET="p",un.ROBOT="r";let xe=un;const No=class No{constructor(t,s,n,r,a,l,c=!1,m=0,h=0){this._productType=t.toLowerCase(),this._productClassId=s,this._extraParam=n,this._productCount=r,this._productData=a,this._furnitureData=l,this._isUniqueLimitedItem=c,this._uniqueLimitedItemSeriesSize=m,this._uniqueLimitedItemsLeft=h}static stripAddonProducts(t){return t.length===1?t:t.filter(s=>s.productType!==xe.BADGE&&s.productType!==xe.EFFECT&&s.productClassId!==No.EFFECT_CLASSID_NINJA_DISAPPEAR)}getIconUrl(t=null,s=null){switch(this._productType){case xe.FLOOR:return H().getFurnitureFloorIconUrl(this.productClassId);case xe.WALL:{if(t&&this._furnitureData){let n="";switch(this._furnitureData.className){case"floor":n=["th",this._furnitureData.className,t.product.extraParam].join("_");break;case"wallpaper":n=["th","wall",t.product.extraParam].join("_");break;case"landscape":n=["th",this._furnitureData.className,(t.product.extraParam||"").replace(".","_"),"001"].join("_");break}if(n!=="")return`${K("catalog.asset.url")}/${n}.png`}return H().getFurnitureWallIconUrl(this.productClassId,this._extraParam)}case xe.EFFECT:return _C(this.productClassId);case xe.HABBO_CLUB:return SC(this.productClassId);case xe.BADGE:return G().getBadgeUrl(this._extraParam);case xe.ROBOT:return null}return null}get productType(){return this._productType}get productClassId(){return this._productClassId}get extraParam(){return this._extraParam}set extraParam(t){this._extraParam=t}get productCount(){return this._productCount}get productData(){return this._productData}get furnitureData(){return this._furnitureData}get isUniqueLimitedItem(){return this._isUniqueLimitedItem}get uniqueLimitedItemSeriesSize(){return this._uniqueLimitedItemSeriesSize}get uniqueLimitedItemsLeft(){return this._uniqueLimitedItemsLeft}set uniqueLimitedItemsLeft(t){this._uniqueLimitedItemsLeft=t}};No.EFFECT_CLASSID_NINJA_DISAPPEAR=108;let ir=No;const Dt=class Dt{constructor(t,s,n,r,a,l,c,m,h,u){this._clubLevel=0,this._bundlePurchaseAllowed=!1,this._offerId=t,this._localizationId=s,this._isRentOffer=n,this._priceInCredits=r,this._priceInActivityPoints=a,this._activityPointType=l,this._giftable=c,this._clubLevel=m,this._products=h,this._bundlePurchaseAllowed=u,this.setPricingModelForProducts(),this.setPricingType();for(const g of h)if(g.productType===xe.BADGE){this._badgeCode=g.extraParam;break}}activate(){}get clubLevel(){return this._clubLevel}get page(){return this._page}set page(t){this._page=t}get offerId(){return this._offerId}get localizationId(){return this._localizationId}get priceInCredits(){return this._priceInCredits}get priceInActivityPoints(){return this._priceInActivityPoints}get activityPointType(){return this._activityPointType}get giftable(){return this._giftable}get product(){if(!this._products||!this._products.length)return null;if(this._products.length===1)return this._products[0];const t=ir.stripAddonProducts(this._products);return t.length?t[0]:null}get pricingModel(){return this._pricingModel}get priceType(){return this._priceType}get bundlePurchaseAllowed(){return this._bundlePurchaseAllowed}get isRentOffer(){return this._isRentOffer}get badgeCode(){return this._badgeCode}get localizationName(){const t=la(this._localizationId);return t?t.name:d(this._localizationId)}get localizationDescription(){const t=la(this._localizationId);return t?t.description:d(this._localizationId)}get isLazy(){return!1}get products(){return this._products}setPricingModelForProducts(){const t=ir.stripAddonProducts(this._products);t.length===1?t[0].productCount===1?this._pricingModel=Dt.PRICING_MODEL_SINGLE:this._pricingModel=Dt.PRICING_MODEL_MULTI:t.length>1?this._pricingModel=Dt.PRICING_MODEL_BUNDLE:this._pricingModel=Dt.PRICING_MODEL_UNKNOWN}setPricingType(){this._priceInCredits>0&&this._priceInActivityPoints>0?this._priceType=Dt.PRICE_TYPE_CREDITS_ACTIVITYPOINTS:this._priceInCredits>0?this._priceType=Dt.PRICE_TYPE_CREDITS:this._priceInActivityPoints>0?this._priceType=Dt.PRICE_TYPE_ACTIVITYPOINTS:this._priceType=Dt.PRICE_TYPE_NONE}clone(){const t=[],s=la(this.localizationId);for(const r of this._products){const a=Ql(r.productClassId,r.productType);t.push(new ir(r.productType,r.productClassId,r.extraParam,r.productCount,s,a))}const n=new Dt(this.offerId,this.localizationId,this.isRentOffer,this.priceInCredits,this.priceInActivityPoints,this.activityPointType,this.giftable,this.clubLevel,t,this.bundlePurchaseAllowed);return n.page=this.page,n}};Dt.PRICING_MODEL_UNKNOWN="pricing_model_unknown",Dt.PRICING_MODEL_SINGLE="pricing_model_single",Dt.PRICING_MODEL_MULTI="pricing_model_multi",Dt.PRICING_MODEL_BUNDLE="pricing_model_bundle",Dt.PRICING_MODEL_FURNITURE="pricing_model_furniture",Dt.PRICE_TYPE_NONE="price_type_none",Dt.PRICE_TYPE_CREDITS="price_type_credits",Dt.PRICE_TYPE_ACTIVITYPOINTS="price_type_activitypoints",Dt.PRICE_TYPE_CREDITS_ACTIVITYPOINTS="price_type_credits_and_activitypoints";let Bt=Dt;class yC{constructor(t){this._furniData=t,this._product=new ir(this._furniData.type,this._furniData.id,this._furniData.customParams,1,la(this._furniData.className),this._furniData)}activate(){D(new kg(this._furniData.rentOfferId>-1?this._furniData.rentOfferId:this._furniData.purchaseOfferId))}get offerId(){return this.isRentOffer?this._furniData.rentOfferId:this._furniData.purchaseOfferId}get priceInActivityPoints(){return 0}get activityPointType(){return 0}get priceInCredits(){return 0}get page(){return this._page}set page(t){this._page=t}get priceType(){return""}get product(){return this._product}get products(){return[this._product]}get localizationId(){return"roomItem.name."+this._furniData.id}get bundlePurchaseAllowed(){return!1}get isRentOffer(){return this._furniData.rentOfferId>-1}get giftable(){return!1}get pricingModel(){return Bt.PRICING_MODEL_FURNITURE}get clubLevel(){return 0}get badgeCode(){return""}get localizationName(){return this._furniData.name}get localizationDescription(){return this._furniData.description}get isLazy(){return!0}}const RC=(o,t,s=null)=>{let n=null;switch(o.toLocaleLowerCase()){case xe.FLOOR:n=H().getFurnitureFloorIconUrl(t);break;case xe.WALL:n=H().getFurnitureWallIconUrl(t,s);break}return n};class OC{constructor(t){this._isEnabled=!1,this._price=null,this._stuffTypes=null,this._boxTypes=null,this._ribbonTypes=null,this._defaultStuffTypes=null,this._isEnabled=t.isEnabled,this._price=t.price,this._boxTypes=t.boxTypes,this._ribbonTypes=t.ribbonTypes,this._stuffTypes=t.giftWrappers,this._defaultStuffTypes=t.giftFurnis}get isEnabled(){return this._isEnabled}get price(){return this._price}get stuffTypes(){return this._stuffTypes}get boxTypes(){return this._boxTypes}get ribbonTypes(){return this._ribbonTypes}get defaultStuffTypes(){return this._defaultStuffTypes}}const _o=class _o{constructor(t,s,n,r,a,l,c,m,h=-1){this._timeLeftMinutes=-1,this._offerId=t,this._furniId=s,this._furniType=n,this._extraData=r,this._stuffData=a,this._price=l,this._status=c,this._averagePrice=m,this._offerCount=h}get offerId(){return this._offerId}set offerId(t){this._offerId=t}get furniId(){return this._furniId}get furniType(){return this._furniType}get extraData(){return this._extraData}get stuffData(){return this._stuffData}get price(){return this._price}set price(t){this._price=t}get averagePrice(){return this._averagePrice}get image(){return this._image}set image(t){this._image=t}get imageCallback(){return this._imageCallback}set imageCallback(t){this._imageCallback=t}get status(){return this._status}get timeLeftMinutes(){return this._timeLeftMinutes}set timeLeftMinutes(t){this._timeLeftMinutes=t}get offerCount(){return this._offerCount}set offerCount(t){this._offerCount=t}get isUniqueLimitedItem(){return this.stuffData&&this.stuffData.uniqueSeries>0}};_o.TYPE_FLOOR=1,_o.TYPE_WALL=2;let Xa=_o;const Xr=class Xr{};Xr.ONGOING=1,Xr.ONGOING_OWN=1,Xr.SOLD=2,Xr.EXPIRED=3;let Qa=Xr;const ya=class ya{};ya.BY_ACTIVITY=1,ya.BY_VALUE=2,ya.ADVANCED=3;let Yt=ya;class eh{constructor(t,s){this._images=t,this._texts=s}getText(t){let s=this._texts[t]||"";return s&&s.length&&(s=s.replace(/\r\n|\r|\n/g,"<br />")),s}getImage(t){const s=this._images[t]||"";if(!s||!s.length)return null;let n=K("catalog.asset.image.url");return n=n.replace("%name%",s),n}}class kC{constructor(t,s,n,r,a,l,c,m){this.roomId=t,this.objectId=s,this.category=n,this.wallLocation=r,this.x=a,this.y=l,this.direction=c,this.offer=m}get offerId(){return this.offer.offerId}get productClassId(){return this.offer.product.productClassId}get productData(){return this.offer.product.productData}get furniData(){return this.offer.product.furnitureData}get extraParam(){return this.offer.product.extraParam}}const zs=class zs{constructor(){this._requestType=zs.REQUEST_TYPE_NONE}resetRequest(){this._requestType=zs.REQUEST_TYPE_NONE,this._requestById=-1,this._requestedByOfferId=-1,this._requestByName=null}get requestType(){return this._requestType}get requestById(){return this._requestById}set requestById(t){this._requestType=zs.REQUEST_TYPE_ID,this._requestById=t}get requestedByOfferId(){return this._requestedByOfferId}set requestedByOfferId(t){this._requestType=zs.REQUEST_TYPE_OFFER,this._requestedByOfferId=t}get requestByName(){return this._requestByName}set requestByName(t){this._requestType=zs.REQUEST_TYPE_NAME,this._requestByName=t}};zs.REQUEST_TYPE_NONE=0,zs.REQUEST_TYPE_ID=1,zs.REQUEST_TYPE_OFFER=2,zs.REQUEST_TYPE_NAME=3;let xr=zs;class AC{constructor(t,s,n){this.searchValue=t,this.offers=s,this.filteredNodes=n}}function Ql(o,t){let s=null;switch(t.toLowerCase()){case xe.FLOOR:s=G().getFloorItemData(o);break;case xe.WALL:s=G().getWallItemData(o);break}return s}function Yo(o,t,s){const n=H().getRoomObject(o,t,s);if(!n)return;const r=n.model.getValue(te.FURNITURE_TYPE_ID);switch(s){case Q.FLOOR:return G().getFloorItemData(r);case Q.WALL:return G().getWallItemData(r)}return null}function DC(){const o=Mr();return o?o.model.getValue(te.FIGURE_POSTURE):oa.POSTURE_STAND}function la(o){return o?G().getProductData(o):null}function Oe(){return Lr().getSession(-1)}function Jl(){D(new Ag)}function Nr(){return G().clubLevel>=Wt.CLUB}function Li(){return G().clubLevel>=Wt.VIP}function PC(o){const t=H().getRoomObject(Oe().roomId,o,Q.FLOOR);if(!t||!t.model)return!1;const s=G().userId,n=t.model.getValue(te.FURNITURE_OWNER_ID);return s===n}function LC(){const o=Mr();return o?o.model.getValue(te.FIGURE_EFFECT)===77:!1}function MC(o){Lr().startSession(o)}const Sc=()=>{Oe()&&(Jl(),Lr().removeSession(-1))};function Mr(){const o=G().userId,t=H().activeRoomId,s=Q.UNIT,n=H().getTotalObjectsForManager(t,s);let r=0;for(;r<n;){const a=H().getRoomObjectByIndex(t,r,s);if(a){const l=Oe().userDataManager.getUserDataByIndex(a.id);if(l&&l.webID===o)return a}r++}return null}const wc=(o,t,s,n=1)=>{const r=H().getRoomObjectBoundingRectangle(o,t,s,n);return r?(r.x=Math.round(r.x),r.y=Math.round(r.y),r):null},th=(o,t,s,n=1)=>{const r=H().getRoomObjectScreenLocation(o,t,s,n);return r?(r.x=Math.round(r.x),r.y=Math.round(r.y),r):null},UC=(o,t,s=1)=>{const n=H(),r=n.activeRoomId;n.initializeRoomInstanceRenderingCanvas(r,s,o,t)};function FC(o){let t=!1;const s=H().getRoomObject(o.roomId,o.objectId,o.category);return s&&s.model.getValue(te.FURNITURE_SELECTION_DISABLED)===1&&(t=!0,G().isModerator&&(t=!1)),t}function _r(o,t,s){H().processRoomObjectOperation(o,t,s)}function Su(o){H().setActiveRoomId(o)}const D=o=>Xl().send(o);class Es{static getAchievementBadgeCode(t){if(!t)return null;let s=t.badgeId;return t.finalLevel||(s=Jm().getPreviousLevelBadgeId(s)),s}static getAchievementCategoryImageUrl(t,s=null,n=!1){const r=K("achievements.images.url");let a=n?"achicon_":"achcategory_";return a+=t.code,s!==null&&(a+=`_${s>0?"active":"inactive"}`),r.replace("%image%",a)}static getAchievementCategoryMaxProgress(t){if(!t)return 0;let s=0;for(const n of t.achievements)s+=n.levelCount;return s}static getAchievementCategoryProgress(t){if(!t)return 0;let s=0;for(const n of t.achievements)s+=n.finalLevel?n.level:n.level-1;return s}static getAchievementCategoryTotalUnseen(t){if(!t)return 0;let s=0;for(const n of t.achievements)n.unseen>0&&s++;return s}static getAchievementHasStarted(t){return t?!!(t.finalLevel||t.level-1>0):!1}static getAchievementIsIgnored(t){if(!t)return!1;const s=K("achievements.unseen.ignored"),n=t.badgeId.replace(/[0-9]/g,"");return s.indexOf(n)>=0}static getAchievementLevel(t){return t?t.finalLevel?t.level:t.level-1:0}}class wu{constructor(t){this._code=t,this._achievements=[]}getProgress(){return Es.getAchievementCategoryProgress(this)}getMaxProgress(){return Es.getAchievementCategoryMaxProgress(this)}get code(){return this._code}get achievements(){return this._achievements}set achievements(t){this._achievements=t}}const Qr=class Qr{};Qr.ACTION_SAVE="AEA_ACTION_SAVE",Qr.ACTION_CLEAR="AEA_ACTION_CLEAR",Qr.ACTION_RESET="AEA_ACTION_RESET",Qr.ACTION_RANDOMIZE="AEA_ACTION_RANDOMIZE";let cn=Qr;class VC{constructor(t,s=!1){this._partColor=t,this._isDisabled=s,this._isHC=this._partColor.clubLevel>0,this._isSelected=!1}dispose(){this._partColor=null}get partColor(){return this._partColor}get color(){return Ht.int2rgb(this._partColor.rgb)}get isDisabled(){return this._isDisabled}get isHC(){return this._isHC}get isSelected(){return this._isSelected}set isSelected(t){this._isSelected=t,this.notify&&this.notify()}get notify(){return this._notifier}set notify(t){this._notifier=t}}class Tc{constructor(t,s,n){this._selectedPartIndex=-1,this._name=t,this._parts=s,this._palettes=n,this._selectedPartIndex=-1}static defaultColorId(t,s){if(!t||!t.length)return-1;let n=0;for(;n<t.length;){const r=t[n];if(r.partColor&&r.partColor.clubLevel<=s)return r.partColor.id;n++}return-1}init(){for(const t of this._parts)t&&t.init()}dispose(){if(this._parts){for(const t of this._parts)t.dispose();this._parts=null}if(this._palettes){for(const t of this._palettes)for(const s of t)s.dispose();this._palettes=null}this._selectedPartIndex=-1,this._paletteIndexes=null}selectPartId(t){if(!this._parts)return;let s=0;for(;s<this._parts.length;){if(this._parts[s].id===t){this.selectPartIndex(s);return}s++}}selectColorIds(t){if(!t||!this._palettes)return;this._paletteIndexes=new Array(t.length);let s=0;for(;s<this._palettes.length;){const n=this.getPalette(s);if(n){let r=0;if(t.length>s)r=t[s];else{const l=n[0];l&&l.partColor&&(r=l.partColor.id)}let a=0;for(;a<n.length;){const l=n[a];l.partColor.id===r?(this._paletteIndexes[s]=a,l.isSelected=!0):l.isSelected=!1,a++}}s++}this.updatePartColors()}selectPartIndex(t){if(!this._parts)return null;if(this._selectedPartIndex>=0&&this._parts.length>this._selectedPartIndex){const s=this._parts[this._selectedPartIndex];s&&(s.isSelected=!1)}if(this._parts.length>t){const s=this._parts[t];if(s)return s.isSelected=!0,this._selectedPartIndex=t,s}return null}selectColorIndex(t,s){const n=this.getPalette(s);if(!n||n.length<=t)return null;this.deselectColorIndex(this._paletteIndexes[s],s),this._paletteIndexes[s]=t;const r=n[t];return r?(r.isSelected=!0,this.updatePartColors(),r):null}getCurrentColorIndex(t){return this._paletteIndexes[t]}deselectColorIndex(t,s){const n=this.getPalette(s);if(!n||n.length<=t)return;const r=n[t];r&&(r.isSelected=!1)}getSelectedColorIds(){if(!this._paletteIndexes||!this._paletteIndexes.length||!this._palettes||!this._palettes.length)return null;const t=this._palettes[0];if(!t||!t.length)return null;const s=t[0];if(!s||!s.partColor)return null;const n=s.partColor.id,r=[];let a=0;for(;a<this._paletteIndexes.length;){const c=this._palettes[a];if(!(!c||c.length<=a))if(c.length>this._paletteIndexes[a]){const m=c[this._paletteIndexes[a]];m&&m.partColor?r.push(m.partColor.id):r.push(n)}else r.push(n);a++}const l=this.getCurrentPart();return l?r.slice(0,Math.max(l.maxColorIndex,1)):null}getSelectedColors(){const t=[];let s=0;for(;s<this._paletteIndexes.length;){const n=this.getSelectedColor(s);n?t.push(n.partColor):t.push(null),s++}return t}getSelectedColor(t){const s=this.getPalette(t);return!s||s.length<=this._paletteIndexes[t]?null:s[this._paletteIndexes[t]]}getSelectedColorId(t){const s=this.getSelectedColor(t);return s&&s.partColor?s.partColor.id:0}getPalette(t){return!this._paletteIndexes||!this._palettes||this._palettes.length<=t?null:this._palettes[t]}getCurrentPart(){return this._parts[this._selectedPartIndex]}updatePartColors(){const t=this.getSelectedColors();for(const s of this._parts)s&&(s.partColors=t)}hasClubSelectionsOverLevel(t){let s=!1;const n=this.getSelectedColors();if(n){let a=0;for(;a<n.length;){const l=n[a];l&&l.clubLevel>t&&(s=!0),a++}}const r=this.getCurrentPart();if(r&&r.partSet){const a=r.partSet;a&&a.clubLevel>t&&(s=!0)}return s}hasInvalidSelectedItems(t){const s=this.getCurrentPart();if(!s)return!1;const n=s.partSet;if(!(!n||!n.isSellable))return t.indexOf(n.id)>-1}stripClubItemsOverLevel(t){const s=this.getCurrentPart();if(s&&s.partSet&&s.partSet.clubLevel>t){const r=this.selectPartIndex(0);return r&&!r.partSet&&this.selectPartIndex(1),!0}return!1}stripClubColorsOverLevel(t){const s=[],n=this.getSelectedColors(),r=this.getPalette(0);let a=!1;const l=Tc.defaultColorId(r,t);if(l===-1)return!1;let c=0;for(;c<n.length;){const m=n[c];m?m.clubLevel>t?(s.push(l),a=!0):s.push(m.id):(s.push(l),a=!0),c++}return a&&this.selectColorIds(s),a}get name(){return this._name}get parts(){return this._parts}get selectedPartIndex(){return this._selectedPartIndex}}const Jr=class Jr{static getGender(t){switch(t){case Se.MALE:case"m":case"M":t=Se.MALE;break;case Se.FEMALE:case"f":case"F":t=Se.FEMALE;break;default:t=Se.MALE}return t}static hasFigureSetId(t){return this.FIGURE_SET_IDS.indexOf(t)>=0}static createCategory(t,s){if(!t||!s||!this.CURRENT_FIGURE)return null;const n=[],r=[];let a=0;for(;a<this.MAX_PALETTES;)r.push([]),a++;const l=Nu(s);if(!l)return null;const c=vu(l.paletteID);if(!c)return null;let m=this.CURRENT_FIGURE.getColorIds(s);m||(m=[]);const h=new Array(m.length),u=this.clubItemsDimmed,g=Cs();for(const E of c.colors.getValues())if(E.isSelectable&&(u||g>=E.clubLevel)){let C=0;for(;C<this.MAX_PALETTES;){const b=g<E.clubLevel,S=new VC(E,b);r[C].push(S),C++}if(s!==Se.FACE){let b=0;for(;b<m.length;)E.id===m[b]&&(h[b]=E),b++}}let f=[];if(u?f=St().getMandatoryAvatarPartSetIds(this.CURRENT_FIGURE.gender,2):f=St().getMandatoryAvatarPartSetIds(this.CURRENT_FIGURE.gender,g),f.indexOf(s)===-1){const E=new uo(null,null,!1);E.isClear=!0,n.push(E)}const x=s!==Se.FACE,I=l.partSets;for(a=I.length-1;a>=0;){const E=I.getWithIndex(a);let C=!1;if((E.gender===Se.UNISEX||E.gender===this.CURRENT_FIGURE.gender)&&(C=!0),E.isSelectable&&C&&(u||g>=E.clubLevel)){const b=g<E.clubLevel;let S=!0;E.isSellable&&(S=this.hasFigureSetId(E.id)),S&&n.push(new uo(E,h,x,b))}a--}for(n.sort(this.clubItemsFirst?this.clubSorter:this.noobSorter),a=0;a<this.MAX_PALETTES;)r[a].sort(this.colorSorter),a++;return new Tc(s,n,r)}static clubSorter(t,s){const n=t.partSet?t.partSet.clubLevel:9999999999,r=s.partSet?s.partSet.clubLevel:9999999999,a=t.partSet?t.partSet.isSellable:!1,l=s.partSet?s.partSet.isSellable:!1;return a&&!l?1:l&&!a||n>r?-1:n<r?1:t.partSet.id>s.partSet.id?-1:t.partSet.id<s.partSet.id?1:0}static colorSorter(t,s){const n=t.partColor?t.partColor.clubLevel:-1,r=s.partColor?s.partColor.clubLevel:-1;return n<r?-1:n>r?1:t.partColor.index<s.partColor.index?-1:t.partColor.index>s.partColor.index?1:0}static noobSorter(t,s){const n=t.partSet?t.partSet.clubLevel:-1,r=s.partSet?s.partSet.clubLevel:-1,a=t.partSet?t.partSet.isSellable:!1,l=s.partSet?s.partSet.isSellable:!1;return a&&!l?1:l&&!a||n<r?-1:n>r?1:t.partSet.id<s.partSet.id?-1:t.partSet.id>s.partSet.id?1:0}static avatarSetFirstSelectableColor(t){const s=Nu(t);if(!s)return-1;const n=vu(s.paletteID);if(!n)return-1;for(const r of n.colors.getValues())if(!(!r.isSelectable||Cs()<r.clubLevel))return r.id;return-1}static get clubItemsFirst(){return K("avatareditor.show.clubitems.first",!0)}static get clubItemsDimmed(){return K("avatareditor.show.clubitems.dimmed",!0)}};Jr.MAX_PALETTES=2,Jr.CURRENT_FIGURE=null,Jr.FIGURE_SET_IDS=[],Jr.BOUND_FURNITURE_NAMES=[];let Rt=Jr;const ce=class ce{constructor(){this._gender="M",this._direction=ce.DEFAULT_DIRECTION,this._avatarEffectType=-1,this._notifier=null}loadAvatarData(t,s){this._data=new Map,this._colors=new Map,this._gender=s,this.parseFigureString(t),this.updateView()}parseFigureString(t){if(!t)return;const s=t.split(".");if(!(!s||!s.length))for(const n of s){const r=n.split("-");if(!r.length)continue;const a=r[0],l=parseInt(r[1]),c=[];let m=2;for(;m<r.length;)c.push(parseInt(r[m])),m++;c.length||c.push(0),this.savePartSetId(a,l,!1),this.savePartSetColourId(a,c,!1)}}getPartSetId(t){const s=this._data.get(t);return s!==void 0?s:-1}getColorIds(t){const s=this._colors.get(t);return s!==void 0?s:[Rt.avatarSetFirstSelectableColor(t)]}getFigureString(){let t="";const s=[];for(const[r,a]of this._data.entries()){const l=this._colors.get(r);let c=r+"-"+a;if(l&&l.length){let m=0;for(;m<l.length;)c=c+("-"+l[m]),m++}s.push(c)}let n=0;for(;n<s.length;)t=t+s[n],n<s.length-1&&(t=t+"."),n++;return t}savePartData(t,s,n,r=!1){this.savePartSetId(t,s,r),this.savePartSetColourId(t,n,r)}savePartSetId(t,s,n=!0){switch(t){case ce.FACE:case ce.HAIR:case ce.HAT:case ce.HEAD_ACCESSORIES:case ce.EYE_ACCESSORIES:case ce.FACE_ACCESSORIES:case ce.SHIRT:case ce.JACKET:case ce.CHEST_ACCESSORIES:case ce.CHEST_PRINTS:case ce.TROUSERS:case ce.SHOES:case ce.TROUSER_ACCESSORIES:s>=0?this._data.set(t,s):this._data.delete(t);break}n&&this.updateView()}savePartSetColourId(t,s,n=!0){switch(t){case ce.FACE:case ce.HAIR:case ce.HAT:case ce.HEAD_ACCESSORIES:case ce.EYE_ACCESSORIES:case ce.FACE_ACCESSORIES:case ce.SHIRT:case ce.JACKET:case ce.CHEST_ACCESSORIES:case ce.CHEST_PRINTS:case ce.TROUSERS:case ce.SHOES:case ce.TROUSER_ACCESSORIES:this._colors.set(t,s);break}n&&this.updateView()}getFigureStringWithFace(t,s=!0){let n="";const r=[ce.FACE],a=[];for(const c of r){const m=this._colors.get(c);if(!m)continue;let h=this._data.get(c);c===ce.FACE&&s&&(h=t);let u=c+"-"+h;if(h>=0){let g=0;for(;g<m.length;)u=u+("-"+m[g]),g++}a.push(u)}let l=0;for(;l<a.length;)n=n+a[l],l<a.length-1&&(n=n+"."),l++;return n}updateView(){this.notify&&this.notify()}get gender(){return this._gender}get direction(){return this._direction}set direction(t){this._direction=t,this.updateView()}set avatarEffectType(t){this._avatarEffectType=t}get avatarEffectType(){return this._avatarEffectType}get notify(){return this._notifier}set notify(t){this._notifier=t}};ce.DEFAULT_DIRECTION=4,ce.MALE="M",ce.FEMALE="F",ce.UNISEX="U",ce.SCALE="h",ce.STD="std",ce.DEFAULT_FRAME="0",ce.FACE="hd",ce.HAIR="hr",ce.HAT="ha",ce.HEAD_ACCESSORIES="he",ce.EYE_ACCESSORIES="ea",ce.FACE_ACCESSORIES="fa",ce.JACKET="cc",ce.SHIRT="ch",ce.CHEST_ACCESSORIES="ca",ce.CHEST_PRINTS="cp",ce.TROUSERS="lg",ce.SHOES="sh",ce.TROUSER_ACCESSORIES="wa",ce.SET_TYPES=[ce.FACE,ce.HAIR,ce.HAT,ce.HEAD_ACCESSORIES,ce.EYE_ACCESSORIES,ce.FACE_ACCESSORIES,ce.JACKET,ce.SHIRT,ce.CHEST_ACCESSORIES,ce.CHEST_PRINTS,ce.TROUSERS,ce.SHOES,ce.TROUSERS];let Se=ce;const dn=class dn{constructor(t,s,n=!0,r=!1){if(this._renderManager=St(),this._partSet=t,this._partColors=s,this._useColors=n,this._isDisabled=r,this._thumbContainer=null,this._imageUrl=null,this._maxColorIndex=0,this._isValidFigure=!1,this._isHC=!1,this._isSellable=!1,this._isClear=!1,this._isSelected=!1,this._disposed=!1,this._isInitalized=!1,t){const a=t.parts;for(const l of a)this._maxColorIndex=Math.max(this._maxColorIndex,l.colorLayerIndex)}}init(){this._isInitalized||(this._isInitalized=!0,this.update())}dispose(){this._disposed||(this._renderManager=null,this._partSet=null,this._partColors=null,this._imageUrl=null,this._disposed=!0,this._isInitalized=!1,this._thumbContainer&&(this._thumbContainer.destroy(),this._thumbContainer=null))}update(){this.updateThumbVisualization()}analyzeFigure(){if(!this._renderManager||!this._partSet||!this._partSet.parts||!this._partSet.parts.length)return!1;const t=this._renderManager.createFigureContainer(this.partSet.type+"-"+this.partSet.id);return this._renderManager.isFigureContainerReady(t)?(this._isValidFigure=!0,!0):(this._renderManager.downloadAvatarFigure(t,this),!1)}renderThumb(){if(!this._renderManager||!this._partSet||!this._isValidFigure&&!this.analyzeFigure())return null;const t=this._partSet.parts.concat().sort(this.sortByDrawOrder),s=new Pg;for(const n of t){if(!n)continue;let r=null,a=0,l=!1;for(;!l&&a<dn.THUMB_DIRECTIONS.length;){const g=Se.SCALE+"_"+Se.STD+"_"+n.type+"_"+n.id+"_"+dn.THUMB_DIRECTIONS[a]+"_"+Se.DEFAULT_FRAME;r=this._renderManager.getAssetByName(g),r&&r.texture?l=!0:a++}if(!l)continue;const c=r.offsetX,m=r.offsetY;let h=null;if(this._useColors&&n.colorLayerIndex>0){const g=this._partColors[n.colorLayerIndex-1];g&&(h=g)}const u=new to(r.texture);u.position.set(c,m),h&&(u.tint=h.rgb),s.addChild(u)}return s}updateThumbVisualization(){if(!this._isInitalized)return;let t=this._thumbContainer;t||(t=this.renderThumb()),t&&(this._partSet?(this._isHC=this._partSet.clubLevel>0,this._isSellable=this._partSet.isSellable):(this._isHC=!1,this._isSellable=!1),this._isDisabled&&this.setAlpha(t,.2),this._imageUrl=vn.generateImageUrl(t),this.notify&&this.notify())}setAlpha(t,s){return t.filters=[dn.ALPHA_FILTER],t}sortByDrawOrder(t,s){const n=dn.DRAW_ORDER.indexOf(t.type),r=dn.DRAW_ORDER.indexOf(s.type);return n<r?-1:n>r?1:t.index<s.index?-1:t.index>s.index?1:0}resetFigure(t){this.analyzeFigure()&&this.update()}get disposed(){return this._disposed}get id(){return this._partSet?this._partSet.id:-1}get partSet(){return this._partSet}set partColors(t){this._partColors=t,this.update()}get isDisabled(){return this._isDisabled}set thumbContainer(t){this._thumbContainer=t,this.update()}get imageUrl(){return this._imageUrl}get maxColorIndex(){return this._maxColorIndex}get isHC(){return this._isHC}get isSellable(){return this._isSellable}get isClear(){return this._isClear}set isClear(t){this._isClear=t}get isSelected(){return this._isSelected}set isSelected(t){this._isSelected=t,this.notify&&this.notify()}get notify(){return this._notifier}set notify(t){this._notifier=t}};dn.ALPHA_FILTER=new Dg(.2),dn.THUMB_DIRECTIONS=[2,6,0,4,3,1],dn.DRAW_ORDER=[Ve.LEFT_HAND_ITEM,Ve.LEFT_HAND,Ve.LEFT_SLEEVE,Ve.LEFT_COAT_SLEEVE,Ve.BODY,Ve.SHOES,Ve.LEGS,Ve.CHEST,Ve.CHEST_ACCESSORY,Ve.COAT_CHEST,Ve.CHEST_PRINT,Ve.WAIST_ACCESSORY,Ve.RIGHT_HAND,Ve.RIGHT_SLEEVE,Ve.RIGHT_COAT_SLEEVE,Ve.HEAD,Ve.FACE,Ve.EYES,Ve.HAIR,Ve.HAIR_BIG,Ve.FACE_ACCESSORY,Ve.EYE_ACCESSORY,Ve.HEAD_ACCESSORY,Ve.HEAD_ACCESSORY_EXTRA,Ve.RIGHT_HAND_ITEM];let uo=dn;class $o{constructor(){this._isInitalized=!1,this._maxPaletteCount=0}dispose(){this._categories=null,this._disposed=!0}get disposed(){return this._disposed}init(){this._categories||(this._categories=new Map)}reset(){if(this._isInitalized=!1,this._categories)for(const t of this._categories.values())t&&t.dispose();this._categories=new Map}addCategory(t){let s=this._categories.get(t);s||(s=Rt.createCategory(this,t),s&&(this._categories.set(t,s),this.updateSelectionsFromFigure(t)))}updateSelectionsFromFigure(t){const s=this._categories.get(t);if(!s)return;const n=Rt.CURRENT_FIGURE.getPartSetId(t);let r=Rt.CURRENT_FIGURE.getColorIds(t);r||(r=[]),s.selectPartId(n),s.selectColorIds(r)}hasClubSelectionsOverLevel(t){if(!this._categories)return!1;for(const s of this._categories.values())if(s&&s.hasClubSelectionsOverLevel(t))return!0;return!1}hasInvalidSelectedItems(t){if(!this._categories)return!1;for(const s of this._categories.values())if(s.hasInvalidSelectedItems(t))return!0;return!1}stripClubItemsOverLevel(t){if(!this._categories)return!1;let s=!1;for(const[n,r]of this._categories.entries()){let a=!1;if(r.stripClubItemsOverLevel(t)&&(a=!0),r.stripClubColorsOverLevel(t)&&(a=!0),a){const l=r.getCurrentPart();l&&Rt.CURRENT_FIGURE&&Rt.CURRENT_FIGURE.savePartData(n,l.id,r.getSelectedColorIds(),!0),s=!0}}return s}stripInvalidSellableItems(){if(!this._categories)return!1;let t=!1;for(const[s,n]of this._categories.entries());return t}selectPart(t,s){const n=this._categories.get(t);if(!n)return;const r=n.selectedPartIndex;n.selectPartIndex(s);const a=n.getCurrentPart();if(a){if(a.isDisabled){n.selectPartIndex(r);return}this._maxPaletteCount=a.maxColorIndex,Rt.CURRENT_FIGURE.savePartData(t,a.id,n.getSelectedColorIds(),!0)}}selectColor(t,s,n){const r=this._categories.get(t);if(!r)return;const a=r.getCurrentColorIndex(n);if(r.selectColorIndex(s,n),r.getSelectedColor(n).isDisabled){r.selectColorIndex(a,n);return}Rt.CURRENT_FIGURE.savePartSetColourId(t,r.getSelectedColorIds(),!0)}getCategoryData(t){return this._isInitalized||this.init(),this._categories?this._categories.get(t):null}get categories(){return this._categories}get canSetGender(){return!1}get maxPaletteCount(){return this._maxPaletteCount||1}set maxPaletteCount(t){this._maxPaletteCount=t}get name(){return null}}class GC extends $o{constructor(){super(...arguments),this._imageCallBackHandled=!1}init(){super.init(),this.addCategory(Se.FACE),this._isInitalized=!0}selectColor(t,s,n){super.selectColor(t,s,n),this.updateSelectionsFromFigure(Se.FACE)}updateSelectionsFromFigure(t){if(!this._categories||!Rt.CURRENT_FIGURE)return;const s=this._categories.get(t);if(!s)return;const n=Rt.CURRENT_FIGURE.getPartSetId(t);let r=Rt.CURRENT_FIGURE.getColorIds(t);r||(r=[]),s.selectPartId(n),s.selectColorIds(r);for(const a of s.parts){const l=c=>{const m=Rt.CURRENT_FIGURE.getFigureStringWithFace(a.id),h=St().createAvatarImage(m,Cc.LARGE,null,{resetFigure:l,dispose:null,disposed:!1}),u=h.getImageAsSprite(so.HEAD);u&&(u.y=10,a.thumbContainer=u,setTimeout(()=>h.dispose(),0))};l()}}get canSetGender(){return!0}get name(){return Us.GENERIC}}const is=o=>{if(o==null||typeof o!="object")return o;const t=new o.constructor;for(const s in o)o.hasOwnProperty(s)&&(t[s]=o[s]);return t};class gs{static makeColorHex(t){return"#"+t}static makeColorNumberHex(t){return"#"+t.toString(16).padStart(6,"0")}static convertFromHex(t){return parseInt(t.replace("#",""),16)}static uintHexColor(t){const s=t>>>0;return gs.makeColorHex(s.toString(16).substring(2))}static int_to_8BitVals(t){const s=t>>24&255,n=t>>16&255,r=t>>8&255,a=t&255;return[s,n,r,a]}static eight_bitVals_to_int(t,s,n,r){return(t<<24)+(s<<16)+(n<<8)+(r|0)}static int2rgb(t){t>>>=0;const s=t&255,n=(t&65280)>>>8;return"rgba("+[(t&16711680)>>>16,n,s,1].join(",")+")"}}const fr=o=>{let t=Math.floor(o/86400),s=Math.floor(o%86400/3600),n=Math.floor(o%86400%3600/60),r=o%86400%3600%60;return t.toString().padStart(2,"0")+":"+s.toString().padStart(2,"0")+":"+n.toString().padStart(2,"0")+":"+r.toString().padStart(2,"0")},Ko=o=>{try{JSON.parse(window.localStorage.getItem(o))}catch{return null}},yc=o=>{let t=Ce().localization.getBadgeDesc(o);return(!t||!t.length)&&(t=`badge_desc_${o}`),t},pa=o=>{let t=Ce().localization.getBadgeName(o);return(!t||!t.length)&&(t=`badge_name_${o}`),t};function Ja(o){return!o||isNaN(o)?"0":o.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}function BC(o){if(!o||isNaN(o))return"0";let t=Math.abs(o);const s=Math.pow(10,1),n=o<0;let r="";const a=[{key:"Q",value:Math.pow(10,15)},{key:"T",value:Math.pow(10,12)},{key:"B",value:Math.pow(10,9)},{key:"M",value:Math.pow(10,6)},{key:"K",value:1e3}];for(const l of a){let c=t/l.value;if(c=Math.round(c*s)/s,c>=1){t=c,r=l.key;break}}return(n?"-":"")+t+r}function d(o,t=null,s=null){return Ce().getLocalizationWithParameters(o,t,s)}const So=class So{};So.CATALOG_PLACE_MULTIPLE_OBJECTS="catalogPlaceMultipleObjects",So.CATALOG_SKIP_PURCHASE_CONFIRMATION="catalogSkipPurchaseConfirmation";let Za=So;const sh=(o,t)=>o.dispatchEvent(t),Zl=o=>sh(Ce().events,o),Nn=new Lg,Nt=o=>sh(Nn,o);let nh=!1;const _n=o=>{nh&&Zl(new su(su.PLAY_SOUND,o))},Tu=[ve.MOUSE_CLICK],HC=()=>{const o=()=>Tu.forEach(s=>window.removeEventListener(s,t)),t=s=>(nh=!0)&&o();Tu.forEach(s=>window.addEventListener(s,t))};HC();const ht=class ht{};ht.DEFAULT=1,ht.WALL_PAPER=2,ht.FLOOR=3,ht.LANDSCAPE=4,ht.POST_IT=5,ht.POSTER=6,ht.SOUND_SET=7,ht.TRAX_SONG=8,ht.PRESENT=9,ht.ECOTRON_BOX=10,ht.TROPHY=11,ht.CREDIT_FURNI=12,ht.PET_SHAMPOO=13,ht.PET_CUSTOM_PART=14,ht.PET_CUSTOM_PART_SHAMPOO=15,ht.PET_SADDLE=16,ht.GUILD_FURNI=17,ht.GAME_FURNI=18,ht.MONSTERPLANT_SEED=19,ht.MONSTERPLANT_REVIVAL=20,ht.MONSTERPLANT_REBREED=21,ht.MONSTERPLANT_FERTILIZE=22,ht.FIGURE_PURCHASABLE_SET=23;let de=ht;class ei{constructor(t){t&&(this._locked=!1,this._id=t.itemId,this._type=t.spriteId,this._ref=t.ref,this._category=t.category,this._groupable=t.isGroupable&&!t.rentable,this._tradeable=t.tradable,this._recyclable=t.isRecycleable,this._sellable=t.sellable,this._stuffData=t.stuffData,this._extra=t.extra,this._secondsToExpiration=t.secondsToExpiration,this._expirationTimeStamp=t.expirationTimeStamp,this._hasRentPeriodStarted=t.hasRentPeriodStarted,this._creationDay=t.creationDay,this._creationMonth=t.creationMonth,this._creationYear=t.creationYear,this._slotId=t.slotId,this._songId=t.songId,this._flatId=t.flatId,this._isRented=t.rentable,this._isWallItem=t.isWallItem)}get rentable(){return this._isRented}get id(){return this._id}get ref(){return this._ref}get category(){return this._category}get type(){return this._type}get stuffData(){return this._stuffData}set stuffData(t){this._stuffData=t}get extra(){return this._extra}get recyclable(){return this._recyclable}get isTradable(){return this._tradeable}get isGroupable(){return this._groupable}get sellable(){return this._sellable}get secondsToExpiration(){if(this._secondsToExpiration===-1)return-1;let t=-1;return this._hasRentPeriodStarted?(t=this._secondsToExpiration-(Ms()-this._expirationTimeStamp)/1e3,t<0&&(t=0)):t=this._secondsToExpiration,t}get creationDay(){return this._creationDay}get creationMonth(){return this._creationMonth}get creationYear(){return this._creationYear}get slotId(){return this._slotId}get songId(){return this._songId}get locked(){return this._locked}set locked(t){this._locked=t}get flatId(){return this._flatId}get isWallItem(){return this._isWallItem}get hasRentPeriodStarted(){return this._hasRentPeriodStarted}get expirationTimeStamp(){return this._expirationTimeStamp}update(t){this._type=t.spriteId,this._ref=t.ref,this._category=t.category,this._groupable=t.isGroupable&&!t.rentable,this._tradeable=t.tradable,this._recyclable=t.isRecycleable,this._sellable=t.sellable,this._stuffData=t.stuffData,this._extra=t.extra,this._secondsToExpiration=t.secondsToExpiration,this._expirationTimeStamp=t.expirationTimeStamp,this._hasRentPeriodStarted=t.hasRentPeriodStarted,this._creationDay=t.creationDay,this._creationMonth=t.creationMonth,this._creationYear=t.creationYear,this._slotId=t.slotId,this._songId=t.songId,this._flatId=t.flatId,this._isRented=t.rentable,this._isWallItem=t.isWallItem}clone(){const t=new ei(null);return t._expirationTimeStamp=this._expirationTimeStamp,t._isWallItem=this._isWallItem,t._songId=this._songId,t._locked=this._locked,t._id=this._id,t._ref=this._ref,t._category=this._category,t._type=this._type,t._stuffData=this._stuffData,t._extra=this._extra,t._recyclable=this._recyclable,t._tradeable=this._tradeable,t._groupable=this._groupable,t._sellable=this._sellable,t._secondsToExpiration=this._secondsToExpiration,t._hasRentPeriodStarted=this._hasRentPeriodStarted,t._creationDay=this._creationDay,t._creationMonth=this._creationMonth,t._creationYear=this._creationYear,t._slotId=this._slotId,t._isRented=this._isRented,t._flatId=this._flatId,t}}class Rc{constructor(t=-1,s=-1,n=null,r=null,a=-1){this._type=t,this._category=s,this._roomEngine=n,this._stuffData=r,this._extra=a,this._isWallItem=!1,this._iconUrl=null,this._name=null,this._description=null,this._locked=!1,this._selected=!1,this._hasUnseenItems=!1,this._items=[]}clone(){const t=new Rc;return t._type=this._type,t._category=this._category,t._roomEngine=this._roomEngine,t._stuffData=this._stuffData,t._extra=this._extra,t._isWallItem=this._isWallItem,t._iconUrl=this._iconUrl,t._name=this._name,t._description=this._description,t._locked=this._locked,t._selected=this._selected,t._hasUnseenItems=this._hasUnseenItems,t._items=this._items,t}prepareGroup(){this.setIcon(),this.setName(),this.setDescription()}dispose(){}getItemByIndex(t){return this._items[t]}getItemById(t){for(const s of this._items)if(s.id===t)return s;return null}getTradeItems(t){const s=[],n=this.getLastItem();if(!n)return s;let r=0,a=0;for(;a<this._items.length&&!(r>=t);){const l=this.getItemByIndex(a);!l.locked&&l.isTradable&&l.type===n.type&&(s.push(l),r++),a++}return s}push(t){const s=[...this._items];let n=0;for(;n<s.length;){let r=s[n];if(r.id===t.id){r=r.clone(),r.locked=!1,s.splice(n,1),s.push(r),this._items=s;return}n++}s.push(t),this._items=s,this._items.length===1&&this.prepareGroup()}pop(){const t=[...this._items];let s=null;if(t.length>0){const n=t.length-1;s=t[n],t.splice(n,1)}return this._items=t,s}remove(t){const s=[...this._items];let n=0;for(;n<s.length;){let r=s[n];if(r.id===t)return s.splice(n,1),this._items=s,r;n++}return null}getTotalCount(){if(this._category===de.POST_IT){let t=0,s=0;for(;s<this._items.length;){const n=this.getItemByIndex(s);t=t+parseInt(n.stuffData.getLegacyString()),s++}return t}return this._items.length}getUnlockedCount(){if(this.category===de.POST_IT)return this.getTotalCount();let t=0,s=0;for(;s<this._items.length;)this.getItemByIndex(s).locked||t++,s++;return t}getLastItem(){return this._items.length?this.getItemByIndex(this._items.length-1):null}unlockAllItems(){const t=[...this._items];let s=0;for(;s<t.length;){const n=t[s];if(n.locked){const r=n.clone();r.locked=!1,t[s]=r}s++}this._items=t}lockItemIds(t){const s=[...this._items];let n=0,r=!1;for(;n<s.length;){const a=s[n],l=t.indexOf(a.ref)>=0;if(a.locked!==l){r=!0;const c=a.clone();c.locked=l,s[n]=c}n++}return this._items=s,r}setName(){const t=this.getLastItem();if(!t){this._name="";return}let s="";switch(this._category){case de.POSTER:s="poster_"+t.stuffData.getLegacyString()+"_name";break;case de.TRAX_SONG:this._name="SONG_NAME";return;default:this.isWallItem?s="wallItem.name."+t.type:s="roomItem.name."+t.type}this._name=d(s)}setDescription(){this._description=""}setIcon(){if(this._iconUrl)return;let t=null;this.isWallItem?t=this._roomEngine.getFurnitureWallIconUrl(this._type,this._stuffData.getLegacyString()):t=this._roomEngine.getFurnitureFloorIconUrl(this._type),t&&(this._iconUrl=t)}get type(){return this._type}get category(){return this._category}get stuffData(){return this._stuffData}get extra(){return this._extra}get iconUrl(){return this._iconUrl}get name(){return this._name}get description(){return this._description}get hasUnseenItems(){return this._hasUnseenItems}set hasUnseenItems(t){this._hasUnseenItems=t}get locked(){return this._locked}set locked(t){this._locked=t}get selected(){return this._selected}set selected(t){this._selected=t}get isWallItem(){const t=this.getItemByIndex(0);return t?t.isWallItem:!1}get isGroupable(){const t=this.getItemByIndex(0);return t?t.isGroupable:!1}get isSellable(){const t=this.getItemByIndex(0);return t?t.sellable:!1}get items(){return this._items}set items(t){this._items=t}}const Oc=(o,t,s,n=NaN)=>new Rc(o,t,H(),s,n),WC=(o,t,s)=>{const n=[];for(const a of o)a.type===t.type&&n.push(a);for(const a of n)if(a.getItemById(t.id))return a;const r=Oc(t.type,t.category,t.stuffData,t.extra);return r.push(t),s?(r.hasUnseenItems=!0,o.unshift(r)):o.push(r),r},qC=(o,t,s)=>{let n=null;for(const r of o)if(r.type===t.type&&r.isWallItem===t.isWallItem&&r.isGroupable)if(t.category===de.POSTER){if(r.stuffData.getLegacyString()===t.stuffData.getLegacyString()){n=r;break}}else if(t.category===de.GUILD_FURNI){if(t.stuffData.compare(r.stuffData)){n=r;break}}else{n=r;break}if(n){if(n.push(t),s){n.hasUnseenItems=!0;const r=o.indexOf(n);r>=0&&o.splice(r,1),o.unshift(n)}return n}return n=Oc(t.type,t.category,t.stuffData,t.extra),n.push(t),s?(n.hasUnseenItems=!0,o.unshift(n)):o.push(n),n},yu=(o,t,s)=>{t.isGroupable?qC(o,t,s):WC(o,t,s)},zC=(o,t,s,n)=>{if(t===1)return o;n[s]=o;for(const a of n)if(!a)return null;const r=new Map;for(const a of n){for(const[l,c]of a)r.set(l,c);a.clear()}return n=null,r},YC=o=>{const t=[];for(const s of o){let n=s.getTotalCount();s.category===de.POST_IT&&(n=1);let r=0;for(;r<n;)t.push(s.getItemByIndex(r).id),r++}return t};let rh=!1,ah=-1;const $C=()=>rh,ui=o=>rh=o,ma=()=>ah,Xo=o=>ah=o,ti=()=>{ma()!==-1&&(H().cancelRoomObjectPlacement(),Xo(-1),ui(!1))},ec=(o,t=!1)=>{const s=o.petData;if(!s)return!1;const n=Lr().getSession(1);return!n||!n.isRoomOwner&&!n.allowPets?!1:(Z("inventory/hide"),H().processRoomObjectPlacement(Wa.INVENTORY,-s.id,Q.UNIT,gt.PET,s.figureData.figuredata)&&(Xo(s.id),ui(!0)),!0)},ha=(o,t=!1)=>{if(!o||!o.getUnlockedCount())return!1;const s=o.getLastItem();if(!s)return!1;if(s.category===de.FLOOR||s.category===de.WALL_PAPER||s.category===de.LANDSCAPE)return t||D(new Ji(s.id)),!1;{Z("inventory/hide");let n=0,r=!1;s.isWallItem?n=Q.WALL:n=Q.FLOOR,s.category===de.POSTER?r=H().processRoomObjectPlacement(Wa.INVENTORY,s.id,n,s.type,s.stuffData.getLegacyString()):r=H().processRoomObjectPlacement(Wa.INVENTORY,s.id,n,s.type,s.extra.toString(),s.stuffData),r&&(Xo(s.ref),ui(!0))}return!0},tc=(o,t=!1)=>{const s=o.botData;if(!s)return!1;const n=Lr().getSession(1);return!n||!n.isRoomOwner?!1:(Z("inventory/hide"),H().processRoomObjectPlacement(Wa.INVENTORY,-s.id,Q.UNIT,gt.RENTABLE_BOT,s.figure)&&(Xo(s.id),ui(!0)),!0)},Zn=class Zn{};Zn.FURNI=1,Zn.RENTABLE=2,Zn.PET=3,Zn.BADGE=4,Zn.BOT=5,Zn.GAMES=6;let at=Zn;const KC=o=>o.map(t=>t.petData.id),ih=(o,t,s=!0)=>{const n={petData:o};return s?t.unshift(n):t.push(n),n},oh=(o,t)=>{let s=0;for(;s<t.length;){const n=t[s];if(n&&n.petData.id===o)return ma()===n.petData.id&&(ti(),Z("inventory/open")),t.splice(s,1),n;s++}return null},XC=(o,t,s)=>{const n=KC(o),r=[],a=[];for(const l of t.keys())n.indexOf(l)===-1&&r.push(l);for(const l of n)!t.get(l)&&a.push(l);n.length;for(const l of a)oh(l,o);for(const l of r){const c=t.get(l);c&&ih(c,o,s(at.PET,c.id))}return o},QC=(o,t,s,n)=>{if(t===1)return o;n[s]=o;for(const a of n)if(!a)return null;const r=new Map;for(const a of n){for(const[l,c]of a)r.set(l,c);a.clear()}return n=null,r},Gn=class Gn{};Gn.TRADING_STATE_READY=0,Gn.TRADING_STATE_RUNNING=1,Gn.TRADING_STATE_COUNTDOWN=2,Gn.TRADING_STATE_CONFIRMING=3,Gn.TRADING_STATE_CONFIRMED=4,Gn.TRADING_STATE_COMPLETED=5,Gn.TRADING_STATE_CANCELLED=6;let yt=Gn;class Ru{constructor(t=-1,s="",n=new qa,r=0,a=0,l=!1,c=!1){this.userId=t,this.userName=s,this.userItems=n,this.itemCount=r,this.creditsCount=a,this.accepts=l,this.canTrade=c}}const Ys=class Ys{};Ys.ALERT_SCAM=0,Ys.HOTEL_TRADING_DISABLED=1,Ys.YOU_NOT_ALLOWED=2,Ys.THEY_NOT_ALLOWED=4,Ys.ROOM_DISABLED=6,Ys.YOU_OPEN=7,Ys.THEY_OPEN=8,Ys.ERROR_WHILE_COMMIT=9,Ys.THEY_CANCELLED=10;let ms=Ys;const Ou=o=>{var t;return((t=G().getWallItemData(o))==null?void 0:t.isExternalImage)||!1},ku=o=>{const t=new qa;if(o.length)for(const n of o){const r=n.spriteId,a=n.category;let l=n.furniType+r;(!n.isGroupable||Ou(r))&&(l="itemid"+n.itemId),n.category===de.POSTER?l=n.itemId+"poster"+n.stuffData.getLegacyString():n.category===de.GUILD_FURNI&&(l="");let c=n.isGroupable&&!Ou(n.spriteId)?t.getValue(l):null;c||(c=Oc(r,a,n.stuffData),t.add(l,c)),c.push(new ei(n))}return t},JC=(o,t)=>{let s=o.toString();if(!(t instanceof li))return s;let n=1;for(;n<5;)s=s+(","+t.getValue(n)),n++;return s};class Zi{static getProductImageUrl(t,s,n){let r=null;switch(t){case Ca.S:r=H().getFurnitureFloorIconUrl(s);break;case Ca.I:this.getProductCategory(Ca.I,s)===1&&(r=H().getFurnitureWallIconUrl(s,n));break}return r}static getProductCategory(t,s){if(t===Ca.S)return 1;if(t===Ca.I){if(s===3001)return de.WALL_PAPER;if(s===3002)return de.FLOOR;if(s===4057)return de.LANDSCAPE}return 1}}class mo{static getRandomNumber(t){return Math.floor(Math.random()*t)}static getRandomElement(t){return t[this.getRandomNumber(t.length)]}static getRandomElements(t,s){const n=new Array(s);let r=t.length;const a=new Array(r);for(;s--;){var l=this.getRandomNumber(r);n[s]=t[l in a?a[l]:l],a[l]=--r in a?a[r]:r}return n}}const $=new Map;$.set("r","red");$.set("b","blue");$.set("g","green");$.set("y","yellow");$.set("w","white");$.set("o","orange");$.set("c","cyan");$.set("br","brown");$.set("pr","purple");$.set("pk","pink");$.set("black","black");$.set("red","red");$.set("orangered","orangered");$.set("orange","orange");$.set("yellow","yellow");$.set("yellowgreen","yellowgreen");$.set("green","green");$.set("seagreen","seagreen");$.set("teal","teal");$.set("blue","blue");$.set("darkblue","darkblue");$.set("indigo","indigo");$.set("purple","purple");$.set("violet","violet");$.set("brown","brown");$.set("burlywood","burlywood");$.set("rosybrown","rosybrown");$.set("saddlebrown","saddlebrown");$.set("maroon","maroon");$.set("firebrick","firebrick");$.set("darkred","darkred");$.set("chocolate","chocolate");$.set("sienna","sienna");$.set("peru","peru");$.set("darkorange","darkorange");$.set("orange","orange");$.set("orangered","orangered");$.set("tomato","tomato");$.set("coral","coral");$.set("darkolivegreen","darkolivegreen");$.set("olive","olive");$.set("olivedrab","olivedrab");$.set("greenyellow","greenyellow");$.set("yellowgreen","yellowgreen");$.set("darkgreen","darkgreen");$.set("limegreen","limegreen");$.set("lime","lime");$.set("lawngreen","lawngreen");$.set("palegreen","palegreen");$.set("springgreen","springgreen");$.set("mediumseagreen","mediumseagreen");$.set("mediumaquamarine","mediumaquamarine");$.set("aquamarine","aquamarine");$.set("turquoise","turquoise");$.set("mediumturquoise","mediumturquoise");$.set("darkturquoise","darkturquoise");$.set("aqua","aqua");$.set("cyan","cyan");$.set("lightcyan","lightcyan");$.set("paleturquoise","paleturquoise");$.set("azure","azure");$.set("lightblue","lightblue");$.set("powderblue","powderblue");$.set("deepskyblue","deepskyblue");$.set("skyblue","skyblue");$.set("lightskyblue","lightskyblue");$.set("steelblue","steelblue");$.set("royalblue","royalblue");$.set("mediumslateblue","mediumslateblue");$.set("slateblue","slateblue");$.set("darkslateblue","darkslateblue");$.set("mediumpurple","mediumpurple");$.set("blueviolet","blueviolet");$.set("darkviolet","darkviolet");$.set("darkmagenta","darkmagenta");$.set("mediumvioletred","mediumvioletred");$.set("violetred","violetred");$.set("orchid","orchid");$.set("darkorchid","darkorchid");$.set("mediumorchid","mediumorchid");$.set("thistle","thistle");$.set("plum","plum");$.set("purple","purple");$.set("darkgrey","darkgrey");$.set("dimgray","dimgray");$.set("lightgrey","lightgrey");$.set("grey","grey");$.set("slategrey","slategrey");$.set("lightslategrey","lightslategrey");$.set("whitesmoke","whitesmoke");$.set("white","white");$.set("snow","snow");$.set("mistyrose","mistyrose");$.set("seashell","seashell");$.set("antiquewhite","antiquewhite");$.set("linen","linen");$.set("oldlace","oldlace");$.set("papayawhip","papayawhip");$.set("blanchedalmond","blanchedalmond");$.set("moccasin","moccasin");$.set("wheat","wheat");$.set("navajowhite","navajowhite");$.set("burlywood","burlywood");$.set("tan","tan");$.set("rosybrown","rosybrown");$.set("sandybrown","sandybrown");$.set("goldenrod","goldenrod");$.set("darkgoldenrod","darkgoldenrod");$.set("peru","peru");$.set("chocolate","chocolate");$.set("saddlebrown","saddlebrown");$.set("sienna","sienna");$.set("brown","brown");const ZC=o=>o.replace(/([\u00A0-\u9999<>&])(.|$)/g,(t,s,n)=>s!=="&"||n!=="#"?(/[\u00A0-\u9999<>&]/.test(n)&&(n="&#"+n.charCodeAt(0)+";"),"&#"+s.charCodeAt(0)+";"+n):t),ev=o=>{let t="";o=ZC(o),o=o.replace(/\[tag\](.*?)\[\/tag\]/g,'<span class="chat-tag"><b>$1</b></span>'),K("youtube.publish.disabled",!1)||(o=o.replace(/(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?.*v=|shorts\/)?([a-zA-Z0-9_-]{11})/g,`
|
||
<div>
|
||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEQElEQVR4nO2X7WscRRzHt+AbfeEfICK+VVTwjWhVUnI7l8SkDY3Wu5ltfbiZXBNbq8ldiZEkVbHSIAEjCtUWNLXFaNWQElOUomKwD0bxoVLtk3I+oPhUjbvZ5x2Zmb29DUlaa3fTO9gvDOzMbx5+n535zYMkJUqUKFFNKoVIK0CEyogcKZfJCO/2y3qkaldLPn+ZDLEGELYbFeVyVgYgLnGADL5GqgUBRCaYwwC1NzUq5EruPCQnpVpRGpG87/RgGhJFLB88xGzyuvxVAOGtAOIXmU2SpGWsHKzNXcfaySh/Pe9DyeVSkNxzUQDkbO4KgIjH4kBGZLuAaa/j5ZD8LmZHJBniAd4Gtj8kynCXyBNVRuRX6WIJIDLN4gBA/CNzuq5uyyWhmRllQL69VJUAMsQDlT+NR3ynHhXLKVfkkJCcAZDoVQmQyuZuLAOkYPudNQcgSdIysZ0SWq/cf20tAkgyJDMJQHXNAN7ox8WTN6/pulRG2AAI/xZeQjLEj7ATG0BsVd0Sqs/iG2REHO64f70ACL/BbKEtVpUh+VvUqzIAJqDgewEip5lNRmQfO9xYeUNm/dUAkZ8AwidkmL+tKoI40VLJeGZbv97dWdIIVLVcRtOUVlPNrrR4urvZVlvrvSClb6Fq6iaR2HfYxur67TSl1eR9Eaiyvo1nB/ticV7vL04HDsWc9P5i8EiKRObw4GNL5bzqJzbbkQHo3R0/sE7dE99Qb2ZmXnK++HRRR6zxvbyO9fru85uFro7vIwPQcFZlnXq//EwXkvvtqUUdsQ/s53Xst8fOC0DLZdToANa1Gfyv9DxIjSd6qVv6Tjh+/Gue14sPRA+wdrURGYCaXWmHO3e+/Iw75Rz8UEx3X4Far45Qvb9AtUwz/7Z27ZwLMPUeNV9+gVqju6i2GlTW+uDj1Jl6n9ofHOD9BONkW+zoANrS7tkA7Mlx4eT+fVTvWi/WlefOAQjL+Ui0M3c8P8+mFzeIcdrSbnQALSu8CwVwjx0N6nnqP9zm/fmHaPfOBHVPnwz64OO0rPCiA2hYTi8UgMWA3vuwb/Ooesftlb9e6KTWm6Oiz+lDYpyG5TQ6gPCpGhVAc10A4GkapabpAxyOASCCJXQ2gLCcQ1MxLKEIgngOAKVzAPTuDrZtUn3zRjpLYAxBfI5t9H8BhGOguIFab/kx8PHB6LfR8kF2LgD31HG+2ywE4Bz9nFp7XhI22xK70F9neJYFsHvsK2GaHI/+ICtfJRYDsF7ZWVnEtr0gQFjMWd5u7555Nr1nU/RXifJlrpzM54aoPTFGjaGnxGB3NVL73Ul+cZvdRLjNGntNnLTbtvC8uX2Y/2m258/et8bfaW6l1sgODuR8coQaW/viuczV/HWaiT0ylsp5fWDzYSkOseeeXgg9KeEqq/KkbHL++5OyyQmelHCVFTwpC50lY/jp3licT5QoUSIpDv0L7jL5ksuHFDUAAAAASUVORK5CYII="
|
||
alt="YouTube Icon" style="vertical-align: middle; margin-right: 5px;"><strong>Click on open video to see the YouTube video</strong>
|
||
</div><center><a href="https://youtu.be/$1" target="_blank" style="background-color: red; color: white; padding: 5px 10px; border-radius: 5px; text-decoration: none;">Open Video</a></center>
|
||
`));const s=o.match(/@[a-zA-Z]+@/);if(s){const n=s[0].toString(),r=n.substr(1,n.length-2),a=o.replace(n,"");$.has(r)?t=`<span style="color: ${$.get(r)}">${a}</span>`:t=a}else t=o;return t},kc=(o,t)=>window.localStorage.setItem(o,JSON.stringify(t)),er=class er{};er.CAMERA_SHUTTER="camera_shutter",er.CREDITS="credits",er.DUCKETS="duckets",er.MESSENGER_NEW_THREAD="messenger_new_thread",er.MESSENGER_MESSAGE_RECEIVED="messenger_message_received",er.MODTOOLS_NEW_TICKET="modtools_new_ticket";let Sn=er;function tv(o){const t=o.parts;let s=0;for(const n of t)s=Math.max(s,n.colorLayerIndex);return s}function sv(o,t){return t=t.filter(s=>o.indexOf(s)===-1),[...o,...mo.getRandomElements(t,mo.getRandomNumber(t.length)+1)]}function nv(o,t,s=0,n=[]){if(!o)return null;const r=o.partSets.getValues().filter(a=>!a.isSelectable||a.gender!=="U"&&a.gender!==t||a.clubLevel>s||a.isSellable&&n.indexOf(a.id)===-1?null:a);return!r||!r.length?null:mo.getRandomElement(r)}function rv(o,t,s=0){if(!o)return[];const n=o.colors.getValues().filter(r=>!r.isSelectable||r.clubLevel>s?null:r);return!n||!n.length?null:mo.getRandomElements(n,tv(t))}function av(o,t,s=0,n=[],r=[]){const a=St().structure,l=new Mg(""),c=sv(a.getMandatorySetTypeIds(t,s),Se.SET_TYPES);for(const m of r){const h=o.getPartSetId(m),u=o.getColorIds(m);l.updatePart(m,h,u)}for(const m of c){if(l.hasPartType(m))continue;const h=a.figureData.getSetType(m),u=nv(h,t,s,n);if(!u)continue;let g=[];u.isColorable&&(g=rv(a.figureData.getPalette(h.paletteID),u,s).map(f=>f.id)),l.updatePart(h.type,u.id,g)}return l.getFigureString()}class iv extends $o{init(){super.init(),this.addCategory(Se.HAIR),this.addCategory(Se.HAT),this.addCategory(Se.HEAD_ACCESSORIES),this.addCategory(Se.EYE_ACCESSORIES),this.addCategory(Se.FACE_ACCESSORIES),this._isInitalized=!0}get name(){return Us.HEAD}}class Au extends $o{init(){super.init(),this.addCategory(Se.TROUSERS),this.addCategory(Se.SHOES),this.addCategory(Se.TROUSER_ACCESSORIES),this._isInitalized=!0}get name(){return Us.LEGS}}class Du extends $o{init(){super.init(),this.addCategory(Se.SHIRT),this.addCategory(Se.CHEST_PRINTS),this.addCategory(Se.JACKET),this.addCategory(Se.CHEST_ACCESSORIES),this._isInitalized=!0}get name(){return Us.TORSO}}const wo=class wo{};wo.COLORMATRIX="colormatrix",wo.COMPOSITE="composite";let si=wo;class ov{constructor(t,s){this.texture=t,this.imageUrl=s}}class lv{constructor(t,s){this.effectName=t,this.thumbnailUrl=s}}class cv{constructor(t,s,n){this._productName=t,this._customImage=s,this._furnitureClassName=n}get productName(){return this._productName}get customImage(){return this._customImage}get furnitureClassName(){return this._furnitureClassName}}const Zr=class Zr{};Zr.STATE_UNLOCKED=1,Zr.STATE_LOCKED_AVAILABLE=2,Zr.STATE_LOCKED_EXPIRED=3,Zr.STATE_LOCKED_FUTURE=4;let rs=Zr;const Ra=class Ra{};Ra.TYPE_CHAT=1,Ra.TYPE_ROOM_INFO=2,Ra.TYPE_IM=3;let tn=Ra;const lh=()=>{const o=new Date;return`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}`},Pu=(o=0)=>{const t=o?new Date(Date.now()-o*1e3):new Date;return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`},ch=o=>{if(!o||!o.length)return null;const t=o.split("/"),s=t[0],n=t[1],r=parseInt(t[2]);return{username:s,figure:n,userId:r}},ea=class ea{constructor(){this.id=-1,this.name=null,this.gender=0,this.online=!1,this.followingAllowed=!1,this.figure=null,this.categoryId=0,this.motto=null,this.realName=null,this.lastAccess=null,this.persistedMessageUser=!1,this.vipMember=!1,this.pocketHabboUser=!1,this.relationshipStatus=-1,this.unread=0}populate(t){this.id=t.id,this.name=t.name,this.gender=t.gender,this.online=t.online,this.followingAllowed=t.followingAllowed,this.figure=t.figure,this.categoryId=t.categoryId,this.motto=t.motto,this.realName=t.realName,this.lastAccess=t.lastAccess,this.persistedMessageUser=t.persistedMessageUser,this.vipMember=t.vipMember,this.pocketHabboUser=t.pocketHabboUser,this.relationshipStatus=t.relationshipStatus}};ea.RELATIONSHIP_NONE=0,ea.RELATIONSHIP_HEART=1,ea.RELATIONSHIP_SMILE=2,ea.RELATIONSHIP_BOBBA=3;let hs=ea;const To=class To{};To.GROUP_CHAT=0,To.PRIVATE_CHAT=1;let wr=To;const Oa=class Oa{};Oa.HIDDEN=0,Oa.SHOW=1,Oa.UNREAD=2;let In=Oa;class Lu{populate(t){return t?(this._id=t.requestId,this._name=t.requesterName,this._figureString=t.figureString,this._requesterUserId=t.requesterUserId,!0):!1}get id(){return this._id}get name(){return this._name}get requesterUserId(){return this._requesterUserId}get figureString(){return this._figureString}}class uv{constructor(t=0,s=0,n=0,r=[]){this.userFriendLimit=t,this.normalFriendLimit=s,this.extendedFriendLimit=n,this.categories=r}}const ta=class ta{constructor(t,s,n=0,r=null,a=0){this._type=a,this._senderId=t,this._message=s,this._secondsSinceSent=n,this._extraData=r,this._date=new Date}get type(){return this._type}get senderId(){return this._senderId}get message(){return this._message}get secondsSinceSent(){return this._secondsSinceSent}get extraData(){return this._extraData}get date(){return this._date}};ta.CHAT=0,ta.ROOM_INVITE=1,ta.STATUS_NOTIFICATION=2,ta.SECURITY_NOTIFICATION=3;let Hn=ta;class dv{constructor(t,s=wr.PRIVATE_CHAT){this._userId=t,this._chats=[],this._type=s}addChat(t){this._chats.push(t)}get userId(){return this._userId}get chats(){return this._chats}get type(){return this._type}set type(t){this._type=t}}const ka=class ka{constructor(t){this._threadId=++ka.THREAD_ID,this._participant=t,this._groups=[],this._lastUpdated=new Date,this._unreadCount=0}addMessage(t,s,n=0,r=null,a=0){const l=t<0&&r,c=l?ch(r).userId:t,m=this.getLastGroup(c);if(!m)return;l&&(m.type=wr.GROUP_CHAT);const h=new Hn(t,s,n,r,a);return m.addChat(h),this._lastUpdated=new Date,this._unreadCount++,h}getLastGroup(t){let s=this._groups[this._groups.length-1];return s&&s.userId===t||(s=new dv(t),this._groups.push(s)),s}setRead(){this._unreadCount=0}get threadId(){return this._threadId}get participant(){return this._participant}get groups(){return this._groups}get lastUpdated(){return this._lastUpdated}get unreadCount(){return this._unreadCount}get unread(){return this._unreadCount>0}};ka.MESSAGE_RECEIVED="MT_MESSAGE_RECEIVED",ka.THREAD_ID=0;let sc=ka;function Qo(o=0){Z(o===0?"friends-messenger/toggle":`friends-messenger/${o}`)}const mv=()=>hm.RENDERER_VERSION,uh=()=>"2.1.1";function di(o){D(new za(o,!0))}function dh(o){Z(`groups/manage/${o}`)}function Mu(o,t){Z(t?`group-members/${o}/${t}`:`group-members/${o}`)}const sa=class sa{constructor(t,s,n,r){this.type=t,this.key=s||0,this.color=n||0,this.position=r||4}get code(){return this.key===0&&this.type!==sa.BASE?null:sa.getCode(this.type,this.key,this.color,this.position)}static getCode(t,s,n,r){return t+(s<10?"0":"")+s+(n<10?"0":"")+n+r}};sa.BASE="b",sa.SYMBOL="s";let ss=sa;const Aa=class Aa{};Aa.NOT_MEMBER=0,Aa.MEMBER=1,Aa.REQUEST_PENDING=2;let Pt=Aa;const Da=class Da{};Da.REGULAR=0,Da.EXCLUSIVE=1,Da.PRIVATE=2;let Ts=Da;const hv=o=>{D(o.favourite?new Ug(o.groupId):new Fg(o.groupId))},Ac=o=>D(new Vg(o)),Tt=class Tt{};Tt.NONE="NONE",Tt.ERROR="ERROR",Tt.REJECTED="REJECTED",Tt.USER_CREATE="USER_CREATE",Tt.USER_PENDING="USER_PENDING",Tt.USER_ONGOING="USER_ONGOING",Tt.USER_FEEDBACK="USER_FEEDBACK",Tt.USER_NO_HELPERS="USER_NO_HELPERS",Tt.USER_SOMETHING_WRONG="USER_SOMETHING_WRONG",Tt.USER_THANKS="USER_THANKS",Tt.USER_GUIDE_DISCONNECTED="USER_GUIDE_DISCONNECTED",Tt.GUIDE_TOOL_MENU="GUIDE_TOOL_MENU",Tt.GUIDE_ACCEPT="GUIDE_ACCEPT",Tt.GUIDE_ONGOING="GUIDE_ONGOING",Tt.GUIDE_CLOSED="GUIDE_CLOSED",Tt.GUARDIAN_CHAT_REVIEW_ACCEPT="GUARDIAN_CHAT_REVIEW_ACCEPT",Tt.GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS="GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS",Tt.GUARDIAN_CHAT_REVIEW_VOTE="GUARDIAN_CHAT_REVIEW_VOTE",Tt.GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS="GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS",Tt.GUARDIAN_CHAT_REVIEW_RESULTS="GUARDIAN_CHAT_REVIEW_RESULTS";let De=Tt;class Uu{constructor(t,s){this._message=t,this._roomId=s}get message(){return this._message}get roomId(){return this._roomId}}class Fu{constructor(t){this._userId=t,this._messages=[]}addChat(t){this._messages.push(t)}get userId(){return this._userId}get messages(){return this._messages}}const Pa=class Pa{};Pa.ACTIVE="active",Pa.NONE="none",Pa.EXPIRED="expired";let pn=Pa;const gv="HC1",fv=["ACH_VipHC1","ACH_VipHC2","ACH_VipHC3","ACH_VipHC4","ACH_VipHC5","HC1","HC2","HC3","HC4","HC5"],pv=o=>{let t=null;return fv.forEach(s=>o.indexOf(s)>-1&&(t=s)),t||gv},yo=class yo{};yo.TOO_MANY_PENDING_CALLS_CODE=1,yo.HAS_ABUSIVE_CALL_CODE=2;let ho=yo;const xv=o=>o===1?"useless":o===2?"abusive":"resolved",Ir=class Ir{};Ir.SELECT_USER=0,Ir.SELECT_CHATS=1,Ir.SELECT_TOPICS=2,Ir.INPUT_REPORT_MESSAGE=3,Ir.REPORT_SUMMARY=4;let Qt=Ir;const mn=class mn{};mn.EMERGENCY=1,mn.GUIDE=2,mn.IM=3,mn.ROOM=4,mn.BULLY=6,mn.THREAD=7,mn.MESSAGE=8,mn.PHOTO=9;let rt=mn;const jv=o=>{switch(o){case 1:case 2:return"Normal";case 3:return"Automatic";case 4:return"Automatic IM";case 5:return"Guide System";case 6:return"IM";case 7:return"Room";case 8:return"Panic";case 9:return"Guardian";case 10:return"Automatic Helper";case 11:return"Discussion";case 12:return"Selfie";case 14:return"Photo";case 15:return"Ambassador"}return"Unknown"},tr=class tr{constructor(t,s,n,r,a){this._actionId=t,this._name=s,this._actionType=n,this._sanctionTypeId=r,this._actionLengthHours=a}get actionId(){return this._actionId}get name(){return this._name}get actionType(){return this._actionType}get sanctionTypeId(){return this._sanctionTypeId}get actionLengthHours(){return this._actionLengthHours}};tr.ALERT=1,tr.MUTE=2,tr.BAN=3,tr.KICK=4,tr.TRADE_LOCK=5,tr.MESSAGE=6;let Ge=tr;const $s=class $s{};$s.NONE=0,$s.START_DOORBELL=1,$s.START_PASSWORD=2,$s.STATE_PENDING_SERVER=3,$s.UPDATE_STATE=4,$s.STATE_WAITING=5,$s.STATE_NO_ANSWER=6,$s.STATE_WRONG_PASSWORD=7,$s.STATE_ACCEPTED=8;let We=$s;const La=class La{};La.LIST=0,La.THUMBNAILS=1,La.FORCED_THUMBNAILS=2;let Xn=La;const Iv=()=>{const o=[];for(let t=10;t<=100;t=t+10)o.push(t);return o},Vu=Iv(),Hr=[{name:"anything",query:null},{name:"room.name",query:"roomname"},{name:"owner",query:"owner"},{name:"tag",query:"tag"},{name:"group",query:"group"}];function os(o){D(new no(o,!1,!0))}const Bn=class Bn{};Bn.DEFAULT="default",Bn.MOTD="motd",Bn.MODERATION="moderation",Bn.EVENT="event",Bn.NITRO="nitro",Bn.SEARCH="search",Bn.ALERT="alert";let je=Bn;const Ma=class Ma{constructor(t,s=je.DEFAULT,n=null,r=null,a=null,l=null){Ma.ITEM_ID+=1,this._id=Ma.ITEM_ID,this._messages=t,this._alertType=s,this._clickUrl=n,this._clickUrlText=r,this._title=a,this._imageUrl=l}get id(){return this._id}get messages(){return this._messages}set alertType(t){this._alertType=t}get alertType(){return this._alertType}get clickUrl(){return this._clickUrl}get clickUrlText(){return this._clickUrlText}get title(){return this._title}get imageUrl(){return this._imageUrl}};Ma.ITEM_ID=-1;let go=Ma;const Ft=class Ft{};Ft.FRIENDOFFLINE="friendoffline",Ft.FRIENDONLINE="friendonline",Ft.THIRDPARTYFRIENDOFFLINE="thirdpartyfriendoffline",Ft.THIRDPARTYFRIENDONLINE="thirdpartyfriendonline",Ft.ACHIEVEMENT="achievement",Ft.BADGE_RECEIVED="badge_received",Ft.INFO="info",Ft.RECYCLEROK="recyclerok",Ft.RESPECT="respect",Ft.CLUB="club",Ft.SOUNDMACHINE="soundmachine",Ft.PETLEVEL="petlevel",Ft.CLUBGIFT="clubgift",Ft.BUYFURNI="buyfurni",Ft.VIP="vip",Ft.ROOMMESSAGESPOSTED="roommessagesposted";let ns=Ft;const Ua=class Ua{constructor(t,s=ns.INFO,n=null,r=null){Ua.ITEM_ID+=1,this._id=Ua.ITEM_ID,this._message=t,this._notificationType=s,this._iconUrl=n,this._linkUrl=r}get id(){return this._id}get message(){return this._message}get notificationType(){return this._notificationType}get iconUrl(){return this._iconUrl}get linkUrl(){return this._linkUrl}};Ua.ITEM_ID=-1;let nc=Ua;const Fa=class Fa{constructor(t,s,n,r,a,l,c){Fa.ITEM_ID+=1,this._id=Fa.ITEM_ID,this._confirmType=t,this._message=s,this._onConfirm=n,this._onCancel=r,this._confirmText=a,this._cancelText=l,this._title=c}get id(){return this._id}get confirmType(){return this._confirmType}get message(){return this._message}get onConfirm(){return this._onConfirm}get onCancel(){return this._onCancel}get confirmText(){return this._confirmText}get cancelText(){return this._cancelText}get title(){return this._title}};Fa.ITEM_ID=-1;let rc=Fa;class Dc{constructor(){this._credits=0,this._activityPoints=new Map,this._clubDays=0,this._clubPeriods=0,this._isVIP=!1,this._pastClubDays=0,this._pastVipDays=0,this._isExpiring=!1,this._minutesUntilExpiration=0,this._minutesSinceLastModified=0,this._lastUpdated=0}static from(t){const s=new Dc;return s._credits=t._credits,s._activityPoints=t._activityPoints,s._clubDays=t._clubDays,s._clubPeriods=t._clubPeriods,s._isVIP=t._isVIP,s._pastClubDays=t._pastClubDays,s._pastVipDays=t._pastVipDays,s._isExpiring=t._isExpiring,s._minutesUntilExpiration=t._minutesUntilExpiration,s._minutesSinceLastModified=t._minutesSinceLastModified,s._lastUpdated=t._lastUpdated,s}get credits(){return this._credits}set credits(t){this._lastUpdated=Ms(),this._credits=t}get activityPoints(){return this._activityPoints}set activityPoints(t){this._lastUpdated=Ms(),this._activityPoints=t}get clubDays(){return this._clubDays}set clubDays(t){this._lastUpdated=Ms(),this._clubDays=t}get clubPeriods(){return this._clubPeriods}set clubPeriods(t){this._lastUpdated=Ms(),this._clubPeriods=t}get hasClubLeft(){return this._clubDays>0||this._clubPeriods>0}get isVip(){return this._isVIP}set isVip(t){this._isVIP=t}get pastClubDays(){return this._pastClubDays}set pastClubDays(t){this._lastUpdated=Ms(),this._pastClubDays=t}get pastVipDays(){return this._pastVipDays}set pastVipDays(t){this._lastUpdated=Ms(),this._pastVipDays=t}get isExpiring(){return this._isExpiring}set isExpiring(t){this._isExpiring=t}get minutesUntilExpiration(){var t=(Ms()-this._lastUpdated)/6e4,s=this._minutesUntilExpiration-t;return s>0?s:0}set minutesUntilExpiration(t){this._lastUpdated=Ms(),this._minutesUntilExpiration=t}get minutesSinceLastModified(){return this._minutesSinceLastModified}set minutesSinceLastModified(t){this._lastUpdated=Ms(),this._minutesSinceLastModified=t}get lastUpdated(){return this._lastUpdated}get clubLevel(){return this.clubDays===0&&this.clubPeriods===0?Wt.NO_CLUB:this.isVip?Wt.VIP:Wt.CLUB}}class mi extends Rs{}const Va=class Va extends mi{constructor(t,s){super(t),this._id=-1,this._numQuestions=0,this._startMessage="",this._endMessage="",this._questionArray=null,this._pollType="",this._npsPoll=!1,this._id=s}get id(){return this._id}get summary(){return this._summary}set summary(t){this._summary=t}get headline(){return this._headline}set headline(t){this._headline=t}get numQuestions(){return this._numQuestions}set numQuestions(t){this._numQuestions=t}get startMessage(){return this._startMessage}set startMessage(t){this._startMessage=t}get endMessage(){return this._endMessage}set endMessage(t){this._endMessage=t}get questionArray(){return this._questionArray}set questionArray(t){this._questionArray=t}get pollType(){return this._pollType}set pollType(t){this._pollType=t}get npsPoll(){return this._npsPoll}set npsPoll(t){this._npsPoll=t}};Va.OFFER="RWPUW_OFFER",Va.ERROR="RWPUW_ERROR",Va.CONTENT="RWPUW_CONTENT";let Qn=Va;const Ro=class Ro extends mi{constructor(t,s=0,n=0,r=0){super(t),this._hue=s,this._saturation=n,this._lightness=r}get hue(){return this._hue}get saturation(){return this._saturation}get lightness(){return this._lightness}};Ro.PREVIEW="RWUBCPE_PREVIEW",Ro.CLEAR_PREVIEW="RWUBCPE_CLEAR_PREVIEW";let rr=Ro;const na=class na extends mi{constructor(t,s){super(na.CHAT_INPUT_CONTENT),this._chatMode="",this._userName="",this._chatMode=t,this._userName=s}get chatMode(){return this._chatMode}get userName(){return this._userName}};na.CHAT_INPUT_CONTENT="RWUCICE_CHAT_INPUT_CONTENT",na.WHISPER="whisper",na.SHOUT="shout";let Tr=na;const Oo=class Oo extends mi{constructor(t,s,n,r,a,l,c){super(Oo.UPDATE_CHAT),this._objectId=t,this._category=s,this._botId=n,this._chat=r,this._automaticChat=a,this._chatDelay=l,this._mixSentences=c}get objectId(){return this._objectId}get category(){return this._category}get botId(){return this._botId}get chat(){return this._chat}get automaticChat(){return this._automaticChat}get chatDelay(){return this._chatDelay}get mixSentences(){return this._mixSentences}};Oo.UPDATE_CHAT="RWURBCE_UPDATE_CHAT";let fo=Oo;const Ls=class Ls extends mi{constructor(t,s,n,r){super(t),this._id=s,this._category=n,this._roomId=r}get id(){return this._id}get category(){return this._category}get roomId(){return this._roomId}};Ls.OBJECT_SELECTED="RWUROE_OBJECT_SELECTED",Ls.OBJECT_DESELECTED="RWUROE_OBJECT_DESELECTED",Ls.USER_REMOVED="RWUROE_USER_REMOVED",Ls.FURNI_REMOVED="RWUROE_FURNI_REMOVED",Ls.FURNI_ADDED="RWUROE_FURNI_ADDED",Ls.USER_ADDED="RWUROE_USER_ADDED",Ls.OBJECT_ROLL_OVER="RWUROE_OBJECT_ROLL_OVER",Ls.OBJECT_ROLL_OUT="RWUROE_OBJECT_ROLL_OUT",Ls.OBJECT_REQUEST_MANIPULATION="RWUROE_OBJECT_REQUEST_MANIPULATION",Ls.OBJECT_DOUBLE_CLICKED="RWUROE_OBJECT_DOUBLE_CLICKED";let Be=Ls;const Qc=class Qc{constructor(t){this.type=t,this.id=0,this.category=0,this.name="",this.description="",this.image=null,this.isWallItem=!1,this.isStickie=!1,this.isRoomOwner=!1,this.roomControllerLevel=0,this.isAnyRoomController=!1,this.expiration=-1,this.purchaseCatalogPageId=-1,this.purchaseOfferId=-1,this.extraParam="",this.isOwner=!1,this.stuffData=null,this.groupId=0,this.ownerId=0,this.ownerName="",this.usagePolicy=0,this.rentCatalogPageId=-1,this.rentOfferId=-1,this.purchaseCouldBeUsedForBuyout=!1,this.rentCouldBeUsedForBuyout=!1,this.availableForBuildersClub=!1,this.tileSizeX=1,this.tileSizeY=1}};Qc.FURNI="IFI_FURNI";let Rr=Qc;class mh{constructor(t,s,n,r,a,l=!1){this.roomIndex=t,this.category=s,this.id=n,this.name=r,this.userType=a,this.isFriend=l}}const Jc=class Jc{constructor(t){this.type=t,this.level=0,this.maximumLevel=0,this.experience=0,this.levelExperienceGoal=0,this.energy=0,this.maximumEnergy=0,this.happyness=0,this.maximumHappyness=0,this.respectsPetLeft=0,this.respect=0,this.age=0,this.name="",this.id=-1,this.image=null,this.petType=0,this.petBreed=0,this.petFigure="",this.posture="std",this.isOwner=!1,this.ownerId=-1,this.ownerName="",this.canRemovePet=!1,this.roomIndex=0,this.unknownRarityLevel=0,this.saddle=!1,this.rider=!1,this.breedable=!1,this.skillTresholds=[],this.publiclyRideable=0,this.fullyGrown=!1,this.dead=!1,this.rarityLevel=0,this.maximumTimeToLive=0,this.remainingTimeToLive=0,this.remainingGrowTime=0,this.publiclyBreedable=!1}};Jc.PET_INFO="IPI_PET_INFO";let Or=Jc;const Zc=class Zc{constructor(t){this.type=t,this.name="",this.motto="",this.webID=0,this.figure="",this.badges=[],this.carryItem=0,this.roomIndex=0,this.amIOwner=!1,this.amIAnyRoomController=!1,this.roomControllerLevel=0,this.ownerId=-1,this.ownerName="",this.botSkills=[]}};Zc.RENTABLE_BOT="IRBI_RENTABLE_BOT";let kr=Zc;const hn=class hn{constructor(t){this.type=t,this.name="",this.motto="",this.achievementScore=0,this.backgroundId=0,this.standId=0,this.overlayId=0,this.webID=0,this.xp=0,this.userType=-1,this.figure="",this.badges=[],this.groupId=0,this.groupName="",this.groupBadgeId="",this.carryItem=0,this.roomIndex=0,this.isSpectatorMode=!1,this.allowNameChange=!1,this.amIOwner=!1,this.amIAnyRoomController=!1,this.roomControllerLevel=0,this.canBeKicked=!1,this.canBeBanned=!1,this.canBeMuted=!1,this.respectLeft=0,this.isIgnored=!1,this.isGuildRoom=!1,this.canTrade=!1,this.canTradeReason=0,this.targetRoomControllerLevel=0,this.isAmbassador=!1}get isOwnUser(){return this.type===hn.OWN_USER}};hn.OWN_USER="IUI_OWN_USER",hn.PEER="IUI_PEER",hn.BOT="IUI_BOT",hn.TRADE_REASON_OK=0,hn.TRADE_REASON_SHUTDOWN=2,hn.TRADE_REASON_NO_TRADING=3,hn.DEFAULT_BOT_BADGE_ID="BOT";let It=hn;class Wr{static getObjectName(t,s){const n=Oe();let r=-1,a=null,l=0;switch(s){case Q.FLOOR:case Q.WALL:{const c=H().getRoomObject(n.roomId,t,s);if(!c)break;if(c.type.indexOf("poster")===0)a=d("${poster_"+parseInt(c.type.replace("poster",""))+"_name}");else{let m=null;const h=c.model.getValue(te.FURNITURE_TYPE_ID);if(s===Q.FLOOR?m=G().getFloorItemData(h):s===Q.WALL&&(m=G().getWallItemData(h)),!m)break;r=m.id,a=m.name}break}case Q.UNIT:{const c=n.userDataManager.getUserDataByIndex(t);if(!c)break;r=c.webID,a=c.name,l=c.type;break}}return!a||!a.length?null:new mh(t,s,r,a,l)}static getFurniInfo(t,s){const n=Oe(),r=new Rr(Rr.FURNI);r.id=t,r.category=s;const a=H().getRoomObject(n.roomId,t,s);if(!a)return;const l=a.model;l.getValue(Mn.INFOSTAND_EXTRA_PARAM)&&(r.extraParam=l.getValue(Mn.INFOSTAND_EXTRA_PARAM));const c=l.getValue(te.FURNITURE_DATA_FORMAT),m=gm.getData(c);m.initializeFromRoomObjectModel(l),r.stuffData=m;const h=a.type;if(h.indexOf("poster")===0){const x=parseInt(h.replace("poster",""));r.name=d("${poster_"+x+"_name}"),r.description=d("${poster_"+x+"_desc}")}else{const x=l.getValue(te.FURNITURE_TYPE_ID);let I=null;s===Q.FLOOR?I=G().getFloorItemData(x):s===Q.WALL&&(I=G().getWallItemData(x)),I&&(r.name=I.name,r.description=I.description,r.purchaseOfferId=I.purchaseOfferId,r.purchaseCouldBeUsedForBuyout=I.purchaseCouldBeUsedForBuyout,r.rentOfferId=I.rentOfferId,r.rentCouldBeUsedForBuyout=I.rentCouldBeUsedForBuyout,r.availableForBuildersClub=I.availableForBuildersClub,r.tileSizeX=I.tileSizeX,r.tileSizeY=I.tileSizeY)}h.indexOf("post_it")>-1&&(r.isStickie=!0);const u=l.getValue(te.FURNITURE_EXPIRY_TIME),g=l.getValue(te.FURNITURE_EXPIRTY_TIMESTAMP);r.expiration=u<0?u:Math.max(0,u-(Ms()-g)/1e3);let f=H().getRoomObjectImage(n.roomId,t,s,new At(180),64,null);(!f.data||f.data.width>140||f.data.height>200)&&(f=H().getRoomObjectImage(n.roomId,t,s,new At(180),1,null)),r.image=f.getImage(),r.isWallItem=s===Q.WALL,r.isRoomOwner=n.isRoomOwner,r.roomControllerLevel=n.controllerLevel,r.isAnyRoomController=G().isModerator,r.ownerId=l.getValue(te.FURNITURE_OWNER_ID),r.ownerName=l.getValue(te.FURNITURE_OWNER_NAME),r.usagePolicy=l.getValue(te.FURNITURE_USAGE_POLICY);const p=l.getValue(te.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID);return p!==0&&(r.groupId=p),Xt(a)&&(r.isOwner=!0),r}static getUserInfo(t,s){const n=Oe();let r=It.OWN_USER;s.webID!==G().userId&&(r=It.PEER);const a=new It(r);a.isSpectatorMode=n.isSpectator,a.name=s.name,a.motto=s.custom,a.backgroundId=s.background,a.standId=s.stand,a.overlayId=s.overlay,a.achievementScore=s.activityPoints,a.webID=s.webID,a.roomIndex=s.roomIndex,a.userType=gt.USER;const l=H().getRoomObject(n.roomId,s.roomIndex,t);if(l&&(a.carryItem=l.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r===It.OWN_USER&&(a.allowNameChange=G().canChangeName),a.amIOwner=n.isRoomOwner,a.isGuildRoom=n.isGuildRoom,a.roomControllerLevel=n.controllerLevel,a.amIAnyRoomController=G().isModerator,a.isAmbassador=G().isAmbassador,r===It.PEER){if(l){const h=l.model.getValue(te.FIGURE_FLAT_CONTROL);h!==null&&(a.targetRoomControllerLevel=h),a.canBeMuted=this.canBeMuted(a),a.canBeKicked=this.canBeKicked(a),a.canBeBanned=this.canBeBanned(a)}a.isIgnored=G().isUserIgnored(s.name),a.respectLeft=G().respectsLeft;const c=G().isSystemShutdown,m=n.tradeMode;if(c)a.canTrade=!1;else switch(m){case ml.ROOM_CONTROLLER_REQUIRED:{const h=a.roomControllerLevel!==Ke.NONE&&a.roomControllerLevel!==Ke.GUILD_MEMBER,u=a.targetRoomControllerLevel!==Ke.NONE&&a.targetRoomControllerLevel!==Ke.GUILD_MEMBER;a.canTrade=h||u;break}case ml.NO_TRADING:a.canTrade=!0;break;default:a.canTrade=!1;break}a.canTradeReason=It.TRADE_REASON_OK,c&&(a.canTradeReason=It.TRADE_REASON_SHUTDOWN),m!==ml.FREE_TRADING&&(a.canTradeReason=It.TRADE_REASON_NO_TRADING)}return a.groupId=s.groupId,a.groupBadgeId=G().getGroupBadge(a.groupId),a.groupName=s.groupName,a.badges=n.userDataManager.getUserBadges(s.webID),a.figure=s.figure,a}static getBotInfo(t,s){const n=Oe(),r=new It(It.BOT);r.name=s.name,r.motto=s.custom,r.webID=s.webID,r.roomIndex=s.roomIndex,r.userType=s.type;const a=H().getRoomObject(n.roomId,s.roomIndex,t);return a&&(r.carryItem=a.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r.amIOwner=n.isRoomOwner,r.isGuildRoom=n.isGuildRoom,r.roomControllerLevel=n.controllerLevel,r.amIAnyRoomController=G().isModerator,r.isAmbassador=G().isAmbassador,r.badges=[It.DEFAULT_BOT_BADGE_ID],r.figure=s.figure,r}static getRentableBotInfo(t,s){const n=Oe(),r=new kr(kr.RENTABLE_BOT);r.name=s.name,r.motto=s.custom,r.webID=s.webID,r.roomIndex=s.roomIndex,r.ownerId=s.ownerId,r.ownerName=s.ownerName,r.botSkills=s.botSkills;const a=H().getRoomObject(n.roomId,s.roomIndex,t);return a&&(r.carryItem=a.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r.amIOwner=n.isRoomOwner,r.roomControllerLevel=n.controllerLevel,r.amIAnyRoomController=G().isModerator,r.badges=[It.DEFAULT_BOT_BADGE_ID],r.figure=s.figure,r}static getPetInfo(t){const s=Oe(),n=s.userDataManager.getPetData(t.id);if(!n)return;const r=new da(n.figure);let a=null;r.typeId===Gt.MONSTERPLANT&&(t.level>=t.adultLevel?a="std":a="grw"+t.level);const l=t.ownerId===G().userId,c=new Or(Or.PET_INFO);return c.name=n.name,c.id=t.id,c.ownerId=t.ownerId,c.ownerName=t.ownerName,c.rarityLevel=t.rarityLevel,c.petType=r.typeId,c.petBreed=r.paletteId,c.petFigure=n.figure,c.posture=a,c.isOwner=l,c.roomIndex=n.roomIndex,c.level=t.level,c.maximumLevel=t.maximumLevel,c.experience=t.experience,c.levelExperienceGoal=t.levelExperienceGoal,c.energy=t.energy,c.maximumEnergy=t.maximumEnergy,c.happyness=t.happyness,c.maximumHappyness=t.maximumHappyness,c.respect=t.respect,c.respectsPetLeft=G().respectsPetLeft,c.age=t.age,c.saddle=t.saddle,c.rider=t.rider,c.breedable=t.breedable,c.fullyGrown=t.fullyGrown,c.dead=t.dead,c.rarityLevel=t.rarityLevel,c.skillTresholds=t.skillTresholds,c.canRemovePet=!1,c.publiclyRideable=t.publiclyRideable,c.maximumTimeToLive=t.maximumTimeToLive,c.remainingTimeToLive=t.remainingTimeToLive,c.remainingGrowTime=t.remainingGrowTime,c.publiclyBreedable=t.publiclyBreedable,(l||s.isRoomOwner||G().isModerator||s.controllerLevel>=Ke.GUEST)&&(c.canRemovePet=!0),c}static checkGuildSetting(t){return t.isGuildRoom?t.roomControllerLevel>=Ke.GUILD_ADMIN:t.roomControllerLevel>=Ke.GUEST}static isValidSetting(t,s){const n=Oe();if(!n.isPrivateRoom)return!1;const r=n.moderationSettings;let a=!1;return r&&(a=s(t,r)),a&&t.targetRoomControllerLevel<Ke.ROOM_OWNER}static canBeMuted(t){const s=(n,r)=>{switch(r.allowMute){case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=Ke.ROOM_OWNER}};return this.isValidSetting(t,s)}static canBeKicked(t){const s=(n,r)=>{switch(r.allowKick){case Qs.MODERATION_LEVEL_ALL:return!0;case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=Ke.ROOM_OWNER}};return this.isValidSetting(t,s)}static canBeBanned(t){const s=(n,r)=>{switch(r.allowBan){case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=Ke.ROOM_OWNER}};return this.isValidSetting(t,s)}}const zt=class zt{};zt.GENERIC_SKILL=0,zt.DRESS_UP=1,zt.SETUP_CHAT=2,zt.RANDOM_WALK=3,zt.DANCE=4,zt.CHANGE_BOT_NAME=5,zt.SERVE_BEVERAGE=6,zt.INCLIENT_LINK=7,zt.NUX_PROCEED=8,zt.CHANGE_BOT_MOTTO=9,zt.NUX_TAKE_TOUR=10,zt.NO_PICK_UP=12,zt.NAVIGATOR_SEARCH=14,zt.DONATE_TO_USER=24,zt.DONATE_TO_ALL=25;let Ye=zt;const ko=class ko{constructor(t=-1,s=-1,n=-1,r="",a="",l="",c=null,m=0,h=0,u=null,g=null,f=""){this.senderId=t,this.senderCategory=s,this.roomId=n,this.text=r,this.formattedText=a,this.username=l,this.location=c,this.type=m,this.styleId=h,this.imageUrl=u,this.color=g,this.chatColours=f,this.id=-1,this.width=0,this.height=0,this.elementRef=null,this.skipMovement=!1,this._top=0,this._left=0,this.id=++ko.BUBBLE_COUNTER,this.color=g,this.chatColours=f}get top(){return this._top}set top(t){this._top=t,this.elementRef&&(this.elementRef.style.top=this._top+"px")}get left(){return this._left}set left(t){this._left=t,this.elementRef&&(this.elementRef.style.left=this._left+"px")}};ko.BUBBLE_COUNTER=0;let ac=ko;const Ga=class Ga{};Ga.CHAT_DEFAULT=0,Ga.CHAT_WHISPER=1,Ga.CHAT_SHOUT=2;let xn=Ga;const bv=`
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
uniform mat3 projectionMatrix;
|
||
varying vec2 vTextureCoord;
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
vTextureCoord = aTextureCoord;
|
||
}`,Ev=`
|
||
varying vec2 vTextureCoord;
|
||
uniform sampler2D uSampler;
|
||
uniform vec3 lineColor;
|
||
uniform vec3 color;
|
||
uniform float time; // Added time uniform for animation
|
||
void main(void) {
|
||
vec4 currentColor = texture2D(uSampler, vTextureCoord);
|
||
vec3 colorLine = lineColor * currentColor.a;
|
||
vec3 colorOverlay = color * currentColor.a;
|
||
|
||
// Calculate fading factor using sine wave (oscillates between 0.5 and 1.0)
|
||
float fadeFactor = 0.75 + 0.25 * sin(time * 3.0); // Adjust speed with multiplier
|
||
|
||
if(currentColor.r == 0.0 && currentColor.g == 0.0 && currentColor.b == 0.0 && currentColor.a > 0.0) {
|
||
gl_FragColor = vec4(colorLine.r * fadeFactor, colorLine.g * fadeFactor, colorLine.b * fadeFactor, currentColor.a);
|
||
} else if(currentColor.a > 0.0) {
|
||
gl_FragColor = vec4(colorOverlay.r * fadeFactor, colorOverlay.g * fadeFactor, colorOverlay.b * fadeFactor, currentColor.a * 0.35);
|
||
}
|
||
}`;class Gu extends fm{constructor(t=[.7,.88,.95],s=[.29,.35,.39]){super(bv,Ev),this.uniforms.lineColor=new Float32Array(3),this.uniforms.color=new Float32Array(3),this.uniforms.time=0,this._time=0,this.lineColor=t,this.color=s}get lineColor(){return this._lineColor}set lineColor(t){const s=this.uniforms.lineColor;typeof t=="number"?(Ht.hex2rgb(t,s),this._lineColor=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._lineColor=Ht.rgb2hex(s))}get color(){return this._color}set color(t){const s=this.uniforms.color;typeof t=="number"?(Ht.hex2rgb(t,s),this._color=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._color=Ht.rgb2hex(s))}get time(){return this._time}set time(t){this._time=t,this.uniforms.time=t}}const Ba=class Ba{static startAnimation(){if(this.animationFrameId!==null)return;const t=s=>{const n=s/1e3;this.activeFilters.forEach(r=>{r.time=n}),this.animationFrameId=requestAnimationFrame(t)};this.animationFrameId=requestAnimationFrame(t)}static stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}static show(t,s=Q.FLOOR){const n=H().getRoomObject(H().activeRoomId,t,s);if(!n)return;const r=n.visualization;if(!r||!r.sprites||!r.sprites.length)return;const a=new Gu([.7,.88,.95],[.29,.35,.39]),l=`${t}_${s}`;this.activeFilters.set(l,a);for(const c of r.sprites)c.blendMode!==1&&(c.filters=[a]);this.startAnimation()}static hide(t,s=Q.FLOOR){const n=H().getRoomObject(H().activeRoomId,t,s);if(!n)return;const r=n.visualization;if(!r)return;const a=`${t}_${s}`;this.activeFilters.delete(a);for(const l of r.sprites)l.filters=[];this.activeFilters.size===0&&this.stopAnimation()}static clearAll(){const t=H(),s=[...t.getRoomObjects(t.activeRoomId,Q.FLOOR),...t.getRoomObjects(t.activeRoomId,Q.WALL)];for(const n of s){const r=n.visualization;if(r)for(const a of r.sprites)a.filters=[]}this.activeFilters.clear(),this.stopAnimation()}};Ba.glowFilter=new Gu([.7,.88,.95],[.29,.35,.39]),Ba.activeFilters=new Map,Ba.animationFrameId=null;let Zs=Ba;class Bu{constructor(t=0,s=0,n=0,r=0){this.id=t,this.type=s,this.color=n,this.light=r}}const Cv=(o,t,s,n=0)=>!(o.left+n+o.width<t.left+n||o.left+n>t.left+n+t.width||o.top+o.height<t.top+s||o.top>t.top+s+t.height),ra=class ra{static savePreset(t,s,n,r,a){Oe().updateMoodlightData(t,s,n,r,a)}static changeState(){Oe().toggleMoodlightState()}static previewDimmer(t,s,n){H().updateObjectRoomColor(Oe().roomId,t,s,n)}static scaleBrightness(t){return~~((t-this.MIN_BRIGHTNESS)*100/(this.MAX_BRIGHTNESS-this.MIN_BRIGHTNESS)+0)}};ra.AVAILABLE_COLORS=[7665141,21495,15161822,15353138,15923281,8581961,0],ra.HTML_COLORS=["#74F5F5","#0053F7","#E759DE","#EA4532","#F2F851","#82F349","#000000"],ra.MIN_BRIGHTNESS=76,ra.MAX_BRIGHTNESS=255;let Fs=ra;const vv=130,Nv=100,_v=130,Sv=100,wv=130,Tv=100,hh=o=>{let t=0,s=0,n=0,r=0;for(;r<o.length;){switch(r%3){case 0:t=t+o.charCodeAt(r)*37;break;case 1:s=s+o.charCodeAt(r)*37;break;case 2:n=n+o.charCodeAt(r)*37;break}r++}return t=t%Nv+vv,s=s%Sv+_v,n=n%Tv+wv,`rgb(${t},${s},${n})`},Ao=class Ao{static getMergedMannequinFigureContainer(t,s){const n=St().createFigureContainer(t),r=St().createFigureContainer(s);for(const a of this.MANNEQUIN_CLOTHING_PART_TYPES)n.removePart(a);for(const a of r.getPartTypeIds())n.updatePart(a,r.getPartSetId(a),r.getPartColorIds(a));return n}static transformAsMannequinFigure(t){for(const s of t.getPartTypeIds())this.MANNEQUIN_CLOTHING_PART_TYPES.indexOf(s)>=0||t.removePart(s);t.updatePart(this.MANNEQUIN_FIGURE[0],this.MANNEQUIN_FIGURE[1],this.MANNEQUIN_FIGURE[2])}};Ao.MANNEQUIN_FIGURE=["hd",99999,[99998]],Ao.MANNEQUIN_CLOTHING_PART_TYPES=[Ve.CHEST_ACCESSORY,Ve.COAT_CHEST,Ve.CHEST,Ve.LEGS,Ve.SHOES,Ve.WAIST_ACCESSORY];let ca=Ao;const Do=class Do{};Do.POSTURE_STAND=0,Do.POSTURE_SIT=1;let po=Do;class $r{constructor(t,s,n,r=0,a="#",l){this._id=t,this._category=s,this._name=n,this._ownerId=r,this._ownerName=a,this._type=l}get id(){return this._id}get category(){return this._category}get name(){return this._name}get ownerId(){return this._ownerId}get ownerName(){return this._ownerName??"#"}get type(){return this._type??"-"}}class yv{constructor(t,s,n,r,a,l,c){this.id=t,this.category=s,this.name=n,this.requestRoomObjectId=r,this.targetRoomObjectId=a,this.requestInventoryStripId=l,this.replace=c}}const xo="0",gh="1",sr=class sr{};sr.UNSTARTED=-1,sr.ENDED=0,sr.PLAYING=1,sr.PAUSED=2,sr.BUFFERING=3,sr.CUED=5;let ar=sr;function ls(o){D(new Gg(o))}const hi=o=>{const t=Math.floor(o/2);return o%2?(t+.5).toString():t.toString()},Ze=class Ze{};Ze.TOGGLE_FURNI_STATE=0,Ze.RESET=1,Ze.SET_FURNI_STATE=3,Ze.MOVE_FURNI=4,Ze.GIVE_SCORE=6,Ze.CHAT=7,Ze.TELEPORT=8,Ze.JOIN_TEAM=9,Ze.LEAVE_TEAM=10,Ze.CHASE=11,Ze.FLEE=12,Ze.MOVE_AND_ROTATE_FURNI=13,Ze.GIVE_SCORE_TO_PREDEFINED_TEAM=14,Ze.TOGGLE_TO_RANDOM_STATE=15,Ze.MOVE_FURNI_TO=16,Ze.GIVE_REWARD=17,Ze.CALL_ANOTHER_STACK=18,Ze.KICK_FROM_ROOM=19,Ze.MUTE_USER=20,Ze.BOT_TELEPORT=21,Ze.BOT_MOVE=22,Ze.BOT_TALK=23,Ze.BOT_GIVE_HAND_ITEM=24,Ze.BOT_FOLLOW_AVATAR=25,Ze.BOT_CHANGE_FIGURE=26,Ze.BOT_TALK_DIRECT_TO_AVTR=27;let st=Ze;const et=class et{};et.STATES_MATCH=0,et.FURNIS_HAVE_AVATARS=1,et.ACTOR_IS_ON_FURNI=2,et.TIME_ELAPSED_MORE=3,et.TIME_ELAPSED_LESS=4,et.USER_COUNT_IN=5,et.ACTOR_IS_IN_TEAM=6,et.HAS_STACKED_FURNIS=7,et.STUFF_TYPE_MATCHES=8,et.STUFFS_IN_FORMATION=9,et.ACTOR_IS_GROUP_MEMBER=10,et.ACTOR_IS_WEARING_BADGE=11,et.ACTOR_IS_WEARING_EFFECT=12,et.NOT_STATES_MATCH=13,et.FURNI_NOT_HAVE_HABBO=14,et.NOT_ACTOR_ON_FURNI=15,et.NOT_USER_COUNT_IN=16,et.NOT_ACTOR_IN_TEAM=17,et.NOT_HAS_STACKED_FURNIS=18,et.NOT_FURNI_IS_OF_TYPE=19,et.NOT_STUFFS_IN_FORMATION=20,et.NOT_ACTOR_IN_GROUP=21,et.NOT_ACTOR_WEARS_BADGE=22,et.NOT_ACTOR_WEARING_EFFECT=23,et.DATE_RANGE_ACTIVE=24,et.ACTOR_HAS_HANDITEM=25;let lt=et;const Hu=o=>`${o.getFullYear()}/${("0"+(o.getMonth()+1)).slice(-2)}/${("0"+o.getDate()).slice(-2)} ${("0"+o.getHours()).slice(-2)}:${("0"+o.getMinutes()).slice(-2)}`,aa=class aa{};aa.STUFF_SELECTION_OPTION_NONE=0,aa.STUFF_SELECTION_OPTION_BY_ID=1,aa.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE=2,aa.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT=3;let ue=aa;const Rv=`
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
uniform mat3 projectionMatrix;
|
||
varying vec2 vTextureCoord;
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
vTextureCoord = aTextureCoord;
|
||
}`,Ov=`
|
||
varying vec2 vTextureCoord;
|
||
uniform sampler2D uSampler;
|
||
uniform vec3 lineColor;
|
||
uniform vec3 color;
|
||
void main(void) {
|
||
vec4 currentColor = texture2D(uSampler, vTextureCoord);
|
||
vec3 colorLine = lineColor * currentColor.a;
|
||
vec3 colorOverlay = color * currentColor.a;
|
||
|
||
if(currentColor.r == 0.0 && currentColor.g == 0.0 && currentColor.b == 0.0 && currentColor.a > 0.0) {
|
||
gl_FragColor = vec4(colorLine.r, colorLine.g, colorLine.b, currentColor.a);
|
||
} else if(currentColor.a > 0.0) {
|
||
gl_FragColor = vec4(colorOverlay.r, colorOverlay.g, colorOverlay.b, currentColor.a);
|
||
}
|
||
}`;class kv extends fm{constructor(t,s){super(Rv,Ov),this.uniforms.lineColor=new Float32Array(3),this.uniforms.color=new Float32Array(3),this.lineColor=t,this.color=s}get lineColor(){return this._lineColor}set lineColor(t){const s=this.uniforms.lineColor;typeof t=="number"?(Ht.hex2rgb(t,s),this._lineColor=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._lineColor=Ht.rgb2hex(s))}get color(){return this._color}set color(t){const s=this.uniforms.color;typeof t=="number"?(Ht.hex2rgb(t,s),this._color=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._color=Ht.rgb2hex(s))}}const js=class js{static setMaxItemSelectionCount(t){js._maxItemSelectionCount=t}static show(t){js.applySelectionShader(js.getRoomObject(t))}static hide(t){js.clearSelectionShader(js.getRoomObject(t))}static clearSelectionShaderFromFurni(t){for(const s of t)js.clearSelectionShader(js.getRoomObject(s))}static applySelectionShaderToFurni(t){for(const s of t)js.applySelectionShader(js.getRoomObject(s))}static getRoomObject(t){const s=H();return s.getRoomObject(s.activeRoomId,t,Q.FLOOR)}static applySelectionShader(t){if(!t)return;const s=t.visualization;if(s)for(const n of s.sprites)n.blendMode!==1&&(n.filters=[js._selectionShader])}static clearSelectionShader(t){if(!t)return;const s=t.visualization;if(s)for(const n of s.sprites)n.filters=[]}};js._selectionShader=new kv([1,1,1],[.6,.6,.6]),js._maxItemSelectionCount=0;let Wn=js;const ga=" ",ts=class ts{};ts.AVATAR_SAYS_SOMETHING=0,ts.AVATAR_WALKS_ON_FURNI=1,ts.AVATAR_WALKS_OFF_FURNI=2,ts.EXECUTE_ONCE=3,ts.TOGGLE_FURNI=4,ts.EXECUTE_PERIODICALLY=6,ts.AVATAR_ENTERS_ROOM=7,ts.GAME_STARTS=8,ts.GAME_ENDS=9,ts.SCORE_ACHIEVED=10,ts.COLLISION=11,ts.EXECUTE_PERIODICALLY_LONG=12,ts.BOT_REACHED_STUFF=13,ts.BOT_REACHED_AVATAR=14;let es=ts;const ia=class ia{};ia.CENTER="DWP_CENTER",ia.TOP_CENTER="DWP_TOP_CENTER",ia.TOP_LEFT="DWP_TOP_LEFT",ia.NOTHING="DWP_NOTHING";let Ot=ia;const An=[],Wu=new Map,qu=0,zu=0,Ur=o=>{const{uniqueKey:t=null,handleSelector:s=".drag-handler",windowPosition:n=Ot.CENTER,disableDrag:r=!1,dragStyle:a={},children:l=null,offsetLeft:c=0,offsetTop:m=0}=o,[h,u]=i.useState(null),[g,f]=i.useState(null),[p,x]=i.useState({x:0,y:0}),[I,j]=i.useState(!1),[E,C]=i.useState(null),b=i.useRef(),S=i.useCallback(()=>{let M=400;for(const X of An)M+=1,X.style.zIndex=M.toString()},[]),_=i.useCallback(()=>{const M=An.indexOf(b.current);if(M===-1)An.push(b.current);else{if(M===An.length-1)return;M>=0&&(An.splice(M,1),An.push(b.current))}S()},[S]),T=i.useCallback(M=>{_()},[_]),P=i.useCallback(M=>{_()},[_]),k=i.useCallback((M,X)=>{x({x:M,y:X}),j(!0)},[]),R=i.useCallback(M=>{k(M.clientX,M.clientY)},[k]),y=i.useCallback(M=>{const X=M.touches[0];k(X.clientX,X.clientY)},[k]),O=i.useCallback(M=>{u({x:M.clientX-p.x,y:M.clientY-p.y})},[p]),F=i.useCallback(M=>{const X=M.touches[0];u({x:X.clientX-p.x,y:X.clientY-p.y})},[p]),V=i.useCallback(()=>{if(!b.current||!E)return;let M=g.x+h.x,X=g.y+h.y;const he=b.current.offsetLeft+M,pe=b.current.offsetTop+X;pe<qu?X=-b.current.offsetTop:pe+E.offsetHeight>=document.body.offsetHeight-qu&&(X=document.body.offsetHeight-b.current.offsetHeight-b.current.offsetTop),he+b.current.offsetWidth<zu?M=-b.current.offsetLeft:he>=document.body.offsetWidth-zu&&(M=document.body.offsetWidth-b.current.offsetWidth-b.current.offsetLeft),u({x:0,y:0}),f({x:M,y:X}),j(!1),t!==null&&Wu.set(t,{x:M,y:X})},[E,h,g,t]),Y=i.useCallback(M=>{V()},[V]),q=i.useCallback(M=>{V()},[V]);return i.useEffect(()=>{const M=b.current;if(!M)return;if(An.push(M),S(),!r){const pe=M.querySelector(s);pe&&C(pe)}let X=0,he=0;switch(n){case Ot.TOP_CENTER:M.style.top=50+m+"px",M.style.left=`calc(50vw - ${M.offsetWidth/2+c}px)`;break;case Ot.CENTER:M.style.top=`calc(50vh - ${M.offsetHeight/2+m}px)`,M.style.left=`calc(50vw - ${M.offsetWidth/2+c}px)`;break;case Ot.TOP_LEFT:M.style.top=50+m+"px",M.style.left=50+c+"px";break}if(t!==null){const pe=Wu.get(t);pe&&(X=pe.x,he=pe.y)}return u({x:0,y:0}),f({x:X,y:he}),()=>{const pe=An.indexOf(M);pe>=0&&An.splice(pe,1)}},[s,n,t,r,c,m,S]),i.useEffect(()=>{if(!g&&!h)return;const M=b.current;M&&(M.style.transform=`translate(${g.x+h.x}px, ${g.y+h.y}px)`,M.style.visibility="visible")},[g,h]),i.useEffect(()=>{if(E)return E.addEventListener(ve.MOUSE_DOWN,R),E.addEventListener(Ut.TOUCH_START,y,{passive:!0}),()=>{E.removeEventListener(ve.MOUSE_DOWN,R),E.removeEventListener(Ut.TOUCH_START,y)}},[E,R,y]),i.useEffect(()=>{if(I)return document.addEventListener(ve.MOUSE_UP,Y),document.addEventListener(Ut.TOUCH_END,q),document.addEventListener(ve.MOUSE_MOVE,O),document.addEventListener(Ut.TOUCH_MOVE,F),()=>{document.removeEventListener(ve.MOUSE_UP,Y),document.removeEventListener(Ut.TOUCH_END,q),document.removeEventListener(ve.MOUSE_MOVE,O),document.removeEventListener(Ut.TOUCH_MOVE,F)}},[I,Y,O,q,F]),i.useEffect(()=>{const M=b.current;if(M)return M.addEventListener("touchstart",P,{passive:!0}),()=>{M.removeEventListener("touchstart",P)}},[P]),i.useEffect(()=>{if(!t)return;const M=Ko(`nitro.windows.${t}`);!M||!M.offset||(u({x:0,y:0}),M.offset&&f(M.offset))},[t]),Ho.createPortal(e.jsx(A,{position:"absolute",innerRef:b,className:"draggable-window",onMouseDownCapture:T,style:a,children:l}),document.getElementById("draggable-windows-container"))},Dn=[],Yu=new Map,Av=o=>{const{uniqueKey:t=null,handleSelector:s=".drag-handler",windowPosition:n=Ot.CENTER,disableDrag:r=!1,dragStyle:a={},children:l=null,offsetLeft:c=0,offsetTop:m=0}=o,[h,u]=i.useState(null),[g,f]=i.useState(null),[p,x]=i.useState({x:0,y:0}),[I,j]=i.useState(!1),[E,C]=i.useState(null),b=i.useRef(),S=i.useCallback(()=>{let M=400;for(const X of Dn)M+=1,X.style.zIndex=M.toString()},[]),_=i.useCallback(()=>{const M=Dn.indexOf(b.current);if(M===-1)Dn.push(b.current);else{if(M===Dn.length-1)return;M>=0&&(Dn.splice(M,1),Dn.push(b.current))}S()},[S]),T=i.useCallback(M=>{_()},[_]),P=i.useCallback(M=>{_()},[_]),k=i.useCallback((M,X)=>{x({x:M,y:X}),j(!0)},[]),R=i.useCallback(M=>{k(M.clientX,M.clientY)},[k]),y=i.useCallback(M=>{const X=M.touches[0];k(X.clientX,X.clientY)},[k]),O=i.useCallback(M=>{u({x:M.clientX-p.x,y:M.clientY-p.y})},[p]),F=i.useCallback(M=>{const X=M.touches[0];u({x:X.clientX-p.x,y:X.clientY-p.y})},[p]),V=i.useCallback(()=>{if(!b.current||!E)return;let M=g.x+h.x,X=g.y+h.y;const he=b.current,pe=he.offsetWidth,qe=he.offsetHeight,wt=document.body.offsetWidth,be=document.body.offsetHeight,Qe=-he.offsetLeft,Ee=wt-pe-he.offsetLeft,Jt=-he.offsetTop,me=be-qe-he.offsetTop;M=Math.max(Qe,Math.min(M,Ee)),X=Math.max(Jt,Math.min(X,me)),u({x:0,y:0}),f({x:M,y:X}),j(!1),t!==null&&Yu.set(t,{x:M,y:X})},[E,h,g,t]),Y=i.useCallback(M=>{V()},[V]),q=i.useCallback(M=>{V()},[V]);return i.useEffect(()=>{const M=b.current;if(!M)return;if(Dn.push(M),S(),!r){const pe=M.querySelector(s);pe&&C(pe)}let X=0,he=0;switch(n){case Ot.TOP_CENTER:M.style.top=50+m+"px",M.style.left=`calc(50vw - ${M.offsetWidth/2+c}px)`;break;case Ot.CENTER:M.style.top=`calc(50vh - ${M.offsetHeight/2+m}px)`,M.style.left=`calc(50vw - ${M.offsetWidth/2+c}px)`;break;case Ot.TOP_LEFT:M.style.top=50+m+"px",M.style.left=50+c+"px";break}if(t!==null){const pe=Yu.get(t);pe&&(X=pe.x,he=pe.y)}return u({x:0,y:0}),f({x:X,y:he}),()=>{const pe=Dn.indexOf(M);pe>=0&&Dn.splice(pe,1)}},[s,n,t,r,c,m,S]),i.useEffect(()=>{if(!g&&!h)return;const M=b.current;M&&(M.style.transform=`translate(${g.x+h.x}px, ${g.y+h.y}px)`,M.style.visibility="visible")},[g,h]),i.useEffect(()=>{if(E)return E.addEventListener(ve.MOUSE_DOWN,R),E.addEventListener(Ut.TOUCH_START,y,{passive:!0}),()=>{E.removeEventListener(ve.MOUSE_DOWN,R),E.removeEventListener(Ut.TOUCH_START,y)}},[E,R,y]),i.useEffect(()=>{if(I)return document.addEventListener(ve.MOUSE_UP,Y),document.addEventListener(Ut.TOUCH_END,q),document.addEventListener(ve.MOUSE_MOVE,O),document.addEventListener(Ut.TOUCH_MOVE,F),()=>{document.removeEventListener(ve.MOUSE_UP,Y),document.removeEventListener(Ut.TOUCH_END,q),document.removeEventListener(ve.MOUSE_MOVE,O),document.removeEventListener(Ut.TOUCH_MOVE,F)}},[I,Y,O,q,F]),i.useEffect(()=>{const M=b.current;if(M)return M.addEventListener("touchstart",P,{passive:!0}),()=>{M.removeEventListener("touchstart",P)}},[P]),i.useEffect(()=>{if(!t)return;const M=Ko(`nitro.windows.${t}`);!M||!M.offset||(u({x:0,y:0}),M.offset&&f(M.offset))},[t]),Ho.createPortal(e.jsx(A,{position:"absolute",innerRef:b,className:"draggable-window-camera",onMouseDownCapture:T,style:a,children:l}),document.getElementById("draggable-windows-container"))},ae=o=>{const{theme:t="primary",uniqueKey:s=null,handleSelector:n=".drag-handler",windowPosition:r=Ot.CENTER,disableDrag:a=!1,overflow:l="hidden",position:c="relative",gap:m=0,classNames:h=[],...u}=o,g=i.useRef(),f=i.useMemo(()=>{const p=["nitro-card","rounded","shadow"];return p.push(`theme-${t||"primary"}`),h.length&&p.push(...h),p},[t,h]);return e.jsx(IC,{value:{theme:t},children:e.jsx(Ur,{uniqueKey:s,handleSelector:n,windowPosition:r,disableDrag:a,children:e.jsx(N,{innerRef:g,overflow:l,position:c,gap:m,classNames:f,...u})})})},it=o=>{const{figure:t="",gender:s="M",headOnly:n=!1,direction:r=0,scale:a=1,classNames:l=[],style:c={},...m}=o,[h,u]=i.useState(null),[g,f]=i.useState(-1),p=i.useRef(!1),x=i.useMemo(()=>{const j=["avatar-image"];return l.length&&j.push(...l),j},[l]),I=i.useMemo(()=>{let j={};return h&&h.length&&(j.backgroundImage=`url('${h}')`),a!==1&&(j.transform=`scale(${a})`,a%1||(j.imageRendering="pixelated")),Object.keys(c).length&&(j={...j,...c}),j},[h,a,c]);return i.useEffect(()=>{const j=St().createAvatarImage(t,Cc.LARGE,s,{resetFigure:b=>{p.current||f(Math.random())},dispose:()=>{},disposed:!1},null);if(!j)return;let E=so.FULL;n&&(E=so.HEAD),j.setDirection(E,r);const C=j.getCroppedImage(E);C&&u(C.src),j.dispose()},[t,s,r,n,g]),i.useEffect(()=>(p.current=!1,()=>{p.current=!0}),[]),e.jsx(A,{classNames:x,style:I,...m})},fh=o=>{const{imageUrl:t=null,fit:s=!0,style:n=null,...r}=o,a=i.useMemo(()=>{const l={...n};return t&&(l.background=`url(${t}) center no-repeat`),l},[n,t]);return e.jsx(A,{fit:s,style:a,...r})},Xe=o=>{const{badgeCode:t=null,isGroup:s=!1,showInfo:n=!1,customTitle:r=null,isGrayscale:a=!1,scale:l=1,classNames:c=[],style:m={},children:h=null,...u}=o,[g,f]=i.useState(null),p=i.useMemo(()=>{const I=["badge-image"];return s&&I.push("group-badge"),a&&I.push("grayscale"),c.length&&I.push(...c),I},[c,s,a]),x=i.useMemo(()=>{let I={};return g&&(I.backgroundImage=`url(${s?g.src:K("badge.asset.url").replace("%badgename%",t.toString())})`,I.width=g.width,I.height=g.height,l!==1&&(I.transform=`scale(${l})`,l%1||(I.imageRendering="pixelated"),I.width=g.width*l,I.height=g.height*l)),Object.keys(m).length&&(I={...I,...m}),I},[g,l,m]);return i.useEffect(()=>{if(!t||!t.length)return;let I=!1;const j=C=>{if(C.badgeId!==t)return;const b=vn.generateImage(new to(C.image));b.onload=()=>f(b),I=!0,G().events.removeEventListener(hl.IMAGE_READY,j)};G().events.addEventListener(hl.IMAGE_READY,j);const E=s?G().getGroupBadgeImage(t):G().getBadgeImage(t);if(E&&!I){const C=vn.generateImage(new to(E));C.onload=()=>f(C)}return()=>G().events.removeEventListener(hl.IMAGE_READY,j)},[t,s]),e.jsxs(A,{classNames:p,style:x,...u,children:[n&&K("badge.descriptions.enabled",!0)&&e.jsxs(A,{className:"badge-information text-black py-1 px-2 small",children:[e.jsx("div",{className:"fw-bold mb-1",children:s?r:pa(t)}),e.jsx("div",{children:s?d("group.badgepopup.body"):yc(t)})]}),h]})},Dv=o=>{const{day:t="00",hour:s="00",minutes:n="00",seconds:r="00",classNames:a=[],children:l=null,...c}=o,m=i.useMemo(()=>{const h=["nitro-counter-time"];return a.length&&h.push(...a),h},[a]);return e.jsxs(w,{gap:1,children:[e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[t!="00"?t:s,t!="00"?d("countdown_clock_unit_days"):d("countdown_clock_unit_hours")]})}),e.jsx(A,{style:{marginTop:"3px"},children:":"}),e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[n,d("countdown_clock_unit_minutes")]})}),e.jsx(A,{style:{marginTop:"3px"},children:":"}),e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[r,d("countdown_clock_unit_seconds")]})}),l]})},_t=o=>{const{type:t="",classNames:s=[],style:n={},...r}=o,a=i.useMemo(()=>{const m=["nitro-currency-icon topcurrencygen"];return s.length&&m.push(...s),m},[s]),l=i.useMemo(()=>{let m=K("currency.asset.icon.url","");return m=m.replace("%type%",t.toString()),`url(${m})`},[t]),c=i.useMemo(()=>{let m={};return m.backgroundImage=l,Object.keys(n).length&&(m={...m,...n}),m},[n,l]);return e.jsx(A,{classNames:a,style:c,...r})},Jo=o=>{const{productType:t="s",productClassId:s=-1,direction:n=2,extraData:r="",scale:a=1,style:l={},...c}=o,[m,h]=i.useState(null),u=i.useMemo(()=>{var f;let g={};return(f=m==null?void 0:m.src)!=null&&f.length&&(g.backgroundImage=`url('${m.src}')`,g.width=m.width,g.height=m.height),a!==1&&(g.transform=`scale(${a})`,a%1||(g.imageRendering="pixelated")),Object.keys(l).length&&(g={...g,...l}),g},[m,a,l]);return i.useEffect(()=>{let g=null;const f={imageReady:(p,x,I)=>{!I&&x&&(I=vn.generateImage(x)),I.onload=()=>h(I)},imageFailed:null};switch(t.toLocaleLowerCase()){case xe.FLOOR:g=H().getFurnitureFloorImage(s,new At(n),64,f,0,r);break;case xe.WALL:g=H().getFurnitureWallImage(s,new At(n),64,f,0,r);break}if(g){const p=g.getImage();p.onload=()=>h(p)}},[t,s,n,r]),m?e.jsx(A,{classNames:["furni-image"],style:u,...c}):null},ph=o=>{const{figure:t=null,userName:s=null,message:n=null,editable:r=!1,onChange:a=null}=o;return e.jsxs(w,{overflow:"hidden",className:"nitro-gift-card text-black",children:[e.jsxs("div",{className:"d-flex align-items-center justify-content-center gift-face flex-shrink-0",children:[!s&&e.jsx("div",{className:"gift-incognito"}),t&&e.jsx("div",{className:"gift-avatar",children:e.jsx(it,{figure:t,direction:2,headOnly:!0})})]}),e.jsx(w,{overflow:"hidden",className:"w-100 pt-4 pb-4 pe-4 ps-3",children:e.jsxs(N,{grow:!0,overflow:"auto",justifyContent:"between",children:[!r&&e.jsx(v,{textBreak:!0,className:"gift-message",children:n}),r&&a!==null&&e.jsx("textarea",{className:"gift-message h-100",maxLength:140,value:n,onChange:l=>a(l.target.value),placeholder:d("catalog.gift_wrapping_new.message_hint")}),s&&e.jsx(v,{italics:!0,textEnd:!0,className:"pe-1",children:d("catalog.gift_wrapping_new.message_from",["name"],[s])})]})})]})},N=o=>{const{size:t=0,offset:s=0,column:n=!0,gap:r=2,classNames:a=[],...l}=o,{isCssGrid:c=!1}=gC(),m=i.useMemo(()=>{const h=[];if(t){let u=`col-${t}`;c&&(u=`g-${u}`),h.push(u)}if(s){let u=`offset-${s}`;c&&(u=`g-start-${s}`),h.push(u)}return a.length&&h.push(...a),h},[t,s,c,a]);return e.jsx(w,{classNames:m,column:n,gap:r,...l})},Cn=o=>{const{count:t=0,position:s="absolute",classNames:n=[],children:r=null,...a}=o,l=i.useMemo(()=>{const c=["badge","border","border-black","bg-white","px-1","nitro-item-count"];return n.length&&c.push(...n),c},[n]);return e.jsxs(A,{position:"absolute",classNames:l,...a,children:[t,r]})},Ar=o=>{const{value:t=0}=o,s=t.toString().split("");return e.jsx(e.Fragment,{children:s.map((n,r)=>e.jsx("i",{className:"limited-edition-number n-"+n},r))})},xh=o=>{const{uniqueNumber:t=0,uniqueSeries:s=0,classNames:n=[],children:r=null,...a}=o,l=i.useMemo(()=>{const c=["unique-compact-plate","z-index-1"];return n.length&&c.push(...n),c},[n]);return e.jsxs(A,{classNames:l,...a,children:[e.jsx("div",{children:e.jsx(Ar,{value:t})}),e.jsx("div",{children:e.jsx(Ar,{value:s})}),r]})},Pv=o=>{const{uniqueLimitedItemsLeft:t=0,uniqueLimitedSeriesSize:s=0,classNames:n=[],...r}=o,a=i.useMemo(()=>{const l=["unique-complete-plate"];return n.length&&l.push(...n),l},[n]);return e.jsx(A,{classNames:a,...r,children:e.jsxs(N,{className:"plate-container",gap:0,children:[e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[d("unique.items.left"),e.jsx("div",{children:e.jsx(Ar,{value:t})})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[d("unique.items.number.sold"),e.jsx("div",{children:e.jsx(Ar,{value:s})})]})]})})},_e=o=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:a=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=o,b=i.useMemo(()=>{const _=["layout-grid-item","border","border-2","border-muted","rounded"];return n&&_.push("active"),(l||c>0)&&_.push("unique-item"),l&&_.push("sold-out"),m&&_.push("unseen"),h&&_.push("has-highlight"),u&&_.push("disabled"),t===null&&_.push("icon","loading-icon"),x.length&&_.push(...x),_},[n,l,c,m,h,u,t,x]),S=i.useMemo(()=>{let _={...p};return t&&!(l||c>0)&&(_.backgroundImage=`url(${t})`),s&&(_.backgroundColor=s),Object.keys(p).length&&(_={..._,...p}),_},[p,t,s,l,c]);return e.jsxs(N,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:S,...C,children:[r>a&&e.jsx(Cn,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(Ar,{value:c})})]}),E]})},Tn=o=>{const{imageUrl:t=null,className:s="",...n}=o;return e.jsx("img",{src:t,className:"no-select "+s,alt:"",...n})},Lv=o=>{const{text:t=null}=o;return e.jsx(w,{className:"nitro-input-error-popup",alignItems:"center",justifyContent:"center",children:e.jsx(v,{className:"px-2",children:t})})},Pc=o=>{const{...t}=o;return e.jsxs(A,{classNames:["spinner-container"],...t,children:[e.jsx(A,{className:"spinner"}),e.jsx(A,{className:"spinner"}),e.jsx(A,{className:"spinner"})]})},Mv=o=>{const{roomId:t=-1,textureReceiver:s=null,onClose:n=null}=o,r=i.useRef(),a=()=>{if(!r||!r.current)return null;const c=r.current.getBoundingClientRect();return new pm(Math.floor(c.x),Math.floor(c.y),Math.floor(c.width),Math.floor(c.height))},l=()=>{_n(Sn.CAMERA_SHUTTER),s(H().createTextureFromRoom(t,1,a()))};return e.jsx(Ur,{handleSelector:".nitro-room-thumbnail-camera",children:e.jsxs("div",{className:"nitro-room-thumbnail-camera px-2",children:[e.jsx("div",{ref:r,className:"camera-frame"}),e.jsxs("div",{className:"d-flex align-items-end h-100 pb-2",children:[e.jsx("button",{className:"btn btn-sm btn-danger w-100 mb-1 me-2",onClick:n,children:d("cancel")}),e.jsx("button",{className:"btn btn-sm btn-success w-100 mb-1",onClick:l,children:d("navigator.thumbeditor.save")})]})]})})},Lc=o=>{const{title:t="",onClose:s=null,classNames:n=[],children:r=null,type:a=je.DEFAULT,options:l=null,...c}=o,m=i.useMemo(()=>{const h=["nitro-alert"];return h.push("nitro-alert-"+a),n.length&&h.push(...n),h},[n,a]);return e.jsxs(ae,{classNames:m,theme:"primary-slim",...c,children:[e.jsx(re,{headerText:t,onCloseClick:s}),e.jsx(se,{grow:!0,justifyContent:"between",overflow:"hidden",className:"text-black",gap:0,children:r}),l]})},Uv=o=>{const{title:t="",onClose:s=null,classNames:n=[],children:r=null,type:a=je.DEFAULT,...l}=o,c=i.useMemo(()=>{const m=["nitro-alert","nitro-alert-credits"];return n.length&&m.push(...n),m},[n,a]);return e.jsxs(ae,{classNames:c,theme:"primary",...l,children:[e.jsx(re,{headerText:t,onCloseClick:s}),e.jsx(se,{grow:!0,justifyContent:"between",overflow:"hidden",className:"text-black",gap:0,children:r})]})},Mc=o=>{const{fadesOut:t=!0,timeoutMs:s=8e3,onClose:n=null,overflow:r="hidden",classNames:a=[],...l}=o,[c,m]=i.useState(!1),h=i.useMemo(()=>{const u=["nitro-notification-bubble","rounded"];return a.length&&u.push(...a),u},[a]);return i.useEffect(()=>(m(!0),()=>m(!1)),[]),i.useEffect(()=>{if(!t)return;const u=setTimeout(()=>{m(!1),setTimeout(()=>n(),300)},s);return()=>clearTimeout(u)},[t,s,n]),e.jsx(or,{children:c&&e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(w,{overflow:r,classNames:h,onClick:n,...l})})})},jn=o=>{const{figure:t="",typeId:s=-1,paletteId:n=-1,petColor:r=16777215,customParts:a=[],posture:l="std",headOnly:c=!1,direction:m=0,scale:h=1,style:u={},...g}=o,[f,p]=i.useState(null),[x,I]=i.useState(0),[j,E]=i.useState(0),C=i.useRef(!1),b=i.useMemo(()=>{let S={};return f&&f.length&&(S.backgroundImage=`url(${f})`),h!==1&&(S.transform=`scale(${h})`,h%1||(S.imageRendering="pixelated")),S.width=x,S.height=j,Object.keys(u).length&&(S={...S,...u}),S},[f,h,u,x,j]);return i.useEffect(()=>{let S=s,_=n,T=r,P=a,k=c;if(t&&t.length){const y=new da(t);S=y.typeId,_=y.paletteId,T=y.color,P=y.customParts}S===16&&(k=!1);const R=H().getRoomObjectPetImage(S,_,T,new At(m*45),64,{imageReady:(y,O,F)=>{C.current||(F?(p(F.src),I(F.width),E(F.height)):O&&(p(vn.generateImageUrl(O)),I(O.width),E(O.height)))},imageFailed:y=>{}},k,0,P,l);if(R){const y=R.getImage();y&&(p(y.src),I(y.width),E(y.height))}},[t,s,n,r,a,l,c,m]),i.useEffect(()=>(C.current=!1,()=>{C.current=!0}),[]),e.jsx(A,{classNames:["pet-image"],style:b,...g})},Uc=o=>{const{text:t="",progress:s=0,maxProgress:n=100,position:r="relative",justifyContent:a="center",classNames:l=[],children:c=null,...m}=o,h=i.useMemo(()=>{const u=["nitro-progress-bar","text-white"];return l.length&&u.push(...l),u},[l]);return e.jsxs(N,{position:r,justifyContent:a,classNames:h,...m,children:[t&&t.length>0&&e.jsx(w,{fit:!0,center:!0,position:"absolute",className:"nitro-progress-bar-text small",children:t}),e.jsx(A,{className:"nitro-progress-bar-inner",style:{width:~~((s-0)*100/(n-0)+0)+"%"}}),c]})},Fc=o=>{const{level:t=0,classNames:s=[],children:n=null,...r}=o,a=i.useMemo(()=>{const l=["nitro-rarity-level"];return s.length&&l.push(...s),l},[s]);return e.jsxs(A,{classNames:a,...r,children:[e.jsx("div",{children:t}),n]})},Zo=o=>{const{roomPreviewer:t=null,height:s=0,children:n=null}=o,[r,a]=i.useState(null),l=i.useRef(),c=m=>{t&&(m.shiftKey?t.changeRoomObjectDirection():t.changeRoomObjectState())};return i.useEffect(()=>{if(!t)return;const m=u=>{!t||!r||!l.current||(t.updatePreviewRoomView(),r.canvasUpdated&&(l.current.style.backgroundImage=`url(${vn.generateImageUrl(r.master)})`))};if(!r&&l.current&&t){let g=document.defaultView.getComputedStyle(l.current,null).backgroundColor;g=Ht.rgbStringToHex(g),g=g.replace("#","0x"),t.backgroundColor=parseInt(g,16);const f=l.current.parentElement.clientWidth;t.getRoomCanvas(f,s);const p=t.getRenderingCanvas();a(p),p.canvasUpdated=!0,m()}qn().add(m);const h=new ResizeObserver(()=>{if(!t||!l.current)return;const u=l.current.parentElement.offsetWidth;t.modifyRoomCanvas(u,s),m()});return h.observe(l.current),()=>{h.disconnect(),qn().remove(m)}},[r,t,l,s]),e.jsxs("div",{className:"room-preview-container",children:[e.jsx("div",{ref:l,className:"room-preview-image",style:{height:s},onClick:c}),n]})},el=o=>{const{roomId:t=-1,customUrl:s=null,shrink:n=!0,overflow:r="hidden",classNames:a=[],children:l=null,...c}=o,m=i.useMemo(()=>{const u=["room-thumbnail","rounded","border"];return a.length&&u.push(...a),u},[a]),h=i.useMemo(()=>s&&s.length?K("image.library.url")+s:K("thumbnails.url").replace("%thumbnail%",t.toString()),[s,t]);return e.jsxs(A,{shrink:n,overflow:r,classNames:m,...c,children:[h&&e.jsx("img",{alt:"",src:h}),l]})},jh=o=>{const{color:t="",message:s="",date:n="",senderName:r="",customTitle:a=null,onCloseClick:l=null}=o;return e.jsx(Ur,{handleSelector:".drag-handler",children:e.jsxs(N,{gap:0,alignItems:"center",className:`nitro-layout-trophy trophy-${t}`,children:[e.jsxs(w,{center:!0,fullWidth:!0,position:"relative",className:"trophy-header drag-handler",children:[e.jsx(A,{position:"absolute",pointer:!0,className:"trophy-close",onClick:l}),e.jsx(v,{bold:!0,children:d("widget.furni.trophy.title")})]}),e.jsxs(N,{className:"trophy-content py-1",gap:1,children:[a&&e.jsx(v,{bold:!0,children:a}),s]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",className:"trophy-footer mt-1",children:[e.jsx(v,{bold:!0,children:n}),e.jsx(v,{bold:!0,children:r})]})]})})},Ih=o=>{const{title:t=null,onSaveSearch:s=null,onClick:n=null}=o;return e.jsx(A,{color:"white",className:"button-search-saves",pointer:!0,title:t,onClickCapture:s,onClick:n,children:e.jsx(am,{})})},Fv=o=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:a=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=o,b=i.useMemo(()=>{const _=["room-creator-grid-item"];return n&&_.push("active"),(l||c>0)&&_.push("unique-item"),l&&_.push("sold-out"),m&&_.push("unseen"),h&&_.push("has-highlight"),u&&_.push("disabled"),t===null&&_.push("icon","loading-icon"),x.length&&_.push(...x),_},[n,l,c,m,h,u,t,x]),S=i.useMemo(()=>{let _={...p};return t&&(_.backgroundImage=`url(${t})`),s&&(_.backgroundColor=s),Object.keys(p).length&&(_={..._,...p}),_},[p,t,s]);return e.jsxs(N,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:S,...C,children:[r>a&&e.jsx(Cn,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(Ar,{value:c})})]}),E]})},vs=o=>{const{userId:t=0,classNames:s=[],pointer:n=!0,children:r=null,...a}=o,l=i.useMemo(()=>{const c=["nitro-friends-spritesheet","icon-profile-sm"];return s.length&&c.push(...s),c},[s]);return e.jsx(A,{classNames:l,pointer:n,onClick:c=>ls(t),...a,children:r})},sn=o=>{const{isActive:t=!1,count:s=0,overflow:n="hidden",position:r="relative",pointer:a=!0,classNames:l=[],children:c=null,...m}=o,h=i.useMemo(()=>{const u=["nav-item","rounded-top","border"];return t&&u.push("active"),l.length&&u.push(...l),u},[t,l]);return e.jsxs(w,{overflow:n,pointer:a,position:r,classNames:h,...m,children:[e.jsx(w,{shrink:!0,center:!0,children:c}),s>0&&e.jsx(Cn,{className:"text-black",count:s})]})},yn=o=>{const{justifyContent:t="start",gap:s=1,classNames:n=[],children:r=null,...a}=o,l=i.useMemo(()=>{const c=["container-fluid","nitro-card-tabs","pt-1","position-relative"];return n.length&&c.push(...n),c},[n]);return e.jsx(w,{justifyContent:t,gap:s,classNames:l,...a,children:r})},$t=(...o)=>o.filter(Boolean).join(" "),Vv=o=>{const{classNames:t=[],...s}=o,n=i.useMemo(()=>{const r=["form-group"];return t.length&&r.push(...t),r},[t]);return e.jsx(w,{classNames:n,...s})},Gv=o=>{const{variant:t="black",height:s=1,classNames:n=[],style:r={},...a}=o,l=i.useMemo(()=>{const m=[];return t&&m.push("bg-"+t),n.length&&m.push(...n),m},[t,n]),c=i.useMemo(()=>{let m={display:"list-item"};return s>0&&(m.height=s),Object.keys(r).length&&(m={...m,...r}),m},[s,r]);return e.jsx(A,{classNames:l,style:c,...a})},zn=(o,t,s,n=!0)=>{i.useEffect(()=>{if(n)return Array.isArray(o)?o.map(r=>t.addEventListener(r,s)):t.addEventListener(o,s),()=>{Array.isArray(o)?o.map(r=>t.removeEventListener(r,s)):t.removeEventListener(o,s)}},[o,t,n,s])},$u=(o,t)=>zn(o,EC().events,t),Bv=(o,t)=>zn(o,Ce().cameraManager.events,t),Hv=(o,t)=>zn(o,Ce().localization.events,t),pr=(o,t)=>zn(o,Ce().events,t),we=(o,t)=>zn(o,H().events,t),He=(o,t)=>zn(o,Lr().events,t),Wv=(o,t)=>zn(o,G().events,t),jr=(o,t,s=!0)=>zn(o,Ce().soundManager.events,t,s),U=(o,t)=>{i.useEffect(()=>{const s=new o(t);return $a().registerMessageEvent(s),()=>$a().removeMessageEvent(s)},[o,t])},ut=(o,t,s=!0)=>zn(o,Nn,t,s),qv=()=>{const[o,t]=i.useState(!0),[s,n]=i.useState([]),[r,a]=i.useState(null),[l,c]=i.useState(-1),[m,h]=i.useState(0),u=i.useMemo(()=>{let E=0;return s.forEach(C=>E+=Es.getAchievementCategoryTotalUnseen(C)),E},[s]),g=i.useMemo(()=>{let E=0;return s.forEach(C=>E+=C.getProgress()),E},[s]),f=i.useMemo(()=>{let E=0;return s.forEach(C=>E+=C.getMaxProgress()),E},[s]),p=i.useMemo(()=>~~((g-0)*100/(f-0)+0),[g,f]),x=i.useMemo(()=>r===null?null:s.find(E=>E.code===r),[s,r]),I=i.useMemo(()=>l===-1||!x?null:x.achievements.find(E=>E.achievementId===l),[x,l]),j=i.useCallback((E,C)=>{n(b=>{const S=[...b];for(const _ of S)if(_.code===E)for(const T of _.achievements)T.achievementId===C&&(T.unseen=0);return S})},[]);return U(Bg,E=>{const b=E.getParser().achievement;n(S=>{const _=[...S],T=_.findIndex(P=>P.code===b.category);if(T===-1){const P=new wu(b.category);P.achievements.push(b),_.push(P)}else{const P=is(_[T]),k=[...P.achievements],R=k.findIndex(O=>O.achievementId===b.achievementId);let y=null;R===-1?k.push(b):(y=k[R],k[R]=b),Es.getAchievementIsIgnored(b)||(b.unseen++,y&&(b.unseen+=y.unseen)),P.achievements=k,_[T]=P}return _})}),U(Hg,E=>{const C=E.getParser(),b=[];for(const S of C.achievements){const _=S.category;let T=b.find(P=>P.code===_);T||(T=new wu(_),b.push(T)),T.achievements.push(S)}n(b)}),U(Wg,E=>{const C=E.getParser();h(C.score)}),i.useEffect(()=>{o&&(D(new qg),t(!1))},[o]),i.useEffect(()=>{!r||l===-1||j(r,l)},[r,l,j]),{achievementCategories:s,selectedCategoryCode:r,setSelectedCategoryCode:a,selectedAchievementId:l,setSelectedAchievementId:c,achievementScore:m,getTotalUnseen:u,getProgress:g,getMaxProgress:f,scaledProgressPercent:p,selectedCategory:x,selectedAchievement:I,setAchievementSeen:j}},tl=()=>dt(qv),zv=()=>{const[o,t]=i.useState([]),[s,n]=i.useState([]),[r,a]=i.useState(-1),[l,c]=i.useState(10),[m,h]=i.useState(null);return Bv($g.INITIALIZED,u=>{t(Array.from(wa().effects.values()))}),U(zg,u=>{const g=u.getParser();h({credits:g.creditPrice,duckets:g.ducketPrice,publishDucketPrice:g.publishDucketPrice})}),i.useEffect(()=>{if(!wa().isLoaded){wa().init(),D(new Yg);return}},[]),{availableEffects:o,cameraRoll:s,setCameraRoll:n,selectedPictureIndex:r,setSelectedPictureIndex:a,myLevel:l,price:m}},bh=()=>dt(zv),Ks=class Ks extends Rs{};Ks.SHOW_CATALOG="CE_SHOW_CATALOG",Ks.HIDE_CATALOG="CE_HIDE_CATALOG",Ks.TOGGLE_CATALOG="CE_TOGGLE_CATALOG",Ks.SOLD_OUT="CE_SOLD_OUT",Ks.APPROVE_NAME_RESULT="CE_APPROVE_NAME_RESULT",Ks.PURCHASE_APPROVED="CE_PURCHASE_APPROVED",Ks.INIT_GIFT="CE_INIT_GIFT",Ks.CATALOG_RESET="CE_RESET",Ks.CATALOG_INVISIBLE_PAGE_VISITED="CE_CATALOG_INVISIBLE_PAGE_VISITED";let Dr=Ks;class Yv extends Dr{constructor(t,s,n){super(Dr.INIT_GIFT),this._pageId=t,this._offerId=s,this._extraData=n}get pageId(){return this._pageId}get offerId(){return this._offerId}get extraData(){return this._extraData}}const Po=class Po extends Dr{constructor(t){super(Po.POST_MARKETPLACE),this._item=t}get item(){return this._item}};Po.POST_MARKETPLACE="CE_POST_MARKETPLACE";let jo=Po;const Lo=class Lo extends Rs{constructor(t){super(Lo.PURCHASE_SUCCESS),this._purchase=t}get purchase(){return this._purchase}};Lo.PURCHASE_SUCCESS="CPE_PURCHASE_SUCCESS";let wn=Lo;const Mo=class Mo extends Rs{constructor(t){super(Mo.PURCHASE_FAILED),this._code=t}get code(){return this._code}};Mo.PURCHASE_FAILED="CPFE_PURCHASE_FAILED";let cr=Mo;const Uo=class Uo extends Rs{constructor(t){super(Uo.NOT_ALLOWED),this._code=t}get code(){return this._code}};Uo.NOT_ALLOWED="CPNAE_NOT_ALLOWED";let ni=Uo;const Et=class Et extends Rs{};Et.WIDGETS_INITIALIZED="CWE_CWE_WIDGETS_INITIALIZED",Et.SELECT_PRODUCT="CWE_SELECT_PRODUCT",Et.SET_EXTRA_PARM="CWE_CWE_SET_EXTRA_PARM",Et.PURCHASE="CWE_PURCHASE",Et.COLOUR_ARRAY="CWE_COLOUR_ARRAY",Et.MULTI_COLOUR_ARRAY="CWE_MULTI_COLOUR_ARRAY",Et.COLOUR_INDEX="CWE_COLOUR_INDEX",Et.TEXT_INPUT="CWE_TEXT_INPUT",Et.DROPMENU_SELECT="CWE_CWE_DROPMENU_SELECT",Et.PURCHASE_OVERRIDE="CWE_PURCHASE_OVERRIDE",Et.SELLABLE_PET_PALETTES="CWE_SELLABLE_PET_PALETTES",Et.UPDATE_ROOM_PREVIEW="CWE_UPDATE_ROOM_PREVIEW",Et.GUILD_SELECTED="CWE_GUILD_SELECTED",Et.TOTAL_PRICE_WIDGET_INITIALIZED="CWE_TOTAL_PRICE_WIDGET_INITIALIZED",Et.PRODUCT_OFFER_UPDATED="CWE_CWE_PRODUCT_OFFER_UPDATED",Et.SET_PREVIEWER_STUFFDATA="CWE_CWE_SET_PREVIEWER_STUFFDATA",Et.EXTRA_PARAM_REQUIRED_FOR_BUY="CWE_CWE_EXTRA_PARAM_REQUIRED_FOR_BUY",Et.TOGGLE="CWE_CWE_TOGGLE",Et.BUILDER_SUBSCRIPTION_UPDATED="CWE_CWE_BUILDER_SUBSCRIPTION_UPDATED",Et.ROOM_CHANGED="CWE_CWE_ROOM_CHANGED",Et.SHOW_WARNING_TEXT="CWE_CWE_SHOW_WARNING_TEXT";let Ku=Et;const Fo=class Fo extends Rs{constructor(){super(Fo.SOLD_OUT)}};Fo.SOLD_OUT="CPSOE_SOLD_OUT";let ri=Fo;const Vo=class Vo extends Rs{constructor(t,s){super(Vo.UPDATE_STUFF_DATA),this._offer=t,this._stuffData=s}get offer(){return this._offer}get stuffData(){return this._stuffData}};Vo.UPDATE_STUFF_DATA="SRPSA_UPDATE_STUFF_DATA";let Xu=Vo;const br=class br extends Rs{};br.SHOW_GUIDE_TOOL="GTE_SHOW_GUIDE_TOOL",br.HIDE_GUIDE_TOOL="GTE_HIDE_GUIDE_TOOL",br.TOGGLE_GUIDE_TOOL="GTE_TOGGLE_GUIDE_TOOL",br.CREATE_HELP_REQUEST="GTE_CREATE_HELP_REQUEST",br.CREATE_BULLY_REQUEST="GTE_CREATE_BULLY_REQUEST";let Is=br;const eu=class eu extends Rs{};eu.INIT="HC_NAME_CHANGE_INIT";let ai=eu;const Go=class Go extends Rs{constructor(t,s){super(Go.DELETE_ITEM_CONFIRM),this._item=t,this._amount=s}get item(){return this._item}get amount(){return this._amount}};Go.DELETE_ITEM_CONFIRM="DIC_DELETE_ITEM_CONFIRM";let Io=Go;const Bo=class Bo extends Rs{constructor(t,s,n){super(Bo.FURNI_ADDED),this.id=t,this.spriteId=s,this.category=n}};Bo.FURNI_ADDED="IFAE_FURNI_ADDED";let ii=Bo;const Ha=class Ha extends Rs{};Ha.SHOW_THUMBNAIL="NE_SHOW_THUMBNAIL",Ha.HIDE_THUMBNAIL="NE_HIDE_THUMBNAIL",Ha.TOGGLE_THUMBNAIL="NE_TOGGLE_THUMBNAIL";let fn=Ha;const Qu=o=>o&&o.length?o.replace(/\\r/g,"\r"):"",Ju=o=>{const t="0"+o;return t.substr(t.length-2,t.length)};let va=null;const $v=()=>{const[o,t]=i.useState([]),[s,n]=i.useState([]),[r,a]=i.useState([]),[l,c]=i.useState(!1),[m,h]=i.useState(!1),u=()=>K("notification",{}),g=R=>{const y=u();return y?y[R]:null},f=(R,y,O,F)=>{if(R.has(O))return R.get(O);const V=["notification",y,O].join(".");return Ce().localization.hasValue(V)||F?d(V,Array.from(R.keys()),Array.from(R.values())):null},p=(R,y)=>{let O=R.get("image");return O||(O=K("image.library.notifications.url","").replace("%image%",y.replace(/\./g,"_"))),d(O)},x=i.useCallback((R,y=null,O=null,F=null,V=null,Y=null)=>{(!V||!V.length)&&(V=d("notifications.broadcast.title")),(!y||!y.length)&&(y=je.DEFAULT);const q=new go([Qu(R)],y,O,F,V,Y);t(M=>[q,...M])},[]),I=i.useCallback(()=>x(null,je.NITRO),[x]),j=i.useCallback((R,y,O=null,F=null)=>{if(l)return;const V=new nc(R,y,O,F);n(Y=>[V,...Y])},[l]),E=(R,y=null)=>{y||(y=new Map);const O=g("notification."+R);if(O)for(const X in O)y.set(X,O[X]);R==="floorplan_editor.error"&&y.set("message",y.get("message").replace(/[^a-zA-Z._ ]/g,""));const F=f(y,R,"title",!0),V=f(y,R,"message",!0).replace(/\\r/g,"\r"),Y=f(y,R,"linkTitle",!1),q=f(y,R,"linkUrl",!1),M=p(y,R);y.get("display")==="BUBBLE"?j(d(V),ns.INFO,M,q):x(d(V),R,q,Y,F,M),y.get("sound")&&_n(y.get("sound"))},C=i.useCallback((R,y,O,F=null,V=null,Y=null,q=null)=>{(!F||!F.length)&&(F=d("generic.confirm")),(!V||!V.length)&&(V=d("generic.cancel")),(!Y||!Y.length)&&(Y=d("notifications.broadcast.title"));const M=new rc(q,R,y,O,F,V,Y);a(X=>[M,...X])},[]),b=(R,y=null,O=!0)=>{x(R,je.DEFAULT,y,d("mod.alert.link"),d("mod.alert.title"))},S=i.useCallback((R,y="")=>{switch(R){case ms.ALERT_SCAM:x(d("inventory.trading.warning.other_not_offering"),null,null,null,d("inventory.trading.notification.title"));return;case ms.HOTEL_TRADING_DISABLED:case ms.YOU_NOT_ALLOWED:case ms.THEY_NOT_ALLOWED:case ms.ROOM_DISABLED:case ms.YOU_OPEN:case ms.THEY_OPEN:x(d(`inventory.trading.openfail.${R}`,["otherusername"],[y]),null,null,null,d("inventory.trading.openfail.title"));return;case ms.ERROR_WHILE_COMMIT:x(`${d("inventory.trading.notification.caption")}, ${d("inventory.trading.notification.commiterror.info")}`,null,null,null,d("inventory.trading.notification.title"));return;case ms.THEY_CANCELLED:x(d("inventory.trading.info.closed"),null,null,null,d("inventory.trading.notification.title"));return}},[x]),_=i.useCallback(R=>{t(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]),T=i.useCallback(R=>{n(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]),P=i.useCallback(R=>{a(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]);U(Kg,R=>{const y=R.getParser();if(y.userId!==G().userId)return;const O=d("notifications.text.respect.1"),F=d("notifications.text.respect.2",["count"],[y.respectsReceived.toString()]);j(O,ns.RESPECT),j(F,ns.RESPECT)}),U(Xg,R=>{const y=R.getParser();x(y.message.replace(/\\r/g,"\r"),null,null,d("notifications.broadcast.title"))}),U(Qg,R=>{const y=R.getParser(),O=d("achievements.levelup.desc"),F=pa(y.data.badgeCode),V=G().getBadgeUrl(y.data.badgeCode),Y="questengine/achievements/"+y.data.category;j(O+" "+F,ns.ACHIEVEMENT,V,Y)}),U(Jg,R=>{const y=R.getParser();y.numGifts<=0||j(y.numGifts.toString(),ns.CLUBGIFT,null,"catalog/open/"+K("catalog.links")["hc.hc_gifts"])}),U(Zg,R=>{const y=R.getParser();b(y.message,y.url,!1)}),U(xm,R=>{const y=R.getParser();if(y.amountChanged<=0||y.type!==5)return;const O=K("currency.asset.icon.url","").replace("%type%",y.type.toString());j(d("notifications.text.loyalty.received",["AMOUNT"],[y.amountChanged.toString()]),ns.INFO,O)}),U(ef,R=>{const y=R.getParser();b(y.message)}),U(tf,R=>{const y=R.getParser();x(d("opening.hours."+(y.userThrowOutAtClose?"disconnected":"closed"),["h","m"],[Ju(y.openHour),Ju(y.openMinute)]),je.DEFAULT,null,null,d("opening.hours.title"))}),U(sf,R=>{const y=R.getParser(),O=d("notifications.text."+(y.boughtAsGift?"petbought":"petreceived"));let F=null;const V=H().getRoomObjectPetImage(y.pet.typeId,y.pet.paletteId,parseInt(y.pet.color,16),new At(45*3),64,null,!0);V&&(F=V.getImage().src),j(O,ns.PETLEVEL,F)}),U(nf,R=>{const O=R.getParser().messages.map(V=>Qu(V)),F=new go(O,je.MOTD,null,null,d("notifications.motd.title"));t(V=>[F,...V])}),U(rf,R=>{const y=R.getParser();let O=null;const F=H().getRoomObjectPetImage(y.figureData.typeId,y.figureData.paletteId,parseInt(y.figureData.color,16),new At(45*3),64,null,!0);F&&(O=F.getImage().src),j(d("notifications.text.petlevel",["pet_name","level"],[y.petName,y.level.toString()]),ns.PETLEVEL,O)}),U(af,R=>{const y=R.getParser();c(!y.enabled)}),U(of,R=>{const y=R.getParser();if(!y.products||!y.products.length)return;const O=y.products[0];O&&j(d("notifications.text.club_gift.selected"),ns.INFO,Zi.getProductImageUrl(O.productType,O.furniClassId,O.extraParam))}),U(lf,R=>{const y=R.getParser();x(d("maintenance.shutdown",["m","d"],[y.minutesUntilMaintenance.toString(),y.duration.toString()]),je.DEFAULT,null,null,d("opening.hours.title"))}),U(cf,R=>{const y=R.getParser();b(y.message,y.url)}),U(uf,R=>{const y=R.getParser();E(y.type,y.parameters)}),U(df,R=>{const y=R.getParser();x(d("opening.hours.shutdown",["m"],[y.openMinute.toString()]),je.DEFAULT,null,null,d("opening.hours.title"))}),U(mf,R=>{const y=R.getParser();x(d("opening.hours.disconnected",["h","m"],[y.openHour.toString(),y.openMinute.toString()]),je.DEFAULT,null,null,d("opening.hours.title"))}),U(hf,R=>{const y=R.getParser();switch(y.errorCode){default:case 0:x(d("connection.server.error.desc",["errorCode"],[y.errorCode.toString()]),je.ALERT,null,null,d("connection.server.error.title"));break;case 1001:case 1002:case 1003:case 1004:case 1005:case 1006:case 1007:case 1008:case 1009:case 1010:case 1011:case 1012:case 1013:case 1014:case 1015:case 1016:case 1017:case 1018:case 1019:R.connection.dispose();break;case 4013:x(d("connection.room.maintenance.desc"),je.ALERT,null,null,d("connection.room.maintenance.title"));break}}),U(gf,R=>{const y=R.getParser();x(d(y.alertMessage),je.DEFAULT,null,null,d(y.titleMessage?y.titleMessage:"notifications.broadcast.title"))});const k=i.useCallback(()=>{if(!m)if(zl.isRunning()){if(va)return;va=setTimeout(()=>{k()},zl.totalRunningTime+5e3)}else va&&(clearTimeout(va),va=null),j(d("mod.chatdisclaimer"),ns.INFO),h(!0)},[m,j]);return U(ff,k),{alerts:o,bubbleAlerts:s,confirms:r,simpleAlert:x,showNitroAlert:I,showTradeAlert:S,showConfirm:C,showSingleBubble:j,closeAlert:_,closeBubbleAlert:T,closeConfirm:P}},Fe=()=>dt($v),Zu=new URLSearchParams(window.location.search).get("userid")||0,Kv=(o,t)=>{o=Zu?`${o}.${Zu}`:o;const[s,n]=i.useState(()=>{try{return(typeof window<"u"?Ko(o):void 0)??t}catch{return t}});return[s,a=>{try{const l=a instanceof Function?a(s):a;n(l),typeof window<"u"&&kc(o,l)}catch(l){jm.error(l)}}]},bn=Kv,Xv=()=>bn(Za.CATALOG_PLACE_MULTIPLE_OBJECTS,!1),Eh=()=>dt(Xv),Qv=()=>bn(Za.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1),Ch=()=>dt(Qv),Jv=-12345678,Zv=()=>{const[o,t]=i.useState(!1),[s,n]=i.useState(!1),[r,a]=i.useState(-1),[l,c]=i.useState(-1),[m,h]=i.useState(Gs.NORMAL),[u,g]=i.useState(null),[f,p]=i.useState(null),[x,I]=i.useState(null),[j,E]=i.useState(null),[C,b]=i.useState([]),[S,_]=i.useState(null),[T,P]=i.useState([]),[k,R]=i.useState(null),[y,O]=i.useState(!1),[F,V]=i.useState({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null}),[Y,q]=i.useState({}),[M,X]=i.useState(!1),[he,pe]=Eh(),[qe,wt]=Ch(),[be,Qe]=i.useState(null),[Ee,Jt]=i.useState(null),[me,ge]=i.useState(0),[le,Ae]=i.useState(0),[qt,cs]=i.useState(0),[rn,Kn]=i.useState(0),[_s,On]=i.useState(0),[Re,Je]=i.useState(0),{simpleAlert:ot=null}=Fe(),Zt=i.useRef(new xr),xs=i.useCallback(()=>{a(-1),c(-1),g(null),p(null),I(null),E(null),b([]),_(null),P([]),t(!1)},[]),ja=i.useCallback(B=>{if(!B)return Un.MISSING_OFFER;if(me<0||me>=le)return Un.FURNI_LIMIT_REACHED;const z=Oe();if(!z)return Un.NOT_IN_ROOM;if(!z.isRoomOwner)return Un.NOT_ROOM_OWNER;if(rn<=0){const J=H();let oe=J.getRoomObjectCount(z.roomId,Q.UNIT);for(;oe>0;){const Ne=J.getRoomObjectByIndex(z.roomId,oe,Q.UNIT),Me=z.userDataManager.getUserDataByIndex(Ne.id);if(Me&&Me.type===gt.USER&&Me.roomIndex!==z.ownRoomIndex&&!Me.isModerator)return Un.VISITORS_IN_ROOM;oe--}}return Un.OKAY},[me,le,rn]),Ia=i.useCallback(B=>{const z=Oe();return!!((z&&B.page&&B.page.layoutCode!=="sold_ltd_items"&&m===Gs.NORMAL&&(z.isRoomOwner||z.isGuildRoom&&z.controllerLevel>=Ke.GUILD_MEMBER)||m===Gs.BUILDER&&ja(B)===Un.OKAY)&&B.pricingModel!==Bt.PRICING_MODEL_BUNDLE&&B.product.productType!==xe.EFFECT&&B.product.productType!==xe.HABBO_CLUB)},[m,ja]),Vr=i.useCallback(B=>{if(!Ia(B))return;const z=B.product;if(!z)return;let J=0;switch(z.productType){case xe.FLOOR:J=Q.FLOOR;break;case xe.WALL:J=Q.WALL;break}H().processRoomObjectPlacement(Wa.CATALOG,-B.offerId,J,z.productClassId,z.extraParam)&&(Qe(B),X(!0),t(!1))},[Ia]),ba=i.useCallback((B,z)=>{const J=H();let oe=J.getRoomInstanceVariable(J.activeRoomId,te.ROOM_WALL_TYPE),Ne=J.getRoomInstanceVariable(J.activeRoomId,te.ROOM_FLOOR_TYPE),Me=J.getRoomInstanceVariable(J.activeRoomId,te.ROOM_LANDSCAPE_TYPE);switch(oe=oe&&oe.length?oe:"101",Ne=Ne&&Ne.length?Ne:"101",Me=Me&&Me.length?Me:"1.1",B){case"floor":J.updateRoomInstancePlaneType(J.activeRoomId,z,oe,Me,!0);return;case"wallpaper":J.updateRoomInstancePlaneType(J.activeRoomId,Ne,z,Me,!0);return;case"landscape":J.updateRoomInstancePlaneType(J.activeRoomId,Ne,oe,z,!0);return;default:J.updateRoomInstancePlaneType(J.activeRoomId,Ne,oe,Me,!0);return}},[]),kn=i.useCallback(()=>{be&&(H().cancelRoomObjectInsert(),X(!1),Qe(null))},[be]),Gr=i.useCallback((B=!0)=>{X(z=>(z&&B&&Z("catalog/open"),!1))},[]),ji=i.useCallback((B=!1)=>{B||Gr(),Jt(z=>{if(z)switch(z.category){case Q.FLOOR:H().removeRoomObjectFloor(z.roomId,z.objectId);break;case Q.WALL:{switch(z.furniData.className){case"floor":case"wallpaper":case"landscape":ba("reset","");break;default:H().removeRoomObjectWall(z.roomId,z.objectId);break}break}default:H().deleteRoomObject(z.objectId,z.category);break}return null})},[Gr,ba]),Br=i.useCallback((B,z)=>{if(z.pageId===B&&z!==u)return z;for(const J of z.children){const oe=Br(B,J);if(oe)return oe}return null},[u]),hr=i.useCallback((B,z)=>{if(z.pageName===B&&z!==u)return z;for(const J of z.children){const oe=hr(B,J);if(oe)return oe}return null},[u]),an=i.useCallback((B,z=!1)=>{if(!f||!f.size)return null;if(z){const J=[],oe=f.get(B);if(oe&&oe.length)for(const Ne of oe)Ne.isVisible&&J.push(Ne);if(J.length)return J}return f.get(B)},[f]),Ii=i.useCallback((B,z)=>{B<0||(n(!0),a(B),B>-1&&D(new pf(B,z,m)))},[m]),ie=i.useCallback((B,z,J,oe,Ne,Me)=>{const bt=new lo(B,z,J,oe,Me);if(I(bt),c(Ie=>B!==-1?B:Ie),O(!1),Ne>-1&&bt.offers.length){for(const Ie of bt.offers)if(Ie.offerId===Ne){E(Ie);break}}},[]),ee=i.useCallback((B,z=-1)=>{if(kn(),B.parent.pageName==="root"&&B.children.length){for(const Ne of B.children)if(Ne.isVisible){B=Ne;break}}const J=[];let oe=B;for(;oe&&oe.pageName!=="root";)J.push(oe),oe=oe.parent;J.reverse(),b(Ne=>{const Me=Ne.indexOf(B)>=0,bt=B.isOpen;for(const Ie of Ne)Ie.deactivate(),J.indexOf(Ie)===-1&&Ie.close();for(const Ie of J)Ie.activate(),Ie.parent&&Ie.open(),Ie===B.parent&&Ie.children.length&&Ie.open();return Me&&bt?B.close():B.open(),J}),B.pageId>-1&&Ii(B.pageId,z)},[b,Ii,kn]),fe=i.useCallback(B=>{if(B!==-1&&_(null),!o)Zt.current.requestById=B,t(!0);else{const z=Br(B,u);z&&ee(z)}},[o,u,Br,ee]),ze=i.useCallback(B=>{if(_(null),!o)Zt.current.requestByName=B,t(!0);else{const z=hr(B,u);z&&ee(z)}},[o,u,hr,ee]),Ue=i.useCallback(B=>{if(_(null),!o)Zt.current.requestedByOfferId=B,t(!0);else{const z=an(B);if(!z||!z.length)return;ee(z[0],B)}},[o,an,ee]),kt=i.useCallback(()=>{},[]);return U(xf,B=>{const z=B.getParser(),J=new Map,oe=(Ne,Me,bt)=>{const Ie=new vC(Ne,Me,bt);for(const us of Ie.offerIds)J.has(us)?J.get(us).push(Ie):J.set(us,[Ie]);Me++;for(const us of Ne.children)Ie.addChild(oe(us,Me,Ie));return Ie};g(oe(z.root,0,null)),p(J)}),U(jf,B=>{const z=B.getParser();if(z.catalogType!==m)return;const J=[];for(const oe of z.offers){const Ne=[],Me=la(oe.localizationId);for(const Ie of oe.products){const us=Ql(Ie.furniClassId,Ie.productType);Ne.push(new ir(Ie.productType,Ie.furniClassId,Ie.extraParam,Ie.productCount,Me,us,Ie.uniqueLimitedItem,Ie.uniqueLimitedSeriesSize,Ie.uniqueLimitedItemsLeft))}if(!Ne.length)continue;const bt=new Bt(oe.offerId,oe.localizationId,oe.rent,oe.priceCredits,oe.priceActivityPoints,oe.priceActivityPointsType,oe.giftable,oe.clubLevel,Ne,oe.bundlePurchaseAllowed);(m===Gs.NORMAL||bt.pricingModel!==Bt.PRICING_MODEL_BUNDLE&&bt.pricingModel!==Bt.PRICING_MODEL_MULTI)&&J.push(bt)}z.frontPageItems&&z.frontPageItems.length&&P(z.frontPageItems),n(!1),r===z.pageId&&ie(z.pageId,z.layoutCode,new eh(z.localization.images.concat(),z.localization.texts.concat()),J,z.offerId,z.acceptSeasonCurrencyAsCredits)}),U(If,B=>{const z=B.getParser();Nt(new wn(z.offer))}),U(bf,B=>{const z=B.getParser();Nt(new cr(z.code))}),U(Ef,B=>{const z=B.getParser();Nt(new ni(z.code))}),U(Cf,B=>{B.getParser(),Nt(new ri)}),U(vf,B=>{const J=B.getParser().offer;if(!J||!J.products.length)return;J.products[0].uniqueLimitedItem;const Ne=[],Me=la(J.localizationId);for(const Ie of J.products){const us=Ql(Ie.furniClassId,Ie.productType);Ne.push(new ir(Ie.productType,Ie.furniClassId,Ie.extraParam,Ie.productCount,Me,us,Ie.uniqueLimitedItem,Ie.uniqueLimitedSeriesSize,Ie.uniqueLimitedItemsLeft))}const bt=new Bt(J.offerId,J.localizationId,J.rent,J.priceCredits,J.priceActivityPoints,J.priceActivityPointsType,J.giftable,J.clubLevel,Ne,J.bundlePurchaseAllowed);(m===Gs.NORMAL||bt.pricingModel!==Bt.PRICING_MODEL_BUNDLE&&bt.pricingModel!==Bt.PRICING_MODEL_MULTI)&&(bt.page=x,E(bt),bt.product&&bt.product.productType===xe.WALL&&V(Ie=>{const us={...Ie};return us.extraData=bt.product.extraParam||null,us}))}),U(Nf,B=>{const z=B.getParser(),J=new NC(z.productCode,z.palettes.slice());q(oe=>{const Ne=[];oe.petPalettes&&Ne.push(...oe.petPalettes);for(let Me=0;Me<Ne.length;Me++)if(Ne[Me].breed===J.breed){Ne.splice(Me,1);break}return Ne.push(J),{...oe,petPalettes:Ne}})}),U(_f,B=>{const z=B.getParser();q(J=>{const oe=z.offers;return{...J,clubOffers:oe}})}),U(Sf,B=>{const z=B.getParser();q(J=>{const oe=z.groups;return{...J,groups:oe}})}),U(wf,B=>{const z=B.getParser();q(J=>{const oe=new OC(z);return{...J,giftConfiguration:oe}})}),U(Tf,B=>{const z=B.getParser();if(!z)return;let J="";z.result===1?J=d("inventory.marketplace.result.title.success"):J=d("inventory.marketplace.result.title.failure");const oe=d(`inventory.marketplace.result.${z.result}`);ot(oe,je.DEFAULT,null,null,J)}),U(Im,B=>{const z=B.getParser();q(J=>({...J,clubGifts:z}))}),U(yf,B=>{const z=o;xs(),z&&ot(d("catalog.alert.published.description"),je.ALERT,null,null,d("catalog.alert.published.title"))}),U(Rf,B=>{const z=B.getParser();ge(z.furniCount),kt()}),U(Of,B=>{const z=B.getParser();Ae(z.furniLimit),cs(z.maxFurniLimit),Kn(z.secondsLeft),On(Ms()),Je(z.secondsLeftWithGrace),kt()}),ut(wn.PURCHASE_SUCCESS,B=>_n(Sn.CREDITS)),we(nu.PLACED,B=>{if(!M||B.type!==nu.PLACED)return;if(ji(!0),!be){Gr();return}let z=!1;const J=be.product;if(B.category===Q.WALL)switch(J.furnitureData.className){case"floor":case"wallpaper":case"landscape":z=B.placedOnFloor||B.placedOnWall;break;default:z=B.placedInRoom;break}else z=B.placedInRoom;if(!z){Gr();return}switch(Jt(new kC(B.roomId,B.objectId,B.category,B.wallLocation,B.x,B.y,B.direction,be)),m){case Gs.NORMAL:{switch(B.category){case Q.FLOOR:H().addFurnitureFloor(B.roomId,B.objectId,J.productClassId,new At(B.x,B.y,B.z),new At(B.direction),0,new Df);break;case Q.WALL:switch(J.furnitureData.className){case"floor":case"wallpaper":case"landscape":ba(J.furnitureData.className,J.extraParam);break;default:H().addFurnitureWall(B.roomId,B.objectId,J.productClassId,new At(B.x,B.y,B.z),new At(B.direction*45),0,B.instanceData,0);break}}const oe=H().getRoomObject(B.roomId,B.objectId,B.category);oe&&oe.model.setValue(te.FURNITURE_ALPHA_MULTIPLIER,.5),qe&&D(new zo(r,be.offerId,J.extraParam,1)),he&&Vr(be);break}case Gs.BUILDER:{let oe=be.page.pageId;switch(oe===Jv&&(oe=-1),B.category){case Q.FLOOR:D(new Af(oe,be.offerId,J.extraParam,B.x,B.y,B.direction));break;case Q.WALL:D(new kf(oe,be.offerId,J.extraParam,B.wallLocation));break}he&&Vr(be);break}}}),ut(ii.FURNI_ADDED,B=>{const z=H();if(!(!Ee||Ee.productClassId!==B.spriteId||Ee.roomId!==z.activeRoomId)){switch(B.category){case de.FLOOR:{const J=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_FLOOR_TYPE);Ee.extraParam!==J&&D(new Ji(B.id));break}case de.WALL_PAPER:{const J=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_WALL_TYPE);Ee.extraParam!==J&&D(new Ji(B.id));break}case de.LANDSCAPE:{const J=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_LANDSCAPE_TYPE);Ee.extraParam!==J&&D(new Ji(B.id));break}default:D(new Pf(B.id,Ee.category,Ee.wallLocation,Ee.x,Ee.y,Ee.direction))}he||ji()}}),i.useEffect(()=>()=>E(null),[x]),i.useEffect(()=>{if(!(!o||!u||!f||!Zt.current))switch(Zt.current.requestType){case xr.REQUEST_TYPE_NONE:if(x)return;if(u.isBranch){for(const B of u.children)if(B&&B.isVisible){ee(B);return}}return;case xr.REQUEST_TYPE_ID:fe(Zt.current.requestById),Zt.current.resetRequest();return;case xr.REQUEST_TYPE_OFFER:Ue(Zt.current.requestedByOfferId),Zt.current.resetRequest();return;case xr.REQUEST_TYPE_NAME:ze(Zt.current.requestByName),Zt.current.resetRequest();return}},[o,u,f,x,ee,fe,Ue,ze]),i.useEffect(()=>{!S&&x&&x.pageId===-1&&fe(l)},[S,x,l,fe]),i.useEffect(()=>{j&&V({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null})},[j]),i.useEffect(()=>{!o||u||(D(new Lf),D(new bm),D(new Mf(m)),D(new Uf))},[o,u,m]),i.useEffect(()=>(R(new ro(H(),++ro.PREVIEW_COUNTER)),()=>{R(B=>(B.dispose(),null))}),[]),{isVisible:o,setIsVisible:t,isBusy:s,pageId:r,previousPageId:l,currentType:m,rootNode:u,offersToNodes:f,currentPage:x,setCurrentPage:I,currentOffer:j,setCurrentOffer:E,activeNodes:C,searchResult:S,setSearchResult:_,frontPageItems:T,roomPreviewer:k,navigationHidden:y,setNavigationHidden:O,purchaseOptions:F,setPurchaseOptions:V,catalogOptions:Y,setCatalogOptions:q,getNodeById:Br,getNodeByName:hr,activateNode:ee,openPageById:fe,openPageByName:ze,openPageByOfferId:Ue,requestOfferToMover:Vr}},Le=()=>dt(Zv),eN=1e3,tN=10,sN=1e3;let ed=0,nN=0;const rN=()=>{const[o,t]=bn("chatHistory",[]),[s,n]=bn("roomHistory",[]),[r,a]=bn("messengerHistory",[]),[l,c]=bn("needsRoomInsert",!1),m=f=>{f.id=ed++,t(p=>{const x=[...p];return x.push(f),x.length>eN&&x.shift(),x})},h=f=>{n(p=>{const x=[...p];return x.push(f),x.length>tN&&x.shift(),x})},u=f=>{f.id=nN++,a(p=>{const x=[...p];return x.push(f),x.length>sN&&x.shift(),x})},g=()=>{t([]),ed=0};return He(Lt.STARTED,f=>c(!0)),U(fa,f=>{if(!l)return;const p=f.getParser();s.length&&s[s.length-1].id===p.data.roomId||(m({id:-1,webId:-1,entityId:-1,name:p.data.roomName,timestamp:lh(),type:tn.TYPE_ROOM_INFO,roomId:p.data.roomId}),h({id:p.data.roomId,name:p.data.roomName}),c(!1))}),U(Em,f=>{const p=f.getParser();u({id:-1,webId:p.senderId,entityId:-1,name:"",message:p.messageText,roomId:-1,timestamp:Pu(p.secondsSinceSent),type:tn.TYPE_IM})}),U(Cm,f=>{const p=f.getParser();u({id:-1,webId:p.senderId,entityId:-1,name:"",message:p.messageText,roomId:-1,timestamp:Pu(),type:tn.TYPE_IM})}),{addChatEntry:m,chatHistory:o,roomHistory:s,messengerHistory:r,clearChatHistory:g}},gi=()=>dt(rN),aN=()=>{const[o,t]=i.useState([]),[s,n]=i.useState([]),[r,a]=i.useState([]),[l,c]=i.useState([]),[m,h]=i.useState(null),{simpleAlert:u}=Fe(),g=i.useMemo(()=>{const b=o.filter(S=>S.online);return b.sort((S,_)=>S.name<_.name?-1:S.name>_.name?1:0),b},[o]),f=i.useMemo(()=>{const b=o.filter(S=>!S.online);return b.sort((S,_)=>S.name<_.name?-1:S.name>_.name?1:0),b},[o]),p=b=>D(new vc(b.id)),x=(b,S)=>S!==b.relationshipStatus&&D(new Na(b.id,S)),I=b=>{for(const S of o)if(S.id===b)return S;return null},j=b=>!(b===G().userId||I(b)||s.find(S=>S.requesterUserId===b)||r.indexOf(b)>=0),E=(b,S)=>{if(!j(b))return!1;a(_=>{const T=[..._];return T.push(b),T}),D(new vm(S))},C=(b,S)=>{b===-1&&!S?(D(new ru(!0)),n([])):n(_=>{const T=[..._],P=T.findIndex(k=>k.id===b);return P===-1?_:(D(S?new $f(T[P].id):new ru(!1,T[P].id)),T.splice(P,1),T)})};return U(Vf,b=>{const S=b.getParser();h(new uv(S.userFriendLimit,S.normalFriendLimit,S.extendedFriendLimit,S.categories)),D(new Ff)}),U(Gf,b=>{const S=b.getParser();t(_=>{const T=[..._];for(const P of S.fragment){const k=T.findIndex(y=>y.id===P.id),R=new hs;R.populate(P),k>-1?T[k]=R:T.push(R)}return T})}),U(Bf,b=>{const S=b.getParser();t(_=>{const T=[..._],P=k=>{const R=T.findIndex(y=>y.id===k.id);if(R===-1){const y=new hs;y.populate(k),T.unshift(y)}else T[R].populate(k)};for(const k of S.addedFriends)P(k);for(const k of S.updatedFriends)P(k);for(const k of S.removedFriendIds){const R=T.findIndex(y=>y.id===k);R>-1&&T.splice(R,1)}return T})}),U(Hf,b=>{const S=b.getParser();n(_=>{const T=[..._];for(const P of S.requests){const k=T.findIndex(R=>R.requesterUserId===P.requesterUserId);if(k>=0)T[k]=is(T[k]),T[k].populate(P);else{const R=new Lu;R.populate(P),T.push(R)}}return T})}),U(Wf,b=>{const _=b.getParser().request;n(T=>{const P=[...T];if(P.findIndex(R=>R.requesterUserId===_.requesterUserId)===-1){const R=new Lu;R.populate(_),P.push(R)}return P})}),U(qf,b=>{const S=b.getParser();S&&u(d(S.success?"friendbar.find.success.text":"friendbar.find.error.text"),"","","",d(S.success?"friendbar.find.success.title":"friendbar.find.error.title"))}),i.useEffect(()=>{D(new zf);const b=window.setInterval(()=>D(new Yf),12e4);return()=>{clearInterval(b)}},[]),{friends:o,requests:s,sentRequests:r,dismissedRequestIds:l,setDismissedRequestIds:c,settings:m,onlineFriends:g,offlineFriends:f,getFriend:I,canRequestFriend:j,requestFriend:E,requestResponse:C,followFriend:p,updateRelationship:x}},fs=()=>dt(aN),iN=()=>{const[o,t]=i.useState([]),[s,n]=i.useState(-1),[r,a]=i.useState([]),[l,c]=i.useState(In.HIDDEN),{getFriend:m=null}=fs(),{simpleAlert:h=null}=Fe(),u=i.useMemo(()=>o.filter(I=>r.indexOf(I.threadId)===-1),[o,r]),g=i.useMemo(()=>s>0&&u.find(I=>I.threadId===s||null),[s,u]),f=I=>{let j=o.find(E=>E.participant&&E.participant.id===I);if(j){const E=r.indexOf(j.threadId);E>=0&&a(C=>{const b=[...C];return b.splice(E,1),b})}else{const E=m(I);if(!E)return null;j=new sc(E),j.addMessage(null,d("messenger.moderationinfo"),0,null,Hn.SECURITY_NOTIFICATION),j.setRead(),t(C=>{const b=[...C];return b.push(j),b})}return j},p=I=>{a(j=>{const E=[...j];return E.indexOf(I)>=0?j:(E.push(I),E)}),s===I&&n(-1)},x=(I,j,E,C=0,b=null,S=Hn.CHAT)=>{if(!I||!E||!E.length)return;const _=j===G().userId;_&&E.length<=255&&D(new Xf(I.participant.id,E)),t(T=>{const P=[...T],k=P.findIndex(R=>R.threadId===I.threadId);return k===-1?T:(I=is(P[k]),_&&I.groups.length===1&&_n(Sn.MESSENGER_NEW_THREAD),I.addMessage(S===Hn.ROOM_INVITE?null:j,E,C,b,S),s===I.threadId&&I.setRead(),P[k]=I,!_&&I.unread&&_n(Sn.MESSENGER_MESSAGE_RECEIVED),P)})};return U(Em,I=>{const j=I.getParser(),E=f(j.senderId);E&&x(E,j.senderId,j.messageText,j.secondsSinceSent,j.extraData)}),U(Cm,I=>{const j=I.getParser(),E=f(j.senderId);E&&x(E,j.senderId,j.messageText,0,null,Hn.ROOM_INVITE)}),U(Kf,I=>{const j=I.getParser();h(`Received room invite error: ${j.errorCode},recipients: ${j.failedRecipients}`,je.DEFAULT,null,null,d("friendlist.alert.title"))}),i.useEffect(()=>{s<=0||t(I=>{const j=[...I],E=j.findIndex(C=>C.threadId===s);return E>=0&&(j[E]=is(j[E]),j[E].setRead()),j})},[s]),i.useEffect(()=>{c(I=>{if(!u.length)return In.HIDDEN;let j=!1;for(const E of u)if(E.unreadCount>0){j=!0;break}return j?In.UNREAD:In.SHOW})},[u]),{messageThreads:o,activeThread:g,iconState:l,visibleThreads:u,getMessageThread:f,setActiveThreadId:n,closeThread:p,sendMessage:x}},vh=()=>dt(iN),oN=()=>{const[o,t]=i.useState(!1),[s,n]=i.useState(null),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(!1),[u,g]=i.useState(null);return U(Qf,f=>{let p=f.getParser();!p||p&&!p.games.length||(a(p.games[0]),n(p.games))}),U(Jf,f=>{let p=f.getParser();p&&c(p)}),U(Zf,f=>{let p=f.getParser();p&&h(p.isInMaintenance)}),U(ep,f=>{let p=f.getParser();if(p)switch(p.gameTypeId){case 2:return console.log("snowwar");default:return g(p.url)}}),i.useEffect(()=>{o&&(D(new tp),Sc())},[o]),{isVisible:o,setIsVisible:t,games:s,accountStatus:l,selectedGame:r,setSelectedGame:a,gameOffline:m,gameURL:u,setGameURL:g}},sl=()=>dt(oN),lN=()=>{const[o,t]=i.useState(null);return U(sp,s=>{const n=s.getParser(),r={badgeBases:[],badgeSymbols:[],badgePartColors:[],groupColorsA:[],groupColorsB:[]};n.bases.forEach((l,c)=>r.badgeBases.push({id:c,images:l})),n.symbols.forEach((l,c)=>r.badgeSymbols.push({id:c,images:l})),n.partColors.forEach((l,c)=>r.badgePartColors.push({id:c,color:l})),n.colorsA.forEach((l,c)=>r.groupColorsA.push({id:c,color:l})),n.colorsB.forEach((l,c)=>r.groupColorsB.push({id:c,color:l}));const a=(l,c)=>l.id<c.id?-1:l.id>c.id?1:0;r.badgeBases.sort(a),r.badgeSymbols.sort(a),r.badgePartColors.sort(a),r.groupColorsA.sort(a),r.groupColorsB.sort(a),t(r)}),i.useEffect(()=>{D(new np)},[]),{groupCustomize:o}},fi=()=>dt(lN),cN=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),{simpleAlert:r=null,showConfirm:a=null}=Fe(),l=(c,m)=>{const h={reportType:c,reportedUserId:-1,reportedChats:[],cfhCategory:-1,cfhTopic:-1,roomId:-1,roomName:"",messageId:-1,threadId:-1,groupId:-1,extraData:"",roomObjectId:-1,message:"",currentStep:0};switch(c){case rt.BULLY:case rt.EMERGENCY:case rt.IM:h.reportedUserId=m.reportedUserId,h.currentStep=Qt.SELECT_CHATS;break;case rt.ROOM:h.roomId=m.roomId,h.roomName=m.roomName,h.currentStep=Qt.SELECT_TOPICS;break;case rt.THREAD:h.groupId=m.groupId,h.threadId=m.threadId,h.currentStep=Qt.SELECT_TOPICS;break;case rt.MESSAGE:h.groupId=m.groupId,h.threadId=m.threadId,h.messageId=m.messageId,h.currentStep=Qt.SELECT_TOPICS;break;case rt.PHOTO:h.extraData=m.extraData,h.roomId=m.roomId,h.reportedUserId=m.reportedUserId,h.roomObjectId=m.roomObjectId,h.currentStep=Qt.SELECT_TOPICS;break}t(h)};return U(ap,c=>{const m=c.getParser();let h=m.messageText;switch(m.resultType){case ho.TOO_MANY_PENDING_CALLS_CODE:D(new rp),r(d("help.cfh.error.pending"),je.MODERATION,null,null,d("help.cfh.error.title"));break;case ho.HAS_ABUSIVE_CALL_CODE:r(d("help.cfh.error.abusive"),je.MODERATION,null,null,d("help.cfh.error.title"));break;default:h.trim().length===0&&(h=d("help.cfh.sent.text")),r(h,je.MODERATION,null,null,d("help.cfh.sent.title"))}}),U(ip,c=>{const m=c.getParser(),h=m.messageText.length===0?d("help.cfh.closed."+xv(m.closeReason)):m.messageText;r(h,je.MODERATION,null,null,d("mod.alert.title"))}),U(lp,c=>{const m=c.getParser();m.count>0&&a(d("help.emergency.pending.title")+`
|
||
`+m.pendingCalls[0].message,()=>{D(new op)},null,d("help.emergency.pending.button.discard"),d("help.emergency.pending.button.keep"),d("help.emergency.pending.message.subtitle"))}),U(cp,c=>{r("Your pending calls were deleted",je.MODERATION,null,null,d("mod.alert.title"))}),U(up,c=>{const m=c.getParser();r(m.message,je.MODERATION,null,null,d("help.cfh.reply.title"))}),U(dp,c=>{const m=c.getParser();r(d("help.emergency.global_mute.message"),je.MODERATION,m.infoUrl,d("help.emergency.global_mute.link"),d("help.emergency.global_mute.subtitle"))}),U(mp,c=>{const m=c.getParser();n(m)}),{activeReport:o,setActiveReport:t,sanctionInfo:s,setSanctionInfo:n,report:l}},Ws=()=>dt(cN),nl=()=>{const[o,t]=i.useState([]),s=i.useMemo(()=>!!o.length,[o]),n=i.useCallback(()=>{let a=-1;return t(l=>{const c=[...l];return a=c.length?c[c.length-1]+1:0,c.push(a),c}),a},[]),r=i.useCallback(a=>{t(l=>{const c=[...l],m=c.indexOf(a);return m===-1?l:(c.splice(m,1),c)})},[]);return{isVisible:s,activate:n,deactivate:r}},uN=o=>D(new gp(o)),dN=(o,t)=>D(new fp(o,...t)),mN=()=>{const[o,t]=i.useState(new Map),s=i.useCallback(m=>{var h;return((h=o.get(m))==null?void 0:h.length)||0},[o]),n=i.useMemo(()=>{let m=0;for(const h of o.keys())m+=s(h);return m},[o,s]),r=i.useCallback(m=>{let h=!0;return t(u=>{if(!u.has(m))return h=!1,u;const g=new Map(u);return g.delete(m),uN(m),g}),h},[]),a=i.useCallback((m,h)=>{let u=!0;return t(g=>{if(!g.has(m))return u=!1,g;const f=new Map(g),p=f.get(m);if(p)for(const x of h)p.splice(p.indexOf(x),1);return dN(m,h),f}),u},[]),l=i.useCallback((m,h)=>o.has(m)?o.get(m).indexOf(h)>=0:!1,[o]),c=i.useCallback((m,h)=>{t(u=>{if(!u.has(m))return u;const g=new Map(u),f=g.get(m),p=f.indexOf(h);return p>=0&&f.splice(p,1),g})},[]);return U(hp,m=>{const h=m.getParser();t(u=>{const g=new Map(u);for(const f of h.categories){let p=g.get(f);p||(p=[],g.set(f,p));const x=h.getItemsByCategory(f);for(const I of x)p.indexOf(I)===-1&&p.push(I)}return g})}),{getCount:s,getFullCount:n,resetCategory:r,resetItems:a,isUnseen:l,removeUnseen:c}},Os=()=>dt(mN),hN=()=>{const[o,t]=i.useState(!0),[s,n]=i.useState([]),[r,a]=i.useState(new Map),[l,c]=i.useState([]),[m,h]=i.useState(null),{isVisible:u=!1,activate:g=null,deactivate:f=null}=nl(),{isUnseen:p=null,resetCategory:x=null}=Os(),I=K("user.badges.max.slots",5),j=S=>l.indexOf(S)>=0,E=()=>l.length<I,C=S=>{c(_=>{const T=[..._],P=T.indexOf(S);if(P===-1){if(!E())return _;T.push(S)}else T.splice(P,1);const k=new Ip;for(let R=0;R<I;R++)k.addActivatedBadge(T[R]??"");return D(k),T})},b=S=>s.indexOf(S)===-1?0:r.get(S)??0;return U(pp,S=>{const _=S.getParser(),T=[];a(P=>{const k=new Map(P);return _.getAllBadgeCodes().forEach(R=>{const y=s.indexOf(R)>=0,O=_.getBadgeId(R);k.set(R,O),!y&&T.push(R)}),k}),c(_.getActiveBadgeCodes()),n(P=>[...P,...T])}),U(xp,S=>{const _=S.getParser(),T=p(at.BADGE,_.badgeId);n(P=>{const k=[...P];return T?k.unshift(_.badgeCode):k.push(_.badgeCode),k}),a(P=>{const k=new Map(P);return k.set(_.badgeCode,_.badgeId),k})}),i.useEffect(()=>{!s||!s.length||h(S=>{let _=S;return _&&s.indexOf(_)===-1&&(_=null),_||(_=s[0]),_})},[s]),i.useEffect(()=>{if(u)return()=>{x(at.BADGE)}},[u,x]),i.useEffect(()=>{!u||!o||(D(new jp),t(!1))},[u,o]),{badgeCodes:s,activeBadgeCodes:l,selectedBadgeCode:m,setSelectedBadgeCode:h,isWearingBadge:j,canWearBadges:E,toggleBadge:C,getBadgeId:b,activate:g,deactivate:f}},pi=()=>dt(hN),gN=()=>{const[o,t]=i.useState(!0),[s,n]=i.useState([]),[r,a]=i.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=nl(),{isUnseen:h=null,resetCategory:u=null}=Os();return U(bp,g=>{const f=g.getParser();n(p=>{const x=[...p],I=x.map(E=>E.botData.id),j=[];for(const E of f.items.values())I.indexOf(E.id)===-1&&j.push(E);for(const E of I){let C=!0;for(const _ of f.items.values())if(_.id===E){C=!1;break}if(!C)continue;const b=x.findIndex(_=>_.botData.id===E),S=x[b];b===-1||!S||(ma()===S.botData.id&&(ti(),Z("inventory/open")),x.splice(b,1))}for(const E of j){const C={botData:E};h(at.BOT,E.id)?x.unshift(C):x.push(C)}return x})}),U(Ep,g=>{const f=g.getParser();n(p=>{const x=[...p];if(x.findIndex(C=>C.botData.id===f.item.id)>=0)return p;const j={botData:f.item};return h(at.BOT,j.botData.id)?x.unshift(j):x.push(j),x})}),U(Cp,g=>{const f=g.getParser();n(p=>{const x=[...p],I=x.findIndex(j=>j.botData.id===f.itemId);return I===-1?p:(x.splice(I,1),ma()===f.itemId&&(ti(),Z("inventory/show")),x)})}),i.useEffect(()=>{!s||!s.length||a(g=>{let f=g;return f&&s.indexOf(f)===-1&&(f=null),f||(f=s[0]),f})},[s]),i.useEffect(()=>{if(l)return()=>{u(at.BOT)}},[l,u]),i.useEffect(()=>{!l||!o||(D(new vp),t(!1))},[l,o]),{botItems:s,selectedBot:r,setSelectedBot:a,activate:c,deactivate:m}},Nh=()=>dt(gN);let Mi=null;const fN=()=>{const[o,t]=i.useState(!0),[s,n]=i.useState([]),[r,a]=i.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=nl(),{isUnseen:h=null,resetCategory:u=null}=Os(),g=x=>{if(!(!s||!s.length))return s.filter(I=>I.type===x)},f=x=>{if(!(!s||!s.length)){for(const I of s){const j=I.getItemById(x);if(j&&j.isWallItem)return I}return null}},p=x=>{if(!(!s||!s.length)){for(const I of s){const j=I.getItemById(x);if(j&&!j.isWallItem)return I}return null}};return U(Nm,x=>{const I=x.getParser();n(j=>{const E=[...j];for(const C of I.items){let b=0,S=null;for(;b<E.length;){const _=E[b];let T=0;for(;T<_.items.length;){const P=_.items[T];if(P.id===C.itemId){P.update(C);const k=[..._.items];k[T]=P,_.items=k,S=_;break}T++}if(S)break;b++}if(S)S.hasUnseenItems=!0,E[b]=is(S);else{const _=new ei(C);yu(E,_,h(at.FURNI,C.itemId)),Nt(new ii(_.id,_.type,_.category))}}return E})}),U(Yl,x=>{const I=x.getParser();Mi||(Mi=new Array(I.totalFragments));const j=zC(I.fragment,I.totalFragments,I.fragmentNumber,Mi);j&&(n(E=>{const C=[...E],b=YC(C);for(const S of b){if(j.get(S))continue;let _=0;for(;_<C.length;){const T=C[_],P=T.remove(S);if(!P){_++;continue}ma()===P.ref&&(ti(),ha(T)||Z("inventory/show")),T.getTotalCount()<=0&&(C.splice(_,1),T.dispose());break}}for(const S of j.keys()){if(b.indexOf(S)>=0)continue;const _=j.get(S);if(!_)continue;const T=new ei(_);yu(C,T,h(at.FURNI,S)),Nt(new ii(T.id,T.type,T.category))}return C}),Mi=null)}),U(Np,x=>{t(!0)}),U(_m,x=>{const I=x.getParser();n(j=>{const E=[...j];let C=0;for(;C<E.length;){const b=E[C],S=b.remove(I.itemId);if(!S){C++;continue}ma()===S.ref&&(ti(),ha(b)||Z("inventory/show")),b.getTotalCount()<=0&&(E.splice(C,1),b.dispose());break}return E})}),U(_p,x=>{}),i.useEffect(()=>{!s||!s.length||a(x=>{let I=x;return I&&s.indexOf(I)===-1&&(I=null),I||(I=s[0]),I})},[s]),i.useEffect(()=>{if(l)return()=>{u(at.FURNI)&&n(x=>{const I=[...x];for(const j of I)j.hasUnseenItems=!1;return I})}},[l,u]),i.useEffect(()=>{!l||!o||(D(new Sp),t(!1))},[l,o]),{isVisible:l,groupItems:s,setGroupItems:n,selectedItem:r,setSelectedItem:a,activate:c,deactivate:m,getWallItemById:f,getFloorItemById:p,getItemsByType:g}},dr=()=>dt(fN);let Ui=null;const pN=()=>{const[o,t]=i.useState(!0),[s,n]=i.useState([]),[r,a]=i.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=nl(),{isUnseen:h=null,resetCategory:u=null}=Os();return U(wp,g=>{const f=g.getParser();Ui||(Ui=new Array(f.totalFragments));const p=QC(f.fragment,f.totalFragments,f.fragmentNumber,Ui);p&&(n(x=>{const I=[...x];return XC(I,p,h),I}),Ui=null)}),U(Tp,g=>{const f=g.getParser();n(p=>{const x=[...p];return ih(f.pet,x,h(at.PET,f.pet.id)),x})}),U(yp,g=>{const f=g.getParser();n(p=>{const x=[...p];return oh(f.petId,x),x})}),i.useEffect(()=>{!s||!s.length||a(g=>{let f=g;return f&&s.indexOf(f)===-1&&(f=null),f||(f=s[0]),f})},[s]),i.useEffect(()=>{if(l)return()=>{u(at.PET)}},[l,u]),i.useEffect(()=>{!l||!o||(D(new Rp),t(!1))},[l,o]),{petItems:s,selectedPet:r,setSelectedPet:a,activate:c,deactivate:m}},_h=()=>dt(pN),xN=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),[r,a]=i.useState(yt.TRADING_STATE_READY),{groupItems:l=[],setGroupItems:c=null,activate:m=null,deactivate:h=null}=dr(),{simpleAlert:u=null,showTradeAlert:g=null}=Fe(),f=r>=yt.TRADING_STATE_RUNNING,p=()=>{switch(r){case yt.TRADING_STATE_RUNNING:!s.itemCount&&!o.accepts&&u(d("inventory.trading.warning.other_not_offering"),null,null,null),o.accepts?D(new zp):D(new Yp);return;case yt.TRADING_STATE_CONFIRMING:D(new qp),a(yt.TRADING_STATE_CONFIRMED);return}},x=j=>{const E=j.getLastItem();E&&D(new Wp(E.id))},I=()=>{if(f)switch(r){case yt.TRADING_STATE_RUNNING:D(new Hp);return;default:D(new Bp);return}};return U(Op,j=>{const E=j.getParser();!o||!s||(o.userId===E.userID?t(C=>{const b=is(C);return b.accepts=E.userAccepts,b}):s.userId===E.userID&&n(C=>{const b=is(C);return b.accepts=E.userAccepts,b}))}),U(Ap,j=>{const E=j.getParser();E.reason===kp.ERROR_WHILE_COMMIT?g(ms.ERROR_WHILE_COMMIT):o&&E.userID!==o.userId&&g(ms.THEY_CANCELLED),t(null),n(null),a(yt.TRADING_STATE_READY)}),U(Dp,j=>{j.getParser(),t(null),n(null),a(yt.TRADING_STATE_READY)}),U(Pp,j=>{j.getParser(),a(yt.TRADING_STATE_COUNTDOWN)}),U(Lp,j=>{const E=j.getParser(),C=ku(E.firstUserItemArray),b=ku(E.secondUserItemArray);t(S=>{const _=is(S);_.userId===E.firstUserID?(_.creditsCount=E.firstUserNumCredits,_.itemCount=E.firstUserNumItems,_.userItems=C):(_.creditsCount=E.secondUserNumCredits,_.itemCount=E.secondUserNumItems,_.userItems=b);const T=[];for(const P of _.userItems.getValues()){let k=0;for(;k<P.getTotalCount();){const R=P.getItemByIndex(k);R&&T.push(R.ref),k++}}return c(P=>{const k=[...P];for(const R of k)R.lockItemIds(T);return k}),_}),n(S=>{const _=is(S);return _.userId===E.firstUserID?(_.creditsCount=E.firstUserNumCredits,_.itemCount=E.firstUserNumItems,_.userItems=C):(_.creditsCount=E.secondUserNumCredits,_.itemCount=E.secondUserNumItems,_.userItems=b),_})}),U(Mp,j=>{j.getParser()}),U(Up,j=>{const E=j.getParser(),C=new Ru,b=Oe().userDataManager.getUserData(E.userID);C.userItems=new qa;const S=new Ru,_=Oe().userDataManager.getUserData(E.otherUserID);S.userItems=new qa,b.webID===G().userId?(C.userId=b.webID,C.userName=b.name,C.canTrade=E.userCanTrade,S.userId=_.webID,S.userName=_.name,S.canTrade=E.otherUserCanTrade):_.webID===G().userId&&(C.userId=_.webID,C.userName=_.name,C.canTrade=E.otherUserCanTrade,S.userId=b.webID,S.userName=b.name,S.canTrade=E.userCanTrade),t(C),n(S),a(yt.TRADING_STATE_RUNNING)}),U(Fp,j=>{const E=j.getParser();g(E.reason,E.otherUserName)}),U(Vp,j=>{j.getParser(),g(ms.THEY_NOT_ALLOWED)}),U(Gp,j=>{j.getParser(),g(ms.YOU_NOT_ALLOWED)}),i.useEffect(()=>{if(r===yt.TRADING_STATE_READY)return;const j=m();return()=>h(j)},[r,m,h]),{ownUser:o,otherUser:s,tradeState:r,setTradeState:a,isTrading:f,groupItems:l,progressTrade:p,removeItem:x,stopTrading:I}},Vc=()=>dt(xN),jN=()=>{const[o,t]=i.useState(null),[s,n]=i.useState([]),[r,a]=i.useState([]),[l,c]=i.useState([]),[m,h]=i.useState([]),[u,g]=i.useState([]),[f,p]=i.useState([]),{simpleAlert:x=null}=Fe(),I=O=>{s.indexOf(O)>=0||n(F=>[...F,O])},j=O=>{n(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},E=O=>{s.indexOf(O)>=0?j(O):I(O)},C=O=>{r.indexOf(O)>=0||a(F=>[...F,O])},b=O=>{a(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},S=O=>{r.indexOf(O)>=0?b(O):C(O)},_=O=>{l.indexOf(O)>=0||c(F=>[...F,O])},T=O=>{c(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},P=O=>{l.indexOf(O)>=0?T(O):_(O)},k=O=>{m.indexOf(O)>=0||h(F=>[...F,O])},R=O=>{h(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},y=O=>{r.indexOf(O)>=0?R(O):k(O)};return U($p,O=>{const V=O.getParser().data;t(V),g(V.issues)}),U(Kp,O=>{const F=O.getParser();g(V=>{const Y=[...V],q=Y.findIndex(M=>M.issueId===F.issueData.issueId);return q>=0?Y[q]=F.issueData:(Y.push(F.issueData),_n(Sn.MODTOOLS_NEW_TICKET)),Y})}),U(Xp,O=>{O.getParser()}),U(Qp,O=>{O.getParser()&&x("Failed to pick issue",je.DEFAULT,null,null,"Error")}),U(Jp,O=>{const F=O.getParser();g(V=>{const Y=[...V],q=Y.findIndex(M=>M.issueId===F.issueId);return q>=0&&Y.splice(q,1),Y})}),U(Zp,O=>{O.getParser().success?x("Moderation action was successfull",je.MODERATION,null,null,"Success"):x("There was a problem applying tht moderation action",je.MODERATION,null,null,"Error")}),U(ex,O=>{const F=O.getParser();p(F.callForHelpCategories)}),U(tx,O=>{O.getParser()}),{settings:o,openRooms:s,openRoomChatlogs:r,openUserChatlogs:m,openUserInfos:l,cfhCategories:f,tickets:u,openRoomInfo:I,closeRoomInfo:j,toggleRoomInfo:E,openRoomChatlog:C,closeRoomChatlog:b,toggleRoomChatlog:S,openUserInfo:_,closeUserInfo:T,toggleUserInfo:P,openUserChatlog:k,closeUserChatlog:R,toggleUserChatlog:y}},xa=()=>dt(jN),IN=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState({roomInfo:null,state:We.NONE}),[u,g]=i.useState(null),[f,p]=i.useState(""),[x,I]=i.useState(null),[j,E]=i.useState({settingsReceived:!1,homeRoomId:0,enteredGuestRoom:null,currentRoomOwner:!1,currentRoomId:0,currentRoomIsStaffPick:!1,createdFlatId:0,avatarId:0,roomPicker:!1,eventMod:!1,currentRoomRating:0,canRate:!0}),{simpleAlert:C=null}=Fe();return U(sx,b=>{const S=b.getParser();D(new no(S.roomId,!1,!1))}),U(nx,b=>{const S=b.getParser();S.canCreate||C(d(`navigator.cannotcreateevent.error.${S.errorCode}`),null,null,null,d("navigator.cannotcreateevent.title"))}),U(wm,b=>{D(new rx),D(new Sm)}),U(ax,b=>{const S=b.getParser();E(_=>{const T={..._};return T.eventMod=S.securityLevel>=ao.MODERATOR,T.roomPicker=S.securityLevel>=ao.COMMUNITY,T})}),U(ix,b=>{const S=b.getParser();os(S.roomId)}),U(Tm,b=>{const S=b.getParser();E(_=>{const T={..._};return T.enteredGuestRoom=null,T.currentRoomOwner=S.isOwner,T.currentRoomId=S.roomId,T}),D(new no(S.roomId,!0,!1)),Ya.available&&Ya.call("legacyTrack","navigator","private",[S.roomId])}),U(fa,b=>{const S=b.getParser();if(S.roomEnter)h({roomInfo:null,state:We.NONE}),E(_=>{const T={..._};return T.enteredGuestRoom=S.data,T.currentRoomIsStaffPick=S.staffPick,!(T.createdFlatId===S.data.roomId)&&S.data.displayRoomEntryAd&&K("roomenterad.habblet.enabled",!1)&&oi.openRoomEnterAd(),T.createdFlatId=0,T.enteredGuestRoom&&T.enteredGuestRoom.habboGroupId>0,T});else if(S.roomForward){if(S.data.ownerName!==G().userName&&!S.isGroupMember)switch(S.data.doorMode){case nt.DOORBELL_STATE:h(_=>{const T={..._};return T.roomInfo=S.data,T.state=We.START_DOORBELL,T});return;case nt.PASSWORD_STATE:h(_=>{const T={..._};return T.roomInfo=S.data,T.state=We.START_PASSWORD,T});return}if(S.data.doorMode===nt.NOOB_STATE&&!G().isAmbassador&&!G().isRealNoob&&!G().isModerator)return;vr(S.data.roomId)}else E(_=>{const T={..._};return T.enteredGuestRoom=S.data,T.currentRoomIsStaffPick=S.staffPick,T})}),U(ox,b=>{const S=b.getParser();E(_=>{const T={..._};return T.currentRoomRating=S.totalLikes,T.canRate=S.canLike,T})}),U(lx,b=>{const S=b.getParser();(!S.userName||S.userName.length===0)&&h(_=>{const T={..._};return T.state=We.STATE_WAITING,T})}),U(cx,b=>{const S=b.getParser();(!S.userName||S.userName.length===0)&&h(_=>{const T={..._};return T.state=We.STATE_ACCEPTED,T})}),U(ux,b=>{const S=b.getParser();(!S.userName||S.userName.length===0)&&h(_=>{const T={..._};return T.state=We.STATE_NO_ANSWER,T})}),U(dx,b=>{switch(b.getParser().errorCode){case-100002:h(_=>{const T={..._};return T.state=We.STATE_WRONG_PASSWORD,T});return;case 4009:C(d("navigator.alert.need.to.be.vip"),je.DEFAULT,null,null,d("generic.alert.title"));return;case 4010:C(d("navigator.alert.invalid_room_name"),je.DEFAULT,null,null,d("generic.alert.title"));return;case 4011:C(d("navigator.alert.cannot_perm_ban"),je.DEFAULT,null,null,d("generic.alert.title"));return;case 4013:C(d("navigator.alert.room_in_maintenance"),je.DEFAULT,null,null,d("generic.alert.title"));return}}),U(mx,b=>{const S=b.getParser();c(S.topLevelContexts),a(S.topLevelContexts.length?S.topLevelContexts[0]:null)}),U(hx,b=>{const S=b.getParser();a(_=>{let T=_;if(T||(T=l&&l.length&&l[0]||null),!T)return null;if(S.result.code!==T.code&&l&&l.length)for(const P of l)P.code===S.result.code&&(T=P);for(const P of l)P.code===S.result.code&&(T=P);return T}),g(S.result),p(S.result.data)}),U(gx,b=>{const S=b.getParser();t(S.categories)}),U(fx,b=>{const S=b.getParser();n(S.categories)}),U(px,b=>{const S=b.getParser();vr(S.roomId)}),U(xx,b=>{const S=b.getParser();let _=!1;if(E(k=>{_=k.settingsReceived;const R={...k};return R.homeRoomId=S.homeRoomId,R.settingsReceived=!0,R}),_)return;let T=-1,P=-1;K("friend.id")!==void 0&&parseInt(K("friend.id"))>0&&(T=0,D(new vc(parseInt(K("friend.id"))))),K("forward.type")!==void 0&&K("forward.id")!==void 0&&(T=parseInt(K("forward.type")),P=parseInt(K("forward.id"))),T===2?os(P):T===-1&&S.roomIdToEnter>0&&(Z("navigator/close"),S.roomIdToEnter!==S.homeRoomId?vr(S.roomIdToEnter):vr(S.homeRoomId))}),U(jx,b=>{const S=b.getParser();switch(S.reason){case gl.REASON_FULL:C(d("navigator.guestroomfull.text"),je.DEFAULT,null,null,d("navigator.guestroomfull.title"));break;case gl.REASON_QUEUE_ERROR:C(d(`room.queue.error.${S.parameter}`),je.DEFAULT,null,null,d("room.queue.error.title"));break;case gl.REASON_BANNED:C(d("navigator.banned.text"),je.DEFAULT,null,null,d("navigator.banned.title"));break;default:C(d("room.queue.error.title"),je.DEFAULT,null,null,d("room.queue.error.title"));break}Sc()}),U(Ix,b=>Z("navigator/show")),U(bx,b=>{const S=b.getParser();S&&I(S.searches)}),{categories:o,doorData:m,setDoorData:h,topLevelContext:r,topLevelContexts:l,searchResult:u,navigatorData:j,navigatorSearches:x,searchResultQuery:f}},qs=()=>dt(IN),bN=()=>{const[o,t]=i.useState(new Dc),s=i.useMemo(()=>K("hc.disabled",!1),[]),n=i.useMemo(()=>s||o.clubDays>0?pn.ACTIVE:o.pastVipDays>0||o.pastVipDays>0?pn.EXPIRED:pn.NONE,[o,s]),r=a=>{if(a===-1)return o.credits;for(const[l,c]of o.activityPoints.entries())if(l===a)return c;return 0};return U(Ex,a=>{const l=a.getParser();t(c=>{const m=is(c);return m.credits=parseFloat(l.credits),c.credits!==m.credits&&_n(Sn.CREDITS),m})}),U(Cx,a=>{const l=a.getParser();t(c=>{const m=is(c);return m.activityPoints=l.currencies,m})}),U(xm,a=>{const l=a.getParser();t(c=>{const m=is(c);return m.activityPoints=new Map(m.activityPoints),m.activityPoints.set(l.type,l.amount),l.type===0&&_n(Sn.DUCKETS),m})}),U(Nx,a=>{const l=a.getParser(),c=l.productName;c!=="club_habbo"&&c!=="habbo_club"||t(m=>{const h=is(m);return h.clubDays=Math.max(0,l.daysToPeriodEnd),h.clubPeriods=Math.max(0,l.periodsSubscribedAhead),h.isVip=l.isVip,h.pastClubDays=l.pastClubDays,h.pastVipDays=l.pastVipDays,h.isExpiring=l.responseType===vx.RESPONSE_TYPE_DISCOUNT_AVAILABLE,h.minutesUntilExpiration=l.minutesUntilExpiration,h.minutesSinceLastModified=l.minutesSinceLastModified,h})}),i.useEffect(()=>{if(s)return;D(new au("habbo_club"));const a=setInterval(()=>D(new au("habbo_club")),5e4);return()=>clearInterval(a)},[s]),i.useEffect(()=>{D(new _x)},[]),{purse:o,hcDisabled:s,clubStatus:n,getCurrencyAmount:r}},Fr=()=>dt(bN),EN=(o,t)=>{i.useEffect(()=>{if(!o)return;const s=n=>t(n);return Nn.addEventListener(Be.FURNI_ADDED,s),()=>{Nn.removeEventListener(Be.FURNI_ADDED,s)}},[o,t])},ks=(o,t)=>{i.useEffect(()=>{if(!o)return;const s=n=>t(n);return Nn.addEventListener(Be.FURNI_REMOVED,s),()=>{Nn.removeEventListener(Be.FURNI_REMOVED,s)}},[o,t])},CN=o=>{ut(Be.OBJECT_DESELECTED,o)},vN=o=>{ut(Be.OBJECT_ROLL_OUT,o)},NN=o=>{ut(Be.OBJECT_ROLL_OVER,o)},Gc=o=>{ut(Be.OBJECT_SELECTED,o)},Sh=(o,t)=>{i.useEffect(()=>{if(!o)return;const s=n=>t(n);return Nn.addEventListener(Be.USER_ADDED,s),()=>{Nn.removeEventListener(Be.USER_ADDED,s)}},[o,t])},wh=(o,t)=>{i.useEffect(()=>{if(!o)return;const s=n=>t(n);return Nn.addEventListener(Be.USER_REMOVED,s),()=>{Nn.removeEventListener(Be.USER_REMOVED,s)}},[o,t])},_N=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(!1);return U(Sx,r=>{const a=r.getParser();a&&t(a)}),{promoteInformation:o,isExtended:s,setPromoteInformation:t,setIsExtended:n}},Bc=()=>dt(_N),SN=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),[r,a]=i.useState(null),[l,c]=i.useState(0),m=(u,g,f,p=!1)=>{if(!s)return;const x=Ht.hslToRGB(((u&255)<<16)+((g&255)<<8)+(f&255));p&&c(x),!u&&!g&&!f?s.tint=0:s.tint=x},h=u=>{if(!r)return;const g=u>>16&255,f=u>>8&255,p=u&255;r.red=g/255,r.green=f/255,r.blue=p/255};return ut(rr.PREVIEW,u=>m(u.hue,u.saturation,u.lightness)),ut(rr.CLEAR_PREVIEW,u=>{s&&(s.tint=l)}),we(wx.ROOM_BACKGROUND_COLOR,u=>{Cr.isRoomPreviewerId(u.roomId)||(u.enable?m(u.hue,u.saturation,u.lightness,!0):m(0,0,0,!0))}),we(Tx.ROOM_COLOR,u=>{if(Cr.isRoomPreviewerId(u.roomId))return;let g=0,f=255;u.bgOnly||(g=u.color,f=u.brightness),h(Ht.hslToRGB((Ht.rgbToHSL(g)&16776960)+f))}),we([ys.INITIALIZED,ys.DISPOSED],u=>{if(Cr.isRoomPreviewerId(u.roomId))return;const g=Oe();if(g)switch(u.type){case ys.INITIALIZED:Su(u.roomId),t(g);return;case ys.DISPOSED:t(null);return}}),He([Lt.CREATED,Lt.ENDED],u=>{switch(u.type){case Lt.CREATED:MC(u.session);return;case Lt.ENDED:t(null);return}}),we([Ct.SELECTED,Ct.DESELECTED,Ct.ADDED,Ct.REMOVED,Ct.PLACED,Ct.REQUEST_MOVE,Ct.REQUEST_ROTATE,Ct.MOUSE_ENTER,Ct.MOUSE_LEAVE,Ct.DOUBLE_CLICK],u=>{if(Cr.isRoomPreviewerId(u.roomId))return;let g=null;switch(u.type){case Ct.SELECTED:FC(u)||(g=new Be(Be.OBJECT_SELECTED,u.objectId,u.category,u.roomId));break;case Ct.DESELECTED:g=new Be(Be.OBJECT_DESELECTED,u.objectId,u.category,u.roomId);break;case Ct.ADDED:{let f=null;switch(u.category){case Q.FLOOR:case Q.WALL:f=Be.FURNI_ADDED;break;case Q.UNIT:f=Be.USER_ADDED;break}f&&(g=new Be(f,u.objectId,u.category,u.roomId));break}case Ct.REMOVED:{let f=null;switch(u.category){case Q.FLOOR:case Q.WALL:f=Be.FURNI_REMOVED;break;case Q.UNIT:f=Be.USER_REMOVED;break}f&&(g=new Be(f,u.objectId,u.category,u.roomId));break}case Ct.REQUEST_MOVE:Ka(o,u.objectId,u.category)&&_r(u.objectId,u.category,Bs.OBJECT_MOVE);break;case Ct.REQUEST_ROTATE:Ka(o,u.objectId,u.category)&&_r(u.objectId,u.category,Bs.OBJECT_ROTATE_POSITIVE);break;case Ct.MOUSE_ENTER:g=new Be(Be.OBJECT_ROLL_OVER,u.objectId,u.category,u.roomId);break;case Ct.MOUSE_LEAVE:g=new Be(Be.OBJECT_ROLL_OUT,u.objectId,u.category,u.roomId);break;case Ct.DOUBLE_CLICK:g=new Be(Be.OBJECT_DOUBLE_CLICKED,u.objectId,u.category,u.roomId);break}g&&Nt(g)}),i.useEffect(()=>{if(!o)return;const u=Ce(),g=H(),f=o.roomId,p=1,x=Math.floor(window.innerWidth),I=Math.floor(window.innerHeight),j=u.application.renderer;j&&(j.view.style.width=`${x}px`,j.view.style.height=`${I}px`,j.resolution=window.devicePixelRatio,j.resize(x,I));const E=g.getRoomInstanceDisplay(f,p,x,I,yx.SCALE_ZOOMED_IN),C=H().getRoomInstanceRenderingCanvas(f,p);if(!E||!C)return;const b=new to(Rx.WHITE),S=new Ox,_=C.master;b.tint=0,b.width=x,b.height=I,_.addChildAt(b,0),_.filters=[S],n(b),a(S);const T=g.getRoomInstanceGeometry(f,p);if(T){const R=g.getRoomInstanceVariable(f,vi.ROOM_MIN_X)||0,y=g.getRoomInstanceVariable(f,vi.ROOM_MAX_X)||0,O=g.getRoomInstanceVariable(f,vi.ROOM_MIN_Y)||0,F=g.getRoomInstanceVariable(f,vi.ROOM_MAX_Y)||0;let V=(R+y)/2,Y=(O+F)/2;const q=20;V=V+(q-1),Y=Y+(q-1);const M=Math.sqrt(q*q+q*q)*Math.tan(30/180*Math.PI);T.location=new At(V,Y,M)}const P=u.application.stage;if(!P)return;P.addChild(E),Su(o.roomId);const k=R=>{const y=Math.floor(window.innerWidth),O=Math.floor(window.innerHeight);j.view.style.width=`${y}px`,j.view.style.height=`${O}px`,j.resolution=window.devicePixelRatio,j.resize(y,O),b.width=y,b.height=O,UC(y,O,1),u.application.render()};return window.addEventListener("resize",k),()=>{n(null),a(null),c(0),window.removeEventListener("resize",k)}},[o]),{roomSession:o}},ke=()=>dt(SN),wN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(0),{roomSession:l=null}=ke(),c=()=>{const u=Ht.rgbToHSL(r),[g,f,p,x]=gs.int_to_8BitVals(u);D(new kx(o,f,p,x))},m=()=>l.useMultistateItem(o),h=()=>{Nt(new rr(rr.CLEAR_PREVIEW)),t(-1),n(-1),a(0)};return we(ye.REQUEST_BACKGROUND_COLOR,u=>{if(!Ka(l,u.objectId,u.category))return;const f=H().getRoomObject(u.roomId,u.objectId,u.category).model;t(u.objectId),n(u.category);const p=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_HUE)),x=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_SATURATION)),I=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_LIGHTNESS)),j=gs.eight_bitVals_to_int(0,p,x,I),E=Ht.hslToRGB(j);a(E)}),ks(o!==-1&&s!==-1,u=>{u.id!==o||u.category!==s||h()}),i.useEffect(()=>{if(o===-1||s===-1)return;const u=Ht.rgbToHSL(r),[g,f,p,x]=gs.int_to_8BitVals(u);Nt(new rr(rr.PREVIEW,f,p,x))},[o,s,r]),{objectId:o,color:r,setColor:a,applyToner:c,toggleToner:m,onClose:h}},TN=wN,yN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState("1"),[l,c]=i.useState(""),[m,h]=i.useState(""),[u,g]=i.useState(""),[f,p]=i.useState(""),{simpleAlert:x=null}=Fe(),I=()=>{t(-1),n(-1),a("1"),c(""),h(""),g(""),p("")};return we([ye.REQUEST_BADGE_DISPLAY_ENGRAVING,ye.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING],j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=new li;C.initializeFromRoomObjectModel(E.model),t(j.objectId),n(j.category),a("1"),c(pa(C.getValue(1))),h(yc(C.getValue(1))),g(C.getValue(2)),p(C.getValue(3))}),we(ye.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);!E||E.model.getValue(te.FURNITURE_OWNER_ID)!==G().userId||x(`${d("resolution.failed.subtitle")} ${d("resolution.failed.text")}`,null,null,null,d("resolution.failed.title"))}),ks(o!==-1&&s!==-1,j=>{j.id!==o||j.category!==s||I()}),{objectId:o,category:s,color:r,badgeName:l,badgeDesc:m,date:u,senderName:f,onClose:I}},RN=yN,ic="MONSTERPLANT_SEED_CONFIRMATION",oc="PURCHASABLE_CLOTHING_CONFIRMATION",Th="GROUP_FURNITURE",yh="EFFECTBOX_OPEN",lc="MYSTERYTROPHY_OPEN_DIALOG",ON=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(null),[r,a]=i.useState(null),[l,c]=i.useState(-1),[m,h]=i.useState(null),[u,g]=i.useState(!1),[f,p]=i.useState(-1),{roomSession:x=null}=ke(),I=()=>{t(-1),h(null),g(!1),n(null)},j=()=>{a(null),c(-1)},E=C=>{if(C)switch(C){case"use_friend_furni":x.useMultistateItem(o);break;case"use_monsterplant_seed":a(ic),c(o);break;case"use_random_teleport":H().useRoomObject(o,Q.FLOOR);break;case"use_purchaseable_clothing":a(oc),c(o);break;case"use_mystery_box":x.useMultistateItem(o);break;case"use_mystery_trophy":a(lc),c(o);break;case"join_group":Ac(m.guildId),g(!0);return;case"go_to_group_homeroom":m&&os(m.guildHomeRoomId);break}I()};return we([ye.OPEN_FURNI_CONTEXT_MENU,ye.CLOSE_FURNI_CONTEXT_MENU,ye.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,ye.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG,ye.REQUEST_EFFECTBOX_OPEN_DIALOG,ye.REQUEST_MYSTERYBOX_OPEN_DIALOG,ye.REQUEST_MYSTERYTROPHY_OPEN_DIALOG],C=>{const b=H().getRoomObject(x.roomId,C.objectId,C.category);if(b)switch(p(b.model.getValue(te.FURNITURE_OWNER_ID)),C.type){case ye.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:if(!Xt(b))return;c(b.id),a(ic),I();return;case ye.REQUEST_EFFECTBOX_OPEN_DIALOG:if(!Xt(b))return;c(b.id),a(yh),I();return;case ye.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:if(!Xt(b))return;c(b.id),a(oc),I();return;case ye.REQUEST_MYSTERYBOX_OPEN_DIALOG:x.useMultistateItem(b.id),I();return;case ye.REQUEST_MYSTERYTROPHY_OPEN_DIALOG:if(!Xt(b))return;c(b.id),a(lc),I();return;case ye.OPEN_FURNI_CONTEXT_MENU:switch(t(b.id),C.contextMenu){case Vt.FRIEND_FURNITURE:n(Vt.FRIEND_FURNITURE);return;case Vt.MONSTERPLANT_SEED:Xt(b)&&n(Vt.MONSTERPLANT_SEED);return;case Vt.MYSTERY_BOX:n(Vt.MYSTERY_BOX);return;case Vt.MYSTERY_TROPHY:Xt(b)&&n(Vt.MYSTERY_TROPHY);return;case Vt.RANDOM_TELEPORT:n(Vt.RANDOM_TELEPORT);return;case Vt.PURCHASABLE_CLOTHING:Xt(b)&&n(Vt.PURCHASABLE_CLOTHING);return}return;case ye.CLOSE_FURNI_CONTEXT_MENU:b.id===o&&I();return}}),U(Ax,C=>{const b=C.getParser();t(b.objectId),h(b),g(b.userIsMember),n(Th)}),{objectId:o,mode:s,confirmMode:r,confirmingObjectId:l,groupData:m,isGroupMember:u,objectOwnerId:f,closeConfirm:j,processAction:E,onClose:I}},kN=ON,AN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState([]),[r,a]=i.useState(null),[l,c]=i.useState([]),[m,h]=i.useState(null),[u,g]=i.useState(new Map),[f,p]=i.useState(!1),{groupItems:x=[],getItemsByType:I=null,activate:j=null,deactivate:E=null}=dr(),{simpleAlert:C=null}=Fe(),b=r&&u.get(r.name)||null,S=()=>{n([]),a(null),c([]),g(new Map)},_=()=>{t(-1),S()},T=()=>{p(!0),D(new Vx(o,r.name))},P=k=>{a(k),u.get(k.name)||D(new Gx(k.name))};return we(ye.OPEN_WIDGET,k=>{k.widget===Dx.CRAFTING&&(t(k.objectId),S(),D(new Px(k.objectId)))}),U(Lx,k=>{const R=k.getParser();if(!R.isActive()){t(-1);return}n(y=>{const O=[];for(const F of R.recipes){const V=H().roomContentLoader._activeObjectTypeIds.get(F.itemName),Y=H().getFurnitureFloorIconUrl(V);O.push({name:F.recipeName,localizedName:d("roomItem.name."+V),iconUrl:Y})}return O}),h(R.ingredients)}),U(Mx,k=>{const R=k.getParser();g(y=>{const O=new Map(y);return O.set(r.name,R.ingredients),O})}),U(Ux,k=>{a(null),p(!1),k.getParser().result&&C(d("crafting.info.result.ok"))}),U(Fx,k=>{}),i.useEffect(()=>{!m||!m.length||c(k=>{const R=[];for(const y of m){const O=H().roomContentLoader._activeObjectTypeIds.get(y),F=H().getFurnitureFloorIconUrl(O),V=I(O);let Y=0;if(V)for(const q of V)Y+=q.items.length;R.push({name:y,iconUrl:F,count:Y})}return R})},[x,m,I]),i.useEffect(()=>{if(o===-1)return;const k=j();return()=>E(k)},[o,j,E]),{objectId:o,recipes:s,ingredients:l,selectedRecipe:r,requiredIngredients:b,isCrafting:f,selectRecipe:P,craft:T,onClose:_}},DN=AN,PN=()=>{const[o,t]=i.useState([]),[s,n]=i.useState(0),[r,a]=i.useState(0),[l,c]=i.useState(0),[m,h]=i.useState(0),[u,g]=i.useState(16777215),[f,p]=i.useState(255),[x,I]=i.useState(0),[j,E]=i.useState(0),[C,b]=i.useState(0),{roomSession:S=null}=ke(),_=()=>S.isRoomOwner||S.controllerLevel>=Ke.GUEST||G().isModerator,T=k=>{const R=o[k-1];R&&(n(R.id),I(R.type),E(R.color),b(R.light))},P=()=>{if(r===0)return;const k=s-1;if(s<1||s>o.length)return;const R=o[k];!R||x===R.type&&j===R.color&&C===R.light||(t(y=>{const O=[...y];return O[k]=new Bu(R.id,x,j,C),O}),Fs.savePreset(R.id,x,j,C,!0))};return we(ye.REQUEST_DIMMER,k=>{_()&&S.requestMoodlightSettings()}),He(Bx.ROOM_DIMMER_PRESETS,k=>{const R=[];let y=0;for(;y<k.presetCount;){const O=k.getPreset(y);O&&R.push(new Bu(O.id,O.type,O.color,O.brightness)),y++}t(R),n(k.selectedPresetId)}),we(Hx.ROOM_COLOR,k=>{Cr.isRoomPreviewerId(k.roomId)||(c(r),a(k.state),n(k.presetId),h(k.effectId),I(k.effectId),g(k.color),E(k.color),p(k.brightness),b(k.brightness))}),i.useEffect(()=>{r===0&&l===0||Fs.previewDimmer(j,C,x===2)},[r,l,j,C,x]),{presets:o,selectedPresetId:s,dimmerState:r,lastDimmerState:l,effectId:m,color:u,brightness:f,selectedEffectId:x,setSelectedEffectId:I,selectedColor:j,setSelectedColor:E,selectedBrightness:C,setSelectedBrightness:b,selectPresetId:T,applyChanges:P}},LN=PN,MN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(0),l=()=>{t(-1),n(-1),a(0)},c=()=>{Oe().connection.send(new Wx(o)),l()};return we(ye.REQUEST_CREDITFURNI,m=>{const h=H().getRoomObject(m.roomId,m.objectId,m.category);!h||!Xt(h)||(t(m.objectId),n(m.category),a(h.model.getValue(te.FURNITURE_CREDIT_VALUE)||0))}),ks(o!==-1&&s!==-1,m=>{m.id!==o||m.category!==s||l()}),{objectId:o,value:r,redeem:c,onClose:l}},UN=MN,FN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(-1),[l,c]=i.useState([]),{roomSession:m=null}=ke(),h=()=>{t(-1),n(-1),a(-1),c([])};return we(ye.REQUEST_EXTERNAL_IMAGE,u=>{const g=H().getRoomObject(u.roomId,u.objectId,u.category),f=H().getRoomObjects(m==null?void 0:m.roomId,Q.WALL);if(!g)return;const p=[];f.forEach(I=>{if(I.type!=="external_image_wallitem_poster_small")return null;const j=I.model.getValue(te.FURNITURE_DATA),E=JSON.parse(j);p.push(E)}),t(u.objectId),n(u.category),c(p);const x=JSON.parse(g.model.getValue(te.FURNITURE_DATA));a(I=>{let j=0;return x&&(j=p.findIndex(E=>E.w===x.w)),j<0&&(j=0),j})}),ks(o!==-1&&s!==-1,u=>{u.id!==o||u.category!==s||h()}),{objectId:o,currentPhotoIndex:r,currentPhotos:l,onClose:h}},VN=FN,GN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(0),[l,c]=i.useState([]),[m,h]=i.useState([]),[u,g]=i.useState(null),[f,p]=i.useState(0),x=()=>{t(-1),n(-1),a(0),c([]),h([]),g(null)},I=j=>{Oe().connection.send(new $x(o,j)),x()};return U(qx,j=>{const E=j.getParser();t(E.furniId),p(E.start?1:2)}),U(zx,j=>x()),U(Yx,j=>x()),we(ye.REQUEST_FRIEND_FURNITURE_ENGRAVING,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model.getValue(te.FURNITURE_DATA),b=E.model.getValue(te.FURNITURE_FRIENDFURNI_ENGRAVING);C[0]!=="1"||C.length!==6||(t(j.objectId),n(j.category),a(b),c([C[1],C[2]]),h([C[3],C[4]]),g(C[5]),p(0))}),ks(o!==-1&&s!==-1,j=>{j.id!==o||j.category!==s||x()}),{objectId:o,type:r,usernames:l,figures:m,date:u,stage:f,onClose:x,respond:I}},BN=GN,HN=["perteam","mostwins","classic"],WN=["alltime","daily","weekly","monthly"],qN=()=>{const[o,t]=i.useState(new Map),{roomSession:s=null}=ke(),n=a=>HN[a],r=a=>WN[a];return we(ye.REQUEST_HIGH_SCORE_DISPLAY,a=>{const l=H().getRoomObject(a.roomId,a.objectId,a.category);if(!l)return;const c=l.model.getValue(te.FURNITURE_DATA_FORMAT),m=gm.getData(c);m.initializeFromRoomObjectModel(l.model),t(h=>{const u=new Map(h);return u.set(l.id,m),u})}),we(ye.REQUEST_HIDE_HIGH_SCORE_DISPLAY,a=>{a.roomId===s.roomId&&t(l=>{const c=new Map(l);return c.delete(a.objectId),c})}),{stuffDatas:o,getScoreType:n,getClearType:r}},zN=qN,YN="internalLink",$N=()=>(we(ye.REQUEST_INTERNAL_LINK,o=>{const t=H().getRoomObject(o.roomId,o.objectId,o.category);if(!t)return;let n=t.model.getValue(te.FURNITURE_DATA)[YN];(!n||!n.length)&&(n=t.model.getValue(te.FURNITURE_INTERNAL_LINK)),n&&n.length&&Z(n)}),{}),KN=$N,XN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(Wt.NO_CLUB),[u,g]=i.useState(null),f=()=>{t(-1),n(-1),a(null),c(null),g(null)},p=()=>{o!==-1&&(D(new Xx(o)),f())},x=()=>{o!==-1&&(D(new $l(o)),f())},I=()=>{o!==-1&&D(new Kx(o,u))};return we(ye.REQUEST_MANNEQUIN,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model,b=C.getValue(te.FURNITURE_MANNEQUIN_FIGURE)||null,S=C.getValue(te.FURNITURE_MANNEQUIN_GENDER)||null,_=St().createFigureContainer(b),T=St().getFigureClubLevel(_,S,ca.MANNEQUIN_CLOTHING_PART_TYPES);t(j.objectId),n(j.category),a(b),c(S),h(T),g(C.getValue(te.FURNITURE_MANNEQUIN_NAME)||null)}),ks(o!==-1&&s!==-1,j=>{j.id!==o||j.category!==s||f()}),{objectId:o,figure:r,gender:l,clubLevel:m,name:u,setName:g,saveFigure:p,wearFigure:x,saveName:I,onClose:f}},QN=XN,JN=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(-1),[l,c]=i.useState(new qa),[m,h]=i.useState([]),{roomSession:u=null}=ke(),{showSingleBubble:g=null,simpleAlert:f=null}=Fe(),p=()=>{t(-1),n(-1)},x=i.useCallback((C,b)=>D(new Qx(C,b)),[]),I=i.useCallback(C=>D(new Jx(C)),[]),j=i.useCallback((C,b)=>D(new $l(C,b)),[]);we(ye.REQUEST_PLAYLIST_EDITOR,C=>{var S,_,T;const b=H().getRoomObject(C.roomId,C.objectId,C.category);if(b){if(Xt(b)){t(C.objectId),n(C.category),(S=Ce().soundManager.musicController)==null||S.requestUserSongDisks(),(T=(_=Ce().soundManager.musicController)==null?void 0:_.getRoomItemPlaylist())==null||T.requestPlayList();return}(u.isRoomOwner||u.controllerLevel>=Ke.GUEST||G().isModerator)&&D(new $l(C.objectId,-2))}}),ks(o!==-1&&s!==-1,C=>{C.id!==o||C.category!==s||p()}),jr(ym.NPE_SONG_CHANGED,C=>{a(C.position)}),jr(Zx.NOTIFY_PLAYED_SONG,C=>{g(d("soundmachine.notification.playing",["songname","songauthor"],[C.name,C.creator]),ns.SOUNDMACHINE)}),jr(ej.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT,C=>{var b;c((b=Ce().soundManager.musicController)==null?void 0:b.songDiskInventory.clone())}),jr(iu.PLUE_PLAY_LIST_UPDATED,C=>{var b,S;h((S=(b=Ce().soundManager.musicController)==null?void 0:b.getRoomItemPlaylist())==null?void 0:S.entries.concat())}),jr(iu.PLUE_PLAY_LIST_FULL,C=>{f(d("playlist.editor.alert.playlist.full"),je.ALERT,"","",d("playlist.editor.alert.playlist.full.title"))});const E=C=>{var b,S;o!==-1&&(C instanceof Yl?C.getParser().fragmentNumber===0&&((b=Ce().soundManager.musicController)==null||b.requestUserSongDisks()):(S=Ce().soundManager.musicController)==null||S.requestUserSongDisks())};return U(Yl,E),U(_m,E),U(Nm,E),{objectId:o,diskInventory:l,playlist:m,currentPlayingIndex:r,onClose:p,addToPlaylist:x,removeFromPlaylist:I,togglePlayPause:j}},ZN=JN,td="floor",e_="wallpaper",sd="landscape",t_="poster",s_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(!1),[u,g]=i.useState(null),[f,p]=i.useState(null),[x,I]=i.useState(-1),[j,E]=i.useState(null),[C,b]=i.useState(!1),[S,_]=i.useState(null),{roomSession:T=null}=ke(),P=()=>{t(-1),n(-1),a(null),c(null),h(!1),g(null),p(null),I(-1),E(null),b(!1),_(null)},k=()=>{o!==-1&&(T.openGift(o),H().changeObjectModelData(H().activeRoomId,o,Q.FLOOR,te.FURNITURE_DISABLE_PICKING_ANIMATION,1))},R=i.useMemo(()=>({imageReady:(y,O,F)=>{!F&&O&&(F=vn.generateImage(O)),_(F.src)},imageFailed:null}),[]);return He(tj.RSPE_PRESENT_OPENED,y=>{let O=null;y.itemType===xe.FLOOR?O=G().getFloorItemData(y.classId):y.itemType===xe.WALL&&(O=G().getWallItemData(y.classId));let F=!1;if(y.placedInRoom){const V=H().getRoomObject(T.roomId,y.placedItemId,Q.FLOOR);V&&(F=Xt(V))}switch(y.itemType){case xe.WALL:{if(O)switch(O.className){case td:case sd:case e_:let V=null;O.className===td?V=d("inventory.furni.item.floor.name"):O.className===sd?V=d("inventory.furni.item.landscape.name"):V=d("inventory.furni.item.wallpaper.name"),c(V);break;case t_:{const Y=y.productCode;let q=null;Y.indexOf("poster")===0&&(q=Y.replace("poster",""));const M=G().getProductData(Y);let X=null;M?X=M.name:O&&(X=O.name),c(X),_(H().getFurnitureWallIconUrl(y.classId,q));break}default:{c(O.name||null),_(H().getFurnitureWallIconUrl(y.classId));break}}break}case xe.HABBO_CLUB:c(d("widget.furni.present.hc"));break;default:{if(y.placedItemType===xe.PET){const Y=y.petFigureString;if(Y&&Y.length){const q=new da(Y),M=H().getRoomObjectPetImage(q.typeId,q.paletteId,q.color,new At(90),64,R,!0,0,q.customParts);M&&_(M.getImage().src)}}else{const Y=H().getFurnitureFloorImage(y.classId,new At(90),64,R);Y&&_(Y.getImage().src)}const V=G().getProductData(y.productCode);c(V&&V.name||O.name);break}}t(0),n(y.classId),a(y.itemType),h(F),I(y.placedItemId),E(y.placedItemType),b(y.placedInRoom)}),we(ye.REQUEST_PRESENT,y=>{const O=H().getRoomObject(y.roomId,y.objectId,y.category);if(!O)return null;P(),t(y.objectId),n(-1),c(O.model.getValue(te.FURNITURE_DATA)||""),h(Xt(O)),g(O.model.getValue(te.FURNITURE_PURCHASER_NAME)||null),p(O.model.getValue(te.FURNITURE_PURCHASER_FIGURE)||null)}),ks(o!==-1,y=>{y.id===o&&P(),y.id===x&&C&&b(!1)}),{objectId:o,classId:s,itemType:r,text:l,isOwnerOfFurniture:m,senderName:u,senderFigure:f,placedItemId:x,placedItemType:j,placedInRoom:C,imageUrl:S,openPresent:k,onClose:P}},n_=s_,r_="internalLink",a_=()=>{const[o,t]=i.useState(0);return we(ye.REQUEST_ROOM_LINK,s=>{const n=H().getRoomObject(s.roomId,s.objectId,s.category);if(!n)return;let a=n.model.getValue(te.FURNITURE_DATA)[r_];(!a||!a.length)&&(a=n.model.getValue(te.FURNITURE_INTERNAL_LINK)),!(!a||!a.length)&&(a=parseInt(a,10),!isNaN(a)&&(t(a),D(new no(a,!1,!1))))}),U(fa,s=>{!o||s.getParser().data.roomId!==o||t(0)}),{}},i_=a_,o_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(""),[l,c]=i.useState(""),[m,h]=i.useState("0"),[u,g]=i.useState(""),[f,p]=i.useState(!1),{getWallItemById:x=null}=dr(),I=()=>{D(new nj(o,l,m,u)),t(-1),n(-1),a(""),c(""),h("0"),g(""),p(!1)};return U(sj,j=>{const E=j.getParser();t(E.itemId),n(Q.WALL);const C=x(E.itemId);let b="post_it";if(C){const S=H().getFurnitureWallName(C.type);S.match("post_it_")&&(b=S)}a(b),c(E.location),h("FFFF33"),g(""),p(!0)}),{objectId:o,color:m,setColor:h,text:u,setText:g,canModify:f,onClose:I}},l_=o_,Sl=40,c_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(0),[l,c]=i.useState(-1),m=()=>{t(-1),n(-1),a(0),c(-1)},h=(u,g=!1)=>{u||(u=0),u=Math.abs(u),g||u>Sl&&(u=Sl),a(parseFloat(u.toFixed(2))),g||c(u*100)};return U(rj,u=>{const g=u.getParser();o===g.furniId&&h(g.height,!0)}),we(ye.REQUEST_STACK_HEIGHT,u=>{if(!Ka(Oe(),u.objectId,u.category))return;const g=H().getRoomObject(u.roomId,u.objectId,u.category);g&&(t(u.objectId),n(u.category),a(g.getLocation().z),c(-1))}),ks(o!==-1&&s!==-1,u=>{u.id!==o||u.category!==s||m()}),i.useEffect(()=>{if(o===-1||l===-1)return;const u=setTimeout(()=>D(new Kl(o,~~l)),10);return()=>clearTimeout(u)},[o,l]),{objectId:o,height:r,maxHeight:Sl,onClose:m,updateHeight:h}},u_=c_,d_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState("0"),[l,c]=i.useState(""),[m,h]=i.useState(""),[u,g]=i.useState(!1),f=()=>{t(-1),n(-1),a("0"),c(""),h(""),g(!1)},p=j=>{j!==r&&(a(j),H().modifyRoomObjectData(o,s,j,l))},x=j=>{c(j),H().modifyRoomObjectData(o,s,r,j)},I=()=>H().deleteRoomObject(o,s);return we(ye.REQUEST_STICKIE,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model.getValue(te.FURNITURE_ITEMDATA);if(C.length<6)return;let b=null,S=null;C.indexOf(" ")>0?(b=C.slice(0,C.indexOf(" ")),S=C.slice(C.indexOf(" ")+1,C.length)):b=C,t(j.objectId),n(j.category),a(b||"0"),c(S||""),h(E.type||"post_it"),g(Oe().isRoomOwner||G().isModerator||Xt(E))}),ks(o!==-1&&s!==-1,j=>{j.id!==o||j.category!==s||f()}),{objectId:o,color:r,text:l,type:m,canModify:u,updateColor:p,updateText:x,trash:I,onClose:f}},m_=d_,h_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState("1"),[l,c]=i.useState(""),[m,h]=i.useState(""),[u,g]=i.useState(""),f=()=>{t(-1),n(-1),a("1"),c(""),h(""),g("")};return we(ye.REQUEST_TROPHY,p=>{const x=H().getRoomObject(p.roomId,p.objectId,p.category);if(!x)return;let I=x.model.getValue(te.FURNITURE_DATA);x.model.getValue(te.FURNITURE_EXTRAS),t(p.objectId),n(p.category),a(x.model.getValue(te.FURNITURE_COLOR)||"1");const j=I.substring(0,I.indexOf(" "));I=I.substring(j.length+1,I.length);const E=I.substring(0,I.indexOf(" ")),C=I.substr(E.length+1,I.length);c(j),h(E),g(C)}),ks(o!==-1&&s!==-1,p=>{p.id!==o||p.category!==s||f()}),{objectId:o,color:r,senderName:l,date:m,message:u,onClose:f}},g_=h_,f_=0,p_=1,x_=2,j_=3,I_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(-1),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(null),[u,g]=i.useState(-1),[f,p]=i.useState(null),[x,I]=i.useState(null),[j,E]=i.useState(!1),C=()=>{t(-1),n(-1),a(null),c(null),h(null),g(-1),p(null),I(null),E(!1)},b=()=>D(new Ni(o,f_)),S=()=>D(new Ni(o,p_)),_=()=>j&&r&&r.length&&D(new Ni(o,x_)),T=()=>j&&r&&r.length&&D(new Ni(o,j_)),P=k=>{if(f===k){p(null),D(new ou(o,""));return}p(k),D(new ou(o,k))};return we(ye.REQUEST_YOUTUBE,k=>{if(Cr.isRoomPreviewerId(k.roomId))return;const R=H().getRoomObject(k.roomId,k.objectId,k.category);R&&(t(k.objectId),n(k.category),E(G().hasSecurity(ao.EMPLOYEE)||Xt(R)),D(new aj(k.objectId)))}),U(ij,k=>{const R=k.getParser();o===-1||o!==R.furniId||(a(R.videoId),c(R.startAtSeconds),h(R.endAtSeconds),g(R.state))}),U(oj,k=>{const R=k.getParser();o===-1||o!==R.furniId||(I(R.playlists),p(R.selectedPlaylistId),a(null),g(-1),h(null),c(null))}),U(lj,k=>{const R=k.getParser();if(!(o===-1||o!==R.furniId))switch(R.commandId){case 1:g(ar.PLAYING);break;case 2:g(ar.PAUSED);break}}),ks(o!==-1&&s!==-1,k=>{k.id!==o||k.category!==s||C()}),{objectId:o,videoId:r,videoStart:l,videoEnd:m,currentVideoState:u,selectedVideo:f,playlists:x,onClose:C,previous:b,next:S,pause:_,play:T,selectVideo:P}},b_=I_,E_=()=>{const[o,t]=i.useState(null),[s,n]=i.useState([]),[r,a]=i.useState(""),[l,c]=i.useState([]),[m,h]=i.useState(0),[u,g]=i.useState(ue.STUFF_SELECTION_OPTION_NONE),[f,p]=i.useState(5),{showConfirm:x}=Fe(),I=()=>{const E=C=>{C&&(C instanceof Rm?D(new hj(C.id,s,r,l,m,C.stuffTypeSelectionCode)):C instanceof Om?D(new gj(C.id,s,r,l,C.stuffTypeSelectionCode)):C instanceof km&&D(new fj(C.id,s,r,l,C.stuffTypeSelectionCode)))};PC(o.id)?E(o):x(d("wiredfurni.nonowner.change.confirm.body"),()=>{E(o)},null,null,null,d("wiredfurni.nonowner.change.confirm.title"))},j=(E,C)=>{!o||!u||E<=0||c(b=>{const S=[...b],_=b.indexOf(E);return _>=0?(S.splice(_,1),Wn.hide(E)):S.length<f&&(S.push(E),Wn.show(E)),S})};return U(cj,E=>{E.getParser(),t(null)}),U(uj,E=>{const C=E.getParser();t(C.definition)}),U(dj,E=>{const C=E.getParser();t(C.definition)}),U(mj,E=>{const C=E.getParser();t(C.definition)}),i.useEffect(()=>{if(o)return()=>{n([]),a(""),h(0),c(E=>(E&&E.length&&Wn.clearSelectionShaderFromFurni(E),[])),g(ue.STUFF_SELECTION_OPTION_NONE)}},[o]),{trigger:o,setTrigger:t,intParams:s,setIntParams:n,stringParam:r,setStringParam:a,furniIds:l,setFurniIds:c,actionDelay:m,setActionDelay:h,setAllowsFurni:g,saveWired:I,selectObjectForWired:j,maxItemSelectionCount:f,setMaxItemSelectionCount:p}},Te=()=>dt(E_),C_=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),[r,a]=i.useState([]),[l,c]=i.useState([]),[m,h]=i.useState(null),[u,g]=i.useState(-1),[f,p]=i.useState(!1),{friends:x=[]}=fs(),{selectObjectForWired:I=null}=Te(),{roomSession:j=null}=ke(),E=T=>{a(P=>{const k=[...P];return k.splice(T,1),k})},C=T=>{c(P=>{const k=[...P],R=k.splice(T,1)[0];return m===R&&h(null),k})},b=T=>{h(T),c([])},S=(T,P)=>{const k=Wr.getObjectName(T,P);k&&(n(k),P!==Q.UNIT&&c([]))},_=(T,P)=>{let k=null;switch(P){case Q.FLOOR:case Q.WALL:k=Wr.getFurniInfo(T,P),k&&I(T,P);break;case Q.UNIT:{const R=j.userDataManager.getUserDataByIndex(T);if(!R)break;switch(R.type){case gt.PET:j.userDataManager.requestPetInfo(R.webID),g(R.webID);break;case gt.USER:k=Wr.getUserInfo(P,R);break;case gt.BOT:k=Wr.getBotInfo(P,R);break;case gt.RENTABLE_BOT:k=Wr.getRentableBotInfo(P,R);break}}}k&&t(k)};return He(pj.USER_DATA_UPDATED,T=>{if(!T.addedUsers.length)return;let P=[];T.addedUsers.forEach(k=>{k.webID===G().userId||k.type!==gt.USER||x.find(R=>R.id===k.webID)&&P.push(new mh(k.roomIndex,Q.UNIT,k.webID,k.name,k.type,!0))}),P.length&&a(k=>{const R=[...k];return P.forEach(y=>{const O=R.findIndex(F=>F.id===y.id);O>-1&&R.splice(O,1),R.push(y)}),R})}),He(xj.PET_INFO,T=>{const P=T.petInfo;if(!P||P.id!==u)return;const k=Wr.getPetInfo(P);k&&(t(k),g(-1))}),He(jj.PET_STATUS_UPDATE,T=>{}),we(lu.USE_PRODUCT_FROM_INVENTORY,T=>{}),we(lu.USE_PRODUCT_FROM_ROOM,T=>{const P=H().getRoomObject(j.roomId,T.objectId,Q.FLOOR);if(!P||!Xt(P))return;const k=P.model.getValue(te.FURNITURE_OWNER_ID),R=P.model.getValue(te.FURNITURE_TYPE_ID),y=G().getFloorItemData(R),O=y.customParams.split(" "),F=O.length?parseInt(O[0]):-1;if(F===-1)return;const V=[],Y=H().getRoomObjects(j.roomId,Q.UNIT);for(const q of Y){const M=j.userDataManager.getUserDataByIndex(q.id);let X=!1;if(!(!M||M.type!==gt.PET)){if(M.ownerId===k){M.hasSaddle&&y.specialType===de.PET_SADDLE&&(X=!0);const he=M.figure.split(" ");if((he.length?parseInt(he[0]):-1)===F){if(y.specialType===de.MONSTERPLANT_REVIVAL&&!M.canRevive||y.specialType===de.MONSTERPLANT_REBREED&&(M.petLevel<7||M.canRevive||M.canBreed)||y.specialType===de.MONSTERPLANT_FERTILIZE&&(M.petLevel>=7||M.canRevive))continue;V.push(new yv(M.roomIndex,Q.UNIT,M.name,T.objectId,q.id,-1,X))}}}}h(null),V.length&&c(V)}),we(Ct.REQUEST_MANIPULATION,T=>{Ka(j,T.objectId,T.category)&&p(!0)}),Gc(T=>{_(T.id,T.category)}),CN(T=>{t(null),c([])}),NN(T=>{o||T.category!==Q.UNIT||S(T.id,T.category)}),vN(T=>{!s||T.category!==Q.UNIT||s.roomIndex!==T.id||n(null)}),ut([Be.FURNI_REMOVED,Be.USER_REMOVED],T=>{if(s&&s.category===T.category&&s.roomIndex===T.id&&n(null),T.category===Q.UNIT){let P=r.findIndex(k=>k.roomIndex===T.id);P>-1&&a(k=>k.filter(R=>R.roomIndex===T.id)),P=l.findIndex(k=>k.id===T.id),P>-1&&c(k=>k.filter(R=>R.id!==T.id))}else T.category===Q.FLOOR&&l.findIndex(k=>k.id===T.id)>-1&&c(k=>k.filter(R=>R.requestRoomObjectId!==T.id));o&&(o instanceof Rr?o.id===T.id&&t(null):(o instanceof It||o instanceof kr||o instanceof Or)&&o.roomIndex===T.id&&t(null))}),i.useEffect(()=>{o&&(n(null),a([]),c([]))},[o]),i.useEffect(()=>{s&&a([])},[s]),i.useEffect(()=>{j&&(j.isDecorating=f)},[j,f]),{avatarInfo:o,setAvatarInfo:t,activeNameBubble:s,setActiveNameBubble:n,nameBubbles:r,productBubbles:l,confirmingProduct:m,isDecorating:f,setIsDecorating:p,removeNameBubble:E,removeProductBubble:C,updateConfirmingProduct:b,getObjectName:S}},v_=C_,N_=()=>{const[o,t]=i.useState(""),[s,n]=i.useState(!1),[r,a]=i.useState(!1),[l,c]=i.useState(!1),[m,h]=i.useState(!1),[u,g]=i.useState(0),{showNitroAlert:f=null,showConfirm:p=null}=Fe(),{roomSession:x=null}=ke(),I=(j,E,C="",b=0,S="")=>{if(j==="")return null;const _=j.split(" ");if(_.length>0){const T=_[0];let P="";if(_.length>1&&(P=_[1]),T.charAt(0)===":"&&P==="x"){const k=H().selectedAvatarId;if(k>-1){const R=x.userDataManager.getUserDataByIndex(k);R&&(P=R.name,j=j.replace(" x"," "+R.name))}}switch(T.toLowerCase()){case":shake":return uu.init(2500,5e3),uu.turnVisualizationOn(),null;case":rotate":return cu.init(2500,5e3),cu.turnVisualizationOn(),null;case":d":case";d":Cs()===Wt.VIP&&x.sendExpressionMessage(gn.LAUGH.ordinal);break;case"o/":case"_o/":return x.sendExpressionMessage(gn.WAVE.ordinal),null;case":kiss":if(Cs()===Wt.VIP)return x.sendExpressionMessage(gn.BLOW.ordinal),null;break;case":jump":if(Cs()===Wt.VIP)return x.sendExpressionMessage(gn.JUMP.ordinal),null;break;case":idle":return x.sendExpressionMessage(gn.IDLE.ordinal),null;case"_b":return x.sendExpressionMessage(gn.RESPECT.ordinal),null;case":sign":return x.sendSignMessage(parseInt(P)),null;case":iddqd":case":flip":return H().events.dispatchEvent(new _a(x.roomId,-1,!0)),null;case":zoom":let k=parseFloat(P);return isNaN(k)&&(k=1),k>=1&&k<=5?H().events.dispatchEvent(new _a(x.roomId,k,!1)):k===0?H().events.dispatchEvent(new _a(x.roomId,1,!1)):H().events.dispatchEvent(new _a(x.roomId,1,!1)),null;case":screenshot":const R=H().createTextureFromRoom(x.roomId,1),y=new Image;return y.src=vn.generateImageUrl(R),window.open("").document.write(y.outerHTML),null;case":pickall":return(x.isRoomOwner||G().isModerator)&&p(d("room.confirm.pick_all"),()=>{G().sendSpecialCommandMessage(":pickall")},null,null,null,d("generic.alert.title"),null,"pickall"),null;case":ejectall":return(x.isRoomOwner||G().isModerator||x.controllerLevel>=Ke.GUEST)&&p(d("room.confirm.eject_all"),()=>{G().sendSpecialCommandMessage(":ejectall")},null,null,null,d("generic.alert.title")),null;case":furni":return Z("furni-chooser/"),null;case":chooser":return Z("user-chooser/"),null;case":floor":case":bcfloor":return x.controllerLevel>=Ke.ROOM_OWNER&&Z("floor-editor/show"),null;case":togglefps":return qn().maxFPS>0?qn().maxFPS=0:qn().maxFPS=K("system.animation.fps"),null;case":client":case":nitro":case":billsonnn":return f(),null;case":settings":return(x.isRoomOwner||G().isModerator)&&D(new Am(x.roomId)),null}}switch(E){case xn.CHAT_DEFAULT:x.sendChatMessage(j,b,S);break;case xn.CHAT_SHOUT:x.sendShoutMessage(j,b,S);break;case xn.CHAT_WHISPER:x.sendWhisperMessage(C,j,b);break}};return He(Ds.FLOOD_EVENT,j=>{h(!0),g(parseFloat(j.message))}),Gc(j=>{if(j.category!==Q.UNIT)return;const E=x.userDataManager.getUserDataByIndex(j.id);E&&t(E.name)}),we(Ct.DESELECTED,j=>t("")),i.useEffect(()=>{if(!m)return;let j=0;const E=window.setInterval(()=>{g(C=>(j=(C||0)-1,j)),j<0&&(clearInterval(E),h(!1))},1e3);return()=>clearInterval(E)},[m]),i.useEffect(()=>{if(!l)return;let j=null;return l&&(j=setTimeout(()=>{c(!1),n(!1)},1e4)),()=>clearTimeout(j)},[l]),i.useEffect(()=>{s?r||(a(!0),x.sendChatTypingMessage(s)):r&&(a(!1),x.sendChatTypingMessage(s))},[x,s,r]),{selectedUsername:o,floodBlocked:m,floodBlockedSeconds:u,setIsTyping:n,setIsIdle:c,sendChat:I}},__=N_,nd=new Map,rd=new Map,ad=new Map,S_=()=>{const[o,t]=i.useState([]),[s,n]=i.useState({mode:vt.CHAT_MODE_FREE_FLOW,weight:vt.CHAT_BUBBLE_WIDTH_NORMAL,speed:vt.CHAT_SCROLL_SPEED_NORMAL,distance:50,protection:vt.FLOOD_FILTER_NORMAL}),{roomSession:r=null}=ke(),{addChatEntry:a}=gi(),l=i.useRef(!1),c=i.useMemo(()=>{if(!s)return 6e3;switch(s.speed){case vt.CHAT_SCROLL_SPEED_FAST:return 3e3;case vt.CHAT_SCROLL_SPEED_NORMAL:return 6e3;case vt.CHAT_SCROLL_SPEED_SLOW:return 12e3}},[s]),m=g=>{const f=St().createAvatarImage(g,Cc.LARGE,null,{resetFigure:I=>{l.current||m(I)},dispose:()=>{},disposed:!1});if(!f)return;const p=f.getCroppedImage(so.HEAD),x=f.getPartColor(Ve.CHEST);return nd.set(g,x&&x.rgb||16777215),f.dispose(),rd.set(g,p.src),p.src},h=g=>{let f=rd.get(g);return f||(f=m(g)),f},u=(g,f,p,x=64,I=null)=>{let j=ad.get(g+I);if(j)return j;const E=new da(g),C=E.typeId,b=H().getRoomObjectPetImage(C,E.paletteId,E.color,new At(f*45),x,null,!1,0,E.customParts,I);return b&&(j=vn.generateImageUrl(b.data),ad.set(g+I,j)),j};return He(Ds.CHAT_EVENT,g=>{const f=H().getRoomObject(r.roomId,g.objectId,Q.UNIT),p=f?th(r.roomId,f==null?void 0:f.id,Q.UNIT):new Vs,x=f?r.userDataManager.getUserDataByIndex(g.objectId):new Ij(-1);let I="",j=0,E=null,C=g.chatType,b=g.style,S=0,_=g.message,T=g._chatColours;if(x){S=x.type;const y=x.figure;switch(S){case gt.PET:E=u(y,2,!0,64,f.model.getValue(te.FIGURE_POSTURE)),new da(y).typeId,T="black";break;case gt.USER:E=h(y);break;case gt.RENTABLE_BOT:case gt.BOT:b=bj.BOT,T="black";break}j=nd.get(y),I=x.name}switch(C){case Ds.CHAT_TYPE_RESPECT:_=d("widgets.chatbubble.respect",["username"],[I]),K("respect.options").enabled&&_n(K("respect.options").sound);break;case Ds.CHAT_TYPE_PETREVIVE:case Ds.CHAT_TYPE_PET_REBREED_FERTILIZE:case Ds.CHAT_TYPE_PET_SPEED_FERTILIZE:{let y="widget.chatbubble.petrevived";C===Ds.CHAT_TYPE_PET_REBREED_FERTILIZE?y="widget.chatbubble.petrefertilized;":C===Ds.CHAT_TYPE_PET_SPEED_FERTILIZE&&(y="widget.chatbubble.petspeedfertilized");let O=null;if(H().getRoomObject(r.roomId,g.extraParam,Q.UNIT)){const V=r.userDataManager.getUserDataByIndex(f.id);V&&(O=V.name)}_=d(y,["petName","userName"],[I,O]);break}case Ds.CHAT_TYPE_PETRESPECT:_=d("widget.chatbubble.petrespect",["petname"],[I]);break;case Ds.CHAT_TYPE_PETTREAT:_=d("widget.chatbubble.pettreat",["petname"],[I]);break;case Ds.CHAT_TYPE_HAND_ITEM_RECEIVED:_=d("widget.chatbubble.handitem",["username","handitem"],[I,d("handitem"+g.extraParam)]);break;case Ds.CHAT_TYPE_MUTE_REMAINING:{const y=(g.extraParam>0?Math.floor(g.extraParam/3600):0).toString(),O=(g.extraParam>0?Math.floor(g.extraParam%3600/60):0).toString(),F=(g.extraParam%60).toString();_=d("widget.chatbubble.mutetime",["hours","minutes","seconds"],[y,O,F]);break}}const P=ev(_),k=j&&("#"+j.toString(16).padStart(6,"0")||null),R=new ac(x.roomIndex,Q.UNIT,r.roomId,_,P,I,new Vs(p.x,p.y),C,b,E,k,T);t(y=>[...y,R]),a({id:-1,webId:x.webID,entityId:x.roomIndex,name:I,imageUrl:E,style:b,chatType:C,entityType:x.type,message:P,timestamp:lh(),type:tn.TYPE_CHAT,roomId:r.roomId,color:k,chatColours:T})}),we(Ej.ROOM_DRAG,g=>{if(!o.length||g.roomId!==r.roomId)return;const f=g.offsetX;o.forEach(p=>p.elementRef&&(p.left+=f))}),U(fa,g=>{const f=g.getParser();f.roomEnter&&n(f.chat)}),U(Cj,g=>{const f=g.getParser();n(f.chat)}),i.useEffect(()=>(l.current=!1,()=>{l.current=!0}),[]),{chatMessages:o,setChatMessages:t,chatSettings:s,getScrollSpeed:c}},w_=S_,T_=()=>{const[o,t]=i.useState([]),s=a=>{o.indexOf(a)>=0||t([...o,a])},n=a=>{const l=o.indexOf(a);if(l===-1)return;const c=[...o];c.splice(l,1),t(c)},r=(a,l)=>{Oe().sendDoorbellApprovalMessage(a,l),n(a)};return He(fl.DOORBELL,a=>s(a.userName)),He(fl.RSDE_REJECTED,a=>n(a.userName)),He(fl.RSDE_ACCEPTED,a=>n(a.userName)),{users:o,addUser:s,removeUser:n,answer:r}},y_=T_,R_=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(!1),r=()=>n(!1);return U(vj,a=>{const l=a.getParser();n(!0),t(l.words)}),{wordsFilter:o,isVisible:s,setWordsFilter:t,onClose:r}},O_=R_,k_=()=>{const[o,t]=i.useState([]),{requests:s=[],dismissedRequestIds:n=[],setDismissedRequestIds:r=null}=fs(),a=i.useMemo(()=>o.filter(c=>n.indexOf(c.request.requesterUserId)===-1),[o,n]),l=c=>{r(m=>{if(m.indexOf(c)>=0)return m;const h=[...m];return h.push(c),h})};return Sh(!0,c=>{if(c.category!==Q.UNIT)return;const m=Oe().userDataManager.getUserDataByIndex(c.id);if(!m||m.type!==du.getTypeNumber(du.USER))return;const h=s.find(g=>g.requesterUserId===m.webID);if(!h||o.find(g=>g.request.requesterUserId===m.webID))return;const u=[...o];u.push({roomIndex:m.roomIndex,request:h}),t(u)}),wh(!0,c=>{if(c.category!==Q.UNIT)return;const m=o.findIndex(u=>u.roomIndex===c.id);if(m===-1)return;const h=[...o];h.splice(m,1),t(h)}),i.useEffect(()=>{const c=[];for(const m of s){const h=Oe().userDataManager.getUserData(m.requesterUserId);h&&c.push({roomIndex:h.roomIndex,request:m})}t(c)},[s]),{displayedRequests:a,hideFriendRequest:l}},A_=k_,D_=()=>{const[o,t]=i.useState(null),{roomSession:s=null}=ke(),n=()=>t(null),r=c=>c&&H().selectRoomObject(Oe().roomId,c.id,c.category),a=c=>c.includes("pet_")||c.includes("bot_")||c==="pet"||c==="bot"||c.includes("rentableBot"),l=()=>{const c=G(),m=H().getRoomObjects(s.roomId,Q.WALL),h=H().getRoomObjects(s.roomId,Q.FLOOR),u=m.map(f=>{var j;if(f.id<0)return null;let p=f.type;if(p.startsWith("poster"))p=d(`poster_${p.replace("poster","")}_name`);else{const E=f.model.getValue(te.FURNITURE_TYPE_ID),C=c.getWallItemData(E);C&&C.name.length&&(p=C.name)}const x=f.model.getValue(te.FURNITURE_OWNER_ID)||0,I=f.model.getValue(te.FURNITURE_OWNER_NAME)||(c.getUserData?(j=c.getUserData(x))==null?void 0:j.name:null)||`User_${x}`;return a(f.type)?null:new $r(f.id,Q.WALL,p,x,I,"furniture")}).filter(f=>f!==null),g=h.map(f=>{var C;if(f.id<0)return null;let p=f.type;const x=f.model.getValue(te.FURNITURE_TYPE_ID),I=c.getFloorItemData(x);I&&I.name.length&&(p=I.name);const j=f.model.getValue(te.FURNITURE_OWNER_ID)||0,E=f.model.getValue(te.FURNITURE_OWNER_NAME)||(c.getUserData?(C=c.getUserData(j))==null?void 0:C.name:null)||`User_${j}`;return a(f.type)?null:new $r(f.id,Q.FLOOR,p,j,E,"furniture")}).filter(f=>f!==null);t([...u,...g].sort((f,p)=>f.name<p.name?-1:1))};return EN(!!o,c=>{var u,g;if(c.id<0)return;const m=H().getRoomObject(Oe().roomId,c.id,c.category);if(!m)return;let h=null;switch(c.category){case Q.WALL:{let f=m.type;if(f.startsWith("poster"))f=d(`poster_${f.replace("poster","")}_name`);else{const I=m.model.getValue(te.FURNITURE_TYPE_ID),j=G().getWallItemData(I);j&&j.name.length&&(f=j.name)}const p=m.model.getValue(te.FURNITURE_OWNER_ID)||0,x=m.model.getValue(te.FURNITURE_OWNER_NAME)||(G().getUserData?(u=G().getUserData(p))==null?void 0:u.name:null)||`User_${p}`;if(a(m.type))return;h=new $r(m.id,Q.WALL,f,p,x,"furniture");break}case Q.FLOOR:{let f=m.type;const p=m.model.getValue(te.FURNITURE_TYPE_ID),x=G().getFloorItemData(p);x&&x.name.length&&(f=x.name);const I=m.model.getValue(te.FURNITURE_OWNER_ID)||0,j=m.model.getValue(te.FURNITURE_OWNER_NAME)||(G().getUserData?(g=G().getUserData(I))==null?void 0:g.name:null)||`User_${I}`;if(a(m.type))return;h=new $r(m.id,Q.FLOOR,f,I,j,"furniture");break}}h&&t(f=>[...f,h].sort((p,x)=>p.name<x.name?-1:1))}),ks(!!o,c=>{c.id<0||t(m=>{const h=[...m];for(let u=0;u<h.length;u++){const g=h[u];if(!(g.id!==c.id||g.category!==c.category)){h.splice(u,1);break}}return h})}),{items:o,onClose:n,selectItem:r,populateChooser:l}},P_=D_,L_=()=>{const[o,t]=i.useState(!1),[s,n]=i.useState(-1),[r,a]=i.useState(""),[l,c]=i.useState(""),[m,h]=i.useState(""),u=()=>{h(""),c(""),a(""),n(-1),t(!1)},g=()=>{D(new Nj(s,l))},f=x=>{c(x),m.length>0&&h("")},p=x=>{if(!(!x||x===0))switch(x){case 1:return d("catalog.alert.petname.long");case 2:return d("catalog.alert.petname.short");case 3:return d("catalog.alert.petname.chars");case 4:default:return d("catalog.alert.petname.bobba")}};return He(mu.RSOPPE_OPEN_PET_PACKAGE_REQUESTED,x=>{if(!x)return;const I=H().getRoomObject(x.session.roomId,x.objectId,Q.FLOOR);n(x.objectId),a(I.type),t(!0)}),He(mu.RSOPPE_OPEN_PET_PACKAGE_RESULT,x=>{x&&(x.nameValidationStatus===0&&u(),x.nameValidationStatus!==0&&h(p(x.nameValidationStatus)))}),{isVisible:o,errorResult:m,petName:l,objectType:r,onChangePetName:f,onConfirm:g,onClose:u}},M_=L_,U_=()=>{const{roomSession:o=null}=ke(),t=r=>o.sendPollStartMessage(r),s=r=>o.sendPollRejectMessage(r),n=(r,a,l)=>o.sendPollAnswerMessage(r,a,l);return He(pl.OFFER,r=>{const a=new Qn(Qn.OFFER,r.id);a.summary=r.summary,a.headline=r.headline,Nt(a)}),He(pl.ERROR,r=>{const a=new Qn(Qn.ERROR,r.id);a.summary=r.summary,a.headline=r.headline,Nt(a)}),He(pl.CONTENT,r=>{const a=new Qn(Qn.CONTENT,r.id);a.startMessage=r.startMessage,a.endMessage=r.endMessage,a.numQuestions=r.numQuestions,a.questionArray=r.questionArray,a.npsPoll=r.npsPoll,Nt(a)}),{startPoll:t,rejectPoll:s,answerPoll:n}},F_=U_,V_=()=>{const[o,t]=i.useState(null),{roomSession:s=null}=ke(),n=()=>t(null),r=c=>c&&H().selectRoomObject(Oe().roomId,c.id,c.category),a=c=>{switch(c){case 1:return"Habbo";case 2:return"Pet";case 3:return"Bot";default:return"-"}},l=()=>{const c=Oe(),m=H().getRoomObjects(c.roomId,Q.UNIT);t(m.map(h=>{if(h.id<0)return null;const u=c.userDataManager.getUserDataByIndex(h.id);if(!u||u.type!==1)return null;const g=a(u.type);return new $r(u.roomIndex,Q.UNIT,u.name,0,"-",g)}).filter(Boolean).sort((h,u)=>h.name<u.name?-1:1))};return Sh(!!o,c=>{if(c.id<0)return;const m=Oe().userDataManager.getUserDataByIndex(c.id);if(!m||m.type!==1)return;const h=a(m.type),u=new $r(m.roomIndex,Q.UNIT,m.name,0,"-",h);t(g=>{const f=[...g];return f.push(u),f.sort((p,x)=>p.name<x.name?-1:1),f})}),wh(!!o,c=>{c.id<0||t(m=>{const h=[...m];for(let u=0;u<h.length;u++){const g=h[u];if(!(g.id!==c.id||g.category!==c.category)){h.splice(u,1);break}}return h})}),{items:o,onClose:n,selectItem:r,populateChooser:l}},G_=V_,id=4e3,B_=3,H_=()=>{const[o,t]=i.useState(-1),[s,n]=i.useState(null),[r,a]=i.useState(!1),[l,c]=i.useState(null),[m,h]=i.useState(new Map),[u,g]=i.useState(new Map),{answerPoll:f=null}=F_(),{roomSession:p=null}=ke(),x=()=>{t(-1),n(null)},I=j=>{r||!s||(f(o,s.id,[j]),a(!0))};return He(xl.ANSWERED,j=>{const E=p.userDataManager.getUserData(j.userId);E&&(h(j.answerCounts),g(C=>{if(!C.has(E.roomIndex)){const b=new Map(u);return b.set(E.roomIndex,{value:j.value,secondsLeft:B_}),b}return C}),H().updateRoomObjectUserGesture(p.roomId,E.roomIndex,oa.getGestureId(j.value==="0"?oa.GESTURE_SAD:oa.GESTURE_SMILE)))}),He(xl.FINISHED,j=>{s&&s.id===j.questionId&&(h(j.answerCounts),a(!0),c(E=>(E&&clearTimeout(E),setTimeout(()=>x(),id)))),g(new Map)}),He(xl.QUESTION,j=>{t(j.id),n(j.question),a(!1),h(new Map),g(new Map),c(E=>{if(E&&clearTimeout(E),j.duration>0){const C=j.duration<1e3?id:j.duration;return setTimeout(()=>x(),C)}return null})}),i.useEffect(()=>{const j=()=>{g(C=>{const b=[];if(C.forEach((_,T)=>{_.secondsLeft--,_.secondsLeft<=0&&b.push(T)}),b.length===0)return C;const S=new Map(C);return b.forEach(_=>S.delete(_)),S})},E=setInterval(()=>j(),1e3);return()=>clearInterval(E)},[]),i.useEffect(()=>()=>{c(j=>(j&&clearTimeout(j),null))},[]),{question:s,answerSent:r,answerCounts:m,userAnswers:u,vote:I}},W_=H_,q_=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(null),[r,a]=bn("chatStyleId",0),[l,c]=bn("chatColour",""),[m,h]=i.useState(0),[u,g]=i.useState(0),[f,p]=bn("nitroScreensize",{width:window.innerWidth,height:window.innerHeight}),x=C=>{a(C),D(new Sj(C))},I=C=>{c(C)},j=C=>{G().giveRespect(C),h(G().respectsLeft)},E=C=>{G().givePetRespect(C),g(G().respectsPetLeft)};return U(wm,C=>{const b=C.getParser();t(b.userInfo),n(b.userInfo.figure),h(b.userInfo.respectsRemaining),g(b.userInfo.respectsPetRemaining)}),U(_j,C=>{const b=C.getParser();n(b.figure)}),i.useEffect(()=>{const C=Ko("nitroScreensize");if(C&&(C.width!==window.innerWidth||C.height!==window.innerHeight)){let S=window.localStorage.length;for(;S>0;){const _=window.localStorage.key(S);_&&_.startsWith("nitro.window")&&window.localStorage.removeItem(_),S--}}const b=S=>p({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[p]),{userInfo:o,userFigure:s,chatStyleId:r,userRespectRemaining:m,petRespectRemaining:u,respectUser:j,respectPet:E,updateChatStyleId:x,updateChatColour:I,chatColour:l}},Yn=()=>dt(q_),z_=o=>i.useEffect(o,[]),Hc=o=>z_(()=>o()),Y_=()=>{const{showConfirm:o=null}=Fe(),t=n=>{if(n.target instanceof HTMLAnchorElement&&n.target.href){n.stopPropagation(),n.preventDefault();const r=n.target.href;if(r.includes("youtube.com")||r.includes("youtu.be")){const a=s(r);a&&Z("youtube-tv/show/"+a)}else o(d("chat.confirm.openurl",["url"],[r]),()=>{window.open(r,"_blank")},null,null,null,d("generic.alert.title"),null,"link")}},s=n=>{const r=/(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?.*v=|shorts\/)?([a-zA-Z0-9_-]{11})/,a=n.match(r);return a?a[1]:null};return{onClickChat:t}},Rh=()=>dt(Y_),rl=o=>{var j,E;const{rows:t=[],overscan:s=5,scrollToBottom:n=!1,rowRender:r=null}=o,a=t.length-1,l=i.useRef(null),{getVirtualItems:c,getTotalSize:m,scrollToIndex:h=null,measureElement:u}=Jh({count:t.length,getScrollElement:()=>l.current,estimateSize:()=>8,overscan:s}),g=c(),f=m(),p=g.length>0&&((j=g==null?void 0:g[0])==null?void 0:j.start)||0,x=g.length>0?f-(((E=g==null?void 0:g[g.length-1])==null?void 0:E.end)||0):0,I=C=>{if(!l.current)return!1;const b=l.current,S=b.querySelector(`[data-index="${C-1}"]`);if(!S)return!1;const _=S.getBoundingClientRect(),{scrollTop:T,scrollHeight:P,clientHeight:k}=b;return T+k+_.height>=P-_.height};return Hc(()=>{n&&setTimeout(()=>h(a),0)}),i.useEffect(()=>{n&&I(a)&&h(a)},[n,a,h]),e.jsxs(A,{fit:!0,innerRef:l,position:"relative",overflow:"auto",children:[p>0&&e.jsx("div",{style:{minHeight:`${p}px`}}),g.map(C=>{const b=t[C.index];return b?e.jsx("div",{"data-index":C.index,ref:u,children:r(b)},C.key):e.jsx(i.Fragment,{},C.key)}),x>0&&e.jsx("div",{style:{minHeight:`${x}px`}})]})},Mt=o=>{const{disabledButton:t,max:s,min:n,value:r,onChange:a,...l}=o;return e.jsxs(w,{fullWidth:!0,gap:1,children:[!t&&e.jsx(L,{disabled:n>=r,onClick:()=>a(n<r?r-1:n,0),children:e.jsx(Zh,{})}),e.jsx(eg,{className:"nitro-slider",max:s,min:n,value:r,onChange:a,...l}),!t&&e.jsx(L,{disabled:s<=r,onClick:()=>a(s>r?r+1:s,0),children:e.jsx(tg,{})})]})},v=o=>{const{variant:t="black",fontWeight:s=null,fontSize:n=0,align:r=null,bold:a=!1,underline:l=!1,italics:c=!1,truncate:m=!1,center:h=!1,textEnd:u=!1,small:g=!1,wrap:f=!1,noWrap:p=!1,textBreak:x=!1,...I}=o,j=i.useMemo(()=>{const E=["d-inline"];return t&&E.push("text-"+t),a&&E.push("fw-bold"),s&&E.push("fw-"+s),n&&E.push("fs-"+n),r&&E.push("text-"+r),l&&E.push("text-decoration-underline"),c&&E.push("fst-italic"),m&&E.push("text-truncate"),h&&E.push("text-center"),u&&E.push("text-end"),g&&E.push("small"),f&&E.push("text-wrap"),p&&E.push("text-nowrap"),x&&E.push("text-break"),E},[t,s,n,r,a,l,c,m,h,u,g,f,p,x]);return e.jsx(A,{classNames:j,...I})},$_=o=>{const{isError:t=!1,message:s="",percent:n=0}=o;return e.jsx(N,{fullHeight:!0,position:"relative",className:"nitro-loading",children:e.jsx(A,{fullHeight:!0,className:"container h-100",children:e.jsxs(N,{fullHeight:!0,alignItems:"center",justifyContent:"end",children:[e.jsx(A,{className:"connecting-duck"}),e.jsx(A,{className:"logo"}),e.jsx(N,{size:6,className:"text-center py-4",children:t&&s&&s.length?e.jsx(A,{className:"fs-4 text-shadow",children:s}):e.jsxs(e.Fragment,{children:[e.jsxs(v,{fontSize:4,variant:"white",className:"text-shadow",children:["The hotel is loading ",n.toFixed(),"%..."]}),e.jsx(Uc,{progress:n,className:"mt-2 large"})]})})]})})})},Oh=o=>{const{achievement:t=null,scale:s=1,...n}=o;return t?e.jsx(Xe,{badgeCode:Es.getAchievementBadgeCode(t),isGrayscale:!Es.getAchievementHasStarted(t),scale:s,...n}):null},K_=o=>{const{achievement:t=null}=o,{selectedAchievement:s=null,setSelectedAchievementId:n=null}=tl();return t?e.jsx(_e,{itemActive:s===t,itemUnseen:t.unseen>0,onClick:r=>n(t.achievementId),children:e.jsx(Oh,{achievement:t})}):null},X_=o=>{const{achievements:t=null}=o;return e.jsx(Pe,{columnCount:6,columnMinWidth:50,columnMinHeight:50,children:t&&t.length>0&&t.map((s,n)=>e.jsx(K_,{achievement:s},n))})},Q_=o=>{const{achievement:t=null}=o;return t?e.jsxs(w,{shrink:!0,className:"bg-muted rounded p-2 text-black",gap:2,overflow:"hidden",children:[e.jsxs(N,{center:!0,gap:1,children:[e.jsx(Oh,{className:"nitro-achievements-badge-image",achievement:t,scale:2}),e.jsx(v,{fontWeight:"bold",children:d("achievements.details.level",["level","limit"],[Es.getAchievementLevel(t).toString(),t.levelCount.toString()])})]}),e.jsxs(N,{fullWidth:!0,justifyContent:"center",overflow:"hidden",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontWeight:"bold",truncate:!0,children:pa(Es.getAchievementBadgeCode(t))}),e.jsx(v,{textBreak:!0,children:yc(Es.getAchievementBadgeCode(t))})]}),(t.levelRewardPoints>0||t.scoreLimit>0)&&e.jsxs(N,{gap:1,children:[t.levelRewardPoints>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{truncate:!0,className:"small",children:d("achievements.details.reward")}),e.jsxs(w,{center:!0,className:"fw-bold small",gap:1,children:[t.levelRewardPoints,e.jsx(_t,{type:t.levelRewardPointType})]})]}),t.scoreLimit>0&&e.jsx(Uc,{text:d("achievements.details.progress",["progress","limit"],[(t.currentPoints+t.scoreAtStartOfLevel).toString(),(t.scoreLimit+t.scoreAtStartOfLevel).toString()]),progress:t.currentPoints+t.scoreAtStartOfLevel,maxProgress:t.scoreLimit+t.scoreAtStartOfLevel})]})]})]}):null},J_=o=>{const{category:t=null}=o,{selectedAchievement:s=null,setSelectedAchievementId:n=null}=tl();return i.useEffect(()=>{var r,a;t&&(s||n((a=(r=t==null?void 0:t.achievements)==null?void 0:r[0])==null?void 0:a.achievementId))},[t,s,n]),t?e.jsxs(N,{fullHeight:!0,justifyContent:"between",children:[e.jsx(X_,{achievements:t.achievements}),!!s&&e.jsx(Q_,{achievement:s})]}):null},Z_=o=>{const{category:t=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=o;if(!t)return null;const r=Es.getAchievementCategoryProgress(t),a=Es.getAchievementCategoryMaxProgress(t),l=Es.getAchievementCategoryImageUrl(t,r),c=Es.getAchievementCategoryTotalUnseen(t);return e.jsxs(_e,{itemActive:s===t.code,itemCount:c,itemCountMinimum:0,gap:1,onClick:m=>n(t.code),children:[e.jsx(v,{fullWidth:!0,center:!0,small:!0,className:"pt-1",children:d(`quests.${t.code}.name`)}),e.jsx(fh,{position:"relative",imageUrl:l,children:e.jsxs(v,{fullWidth:!0,center:!0,position:"absolute",variant:"white",style:{fontSize:12,bottom:9},children:[r," / ",a]})})]})},eS=o=>{const{categories:t=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=o;return e.jsx(Pe,{columnCount:3,columnMinWidth:90,columnMinHeight:100,children:t&&t.length>0&&t.map((r,a)=>e.jsx(Z_,{category:r,selectedCategoryCode:s,setSelectedCategoryCode:n},a))})},tS=o=>{const[t,s]=i.useState(!1),{achievementCategories:n=[],selectedCategoryCode:r=null,setSelectedCategoryCode:a=null,achievementScore:l=0,getProgress:c=0,getMaxProgress:m=0,selectedCategory:h=null}=tl();return i.useEffect(()=>{const u={linkReceived:g=>{const f=g.split("/");if(!(f.length<2))switch(f[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(p=>!p);return}},eventUrlPrefix:"achievements/"};return ft(u),()=>pt(u)},[]),t?e.jsxs(ae,{uniqueKey:"achievements",className:"nitro-achievements",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.achievements"),onCloseClick:u=>s(!1)}),h&&e.jsxs(Qm,{position:"relative",className:"justify-content-center align-items-center cursor-pointer",gap:3,children:[e.jsx(A,{onClick:u=>a(null),className:"nitro-achievements-back-arrow"}),e.jsxs(N,{grow:!0,gap:0,children:[e.jsx(v,{fontSize:4,fontWeight:"bold",className:"text-small",children:d(`quests.${h.code}.name`)}),e.jsx(v,{children:d("achievements.details.categoryprogress",["progress","limit"],[h.getProgress().toString(),h.getMaxProgress().toString()])})]}),e.jsx(Tn,{imageUrl:Es.getAchievementCategoryImageUrl(h,null,!0)})]}),e.jsxs(se,{gap:1,children:[!h&&e.jsxs(e.Fragment,{children:[e.jsx(eS,{categories:n,selectedCategoryCode:r,setSelectedCategoryCode:a}),e.jsxs(N,{grow:!0,justifyContent:"end",gap:1,children:[e.jsx(v,{small:!0,center:!0,children:d("achievements.categories.score",["score"],[l.toString()])}),e.jsx(Uc,{text:d("achievements.categories.totalprogress",["progress","limit"],[c.toString(),m.toString()]),progress:c,maxProgress:m})]})]}),h&&e.jsx(J_,{category:h})]})]}):null},sS=o=>{const{figureData:t=null}=o,[s,n]=i.useState(-1),r=a=>{a<_i.MIN_DIRECTION&&(a=_i.MAX_DIRECTION+(a+1)),a>_i.MAX_DIRECTION&&(a=a-(_i.MAX_DIRECTION+1)),t.direction=a};return i.useEffect(()=>{if(t)return t.notify=()=>n(a=>a+1),()=>{t.notify=null}},[t]),e.jsxs(N,{className:"figure-preview-container",overflow:"hidden",position:"relative",children:[e.jsx(it,{figure:t.getFigureString(),direction:t.direction,scale:2}),e.jsx(A,{className:"avatar-shadow"}),e.jsx(A,{className:"arrow-container",children:e.jsx("i",{className:"icon arrow-left",onClick:a=>r(t.direction+1)})})]})},Kr=o=>{const{icon:t=null,selected:s=!1,classNames:n=[],children:r=null,...a}=o,l=i.useMemo(()=>{const c=["nitro-avatar-editor-spritesheet"];return t&&t.length&&c.push(t+"-icon"),s&&c.push("selected"),n.length&&c.push(...n),c},[t,s,n]);return e.jsx(A,{classNames:l,...a})},nS=o=>{const{partItem:t=null,children:s=null,...n}=o,[r,a]=i.useState(-1),l=K("hc.disabled",!1);return i.useEffect(()=>{const c=()=>a(m=>m+1);return t.notify=c,()=>t.notify=null},[t]),e.jsx("div",{className:"avatar-container",children:e.jsxs(_e,{className:`avatar-parts ${t.isSelected?"part-selected":""}`,itemImage:t.isClear?void 0:t.imageUrl,...n,children:[!l&&t.isHC&&e.jsx("i",{className:"icon hc-icon position-absolute"}),t.isClear&&e.jsx(Kr,{icon:"clear"}),t.isSellable&&e.jsx(Kr,{icon:"sellable",position:"absolute",className:"end-1 bottom-1"}),s]})})},rS=[3111,3110,3109,3030,3114,266,265,262,3113,3112,691,690,667],aS=[3128,3127,3126,3125,3124,3123,3122,3121,3120,3119],iS=[3116,281,275,715,700,696,3006],oS=[3115,3068,906],lS=o=>{const{model:t=null,category:s=null,isFromFootballGate:n=!1,setMaxPaletteCount:r=null}=o,a=i.useRef(null),l=i.useCallback(c=>{const m=s.parts.indexOf(c);if(m===-1)return;if(c.isHC&&G().clubLevel===Wt.NO_CLUB)return Z("habboUI/open/hccenter");t.selectPart(s.name,m);const h=s.getCurrentPart();r(h.maxColorIndex||1)},[t,s,r]);return i.useEffect(()=>{!t||!s||!a||!a.current||(a.current.scrollTop=0)},[t,s]),e.jsx(Pe,{className:"clothing-container",innerRef:a,columnCount:3,columnMinHeight:50,children:s.parts.length>0&&s.parts.map(c=>(!n||n&&rS.includes(c.id)||aS.includes(c.id)||iS.includes(c.id)||oS.includes(c.id))&&e.jsx(nS,{partItem:c,onClick:m=>l(c)},c.id))})},cS=o=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:a=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=o,b=i.useMemo(()=>{const _=["layout-grid-item","color-picker-frame"];return n&&_.push("active"),(l||c>0)&&_.push("unique-item"),l&&_.push("sold-out"),m&&_.push("unseen"),h&&_.push("has-highlight"),u&&_.push("disabled"),t===null&&_.push("icon","loading-icon"),x.length&&_.push(...x),_},[n,l,c,m,h,u,t,x]),S=i.useMemo(()=>{let _={...p};return t&&(_.backgroundImage=`url(${t})`),s&&(_.backgroundColor=s),Object.keys(p).length&&(_={..._,...p}),_},[p,t,s]);return e.jsxs(N,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:S,...C,children:[r>a&&e.jsx(Cn,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(Ar,{value:c})})]}),E]})},uS=o=>{const{colorItem:t=null,children:s=null,...n}=o,[r,a]=i.useState(-1),l=K("hc.disabled",!1);return i.useEffect(()=>{const c=()=>a(m=>m+1);return t.notify=c,()=>t.notify=null},[t]),e.jsxs(cS,{itemHighlight:!0,itemColor:t.color,itemActive:t.isSelected,className:"color-picker-frame clear-bg",...n,children:[!l&&t.isHC&&e.jsx("i",{className:"icon hc-icon position-absolute"}),s]})},od=o=>{const{model:t=null,category:s=null,paletteSet:n=[],paletteIndex:r=-1}=o,a=i.useRef(null),l=i.useCallback(c=>{const m=n.indexOf(c);if(m!==-1){if(c.isHC&&G().clubLevel===Wt.NO_CLUB)return Z("habboUI/open/hccenter");t.selectColor(s.name,m,r)}},[t,s,n,r]);return i.useEffect(()=>{!t||!s||!a||!a.current||(a.current.scrollTop=0)},[t,s]),e.jsx(Pe,{className:"py-1 avatar-editor-palette-set-view",innerRef:a,gap:1,columnCount:8,columnMinWidth:14,children:n.length>0&&n.map((c,m)=>e.jsx(uS,{colorItem:c,onClick:h=>l(c)},m))})},dS=["ch","cp","lg","sh"],mS=o=>{const{model:t=null,gender:s=null,isFromFootballGate:n=!1,setGender:r=null}=o,[a,l]=i.useState(null),[c,m]=i.useState(1),h=i.useCallback(u=>{const g=t.categories.get(u);if(g){g.init(),l(g);for(const f of g.parts)if(!(!f||!f.isSelected)){m(f.maxColorIndex||1);break}}},[t]);return i.useEffect(()=>{t.init();for(const u of t.categories.keys()){h(u);break}},[t,h]),!t||!a?null:e.jsx(ne,{children:e.jsxs(N,{className:"choose-clothing overflow-y-auto overflow-x-hidden",children:[e.jsxs(w,{className:"px-3",gap:4,children:[t.canSetGender&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,pointer:!0,className:"category-item",gap:3,onClick:u=>r(Se.MALE),children:[e.jsx(Kr,{icon:"male",selected:s===Se.MALE}),e.jsx(v,{bold:!0,children:d("avatareditor.generic.boy")})]}),e.jsxs(w,{center:!0,pointer:!0,className:"category-item",gap:3,onClick:u=>r(Se.FEMALE),children:[e.jsx(Kr,{icon:"female",selected:s===Se.FEMALE}),e.jsx(v,{bold:!0,children:d("avatareditor.generic.girl")})]})]}),!t.canSetGender&&t.categories&&t.categories.size>0&&Array.from(t.categories.keys()).map(u=>{const g=t.categories.get(u);return e.jsx("div",{children:e.jsxs(w,{center:!0,pointer:!0,className:"category-item",onClick:f=>h(u),children:[n&&dS.includes(g.name)&&e.jsx(Kr,{icon:g.name,selected:a===g}),!n&&e.jsx(Kr,{icon:g.name,selected:a===g})]})},u)})]}),e.jsx(N,{className:"avatar-parts-container",size:5,overflow:"hidden",children:e.jsx(lS,{model:t,category:a,isFromFootballGate:n,setMaxPaletteCount:m})}),e.jsxs(N,{overflow:"hidden",className:c===2?"avatar-color-palette-container dual-palette":"avatar-color-palette-container",children:[c>=1&&e.jsx(od,{model:t,category:a,paletteSet:a.getPalette(0),paletteIndex:0}),c===2&&e.jsx(od,{model:t,category:a,paletteSet:a.getPalette(1),paletteIndex:1})]})]})})},hS=o=>{const{figureData:t=null,savedFigures:s=[],setSavedFigures:n=null,loadAvatarInEditor:r=null}=o,a=K("hc.disabled",!1),l=i.useCallback(u=>{if(u>=s.length||u<0)return;const[g,f]=s[u];r(g.getFigureString(),f)},[s,r]),c=i.useCallback(u=>{if(!t||u>=s.length||u<0)return;if(G().clubLevel===Wt.NO_CLUB)return Z("habboUI/open/hccenter");const g=[...s],f=t.getFigureString(),p=t.gender;g[u]=[St().createFigureContainer(f),p],n(g),D(new wj(u+1,f,p))},[t,s,n]),m=i.useCallback(()=>{let u=0;return s.forEach(([g,f])=>{if(g){const p=St().getFigureClubLevel(g,f);u=Math.max(u,p)}}),u},[s]),h=i.useMemo(()=>{if(!s||!s.length)return[];const u=[];return s.forEach(([g,f],p)=>{let x=0;g&&(x=St().getFigureClubLevel(g,f)),u.push(e.jsxs(w,{alignItems:"center",justifyContent:"center",children:[e.jsxs(w,{gap:1,column:!0,className:"button-container",children:[e.jsx("button",{className:"saved-outfit-button",onClick:I=>c(p),disabled:x>Cs()&&!a,children:e.jsx(sg,{})}),g&&e.jsx("button",{className:"saved-outfit-button",onClick:I=>l(p),disabled:x>Cs()&&!a,children:e.jsx(ng,{})})]}),e.jsx("div",{className:"avatar-container",children:g&&e.jsx(it,{className:"avatar-figure",figure:g.getFigureString(),gender:f,direction:4})})]},p))}),u},[s,c,l]);return e.jsxs("div",{children:[e.jsxs("div",{className:"d-flex flex-column align-items-center",children:[e.jsx("span",{className:"saved-outfits-title",children:d("avatareditor.wardrobe.title")}),e.jsx("span",{className:"mt-2",children:!a&&m()>0&&e.jsx(_t,{type:"hc"})})]}),e.jsx("div",{className:"saved-outfit-container mt-2",children:e.jsx("div",{className:"nitro-avatar-editor-wardrobe-container",children:h})})]})},gS="hr-100.hd-180-7.ch-215-66.lg-270-79.sh-305-62.ha-1002-70.wa-2007",fS="hr-515-33.hd-600-1.ch-635-70.lg-716-66-62.sh-735-68",pS=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(null),[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState(null),[g,f]=i.useState([]),[p,x]=i.useState([]),[I,j]=i.useState([]),[E,C]=i.useState(!1),[b,S]=i.useState(null),[_,T]=i.useState(null),[P,k]=i.useState(!0),[R,y]=i.useState(!1),[O,F]=i.useState(null),[V,Y]=i.useState(null),q=JSON.parse(window.localStorage.getItem("nitro.look.footballgate.M"))||"ch-3109-92-1408.lg-3116-82-1408.sh-3115-1408-1408",M=JSON.parse(window.localStorage.getItem("nitro.look.footballgate.F"))||"ch-3112-1408-1408.lg-3116-71-1408.sh-3115-1408-1408",X=i.useMemo(()=>K("avatar.wardrobe.max.slots",10),[]),he=()=>{F(null),Y(null),s(!1)};U(yj,me=>{const ge=me.getParser();f(ge.figureSetIds),x(ge.boundsFurnitureNames)}),U(Rj,me=>{const ge=me.getParser(),le=[];let Ae=0;for(;Ae<X;)le.push([null,null]),Ae++;for(let[qt,[cs,rn]]of ge.looks.entries()){const Kn=St().createFigureContainer(cs);le[qt-1]=[Kn,rn]}j(le)});const pe=i.useCallback(me=>{c&&u(c.get(me))},[c]),qe=i.useCallback(()=>{const me=new Map;O?(me.set(Us.TORSO,new Du),me.set(Us.LEGS,new Au)):(me.set(Us.GENERIC,new GC),me.set(Us.HEAD,new iv),me.set(Us.TORSO,new Du),me.set(Us.LEGS,new Au)),m(me)},[O]),wt=i.useCallback(()=>{const me=new Map,ge=new Se,le=new Se;ge.loadAvatarData(gS,Se.MALE),le.loadAvatarData(fS,Se.FEMALE),me.set(Se.MALE,ge),me.set(Se.FEMALE,le),r(me),l(me.get(Se.MALE))},[]),be=i.useCallback((me,ge,le=!0)=>{ge=Rt.getGender(ge);let Ae=a;ge!==Ae.gender&&(Ae=n.get(ge)),me!==Ae.getFigureString()&&Ae.loadAvatarData(me,ge),Ae!==a&&l(Ae),le&&(S(a.getFigureString()),T(a.gender))},[n,a]),Qe=i.useCallback(me=>{switch(me){case cn.ACTION_CLEAR:be(a.getFigureStringWithFace(0,!1),a.gender,!1),qe();return;case cn.ACTION_RESET:be(b,_),qe();return;case cn.ACTION_RANDOMIZE:const ge=av(a,a.gender,Cs(),g,[Se.FACE]);be(ge,a.gender,!1),qe();return;case cn.ACTION_SAVE:D(O?new Tj(V,O,a.getFigureString()):new Dm(a.gender,a.getFigureString())),kc(`nitro.look.footballgate.${O}`,a.getFigureString()),he();return}},[be,a,qe,b,_,g,O,V]),Ee=i.useCallback(me=>{me=Rt.getGender(me),l(n.get(me))},[n]);if(i.useEffect(()=>{const me={linkReceived:ge=>{const le=ge.split("/");if(F(le[2]?le[2]:null),Y(le[3]?Number(le[3]):null),!(le.length<2))switch(le[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(Ae=>!Ae);return}},eventUrlPrefix:"avatar-editor/"};return ft(me),()=>pt(me)},[]),i.useEffect(()=>{j(new Array(X))},[X]),i.useEffect(()=>{D(new Oj)},[]),i.useEffect(()=>{c&&pe(O?Us.TORSO:Us.GENERIC)},[c,O,pe]),i.useEffect(()=>{if(a)return Rt.CURRENT_FIGURE=a,qe(),()=>Rt.CURRENT_FIGURE=null},[a,qe]),i.useEffect(()=>(Rt.FIGURE_SET_IDS=g,Rt.BOUND_FURNITURE_NAMES=p,qe(),()=>{Rt.FIGURE_SET_IDS=null,Rt.BOUND_FURNITURE_NAMES=null}),[g,p,qe]),i.useEffect(()=>{if(t&&!n){wt(),y(!0);return}},[t,n,wt]),i.useEffect(()=>{!t||!R||!P||(O||be(G().figure,G().gender),O&&be(O===Se.MALE?q:M,O),k(!1))},[t,R,P,be,O,q,M]),i.useEffect(()=>{if(t)return()=>{wt(),C(!1),k(!0)}},[t,O,wt]),i.useEffect(()=>{if(!t)return()=>{k(!0)}},[t]),!t||!a)return null;const Jt=`nitro-avatar-editor no-resize ${E?"expanded":""}`;return e.jsxs(ae,{uniqueKey:"avatar-editor",className:Jt,children:[e.jsx(re,{headerText:d(O?"widget.furni.clothingchange.editor.title":"avatareditor.title"),onCloseClick:he}),e.jsxs(yn,{className:"avatar-editor-tabs",children:[c&&c.size>0&&Array.from(c.keys()).map(me=>{const ge=h&&h.name===me;return e.jsx(sn,{isActive:ge,onClick:le=>pe(me),children:e.jsx("div",{className:`tab ${me}`})},me)}),!O&&e.jsx(sn,{onClick:me=>C(!E),children:e.jsx("div",{className:"tab-wardrobe"})})]}),e.jsx(se,{children:e.jsxs(ne,{children:[e.jsx(N,{size:E?6:8,overflow:"hidden",children:h&&e.jsx(mS,{model:h,gender:a.gender,setGender:Ee})}),e.jsx(N,{size:E?6:4,overflow:"hidden",children:e.jsxs(w,{gap:2,className:"w-100 h-100",children:[e.jsxs(w,{column:!0,className:"w-100",children:[e.jsx(sS,{figureData:a}),e.jsxs(N,{grow:!0,gap:1,children:[!O&&e.jsxs(En,{className:"action-buttons w-100",children:[e.jsx(L,{variant:"secondary",onClick:me=>Qe(cn.ACTION_RESET),children:e.jsx(rg,{className:"fa-icon"})}),e.jsx(L,{variant:"secondary",onClick:me=>Qe(cn.ACTION_CLEAR),children:e.jsx(pc,{className:"fa-icon"})}),e.jsx(L,{variant:"secondary",onClick:me=>Qe(cn.ACTION_RANDOMIZE),children:e.jsx(ag,{className:"fa-icon"})})]}),e.jsx(L,{className:"w-10",variant:"success",onClick:me=>Qe(cn.ACTION_SAVE),children:d("avatareditor.save")})]})]}),E&&e.jsx(N,{overflow:"hidden",className:"w-100",children:e.jsx(hS,{figureData:a,savedFigures:I,setSavedFigures:j,loadAvatarInEditor:be})})]})})]})})]})},xS=5,jS=o=>{const{onClose:t=null,onEdit:s=null,onDelete:n=null}=o,{cameraRoll:r=null,setCameraRoll:a=null,selectedPictureIndex:l=-1,setSelectedPictureIndex:c=null}=bh(),{simpleAlert:m=null}=Fe(),h=i.useRef(),u=l>-1?r[l]:null,g=()=>{if(!h||!h.current)return null;const p=h.current.getBoundingClientRect();return new pm(Math.floor(p.x),Math.floor(p.y),Math.floor(p.width),Math.floor(p.height))},f=()=>{if(l>-1){c(-1);return}const p=H().createTextureFromRoom(Oe().roomId,1,g()),x=[...r];x.length>=xS&&(m(d("camera.full.body")),x.pop()),_n(Sn.CAMERA_SHUTTER),x.push(new ov(p,vn.generateImageUrl(p))),a(x)};return e.jsx(Av,{uniqueKey:"nitro-camera-capture",children:e.jsxs(N,{center:!0,className:"nitro-camera-capture",gap:0,children:[u&&e.jsx("img",{alt:"",className:"camera-area",src:u.imageUrl}),e.jsxs("div",{className:"camera-canvas drag-handler",children:[e.jsx("div",{className:"position-absolute info-camera",onClick:()=>Z("habbopages/camera")}),e.jsx("div",{className:"position-absolute header-close",onClick:t,children:e.jsx(Hs,{className:"fa-icon"})}),!u&&e.jsx("div",{ref:h,className:"camera-area camera-view-finder"}),u&&e.jsx("div",{className:"camera-area camera-frame",children:e.jsxs("div",{className:"camera-frame-preview-actions w-100 position-absolute bottom-0 py-2 text-center",children:[e.jsx("button",{className:"btn btn-success me-3",title:d("camera.editor.button.tooltip"),onClick:s,children:d("camera.editor.button.text")}),e.jsx("button",{className:"btn btn-danger",onClick:n,children:d("camera.delete.button.text")})]})}),e.jsx("div",{className:"d-flex justify-content-center",children:e.jsx("div",{className:"camera-button",title:d("camera.take.photo.button.tooltip"),onClick:f})})]}),r.length>0&&e.jsx(w,{gap:2,justifyContent:"center",className:"camera-roll d-flex justify-content-center py-2",children:r.map((p,x)=>e.jsx("img",{alt:"",src:p.imageUrl,onClick:I=>c(x)},x))})]})})},IS=o=>{const{base64Url:t=null,onCloseClick:s=null,onCancelClick:n=null,price:r=null}=o,[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState(0),[g,f]=i.useState(!1),[p,x]=i.useState(!1),[I,j]=i.useState(0),{simpleAlert:E}=Fe(),C=i.useMemo(()=>K("camera.publish.disabled",!1),[]);U(kj,S=>{u(_=>_+1),x(!1)}),U(Aj,S=>{const _=S.getParser();_.ok||E(d("camera.publish.wait",["minutes"],[Math.floor(_.secondsToWait/60).toString().replace("-","")]),null,null,null,d("camera.purchase.pleasewait")),m(_.extraDataId),j(_.secondsToWait),f(_.ok),x(!1)}),U(Dj,S=>{const _=S.getParser();l(K("camera.url")+"/"+_.url)}),U(Pj,S=>{const _=S.getParser();if(!_)return null;_.notEnoughCredits&&!_.notEnoughActivityPoints&&E(d("catalog.alert.notenough.credits.description"),null,null,null,d("catalog.alert.notenough.title")),!_.notEnoughCredits&&_.notEnoughActivityPoints&&E(d(`catalog.alert.notenough.activitypoints.description.${_.activityPointType}`),null,null,null,d(`catalog.alert.notenough.activitypoints.title.${_.activityPointType}`)),x(!1)});const b=(S,_=null)=>{switch(S){case"close":s();return;case"buy":if(p)return;x(!0),D(new Mj(""));return;case"publish":if(p)return;x(!0),D(new Lj);return;case"cancel":n();return}};return i.useEffect(()=>{t&&H().saveBase64AsScreenshot(t)},[t]),r?e.jsxs(ae,{className:"nitro-camera-checkout",theme:"primary-slim",children:[e.jsx(re,{headerText:d("camera.confirm_phase.title"),onCloseClick:S=>b("close")}),e.jsxs(se,{children:[e.jsxs(w,{center:!0,children:[a&&a.length&&e.jsx(Tn,{className:"picture-preview border",imageUrl:a}),(!a||!a.length)&&e.jsx(w,{center:!0,className:"picture-preview border",children:e.jsx(v,{bold:!0,children:d("camera.loading")})})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",className:"bg-muted rounded p-2",children:[e.jsxs(N,{size:C?10:6,gap:1,children:[e.jsx(v,{bold:!0,children:d("camera.purchase.header")}),(r.credits>0||r.duckets>0)&&e.jsxs(w,{gap:1,children:[e.jsx(v,{children:d("catalog.purchase.confirmation.dialog.cost")}),r.credits>0&&e.jsxs(w,{gap:1,children:[e.jsx(v,{bold:!0,children:r.credits}),e.jsx(_t,{type:-1})]}),r.duckets>0&&e.jsxs(w,{gap:1,children:[e.jsx(v,{bold:!0,children:r.duckets}),e.jsx(_t,{type:5})]})]}),h>0&&e.jsxs(v,{children:[e.jsx(v,{bold:!0,children:d("camera.purchase.count.info")})," ",h,e.jsx("u",{className:"ms-1 cursor-pointer",onClick:()=>Z("inventory/toggle"),children:d("camera.open.inventory")})]})]}),e.jsx(w,{alignItems:"center",children:e.jsx(L,{variant:"success",disabled:p,onClick:S=>b("buy"),children:d(h?"camera.buy.another.button.text":"buy")})})]}),!C&&e.jsxs(w,{justifyContent:"between",alignItems:"center",className:"bg-muted rounded p-2",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d(g?"camera.publish.successful":"camera.publish.explanation")}),e.jsx(v,{children:d(g?"camera.publish.success.short.info":"camera.publish.detailed.explanation")}),g&&e.jsx("a",{href:c,rel:"noreferrer",target:"_blank",children:d("camera.link.to.published")}),!g&&r.publishDucketPrice>0&&e.jsxs(w,{gap:1,children:[e.jsx(v,{children:d("catalog.purchase.confirmation.dialog.cost")}),e.jsxs(w,{gap:1,children:[e.jsx(v,{bold:!0,children:r.publishDucketPrice}),e.jsx(_t,{type:5})]})]}),I>0&&e.jsx("div",{className:"mt-1 text-center fw-bold",children:d("camera.publish.wait",["minutes"],[Math.ceil(I/60).toString()])})]}),!g&&e.jsx(w,{className:"d-flex align-items-end",children:e.jsx(L,{variant:"success",disabled:p||I>0,onClick:S=>b("publish"),children:d("camera.publish.button.text")})})]}),e.jsx(v,{center:!0,children:d("camera.warning.disclaimer")}),e.jsx(w,{justifyContent:"end",children:e.jsx(L,{onClick:S=>b("cancel"),children:d("generic.cancel")})})]})]}):null},bS=o=>{const{effect:t=null,thumbnailUrl:s=null,isActive:n=!1,isLocked:r=!1,selectEffect:a=null,removeEffect:l=null}=o;return e.jsxs(_e,{title:d(r?`camera.effect.required.level ${t.minLevel}`:`camera.effect.name.${t.name}`),itemActive:n,onClick:c=>!n&&a(),children:[n&&e.jsx(L,{variant:"danger",className:"rounded-circle remove-effect",onClick:l,children:e.jsx(Hs,{className:"fa-icon"})}),!r&&s&&s.length>0&&e.jsx("div",{className:"effect-thumbnail-image border",children:e.jsx("img",{alt:"",src:s})}),r&&e.jsxs(v,{center:!0,bold:!0,children:[e.jsx("div",{children:e.jsx(ig,{className:"fa-icon"})}),t.minLevel]})]})},ES=o=>{const{myLevel:t=0,selectedEffects:s=[],effects:n=[],thumbnails:r=[],processAction:a=null}=o;return e.jsx(ne,{columnCount:3,overflow:"auto",children:n&&n.length>0&&n.map((l,c)=>{const m=r.find(u=>u.effectName===l.name),h=s.findIndex(u=>u.effect.name===l.name)>-1;return e.jsx(bS,{effect:l,thumbnailUrl:m&&m.thumbnailUrl||null,isActive:h,isLocked:l.minLevel>t,selectEffect:()=>a("select_effect",l.name),removeEffect:()=>a("remove_effect",l.name)},c)})})},ld=[si.COLORMATRIX,si.COMPOSITE],CS=o=>{const{picture:t=null,availableEffects:s=null,myLevel:n=1,onClose:r=null,onCancel:a=null,onCheckout:l=null}=o,[c,m]=i.useState(ld[0]),[h,u]=i.useState(null),[g,f]=i.useState([]),[p,x]=i.useState([]),[I,j]=i.useState(!1),E=i.useMemo(()=>s.filter(y=>y.colorMatrix),[s]),C=i.useMemo(()=>s.filter(y=>y.texture),[s]),b=i.useCallback(()=>c===si.COLORMATRIX?E:C,[c,E,C]),S=i.useCallback(y=>!y||!y.length||!g||!g.length?-1:g.findIndex(O=>O.effect.name===y),[g]),_=i.useMemo(()=>S(h),[h,S]),T=i.useMemo(()=>h&&g[_]||null,[h,_,g]),P=i.useCallback(y=>{const O=_;O!==-1&&f(F=>{const V=[...F],Y=V[O];return V[_]=new jl(Y.effect,y),V})},[_,f]),k=i.useMemo(()=>wa().applyEffects(t.texture,g,I).src,[t,g,I]),R=i.useCallback((y,O=null)=>{switch(y){case"close":r();return;case"cancel":a();return;case"checkout":l(k);return;case"change_tab":m(String(O));return;case"select_effect":{if(S(O)>=0)return;const V=s.find(Y=>Y.name===O);if(!V)return;f(Y=>[...Y,new jl(V,1)]),u(V.name);return}case"remove_effect":{let F=S(O);if(F===-1)return;f(V=>{const Y=[...V];return Y.splice(F,1),Y}),h===O&&u(null);return}case"clear_effects":u(null),f([]);return;case"download":{const F=new Image;F.src=k,window.open("").document.write(F.outerHTML);return}case"zoom":j(!I);return}},[I,s,h,k,S,a,l,r,j,f]);return i.useEffect(()=>{const y=[];for(const O of s)y.push(new lv(O.name,wa().applyEffects(t.texture,[new jl(O,1)],!1).src));x(y)},[t,s]),e.jsxs(ae,{className:"nitro-camera-editor",children:[e.jsx(re,{headerText:d("camera.editor.button.text"),onCloseClick:y=>R("close")}),e.jsx(yn,{children:ld.map(y=>e.jsx(sn,{isActive:c===y,onClick:O=>R("change_tab",y),children:e.jsx("i",{className:"icon icon-camera-"+y})},y))}),e.jsx(se,{children:e.jsxs(ne,{children:[e.jsx(N,{size:5,overflow:"hidden",children:e.jsx(ES,{myLevel:n,selectedEffects:g,effects:b(),thumbnails:p,processAction:R})}),e.jsxs(N,{size:7,justifyContent:"between",overflow:"hidden",children:[e.jsxs(N,{center:!0,children:[e.jsx(Tn,{imageUrl:k,className:"picture-preview"}),h&&e.jsxs(N,{center:!0,fullWidth:!0,gap:1,children:[e.jsx(v,{children:d("camera.effect.name."+h)}),e.jsx(Mt,{min:0,max:1,step:.01,value:T.alpha,onChange:y=>P(y),renderThumb:(y,O)=>e.jsx("div",{...y,children:O.valueNow})})]})]}),e.jsxs(w,{justifyContent:"between",children:[e.jsxs(En,{children:[e.jsx(L,{onClick:y=>R("clear_effects"),children:e.jsx(pc,{className:"fa-icon"})}),e.jsx(L,{onClick:y=>R("download"),children:e.jsx(og,{className:"fa-icon"})}),e.jsxs(L,{onClick:y=>R("zoom"),children:[I&&e.jsx(im,{className:"fa-icon"}),!I&&e.jsx(om,{className:"fa-icon"})]})]}),e.jsxs(w,{gap:1,children:[e.jsx(L,{onClick:y=>R("cancel"),children:d("generic.cancel")}),e.jsx(L,{onClick:y=>R("checkout"),children:d("camera.preview.button.text")})]})]})]})]})})]})},qr=0,Fi=1,cd=2,ud=3,vS=o=>{const[t,s]=i.useState(qr),[n,r]=i.useState(null),{availableEffects:a=[],selectedPictureIndex:l=-1,cameraRoll:c=[],setCameraRoll:m=null,myLevel:h=0,price:u={credits:0,duckets:0,publishDucketPrice:0}}=bh(),g=x=>{switch(x){case"close":s(qr);return;case"edit":s(cd);return;case"delete":m(I=>{const j=[...I];return j.splice(l,1),j});return;case"editor_cancel":s(Fi);return}},f=x=>{if(!x.startsWith("data:image/"))return;const j=p(x);j&&(r(j),s(ud))},p=x=>x.startsWith("data:image/")?x:null;return He(Lt.ENDED,x=>s(qr)),i.useEffect(()=>{const x={linkReceived:I=>{const j=I.split("/");if(!(j.length<2))switch(j[1]){case"show":s(Fi);return;case"hide":s(qr);return;case"toggle":s(E=>E?qr:Fi);return}},eventUrlPrefix:"camera/"};return ft(x),()=>pt(x)},[]),t===qr?null:e.jsxs(e.Fragment,{children:[t===Fi&&e.jsx(jS,{onClose:()=>g("close"),onEdit:()=>g("edit"),onDelete:()=>g("delete")}),t===cd&&e.jsx(CS,{picture:c[l],myLevel:h,onClose:()=>g("close"),onCancel:()=>g("editor_cancel"),onCheckout:f,availableEffects:a}),t===ud&&e.jsx(IS,{base64Url:n,onCloseClick:()=>g("close"),onCancelClick:()=>g("editor_cancel"),price:u})]})},NS=o=>{const{itemId:t=-1,state:s=null,product:n=null,active:r=!1,onClick:a=null}=o,l=c=>{let m=G().getFloorItemDataByName(c),h=null;return m?h=H().getFurnitureFloorIconUrl(m.id):(m=G().getWallItemDataByName(c),m&&(h=H().getFurnitureWallIconUrl(m.id))),h};return e.jsxs(N,{fit:!0,center:!0,pointer:!0,className:`campaign-spritesheet campaign-day-generic-bg rounded calendar-item ${r?"active":""}`,onClick:()=>a(t),children:[s===rs.STATE_UNLOCKED&&e.jsx(w,{center:!0,className:"campaign-spritesheet unlocked-bg",children:e.jsx(w,{center:!0,className:"campaign-spritesheet campaign-opened",children:n&&e.jsx(Tn,{imageUrl:n.customImage?K("image.library.url")+n.customImage:l(n.productName)})})}),s!==rs.STATE_UNLOCKED&&e.jsxs(w,{center:!0,className:"campaign-spritesheet locked-bg",children:[s===rs.STATE_LOCKED_AVAILABLE&&e.jsx(A,{className:"campaign-spritesheet available"}),(s===rs.STATE_LOCKED_EXPIRED||s===rs.STATE_LOCKED_FUTURE)&&e.jsx(A,{className:"campaign-spritesheet unavailable"})]})]})},wl=5,_S=o=>{const{onClose:t=null,campaignName:s=null,currentDay:n=null,numDays:r=null,missedDays:a=null,openedDays:l=null,openPackage:c=null,receivedProducts:m=null}=o,[h,u]=i.useState(n),[g,f]=i.useState(Math.max(0,h-1)),p=b=>l.includes(b)?rs.STATE_UNLOCKED:b>n?rs.STATE_LOCKED_FUTURE:a.includes(b)?rs.STATE_LOCKED_EXPIRED:rs.STATE_LOCKED_AVAILABLE,x=b=>{switch(p(b)){case rs.STATE_UNLOCKED:return d("campaign.calendar.info.unlocked");case rs.STATE_LOCKED_FUTURE:return d("campaign.calendar.info.future");case rs.STATE_LOCKED_EXPIRED:return d("campaign.calendar.info.expired");default:return d("campaign.calendar.info.available.desktop")}},I=()=>{const b=h+1;b!==r&&(u(b),g+wl<b+1&&f(g+1))},j=()=>{const b=h-1;b<0||(u(b),g>b&&f(g-1))},E=b=>{if(h===b){p(b)===rs.STATE_LOCKED_AVAILABLE&&c(b,!1);return}u(b)},C=()=>{const b=h;p(b)!==rs.STATE_UNLOCKED&&c(b,!0)};return e.jsxs(ae,{className:"nitro-campaign-calendar",theme:"primary-slim",children:[e.jsx(re,{headerText:d(`campaign.calendar.${s}.title`),onCloseClick:t}),e.jsxs(se,{children:[e.jsxs(ne,{fullHeight:!1,justifyContent:"between",alignItems:"center",children:[e.jsx(N,{size:1}),e.jsx(N,{size:10,children:e.jsxs(w,{justifyContent:"between",alignItems:"center",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:3,children:d("campaign.calendar.heading.day",["number"],[(h+1).toString()])}),e.jsx(v,{children:x(h)})]}),e.jsx("div",{children:G().isModerator&&e.jsx(L,{variant:"danger",onClick:C,children:"Force open"})})]})}),e.jsx(N,{size:1})]}),e.jsxs(w,{fullHeight:!0,gap:2,children:[e.jsx(w,{center:!0,children:e.jsx(A,{pointer:!0,className:"campaign-spritesheet prev",onClick:j})}),e.jsx(N,{center:!0,fullWidth:!0,children:e.jsx(ne,{fit:!0,columnCount:wl,gap:1,children:[...Array(wl)].map((b,S)=>{const _=g+S;return e.jsx(N,{overflow:"hidden",children:e.jsx(NS,{itemId:_,state:p(_),active:h===_,product:m.has(_)?m.get(_):null,onClick:E})},S)})})}),e.jsx(w,{center:!0,children:e.jsx(A,{pointer:!0,className:"campaign-spritesheet next",onClick:I})})]})]})]})},SS=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(-1),[a,l]=i.useState(new Map),[c,m]=i.useState(!1),h=(u,g=!1)=>{t&&(r(u),D(g?new Uj(t.campaignName,u):new Fj(t.campaignName,u)))};return U(Vj,u=>{const g=u.getParser();g&&s(g.calendarData)}),U(Gj,u=>{const g=u.getParser();if(!g)return;const f=n;g.doorOpened&&(s(p=>{const x=p.clone();return x.openedDays.push(n),x}),l(p=>{const x=new Map(p);return x.set(f,new cv(g.productName,g.customImage,g.furnitureClassName)),x})),r(-1)}),i.useEffect(()=>{const u={linkReceived:g=>{const f=g.split("/");if(!(f.length<2))switch(f[1]){case"calendar":m(!0);break}},eventUrlPrefix:"openView/"};return ft(u),()=>pt(u)},[]),e.jsx(e.Fragment,{children:t&&c&&e.jsx(_S,{onClose:()=>m(!1),campaignName:t.campaignName,currentDay:t.currentDay,numDays:t.campaignDays,openedDays:t.openedDays,missedDays:t.missedDays,openPackage:h,receivedProducts:a})})},kh=o=>{const{icon:t=0}=o,s=i.useMemo(()=>K("catalog.asset.icon.url").replace("%name%",t.toString()),[t]);return e.jsx(Tn,{imageUrl:s,style:{width:20,height:20}})},wS=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(0),[a,l]=i.useState(0),[c,m]=i.useState(""),[h,u]=i.useState(""),[g,f]=i.useState(!0),[p,x]=i.useState(""),[I,j]=i.useState([]),[E,C]=i.useState(0),[b,S]=i.useState(0),[_,T]=i.useState(0),[P,k]=i.useState(0),[R,y]=i.useState(0),[O,F]=i.useState(!1),{catalogOptions:V=null,getNodesByOfferId:Y=null}=Le(),{friends:q}=fs(),{giftConfiguration:M=null}=V,[X,he]=i.useState([]),[pe,qe]=i.useState([]),[wt,be]=i.useState(!0),Qe=i.useCallback(()=>{s(!1),r(0),l(0),m(""),u(""),f(!0),x(""),C(0),S(0),be(!1),qe([]),I.length&&T(I[0].id)},[I]),Ee=i.useMemo(()=>M?M.defaultStuffTypes.findIndex(Re=>Re===X[E])>-1:!1,[X,M,E]),Jt=i.useMemo(()=>M?(X[E]*1e3+M.ribbonTypes[b]).toString():"",[M,E,b,X]),me=i.useMemo(()=>{if(!M||Ee)return!1;const Re=X[E];return!(Re===8||Re>=3&&Re<=6)},[M,E,Ee,X]),ge=i.useMemo(()=>Ee?X[E]:_,[Ee,X,E,_]),le=q.filter(Re=>Re.id!==-1),Ae=Re=>{const Je=Re.target.value;let ot=[];Je.length>0&&(ot=le.sort().filter(Zt=>Zt.name.includes(Je))),u(Je),be(!0),qe(ot)},qt=Re=>{u(Re),be(!1)},cs=i.useCallback(Re=>{switch(Re){case"prev_box":C(ot=>ot===0?P:ot-1);return;case"next_box":C(ot=>ot===P?0:ot+1);return;case"prev_ribbon":S(ot=>ot===0?R:ot-1);return;case"next_ribbon":S(ot=>ot===R?0:ot+1);return;case"buy":if(!h||h.length===0){F(!0);return}let Je=n;if(Je===-1){const ot=Y(a);ot&&(Je=ot[0].pageId)}D(new Bj(Je,a,c,h,p,ge,E,b,g));return}},[ge,c,P,R,p,a,n,h,E,b,g,Y]);U(Hj,Re=>F(!0)),ut([wn.PURCHASE_SUCCESS,Dr.INIT_GIFT],Re=>{switch(Re.type){case wn.PURCHASE_SUCCESS:Qe();return;case Dr.INIT_GIFT:const Je=Re;Qe(),r(Je.pageId),l(Je.offerId),m(Je.extraData),s(!0);return}}),i.useEffect(()=>{F(!1)},[h]);const rn=i.useCallback(()=>{M&&he(Re=>{let Je=[...M.boxTypes];return Je.push(M.defaultStuffTypes[Math.floor(Math.random()*(M.defaultStuffTypes.length-1))]),k(Je.length-1),y(Je.length-1),Je})},[M]);if(i.useEffect(()=>{if(!M)return;const Re=[];for(const Je of M.stuffTypes){const ot=G().getFloorItemData(Je);ot&&(ot.colors&&ot.colors.length>0?Re.push({id:Je,color:gs.makeColorNumberHex(ot.colors[0])}):Re.push({id:Je,color:"#000000"}))}rn(),Re.length&&(T(Re[0].id),j(Re))},[M,rn]),i.useEffect(()=>{t&&rn()},[rn,t]),!M||!M.isEnabled||!t)return null;const Kn="catalog.gift_wrapping_new.box."+(Ee?"default":X[E]),_s=`catalog.gift_wrapping_new.ribbon.${b}`,On="catalog.gift_wrapping_new."+(Ee?"freeprice":"price");return e.jsxs(ae,{uniqueKey:"catalog-gift",className:"nitro-catalog-gift",theme:"primary-slim",children:[e.jsx(re,{headerText:d("catalog.gift_wrapping.title"),onCloseClick:Qe}),e.jsxs(se,{className:"text-black",children:[e.jsxs(Vv,{column:!0,children:[e.jsx(v,{children:d("catalog.gift_wrapping.receiver")}),e.jsx("input",{type:"text",className:$t("form-control form-control-sm",O&&"is-invalid"),value:h,onChange:Re=>Ae(Re)}),pe.length>0&&wt&&e.jsx(N,{className:"autocomplete-gift-container",children:pe.map(Re=>e.jsx(A,{className:"autocomplete-gift-item",onClick:Je=>qt(Re.name),children:Re.name},Re.id))}),O&&e.jsx(A,{className:"invalid-feedback",children:d("catalog.gift_wrapping.receiver_not_found.title")})]}),e.jsx(ph,{figure:G().figure,userName:G().userName,message:p,editable:!0,onChange:Re=>x(Re)}),e.jsxs(A,{className:"form-check",children:[e.jsx("input",{className:"form-check-input",type:"checkbox",name:"showMyFace",checked:g,onChange:Re=>f(Je=>!Je)}),e.jsx("label",{className:"form-check-label",children:d("catalog.gift_wrapping.show_face.title")})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[_&&e.jsx(A,{className:"gift-preview",children:e.jsx(Jo,{productType:xe.FLOOR,productClassId:ge,extraData:Jt})}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:2,children:[e.jsxs(En,{children:[e.jsx(L,{variant:"primary",onClick:()=>cs("prev_box"),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(L,{variant:"primary",onClick:()=>cs("next_box"),children:e.jsx(ws,{className:"fa-icon"})})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{fontWeight:"bold",children:d(Kn)}),e.jsxs(w,{alignItems:"center",gap:1,children:[d(On,["price"],[M.price.toString()]),e.jsx(_t,{type:-1})]})]})]}),e.jsxs(w,{alignItems:"center",gap:2,className:me?"":"opacity-50 pointer-events-none",children:[e.jsxs(En,{children:[e.jsx(L,{variant:"primary",onClick:()=>cs("prev_ribbon"),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(L,{variant:"primary",onClick:()=>cs("next_ribbon"),children:e.jsx(ws,{className:"fa-icon"})})]}),e.jsx(v,{fontWeight:"bold",children:d(_s)})]})]})]}),e.jsxs(N,{gap:1,className:me?"":"opacity-50 pointer-events-none",children:[e.jsx(v,{fontWeight:"bold",children:d("catalog.gift_wrapping.pick_color")}),e.jsx(En,{fullWidth:!0,children:I.map(Re=>e.jsx(L,{variant:"dark",active:Re.id===_,disabled:!me,style:{backgroundColor:Re.color},onClick:()=>T(Re.id)},Re.id))})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[e.jsx(L,{variant:"link",onClick:Qe,className:"text-black",children:d("cancel")}),e.jsx(L,{variant:"success",onClick:()=>cs("buy"),children:d("catalog.gift_wrapping.give_gift")})]})]})]})},TS=o=>{const[t,s]=i.useState(""),{currentType:n=null,rootNode:r=null,offersToNodes:a=null,searchResult:l=null,setSearchResult:c=null,setCurrentPage:m=null}=Le();return i.useEffect(()=>{let h=t==null?void 0:t.toLocaleLowerCase().replace(" ","");if(!h||!h.length){c(null);return}const u=setTimeout(()=>{const g=G().getAllFurnitureData({loadFurnitureData:null});if(!g||!g.length)return;const f=[],p=[];for(const j of g){if(n===Gs.BUILDER&&!j.availableForBuildersClub||n===Gs.NORMAL&&j.excludeDynamic)continue;const E=[j.className,j.name,j.description].join(" ").replace(/ /gi,"").toLowerCase();if(!(n===Gs.BUILDER&&j.purchaseOfferId===-1&&j.rentOfferId===-1)){if([..._u(a,j.purchaseOfferId),..._u(a,j.rentOfferId)].length&&(E.indexOf(h)>=0&&f.push(j),f.length===250))break}}const x=[];for(const j of f)x.push(new yC(j));let I=[];Zm(h,p,r,I),c(new AC(h,x,I.filter(j=>j.isVisible))),m(new lo(-1,"default_3x3",new eh([],[]),x,!1,1))},300);return()=>clearTimeout(u)},[a,n,r,t,m,c]),e.jsxs(w,{gap:1,children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:t,onChange:h=>s(h.target.value)})}),(!t||!t.length)&&e.jsx(L,{variant:"primary",className:"catalog-search-button",children:e.jsx(lg,{className:"fa-icon"})}),t&&!!t.length&&e.jsx(L,{variant:"primary",className:"catalog-search-button",onClick:h=>s(""),children:e.jsx(Hs,{className:"fa-icon"})})]})},Ah=o=>{const{node:t=null,child:s=!1}=o;return e.jsx(e.Fragment,{children:t&&t.children.length>0&&t.children.map((n,r)=>n.isVisible?e.jsx(Dh,{node:n,child:s},r):null)})},Dh=o=>{const{node:t=null,child:s=!1}=o,{activateNode:n=null}=Le();return e.jsxs(A,{className:"nitro-catalog-navigation-section",children:[e.jsxs(_e,{gap:1,column:!1,itemActive:t.isActive,onClick:r=>n(t),className:s?"inset":"",children:[e.jsx(kh,{icon:t.iconId}),e.jsx(v,{grow:!0,truncate:!0,children:t.localization}),t.isBranch&&e.jsxs(e.Fragment,{children:[t.isOpen&&e.jsx(gc,{className:"fa-icon blackselectiongen"}),!t.isOpen&&e.jsx(fc,{className:"fa-icon blackselectiongen"})]})]}),t.isOpen&&t.isBranch&&e.jsx(Ah,{node:t,child:!0})]})},yS=o=>{const{node:t=null}=o,{searchResult:s=null}=Le();return e.jsxs(e.Fragment,{children:[e.jsx(TS,{}),e.jsx(N,{fullHeight:!0,className:"nitro-catalog-navigation-grid-container rounded p-1",overflow:"hidden",children:e.jsxs(Pe,{id:"nitro-catalog-main-navigation",gap:1,columnCount:1,children:[s&&s.filteredNodes.length>0&&s.filteredNodes.map((n,r)=>e.jsx(Dh,{node:n},r)),!s&&e.jsx(Ah,{node:t})]})})]})},RS=o=>{const{columnCount:t=5,...s}=o,[n,r]=i.useState(!1),[a,l]=i.useState(null),{currentOffer:c=null,setPurchaseOptions:m=null}=Le(),{badgeCodes:h=[],activate:u=null,deactivate:g=null}=pi(),f=i.useMemo(()=>{if(!a)return null;const p=new li;return p.setValue(["0",a,"",""]),p},[a]);return i.useEffect(()=>{c&&m(p=>{const x={...p};return x.extraParamRequired=!0,x.extraData=f&&f.getValue(1)||null,x.previewStuffData=f,x})},[c,f,m]),i.useEffect(()=>{if(!n)return;const p=u();return()=>g(p)},[n,u,g]),i.useEffect(()=>(r(!0),()=>r(!1)),[]),e.jsx(Pe,{columnCount:t,...s,children:h&&h.length>0&&h.map((p,x)=>e.jsx(_e,{itemActive:a===p,onClick:I=>l(p),children:e.jsx(Xe,{badgeCode:p})},x))})},al=o=>{const{currentPage:t=null,setCurrentOffer:s=null}=Le();return i.useEffect(()=>{!t||!t.offers.length||s(t.offers[0])},[t,s]),null},Wc=o=>{const{offer:t=null,selectOffer:s=null,itemActive:n=!1,...r}=o,[a,l]=i.useState(!1),{requestOfferToMover:c=null}=Le(),{isVisible:m=!1}=dr(),h=i.useMemo(()=>t.pricingModel===Bt.PRICING_MODEL_BUNDLE?null:t.product.getIconUrl(t),[t]),u=f=>{switch(f.type){case ve.MOUSE_DOWN:s(t),l(!0);return;case ve.MOUSE_UP:l(!1);return;case ve.ROLL_OUT:if(!a||!n||!m)return;c(t);return}},g=t.product;return g?e.jsx(_e,{itemImage:h,itemCount:t.pricingModel===Bt.PRICING_MODEL_MULTI?g.productCount:1,itemUniqueSoldout:g.uniqueLimitedItemSeriesSize&&!g.uniqueLimitedItemsLeft,itemUniqueNumber:g.uniqueLimitedItemSeriesSize,itemActive:n,onMouseDown:u,onMouseUp:u,onMouseOut:u,...r,children:t.product.productType===xe.ROBOT&&e.jsx(it,{figure:t.product.extraParam,headOnly:!0,direction:3})}):null},xi=o=>{const{columnCount:t=5,children:s=null,...n}=o,{currentOffer:r=null,setCurrentOffer:a=null,currentPage:l=null,setPurchaseOptions:c=null}=Le(),m=i.useRef();if(i.useEffect(()=>{m&&m.current&&(m.current.scrollTop=0)},[l]),!l)return null;const h=u=>{u.activate(),!u.isLazy&&(a(u),u.product&&u.product.productType===xe.WALL&&c(g=>{const f={...g};return f.extraData=u.product.extraParam||null,f}))};return e.jsxs(Pe,{innerRef:m,columnCount:t,...n,children:[l.offers&&l.offers.length>0&&l.offers.map((u,g)=>e.jsx(Wc,{itemActive:r&&r.offerId===u.offerId,offer:u,selectOffer:h},g)),s]})},il=o=>{const{children:t=null,...s}=o,{currentOffer:n=null}=Le();return!n||n.pricingModel!==Bt.PRICING_MODEL_SINGLE||!n.product.isUniqueLimitedItem?null:e.jsxs(A,{...s,children:[e.jsx(Pv,{className:"mx-auto",uniqueLimitedItemsLeft:n.product.uniqueLimitedItemsLeft,uniqueLimitedSeriesSize:n.product.uniqueLimitedItemSeriesSize}),t]})},nn=o=>{const{noGiftOption:t=!1,purchaseCallback:s=null}=o,[n,r]=i.useState(tt.NONE),[a]=bn(Za.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1),{currentOffer:l=null,purchaseOptions:c=null,setPurchaseOptions:m=null,getNodesByOfferId:h=null}=Le(),{getCurrencyAmount:u=null}=Fr(),g=i.useCallback(I=>{switch(I.type){case wn.PURCHASE_SUCCESS:r(tt.NONE);return;case cr.PURCHASE_FAILED:r(tt.FAILED);return;case ni.NOT_ALLOWED:r(tt.FAILED);return;case ri.SOLD_OUT:r(tt.SOLD_OUT);return}},[]);ut(wn.PURCHASE_SUCCESS,g),ut(cr.PURCHASE_FAILED,g),ut(ni.NOT_ALLOWED,g),ut(ri.SOLD_OUT,g);const f=i.useMemo(()=>{if(!l||c.extraParamRequired&&(!c.extraData||!c.extraData.length))return!1;if(l.pricingModel===Bt.PRICING_MODEL_SINGLE){const I=l.product;if(I&&I.isUniqueLimitedItem)return!I.uniqueLimitedItemsLeft}return!1},[l,c]),p=(I=!1)=>{if(!l)return;if(Cs()<l.clubLevel){Z("habboUI/open/hccenter");return}if(I){Nt(new Yv(l.page.pageId,l.offerId,c.extraData));return}if(r(tt.PURCHASE),s){s();return}let j=l.page.pageId;D(new zo(j,l.offerId,c.extraData,c.quantity))};if(i.useEffect(()=>{l&&r(tt.NONE)},[l,m]),i.useEffect(()=>{let I=null;return(n===tt.CONFIRM||n===tt.FAILED)&&(I=setTimeout(()=>r(tt.NONE),3e3)),()=>{I&&clearTimeout(I)}},[n]),!l)return null;const x=()=>{const I=l.priceInCredits*c.quantity,j=l.priceInActivityPoints*c.quantity;if(Cs()<l.clubLevel)return e.jsx(L,{variant:"danger",disabled:!0,children:d("catalog.alert.hc.required")});if(f)return e.jsx(L,{variant:"danger",disabled:!0,children:d("catalog.alert.limited_edition_sold_out.title")});if(I>u(-1))return e.jsx(L,{variant:"danger",disabled:!0,children:d("catalog.alert.notenough.title")});if(j>u(l.activityPointType))return e.jsx(L,{variant:"danger",disabled:!0,children:d("catalog.alert.notenough.activitypoints.title."+l.activityPointType)});switch(n){case tt.CONFIRM:return e.jsx(L,{variant:"warning",onClick:()=>p(),children:d("catalog.marketplace.confirm_title")});case tt.PURCHASE:return e.jsx(L,{disabled:!0,children:e.jsx(Pc,{})});case tt.FAILED:return e.jsx(L,{variant:"danger",children:d("generic.failed")});case tt.SOLD_OUT:return e.jsx(L,{variant:"danger",children:d("generic.failed")+" - "+d("catalog.alert.limited_edition_sold_out.title")});case tt.NONE:default:return e.jsx(L,{disabled:c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:E=>r(tt.CONFIRM),children:d("catalog.purchase_confirmation."+(l.isRentOffer?"rent":"buy"))})}};return e.jsxs(e.Fragment,{children:[e.jsx(x,{}),!t&&!l.isRentOffer&&e.jsx(L,{disabled:c.quantity>1||!l.giftable||f||c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:()=>p(!0),children:d("catalog.purchase_confirmation.gift")})]})},Ph=o=>{const{offer:t=null,separator:s=!1}=o,{purchaseOptions:n=null}=Le(),{quantity:r=1}=n;return t?e.jsxs(e.Fragment,{children:[t.priceInCredits>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{bold:!0,children:t.priceInCredits*r}),e.jsx(_t,{type:-1})]}),s&&t.priceInCredits>0&&t.priceInActivityPoints>0&&e.jsx(Wo,{size:"xs",color:"black",className:"fa-icon"}),t.priceInActivityPoints>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{bold:!0,children:t.priceInActivityPoints*r}),e.jsx(_t,{type:t.activityPointType})]})]}):null},$n=o=>{const{gap:t=1,...s}=o,{currentOffer:n=null}=Le();return e.jsx(N,{gap:t,...s,children:e.jsx(Ph,{offer:n})})},mr=o=>{const{currentOffer:t=null,roomPreviewer:s=null,purchaseOptions:n=null}=Le(),{previewStuffData:r=null}=n;return i.useEffect(()=>{if(!t||t.pricingModel===Bt.PRICING_MODEL_BUNDLE||!s)return;const a=t.product;if(a)switch(s.reset(!1),a.productType){case xe.FLOOR:{if(!a.furnitureData)return;if(a.furnitureData.specialType===de.FIGURE_PURCHASABLE_SET){const c=G().getFloorItemData(a.furnitureData.id).customParams.split(",").map(u=>parseInt(u)),m=[];for(const u of c)St().isValidFigureSetForGender(u,G().gender)&&m.push(u);const h=St().getFigureStringWithFigureIds(G().figure,G().gender,m);s.addAvatarIntoRoom(h,a.productClassId)}else s.addFurnitureIntoRoom(a.productClassId,new At(90),r,a.extraParam);return}case xe.WALL:{if(!a.furnitureData)return;switch(a.furnitureData.specialType){case de.FLOOR:s.updateObjectRoom(a.extraParam);return;case de.WALL_PAPER:s.updateObjectRoom(null,a.extraParam);return;case de.LANDSCAPE:{s.updateObjectRoom(null,null,a.extraParam);const l=G().getWallItemDataByName("window_double_default");l&&s.addWallItemIntoRoom(l.id,new At(90),l.customParams);return}default:s.updateObjectRoom("default","default","default"),s.addWallItemIntoRoom(a.productClassId,new At(90),a.extraParam);return}}case xe.ROBOT:s.addAvatarIntoRoom(a.extraParam,0);return;case xe.EFFECT:s.addAvatarIntoRoom(G().figure,a.productClassId);return}},[t,r,s]),t?t.pricingModel===Bt.PRICING_MODEL_BUNDLE?e.jsx(N,{fit:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Pe,{fullWidth:!0,columnCount:4,className:"nitro-catalog-layout-bundle-grid",children:t.products.length>0&&t.products.map((a,l)=>e.jsx(_e,{itemImage:a.getIconUrl(t),itemCount:a.productCount},l))})}):e.jsx(Zo,{roomPreviewer:s,height:140}):null},OS=o=>{const{page:t=null}=o,{currentOffer:s=null}=Le();return e.jsxs(e.Fragment,{children:[e.jsx(al,{}),e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[e.jsx(xi,{shrink:!0}),e.jsxs(N,{gap:1,overflow:"hidden",children:[e.jsx(v,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog_selectbadge")}),e.jsx(RS,{})]})]}),e.jsxs(N,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(A,{position:"relative",overflow:"hidden",children:e.jsx(mr,{})}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(v,{grow:!0,truncate:!0,children:s.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{alignItems:"end"})}),e.jsx(nn,{})]})]})]})]})]})},ur=o=>{const{...t}=o,{currentOffer:s=null}=Le();return!s||!s.badgeCode||!s.badgeCode.length?null:e.jsx(Xe,{badgeCode:s.badgeCode,...t})},kS=1,AS=100,qc=o=>{const{currentOffer:t=null,purchaseOptions:s=null,setPurchaseOptions:n=null}=Le(),{quantity:r=1}=s,a=l=>{isNaN(l)&&(l=1),l=Math.max(l,kS),l=Math.min(l,AS),l!==r&&n(c=>{const m={...c};return m.quantity=l,m})};return!t||!t.bundlePurchaseAllowed?null:e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("catalog.bundlewidget.spinner.select.amount")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(xc,{className:"text-black cursor-pointer fa-icon",onClick:l=>a(r-1)}),e.jsx("input",{type:"number",className:"form-control form-control-sm quantity-input",value:r,onChange:l=>a(l.target.valueAsNumber)}),e.jsx(jc,{className:"text-black cursor-pointer fa-icon",onClick:l=>a(r+1)})]})]})},DS=o=>{const{page:t=null}=o,[s,n]=i.useState(new Map),{currentOffer:r=null,setCurrentOffer:a=null}=Le(),[l,c]=i.useState(!1),m=(p,x)=>!p.product.furnitureData.colorIndex||!x.product.furnitureData.colorIndex||p.product.furnitureData.colorIndex>x.product.furnitureData.colorIndex?1:p==x?0:-1,h=(p,x)=>p.product.furnitureData.className>x.product.furnitureData.className?1:p==x?0:-1,u=p=>{p.activate(),a(p)},g=(p,x)=>{const I=`${x}*${p}`,j=t.offers.findIndex(E=>E.product.furnitureData.fullName===I);j>-1&&u(t.offers[j])},f=i.useMemo(()=>{const p=[],x=new Map,I=new Map;return t.offers.sort(m),t.offers.forEach(j=>{if(!j.product)return;const E=j.product.furnitureData;if(!E||!E.hasIndexedColor)p.push(j);else{const C=E.className,b=E.colorIndex;I.has(C)||I.set(C,[]);let S=16777215;if(E.colors){for(let _ of E.colors)_!==16777215&&(S=_);I.get(C).indexOf(S)===-1&&(I.get(C)[b]=S)}x.has(C)||(p.push(j),x.set(C,!0))}}),p.sort(h),n(I),p},[t.offers]);return e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsxs(Pe,{columnCount:5,children:[(!l||!r||!s.has(r.product.furnitureData.className))&&f.map((p,x)=>e.jsx(Wc,{itemActive:r&&(r.product.furnitureData.hasIndexedColor?r.product.furnitureData.className===p.product.furnitureData.className:r.offerId===p.offerId),offer:p,selectOffer:u},x)),l&&r&&s.has(r.product.furnitureData.className)&&s.get(r.product.furnitureData.className).map((p,x)=>e.jsx(_e,{itemHighlight:!0,itemActive:r.product.furnitureData.colorIndex===x,itemColor:Ht.int2rgb(p),className:"clear-bg",onClick:I=>g(x,r.product.furnitureData.className)},x))]})}),e.jsxs(N,{center:!r,size:5,overflow:"hidden",children:[!r&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(mr,{}),e.jsx(ur,{position:"absolute",className:"bg-muted rounded bottom-1 end-1"}),r.product.furnitureData.hasIndexedColor&&e.jsx(L,{position:"absolute",className:"bottom-1 start-1",onClick:p=>c(x=>!x),children:e.jsx(lm,{className:"fa-icon"})})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(v,{grow:!0,truncate:!0,children:r.localizationName}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(N,{gap:1,children:e.jsx(qc,{})}),e.jsx($n,{justifyContent:"end",alignItems:"end"})]}),e.jsx(nn,{})]})]})]})]})},Lh=o=>{const{imageUrl:t=null}=o,[s,n]=i.useState("");return i.useEffect(()=>{n(t??K("catalog.asset.image.url").replace("%name%","catalog_header_roombuilder"))},[t]),e.jsx(w,{center:!0,fullWidth:!0,className:"nitro-catalog-header",children:e.jsx("img",{src:s,onError:({currentTarget:r})=>{r.src=K("catalog.asset.image.url").replace("%name%","catalog_header_roombuilder")}})})},PS=o=>{const{page:t=null}=o,{currentOffer:s=null,currentPage:n=null}=Le();return e.jsx(e.Fragment,{children:e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[K("catalog.headers")&&e.jsx(Lh,{imageUrl:n.localization.getImage(0)}),e.jsx(xi,{})]}),e.jsxs(N,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx(Tn,{imageUrl:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,overflow:"hidden",style:{height:140},children:[s.product.productType!==xe.BADGE&&e.jsxs(e.Fragment,{children:[e.jsx(mr,{}),e.jsx(ur,{className:"bg-muted rounded bottom-1 end-1"})]}),s.product.productType===xe.BADGE&&e.jsx(ur,{className:"scale-2"})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(v,{grow:!0,children:s.localizationName}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(N,{gap:1,children:e.jsx(qc,{})}),e.jsx($n,{justifyContent:"end",alignItems:"end"})]}),e.jsx(nn,{})]})]})]})]})})},LS=o=>{const{...t}=o,{currentOffer:s=null,purchaseOptions:n=null}=Le(),{previewStuffData:r=null}=n,a=i.useMemo(()=>{if(!s||!r)return null;const l=r.getValue(2);return!l||!l.length?null:l},[s,r]);return a?e.jsx(Xe,{badgeCode:a,isGroup:!0,...t}):null},Mh=o=>{const[t,s]=i.useState(0),{currentOffer:n=null,catalogOptions:r=null,setPurchaseOptions:a=null}=Le(),{groups:l=null}=r,c=i.useMemo(()=>{if(!l||!l.length)return null;const h=l[t];if(!h)return null;const u=new li;return u.setValue(["0",h.groupId.toString(),h.badgeCode,h.colorA,h.colorB]),u},[t,l]);if(i.useEffect(()=>{n&&a(h=>{const u={...h};return u.extraParamRequired=!0,u.extraData=c&&c.getValue(1)||null,u.previewStuffData=c,u})},[n,c,a]),i.useEffect(()=>{D(new Pm)},[]),!l||!l.length)return e.jsxs(A,{className:"bg-muted rounded p-1 text-black text-center",children:[d("catalog.guild_selector.members_only"),e.jsx(L,{className:"mt-1",children:d("catalog.guild_selector.find_groups")})]});const m=l[t];return e.jsxs(w,{gap:1,children:[!!m&&e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+m.colorA}}),e.jsx(A,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+m.colorB}})]}),e.jsx("select",{className:"form-select form-select-sm",value:t,onChange:h=>s(parseInt(h.target.value)),children:l.map((h,u)=>e.jsx("option",{value:u,children:h.groupName},u))})]})},MS=o=>{const{page:t=null}=o,{currentOffer:s=null}=Le();return e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsx(xi,{})}),e.jsxs(N,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(mr,{}),e.jsx(LS,{position:"absolute",className:"bottom-1 end-1"})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{truncate:!0,children:s.localizationName}),e.jsx(A,{grow:!0,children:e.jsx(Mh,{})}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{alignItems:"end"})}),e.jsx(nn,{})]})]})]})]})},US=o=>{const{page:t=null}=o,[s,n]=i.useState(0),{currentOffer:r=null,setCurrentOffer:a=null,catalogOptions:l=null}=Le(),{groups:c=null}=l;return i.useEffect(()=>{D(new Pm)},[t]),e.jsxs(e.Fragment,{children:[e.jsx(al,{}),e.jsxs(ne,{children:[e.jsx(N,{className:"bg-muted rounded p-2 text-black",size:7,overflow:"hidden",children:e.jsx(A,{className:"overflow-auto",dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})}),e.jsx(N,{size:5,overflow:"hidden",gap:1,children:!!r&&e.jsx(e.Fragment,{children:e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{truncate:!0,children:r.localizationName}),e.jsx(A,{grow:!0,children:e.jsx(Mh,{})}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{alignItems:"end"})}),e.jsx(nn,{noGiftOption:!0})]})})})]})]})},FS=o=>{const{page:t=null}=o;return e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",className:"bg-muted rounded p-2 text-black",children:[e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(A,{overflow:"auto",dangerouslySetInnerHTML:{__html:t.localization.getText(0)}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})]}),e.jsxs(N,{center:!0,size:5,overflow:"hidden",children:[e.jsx(Tn,{imageUrl:t.localization.getImage(1)}),e.jsx(L,{onClick:()=>Z("groups/create"),children:d("catalog.start.guild.purchase.button")})]})]})},VS=o=>{const{page:t=null}=o;return e.jsx("div",{className:"h-100 nitro-catalog-layout-info-loyalty text-black d-flex flex-row",children:e.jsx("div",{className:"overflow-auto h-100 d-flex flex-column info-loyalty-content",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})})})},Uh=o=>{const{page:t=null}=o,s=t.localization.getImage(1);return e.jsxs(N,{grow:!0,className:"bg-muted rounded text-black p-2",overflow:"hidden",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[s&&e.jsx("img",{alt:"",src:s}),e.jsx(A,{className:"fs-5",dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})]}),e.jsx(N,{grow:!0,alignItems:"center",overflow:"auto",children:e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}})}),e.jsx(w,{alignItems:"center",children:e.jsx(A,{className:"fw-bold",dangerouslySetInnerHTML:{__html:t.localization.getText(3)}})})]})},GS=o=>e.jsx(Uh,{...o}),BS=o=>{const{page:t=null}=o,[s,n]=i.useState(""),[r,a]=i.useState(""),[l,c]=i.useState(-1),[m,h]=i.useState([]),[u,g]=i.useState(!1),[f,p]=i.useState(1),{categories:x=null}=qs(),{setIsVisible:I=null}=Le(),{promoteInformation:j,isExtended:E,setIsExtended:C}=Bc();i.useEffect(()=>{E&&(c(j.data.flatId),n(j.data.eventName),a(j.data.eventDescription),p(j.data.categoryId),g(E),C(!1))},[E,s,r,f]);const b=()=>{c(-1),n(""),a(""),p(1),C(!1),I(!1)},S=()=>{const _=t.pageId,T=t.offers.length>=1?t.offers[0].offerId:-1,P=l,k=s,R=r,y=f;D(new zj(_,T,P,k,u,R,y)),b()};return U(Wj,_=>{const T=_.getParser();T&&h(T.rooms)}),i.useEffect(()=>{D(new qj),D(new Sm)},[]),e.jsxs(e.Fragment,{children:[e.jsx(v,{bold:!0,center:!0,children:d("roomad.catalog_header")}),e.jsxs(N,{size:12,overflow:"hidden",className:"text-black",children:[e.jsx(A,{children:d("roomad.catalog_text",["duration"],["120"])}),e.jsxs(A,{className:"bg-muted rounded p-1",children:[e.jsxs(N,{gap:2,children:[e.jsx(v,{bold:!0,children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",value:f,onChange:_=>p(parseInt(_.target.value)),disabled:u,children:x&&x.map((_,T)=>e.jsx("option",{value:_.id,children:d(_.name)},T))})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("roomad.catalog_name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:64,value:s,onChange:_=>n(_.target.value),readOnly:u})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("roomad.catalog_description")}),e.jsx("textarea",{className:"form-control form-control-sm",maxLength:64,value:r,onChange:_=>a(_.target.value),readOnly:u})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("roomad.catalog_roomname")}),e.jsxs("select",{className:"form-select form-select-sm",value:l,onChange:_=>c(parseInt(_.target.value)),disabled:u,children:[e.jsx("option",{value:-1,disabled:!0,children:d("roomad.catalog_roomname")}),m&&m.map((_,T)=>e.jsx("option",{value:_.roomId,children:_.roomName},T))]})]}),e.jsx(N,{gap:1,children:e.jsx(L,{variant:!s||!r||l===-1?"danger":"success",onClick:S,disabled:!s||!r||l===-1,children:d(u?"roomad.extend.event":"buy")})})]})]})]})},Fh=o=>{const{columnCount:t=5,children:s=null,...n}=o,{currentOffer:r=null}=Le(),a=i.useRef();return i.useEffect(()=>{a&&a.current&&(a.current.scrollTop=0)},[r]),r?e.jsxs(Pe,{innerRef:a,columnCount:5,...n,children:[r.products&&r.products.length>0&&r.products.map((l,c)=>e.jsx(_e,{itemImage:l.getIconUrl(),itemCount:l.productCount},c)),s]}):null},Vh=o=>{const{gap:t=1,...s}=o,{currentOffer:n=null}=Le();return e.jsx(w,{gap:t,alignItems:"center",classNames:["bg-muted","p-1","rounded"],...s,children:e.jsx(Ph,{separator:!0,offer:n})})},HS=o=>{const{page:t=null}=o;return e.jsxs(e.Fragment,{children:[e.jsx(al,{}),e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[!!t.localization.getText(2)&&e.jsx(v,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(N,{grow:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Fh,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),e.jsxs(N,{size:5,overflow:"hidden",gap:1,children:[!!t.localization.getText(1)&&e.jsx(v,{center:!0,small:!0,overflow:"auto",children:t.localization.getText(1)}),e.jsxs(N,{grow:!0,position:"relative",overflow:"hidden",gap:0,children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",className:"flex-grow-1",src:t.localization.getImage(1)}),e.jsx(ur,{position:"absolute",className:"bg-muted rounded bottom-0 start-0"}),e.jsx(Vh,{position:"absolute",className:"bottom-0 end-0"})]}),e.jsx(N,{gap:1,children:e.jsx(nn,{})})]})]})]})},WS=o=>{const{page:t=null}=o;return e.jsxs(e.Fragment,{children:[e.jsx(al,{}),e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[!!t.localization.getText(2)&&e.jsx(v,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(N,{grow:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Fh,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),e.jsxs(N,{size:5,overflow:"hidden",gap:1,children:[!!t.localization.getText(1)&&e.jsx(v,{center:!0,small:!0,overflow:"auto",children:t.localization.getText(1)}),e.jsxs(N,{grow:!0,position:"relative",overflow:"hidden",gap:0,children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",className:"flex-grow-1",src:t.localization.getImage(1)}),e.jsx(ur,{position:"absolute",className:"bg-muted rounded bottom-0 start-0"}),e.jsx(Vh,{position:"absolute",className:"bottom-0 end-0"})]}),e.jsx(N,{gap:1,children:e.jsx(nn,{})})]})]})]})},qS=o=>{const{page:t=null}=o,[s,n]=i.useState(-1),[r,a]=i.useState(""),{currentOffer:l=null,currentPage:c=null}=Le(),m=h=>{var u;return(u=Ce().soundManager.musicController)==null?void 0:u.playSong(h,Sa.PRIORITY_PURCHASE_PREVIEW,15,0,0,0)};return U(Yj,h=>{const u=h.getParser();u.officialSongId===r&&n(u.songId)}),i.useEffect(()=>{if(!l)return;const h=l.product;if(h){if(h.extraParam.length>0){const u=parseInt(h.extraParam);u>0?n(u):(a(h.extraParam),D(new $j(h.extraParam)))}else a(""),n(-1);return()=>{var u;return(u=Ce().soundManager.musicController)==null?void 0:u.stop(Sa.PRIORITY_PURCHASE_PREVIEW)}}},[l]),i.useEffect(()=>()=>{var h;return(h=Ce().soundManager.musicController)==null?void 0:h.stop(Sa.PRIORITY_PURCHASE_PREVIEW)},[]),e.jsx(e.Fragment,{children:e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[K("catalog.headers")&&e.jsx(Lh,{imageUrl:c.localization.getImage(0)}),e.jsx(xi,{})]}),e.jsxs(N,{center:!l,size:5,overflow:"hidden",children:[!l&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx(Tn,{imageUrl:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),l&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,overflow:"hidden",style:{height:140},children:[l.product.productType!==xe.BADGE&&e.jsxs(e.Fragment,{children:[e.jsx(mr,{}),e.jsx(ur,{className:"bg-muted rounded bottom-1 end-1"})]}),l.product.productType===xe.BADGE&&e.jsx(ur,{className:"scale-2"})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(v,{grow:!0,truncate:!0,children:l.localizationName}),s>-1&&e.jsx(L,{onClick:()=>m(s),children:d("play_preview_button")}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(N,{gap:1,children:e.jsx(qc,{})}),e.jsx($n,{justifyContent:"end",alignItems:"end"})]}),e.jsx(nn,{})]})]})]})]})})},zS=["floors","walls","views"],YS=o=>{const{columnCount:t=5,children:s=null,...n}=o,[r,a]=i.useState(null),[l,c]=i.useState(-1),[m,h]=i.useState(null),{currentPage:u=null,currentOffer:g=null,setCurrentOffer:f=null,setPurchaseOptions:p=null}=Le(),x=i.useRef(),I=E=>{E&&h(C=>{const b=[...C];return b[l]=E,b})};if(i.useEffect(()=>{if(!u)return;const E=[[],[],[]];for(const C of u.offers){if(C.pricingModel!==Bt.PRICING_MODEL_SINGLE&&C.pricingModel!==Bt.PRICING_MODEL_MULTI)continue;const b=C.product;if(!b||b.productType!==xe.WALL&&b.productType!==xe.FLOOR||!b.furnitureData)continue;switch(b.furnitureData.className){case"floor":E[0].push(C);break;case"wallpaper":E[1].push(C);break;case"landscape":E[2].push(C);break}}a(E),c(0),h([E[0][0],E[1][0],E[2][0]])},[u]),i.useEffect(()=>{l===-1||!m||f(m[l])},[l,m,f]),i.useEffect(()=>{l===-1||!m||!g||p(E=>{const C={...E};return C.extraData=m[l].product.extraParam,C.extraParamRequired=!0,C})},[g,l,m,p]),i.useEffect(()=>{x&&x.current&&(x.current.scrollTop=0)},[l]),!r||l===-1)return null;const j=r[l];return e.jsxs(e.Fragment,{children:[e.jsx(En,{children:zS.map((E,C)=>e.jsx(L,{active:l===C,onClick:b=>c(C),children:d(`catalog.spaces.tab.${E}`)},C))}),e.jsxs(Pe,{innerRef:x,columnCount:t,...n,children:[j&&j.length>0&&j.map((E,C)=>e.jsx(Wc,{itemActive:g&&g===E,offer:E,selectOffer:b=>I(b)},C)),s]})]})},$S=o=>{const{page:t=null}=o,{currentOffer:s=null,roomPreviewer:n=null}=Le();return i.useEffect(()=>{n.updatePreviewObjectBoundingRectangle(new Vs)},[n]),e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsx(YS,{})}),e.jsxs(N,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(A,{position:"relative",overflow:"hidden",children:e.jsx(mr,{})}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{grow:!0,truncate:!0,children:s.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{alignItems:"end"})}),e.jsx(nn,{})]})]})]})]})},KS=o=>{const{page:t=null}=o,[s,n]=i.useState(""),{currentOffer:r=null,setPurchaseOptions:a=null}=Le();return i.useEffect(()=>{r&&a(l=>{const c={...l};return c.extraData=s,c})},[r,s,a]),e.jsxs(ne,{children:[e.jsxs(N,{size:7,overflow:"hidden",children:[e.jsx(xi,{}),e.jsx("textarea",{className:"flex-grow-1 form-control w-100",defaultValue:s||"",onChange:l=>n(l.target.value)})]}),e.jsxs(N,{center:!r,size:5,overflow:"hidden",children:[!r&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(mr,{}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{grow:!0,truncate:!0,children:r.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{alignItems:"end"})}),e.jsx(nn,{})]})]})]})]})},XS=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(tt.NONE),{currentPage:a=null,catalogOptions:l=null}=Le(),{purse:c=null,getCurrencyAmount:m=null}=Fr(),{clubOffers:h=null}=l,u=i.useCallback(C=>{switch(C.type){case wn.PURCHASE_SUCCESS:r(tt.NONE);return;case cr.PURCHASE_FAILED:r(tt.FAILED);return}},[]);ut(wn.PURCHASE_SUCCESS,u),ut(cr.PURCHASE_FAILED,u);const g=i.useCallback(C=>{let b="";return C.months>0&&(b=d("catalog.vip.item.header.months",["num_months"],[C.months.toString()])),C.extraDays>0&&(b!==""&&(b+=" "),b+=" "+d("catalog.vip.item.header.days",["num_days"],[C.extraDays.toString()])),b},[]),f=i.useCallback(()=>{if(!c)return"";const C=c.clubDays>0||c.clubPeriods>0?"extension.":"subscription.",b=t.months===0?"days":"months",S=t.months===0?t.extraDays:t.months;return d("catalog.vip.buy.confirm."+C+b).replace("%NUM_"+b.toUpperCase()+"%",S.toString())},[t,c]),p=i.useCallback(()=>{let C=d("catalog.vip.buy.confirm.end_date");return C=C.replace("%month%",t.month.toString()),C=C.replace("%day%",t.day.toString()),C=C.replace("%year%",t.year.toString()),C},[t]),x=i.useMemo(()=>{const C=c.clubDays,S=c.clubPeriods*31+C;return d("catalog.vip.extend.info",["days"],[S.toString()])},[c]),I=i.useCallback(()=>{t&&(r(tt.PURCHASE),D(new zo(a.pageId,t.offerId,null,1)))},[t,a]),j=i.useCallback(C=>{r(tt.NONE),s(C)},[]),E=i.useCallback(()=>{if(!t)return null;if(t.priceCredits>m(-1))return e.jsx(L,{fullWidth:!0,variant:"danger",children:d("catalog.alert.notenough.title")});if(t.priceActivityPoints>m(t.priceActivityPointsType))return e.jsx(L,{fullWidth:!0,variant:"danger",children:d("catalog.alert.notenough.activitypoints.title."+t.priceActivityPointsType)});switch(n){case tt.CONFIRM:return e.jsx(L,{fullWidth:!0,variant:"warning",onClick:I,children:d("catalog.marketplace.confirm_title")});case tt.PURCHASE:return e.jsx(L,{fullWidth:!0,variant:"primary",disabled:!0,children:e.jsx(Pc,{})});case tt.FAILED:return e.jsx(L,{fullWidth:!0,variant:"danger",disabled:!0,children:d("generic.failed")});case tt.NONE:default:return e.jsx(L,{fullWidth:!0,variant:"success",onClick:()=>r(tt.CONFIRM),children:d("buy")})}},[t,n,I,m]);return i.useEffect(()=>{h||D(new Kj(1))},[h]),e.jsxs(ne,{children:[e.jsxs(N,{fullHeight:!0,size:7,overflow:"hidden",justifyContent:"between",children:[e.jsx(Pe,{columnCount:1,className:"nitro-catalog-layout-vip-buy-grid",children:h&&h.length>0&&h.map((C,b)=>e.jsxs(_e,{column:!1,center:!1,alignItems:"center",justifyContent:"between",itemActive:t===C,className:"p-1",onClick:()=>j(C),children:[e.jsx("i",{className:"icon-hc-banner"}),e.jsxs(N,{justifyContent:"end",gap:0,children:[e.jsx(v,{textEnd:!0,children:g(C)}),e.jsxs(w,{justifyContent:"end",gap:1,children:[C.priceCredits>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(v,{children:C.priceCredits}),e.jsx(_t,{type:-1})]}),C.priceActivityPoints>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(v,{children:C.priceActivityPoints}),e.jsx(_t,{type:C.priceActivityPointsType})]})]})]})]},b))}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:d("catalog.vip.buy.hccenter")}})]}),e.jsxs(N,{size:5,overflow:"hidden",children:[e.jsxs(N,{fullHeight:!0,center:!0,overflow:"hidden",children:[a.localization.getImage(1)&&e.jsx("img",{alt:"",src:a.localization.getImage(1)}),e.jsx(v,{center:!0,overflow:"auto",dangerouslySetInnerHTML:{__html:x}})]}),t&&e.jsxs(N,{fullWidth:!0,grow:!0,justifyContent:"end",children:[e.jsxs(w,{alignItems:"end",children:[e.jsxs(N,{grow:!0,gap:0,children:[e.jsx(v,{fontWeight:"bold",children:f()}),e.jsx(v,{children:p()})]}),e.jsxs(N,{gap:1,children:[t.priceCredits>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(v,{children:t.priceCredits}),e.jsx(_t,{type:-1})]}),t.priceActivityPoints>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(v,{children:t.priceActivityPoints}),e.jsx(_t,{type:t.priceActivityPointsType})]})]})]}),E()]})]})]})},QS=o=>{const{text:t=null}=o,[s,n]=i.useState(""),[r,a]=i.useState(!1),{simpleAlert:l=null}=Fe(),c=()=>{!s||!s.length||r||(D(new Jj(s)),a(!0))};return U(Xj,m=>{const h=m.getParser();let u=d("catalog.alert.voucherredeem.ok.description");h.productName&&(u=d("catalog.alert.voucherredeem.ok.description.furni",["productName","productDescription"],[h.productName,h.productDescription])),l(u,null,null,null,d("catalog.alert.voucherredeem.ok.title")),a(!1),n("")}),U(Qj,m=>{const h=m.getParser();l(d(`catalog.alert.voucherredeem.error.description.${h.errorCode}`),null,null,null,d("catalog.alert.voucherredeem.error.title")),a(!1)}),e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:t,value:s,onChange:m=>n(m.target.value)}),e.jsx(L,{variant:"primary",onClick:c,disabled:r,children:e.jsx(cg,{className:"fa-icon"})})]})},Vi=o=>{const{item:t=null,position:s="relative",pointer:n=!0,overflow:r="hidden",fullHeight:a=!0,classNames:l=[],children:c=null,...m}=o,h=i.useMemo(()=>{const g=["rounded","nitro-front-page-item"];return l.length&&g.push(...l),g},[l]);if(!t)return null;const u=K("image.library.url")+t.itemPromoImage;return e.jsxs(fh,{imageUrl:u,classNames:h,position:s,fullHeight:a,pointer:n,overflow:r,...m,children:[e.jsx(v,{position:"absolute",variant:"white",className:"bg-dark rounded p-2 m-2 bottom-0",children:t.itemName}),c]})},JS=o=>{const{page:t=null,hideNavigation:s=null}=o,{frontPageItems:n=[]}=Le(),r=i.useCallback(a=>{switch(a.type){case hu.ITEM_CATALOGUE_PAGE:Z(`catalog/open/${a.catalogPageLocation}`);return;case hu.ITEM_PRODUCT_OFFER:Z(`catalog/open/${a.productOfferId}`);return}},[]);return i.useEffect(()=>{s()},[t,s]),e.jsxs(ne,{children:[e.jsx(N,{size:4,children:n[0]&&e.jsx(Vi,{item:n[0],onClick:a=>r(n[0])})}),e.jsxs(N,{size:8,children:[n[1]&&e.jsx(Vi,{item:n[1],onClick:a=>r(n[1])}),n[2]&&e.jsx(Vi,{item:n[2],onClick:a=>r(n[2])}),n[3]&&e.jsx(Vi,{item:n[3],onClick:a=>r(n[3])}),e.jsx(QS,{text:t.localization.getText(1)})]})]})},cc=1,eo=2,Gh=o=>{const{offerData:t=null,type:s=eo,onClick:n=null}=o,r=i.useMemo(()=>t?d((t.furniType===2?"wallItem":"roomItem")+`.name.${t.furniId}`):"",[t]),a=i.useCallback(()=>{if(!t)return"";if(t.status===Qa.SOLD)return d("catalog.marketplace.offer.sold");if(t.timeLeftMinutes<=0)return d("catalog.marketplace.offer.expired");const l=Math.max(1,t.timeLeftMinutes),c=Math.floor(l/60);let h=l-c*60+" "+d("catalog.marketplace.offer.minutes");return c>0&&(h=c+" "+d("catalog.marketplace.offer.hours")+" "+h),d("catalog.marketplace.offer.time_left",["time"],[h])},[t]);return e.jsxs(_e,{shrink:!0,center:!1,column:!1,alignItems:"center",className:"p-1",children:[e.jsx(N,{style:{width:40,height:40},children:e.jsx(_e,{column:!1,itemImage:RC(t.furniType===Xa.TYPE_FLOOR?xe.FLOOR:xe.WALL,t.furniId,t.extraData),itemUniqueNumber:t.isUniqueLimitedItem?t.stuffData.uniqueNumber:0})}),e.jsxs(N,{grow:!0,gap:0,children:[e.jsx(v,{fontWeight:"bold",children:r}),s===cc&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("catalog.marketplace.offer.price_own_item",["price"],[t.price.toString()])}),e.jsx(v,{children:a()})]}),s===eo&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("catalog.marketplace.offer.price_public_item",["price","average"],[t.price.toString(),t.averagePrice>0?t.averagePrice.toString():"-"])}),e.jsx(v,{children:d("catalog.marketplace.offer_count",["count"],[t.offerCount.toString()])})]})]}),e.jsxs(N,{gap:1,children:[s===cc&&t.status!==Qa.SOLD&&e.jsx(L,{variant:"secondary",onClick:()=>n(t),children:d("catalog.marketplace.offer.pick")}),s===eo&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"secondary",onClick:()=>n(t),children:d("buy")}),e.jsx(L,{variant:"secondary",disabled:!0,children:d("catalog.marketplace.view_more")})]})]})]})},ZS=o=>{const[t,s]=i.useState(0),[n,r]=i.useState([]),{simpleAlert:a=null}=Fe();U(Zj,h=>{const u=h.getParser();if(!u)return;const g=u.offers.map(f=>{const p=new Xa(f.offerId,f.furniId,f.furniType,f.extraData,f.stuffData,f.price,f.status,f.averagePrice,f.offerCount);return p.timeLeftMinutes=f.timeLeftMinutes,p});s(u.creditsWaiting),r(g)}),U(eI,h=>{const u=h.getParser();if(u){if(!u.success){a(d("catalog.marketplace.cancel_failed"),je.DEFAULT,null,null,d("catalog.marketplace.operation_failed.topic"));return}r(g=>g.filter(f=>f.offerId!==u.offerId))}});const l=i.useMemo(()=>n.filter(h=>h.status===Qa.SOLD),[n]),c=i.useCallback(()=>{r(h=>{const u=l.map(g=>g.offerId);return h.filter(g=>u.indexOf(g.offerId)===-1)}),D(new tI)},[l]),m=h=>{D(new nI(h.offerId))};return i.useEffect(()=>{D(new sI)},[]),e.jsxs(N,{overflow:"hidden",children:[t<=0&&e.jsx(v,{center:!0,className:"bg-muted rounded p-1",children:d("catalog.marketplace.redeem.no_sold_items")}),t>0&&e.jsxs(N,{center:!0,gap:1,className:"bg-muted rounded p-2",children:[e.jsx(v,{children:d("catalog.marketplace.redeem.get_credits",["count","credits"],[l.length.toString(),t.toString()])}),e.jsx(L,{className:"mt-1",onClick:c,children:d("catalog.marketplace.offer.redeem")})]}),e.jsxs(N,{gap:1,overflow:"hidden",children:[e.jsx(v,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog.marketplace.items_found",["count"],[n.length.toString()])}),e.jsx(N,{overflow:"auto",className:"nitro-catalog-layout-marketplace-grid",children:n.length>0&&n.map(h=>e.jsx(Gh,{offerData:h,type:cc,onClick:m},h.offerId))})]})]})},ew=o=>{const{searchType:t=null,sortTypes:s=null,onSearch:n=null}=o,[r,a]=i.useState(s?s[0]:3),[l,c]=i.useState(""),[m,h]=i.useState(0),[u,g]=i.useState(0),f=i.useCallback(x=>{a(x),(t===Yt.BY_ACTIVITY||t===Yt.BY_VALUE)&&n({minPrice:-1,maxPrice:-1,query:"",type:x})},[n,t]),p=i.useCallback(()=>{const x=m>0?m:-1,I=u>0?u:-1;n({minPrice:x,maxPrice:I,type:r,query:l})},[u,m,n,l,r]);return i.useEffect(()=>{if(!s||!s.length)return;const x=s[0];a(x),(t===Yt.BY_ACTIVITY||Yt.BY_VALUE===t)&&n({minPrice:-1,maxPrice:-1,query:"",type:x})},[n,t,s]),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("catalog.marketplace.sort_order")}),e.jsx("select",{className:"form-select form-select-sm",value:r,onChange:x=>f(parseInt(x.target.value)),children:s.map(x=>e.jsx("option",{value:x,children:d(`catalog.marketplace.sort.${x}`)},x))})]}),t===Yt.ADVANCED&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("catalog.marketplace.search_name")}),e.jsx("input",{className:"form-control form-control-sm",type:"text",value:l,onChange:x=>c(x.target.value)})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("catalog.marketplace.search_price")}),e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:m,onChange:x=>h(x.target.valueAsNumber)}),e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:u,onChange:x=>g(x.target.valueAsNumber)})]})]}),e.jsx(L,{variant:"secondary",className:"mx-auto",onClick:p,children:d("generic.search")})]})]})},tw=[1,2],sw=[3,4,5,6],nw=[1,2,3,4,5,6],rw=o=>{const[t,s]=i.useState(Yt.BY_ACTIVITY),[n,r]=i.useState(0),[a,l]=i.useState(new Map),[c,m]=i.useState({minPrice:-1,maxPrice:-1,query:"",type:3}),{getCurrencyAmount:h=null}=Fr(),{simpleAlert:u=null,showConfirm:g=null}=Fe(),f=i.useCallback(I=>{m(I),D(new rI(I.minPrice,I.maxPrice,I.query,I.type))},[]),p=i.useMemo(()=>{switch(t){case Yt.BY_ACTIVITY:return sw;case Yt.BY_VALUE:return tw;case Yt.ADVANCED:return nw}return[]},[t]),x=i.useCallback(I=>{if(I.price>h(-1)){u(d("catalog.alert.notenough.credits.description"),je.DEFAULT,null,null,d("catalog.alert.notenough.title"));return}const j=I.offerId;g(d("catalog.marketplace.confirm_header"),()=>{D(new gu(j))},null,null,null,d("catalog.marketplace.confirm_title"))},[h,u,g]);return U(aI,I=>{const j=I.getParser();if(!j)return;const E=new Map;j.offers.forEach(C=>{const b=new Xa(C.offerId,C.furniId,C.furniType,C.extraData,C.stuffData,C.price,C.status,C.averagePrice,C.offerCount);b.timeLeftMinutes=C.timeLeftMinutes,E.set(C.offerId,b)}),r(j.totalItemsFound),l(E)}),U(iI,I=>{const j=I.getParser();if(j)switch(j.result){case 1:f(c);break;case 2:l(E=>{const C=new Map(E);return C.delete(j.requestedOfferId),C}),u(d("catalog.marketplace.not_available_header"),je.DEFAULT,null,null,d("catalog.marketplace.not_available_title"));break;case 3:l(E=>{const C=new Map(E),b=C.get(j.requestedOfferId);return b&&(b.offerId=j.offerId,b.price=j.newPrice,b.offerCount--,C.set(b.offerId,b)),C.delete(j.requestedOfferId),C}),g(d("catalog.marketplace.confirm_higher_header")+`
|
||
`+d("catalog.marketplace.confirm_price",["price"],[j.newPrice.toString()]),()=>{D(new gu(j.offerId))},null,null,null,d("catalog.marketplace.confirm_higher_title"));break;case 4:u(d("catalog.alert.notenough.credits.description"),je.DEFAULT,null,null,d("catalog.alert.notenough.title"));break}}),e.jsxs(e.Fragment,{children:[e.jsxs(En,{children:[e.jsx(L,{active:t===Yt.BY_ACTIVITY,onClick:()=>s(Yt.BY_ACTIVITY),children:d("catalog.marketplace.search_by_activity")}),e.jsx(L,{active:t===Yt.BY_VALUE,onClick:()=>s(Yt.BY_VALUE),children:d("catalog.marketplace.search_by_value")}),e.jsx(L,{active:t===Yt.ADVANCED,onClick:()=>s(Yt.ADVANCED),children:d("catalog.marketplace.search_advanced")})]}),e.jsx(ew,{sortTypes:p,searchType:t,onSearch:f}),e.jsxs(N,{gap:1,overflow:"hidden",children:[e.jsx(v,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog.marketplace.items_found",["count"],[a.size.toString()])}),e.jsx(N,{className:"nitro-catalog-layout-marketplace-grid",overflow:"auto",children:Array.from(a.values()).map((I,j)=>e.jsx(Gh,{offerData:I,type:eo,onClick:x},j))})]})]})},aw=o=>{const{page:t=null}=o,[s,n]=i.useState(-1),[r,a]=i.useState([]),[l,c]=i.useState(-1),[m,h]=i.useState([]),[u,g]=i.useState(-1),[f,p]=i.useState(!1),[x,I]=i.useState(""),[j,E]=i.useState(!0),[C,b]=i.useState(-1),{currentOffer:S=null,setCurrentOffer:_=null,setPurchaseOptions:T=null,catalogOptions:P=null,roomPreviewer:k=null}=Le(),{petPalettes:R=null}=P,y=i.useMemo(()=>!m.length||u===-1?16777215:m[u][0],[m,u]),O=i.useMemo(()=>s===-1||!r.length||l===-1?"":d(`pet.breed.${s}.${r[l].breedId}`),[s,r,l]),F=i.useMemo(()=>{if(!r.length||l===-1)return"";const q=r[l].paletteId;let M=16777215;if(s<=7){if(u===-1)return"";M=m[u][0]}let X=M.toString(16).toUpperCase();for(;X.length<6;)X="0"+X;return`${q}
|
||
${X}`},[r,l,s,m,u]),V=i.useMemo(()=>{let q="";switch(C){case 1:q="catalog.alert.petname.long";break;case 2:q="catalog.alert.petname.short";break;case 3:q="catalog.alert.petname.chars";break;case 4:q="catalog.alert.petname.bobba";break}return!q||!q.length?"":d(q)},[C]),Y=i.useCallback(()=>{if(C===-1){D(new oI(x,1));return}if(C===0){D(new zo(t.pageId,S.offerId,`${x}
|
||
${F}`,1));return}},[t,S,x,F,C]);return U(lI,q=>{const M=q.getParser();b(M.result),M.result===0?Y():Nt(new cr(-1))}),i.useEffect(()=>{if(!t||!t.offers.length)return;const q=t.offers[0];_(q),n(wC(q.localizationId)),p(!1)},[t,_]),i.useEffect(()=>{if(!S)return;const q=S.product.productData;if(q){if(R)for(const M of R){if(M.breed!==q.type)continue;const X=[];for(const he of M.palettes)he.sellable&&X.push(he);c(X.length?0:-1),a(X);return}c(-1),a([]),D(new cI(q.type))}},[S,R]),i.useEffect(()=>{if(s===-1)return;const q=TC(s,r);g(q.length?0:-1),h(q)},[s,r]),i.useEffect(()=>{if(!k||(k.reset(!1),s===-1||!r.length||l===-1))return;let q=`${s} ${r[l].paletteId}`;s<=7&&(q+=` ${y.toString(16)}`),k.addPetIntoRoom(q)},[k,s,r,l,y]),i.useEffect(()=>{b(-1)},[x]),S?e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsxs(Pe,{columnCount:5,children:[!f&&r.length>0&&r.map((q,M)=>e.jsx(_e,{itemActive:l===M,onClick:X=>c(M),children:e.jsx(jn,{typeId:s,paletteId:q.paletteId,direction:2,headOnly:!0})},M)),f&&m.length>0&&m.map((q,M)=>e.jsx(_e,{itemHighlight:!0,itemActive:u===M,itemColor:Ht.int2rgb(q[0]),className:"clear-bg",onClick:X=>g(M)},M))]})}),e.jsxs(N,{center:!S,size:5,overflow:"hidden",children:[!S&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(v,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),S&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(mr,{}),e.jsx(ur,{position:"absolute",className:"bg-muted rounded bottom-1 end-1"}),s>-1&&s<=7&&e.jsx(L,{position:"absolute",className:"bottom-1 start-1",onClick:q=>p(!f),children:e.jsx(lm,{className:"fa-icon"})})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{truncate:!0,children:O}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm w-100",placeholder:d("widgets.petpackage.name.title"),value:x,onChange:q=>I(q.target.value)}),C>0&&e.jsx(A,{className:"invalid-feedback d-block m-0",children:V})]}),e.jsx(w,{justifyContent:"end",children:e.jsx($n,{justifyContent:"end",alignItems:"end"})}),e.jsx(nn,{purchaseCallback:Y})]})]})]})]}):null},iw=o=>{const{offer:t=null,isAvailable:s=!1,daysRequired:n=0,onSelect:r=null}=o,a=i.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0];return Zi.getProductImageUrl(c.productType,c.furniClassId,c.extraParam)},[t]),l=i.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0],m=Zi.getProductCategory(c.productType,c.furniClassId)===2?"wallItem.name."+c.furniClassId:"roomItem.name."+c.furniClassId;return d(m)},[t]);return i.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0],m=Zi.getProductCategory(c.productType,c.furniClassId)===2?"wallItem.desc."+c.furniClassId:"roomItem.desc."+c.furniClassId;return d(m)},[t]),i.useCallback(()=>Math.floor(n/31),[n]),e.jsxs(_e,{center:!1,column:!1,alignItems:"center",className:"p-1",children:[e.jsx(Tn,{imageUrl:a()}),e.jsx(v,{grow:!0,fontWeight:"bold",children:l()}),e.jsx(L,{variant:"secondary",onClick:()=>r(t.localizationId),disabled:!s,children:d("catalog.club_gift.select")})]})},ow=o=>{const{purse:t=null}=Fr(),{catalogOptions:s=null,setCatalogOptions:n=null}=Le(),{clubGifts:r=null}=s,{showConfirm:a=null}=Fe(),l=i.useCallback(()=>r?r.giftsAvailable>0?d("catalog.club_gift.available",["amount"],[r.giftsAvailable.toString()]):r.daysUntilNextGift>0?d("catalog.club_gift.days_until_next",["days"],[r.daysUntilNextGift.toString()]):t.isVip?d("catalog.club_gift.not_available"):d("catalog.club_gift.no_club"):"",[r,t]),c=i.useCallback(h=>{a(d("catalog.club_gift.confirm"),()=>{D(new uI(h)),n(u=>(u.clubGifts.giftsAvailable--,{...u}))},null)},[n,a]),m=i.useMemo(()=>r.offers.sort((u,g)=>r.getOfferExtraData(u.offerId).daysRequired-r.getOfferExtraData(g.offerId).daysRequired),[r]);return e.jsxs(e.Fragment,{children:[e.jsx(v,{truncate:!0,shrink:!0,fontWeight:"bold",children:l()}),e.jsx(Pe,{columnCount:1,className:"nitro-catalog-layout-vip-gifts-grid",children:r.offers.length>0&&m.map(h=>e.jsx(iw,{offer:h,isAvailable:r.getOfferExtraData(h.offerId).isSelectable&&r.giftsAvailable>0,onSelect:c,daysRequired:r.getOfferExtraData(h.offerId).daysRequired},h.offerId))})]})},lw=(o,t)=>{if(!o)return null;const s={page:o,hideNavigation:t};switch(o.layoutCode){case"frontpage_featured":return null;case"frontpage4":return e.jsx(JS,{...s});case"pets":return e.jsx(aw,{...s});case"pets2":return e.jsx(GS,{...s});case"pets3":return e.jsx(Uh,{...s});case"vip_buy":return e.jsx(XS,{...s});case"guild_frontpage":return e.jsx(FS,{...s});case"guild_forum":return e.jsx(US,{...s});case"guild_custom_furni":return e.jsx(MS,{...s});case"club_gifts":return e.jsx(ow,{...s});case"marketplace_own_items":return e.jsx(ZS,{...s});case"marketplace":return e.jsx(rw,{...s});case"single_bundle":return e.jsx(WS,{...s});case"room_bundle":return e.jsx(HS,{...s});case"spaces_new":return e.jsx($S,{...s});case"trophies":return e.jsx(KS,{...s});case"info_loyalty":return e.jsx(VS,{...s});case"badge_display":return e.jsx(OS,{...s});case"roomads":return e.jsx(BS,{...s});case"default_3x3_color_grouping":return e.jsx(DS,{...s});case"soundmachine":return e.jsx(qS,{...s});case"bots":case"default_3x3":default:return e.jsx(PS,{...s})}},cw=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(0),[a,l]=i.useState("0"),{catalogOptions:c=null,setCatalogOptions:m=null}=Le(),{marketplaceConfiguration:h=null}=c,{showConfirm:u=null}=Fe(),g=j=>{l(j);const E=parseInt(j);isNaN(E)||E===n||r(parseInt(j))};if(U(dI,j=>{const E=j.getParser();m(C=>{const b={...C};return b.marketplaceConfiguration=E,b})}),ut(jo.POST_MARKETPLACE,j=>s(j.item)),i.useEffect(()=>{!t||h||D(new mI)},[t,h]),i.useEffect(()=>{if(t)return()=>r(0)},[t]),!h||!t)return null;const f=t?d(t.isWallItem?"wallItem.name."+t.type:"roomItem.name."+t.type):"",p=t?d(t.isWallItem?"wallItem.desc."+t.type:"roomItem.desc."+t.type):"",x=()=>Math.max(Math.ceil(h.commission*.01*n),1),I=()=>{!t||n<h.minimumPrice||u(d("inventory.marketplace.confirm_offer.info",["furniname","price"],[f,n.toString()]),()=>{D(new hI(n,t.isWallItem?2:1,t.id)),s(null)},()=>{s(null)},null,null,d("inventory.marketplace.confirm_offer.title"))};return e.jsxs(ae,{className:"nitro-catalog-layout-marketplace-post-offer",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.marketplace.make_offer.title"),onCloseClick:j=>s(null)}),e.jsx(se,{overflow:"hidden",children:e.jsxs(ne,{fullHeight:!0,children:[e.jsx(N,{center:!0,className:"bg-muted rounded p-2",size:4,overflow:"hidden",children:e.jsx(Jo,{productType:t.isWallItem?xe.WALL:xe.FLOOR,productClassId:t.type,extraData:t.extra.toString()})}),e.jsxs(N,{size:8,justifyContent:"between",overflow:"hidden",children:[e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{fontWeight:"bold",children:f}),e.jsx(v,{truncate:!0,shrink:!0,children:p})]}),e.jsxs(N,{overflow:"auto",children:[e.jsx(v,{italics:!0,children:d("inventory.marketplace.make_offer.expiration_info",["time"],[h.offerTime.toString()])}),e.jsxs("div",{className:"input-group has-validation",children:[e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:a,onChange:j=>g(j.target.value),placeholder:d("inventory.marketplace.make_offer.price_request")}),(n<h.minimumPrice||isNaN(n))&&e.jsx(A,{className:"invalid-feedback d-block",children:d("inventory.marketplace.make_offer.min_price",["minprice"],[h.minimumPrice.toString()])}),n>h.maximumPrice&&!isNaN(n)&&e.jsx(A,{className:"invalid-feedback d-block",children:d("inventory.marketplace.make_offer.max_price",["maxprice"],[h.maximumPrice.toString()])}),!(n<h.minimumPrice||n>h.maximumPrice||isNaN(n))&&e.jsx(A,{className:"invalid-feedback d-block",children:d("inventory.marketplace.make_offer.final_price",["commission","finalprice"],[x().toString(),(n+x()).toString()])})]}),e.jsx(L,{disabled:n<h.minimumPrice||n>h.maximumPrice||isNaN(n),onClick:I,children:d("inventory.marketplace.make_offer.post")})]})]})]})})]})},uw=o=>{const{isVisible:t=!1,setIsVisible:s=null,rootNode:n=null,currentPage:r=null,navigationHidden:a=!1,setNavigationHidden:l=null,activeNodes:c=[],searchResult:m=null,setSearchResult:h=null,openPageByName:u=null,openPageByOfferId:g=null,activateNode:f=null,getNodeById:p}=Le();return i.useEffect(()=>{const x={linkReceived:I=>{const j=I.split("/");if(!(j.length<2))switch(j[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(E=>!E);return;case"open":if(j.length>2)if(j.length===4)switch(j[2]){case"offerId":g(parseInt(j[3]));return}else u(j[2]);else s(!0);return}},eventUrlPrefix:"catalog/"};return ft(x),()=>pt(x)},[s,g,u]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ae,{uniqueKey:"catalog",className:"nitro-catalog",style:K("catalog.headers")?{width:710}:{},children:[e.jsx(re,{headerText:d("catalog.title"),onCloseClick:x=>s(!1)}),e.jsx(yn,{children:n&&n.children.length>0&&n.children.map((x,I)=>{if(!x.isVisible)return null;const j=`${x.pageId}-${I}`;return e.jsx(sn,{isActive:x.isActive,onClick:E=>{m&&h(null),f(x)},children:e.jsxs(w,{gap:K("catalog.tab.icons")?1:0,alignItems:"center",children:[K("catalog.tab.icons")&&e.jsx(kh,{icon:x.iconId}),x.localization]})},j)})}),e.jsx(se,{children:e.jsxs(ne,{children:[!a&&e.jsx(N,{size:3,overflow:"hidden",children:c&&c.length>0&&e.jsx(yS,{node:c[0]})}),e.jsx(N,{size:a?12:9,overflow:"hidden",children:lw(r,()=>l(!0))})]})})]}),e.jsx(wS,{}),e.jsx(cw,{})]})},dw=o=>{const{chatHistory:t=[],clearChatHistory:s}=gi(),[n,r]=i.useState(!1),{onClickChat:a=null}=Rh(),[l,c]=i.useState(""),m=i.useRef(null),h=i.useMemo(()=>{if(l.length===0)return t;let g=l.toLowerCase();return t.filter(f=>f.message&&f.message.toLowerCase().includes(g)||f.name&&f.name.toLowerCase().includes(g))},[t,l]),u=()=>{s&&s()};return i.useEffect(()=>{m&&m.current&&n&&(m.current.scrollTop=m.current.scrollHeight)},[n]),i.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":r(!0);return;case"hide":r(!1);return;case"toggle":r(x=>!x);return}},eventUrlPrefix:"chat-history/"};return ft(g),()=>pt(g)},[]),e.jsx(or,{children:n&&e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:e.jsxs(w,{gap:2,className:"nitro-chat-history",children:[e.jsx(N,{className:"chat-history-content h-100",children:e.jsxs(N,{className:"h-100",children:[e.jsx(w,{justifyContent:"end",className:"p-2",children:e.jsx(L,{variant:"danger",onClick:u,children:d("chat.history.clear")})}),e.jsx(rl,{rows:h,scrollToBottom:!0,rowRender:g=>e.jsxs(w,{alignItems:"center",className:"p-1",gap:2,children:[e.jsx(v,{variant:"muted",children:g.timestamp}),g.type===tn.TYPE_CHAT&&e.jsxs("div",{className:"bubble-container",style:{position:"relative"},children:[g.style===0&&e.jsx("div",{className:"user-container-bg",style:{backgroundColor:g.color}}),e.jsxs("div",{className:`chat-bubble bubble-${g.style} type-${g.chatType}`,style:{maxWidth:"100%"},children:[e.jsx("div",{className:"user-container",children:g.imageUrl&&g.imageUrl.length>0&&e.jsx("div",{className:"user-image",style:{backgroundImage:`url(${g.imageUrl})`}})}),e.jsxs("div",{className:"chat-content",children:[e.jsx("b",{className:"username mr-1",dangerouslySetInnerHTML:{__html:`${g.name}: `}}),e.jsx("span",{className:"message",style:{color:g.chatColours},dangerouslySetInnerHTML:{__html:`${g.message}`},onClick:f=>a(f)})]})]})]}),g.type===tn.TYPE_ROOM_INFO&&e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"icon icon-small-room"}),e.jsx(v,{textBreak:!0,wrap:!0,grow:!0,variant:"white",children:g.name})]})]})})]})}),e.jsx(w,{className:"chat-toggle",onClick:g=>r(!1)})]})})})},Bh=i.createContext({originalFloorplanSettings:null,setOriginalFloorplanSettings:null,visualizationSettings:null,setVisualizationSettings:null}),mw=o=>e.jsx(Bh.Provider,{...o}),zc=()=>i.useContext(Bh),bs=32,Pn=95,Jn="x0123456789abcdefghijklmnopq",Er=class Er{};Er.DOOR=0,Er.UP=1,Er.DOWN=2,Er.SET=3,Er.UNSET=4;let ct=Er;const hw={x:"101010",0:"0065ff",1:"0091ff",2:"00bcff",3:"00e8ff",4:"00ffea",5:"00ffbf",6:"00ff93",7:"00ff68",8:"00ff3d",9:"19ff00",a:"44ff00",b:"70ff00",c:"9bff00",d:"f2ff00",e:"ffe000",f:"ffb500",g:"ff8900",h:"ff5e00",i:"ff3200",j:"ff0700",k:"ff0023",l:"ff007a",m:"ff00a5",n:"ff00d1",o:"ff00fc",p:"d600ff",q:"aa00ff"};class gw{constructor(){this._currentAction=ct.SET,this._currentHeight=Jn[1]}get currentAction(){return this._currentAction}set currentAction(t){this._currentAction=t}get currentHeight(){return this._currentHeight}set currentHeight(t){this._currentHeight=t}clear(){this._currentAction=ct.SET,this._currentHeight=Jn[1]}}const fw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAC+CAMAAADnThrbAAAAYFBMVEUAAAAiIiIAZf8A6P8A/5MZ/wCb/wD/tQD/MgD/AHr/APxDXocAkf8A/+oA/2hE/wDy/wD/iQD/BwD/AKXWAP////8AvP8A/78A/z1w/wD/4AD/XgD/ACP/ANGqAP8QEBBSz3qJAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAABJxJREFUeNrt1tuOszoMBeDpD7QFBloKDGf6/m+51UTj1PUhN1uWOup3vSQLkSzn6+vV4fAV9X9lLIcdDv/+xWKHw/d3PPPzE8k8Rj1osceoBz3z4yiZ31HauN9R2rjfUcq451HSuOdR0rjnUcK411HcuNdR3LjXUcw4btTrOG7U6zhu1Ms4adTzOGnU8zhpVBh30Eb5cQ/fKp/5UR1+51l9mfU/Mz6NxvfMuEGMu9G49f/y8vzLz4Ikif/8qopnhiF6FhNHP9aVo2cGR71lCZAvbAXkzADE/kgQvooqhM8MCNuMCUFLtiJoZiBI5ycsvD4qFs4MLLTNElFYjJUoZAYRPAsSlV/5lcpnBhU8C6y+zPqfGZ9G43tm3CDG3Wjc+p9N/Z7PgjSN//y6jmfGMXoWU0c/1rWjZ0ZHvWUpkC9sDeTMCMT+SBG+imqEz4wI24wpQUu2JmhmJEjnpyy8PmoWzowstM1SUViMtShkRhE8C1KVX/m1ymdGFTwLrL7M+p8Zn0bje2bcIMbdaNz6n039ns+CLIv//Mslnpmm6FnMHP1YXxw9MznqLcuAfGEvQM5MQOyPDOGr6ILwmQlhmzEjaMleCJqZCNL5GQuvjwsLZyYW2maZKCzGiyhkJhE8CzKVX/kXlc9MKngWWH2Z9T8zPo3G98y4QYy70bj1P5v6PZ8Fx2P851+v8cw8R8/i0dGP9dXRM7Oj3rIjkC/sFciZGYj9cUT4KroifGZG2GY8ErRkrwTNzATp/CMLr48rC2dmFtpmR1FYjFdRyMwieBYcVX7lX1U+M6vgWWD1Zdb/zPg0Gt8z4wYx7kbj1v9s6vd8FpxO8Z/fNPHMskTP4snRj3Xj6JnFUW/ZCcgXtgFyZgFif5wQvooahM8sCNuMJ4KWbEPQzEKQzj+x8PpoWDizsNA2O4nCYmxEIbOI4FlwUvmV36h8ZlHBs8Dqy6z/mfFpNL5nxg1i3I3Grf/Z1O/5LDif4z//dotn1jV6Fs+Ofqxvjp5ZHfWWnYF8YW9AzqxA7I8zwlfRDeEzK8I245mgJXsjaGYlSOefWXh93Fg4s7LQNjuLwmK8iUJmFcGz4KzyK/+m8plVBc8Cqy+z/mfGp9H4nhk3iHE3Grf+Z1O/57Mgz+M/v23jmW2LnsXc0Y916+iZzVFvWQ7kC9sCObMBsT9yhK+iFuEzG8I2Y07Qkm0JmtkI0vk5C6+PloUzGwtts1wUFmMrCplNBM+CXOVXfqvymU0FzwKrL7P+Z8an0fieGTeIcTcat/5nU7/ns6Ao4j+/6+KZfY+excLRj3Xn6JndUW9ZAeQL2wE5swOxPwqEr6IO4TM7wjZjQdCS7Qia2QnS+QULr4+OhTM7C22zQhQWYycKmV0Ez4JC5Vd+p/KZXQXPAqsvs/5nxqfR+J4ZN4hxNxq3/mdTv+ezoCzjP7/v45n7PXoWS0c/1r2jZ+6OestKIF/YHsiZOxD7o0T4KuoRPnNH2GYsCVqyPUEzd4J0fsnC66Nn4cydhbZZKQqLsReFzF0Ez4JS5Vd+r/KZuwqeBVZfZv3PjE+j8T0zbhDjbjRu/b+0PP8DZwi9QurvbfwAAAAASUVORK5CYII=",pw={frames:{0:{frame:{x:1,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},1:{frame:{x:37,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},2:{frame:{x:73,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},3:{frame:{x:1,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},4:{frame:{x:37,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},5:{frame:{x:73,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},6:{frame:{x:1,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},7:{frame:{x:37,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},8:{frame:{x:73,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},9:{frame:{x:1,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},a:{frame:{x:37,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},b:{frame:{x:73,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},c:{frame:{x:1,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},d:{frame:{x:37,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},e:{frame:{x:73,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},f:{frame:{x:1,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},g:{frame:{x:37,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},h:{frame:{x:73,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},i:{frame:{x:1,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},j:{frame:{x:37,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},k:{frame:{x:73,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},l:{frame:{x:1,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},m:{frame:{x:37,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},n:{frame:{x:73,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},o:{frame:{x:1,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},p:{frame:{x:37,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},q:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r_blocked:{frame:{x:1,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r_door:{frame:{x:37,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},s:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},t:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},x:{frame:{x:73,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}}}};class Gi{constructor(t,s){this._height=t,this._isBlocked=s,this._selected=!1}get height(){return this._height}set height(t){this._height=t}get isBlocked(){return this._isBlocked}set isBlocked(t){this._isBlocked=t}get selected(){return this._selected}set selected(t){this._selected=t}}const dd=(o,t)=>{let s=o*bs/2-t*bs/2;const n=o*bs/4+t*bs/4;return s=s+1600,[s,n]},md=(o,t)=>{const s=o-1600,n=(s/(bs/2)+t/(bs/4))/2,r=(t/(bs/4)-s/(bs/2))/2;return[n,r]},bo=o=>{switch(o=parseInt(o.toString()),o){case 0:return-2;case 1:return-1;case 3:return 1;default:return 0}},Bi=o=>{switch(o){case .25:return 0;case .5:return 1;case 2:return 3;default:return 2}},Xs=class Xs{constructor(){this._squareSelectMode=!1,this._selectionStart=null,this._selectionEnd=null,this._zoomLevel=1;const t=bs*Pn+20,s=bs*Pn/2+100,n=document.createElement("canvas");n.height=s,n.width=t,n.style.touchAction="none",n.oncontextmenu=r=>{r.preventDefault()},this._renderer=n.getContext("2d"),this._image=new Image,this._image.src=fw,this._tilemap=[],this._doorLocation=new Vs(0,0),this._width=0,this._height=0,this._isPointerDown=!1,this._lastUsedTile=new Vs(-1,-1),this._actionSettings=new gw}setSquareSelectMode(t){this._squareSelectMode=t,t||(this._selectionStart=null,this._selectionEnd=null)}get squareSelectMode(){return this._squareSelectMode}onPointerRelease(){this._isPointerDown=!1,this._squareSelectMode&&this._selectionStart&&this.finalizeSquareSelection()}onPointerDown(t){if(this._squareSelectMode){t.preventDefault();const n=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel),[r,a]=md(n.x,n.y),l=Math.floor(r),c=Math.floor(a);this._selectionStart=new Vs(l,c),this._selectionEnd=new Vs(l,c),this._isPointerDown=!0;return}if(t.button===2)return;const s=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel);this._isPointerDown=!0,this.tileHitDetection(s,!0)}onPointerMove(t){if(!this._isPointerDown)return;const s=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel);if(this._squareSelectMode&&this._selectionStart){const[n,r]=md(s.x,s.y);this._selectionEnd.x=Math.floor(n),this._selectionEnd.y=Math.floor(r),this.renderTiles();return}this.tileHitDetection(s,!1)}tileHitDetection(t,s=!1){const n=Math.floor(t.x),r=Math.floor(t.y),a=bs,l=bs/2;for(let c=0;c<this._tilemap.length;c++)for(let m=0;m<this.tilemap[c].length;m++){const[h,u]=dd(m,c),g=h+a/2,f=u+l/2,p=Math.abs(n-g),x=Math.abs(r-f);if(p/(a*.5)+x/(l*.5)<=1)return this._isPointerDown&&(s?this.onClick(m,c):(this._lastUsedTile.x!==m||this._lastUsedTile.y!==c)&&(this._lastUsedTile.x=m,this._lastUsedTile.y=c,this.onClick(m,c))),!0}return!1}onClick(t,s,n=!0,r=!1){const a=this._tilemap[s][t];let l=a.height==="x"&&r?0:Jn.indexOf(a.height),c=0;switch(this._actionSettings.currentAction){case ct.DOOR:!r&&a.height!=="x"&&(this._doorLocation.x=t,this._doorLocation.y=s,n&&this.renderTiles());return;case ct.UP:if(!r&&a.height==="x")return;c=l+1;break;case ct.DOWN:if(!r&&(a.height==="x"||l<=1))return;c=l-1;break;case ct.SET:c=Jn.indexOf(this._actionSettings.currentHeight);break;case ct.UNSET:c=0;break}if(c===-1||l===c)return;!r&&c>0&&(t+1>this._width&&(this._width=t+1),s+1>this._height&&(this._height=s+1));const m=Jn[c];m&&(this._tilemap[s][t].height=m,n&&this.renderTiles())}renderTiles(){this.clearCanvas(),this._renderer.save(),this._renderer.scale(this._zoomLevel,this._zoomLevel);for(let t=0;t<this._tilemap.length;t++)for(let s=0;s<this.tilemap[t].length;s++){const n=this.tilemap[t][s];let r=n.height;this._doorLocation.x===s&&this._doorLocation.y===t&&(r=Xs.TILE_DOOR),n.isBlocked&&(r=Xs.TILE_BLOCKED),(n.height==="x"||n.height==="X")&&n.isBlocked&&(r="x");const[a,l]=dd(s,t),c=pw.frames[r];if(c===void 0){console.warn(`Asset "${r}" not found in spritesheet.`);continue}if(this.renderer.drawImage(this._image,c.frame.x,c.frame.y,c.frame.w,c.frame.h,a,l,c.frame.w,c.frame.h),this._squareSelectMode&&this._isPointerDown&&this._selectionStart&&this._selectionEnd){const m=Math.min(this._selectionStart.x,this._selectionEnd.x),h=Math.max(this._selectionStart.x,this._selectionEnd.x),u=Math.min(this._selectionStart.y,this._selectionEnd.y),g=Math.max(this._selectionStart.y,this._selectionEnd.y);if(s>=m&&s<=h&&t>=u&&t<=g){this.renderer.fillStyle="rgba(0, 255, 0, 0.3)",this.renderer.fillRect(a,l,c.frame.w,c.frame.h);continue}}n.selected&&(this.renderer.fillStyle=n.isBlocked?"rgb(128, 0, 128)":"rgba(0, 0, 255, 0.3)",this.renderer.fillRect(a,l,c.frame.w,c.frame.h))}this._renderer.restore()}toggleSelectAll(){for(let t=0;t<this._tilemap.length;t++)for(let s=0;s<this._tilemap[t].length;s++)if(this._tilemap[t][s].selected=!0,this._actionSettings.currentAction!==ct.DOOR){const n=this._tilemap[t][s];let r=n.height==="x"?0:Jn.indexOf(n.height),a=0;switch(this._actionSettings.currentAction){case ct.UP:if(n.height==="x")continue;a=r+1;break;case ct.DOWN:if(n.height==="x"||r<=1)continue;a=r-1;break;case ct.SET:a=Jn.indexOf(this._actionSettings.currentHeight);break;case ct.UNSET:a=0;break;default:continue}if(a!==-1&&r!==a){const l=Jn[a];l&&(this._tilemap[t][s].height=l,s+1>this._width&&(this._width=s+1),t+1>this._height&&(this._height=t+1))}}this.recalcActiveArea(),this.renderTiles()}finalizeSquareSelection(){const t=Math.floor(this._selectionStart.x),s=Math.floor(this._selectionStart.y),n=Math.floor(this._selectionEnd.x),r=Math.floor(this._selectionEnd.y),a=Math.min(t,n),l=Math.max(t,n),c=Math.min(s,r),m=Math.max(s,r);this.selectSquareField(a,c,l,m),this._selectionStart=null,this._selectionEnd=null,this.renderTiles()}selectSquareField(t,s,n,r){for(let a=s;a<=r;a++)for(let l=t;l<=n;l++)this._tilemap[a]&&this._tilemap[a][l]&&(this._tilemap[a][l].selected=!0,this.onClick(l,a,!1,!0));this.recalcActiveArea(),this.renderTiles()}recalcActiveArea(){this._width=0,this._height=0;for(let t=0;t<this._tilemap.length;t++)for(let s=0;s<this._tilemap[t].length;s++)this._tilemap[t][s].height!=="x"&&(s+1>this._width&&(this._width=s+1),t+1>this._height&&(this._height=t+1))}setTilemap(t,s){this._tilemap=[];const n=t.split("\r");let r=0,a=n.length;for(let l=0;l<a;l++){const c=n[l];if(c.length===0){n.splice(l,1),a=n.length,l--;continue}c.length>r&&(r=c.length)}for(let l=0;l<a;l++){this._tilemap[l]=[];const c=n[l];for(let m=0;m<r;m++){const h=s[l]&&s[l][m]||!1,u=c[m];u!=="x"&&u!=="X"&&u?this._tilemap[l][m]=new Gi(u,h):this._tilemap[l][m]=new Gi("x",h)}for(let m=r;m<Pn;m++)this.tilemap[l][m]=new Gi("x",!1)}for(let l=a;l<Pn;l++){this.tilemap[l]||(this.tilemap[l]=[]);for(let c=0;c<Pn;c++)this.tilemap[l][c]=new Gi("x",!1)}this._width=r,this._height=a}getCurrentTilemapString(){if(this._tilemap[this._height-1][this._width-1].height==="x"){this._width=-1,this._height=-1;for(let n=Pn-1;n>=0;n--)if(this._tilemap[n])for(let r=Pn-1;r>=0;r--){if(!this._tilemap[n][r])continue;this._tilemap[n][r].height!=="x"&&(r+1>this._width&&(this._width=r+1),n+1>this._height&&(this._height=n+1))}}const s=[];for(let n=0;n<this._height;n++){const r=[];for(let a=0;a<this._width;a++){const l=this._tilemap[n][a];r[a]=l.height}s[n]=r.join("")}return s.join("\r")}clear(){this._tilemap=[],this._doorLocation.set(-1,-1),this._width=0,this._height=0,this._isPointerDown=!1,this._lastUsedTile.set(-1,-1),this._actionSettings.clear(),this.clearCanvas()}clearCanvas(){this.renderer.fillStyle="#000000",this.renderer.fillRect(0,0,this._renderer.canvas.width,this._renderer.canvas.height)}zoomIn(){this._zoomLevel=Math.min(this._zoomLevel+.1,2),this.adjustCanvasSize(),this.renderTiles()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel-.1,.5),this.adjustCanvasSize(),this.renderTiles()}adjustCanvasSize(){const t=bs*Pn+20,s=bs*Pn/2+100;this._renderer.canvas.width=t*this._zoomLevel,this._renderer.canvas.height=s*this._zoomLevel}get zoomLevel(){return this._zoomLevel}get renderer(){return this._renderer}get tilemap(){return this._tilemap}get doorLocation(){return this._doorLocation}set doorLocation(t){this._doorLocation=t}get actionSettings(){return this._actionSettings}static get instance(){return Xs._INSTANCE||(Xs._INSTANCE=new Xs),Xs._INSTANCE}};Xs._INSTANCE=null,Xs.TILE_BLOCKED="r_blocked",Xs.TILE_DOOR="r_door";let $e=Xs;const xw=o=>{const{gap:t=1,children:s=null,...n}=o,[r,a]=i.useState(!1),[l,c]=i.useState(!1),{originalFloorplanSettings:m=null,setOriginalFloorplanSettings:h=null,setVisualizationSettings:u=null}=zc(),g=i.useRef(null);U(gI,C=>{const b=C.getParser();h(S=>{const _={...S};return _.reservedTiles=b.blockedTilesMap,$e.instance.setTilemap(_.tilemap,_.reservedTiles),_}),a(!0),g.current.scrollTo($e.instance.renderer.canvas.width/3,0)}),U(fI,C=>{const b=C.getParser();h(S=>{const _={...S};return _.entryPoint=[b.x,b.y],_.entryPointDir=b.direction,_}),u(S=>{const _={...S};return _.entryPointDir=b.direction,_}),$e.instance.doorLocation=new Vs(b.x,b.y),c(!0)});const f=C=>{const b=g.current;if(b)switch(C){case"up":b.scrollBy({top:-10});break;case"down":b.scrollBy({top:10});break;case"left":b.scrollBy({left:-10});break;case"right":b.scrollBy({left:10});break}},p=C=>{switch(C.preventDefault(),C.type){case"pointerout":case"pointerup":$e.instance.onPointerRelease();break;case"pointerdown":$e.instance.onPointerDown(C);break;case"pointermove":$e.instance.onPointerMove(C);break}},x=()=>{$e.instance.zoomIn()},I=()=>{$e.instance.zoomOut()},j=()=>{$e.instance._zoomLevel=1,$e.instance.adjustCanvasSize(),$e.instance.renderTiles()};i.useEffect(()=>()=>{$e.instance.clear(),u(C=>({wallHeight:m.wallHeight,thicknessWall:m.thicknessWall,thicknessFloor:m.thicknessFloor,entryPointDir:C.entryPointDir}))},[m.thicknessFloor,m.thicknessWall,m.wallHeight,u]),i.useEffect(()=>{!l||!r||$e.instance.renderTiles()},[l,r]),i.useEffect(()=>{D(new pI),D(new xI);const C=g.current;if(C)return C.appendChild($e.instance.renderer.canvas),C.addEventListener("pointerup",p),C.addEventListener("pointerout",p),C.addEventListener("pointerdown",p),C.addEventListener("pointermove",p),()=>{C&&(C.removeEventListener("pointerup",p),C.removeEventListener("pointerout",p),C.removeEventListener("pointerdown",p),C.removeEventListener("pointermove",p))}},[]);const E=()=>window.innerWidth<768;return e.jsxs(N,{gap:t,...n,children:[e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsx(N,{center:!0,size:1,className:"d-md-none",children:e.jsx(L,{className:"d-md-none",onClick:C=>f("left"),children:e.jsx(cm,{className:"fa-icon"})})}),e.jsxs(N,{overflow:"hidden",size:E()?10:12,gap:1,children:[e.jsxs(w,{justifyContent:"left",gap:1,children:[e.jsx(L,{shrink:!0,onClick:x,children:e.jsx(om,{className:"fa-icon"})}),e.jsx(L,{shrink:!0,onClick:j,children:e.jsx(ug,{className:"fa-icon"})}),e.jsx(L,{shrink:!0,onClick:I,children:e.jsx(im,{className:"fa-icon"})}),e.jsx(L,{shrink:!0,onClick:C=>f("up"),className:"d-md-none",children:e.jsx(dg,{className:"fa-icon"})})]}),e.jsx(A,{overflow:"auto",innerRef:g}),e.jsx(w,{justifyContent:"center",className:"d-md-none",children:e.jsx(L,{shrink:!0,onClick:C=>f("down"),children:e.jsx(mg,{className:"fa-icon"})})})]}),e.jsx(N,{center:!0,size:1,className:"d-md-none",children:e.jsx(L,{className:"d-md-none",onClick:C=>f("right"),children:e.jsx(um,{className:"fa-icon"})})})]}),s]})},hd=o=>o.replace(/\r\n|\r|\n/g,`
|
||
`).toLowerCase(),jw=o=>{const{onCloseClick:t=null}=o,[s,n]=i.useState(""),{originalFloorplanSettings:r=null}=zc(),a=()=>{D(new Lm(s.split(`
|
||
`).join("\r"),r.entryPoint[0],r.entryPoint[1],r.entryPointDir,bo(r.thicknessWall),bo(r.thicknessFloor),r.wallHeight-1))};return Hc(()=>{n(hd(r.tilemap))}),e.jsxs(ae,{theme:"primary-slim",className:"floorplan-import-export",children:[e.jsx(re,{headerText:d("floor.plan.editor.import.export"),onCloseClick:t}),e.jsxs(se,{children:[e.jsx("textarea",{className:"h-100",value:s,onChange:l=>n(l.target.value)}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(L,{onClick:l=>n(hd(r.tilemap)),children:d("floor.plan.editor.revert.to.last.received.map")}),e.jsx(L,{onClick:a,children:d("floor.plan.editor.save")})]})]})]})},gd=0,Hi=16,Iw=0,bw=26,Ew=o=>{const{visualizationSettings:t=null,setVisualizationSettings:s=null}=zc(),[n,r]=i.useState(ct.SET),[a,l]=i.useState(0),[c,m]=i.useState($e.instance.squareSelectMode);i.useEffect(()=>{m($e.instance.squareSelectMode)},[]);const h=C=>{r(C),$e.instance.actionSettings.currentAction=C},u=()=>{const C=!$e.instance.squareSelectMode;$e.instance.setSquareSelectMode(C),m(C)},g=()=>{s(C=>{const b={...C};return b.entryPointDir<7?++b.entryPointDir:b.entryPointDir=0,b})},f=C=>{(isNaN(C)||C<=0)&&(C=0),C>26&&(C=26),l(C),$e.instance.actionSettings.currentHeight=C.toString(36)},p=C=>{s(b=>{const S={...b};return S.thicknessFloor=C,S})},x=C=>{s(b=>{const S={...b};return S.thicknessWall=C,S})},I=C=>{(isNaN(C)||C<=0)&&(C=gd),C>Hi&&(C=Hi),s(b=>{const S={...b};return S.wallHeight=C,S})},j=()=>{let C=t.wallHeight+1;C>Hi&&(C=Hi),I(C)},E=()=>{let C=t.wallHeight-1;C<=0&&(C=gd),I(C)};return e.jsxs(N,{children:[e.jsxs(w,{gap:1,children:[e.jsxs(N,{size:5,gap:1,children:[e.jsx(v,{bold:!0,children:d("floor.plan.editor.draw.mode")}),e.jsxs(w,{gap:3,children:[e.jsxs(w,{gap:1,children:[e.jsx(_e,{itemActive:n===ct.SET,onClick:C=>h(ct.SET),children:e.jsx("i",{className:"icon icon-set-tile"})}),e.jsx(_e,{itemActive:n===ct.UNSET,onClick:C=>h(ct.UNSET),children:e.jsx("i",{className:"icon icon-unset-tile"})})]}),e.jsxs(w,{gap:1,children:[e.jsx(_e,{itemActive:n===ct.UP,onClick:C=>h(ct.UP),children:e.jsx("i",{className:"icon icon-increase-height"})}),e.jsx(_e,{itemActive:n===ct.DOWN,onClick:C=>h(ct.DOWN),children:e.jsx("i",{className:"icon icon-decrease-height"})}),e.jsx(_e,{itemActive:n===ct.DOOR,onClick:C=>h(ct.DOOR),children:e.jsx("i",{className:"icon icon-set-door"})}),e.jsx(_e,{onClick:C=>$e.instance.toggleSelectAll(),children:e.jsx("i",{className:`icon ${n===ct.UNSET?"icon-set-deselect":"icon-set-select"}`})}),e.jsx(_e,{itemActive:c,onClick:u,children:e.jsx("i",{className:`icon ${c?"icon-set-active-squaresselect":"icon-set-squaresselect"}`})})]})]})]}),e.jsxs(N,{alignItems:"center",size:4,children:[e.jsx(v,{bold:!0,children:d("floor.plan.editor.enter.direction")}),e.jsx("i",{className:`icon icon-door-direction-${t.entryPointDir} cursor-pointer`,onClick:g})]}),e.jsxs(N,{size:3,children:[e.jsx(v,{bold:!0,children:d("floor.editor.wall.height")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(xc,{className:"cursor-pointer fa-icon",onClick:E}),e.jsx("input",{type:"number",className:"form-control form-control-sm quantity-input",value:t.wallHeight,onChange:C=>I(C.target.valueAsNumber)}),e.jsx(jc,{className:"cursor-pointer fa-icon",onClick:j})]})]})]}),e.jsxs(w,{gap:1,children:[e.jsxs(N,{size:6,children:[e.jsxs(v,{bold:!0,children:[d("floor.plan.editor.tile.height"),": ",a]}),e.jsx(Mt,{min:Iw,max:bw,step:1,value:a,onChange:C=>f(C),renderThumb:({style:C,key:b,...S},_)=>e.jsx("div",{style:{backgroundColor:`#${hw[_.valueNow.toString(33)]}`,...C},...S,children:_.valueNow},b)})]}),e.jsxs(N,{size:6,children:[e.jsx(v,{bold:!0,children:d("floor.plan.editor.room.options")}),e.jsxs(w,{className:"align-items-center",children:[e.jsxs("select",{className:"form-control form-control-sm",value:t.thicknessWall,onChange:C=>x(parseInt(C.target.value)),children:[e.jsx("option",{value:0,children:d("navigator.roomsettings.wall_thickness.thinnest")}),e.jsx("option",{value:1,children:d("navigator.roomsettings.wall_thickness.thin")}),e.jsx("option",{value:2,children:d("navigator.roomsettings.wall_thickness.normal")}),e.jsx("option",{value:3,children:d("navigator.roomsettings.wall_thickness.thick")})]}),e.jsxs("select",{className:"form-control form-control-sm",value:t.thicknessFloor,onChange:C=>p(parseInt(C.target.value)),children:[e.jsx("option",{value:0,children:d("navigator.roomsettings.floor_thickness.thinnest")}),e.jsx("option",{value:1,children:d("navigator.roomsettings.floor_thickness.thin")}),e.jsx("option",{value:2,children:d("navigator.roomsettings.floor_thickness.normal")}),e.jsx("option",{value:3,children:d("navigator.roomsettings.floor_thickness.thick")})]})]})]})]})]})},Cw=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState({tilemap:"",reservedTiles:[],entryPoint:[0,0],entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),[c,m]=i.useState({entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),h=()=>{D(new Lm($e.instance.getCurrentTilemapString(),$e.instance.doorLocation.x,$e.instance.doorLocation.y,c.entryPointDir,bo(c.thicknessWall),bo(c.thicknessFloor),c.wallHeight-1))},u=()=>{m({wallHeight:a.wallHeight,thicknessWall:a.thicknessWall,thicknessFloor:a.thicknessFloor,entryPointDir:a.entryPointDir}),$e.instance.doorLocation=new Vs(a.entryPoint[0],a.entryPoint[1]),$e.instance.setTilemap(a.tilemap,a.reservedTiles),$e.instance.renderTiles()};return we(ys.DISPOSED,g=>s(!1)),U(jI,g=>{const f=g.getParser();l(p=>{const x={...p};return x.tilemap=f.model,x.wallHeight=f.wallHeight+1,x}),m(p=>{const x={...p};return x.wallHeight=f.wallHeight+1,x})}),U(II,g=>{const f=g.getParser();l(p=>{const x={...p};return x.thicknessFloor=Bi(f.thicknessFloor),x.thicknessWall=Bi(f.thicknessWall),x}),m(p=>{const x={...p};return x.thicknessFloor=Bi(f.thicknessFloor),x.thicknessWall=Bi(f.thicknessWall),x})}),i.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(x=>!x);return}},eventUrlPrefix:"floor-editor/"};return ft(g),()=>pt(g)},[]),e.jsxs(mw,{value:{originalFloorplanSettings:a,setOriginalFloorplanSettings:l,visualizationSettings:c,setVisualizationSettings:m},children:[t&&e.jsxs(ae,{uniqueKey:"floorpan-editor",className:"nitro-floorplan-editor",theme:"primary-slim",children:[e.jsx(re,{headerText:d("floor.plan.editor.title"),onCloseClick:()=>s(!1)}),e.jsxs(se,{overflow:"hidden",children:[e.jsx(Ew,{}),e.jsx(xw,{overflow:"hidden"}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(L,{onClick:u,children:d("floor.plan.editor.reload")}),e.jsxs(En,{children:[e.jsx(L,{disabled:!0,children:d("floor.plan.editor.preview")}),e.jsx(L,{onClick:g=>r(!0),children:d("floor.plan.editor.import.export")}),e.jsx(L,{onClick:h,children:d("floor.plan.editor.save")})]})]})]})]}),n&&e.jsx(jw,{onCloseClick:()=>r(!1)})]})},vw=o=>{const{friend:t=null}=o,[s,n]=i.useState(!1),{followFriend:r=null}=fs(),a=i.useRef();return i.useEffect(()=>{const l=c=>{const m=a.current;m&&c.target!==m&&!m.contains(c.target)&&n(!1)};return document.addEventListener(ve.MOUSE_CLICK,l),()=>document.removeEventListener(ve.MOUSE_CLICK,l)},[]),t?e.jsxs("div",{ref:a,className:"btn btn-friendsgensuccess friend-bar-item "+(s?"friend-bar-item-active":""),onClick:l=>n(c=>!c),children:[e.jsxs("div",{className:`friend-bar-item-head position-absolute ${t.id>0?"avatar":"group"}`,children:[t.id>0&&e.jsx(it,{headOnly:!s,figure:t.figure,direction:s?2:3}),t.id<=0&&e.jsx(it,{headOnly:!s,figure:t.id<=0&&t.figure==="ADM"?"ha-3409-1413-70.lg-285-89.ch-3032-1334-109.sh-3016-110.hd-185-1359.ca-3225-110-62.wa-3264-62-62.fa-1206-90.hr-3322-1403":t.figure,isgroup:t.id<=0?1:0,direction:s?2:3})]}),e.jsx("div",{className:"text-truncate",children:t.name}),s&&e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-friendbar-chat cursor-pointer",onClick:l=>Qo(t.id)}),t.followingAllowed&&e.jsx(A,{className:"nitro-friends-spritesheet icon-friendbar-visit cursor-pointer",onClick:l=>r(t)}),e.jsx(A,{className:"nitro-friends-spritesheet icon-profile cursor-pointer",onClick:l=>ls(t.id)})]})]}):e.jsxs("div",{ref:a,className:"btn btn-friendsgen friend-bar-item friend-bar-search "+(s?"friend-bar-search-item-active":""),onClick:l=>n(c=>!c),children:[e.jsx("div",{className:"friend-bar-item-head position-absolute"}),e.jsx("div",{className:"friend-bar-text",children:d("friend.bar.find.title")}),s&&e.jsxs("div",{className:"search-content mt-3",children:[e.jsx("div",{className:"bg-white text-black px-1 py-1 font-size-friend",children:d("friend.bar.find.text")}),e.jsx(L,{className:"mt-2 mb-4",variant:"white",onClick:()=>D(new Mm),children:d("friend.bar.find.button")})]})]})},Tl=3,Nw=o=>{const{onlineFriends:t=null}=o,[s,n]=i.useState(0),r=i.useRef();return e.jsxs(w,{innerRef:r,alignItems:"center",className:"friend-bar",children:[e.jsx(L,{variant:"black",className:"friend-bar-button",disabled:s<=0,onClick:a=>n(s-1),children:e.jsx(Ss,{className:"fa-icon"})}),Array.from(Array(Tl),(a,l)=>e.jsx(vw,{friend:t[s+l]||null},l)),e.jsx(L,{variant:"black",className:"friend-bar-button",disabled:!(t.length>Tl&&s+Tl<=t.length-1),onClick:a=>n(s+1),children:e.jsx(ws,{className:"fa-icon"})})]})},_w=o=>{const{friend:t=null,selected:s=!1,selectFriend:n=null}=o,[r,a]=i.useState(!1),{followFriend:l=null,updateRelationship:c=null}=fs(),m=p=>{p.stopPropagation(),l(t)},h=p=>{p.stopPropagation(),Qo(t.id)},u=p=>{p.stopPropagation(),a(!0)},g=(p,x)=>{p.stopPropagation(),c(t,x),a(!1)},f=()=>{if(!t)return"none";switch(t.relationshipStatus){case hs.RELATIONSHIP_HEART:return"heart";case hs.RELATIONSHIP_SMILE:return"smile";case hs.RELATIONSHIP_BOBBA:return"bobba";default:return"none"}};return t?e.jsxs(io,{justifyContent:"between",className:`px-2 py-1 ${s&&"bg-primary text-white"}`,onClick:p=>n(t.id),children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{onClick:p=>p.stopPropagation(),children:e.jsx(vs,{userId:t.id})}),e.jsx("div",{children:t.name})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[!r&&e.jsxs(e.Fragment,{children:[t.followingAllowed&&e.jsx(A,{pointer:!0,onClick:m,className:"nitro-friends-spritesheet icon-follow",title:d("friendlist.tip.follow")}),t.online&&e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-chat",onClick:h,title:d("friendlist.tip.im")}),t.id>0&&e.jsx(A,{className:`nitro-friends-spritesheet icon-${f()} cursor-pointer`,onClick:u,title:d("infostand.link.relationship")})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-heart",onClick:p=>g(p,hs.RELATIONSHIP_HEART)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-smile",onClick:p=>g(p,hs.RELATIONSHIP_SMILE)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba",onClick:p=>g(p,hs.RELATIONSHIP_BOBBA)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-none",onClick:p=>g(p,hs.RELATIONSHIP_NONE)})]})]})]}):null},fd=o=>{const{list:t=null,selectedFriendsIds:s=null,selectFriend:n=null}=o;return!t||!t.length?null:e.jsx(e.Fragment,{children:t.map((r,a)=>e.jsx(_w,{friend:r,selected:s&&s.indexOf(r.id)>=0,selectFriend:n},a))})},Sw=o=>{const{request:t=null}=o,{requestResponse:s=null}=fs();return t?e.jsxs(io,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.id}),e.jsx("div",{children:t.name})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-accept cursor-pointer",onClick:n=>s(t.id,!0)}),e.jsx(A,{className:"nitro-friends-spritesheet icon-deny cursor-pointer",onClick:n=>s(t.id,!1)})]})]}):null},ww=o=>{const{children:t=null,...s}=o,{requests:n=[],requestResponse:r=null}=fs();return n.length?e.jsxs(oo,{...s,children:[e.jsxs(N,{fullHeight:!0,justifyContent:"between",gap:1,children:[e.jsx(N,{gap:0,children:n.map((a,l)=>e.jsx(Sw,{request:a},l))}),e.jsx(w,{justifyContent:"center",className:"px-2 py-1",children:e.jsx(L,{onClick:a=>r(-1,!1),children:d("friendlist.requests.dismissall")})})]}),t]}):null},Tw=o=>{const{selectedFriendsIds:t=null,removeFriendsText:s=null,removeSelectedFriends:n=null,onCloseClick:r=null}=o;return e.jsxs(ae,{className:"nitro-friends-remove-confirmation",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.removefriendconfirm.title"),onCloseClick:r}),e.jsxs(se,{className:"text-black",children:[e.jsx("div",{children:s}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"danger",disabled:t.length===0,onClick:n,children:d("generic.ok")}),e.jsx(L,{fullWidth:!0,onClick:r,children:d("generic.cancel")})]})]})]})},yw=o=>{const{selectedFriendsIds:t=null,onCloseClick:s=null,sendRoomInvite:n=null}=o,[r,a]=i.useState("");return e.jsxs(ae,{className:"nitro-friends-room-invite",uniqueKey:"nitro-friends-room-invite",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.invite.title"),onCloseClick:s}),e.jsxs(se,{className:"text-black",children:[d("friendlist.invite.summary",["count"],[t.length.toString()]),e.jsx("textarea",{className:"form-control",value:r,maxLength:255,onChange:l=>a(l.target.value)}),e.jsx(v,{center:!0,className:"bg-muted rounded p-1",children:d("friendlist.invite.note")}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"success",disabled:r.length===0||t.length===0,onClick:()=>n(r),children:d("friendlist.invite.send")}),e.jsx(L,{fullWidth:!0,onClick:s,children:d("generic.cancel")})]})]})]})},Rw=o=>{const{...t}=o,[s,n]=i.useState(""),[r,a]=i.useState(null),[l,c]=i.useState(null),{canRequestFriend:m=null,requestFriend:h=null}=fs();return U(bI,u=>{const g=u.getParser();a(g.friends),c(g.others)}),i.useEffect(()=>{if(!s||!s.length)return;const u=setTimeout(()=>{!s||!s.length||D(new EI(s))},500);return()=>clearTimeout(u)},[s]),e.jsxs(oo,{...t,children:[e.jsx("input",{type:"text",className:"search-input form-control form-control-sm w-100 rounded-0",placeholder:d("generic.search"),value:s,maxLength:50,onChange:u=>n(u.target.value)}),e.jsxs(N,{children:[r&&e.jsxs(e.Fragment,{children:[r.length===0&&e.jsx(v,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.nofriendsfound")}),r.length>0&&e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.friendscaption",["cnt"],[r.length.toString()])}),e.jsx("hr",{className:"mx-2 mt-0 mb-1 text-black"}),e.jsx(N,{gap:0,children:r.map(u=>e.jsxs(io,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:u.avatarId}),e.jsx("div",{children:u.avatarName})]}),e.jsx(w,{alignItems:"center",gap:1,children:u.isAvatarOnline&&e.jsx(A,{className:"nitro-friends-spritesheet icon-chat cursor-pointer",onClick:g=>Qo(u.avatarId),title:d("friendlist.tip.im")})})]},u.avatarId))})]})]}),l&&e.jsxs(e.Fragment,{children:[l.length===0&&e.jsx(v,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.noothersfound")}),l.length>0&&e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.otherscaption",["cnt"],[l.length.toString()])}),e.jsx("hr",{className:"mx-2 mt-0 mb-1 text-black"}),e.jsx(N,{gap:0,children:l.map(u=>e.jsxs(io,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:u.avatarId}),e.jsx("div",{children:u.avatarName})]}),e.jsx(w,{alignItems:"center",gap:1,children:m(u.avatarId)&&e.jsx(A,{className:"nitro-friends-spritesheet icon-add cursor-pointer",onClick:g=>h(u.avatarId,u.avatarName),title:d("friendlist.tip.addfriend")})})]},u.avatarId))})]})]})]})]})},Ow=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState([]),[c,m]=i.useState(!1),[h,u]=i.useState(!1),{onlineFriends:g=[],offlineFriends:f=[],requests:p=[],requestFriend:x=null}=fs(),I=i.useMemo(()=>{if(!a||!a.length)return"";const b=[];for(const S of a){let _=g.find(T=>T.id===S);_||(_=f.find(T=>T.id===S)),_&&b.push(_.name)}return d("friendlist.removefriendconfirm.userlist",["user_names"],[b.join(", ")])},[f,g,a]),j=i.useCallback(b=>{b<0||l(S=>{const _=[...S],T=_.indexOf(b);return T>-1?_.splice(T,1):_.push(b),_})},[l]),E=b=>{!a.length||!b||!b.length||b.length>255||(D(new CI(b,a)),m(!1))},C=()=>{a.length!==0&&(l(b=>(D(new vI(...b)),[])),u(!1))};return i.useEffect(()=>{const b={linkReceived:S=>{const _=S.split("/");if(!(_.length<2))switch(_[1]){case"show":r(!0),s(!1);return;case"hide":r(!1),s(!1);return;case"toggle":r(T=>!T),s(!0);return;case"request":if(_.length<4)return;x(parseInt(_[2]),_[3])}},eventUrlPrefix:"friends/"};return ft(b),()=>pt(b)},[x]),n?e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:"nitro-friends",uniqueKey:"nitro-friends",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.friends"),onCloseClick:b=>r(!1)}),e.jsxs(se,{overflow:"hidden",gap:1,className:"text-black p-0",children:[e.jsxs(xC,{fullHeight:!0,overflow:"hidden",children:[e.jsx(oo,{headerText:d("friendlist.friends")+` (${g.length})`,isExpanded:!0,children:e.jsx(fd,{list:g,selectedFriendsIds:a,selectFriend:j})}),e.jsx(oo,{headerText:d("friendlist.friends.offlinecaption")+` (${f.length})`,children:e.jsx(fd,{list:f,selectedFriendsIds:a,selectFriend:j})}),e.jsx(ww,{headerText:d("friendlist.tab.friendrequests")+` (${p.length})`,isExpanded:!0}),e.jsx(Rw,{headerText:d("people.search.title")})]}),a&&a.length>0&&e.jsxs(w,{gap:1,className:"p-1",children:[e.jsx(L,{fullWidth:!0,onClick:()=>m(!0),children:d("friendlist.tip.invite")}),e.jsx(L,{fullWidth:!0,variant:"danger",onClick:b=>u(!0),children:d("generic.delete")})]})]})]}),c&&e.jsx(yw,{selectedFriendsIds:a,onCloseClick:()=>m(!1),sendRoomInvite:E}),h&&e.jsx(Tw,{selectedFriendsIds:a,removeFriendsText:I,onCloseClick:()=>u(!1),removeSelectedFriends:C})]}):null},kw=o=>{const{thread:t=null,group:s=null}=o,n=i.useMemo(()=>s.type===wr.GROUP_CHAT&&ch(s.chats[0].extraData),[s]),r=i.useMemo(()=>!t||!s?!1:!!(s.type===wr.PRIVATE_CHAT&&s.userId===G().userId||n&&s.chats.length&&n.userId===G().userId),[t,s,n]);return!t||!s?null:s.userId?e.jsxs(w,{fullWidth:!0,justifyContent:r?"end":"start",gap:2,children:[e.jsxs(A,{shrink:!0,className:"message-avatar",children:[s.type===wr.PRIVATE_CHAT&&!r&&e.jsx(it,{figure:t.participant.figure,direction:2}),n&&!r&&e.jsx(it,{figure:n.figure,direction:2})]}),e.jsxs(A,{className:"bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-"+(r?"right":"left"),children:[e.jsxs(A,{className:"fw-bold",children:[e.jsx(A,{className:"small text-muted",children:s.chats[0].date.toLocaleTimeString()}),r&&G().userName,!r&&(n?n.username:t.participant.name)]}),s.chats.map((a,l)=>e.jsx(A,{className:"text-break",children:a.message},l))]}),r&&e.jsx(A,{shrink:!0,className:"message-avatar",children:e.jsx(it,{figure:G().figure,direction:4})})]}):e.jsx(e.Fragment,{children:s.chats.map((a,l)=>e.jsx(w,{fullWidth:!0,gap:2,justifyContent:"start",children:e.jsxs(A,{className:"w-100 text-break",children:[a.type===Hn.SECURITY_NOTIFICATION&&e.jsxs(w,{gap:2,alignItems:"center",className:"bg-light rounded mb-2 px-2 py-1 small text-muted",children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-warning flex-shrink-0"}),e.jsx(A,{children:a.message})]}),a.type===Hn.ROOM_INVITE&&e.jsxs(w,{gap:2,alignItems:"center",className:"bg-light rounded mb-2 px-2 py-1 small text-black",children:[e.jsx(A,{className:"messenger-notification-icon flex-shrink-0"}),e.jsxs(A,{children:[d("messenger.invitation")+" ",a.message]})]})]})},l))})},Aw=o=>{const{thread:t=null}=o;return t.setRead(),e.jsx(e.Fragment,{children:t.groups.length>0&&t.groups.map((s,n)=>e.jsx(kw,{thread:t,group:s},n))})},Dw=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(-1),[a,l]=i.useState(""),{visibleThreads:c=[],activeThread:m=null,getMessageThread:h=null,sendMessage:u=null,setActiveThreadId:g=null,closeThread:f=null}=vh(),{report:p=null}=Ws(),x=i.useRef(),I=()=>m&&m.participant&&D(new vc(m.participant.id)),j=()=>m&&m.participant&&ls(m.participant.id),E=()=>{!m||!a.length||(u(m,G().userId,a),l(""))},C=b=>{b.key==="Enter"&&E()};return i.useEffect(()=>{const b={linkReceived:S=>{const _=S.split("/");if(_.length===2){if(_[1]==="open"){s(!0);return}if(_[1]==="toggle"){s(P=>!P);return}const T=h(parseInt(_[1]));if(!T)return;g(T.threadId),s(!0)}},eventUrlPrefix:"friends-messenger/"};return ft(b),()=>pt(b)},[h,g]),i.useEffect(()=>{!t||!m||(x.current.scrollTop=x.current.scrollHeight)},[t,m]),i.useEffect(()=>{if(t&&!m){n>0?g(n):c.length>0&&g(c[0].threadId);return}!t&&m&&(r(m.threadId),g(-1))},[t,m,n,c,g]),t?e.jsxs(ae,{className:"nitro-friends-messenger",uniqueKey:"nitro-friends-messenger",theme:"primary-slim",children:[e.jsx(re,{headerText:d("messenger.window.title",["OPEN_CHAT_COUNT"],[c.length.toString()]),onCloseClick:b=>s(!1)}),e.jsx(se,{children:e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(N,{size:4,overflow:"hidden",children:[e.jsx(v,{bold:!0,children:d("toolbar.icon.label.messenger")}),e.jsx(N,{fit:!0,overflow:"auto",children:e.jsx(N,{children:c&&c.length>0&&c.map(b=>e.jsxs(_e,{itemActive:m===b,onClick:S=>g(b.threadId),children:[b.unread&&e.jsx(Cn,{className:"text-black",count:b.unreadCount}),e.jsxs(w,{fullWidth:!0,alignItems:"center",gap:1,children:[e.jsx(w,{alignItems:"center",className:"friend-head px-2",children:e.jsx(it,{figure:b.participant.id>0?b.participant.figure:b.participant.id<=0&&b.participant.figure==="ADM"?"ha-3409-1413-70.lg-285-89.ch-3032-1334-109.sh-3016-110.hd-185-1359.ca-3225-110-62.wa-3264-62-62.fa-1206-90.hr-3322-1403":b.participant.figure,headOnly:!0,direction:b.participant.id>0?2:3})}),e.jsx(v,{truncate:!0,grow:!0,children:b.participant.name})]})]},b.threadId))})})]}),e.jsx(N,{size:8,overflow:"hidden",children:m&&e.jsxs(e.Fragment,{children:[e.jsx(v,{bold:!0,center:!0,children:d("messenger.window.separator",["FRIEND_NAME"],[m.participant.name])}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[m&&m.participant.id>0&&e.jsxs(w,{gap:1,children:[e.jsxs(En,{children:[e.jsx(L,{onClick:I,children:e.jsx(A,{className:"nitro-friends-spritesheet icon-follow"})}),e.jsx(L,{onClick:j,children:e.jsx(A,{className:"nitro-friends-spritesheet icon-profile-sm"})})]}),e.jsx(L,{variant:"danger",onClick:()=>p(rt.IM,{reportedUserId:m.participant.id}),children:d("messenger.window.button.report")})]}),e.jsx(L,{onClick:b=>f(m.threadId),children:e.jsx(Hs,{className:"fa-icon"})})]}),e.jsx(N,{fit:!0,className:"bg-muted p-2 rounded chat-messages",children:e.jsx(N,{innerRef:x,overflow:"auto",children:e.jsx(Aw,{thread:m})})}),e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:255,placeholder:d("messenger.window.input.default",["FRIEND_NAME"],[m.participant.name]),value:a,onChange:b=>l(b.target.value),onKeyDown:C}),e.jsx(L,{variant:"success",onClick:E,children:d("widgets.chatinput.say")})]})]})})]})})]}):null},Pw=o=>{const{settings:t=null,onlineFriends:s=[]}=fs();return t?e.jsxs(e.Fragment,{children:[Ho.createPortal(e.jsx(Nw,{onlineFriends:s}),document.getElementById("toolbar-friend-bar-container")),e.jsx(Ow,{}),e.jsx(Dw,{})]}):null},Lw=()=>{const{games:o,selectedGame:t,setSelectedGame:s}=sl(),n=a=>{let l=["game-icon"];return t===a&&l.push("selected"),l.join(" ")},r=a=>`url(${a.assetUrl}${a.gameNameId}_icon.png)`;return e.jsxs(A,{fullWidth:!0,className:"gameList-container bg-dark p-1",children:[d("gamecenter.game_list_title"),e.jsx(w,{gap:3,children:o&&o.map((a,l)=>e.jsx(A,{className:n(a),onClick:c=>s(a),style:{backgroundImage:r(a)}},l))})]})},Mw=()=>{const{gameURL:o,setGameURL:t}=sl(),[s,n]=i.useState(0),r=i.useRef();return i.useEffect(()=>{if(!r||r&&!r.current)return;n(0);let a=document.createElement("iframe");a.src=o,a.classList.add("game-center-stage"),a.classList.add("h-100"),a.onload=()=>{n(l=>l+=1)},r.current.innerHTML="",r.current.appendChild(a)},[r,o]),i.useEffect(()=>{s>1&&(t(null),D(new NI))},[s,t]),o?e.jsx(A,{innerRef:r,className:"game-center-stage"}):null},Uw=()=>{const{selectedGame:o,accountStatus:t}=sl();i.useEffect(()=>{o&&(D(new _I(o.gameId)),D(new SI(o.gameId)))},[o]);const s=()=>gs.uintHexColor(o.bgColor),n=()=>`url(${o.assetUrl}${o.gameNameId}_theme.png)`,r=()=>gs.uintHexColor(o.textColor),a=()=>{D(new wI(o.gameId))};return e.jsxs(w,{className:"game-view py-4",fullHeight:!0,style:{backgroundColor:s(),backgroundImage:n(),color:r()},children:[e.jsxs(w,{className:"w-75",column:!0,alignItems:"center",gap:2,children:[e.jsx(v,{bold:!0,children:d(`gamecenter.${o.gameNameId}.description_title`)}),e.jsx("img",{src:o.assetUrl+o.gameNameId+"_logo.png"}),(t.hasUnlimitedGames||t.freeGamesLeft>0)&&e.jsx(e.Fragment,{children:e.jsxs(L,{variant:"light",position:"relative",className:"px-4",onClick:a,children:[d("gamecenter.play_now"),!t.hasUnlimitedGames&&e.jsx(Cn,{className:"me-n1 mt-n1 text-black",count:t.freeGamesLeft})]})}),e.jsx(v,{bold:!0,className:"w-50",center:!0,children:d(`gamecenter.${o.gameNameId}.description_content`)})]}),e.jsx(A,{className:"w-25"})]})},Fw=()=>{const{isVisible:o,setIsVisible:t,games:s,accountStatus:n}=sl();if(i.useEffect(()=>{const r=()=>{t(l=>!l)},a={linkReceived:l=>{switch(l.split("/")[1]){case"toggle":r();break}},eventUrlPrefix:"games/"};return ft(a),()=>pt(a)},[]),!(!o||!s||!n))return e.jsxs(w,{position:"absolute",className:"top-0 bottom-0 start-0 end-0 bg-black",justifyContent:"center",children:[e.jsxs(w,{className:"game-center-main",column:!0,children:[e.jsx(Uw,{}),e.jsx(Lw,{})]}),e.jsx(Mw,{})]})},Vw=[0,1,2,3,4,5,6,7,8],Gw=o=>{const{badgeParts:t=[],setBadgeParts:s=null}=o,[n,r]=i.useState(-1),{groupCustomize:a=null}=fi(),l=(c,m,h)=>{const u=[...t];u[c][m]=h,s(u),m==="key"&&r(-1)};return!t||!t.length?null:e.jsxs(e.Fragment,{children:[n<0&&t&&t.length>0&&t.map((c,m)=>e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,className:"bg-muted rounded px-2 py-1",children:[e.jsxs(w,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:h=>r(m),children:[t[m].code&&t[m].code.length>0&&e.jsx(Xe,{badgeCode:t[m].code,isGroup:!0}),(!t[m].code||!t[m].code.length)&&e.jsx(w,{center:!0,className:"badge-image group-badge",children:e.jsx(Wo,{className:"fa-icon"})})]}),c.type!==ss.BASE&&e.jsx(ne,{gap:1,columnCount:3,children:Vw.map((h,u)=>e.jsx(A,{pointer:!0,className:`group-badge-position-swatch ${t[m].position===h?"active":""}`,onClick:g=>l(m,"position",h)},u))}),e.jsx(ne,{gap:1,columnCount:8,children:a.badgePartColors.length>0&&a.badgePartColors.map((h,u)=>e.jsx(A,{pointer:!0,className:`group-badge-color-swatch ${t[m].color===u+1?"active":""}`,style:{backgroundColor:"#"+h.color},onClick:g=>l(m,"color",u+1)},u))})]},m)),n>=0&&e.jsxs(ne,{gap:1,columnCount:5,children:[t[n].type===ss.SYMBOL&&e.jsx(N,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:c=>l(n,"key",0),children:e.jsx(w,{center:!0,className:"badge-image group-badge",children:e.jsx(Hs,{className:"fa-icon"})})}),(t[n].type===ss.BASE?a.badgeBases:a.badgeSymbols).map((c,m)=>e.jsx(N,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:h=>l(n,"key",c.id),children:e.jsx(Xe,{badgeCode:ss.getCode(t[n].type,c.id,t[n].color,4),isGroup:!0})},m))]})]})},Hh=o=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null,skipDefault:r=null}=o,[a,l]=i.useState(null),{groupCustomize:c=null}=fi(),m=()=>{if(!a||!a.length)return"";let u="";return a.forEach(g=>g.code&&(u+=g.code)),u},h=i.useCallback(()=>{if(!t||!a||!a.length)return!1;if(t.groupBadgeParts===a)return!0;if(t.groupId<=0)return s(g=>{const f={...g};return f.groupBadgeParts=a,f}),!0;const u=[];return a.forEach(g=>{g.code&&(u.push(g.key),u.push(g.color),u.push(g.position))}),D(new TI(t.groupId,u)),!0},[t,a,s]);return i.useEffect(()=>{if(t.groupBadgeParts)return;const u=[new ss(ss.BASE,c.badgeBases[0].id,c.badgePartColors[0].id),new ss(ss.SYMBOL,0,c.badgePartColors[0].id),new ss(ss.SYMBOL,0,c.badgePartColors[0].id),new ss(ss.SYMBOL,0,c.badgePartColors[0].id),new ss(ss.SYMBOL,0,c.badgePartColors[0].id)];s(g=>({...g,groupBadgeParts:u}))},[t.groupBadgeParts,c,s]),i.useEffect(()=>{if(t.groupId<=0){l(t.groupBadgeParts?[...t.groupBadgeParts]:null);return}l(t.groupBadgeParts)},[t]),i.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsx(N,{size:2,children:e.jsx(w,{center:!0,className:"bg-muted rounded p-1",children:e.jsx(Xe,{badgeCode:m(),isGroup:!0})})}),e.jsx(N,{size:10,overflow:"auto",children:e.jsx(Gw,{badgeParts:a,setBadgeParts:l})})]})},Wh=o=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null}=o,[r,a]=i.useState(null),{groupCustomize:l=null}=fi(),c=u=>u===0?l.groupColorsA.find(g=>g.id===r[u]).color:l.groupColorsB.find(g=>g.id===r[u]).color,m=(u,g)=>{a(f=>{const p=[...f];return p[u]=g,p})},h=i.useCallback(()=>!t||!r||!r.length?!1:t.groupColors===r?!0:t.groupId<=0?(s(u=>{const g={...u};return g.groupColors=[...r],g}),!0):(D(new yI(t.groupId,r[0],r[1])),!0),[t,r,s]);return i.useEffect(()=>{if(!l.groupColorsA||!l.groupColorsB||t.groupColors)return;const u=[l.groupColorsA[0].id,l.groupColorsB[0].id];s(g=>({...g,groupColors:u}))},[l,t.groupColors,s]),i.useEffect(()=>{if(t.groupId<=0){a(t.groupColors?[...t.groupColors]:null);return}a(t.groupColors)},[t]),i.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),r?e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(N,{size:2,gap:1,children:[e.jsx(v,{bold:!0,children:d("group.edit.color.guild.color")}),t.groupColors&&t.groupColors.length>0&&e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+c(0)}}),e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+c(1)}})]})]}),e.jsxs(N,{size:5,gap:1,overflow:"hidden",children:[e.jsx(v,{bold:!0,children:d("group.edit.color.primary.color")}),e.jsx(Pe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:t.groupColors&&l.groupColorsA&&l.groupColorsA.map((u,g)=>e.jsx("div",{className:$t("group-badge-color-swatch cursor-pointer",t.groupColors[0]===u.id&&"active"),style:{backgroundColor:"#"+u.color},onClick:()=>m(0,u.id)},g))})]}),e.jsxs(N,{size:5,gap:1,overflow:"hidden",children:[e.jsx(v,{bold:!0,children:d("group.edit.color.secondary.color")}),e.jsx(Pe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:t.groupColors&&l.groupColorsB&&l.groupColorsB.map((u,g)=>e.jsx("div",{className:$t("group-badge-color-swatch cursor-pointer",t.groupColors[1]===u.id&&"active"),style:{backgroundColor:"#"+u.color},onClick:()=>m(1,u.id)},g))})]})]}):null},Bw=o=>{const{groupData:t=null,setGroupData:s=null,purchaseCost:n=0}=o,{groupCustomize:r=null}=fi(),a=()=>{if(!t||!t.groupBadgeParts||!t.groupBadgeParts.length)return"";let c="";return t.groupBadgeParts.forEach(m=>m.code&&(c+=m.code)),c},l=c=>c===0?r.groupColorsA.find(m=>m.id===t.groupColors[c]).color:r.groupColorsB.find(m=>m.id===t.groupColors[c]).color;return t?e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsxs(N,{size:3,children:[e.jsxs(N,{center:!0,className:"bg-muted rounded p-1",gap:2,children:[e.jsx(v,{bold:!0,center:!0,children:d("group.create.confirm.guildbadge")}),e.jsx(Xe,{badgeCode:a(),isGroup:!0})]}),e.jsxs(N,{center:!0,className:"bg-muted rounded p-1",gap:2,children:[e.jsx(v,{bold:!0,center:!0,children:d("group.edit.color.guild.color")}),e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+l(0)}}),e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+l(1)}})]})]})]}),e.jsxs(N,{size:9,justifyContent:"between",children:[e.jsxs(N,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:t.groupName}),e.jsx(v,{children:t.groupDescription})]}),e.jsx(v,{overflow:"auto",children:d("group.create.confirm.info")})]}),e.jsx(v,{center:!0,variant:"white",className:"bg-primary rounded p-1",children:d("group.create.confirm.buyinfo",["amount"],[n.toString()])})]})]}):null},qh=o=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null,onClose:r=null,isCreator:a=!1,availableRooms:l=[]}=o,[c,m]=i.useState(""),[h,u]=i.useState(""),[g,f]=i.useState(-1),{showConfirm:p=null}=Fe(),x=()=>{!t||t.groupId<=0||p(d("group.deleteconfirm.desc"),()=>{D(new OI(t.groupId)),r&&r()},null,null,null,d("group.deleteconfirm.title"))},I=i.useCallback(()=>!t||!c||!c.length?!1:c===t.groupName&&h===t.groupDescription?!0:t.groupId<=0?g<=0?!1:(s(j=>{const E={...j};return E.groupName=c,E.groupDescription=h,E.groupHomeroomId=g,E}),!0):(D(new RI(t.groupId,c,h||"")),!0),[t,c,h,g,s]);return i.useEffect(()=>{m(t.groupName||""),u(t.groupDescription||""),f(t.groupHomeroomId)},[t]),i.useEffect(()=>(n({action:I}),()=>n(null)),[n,I]),t?e.jsxs(N,{justifyContent:"between",overflow:"auto",children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{center:!0,className:"col-3",children:d("group.edit.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:c,maxLength:29,onChange:j=>m(j.target.value)})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{center:!0,className:"col-3",children:d("group.edit.desc")}),e.jsx("textarea",{className:"form-control form-control-sm",value:h,maxLength:254,onChange:j=>u(j.target.value)})]}),a&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{center:!0,className:"col-3",children:d("group.edit.base")}),e.jsx(N,{fullWidth:!0,gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:g,onChange:j=>f(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:d("group.edit.base.select.room")}),l&&l.map((j,E)=>e.jsx("option",{value:j.id,children:j.name},E))]})})]}),e.jsxs(w,{gap:1,children:[e.jsx(A,{className:"col-3",children:" "}),e.jsx(v,{small:!0,children:d("group.edit.base.warning")})]})]})]}),!a&&e.jsx(L,{variant:"danger",onClick:x,children:d("group.delete")}),a&&e.jsx(v,{underline:!0,center:!0,fullWidth:!0,pointer:!0,onClick:j=>Z("navigator/create"),children:d("group.createroom")})]}):null},Hw=[1,2,3,4],Ww=o=>{const{onClose:t=null}=o,[s,n]=i.useState(1),[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(null),[u,g]=i.useState(0),f=()=>{a(null),c(null),t&&t()},p=()=>{if(!l)return;const j=[];l.groupBadgeParts.forEach(E=>{E.code&&(j.push(E.key),j.push(E.color),j.push(E.position))}),D(new DI(l.groupName,l.groupDescription,l.groupHomeroomId,l.groupColors[0],l.groupColors[1],j))},x=()=>{if(!(r&&r.action&&!r.action())){if(s===1){t();return}n(j=>j-1)}},I=()=>{if(!(r&&r.action&&!r.action())){if(s===4){p();return}n(j=>j===4?j:j+1)}};return U(kI,j=>{const E=j.getParser(),C=[];E.availableRooms.forEach((b,S)=>C.push({id:S,name:b})),h(C),g(E.groupCost)}),i.useEffect(()=>{n(1),c({groupId:-1,groupName:null,groupDescription:null,groupHomeroomId:-1,groupState:1,groupCanMembersDecorate:!0,groupColors:null,groupBadgeParts:null}),D(new AI)},[c]),l?e.jsxs(ae,{className:"nitro-group-creator",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.create.title"),onCloseClick:f}),e.jsxs(se,{children:[e.jsx(w,{center:!0,className:"creator-tabs",children:Hw.map((j,E)=>e.jsx(w,{center:!0,className:`tab tab-${j===1?"blue-flat":j===4?"yellow":"blue-arrow"} ${s===j?"active":""}`,children:e.jsx(v,{variant:"white",children:d(`group.create.steplabel.${j}`)})},E))}),e.jsxs(N,{overflow:"hidden",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(A,{className:`nitro-group-tab-image tab-${s}`}),e.jsxs(N,{grow:!0,gap:0,children:[e.jsx(v,{bold:!0,fontSize:4,children:d(`group.create.stepcaption.${s}`)}),e.jsx(v,{children:d(`group.create.stepdesc.${s}`)})]})]}),e.jsxs(N,{overflow:"hidden",children:[s===1&&e.jsx(qh,{groupData:l,setGroupData:c,setCloseAction:a,onClose:null,isCreator:!0,availableRooms:m}),s===2&&e.jsx(Hh,{groupData:l,setGroupData:c,setCloseAction:a}),s===3&&e.jsx(Wh,{groupData:l,setGroupData:c,setCloseAction:a}),s===4&&e.jsx(Bw,{groupData:l,setGroupData:c,purchaseCost:u})]}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(L,{variant:"link",className:"text-black",onClick:x,children:d(s===1?"generic.cancel":"group.create.previousstep")}),e.jsx(L,{disabled:s===4&&!Nr(),variant:s===4?Nr()?"success":"danger":"primary",onClick:I,children:d(s===4?Nr()?"group.create.confirm.buy":"group.create.confirm.viprequired":"group.create.nextstep")})]})]})]})]}):null},qw=["regular","exclusive","private"],zh=o=>{const{groupInformation:t=null,onClose:s=null,overflow:n="hidden",...r}=o,{showConfirm:a=null}=Fe(),l=t&&t.ownerName===G().userName,c=()=>t&&Ac(t.id),m=()=>{a(d("group.leaveconfirm.desc"),()=>{D(new Nc(t.id,G().userId)),s&&s()},null)},h=()=>t.membershipType===Pt.NOT_MEMBER||t.membershipType===Pt.REQUEST_PENDING?null:l?e.jsx("i",{className:"icon icon-group-owner",title:d("group.youareowner")}):t.isAdmin?e.jsx("i",{className:"icon icon-group-admin",title:d("group.youareadmin")}):e.jsx("i",{className:"icon icon-group-member",title:d("group.youaremember")}),u=()=>{if(l)return"group.youareowner";if(t.type===Ts.PRIVATE&&t.membershipType!==Pt.MEMBER)return"";if(t.membershipType===Pt.MEMBER)return"group.leave";if(t.membershipType===Pt.NOT_MEMBER&&t.type===Ts.REGULAR)return"group.join";if(t.membershipType===Pt.REQUEST_PENDING)return"group.membershippending";if(t.membershipType===Pt.NOT_MEMBER&&t.type===Ts.EXCLUSIVE)return"group.requestmembership"},g=()=>{if(!(t.type===Ts.PRIVATE&&t.membershipType===Pt.NOT_MEMBER)){if(t.membershipType===Pt.MEMBER){m();return}c()}},f=p=>{switch(p){case"members":Mu(t.id);break;case"members_pending":Mu(t.id,2);break;case"manage":dh(t.id);break;case"homeroom":os(t.roomId);break;case"furniture":Z("catalog/open/"+co.GUILD_CUSTOM_FURNI);break;case"popular_groups":Z("navigator/search/groups");break}};return t?e.jsxs(ne,{overflow:n,...r,children:[e.jsxs(N,{center:!0,size:3,overflow:"hidden",children:[e.jsx(w,{alignItems:"center",overflow:"hidden",className:"group-badge",children:e.jsx(Xe,{badgeCode:t.badge,isGroup:!0,scale:2})}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("members"),children:d("group.membercount",["totalMembers"],[t.membersCount.toString()])}),t.pendingRequestsCount>0&&e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("members_pending"),children:d("group.pendingmembercount",["amount"],[t.pendingRequestsCount.toString()])}),t.isOwner&&e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("manage"),children:d("group.manage")})]}),h()]}),e.jsxs(N,{size:9,justifyContent:"between",overflow:"auto",children:[e.jsxs(N,{overflow:"hidden",children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(v,{bold:!0,children:t.title}),e.jsxs(w,{gap:1,children:[e.jsx("i",{className:"icon icon-group-type-"+t.type,title:d(`group.edit.settings.type.${qw[t.type]}.help`)}),t.canMembersDecorate&&e.jsx("i",{className:"icon icon-group-decorate",title:d("group.memberscandecorate")})]})]}),e.jsx(v,{small:!0,children:d("group.created",["date","owner"],[t.createdAt,t.ownerName])})]}),e.jsx(v,{small:!0,overflow:"auto",className:"group-description",children:t.description})]}),e.jsxs(N,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("homeroom"),children:d("group.linktobase")}),e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("furniture"),children:d("group.buyfurni")}),e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:()=>f("popular_groups"),children:d("group.showgroups")})]}),(t.type!==Ts.PRIVATE||t.type===Ts.PRIVATE&&t.membershipType===Pt.MEMBER)&&e.jsx(L,{disabled:t.membershipType===Pt.REQUEST_PENDING||l,onClick:g,children:d(u())})]})]})]}):null},zw=o=>{const[t,s]=i.useState(null);return U(ci,n=>{const r=n.getParser();(t&&t.id===r.id||r.flag)&&s(r)}),t?e.jsxs(ae,{className:"nitro-group-information-standalone",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.window.title"),onCloseClick:n=>s(null)}),e.jsx(se,{children:e.jsx(zh,{groupInformation:t,onClose:()=>s(null)})})]}):null},Yw=["regular","exclusive","private"],$w=o=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null}=o,[r,a]=i.useState(t.groupState),[l,c]=i.useState(t.groupCanMembersDecorate),m=i.useCallback(()=>t?r===t.groupState&&l===t.groupCanMembersDecorate?!0:t.groupId<=0?(s(h=>{const u={...h};return u.groupState=r,u.groupCanMembersDecorate=l,u}),!0):(D(new PI(t.groupId,r,l?0:1)),!0):!1,[t,r,l,s]);return i.useEffect(()=>{a(t.groupState),c(t.groupCanMembersDecorate)},[t]),i.useEffect(()=>(n({action:m}),()=>n(null)),[n,m]),e.jsxs(N,{overflow:"auto",children:[e.jsx(N,{children:Yw.map((h,u)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"groupState",checked:r===u,onChange:g=>a(u)}),e.jsxs(N,{gap:0,children:[e.jsxs(w,{gap:1,children:[e.jsx("i",{className:`icon icon-group-type-${u}`}),e.jsx(v,{bold:!0,children:d(`group.edit.settings.type.${h}.label`)})]}),e.jsx(v,{children:d(`group.edit.settings.type.${h}.help`)})]})]},u))}),e.jsx(Gv,{}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input flex-shrink-0",type:"checkbox",checked:l,onChange:h=>c(u=>!u)}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("group.edit.settings.rights.caption")}),e.jsx(v,{children:d("group.edit.settings.rights.members.help")})]})]})]})},Kw=[1,2,3,5],Xw=o=>{const[t,s]=i.useState(1),[n,r]=i.useState(null),[a,l]=i.useState(null),c=()=>{r(h=>(h&&h.action&&h.action(),null)),l(null)},m=h=>{n&&n.action&&n.action(),s(h)};return U(ci,h=>{const u=h.getParser();!a||a.groupId!==u.id||l(g=>{const f={...g};return f.groupName=u.title,f.groupDescription=u.description,f.groupState=u.type,f.groupCanMembersDecorate=u.canMembersDecorate,f})}),U(LI,h=>{const u=h.getParser(),g=[];u.badgeParts.forEach((f,p)=>{g.push(new Il(f.isBase?Il.BASE:Il.SYMBOL,f.key,f.color,f.position))}),l({groupId:u.id,groupName:u.title,groupDescription:u.description,groupHomeroomId:u.roomId,groupState:u.state,groupCanMembersDecorate:u.canMembersDecorate,groupColors:[u.colorA,u.colorB],groupBadgeParts:g})}),!a||a.groupId<=0?null:e.jsxs(ae,{className:"nitro-group-manager",children:[e.jsx(re,{headerText:d("group.window.title"),onCloseClick:c}),e.jsx(yn,{children:Kw.map(h=>e.jsx(sn,{isActive:t===h,onClick:()=>m(h),children:d(`group.edit.tab.${h}`)},h))}),e.jsxs(se,{children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(A,{className:`nitro-group-tab-image tab-${t}`}),e.jsxs(N,{grow:!0,gap:0,children:[e.jsx(v,{bold:!0,fontSize:4,children:d(`group.edit.tabcaption.${t}`)}),e.jsx(v,{children:d(`group.edit.tabdesc.${t}`)})]})]}),e.jsxs(N,{grow:!0,overflow:"hidden",children:[t===1&&e.jsx(qh,{groupData:a,setGroupData:l,setCloseAction:r,onClose:c}),t===2&&e.jsx(Hh,{groupData:a,setGroupData:l,setCloseAction:r,skipDefault:!0}),t===3&&e.jsx(Wh,{groupData:a,setGroupData:l,setCloseAction:r}),t===5&&e.jsx($w,{groupData:a,setGroupData:l,setCloseAction:r})]})]})]})},Qw=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(-1),[a,l]=i.useState(null),[c,m]=i.useState(-1),[h,u]=i.useState(0),[g,f]=i.useState(""),[p,x]=i.useState(null),{showConfirm:I=null}=Fe(),j=_=>{if(_.rank===ds.OWNER)return"group.members.owner";if(a.admin){if(_.rank===ds.ADMIN)return"group.members.removerights";if(_.rank===ds.MEMBER)return"group.members.giverights"}return""},E=i.useCallback(()=>{t===-1||n===-1||c===-1||D(new fu(t,c,g,n))},[t,n,c,g]),C=_=>{!a.admin||_.rank===ds.OWNER||(_.rank!==ds.ADMIN?D(new FI(a.groupId,_.id)):D(new VI(a.groupId,_.id)),E())},b=_=>{!a.admin||_.rank!==ds.REQUESTED||(D(new GI(a.groupId,_.id)),E())},S=_=>{if(a.admin){if(_.rank===ds.REQUESTED){D(new BI(a.groupId,_.id)),E();return}x(_.name),D(new HI(a.groupId,_.id))}};return U(MI,_=>{const T=_.getParser();l(T),r(T.level),u(Math.ceil(T.totalMembersCount/T.pageSize))}),U(UI,_=>{const T=_.getParser();I(d(T.furnitureCount>0?"group.kickconfirm.desc":"group.kickconfirm_nofurni.desc",["user","amount"],[p,T.furnitureCount.toString()]),()=>{D(new Nc(a.groupId,T.userId)),E()},null),x(null)}),i.useEffect(()=>{const _={linkReceived:T=>{const P=T.split("/");if(P.length<2)return;const k=parseInt(P[1])||-1,R=parseInt(P[2])||3;s(k),r(R),m(0)},eventUrlPrefix:"group-members/"};return ft(_),()=>pt(_)},[]),i.useEffect(()=>{m(0)},[t,n,g]),i.useEffect(()=>{t===-1||n===-1||c===-1||D(new fu(t,c,g,n))},[t,n,c,g]),i.useEffect(()=>{t!==-1&&(r(-1),l(null),u(0),f(""),x(null))},[t]),t===-1||!a?null:e.jsxs(ae,{className:"nitro-group-members",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.members.title",["groupName"],[a?a.groupTitle:""]),onCloseClick:_=>s(-1)}),e.jsxs(se,{overflow:"hidden",children:[e.jsxs(w,{gap:2,children:[e.jsx(w,{center:!0,className:"group-badge",children:e.jsx(Xe,{badgeCode:a.badge,isGroup:!0,className:"mx-auto d-block"})}),e.jsxs(N,{fullWidth:!0,gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm w-100",placeholder:d("group.members.searchinfo"),value:g,onChange:_=>f(_.target.value)}),e.jsxs("select",{className:"form-select form-select-sm w-100",value:n,onChange:_=>r(parseInt(_.target.value)),children:[e.jsx("option",{value:"0",children:d("group.members.search.all")}),e.jsx("option",{value:"1",children:d("group.members.search.admins")}),e.jsx("option",{value:"2",children:d("group.members.search.pending")})]})]})]}),e.jsx(ne,{columnCount:2,overflow:"auto",className:"nitro-group-members-list-grid",children:a.result.map((_,T)=>e.jsxs(w,{gap:2,alignItems:"center",overflow:"hidden",className:"member-list-item bg-white rounded p-2",children:[e.jsx("div",{className:"avatar-head cursor-pointer",onClick:()=>ls(_.id),children:e.jsx(it,{figure:_.figure,headOnly:!0,direction:2})}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{bold:!0,small:!0,pointer:!0,onClick:P=>ls(_.id),children:_.name}),_.rank!==ds.REQUESTED&&e.jsx(v,{small:!0,italics:!0,variant:"muted",children:d("group.members.since",["date"],[_.joinedAt])})]}),e.jsxs(N,{gap:1,children:[_.rank!==ds.REQUESTED&&e.jsx(w,{center:!0,children:e.jsx(A,{pointer:a.admin,className:`icon icon-group-small-${_.rank===ds.OWNER?"owner":_.rank===ds.ADMIN?"admin":a.admin&&_.rank===ds.MEMBER?"not-admin":""}`,title:d(j(_)),onClick:P=>C(_)})}),a.admin&&_.rank===ds.REQUESTED&&e.jsx(w,{alignItems:"center",children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-accept",title:d("group.members.accept"),onClick:P=>b(_)})}),a.admin&&_.rank!==ds.OWNER&&_.id!==G().userId&&e.jsx(w,{alignItems:"center",children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-deny",title:d(_.rank===ds.REQUESTED?"group.members.reject":"group.members.kick"),onClick:P=>S(_)})})]})]},T))}),e.jsxs(w,{gap:1,justifyContent:"between",alignItems:"center",children:[e.jsx(L,{disabled:a.pageIndex===0,onClick:_=>m(T=>T-1),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(v,{small:!0,children:d("group.members.pageinfo",["amount","page","totalPages"],[a.totalMembersCount.toString(),(a.pageIndex+1).toString(),h.toString()])}),e.jsx(L,{disabled:a.pageIndex===h-1,onClick:_=>m(T=>T+1),children:e.jsx(ws,{className:"fa-icon"})})]})]})]})},Jw=o=>{const[t,s]=i.useState(!1);return fi(),U(qI,n=>{const r=n.getParser();s(!1),os(r.roomId)}),i.useEffect(()=>{const n={linkReceived:r=>{const a=r.split("/");if(!(a.length<2))switch(a[1]){case"create":s(!0);return;case"manage":if(!a[2])return;s(!1),D(new WI(Number(a[2])));return}},eventUrlPrefix:"groups/"};return ft(n),()=>pt(n)},[]),e.jsxs(e.Fragment,{children:[t&&e.jsx(Ww,{onClose:()=>s(!1)}),!t&&e.jsx(Xw,{}),e.jsx(Qw,{}),e.jsx(zw,{})]})},Zw=o=>{const{helpRequestDescription:t=null,helpRequestAverageTime:s=0}=o,n=r=>D(new zI(r));return e.jsxs(N,{children:[e.jsxs(N,{gap:0,className:"bg-muted p-2 rounded",children:[e.jsx(v,{bold:!0,children:d("guide.help.request.guide.accept.request.title")}),e.jsx(v,{variant:"muted",children:d("guide.help.request.type.1")}),e.jsx(v,{wrap:!0,textBreak:!0,children:t})]}),e.jsxs(N,{gap:1,children:[e.jsx(L,{variant:"success",onClick:r=>n(!0),children:d("guide.help.request.guide.accept.accept.button")}),e.jsx(L,{variant:"danger",onClick:r=>n(!1),children:d("guide.help.request.guide.accept.skip.link")})]})]})},eT=o=>{const{isOnDuty:t=!1,isHandlingGuideRequests:s=!1,setIsHandlingGuideRequests:n=null,isHandlingHelpRequests:r=!1,setIsHandlingHelpRequests:a=null,isHandlingBullyReports:l=!1,setIsHandlingBullyReports:c=null,guidesOnDuty:m=0,helpersOnDuty:h=0,guardiansOnDuty:u=0,processAction:g=null}=o;return e.jsxs(N,{children:[e.jsxs(w,{alignItems:"center",gap:2,className:"bg-muted p-2 rounded",children:[e.jsx(A,{className:"duty-switch"+(t?"":" off"),onClick:f=>g("toggle_duty")}),e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,children:d("guide.help.guide.tool.yourstatus")}),e.jsx(v,{children:d(`guide.help.guide.tool.duty.${t?"on":"off"}`)})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("guide.help.guide.tool.tickettypeselection.caption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:s,onChange:f=>n(f.target.checked)}),e.jsx(v,{children:d("guide.help.guide.tool.tickettypeselection.guiderequests")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:r,onChange:f=>a(f.target.checked)}),e.jsx(v,{children:d("guide.help.guide.tool.tickettypeselection.onlyhelprequests")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:l,onChange:f=>c(f.target.checked)}),e.jsx(v,{children:d("guide.help.guide.tool.tickettypeselection.bullyreports")})]})]}),e.jsx("hr",{className:"bg-dark m-0"}),e.jsxs(w,{center:!0,gap:2,children:[e.jsx(A,{className:"info-icon"}),e.jsxs(N,{gap:1,children:[e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.guidesonduty",["amount"],[m.toString()])}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.helpersonduty",["amount"],[h.toString()])}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.guardiansonduty",["amount"],[u.toString()])}})]})]}),e.jsx("hr",{className:"bg-dark m-0"}),e.jsxs(w,{justifyContent:"between",gap:2,children:[e.jsx(L,{disabled:!0,onClick:f=>g("forum_link"),children:d("guide.help.guide.tool.forum.link")}),e.jsx(L,{disabled:!0,children:d("guide.help.guide.tool.skill.link")})]})]})},tT=o=>{const t=i.useRef(null),{isGuide:s=!1,userId:n=0,userName:r=null,userFigure:a=null,isTyping:l=!1,messageGroups:c=[]}=o,[m,h]=i.useState("");i.useEffect(()=>{var j;(j=t.current)==null||j.scrollIntoView({block:"end",behavior:"smooth"})},[c]);const u=i.useCallback(()=>{D(new YI)},[]),g=i.useCallback(()=>{D(new $I)},[]),f=i.useCallback(()=>{D(new KI)},[]);U(XI,j=>{const E=j.getParser();os(E.requesterRoomId)});const p=i.useCallback(()=>{!m||!m.length||(D(new QI(m)),h(""))},[m]),x=i.useCallback(j=>{j.key==="Enter"&&p()},[p]),I=i.useCallback(j=>j===G().userId,[]);return e.jsxs(N,{fullHeight:!0,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,className:"bg-muted p-2 rounded",children:[s&&e.jsxs(En,{children:[e.jsx(L,{onClick:u,children:d("guide.help.request.guide.ongoing.visit.button")}),e.jsx(L,{onClick:g,children:d("guide.help.request.guide.ongoing.invite.button")})]}),!s&&e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,children:r}),e.jsx(v,{children:d("guide.help.request.user.ongoing.guide.desc")})]}),e.jsx(L,{variant:"danger",disabled:!0,children:d("guide.help.common.report.link")})]}),e.jsx(N,{overflow:"hidden",gap:1,className:"bg-muted rounded chat-messages p-2",children:e.jsxs(N,{overflow:"auto",children:[c.map((j,E)=>e.jsxs(w,{fullWidth:!0,justifyContent:I(j.userId)?"end":"start",gap:2,children:[e.jsx(A,{shrink:!0,className:"message-avatar",children:!I(j.userId)&&e.jsx(it,{figure:a,direction:2})}),e.jsxs(A,{className:"bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-"+(I(j.userId)?"right":"left"),children:[e.jsxs(v,{bold:!0,children:[I(j.userId)&&G().userName,!I(j.userId)&&r]}),j.messages.map((C,b)=>e.jsx(A,{pointer:!!C.roomId,className:C.roomId?"text-break text-underline":"text-break",onClick:()=>C.roomId?os(C.roomId):null,children:C.message},b))]}),I(j.userId)&&e.jsx(A,{className:"message-avatar flex-shrink-0",children:e.jsx(it,{figure:G().figure,direction:4})})]},E)),e.jsx("div",{ref:t})]})}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("guide.help.request.guide.ongoing.input.empty",["name"],[r]),value:m,onChange:j=>h(j.target.value),onKeyDown:x}),e.jsx(L,{variant:"success",onClick:p,children:d("widgets.chatinput.say")})]}),l&&e.jsx(v,{variant:"muted",children:d("guide.help.common.typing")})]}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:f,children:d("guide.help.request."+(s?"guide":"user")+".ongoing.close.link")})]})},sT=15,nT=o=>{const{userRequest:t="",setUserRequest:s=null}=o,[n,r]=i.useState(!1),a=()=>{r(!0),D(new JI(1,t))};return e.jsxs(N,{children:[e.jsx(v,{children:d("guide.help.request.user.create.help")}),e.jsx("textarea",{className:"request-message",maxLength:140,value:t,onChange:l=>s(l.target.value),placeholder:d("guide.help.request.user.create.input.help")}),e.jsx(L,{fullWidth:!0,variant:"success",disabled:t.length<sT||n,onClick:a,children:d("guide.help.request.user.create.input.button")})]})},rT=o=>{const{userName:t=null}=o,s=n=>D(new ZI(n));return e.jsxs(N,{children:[e.jsxs(w,{justifyContent:"between",gap:1,className:"bg-muted p-2 rounded",children:[e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,children:t}),e.jsx(v,{children:d("guide.help.request.user.feedback.guide.desc")})]}),e.jsx(L,{variant:"danger",disabled:!0,children:d("guide.help.common.report.link")})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("guide.help.request.user.feedback.closed.title")}),e.jsx(v,{children:d("guide.help.request.user.feedback.closed.desc")})]}),t&&t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"bg-dark m-0 mt-auto"}),e.jsxs(N,{children:[e.jsx(v,{center:!0,bold:!0,children:d("guide.help.request.user.feedback.question")}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"success",onClick:n=>s(!0),children:d("guide.help.request.user.feedback.positive.button")}),e.jsx(L,{fullWidth:!0,variant:"danger",onClick:n=>s(!1),children:d("guide.help.request.user.feedback.negative.button")})]})]})]})]})},aT=o=>e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("guide.help.request.no_tour_guides.title")}),e.jsx(v,{children:d("guide.help.request.no_tour_guides.message")})]}),iT=o=>{const{helpRequestDescription:t=null,helpRequestAverageTime:s=0}=o,n=()=>D(new eb);return e.jsxs(N,{children:[e.jsxs(N,{gap:0,className:"bg-muted rounded p-2",children:[e.jsx(v,{bold:!0,children:d("guide.help.request.guide.accept.request.title")}),e.jsx(v,{variant:"muted",children:d("guide.help.request.type.1")}),e.jsx(v,{wrap:!0,textBreak:!0,children:t})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("guide.help.request.user.pending.info.title")}),e.jsx(v,{children:d("guide.help.request.user.pending.info.message")}),e.jsx(v,{children:d("guide.help.request.user.pending.info.waiting",["waitingtime"],[s.toString()])})]}),e.jsx(L,{variant:"danger",onClick:n,children:d("guide.help.request.user.pending.cancel.button")})]})},oT=o=>e.jsx(N,{gap:1,children:e.jsx(v,{children:d("guide.help.request.user.guide.disconnected.error.desc")})}),lT=o=>e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("guide.help.request.user.thanks.info.title")}),e.jsx(v,{children:d("guide.help.request.user.thanks.info.desc")})]}),cT=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(d("guide.help.guide.tool.title")),[a,l]=i.useState(!1),[c,m]=i.useState(De.GUIDE_TOOL_MENU),[h,u]=i.useState(!1),[g,f]=i.useState(!1),[p,x]=i.useState(!1),[I,j]=i.useState(!1),[E,C]=i.useState(0),[b,S]=i.useState(0),[_,T]=i.useState(0),[P,k]=i.useState(""),[R,y]=i.useState(null),[O,F]=i.useState(0),[V,Y]=i.useState(0),[q,M]=i.useState(null),[X,he]=i.useState(null),[pe,qe]=i.useState(!1),[wt,be]=i.useState([]),{simpleAlert:Qe=null}=Fe(),Ee=i.useCallback((ge,le)=>{switch(ge){case De.GUIDE_TOOL_MENU:r(d("guide.help.guide.tool.title")),l(!1);break;case De.GUIDE_ACCEPT:r(d("guide.help.request.guide.accept.title")),l(!0);break;case De.GUIDE_ONGOING:r(d("guide.help.request.guide.ongoing.title",["name"],[le])),l(!0);break;case De.USER_CREATE:r(d("guide.help.request.user.create.title")),l(!1);break;case De.USER_PENDING:r(d("guide.help.request.user.pending.title")),l(!0);break;case De.USER_ONGOING:r(d("guide.help.request.user.ongoing.title",["name"],[le])),l(!0);break;case De.USER_FEEDBACK:r(d("guide.help.request.user.feedback.title")),l(!0);break;case De.USER_THANKS:r(d("guide.help.request.user.thanks.title")),l(!1);break;case De.USER_NO_HELPERS:r(d("guide.help.request.no_tour_guides.heading")),l(!1);break;case De.USER_SOMETHING_WRONG:r(d("guide.help.request.user.guide.disconnected.error.heading")),l(!1);break}m(ge),s(!0)},[]),Jt=i.useCallback(ge=>{switch(ge.type){case Is.SHOW_GUIDE_TOOL:s(!0);return;case Is.HIDE_GUIDE_TOOL:s(!1);return;case Is.TOGGLE_GUIDE_TOOL:s(le=>!le);return;case Is.CREATE_HELP_REQUEST:Ee(De.USER_CREATE);return}},[Ee]);ut(Is.SHOW_GUIDE_TOOL,Jt),ut(Is.HIDE_GUIDE_TOOL,Jt),ut(Is.TOGGLE_GUIDE_TOOL,Jt),ut(Is.CREATE_HELP_REQUEST,Jt),U(Fm,ge=>{!ge.getParser().isAllowed(Um.USE_GUIDE_TOOL)&&h&&(u(!1),D(new pu(!1,!1,!1,!1)))}),U(tb,ge=>{const le=ge.getParser();u(le.onDuty),S(le.guidesOnDuty),C(le.helpersOnDuty),T(le.guardiansOnDuty)}),U(sb,ge=>{const le=ge.getParser();y(le.helpRequestDescription),F(le.roleSpecificWaitTime),le.asGuide&&h&&Ee(De.GUIDE_ACCEPT),le.asGuide||Ee(De.USER_PENDING)}),U(nb,ge=>{const le=ge.getParser();h?(Y(le.requesterUserId),M(le.requesterName),he(le.requesterFigure),Ee(De.GUIDE_ONGOING,le.requesterName)):(Y(le.guideUserId),M(le.guideName),he(le.guideFigure),Ee(De.USER_ONGOING,le.guideName))}),U(rb,ge=>{const le=ge.getParser();qe(le.isTyping)}),U(ab,ge=>{const le=ge.getParser(),Ae=[...wt];let qt=Ae[Ae.length-1];(!qt||qt.userId!==le.senderId)&&(qt=new Fu(le.senderId),Ae.push(qt)),qt.addChat(new Uu(le.chatMessage)),be(Ae)}),U(ib,ge=>{const le=ge.getParser();if(le.roomId!==0){const Ae=[...wt];let qt=Ae[Ae.length-1];const cs=h?G().userId:V;(!qt||qt.userId!==cs)&&(qt=new Fu(cs),Ae.push(qt)),qt.addChat(new Uu(le.roomName,le.roomId)),be(Ae)}}),U(ob,ge=>{h?(Y(0),M(null),he(null),qe(!1),be([]),Ee(De.GUIDE_TOOL_MENU)):Ee(De.USER_FEEDBACK)}),U(lb,ge=>{switch(ge.getParser().errorCode){case 0:Ee(De.USER_SOMETHING_WRONG);break;case 1:case 2:Ee(De.USER_NO_HELPERS);break}}),U(cb,ge=>{Y(0),M(null),he(null),qe(!1),be([]),Ee(h?De.GUIDE_TOOL_MENU:De.USER_THANKS)}),i.useEffect(()=>{const ge={linkReceived:le=>{const Ae=le.split("/");if(!(Ae.length<2))switch(Ae[1]){case"tour":return}},eventUrlPrefix:"help/"};return ft(ge),()=>pt(ge)},[]);const me=i.useCallback(ge=>{switch(ge){case"close":s(!1),k(""),m(De.GUIDE_TOOL_MENU);return;case"toggle_duty":if(!g&&!p&&!I){Qe(d("guide.help.guide.tool.noqueueselected.message"),null,null,null,d("guide.help.guide.tool.noqueueselected.caption"),null);return}u(Ae=>(D(new pu(!Ae,Ae?!1:p,Ae?!1:I,Ae?!1:g)),!Ae));return;case"forum_link":const le=K("group.homepage.url","").replace("%groupid%",K("guide.help.alpha.groupid","0"));window.open(le);return}},[g,p,I,Qe]);return t?e.jsxs(ae,{className:"nitro-guide-tool",theme:"primary-slim",children:[e.jsx(re,{headerText:n,onCloseClick:ge=>me("close"),noCloseButton:a}),e.jsxs(se,{className:"text-black",children:[c===De.GUIDE_TOOL_MENU&&e.jsx(eT,{isOnDuty:h,isHandlingGuideRequests:p,setIsHandlingGuideRequests:x,isHandlingHelpRequests:I,setIsHandlingHelpRequests:j,isHandlingBullyReports:g,setIsHandlingBullyReports:f,guidesOnDuty:b,helpersOnDuty:E,guardiansOnDuty:_,processAction:me}),c===De.GUIDE_ACCEPT&&e.jsx(Zw,{helpRequestDescription:R,helpRequestAverageTime:O}),[De.GUIDE_ONGOING,De.USER_ONGOING].includes(c)&&e.jsx(tT,{isGuide:h,userId:V,userName:q,userFigure:X,isTyping:pe,messageGroups:wt}),c===De.USER_CREATE&&e.jsx(nT,{userRequest:P,setUserRequest:k}),c===De.USER_PENDING&&e.jsx(iT,{helpRequestDescription:R,helpRequestAverageTime:O}),c===De.USER_FEEDBACK&&e.jsx(rT,{userName:q}),c===De.USER_THANKS&&e.jsx(lT,{}),c===De.USER_NO_HELPERS&&e.jsx(aT,{}),c===De.USER_SOMETHING_WRONG&&e.jsx(oT,{})]})]}):null},uT=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(null),[a,l]=i.useState(0),[c,m]=i.useState(null),{userFigure:h=null}=Yn(),{purse:u=null,clubStatus:g=null}=Fr(),{badgeCodes:f=[],activate:p=null,deactivate:x=null}=pi(),I=()=>u.clubDays<=0?d("purse.clubdays.zero.amount.text"):u.minutesUntilExpiration>-1&&u.minutesUntilExpiration<60*24?en.shortFormat(u.minutesUntilExpiration*60):en.shortFormat((u.clubPeriods*31+u.clubDays)*86400),j=()=>{switch(g){case pn.ACTIVE:return d(`hccenter.status.${g}.info`,["timeleft","joindate","streakduration"],[I(),n==null?void 0:n.firstSubscriptionDate,en.shortFormat((n==null?void 0:n.currentHcStreak)*86400)]);case pn.EXPIRED:return d(`hccenter.status.${g}.info`,["joindate"],[n==null?void 0:n.firstSubscriptionDate]);default:return d(`hccenter.status.${g}.info`)}},E=()=>!n||n.timeUntilPayday<60?d("hccenter.special.time.soon"):en.shortFormat(n.timeUntilPayday*60),C=()=>d("hccenter.special.sum",["credits"],[((n==null?void 0:n.creditRewardForStreakBonus)+(n==null?void 0:n.creditRewardForMonthlySpent)).toString()]);if(U(Im,S=>{const _=S.getParser();l(_.giftsAvailable)}),U(ub,S=>{const _=S.getParser();r(_.data)}),i.useEffect(()=>{const S={linkReceived:_=>{const T=_.split("/");if(!(T.length<2))switch(T[1]){case"open":if(T.length>2)switch(T[2]){case"hccenter":s(!0);break}return}},eventUrlPrefix:"habboUI/"};return ft(S),()=>pt(S)},[]),i.useEffect(()=>{m(pv(f))},[f]),i.useEffect(()=>{if(!t)return;const S=p();return()=>x(S)},[t,p,x]),i.useEffect(()=>{D(new bm),D(new db)},[]),!t)return null;const b=e.jsx(ua,{id:"popover-basic",children:e.jsxs(ua.Body,{className:"text-black py-2 px-3",children:[e.jsx("h5",{children:d("hccenter.breakdown.title")}),e.jsx("div",{children:d("hccenter.breakdown.creditsspent",["credits"],[n==null?void 0:n.totalCreditsSpent.toString()])}),e.jsx("div",{children:d("hccenter.breakdown.paydayfactor.percent",["percent"],[((n==null?void 0:n.kickbackPercentage)*100).toString()])}),e.jsx("div",{children:d("hccenter.breakdown.streakbonus",["credits"],[n==null?void 0:n.creditRewardForStreakBonus.toString()])}),e.jsx("hr",{className:"w-100 text-black my-1"}),e.jsx("div",{children:d("hccenter.breakdown.total",["credits","actual"],[C(),(((n==null?void 0:n.kickbackPercentage)*(n==null?void 0:n.totalCreditsSpent)+(n==null?void 0:n.creditRewardForStreakBonus))*100/100).toString()])}),e.jsx("div",{className:"btn btn-link text-primary p-0",onClick:()=>Z("habbopages/"+K("hc.center")["payday.habbopage"]),children:d("hccenter.special.infolink")})]})});return e.jsxs(ae,{theme:"primary-slim",className:"nitro-hc-center",children:[e.jsx(re,{headerText:d("generic.hccenter"),onCloseClick:()=>s(!1)}),e.jsxs(w,{position:"relative",className:"bg-muted p-2",children:[e.jsxs(N,{gap:1,children:[e.jsx("div",{className:"hc-logo"}),e.jsx(w,{children:e.jsx(L,{variant:"success",onClick:S=>Z("catalog/open/"+K("catalog.links")["hc.buy_hc"]),children:d(g===pn.ACTIVE?"hccenter.btn.extend":"hccenter.btn.buy")})})]}),e.jsx(A,{position:"absolute",className:"end-0 p-4 top-0 habbo-avatar",children:e.jsx(it,{figure:h,direction:4,scale:2})})]}),e.jsxs(se,{children:[e.jsxs(w,{gap:2,children:[e.jsx(Xe,{badgeCode:c,className:"align-self-center flex-shrink-0 me-1"}),e.jsxs(N,{size:5,className:"streak-info",gap:0,children:[e.jsx(v,{children:d("hccenter.status."+g)}),e.jsx(v,{dangerouslySetInnerHTML:{__html:j()}})]})]}),K("hc.center")["payday.info"]&&e.jsxs(w,{alignItems:"center",children:[e.jsxs(N,{className:"rounded-start bg-primary p-2 payday-special mb-1",children:[e.jsx("h4",{className:"mb-1",children:d("hccenter.special.title")}),e.jsx("div",{children:d("hccenter.special.info")}),e.jsx("div",{className:"btn btn-link text-white p-0 mt-auto align-self-baseline",onClick:()=>Z("habbopages/"+K("hc.center")["payday.habbopage"]),children:d("hccenter.special.infolink")})]}),e.jsxs("div",{className:"payday flex-shrink-0 p-2",children:[e.jsx("h5",{className:"mb-2 ms-2",children:d("hccenter.special.time.title")}),e.jsxs("div",{className:"d-flex flex-row mb-2",children:[e.jsx("div",{className:"clock me-2"}),e.jsx("h6",{className:"mb-0 align-self-center",children:E()})]}),g===pn.ACTIVE&&e.jsxs("div",{className:"pe-3",children:[e.jsx("h5",{className:"ms-2 mb-1 bolder",children:d("hccenter.special.amount.title")}),e.jsxs("div",{className:"d-flex flex-column",children:[e.jsx("div",{className:"w-100 text-center ms-4n",children:C()}),e.jsx(dm,{trigger:["hover","focus"],placement:"left",overlay:b,children:e.jsx("div",{className:"btn btn-link align-self-end text-primary",children:d("hccenter.breakdown.infolink")})})]})]})]})]}),K("hc.center")["gift.info"]&&e.jsxs("div",{className:"rounded bg-success p-2 d-flex flex-row mb-0",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"mb-1",children:d("hccenter.gift.title")}),e.jsx("div",{dangerouslySetInnerHTML:{__html:a>0?d("hccenter.unclaimedgifts",["unclaimedgifts"],[a.toString()]):d("hccenter.gift.info")}})]}),e.jsx("button",{className:"btn btn-primary btn-lg align-self-center ms-auto",onClick:()=>Z("catalog/open/"+K("catalog.links")["hc.hc_gifts"]),children:d(g===pn.ACTIVE?"hccenter.btn.gifts.redeem":"hccenter.btn.gifts.view")})]}),K("hc.center")["benefits.info"]&&e.jsxs("div",{className:"benefits text-black py-2",children:[e.jsx("h5",{className:"mb-1 text-primary",children:d("hccenter.general.title")}),e.jsx("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:d("hccenter.general.info")}}),e.jsx("button",{className:"btn btn-link p-0 text-primary",onClick:()=>Z("habbopages/"+K("hc.center")["benefits.habbopage"]),children:d("hccenter.general.infolink")})]})]})]})},dT=o=>{const[t,s]=i.useState(""),{activeReport:n=null,setActiveReport:r=null}=Ws(),a=()=>{t.length<15||r(c=>{const m=Qt.REPORT_SUMMARY;return{...c,message:t,currentStep:m}})},l=()=>{r(c=>({...c,currentStep:c.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(v,{children:d("help.cfh.input.text")})]}),e.jsx("textarea",{className:"form-control h-100",value:t,onChange:c=>s(c.target.value)}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(L,{variant:"secondary",disabled:!(n.reportType===rt.BULLY||n.reportType===rt.EMERGENCY),onClick:l,children:d("generic.back")}),e.jsx(L,{disabled:t.length<15,onClick:a,children:d("help.emergency.main.submit.button")})]})]})},mT=o=>{const{setActiveReport:t=null}=Ws(),s=()=>{t(n=>{const r=Qt.SELECT_USER,a=rt.BULLY;return{...n,currentStep:r,reportType:a}})};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{grow:!0,center:!0,gap:1,children:[e.jsx(v,{fontSize:3,children:d("help.main.frame.title")}),e.jsx(v,{children:d("help.main.self.description")})]}),e.jsxs(N,{gap:1,children:[e.jsx(L,{onClick:s,children:d("help.main.bully.subtitle")}),e.jsx(L,{onClick:()=>Nt(new Is(Is.CREATE_HELP_REQUEST)),disabled:!K("guides.enabled"),children:d("help.main.help.title")}),e.jsx(L,{disabled:!0,children:d("help.main.self.tips.title")})]}),e.jsx(L,{variant:"link",textColor:"black",onClick:()=>D(new mb(!1)),children:d("help.main.my.sanction.status")})]})},hT=o=>{const{username:t="",onAction:s=null}=o,[n,r]=i.useState(!1),a=()=>{n||(r(!0),D(new gb(t)))};return U(hb,l=>{const c=l.getParser();c&&c.webId===G().userId&&s("close")}),e.jsxs("div",{className:"d-flex flex-column gap-4 h-100",children:[e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("tutorial.name_change.info.confirm")}),e.jsxs("div",{className:"d-flex flex-column align-items-center gap-1 h-100",children:[e.jsx("div",{children:d("tutorial.name_change.confirm")}),e.jsx("div",{className:"fw-bold",children:t})]}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",disabled:n,onClick:a,children:d("generic.ok")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>s("close"),children:d("cancel")})]})]})},gT=o=>{const{onAction:t=null}=o;return e.jsxs("div",{className:"d-flex flex-column gap-4 h-100",children:[e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("tutorial.name_change.info.main")}),e.jsx("div",{className:"fw-bold d-flex align-items-center justify-content-center h-100 w-100",children:d("tutorial.name_change.current",["name"],[G().userName])}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",onClick:()=>t("start"),children:d("tutorial.name_change.change")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>t("confirmation",G().userName),children:d("tutorial.name_change.keep")})]})]})},fT=0,pT=2,xT=3,jT=4,IT=5,bT=6,ET=o=>{const{onAction:t=null}=o,[s,n]=i.useState(""),[r,a]=i.useState(!1),[l,c]=i.useState(!1),[m,h]=i.useState(null),[u,g]=i.useState([]),f=()=>{s!==""&&(a(!1),g([]),h(null),c(!0),D(new pb(s)))},p=x=>{a(!1),g([]),h(null),n(x)};return U(fb,x=>{c(!1);const I=x.getParser();if(I)switch(I.resultCode){case fT:a(!0);break;case pT:h("short");break;case xT:h("long");break;case jT:h("invalid");break;case IT:g(I.nameSuggestions),h("taken");break;case bT:h("change_not_allowed")}}),e.jsxs("div",{className:"d-flex flex-column gap-3 h-100",children:[e.jsx("div",{children:d("tutorial.name_change.info.select")}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",value:s,onChange:x=>p(x.target.value)}),e.jsx("button",{className:"btn btn-primary",disabled:s===""||l,onClick:f,children:d("tutorial.name_change.check")})]}),!m&&!r&&e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("help.tutorial.name.info")}),m&&e.jsx("div",{className:"bg-danger rounded p-2 text-center text-white",children:d(`help.tutorial.name.${m}`,["name"],[s])}),r&&e.jsx("div",{className:"bg-success rounded p-2 text-center text-white",children:d("help.tutorial.name.available",["name"],[s])}),u&&e.jsx("div",{className:"d-flex flex-column gap-2",children:u.map((x,I)=>e.jsx("div",{className:"col bg-muted rounded p-1 cursor-pointer",onClick:()=>p(x),children:x},I))}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",disabled:!r,onClick:()=>t("confirmation",s),children:d("tutorial.name_change.pick")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>t("close"),children:d("cancel")})]})]})},Wi="INIT",yl="INPUT",Rl="CONFIRMATION",CT=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(Wi),[a,l]=i.useState(""),c=(h,u)=>{switch(h){case"start":r(yl);break;case"confirmation":l(u),r(Rl);break;case"close":l(""),s(!1);break}},m=i.useMemo(()=>{switch(n){case Wi:return"tutorial.name_change.title.main";case yl:return"tutorial.name_change.title.select";case Rl:return"tutorial.name_change.title.confirm"}},[n]);return ut(ai.INIT,h=>{r(Wi),s(!0)}),t?e.jsxs(ae,{className:"nitro-change-username",theme:"primary-slim",children:[e.jsx(re,{headerText:d(m),onCloseClick:()=>c("close")}),e.jsxs(se,{className:"text-black",children:[n===Wi&&e.jsx(gT,{onAction:c}),n===yl&&e.jsx(ET,{onAction:c}),n===Rl&&e.jsx(hT,{username:a,onAction:c})]})]}):null},vT=o=>{const{activeReport:t=null,setActiveReport:s=null}=Ws(),n=()=>{const r=[];switch(t.reportType){case rt.BULLY:case rt.EMERGENCY:case rt.ROOM:{const a=t.roomId<=0?t.reportedChats[0].roomId:t.roomId;t.reportedChats.forEach(l=>r.push(l.webId,l.message)),D(new Eb(t.message,t.cfhTopic,t.reportedUserId,a,r));break}case rt.IM:t.reportedChats.forEach(a=>r.push(a.webId,a.message)),D(new bb(t.message,t.cfhTopic,t.reportedUserId,r));break;case rt.THREAD:D(new Ib(t.groupId,t.threadId,t.cfhTopic,t.message));break;case rt.MESSAGE:D(new jb(t.groupId,t.threadId,t.messageId,t.cfhTopic,t.message));break;case rt.PHOTO:D(new xb(t.extraData,t.roomId,t.reportedUserId,t.cfhTopic,t.roomObjectId));break}s(null)};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:4,children:d("help.cfh.button.send")}),e.jsx(v,{children:d("help.main.summary")})]}),e.jsx(L,{variant:"success",onClick:n,children:d("guide.help.request.emergency.submit.button")})]})},NT=o=>{const{sanctionInfo:t=null,setSanctionInfo:s=null}=Ws(),n=(r,a,l)=>{let c=`help.sanction.${r}`;switch(a){case"ALERT":c=c+".alert";break;case"MUTE":c=c+".mute";break;case"BAN_PERMANENT":c=c+".permban";break;default:if(c=c+".ban",l>24)return c=c+".days",d(c,["days"],[(l/24).toString()])}return d(c,["hours"],[l.toString()])};return t?e.jsxs(ae,{className:"nitro-help",theme:"primary-slim",children:[e.jsx(re,{headerText:d("help.sanction.info.title"),onCloseClick:()=>s(null)}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{children:[e.jsx(N,{center:!0,size:5,overflow:"hidden",children:e.jsx(A,{className:"index-image"})}),e.jsxs(N,{justifyContent:"between",size:7,overflow:"hidden",children:[t.sanctionReason==="cfh.reason.EMPTY"?e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.current.none")}):e.jsxs(e.Fragment,{children:[(t.probationHoursLeft>0||t.isSanctionActive)&&e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.probation.reminder")}),e.jsxs("div",{className:`col-12 fw-bold ${t.isSanctionNew?"text-danger":""}`,children:[d("help.sanction.last.sanction")," ",n("current",t.sanctionName,t.sanctionLengthHours)]}),e.jsxs("div",{className:"col-12",children:[d("generic.start.time")," ",t.sanctionCreationTime]}),e.jsxs("div",{className:"col-12",children:[d("generic.reason")," ",t.sanctionReason]}),e.jsxs("div",{className:"col-12",children:[d("help.sanction.probation.days.left")," ",Math.trunc(t.probationHoursLeft/24)+1]})]}),t.hasCustomMute&&!t.isSanctionActive&&e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.custom.mute")}),t.tradeLockExpiryTime&&t.tradeLockExpiryTime.length>0&&e.jsxs("div",{className:"col-12 fw-bold",children:[d("trade.locked.until")," ",t.tradeLockExpiryTime]}),e.jsx("div",{className:"col-12",children:n("next",t.nextSanctionName,t.nextSanctionLengthHours)}),e.jsx(L,{variant:"success",onClick:r=>s(null),children:d("habbo.way.ok.button")})]})]})})]}):null},_T=o=>{const[t,s]=i.useState([]),{activeReport:n=null,setActiveReport:r=null}=Ws(),{chatHistory:a=[],messengerHistory:l=[]}=gi(),c=i.useMemo(()=>{switch(n.reportType){case rt.BULLY:case rt.EMERGENCY:return a.filter(g=>g.type===tn.TYPE_CHAT&&g.webId===n.reportedUserId&&g.entityType===gt.USER);case rt.IM:return l.filter(g=>g.webId===n.reportedUserId&&g.type===tn.TYPE_IM)}return[]},[n,a,l]),m=g=>{s(f=>{const p=[...f],x=p.indexOf(g);return x>=0?p.splice(x,1):p.push(g),p})},h=()=>{!t||t.length<=0||r(g=>({...g,reportedChats:t,currentStep:Qt.SELECT_TOPICS}))},u=()=>{r(g=>({...g,currentStep:g.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(v,{children:d("help.emergency.chat_report.description")})]}),e.jsxs(N,{gap:1,overflow:"hidden",children:[!c||!c.length&&e.jsx(v,{children:d("help.cfh.error.no_user_data")}),c.length>0&&e.jsx(Pe,{gap:1,columnCount:1,columnMinHeight:25,overflow:"auto",children:c.map((g,f)=>e.jsx(_e,{onClick:p=>m(g),itemActive:t.indexOf(g)>=0,children:e.jsx(v,{children:g.message})},g.id))})]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(L,{variant:"secondary",onClick:u,disabled:n.reportType===rt.IM,children:d("generic.back")}),e.jsx(L,{disabled:t.length<=0,onClick:h,children:d("help.emergency.main.submit.button")})]})]})},ST=o=>{const[t,s]=i.useState(-1),{chatHistory:n=[]}=gi(),{activeReport:r=null,setActiveReport:a=null}=Ws(),l=i.useMemo(()=>{const u=new Map;return n.forEach(g=>{g.type===tn.TYPE_CHAT&&g.entityType===gt.USER&&g.webId!==G().userId&&!u.has(g.webId)&&u.set(g.webId,{id:g.webId,username:g.name})}),Array.from(u.values())},[n]),c=u=>{u<=0||a(g=>({...g,reportedUserId:u,currentStep:Qt.SELECT_CHATS}))},m=u=>{s(g=>u===g?-1:u)},h=()=>{a(u=>({...u,currentStep:u.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:4,children:d("help.emergency.main.step.two.title")}),l.length>0&&e.jsx(v,{children:d("report.user.pick.user")})]}),e.jsxs(N,{gap:1,overflow:"hidden",children:[!l.length&&e.jsx(v,{children:d("report.user.error.nolist")}),l.length>0&&e.jsx(Pe,{columnCount:1,columnMinHeight:25,gap:1,children:l.map((u,g)=>e.jsx(_e,{onClick:f=>m(u.id),itemActive:t===u.id,children:e.jsx("span",{dangerouslySetInnerHTML:{__html:u.username}})},u.id))})]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(L,{variant:"secondary",onClick:h,children:d("generic.back")}),e.jsx(L,{disabled:t<=0,onClick:()=>c(t),children:d("help.emergency.main.submit.button")})]})]})},wT=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(-1),{setActiveReport:a=null}=Ws(),{cfhCategories:l=[]}=xa(),c=()=>{t<0||n<0||a(h=>({...h,cfhCategory:t,cfhTopic:l[t].topics[n].id,currentStep:Qt.INPUT_REPORT_MESSAGE}))},m=()=>{a(h=>({...h,currentStep:h.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(v,{children:d("help.cfh.pick.topic")})]}),e.jsxs(N,{gap:1,overflow:"auto",children:[t<0&&l.map((h,u)=>e.jsx(L,{variant:"danger",onClick:g=>s(u),children:d(`help.cfh.reason.${h.name}`)},u)),t>=0&&l[t].topics.map((h,u)=>e.jsx(L,{variant:"danger",onClick:g=>r(u),active:n===u,children:d(`help.cfh.topic.${h.id}`)},u))]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(L,{variant:"secondary",onClick:m,children:d("generic.back")}),e.jsx(L,{disabled:n<0,onClick:c,children:d("help.emergency.main.submit.button")})]})]})},TT=o=>{const[t,s]=i.useState(!1),{activeReport:n=null,setActiveReport:r=null,report:a=null}=Ws(),l=()=>{r(null),s(!1)};i.useEffect(()=>{const m={linkReceived:h=>{const u=h.split("/");if(!(u.length<2))switch(u[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(g=>!g);return;case"tour":return;case"report":u.length>=5&&u[2]==="room"&&(parseInt(u[3]),unescape(u.splice(4).join("/")));return}},eventUrlPrefix:"help/"};return ft(m),()=>pt(m)},[]),i.useEffect(()=>{n&&s(!0)},[n]);const c=()=>{if(n)switch(n.currentStep){case Qt.SELECT_USER:return e.jsx(ST,{});case Qt.SELECT_CHATS:return e.jsx(_T,{});case Qt.SELECT_TOPICS:return e.jsx(wT,{});case Qt.INPUT_REPORT_MESSAGE:return e.jsx(dT,{});case Qt.REPORT_SUMMARY:return e.jsx(vT,{})}return e.jsx(mT,{})};return e.jsxs(e.Fragment,{children:[t&&e.jsxs(ae,{className:"nitro-help",theme:"primary-slim",children:[e.jsx(re,{headerText:d("help.button.cfh"),onCloseClick:l}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{children:[e.jsx(N,{center:!0,size:5,overflow:"hidden",children:e.jsx(A,{className:"index-image"})}),e.jsx(N,{justifyContent:"between",size:7,overflow:"hidden",children:e.jsx(c,{})})]})})]}),e.jsx(NT,{}),e.jsx(CT,{})]})},yT=[{id:"room.rooftop",className:"rooftop-orange"},{id:"room.rooftop.pool",className:"rooftop-pool-orange"},{id:"room.pool",className:"pool-orange"},{id:"room.picnic",className:"picnic-orange"},{id:"room.peaceful",className:"peaceful-orange"},{id:"room.infobus",className:"infobus-orange"},{id:"room.lobby",className:"lobby"}],Kt=()=>{const o=K("hotelview"),t=s=>{Z(`navigator/goto/${s}`)};return e.jsx(w,{children:yT.map(s=>e.jsx(A,{className:`position-absolute ${s.className}`,onClick:()=>t(o[s.id]),children:e.jsx("i",{className:"active-arrow arrow"})},s.id))})},RT=()=>{const o=K("hotelview").images["background.colour"],t=new Date;t.getHours(),t.getMinutes();const s=o?{background:o}:{};return(r=>e.jsx("div",{className:"nitro-hotel-view",style:s,children:r}))(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{})]})})]}))},OT=[{id:"room.rooftop",className:"rooftop-night"},{id:"room.rooftop.pool",className:"rooftop-pool-night"},{id:"room.picnic",className:"picnic-night"},{id:"room.peaceful",className:"peaceful-night"},{id:"room.pool",className:"pool-night"},{id:"room.infobus",className:"infobus-night"},{id:"room.lobby",className:"lobby-night"}],Eo=()=>{const o=K("hotelview"),t=s=>{Z(`navigator/goto/${s}`)};return e.jsx(w,{children:OT.map(s=>e.jsx(A,{className:`position-absolute ${s.className}`,onClick:()=>t(o[s.id]),children:e.jsx("i",{className:"active-arrow arrow"})},s.id))})},kT=o=>{const t=K("hotelview").images["background.colour"],[s,n]=i.useState(!1),[r,a]=i.useState(!1);i.useEffect(()=>{setTimeout(()=>n(!0),7e3),setTimeout(()=>a(!0),0)},[]);const l=new Date,c=l.getHours()*60+l.getMinutes();return[{start:18*60,end:18*60+30},{start:19*60,end:19*60+30},{start:20*60,end:20*60+30},{start:21*60,end:21*60+30},{start:22*60,end:22*60+30},{start:23*60,end:23*60+30}].some(u=>c>=u.start&&c<=u.end)?e.jsxs("div",{className:"nitro-hotel-view",style:t&&t?{background:t}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Eo,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"}),e.jsx("div",{className:"door-b position-absolute"})]})})]}):e.jsxs("div",{className:"nitro-hotel-view",style:t&&t?{background:t}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Eo,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"}),e.jsx("div",{className:"door-b position-absolute"})]})})]})},AT=()=>{const o=K("hotelview").images["background.colour"],t=new Date,s=t.getHours(),n=t.getMinutes(),r=o&&o?{background:o}:{},a=l=>e.jsx("div",{className:"nitro-hotel-view",style:r,children:l});return e.jsxs(e.Fragment,{children:[s===6&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a position-absolute"}),e.jsx("div",{className:"back-a position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Eo,{}),e.jsx("div",{className:"light-a position-absolute"}),e.jsx("div",{className:"light-a position-absolute"})]})})]})),s===6&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a-alt position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-a position-absolute"}),e.jsx("div",{className:"light-a position-absolute"})]})})]})),s===7&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a-alt position-absolute"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-b position-absolute"}),e.jsx("div",{className:"light-b position-absolute"})]})})]})),s===7&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-d position-absolute"}),e.jsx("div",{className:"back-c position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-b position-absolute"}),e.jsx("div",{className:"light-d position-absolute"})]})})]})),s===8&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-d position-absolute"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"light-e position-absolute"})]})})]})),s===8&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-iii position-absolute"}),e.jsx("div",{className:"back-d position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"light-f position-absolute"})]})})]})),s===9&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-iv position-absolute"}),e.jsx("div",{className:"back-d position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-d position-absolute"}),e.jsx("div",{className:"light-gg-alt position-absolute"}),e.jsx("div",{className:"light-g position-absolute"}),e.jsx("div",{className:"light-g position-absolute"})]})})]})),s===9&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e position-absolute"}),e.jsx("div",{className:"back-e-alt-v position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"light-gg-alt position-absolute"}),e.jsx("div",{className:"light-g position-absolute"})]})})]})),s===10&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"light-i position-absolute"})]})})]}))]})},DT=o=>{const[t,s]=i.useState(!1),n=K("hotelview").images["background.colour"];return i.useEffect(()=>{setTimeout(()=>s(!0),15e3)},[]),e.jsxs("div",{className:"nitro-hotel-view",style:n&&n?{background:n}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Eo,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"})]})})]})},PT=()=>{const o=K("hotelview").images["background.colour"],t=new Date,s=t.getHours(),n=t.getMinutes(),r=o&&o?{background:o}:{},a=l=>e.jsx("div",{className:"nitro-hotel-view",style:r,children:l});return e.jsxs(e.Fragment,{children:[s===16&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-1 position-relative"}),e.jsx("div",{className:"back-f-alt position-absolute"}),e.jsx("div",{className:"back-f position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-j position-absolute"}),e.jsx("div",{className:"light-j position-absolute"})]})})]})),s===16&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-2 position-relative"}),e.jsx("div",{className:"back-g-alt position-absolute"}),e.jsx("div",{className:"back-g position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-l position-absolute"}),e.jsx("div",{className:"light-l-alt position-absolute"})]})})]})),s===17&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-3 position-relative"}),e.jsx("div",{className:"back-h-alt position-absolute"}),e.jsx("div",{className:"back-h position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-m position-absolute"}),e.jsx("div",{className:"light-m-alt position-absolute"})]})})]})),s===17&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-4 position-relative"}),e.jsx("div",{className:"back-h position-absolute"})]})}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-n position-absolute"}),e.jsx("div",{className:"light-n-alt position-absolute"})]})})]})),s===18&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-5 position-relative"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-n position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-k position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-n position-absolute"}),e.jsx("div",{className:"light-n-alt-iii position-absolute"})]})})]})),s===18&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-6 position-relative"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-n position-absolute"}),e.jsx("div",{className:"back-k-final position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-k position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-o position-absolute"}),e.jsx("div",{className:"light-o-alt position-absolute"}),e.jsx("div",{className:"light-o-alt-ii position-absolute"})]})})]})),s===19&&n<=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-k-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-m position-absolute"}),e.jsx("div",{className:"front-m position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-p position-absolute"}),e.jsx("div",{className:"light-p-alt position-absolute"}),e.jsx("div",{className:"light-p-alt-ii position-absolute"})]})})]})),s===19&&n>=30&&a(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-e position-absolute"}),e.jsx("div",{className:"back-k-final position-absolute"}),e.jsx("div",{className:"back-l position-absolute"}),e.jsx("div",{className:"back-l position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Kt,{}),e.jsx("div",{className:"front-a position-absolute"}),e.jsx("div",{className:"light-q position-absolute"}),e.jsx("div",{className:"light-q-alt-ii position-absolute"})]})})]}))]})},LT=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(null),[a,l]=i.useState(null),[c,m]=i.useState(null);return U(Cb,h=>{const u=h.getParser();s(u.productType),r(u.productClassId),l(u.totalCoinsForBonus),m(u.coinsStillRequiredToBuy)}),i.useEffect(()=>{D(new vb)},[]),t?e.jsxs("div",{className:"bonus-rare widget d-flex",children:[t,e.jsxs("div",{className:"bg-light-dark rounded overflow-hidden position-relative bonus-bar-container",children:[e.jsx("div",{className:"d-flex justify-content-center align-items-center w-100 h-100 position-absolute small top-0",children:a-c+"/"+a}),e.jsx("div",{className:"small bg-info rounded position-absolute top-0 h-100",style:{width:(a-c)/a*100+"%"}})]})]}):null},MT=o=>{const{data:t=null,goalCode:s=null}=o;return e.jsxs("div",{className:"hof-user-container",children:[e.jsxs("div",{className:"hof-tooltip px-2",children:[e.jsx(A,{className:"icon icon-sheet"}),e.jsx("b",{className:"text-black cursor-pointer px-2",onClick:()=>ls(t.userId),children:t.userName}),e.jsxs("div",{className:"small text-black text-muted fw-bold",children:[d("landing.view.competition.hof.points",["points"],[Ja(t.currentScore).toString()])," points"]}),e.jsx("div",{className:"small text-black text-muted",children:d(`landing.view.competition.hof.${s}.rankdesc.leader`)})]}),e.jsx(it,{figure:t.figure,direction:2})]})},UT=o=>{const{slot:t=-1,conf:s=null}=o,[n,r]=i.useState(null);return U(Nb,a=>{const l=a.getParser();r(l.data)}),i.useEffect(()=>{const a=s?s.campaign:"";D(new _b(a))},[s]),n?e.jsx("div",{className:"hall-of-fame d-flex px-2",children:n.hof&&n.hof.length>0&&n.hof.map((a,l)=>e.jsx(MT,{data:a,goalCode:n.goalCode},l))}):null},FT=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(0);return U(Sb,a=>{const l=a.getParser();s(l.articles)}),i.useEffect(()=>{D(new wb)},[]),t?e.jsxs("div",{className:"promo-articles widget mb-2",children:[e.jsxs("div",{className:"d-flex flex-row align-items-center w-100 mb-1",children:[e.jsx("small",{className:"flex-shrink-0 pe-1",children:d("landing.view.promo.article.header")}),e.jsx("hr",{className:"w-100 my-0"})]}),e.jsx("div",{className:"d-flex flex-row mb-1",children:t&&t.length>0&&t.map((a,l)=>e.jsx("div",{className:"promo-articles-bullet cursor-pointer "+(a===t[n]?"promo-articles-bullet-active":""),onClick:c=>r(l)},a.id))}),t&&t[n]&&e.jsxs("div",{className:"promo-article d-flex flex-row row mx-0",children:[e.jsx("div",{className:"promo-article-image",style:{backgroundImage:`url(${t[n].imageUrl})`}}),e.jsxs("div",{className:"col-3 d-flex flex-column h-100",children:[e.jsx("h3",{className:"my-0",children:t[n].title}),e.jsx("b",{children:t[n].bodyText}),e.jsx("button",{className:"btn btn-sm mt-auto btn-gainsboro",onClick:a=>Pr(t[n].linkContent),children:t[n].buttonText})]})]})]}):null},VT=o=>{const{conf:t=null}=o,s=n=>{const r=t[n];if(!r)return null;switch(n){case"image":return Ec.interpolate(r)}return r};return e.jsxs("div",{className:"widgetcontainer widget d-flex flex-row overflow-hidden",children:[e.jsx("div",{className:"widgetcontainer-image flex-shrink-0",style:{backgroundImage:`url(${s("image")})`}}),e.jsxs("div",{className:"d-flex flex-column align-self-center",children:[e.jsx("h3",{className:"my-0",children:d(`landing.view.${s("texts")}.header`)}),e.jsx("i",{children:d(`landing.view.${s("texts")}.body`)}),e.jsx("button",{className:"btn btn-sm btn-gainsboro align-self-start px-3 mt-auto",onClick:n=>Pr(s("btnLink")),children:d(`landing.view.${s("texts")}.button`)})]})]})},GT=o=>{switch(o.widgetType){case"promoarticle":return e.jsx(FT,{});case"achievementcompetition_hall_of_fame":return e.jsx(UT,{slot:o.slot,conf:o.widgetConf});case"bonusrare":return e.jsx(LT,{});case"widgetcontainer":return e.jsx(VT,{conf:o.widgetConf});default:return null}},BT=o=>{const{widgetType:t=null,widgetSlot:s=0,widgetConf:n=null,className:r="",...a}=o;return e.jsx("div",{className:`widget-slot slot-${s} ${r||""}`,...a,children:e.jsx(GT,{widgetType:t,slot:s,widgetConf:n})})},HT=()=>{const[o,t]=i.useState(!0);if(He([Lt.CREATED,Lt.ENDED],l=>{switch(l.type){case Lt.CREATED:t(!1);return;case Lt.ENDED:t(l.openLandingView);return}}),!o)return null;const s=K("hotelview"),n=s.images["background.colour"];K("asset.url");const r=l=>e.jsx(BT,{widgetSlot:l,widgetType:s.widgets[`slot.${l}.widget`],widgetConf:s.widgets[`slot.${l}.conf`],className:l===6?"mt-auto":l%2===0?"col-5":"col-7"},l),a=[1,2,3,4,5,6,7].map(l=>r(l));return e.jsx("div",{className:"nitro-hotel-view",style:n?{background:n}:{},children:e.jsx("div",{className:"container h-100 py-3 overflow-hidden landing-widgets",children:e.jsxs("div",{className:"row h-100",children:[e.jsx("div",{className:"col-9 h-100 d-flex flex-column",children:a.slice(0,6)}),e.jsx("div",{className:"col-3 h-100",children:a[6]})]})})})},WT=()=>{const[o,t]=i.useState(!0),{userFigure:s=null}=Yn(),r=new Date().getHours(),a=r>5&&r<=9,l=r>9&&r<=16,c=r>16&&r<=19,m=r>19&&r<=23,h=r>23||r<=5;return He([Lt.CREATED,Lt.ENDED],u=>{t(u.type===Lt.CREATED?!1:u.openLandingView)}),o?e.jsxs("div",{children:[e.jsx(HT,{}),a&&e.jsx(AT,{}),l&&e.jsx(RT,{}),c&&e.jsx(PT,{}),m&&e.jsx(kT,{}),h&&e.jsx(DT,{})]}):null},nr=class nr{};nr.EVERYTHING="inventory.filter.option.everything",nr.FLOOR="inventory.furni.tab.floor",nr.WALL="inventory.furni.tab.wall",nr.ANYWHERE="inventory.placement.option.anywhere",nr.IN_ROOM="inventory.placement.option.inroom",nr.IN_INVENTORY="inventory.placement.option.notinroom";let Ps=nr;const Sr="inventory.furni",uc="inventory.bots",dc="inventory.furni.tab.pets",Ta="inventory.badges",mc=[Sr,dc,Ta,uc],qT=[at.FURNI,at.PET,at.BADGE,at.BOT],hc=9,zT=o=>{const{currentTab:t=null,groupItems:s=[],badgeCodes:n=[],setGroupItems:r=null,setBadgeCodes:a=null}=o,[l,c]=i.useState(Ps.EVERYTHING),[m,h]=i.useState(Ps.IN_INVENTORY),[u,g]=i.useState("");return i.useEffect(()=>{if(t!==Ta)return;let f=[...n];const p=n.filter(j=>j.startsWith("ACH_")),x={};p.forEach(j=>{const E=j.split(/[\d]+/)[0],C=Number(j.replace(E,""));(x[E]===void 0||C>x[E])&&(x[E]=C)}),f=Object.keys(x).map(j=>`${j}${x[j]}`).concat(n.filter(j=>!j.startsWith("ACH_"))).filter(j=>pa(j).toLocaleLowerCase().includes(u==null?void 0:u.toLocaleLowerCase().replace(" ",""))),a(f)},[n,t,u,a]),i.useEffect(()=>{if(t!==Sr)return;let f=[...s];const p=u.toLocaleLowerCase();if(l===Ps.EVERYTHING)return r(s.filter(x=>x.name.toLocaleLowerCase().includes(p)));f=s.filter(x=>{const I=l===Ps.WALL?x.isWallItem:!1,j=l===Ps.FLOOR?!x.isWallItem:!1,E=!!x.name.toLocaleLowerCase().includes(p);return p&&p.length?E&&(I||j):I||j}),r(f)},[s,r,u,l,t]),i.useEffect(()=>{c(Ps.EVERYTHING),h(Ps.IN_INVENTORY),g("")},[t]),e.jsxs(w,{className:"nitro-inventory-category-filter rounded p-1 mt-n1",style:{width:t===Ta?"320px":"100%"},children:[e.jsxs(w,{className:"position-relative",children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",value:u,onChange:f=>g(f.target.value),placeholder:d("catalog.search")})}),u&&!!u.length&&e.jsx("i",{className:"icon icon-clear position-absolute cursor-pointer end-1 top-1",onClick:f=>g("")})]}),t!==Ta&&e.jsx(e.Fragment,{children:e.jsx(w,{alignItems:"center",position:"relative",className:"ms-2",children:e.jsx("select",{className:"form-select form-select-sm",value:l,onChange:f=>c(f.target.value),children:[Ps.EVERYTHING,Ps.FLOOR,Ps.WALL].map((f,p)=>e.jsx("option",{value:f,children:d(f)},p))})})})]})},pd=o=>{const{badgeCode:t=null,children:s=null,...n}=o,{selectedBadgeCode:r=null,setSelectedBadgeCode:a=null,toggleBadge:l=null,getBadgeId:c=null}=pi(),{isUnseen:m=null}=Os(),h=m(at.BADGE,c(t));return e.jsxs(_e,{className:"badge-container",itemActive:r===t,itemUnseen:h,onMouseDown:u=>a(t),onDoubleClick:u=>l(r),...n,children:[e.jsx(Xe,{badgeCode:t}),s]})},YT=o=>{const{filteredBadgeCodes:t=[]}=o,[s,n]=i.useState(!1),{activeBadgeCodes:r=[],selectedBadgeCode:a=null,isWearingBadge:l=null,canWearBadges:c=null,toggleBadge:m=null,getBadgeId:h=null,activate:u=null,deactivate:g=null}=pi(),{isUnseen:f=null,removeUnseen:p=null}=Os();return i.useEffect(()=>{!a||!f(at.BADGE,h(a))||p(at.BADGE,h(a))},[a,f,p,h]),i.useEffect(()=>{if(!s)return;const x=u();return()=>g(x)},[s,u,g]),i.useEffect(()=>(n(!0),()=>n(!1)),[]),e.jsxs("div",{className:"badge-wrapper calc-wrapper mt-n2",children:[e.jsxs(ne,{gap:1,children:[e.jsx(N,{overflow:"hidden",className:"size-list-badges mt-1",children:e.jsx(Pe,{gap:1,columnCount:5,children:t&&t.length>0&&t.map((x,I)=>l(x)?null:e.jsx(pd,{badgeCode:x},I))})}),e.jsx(N,{className:"justify-content-between size-badges position-absolute end-2 mt-n4",overflow:"auto",children:e.jsxs(N,{overflow:"hidden",children:[e.jsx(v,{center:!0,bold:!0,children:d("inventory.badges.activebadges")}),e.jsx(Pe,{gap:1,columnCount:5,children:r&&r.length>0&&r.map((x,I)=>e.jsx(pd,{badgeCode:x},I))})]})})]}),e.jsx(N,{gap:0,position:"absolute",className:"bottom-2",style:{width:"96%"},children:!!a&&e.jsxs(w,{className:"bg-white pb-1 px-2 rounded mt-2",style:{height:"50px"},justifyContent:"between",alignItems:"end",gap:2,children:[e.jsxs(w,{alignItems:"start",gap:2,children:[e.jsx(Xe,{shrink:!0,badgeCode:a}),e.jsx(v,{className:"font-bold mt-2",children:pa(a)})]}),e.jsx(L,{className:"btn btn-primary mb-1",style:{fontSize:"12px"},disabled:!l(a)&&!c(),onClick:x=>m(a),children:d(l(a)?"inventory.badges.clearbadge":"inventory.badges.wearbadge")})]})})]})},Yc=o=>{const{title:t="",desc:s="",isTrading:n=!1,children:r=null,...a}=o;return e.jsxs(ne,{...a,children:[e.jsxs(N,{center:!0,size:5,overflow:"hidden",children:[e.jsx("div",{className:"empty-image"}),!n&&e.jsx(w,{gap:2,position:"absolute",className:"bottom-2",children:e.jsx(L,{className:"py-1",onClick:()=>Z("catalog/open"),children:d("inventory.open.catalog")})})]}),e.jsxs(N,{justifyContent:"center",size:7,overflow:"hidden",children:[e.jsx(v,{fontWeight:"bold",fontSize:5,overflow:"unset",truncate:!0,children:t}),e.jsx(v,{overflow:"auto",children:s})]}),r]})},$T=o=>{const{botItem:t=null,children:s=null,...n}=o,[r,a]=i.useState(!1),{selectedBot:l=null,setSelectedBot:c=null}=Nh(),{isUnseen:m=null}=Os(),h=m(at.BOT,t.botData.id),u=g=>{switch(g.type){case ve.MOUSE_DOWN:c(t),a(!0);return;case ve.MOUSE_UP:a(!1);return;case ve.ROLL_OUT:if(!r||l!==t)return;tc(t);return;case"dblclick":tc(t);return}};return e.jsxs(_e,{itemActive:l===t,itemUnseen:h,onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...n,children:[e.jsx(it,{figure:t.botData.figure,direction:3,headOnly:!0}),s]})},KT=o=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=!1}=o,[r,a]=i.useState(!1),{botItems:l=[],selectedBot:c=null,activate:m=null,deactivate:h=null}=Nh(),{isUnseen:u=null,removeUnseen:g=null}=Os();return i.useEffect(()=>{if(!c||!s)return;const f=c.botData,p=H();let x=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_WALL_TYPE),I=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_FLOOR_TYPE),j=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_LANDSCAPE_TYPE);x=x&&x.length?x:"101",I=I&&I.length?I:"101",j=j&&j.length?j:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,x,j),s.addAvatarIntoRoom(f.figure,0)},[s,c]),i.useEffect(()=>{!c||!u(at.BOT,c.botData.id)||g(at.BOT,c.botData.id)},[c,u,g]),i.useEffect(()=>{if(!r)return;const f=m();return()=>h(f)},[r,m,h]),i.useEffect(()=>(a(!0),()=>a(!1)),[]),!l||!l.length?e.jsx(Yc,{title:d("inventory.empty.bots.title"),desc:d("inventory.empty.bots.desc"),isTrading:n}):e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsx(Pe,{columnCount:5,children:l&&l.length>0&&l.map(f=>e.jsx($T,{botItem:f},f.botData.id))})}),e.jsxs(N,{size:5,overflow:"auto",children:[e.jsx(N,{overflow:"hidden",position:"relative",children:e.jsx(Zo,{roomPreviewer:s,height:140})}),c&&e.jsxs(N,{grow:!0,justifyContent:"between",gap:2,children:[e.jsx(v,{grow:!0,truncate:!0,children:c.botData.name}),!!t&&e.jsx(L,{variant:"success",onClick:f=>tc(c),children:d("inventory.furni.placetoroom")})]})]})]})},XT=o=>{const{groupItem:t=null,isTrading:s=null,attemptItemOffer:n=null,setGroupItem:r=null,...a}=o,[l,c]=i.useState(!1),{selectedItem:m=null,setSelectedItem:h=null}=dr(),u=f=>{switch(f.type){case ve.MOUSE_DOWN:h(t),c(!0);return;case ve.MOUSE_UP:c(!1);return;case ve.ROLL_OUT:if(!l||t!==m)return;s||ha(t);return;case"dblclick":s||ha(t),s&&(r(t),n(1));return}},g=t.getUnlockedCount();return e.jsx(_e,{className:g?"inventory-items":"inventory-items opacity-0-5 ",itemImage:t.iconUrl,itemCount:t.getUnlockedCount(),itemActive:t===m,itemUniqueNumber:t.stuffData.uniqueNumber,itemUnseen:t.hasUnseenItems,onClick:f=>g&&r(t),onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...a})},QT=o=>{const t=o.getLastItem();if(!t||!t.sellable)return!1;Nt(new jo(t))},JT=o=>{const t=o.getLastItem();if(!t)return!1;Nt(new Io(t,o.getTotalCount()))},ZT=o=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=null,filteredGroupItems:r=[]}=o,[a,l]=i.useState(!1),[c,m]=i.useState(null),[h,u]=i.useState(1),{groupItems:g=[],selectedItem:f=null,activate:p=null,deactivate:x=null}=dr(),{ownUser:I=null}=Vc(),{resetItems:j=null}=Os(),{simpleAlert:E=null}=Fe(),C=(P,k)=>{(isNaN(Number(P))||Number(P)<0||!P)&&(P=1),P=Math.max(Number(P),1),P=Math.min(Number(P),k),P!==h&&u(P)},b=P=>{C(h,P),_(h)},S=(P,k,R,y,O)=>{if(!I||I.accepts||!I.userItems)return!1;if(I.userItems.length<hc)return!0;if(!y)return!1;let F=k.toString();return R===de.POSTER?F=F+"poster"+O.getLegacyString():R===de.GUILD_FURNI?F=JC(k,O):F=(P?"I":"S")+F,!!I.userItems.getValue(F)},_=P=>{if(!c)return;const k=c.getTradeItems(P);if(!k||!k.length)return;let R=null;const y=[];for(const F of k)y.push(F.id),R||(R=F);if(I.userItems.length+y.length<=1500)if(!R.isGroupable&&y.length)D(new xu(y.pop()));else{const F=[];for(const V of y)S(R.isWallItem,R.type,R.category,R.isGroupable,R.stuffData)&&F.push(V);F.length&&(F.length===1?D(new xu(F.pop())):D(new Tb(...F)))}else E(d("trading.items.too_many_items.desc"),je.DEFAULT,null,null,d("trading.items.too_many_items.title"));m(f)};if(i.useEffect(()=>{if(!f||!s)return;const P=f.getLastItem();if(!P)return;const k=H();let R=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_WALL_TYPE),y=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_FLOOR_TYPE),O=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_LANDSCAPE_TYPE);if(R=R&&R.length?R:"101",y=y&&y.length?y:"101",O=O&&O.length?O:"1.1",s.reset(!1),s.updateObjectRoom(y,R,O),s.updateRoomWallsAndFloorVisibility(!0,!0),P.category===de.WALL_PAPER||P.category===de.FLOOR||P.category===de.LANDSCAPE){if(y=P.category===de.FLOOR?f.stuffData.getLegacyString():y,R=P.category===de.WALL_PAPER?f.stuffData.getLegacyString():R,O=P.category===de.LANDSCAPE?f.stuffData.getLegacyString():O,s.updateObjectRoom(y,R,O),P.category===de.LANDSCAPE){const F=G().getWallItemDataByName("window_double_default");F&&s.addWallItemIntoRoom(F.id,new At(90,0,0),F.customParams)}}else f.isWallItem?s.addWallItemIntoRoom(f.type,new At(90),P.stuffData.getLegacyString()):s.addFurnitureIntoRoom(f.type,new At(90),f.stuffData,P.extra.toString());m(f)},[s,f]),i.useEffect(()=>{!f||!f.hasUnseenItems||(j(at.FURNI,f.items.map(P=>P.id)),f.hasUnseenItems=!1)},[f,j]),i.useEffect(()=>{if(!a)return;const P=p();return()=>x(P)},[a,p,x]),i.useEffect(()=>(l(!0),()=>l(!1)),[]),i.useEffect(()=>{u(1)},[r]),!g||!g.length)return e.jsx(Yc,{title:d("inventory.empty.title"),desc:d("inventory.empty.desc"),isTrading:n});const T=n?f.getUnlockedCount():f.items.length;return e.jsxs(ne,{className:"mt-n1",children:[e.jsx(N,{size:7,overflow:"hidden",style:{height:`calc(100% - ${n?"5px":"34px"})`},children:e.jsx(Pe,{gap:1,columnCount:5,className:n?"trading-inventory":"",children:r&&r.length>0&&r.map((P,k)=>e.jsx(XT,{groupItem:P,isTrading:n,attemptItemOffer:R=>_(R),setGroupItem:R=>m(R)},k))})}),e.jsxs(N,{size:5,overflow:"auto",children:[e.jsxs(N,{overflow:"hidden",position:"relative",className:"cursor-pointer",children:[e.jsx(Zo,{roomPreviewer:s,height:140}),f&&e.jsx(L,{variant:"danger",className:"bottom-2 end-2",position:"absolute",onClick:P=>JT(f),children:e.jsx(hg,{className:"fa-icon"})}),f&&(f.items[0].isTradable||!f.items[0].isTradable)&&e.jsxs(w,{gap:2,position:"absolute",className:"top-2 start-2",children:[e.jsx(A,{className:`icon ${f.items[0].isTradable&&T>0?"icon-tradeable":"icon-not-tradeable"}`,title:d(f.items[0].isTradable&&T>0?"inventory.furni.preview.tradeable_amount":"inventory.furni.preview.not_tradeable")}),f.items[0].isTradable&&T>0&&e.jsx(v,{variant:"black",className:"text-shadow-around-text mt-n1",children:T})]}),f&&(f.items[0].recyclable||!f.items[0].recyclable)&&e.jsxs(w,{gap:2,position:"absolute",className:"top-4 start-2",children:[e.jsx(A,{className:`icon ${f.items[0].recyclable&&T>0?"icon-recyclable":"icon-not-recyclable"}`,title:d(f.items[0].recyclable&&T>0?"inventory.furni.preview.recyclable_amount":"inventory.furni.preview.not_recyclable")}),f.items[0].recyclable&&T>0&&e.jsx(v,{variant:"black",className:"text-shadow-around-text",children:T})]}),f&&f.stuffData.isUnique&&e.jsx(xh,{className:"top-2 end-2",position:"absolute",uniqueNumber:f.stuffData.uniqueNumber,uniqueSeries:f.stuffData.uniqueSeries}),f&&f.stuffData.rarityLevel>-1&&e.jsx(Fc,{className:"top-2 end-2",position:"absolute",level:f.stuffData.rarityLevel})]}),f&&e.jsx(N,{grow:!0,justifyContent:"between",gap:2,children:e.jsxs(N,{gap:1,position:n?"relative":"absolute",className:"bottom-1",style:{width:n?"":"39%"},children:[e.jsx(v,{grow:!0,truncate:!0,bold:!0,children:f.name}),f.description&&e.jsx(v,{grow:!0,truncate:!0,small:!0,children:f.description}),!n&&e.jsxs(e.Fragment,{children:[!!t&&e.jsx(L,{className:"p-0 px-2",onClick:P=>ha(f),children:d("inventory.furni.placetoroom")}),f&&f.isSellable&&e.jsx(L,{className:"p-0 px-2",onClick:P=>QT(f),children:d("inventory.marketplace.sell")})]}),n&&e.jsxs(N,{gap:1,alignItems:"start",children:[e.jsx("input",{type:"number",className:"quantity-input remove-outline form-control",placeholder:d("catalog.bundlewidget.spinner.select.amount"),disabled:f.getUnlockedCount()===0,value:h||"",onChange:P=>u(P.target.valueAsNumber)}),e.jsx(L,{variant:"secondary",disabled:!h||f.getUnlockedCount()===0,onClick:P=>h?b(f.getUnlockedCount()):null,children:d("inventory.trading.areoffering")})]})]})})]})]})},ey=o=>{const{currentTab:t=null,setCurrentTab:s=null,cancelTrade:n=null}=o,[r,a]=i.useState(null),[l,c]=i.useState(null),[m,h]=i.useState(3),{ownUser:u=null,otherUser:g=null,tradeState:f=yt.TRADING_STATE_READY,progressTrade:p=null,removeItem:x=null,setTradeState:I=null}=Vc(),j=C=>C?e.jsx(A,{className:"mt-auto mb-5 pb-5 icon icon-lock-locked"}):e.jsx(A,{className:"mt-auto mb-5 pb-5 icon icon-lock-open"}),E=C=>C.getValues().map(b=>{var S;return Number((S=b.iconUrl.split("/")[b.iconUrl.split("/").length-1])==null?void 0:S.split("_")[1])*b.items.length}).reduce((b,S)=>b+(isNaN(S)?0:S),0);return i.useEffect(()=>{if(f!==yt.TRADING_STATE_COUNTDOWN)return;h(3);const C=window.setInterval(()=>{h(b=>{const S=b-1;return S===0&&clearInterval(C),S})},1e3);return()=>clearInterval(C)},[f,I]),i.useEffect(()=>{m===0&&I(yt.TRADING_STATE_CONFIRMING)},[m,I]),f===yt.TRADING_STATE_READY||!u||!g?null:e.jsx(N,{children:e.jsxs(N,{fullWidth:!0,size:12,overflow:"hidden",className:"trade-bg p-2 text-black",children:[t===Sr&&e.jsxs(e.Fragment,{children:[e.jsx(v,{small:!0,children:d("inventory.trading.info.add")}),e.jsxs(ne,{gap:0,overflow:"hidden",className:"px-2",children:[e.jsxs(N,{size:4,overflow:"hidden",children:[e.jsxs(w,{children:[u.accepts&&e.jsx(A,{className:"icon icon-confirmed"}),e.jsxs("small",{className:u.accepts?"px-2":"",children:[e.jsx("b",{children:d("inventory.trading.you")})," ",d("inventory.trading.areoffering")]})]}),e.jsx(Pe,{columnCount:3,columnMinWidth:35,columnMinHeight:35,children:Array.from(Array(hc),(C,b)=>{const S=u.userItems.getWithIndex(b)||null;return S?e.jsx(_e,{itemActive:r===S,itemImage:S.iconUrl,itemCount:S.getTotalCount(),itemUniqueNumber:S.stuffData.uniqueNumber,onClick:_=>a(S),onDoubleClick:_=>x(S),children:r===S&&e.jsx(A,{position:"absolute",onClick:_=>x(S)})},b):e.jsx(_e,{},b)})}),e.jsxs(N,{gap:0,fullWidth:!0,children:[e.jsx("small",{children:d("inventory.trading.info.itemcount",["value"],[u.itemCount.toString()])}),e.jsx("small",{className:"credits-align",children:d("inventory.trading.info.creditvalue.own",["value"],[E(u.userItems).toString()])})]})]}),e.jsx(w,{className:"lock-design-left",children:j(u.accepts)}),e.jsx(w,{className:"divisor"}),e.jsxs(N,{size:4,overflow:"hidden",children:[e.jsxs(w,{children:[g.accepts&&e.jsx(A,{className:"icon icon-confirmed"}),e.jsxs("small",{className:g.accepts?"px-2":"",children:[e.jsx("b",{children:g.userName})," ",d("inventory.trading.isoffering")]})]}),e.jsx(Pe,{columnCount:3,columnMinWidth:35,columnMinHeight:35,children:Array.from(Array(hc),(C,b)=>{const S=g.userItems.getWithIndex(b)||null;return S?e.jsx(_e,{itemActive:l===S,itemImage:S.iconUrl,itemCount:S.getTotalCount(),itemUniqueNumber:S.stuffData.uniqueNumber,onClick:_=>c(S)},b):e.jsx(_e,{},b)})}),e.jsxs(N,{gap:0,fullWidth:!0,children:[e.jsx("small",{children:d("inventory.trading.info.itemcount",["value"],[g.itemCount.toString()])}),e.jsx("small",{children:d("inventory.trading.info.creditvalue",["value"],[E(g.userItems).toString()])})]})]}),e.jsx(w,{className:"lock-design-right",children:j(g.accepts)})]})]}),t!==Sr&&e.jsx(e.Fragment,{children:e.jsxs(w,{className:"px-2",children:[e.jsx(A,{className:"flex-shrink-0 icon icon-report-room"}),e.jsx(v,{bold:!0,children:d("inventory.trading.minimized.trade_in_progress")})]})}),e.jsxs(w,{grow:!0,justifyContent:"between",children:[t===Sr&&e.jsxs(e.Fragment,{children:[f===yt.TRADING_STATE_READY&&e.jsx(L,{variant:"secondary",disabled:!u.itemCount&&!g.itemCount,onClick:p,children:d("inventory.trading.accept")}),f===yt.TRADING_STATE_RUNNING&&e.jsx(L,{variant:"secondary",disabled:!u.itemCount&&!g.itemCount,onClick:p,children:d(u.accepts?"inventory.trading.modify":"inventory.trading.accept")}),f===yt.TRADING_STATE_COUNTDOWN&&e.jsx(L,{variant:"secondary",disabled:!0,children:d("inventory.trading.countdown",["counter"],[m.toString()])}),f===yt.TRADING_STATE_CONFIRMING&&e.jsx(L,{variant:"secondary",onClick:p,children:d("inventory.trading.button.restore")}),f===yt.TRADING_STATE_CONFIRMED&&e.jsx(L,{variant:"secondary",children:d("inventory.trading.info.waiting")})]}),t!==Sr&&e.jsx(L,{variant:"secondary",onClick:()=>s(mc[0]),children:d("inventory.trading.minimized.continue_trade")}),e.jsx(L,{variant:"danger",onClick:n,children:d("generic.cancel")})]})]})})},ty=o=>{const{petItem:t=null,children:s=null,...n}=o,[r,a]=i.useState(!1),{selectedPet:l=null,setSelectedPet:c=null}=_h(),{isUnseen:m}=Os(),h=m(at.PET,t.petData.id),u=g=>{switch(g.type){case ve.MOUSE_DOWN:c(t),a(!0);return;case ve.MOUSE_UP:a(!1);return;case ve.ROLL_OUT:if(!r||t!==l)return;ec(t);return;case"dblclick":ec(t);return}};return e.jsxs(_e,{itemActive:t===l,itemUnseen:h,onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...n,children:[e.jsx(jn,{figure:t.petData.figureData.figuredata,direction:3,headOnly:!0}),s]})},sy=o=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=!1}=o,[r,a]=i.useState(!1),{petItems:l=null,selectedPet:c=null,activate:m=null,deactivate:h=null}=_h(),{isUnseen:u=null,removeUnseen:g=null}=Os();return i.useEffect(()=>{if(!c||!s)return;const f=c.petData,p=H();let x=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_WALL_TYPE),I=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_FLOOR_TYPE),j=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_LANDSCAPE_TYPE);x=x&&x.length?x:"101",I=I&&I.length?I:"101",j=j&&j.length?j:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,x,j),s.addPetIntoRoom(f.figureString)},[s,c]),i.useEffect(()=>{!c||!u(at.PET,c.petData.id)||g(at.PET,c.petData.id)},[c,u,g]),i.useEffect(()=>{if(!r)return;const f=m();return()=>h(f)},[r,m,h]),i.useEffect(()=>(a(!0),()=>a(!1)),[]),!l||!l.length?e.jsx(Yc,{title:d("inventory.empty.pets.title"),desc:d("inventory.empty.pets.desc"),isTrading:n}):e.jsxs(ne,{children:[e.jsx(N,{size:7,overflow:"hidden",children:e.jsx(Pe,{columnCount:5,children:l&&l.length>0&&l.map(f=>e.jsx(ty,{petItem:f},f.petData.id))})}),e.jsxs(N,{size:5,overflow:"auto",children:[e.jsx(N,{overflow:"hidden",position:"relative",children:e.jsx(Zo,{roomPreviewer:s,height:140})}),c&&c.petData&&e.jsxs(N,{grow:!0,justifyContent:"between",gap:2,children:[e.jsx(v,{grow:!0,truncate:!0,children:c.petData.name}),!!t&&e.jsx(L,{variant:"success",onClick:f=>ec(c),children:d("inventory.furni.placetoroom")})]})]})]})},ny=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(1),[a,l]=i.useState("1"),[c,m]=i.useState(1),h=x=>{let I=parseInt(x);isNaN(I)||I===n||(I=Math.max(I,1),I=Math.min(I,c),I!==n&&(l(I.toString()),r(I)))},{showConfirm:u=null}=Fe();if(ut(Io.DELETE_ITEM_CONFIRM,x=>{s(x.item),m(x.amount)}),!t)return null;const g=t?d(t.isWallItem?"wallItem.name."+t.type:"roomItem.name."+t.type):"",f=t?d(t.isWallItem?"wallItem.desc."+t.type:"roomItem.desc."+t.type):"",p=()=>{t&&u(d("inventory.delete.confirm_delete.info",["furniname","amount"],[g,n.toString()]),()=>{D(new yb(t.id,n)),s(null),r(1),m(1),l("1")},()=>{s(null),r(1),m(1),l("1")},null,null,d("inventory.delete.confirm_delete.title"))};return e.jsxs(ae,{className:"nitro-catalog-layout-marketplace-post-offer",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.delete.confirm_delete.title"),onCloseClick:x=>{s(null),r(1),m(1),l("1")}}),e.jsx(se,{overflow:"hidden",children:e.jsxs(ne,{fullHeight:!0,children:[e.jsx(N,{center:!0,className:"bg-muted rounded p-2",size:4,overflow:"hidden",children:e.jsx(Jo,{productType:t.isWallItem?xe.WALL:xe.FLOOR,productClassId:t.type,extraData:t.extra.toString()})}),e.jsxs(N,{size:8,justifyContent:"between",overflow:"hidden",children:[e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{fontWeight:"bold",children:g}),e.jsx(v,{truncate:!0,shrink:!0,children:f})]}),e.jsxs(N,{overflow:"auto",children:[e.jsx(v,{children:d("inventory.delete.amount")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(xc,{className:"text-black cursor-pointer fa-icon",onClick:x=>h((n-1).toString())}),e.jsx("input",{className:"form-control form-control-sm quantity-input",type:"number",min:1,max:c,value:a,onChange:x=>h(x.target.value),placeholder:d("inventory.delete.amount")}),e.jsx(jc,{className:"text-black cursor-pointer fa-icon",onClick:x=>h((n+1).toString())}),e.jsx(L,{onClick:x=>h(c.toString()),children:d("inventory.delete.max_amount.button")})]}),e.jsx(L,{disabled:n>c,onClick:p,children:d("inventory.delete.confirm_delete.button")})]})]})]})})]})},ry=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(mc[0]),[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState([]),[g,f]=i.useState([]),{isTrading:p=!1,stopTrading:x=null}=Vc(),{getCount:I=null}=Os(),{groupItems:j=[]}=dr(),{badgeCodes:E=[]}=pi(),C=()=>{p&&x(),s(!1)};return we(Ct.PLACED,b=>{$C()&&(ui(!1),b.placedInRoom||s(!0))}),He([Lt.CREATED,Lt.ENDED],b=>{switch(b.type){case Lt.CREATED:l(b.session);return;case Lt.ENDED:l(null),s(!1);return}}),U(Rb,b=>{const S=b.getParser();for(const _ of S.data)Jm().setBadgePointLimit(_.badgeId,_.limit)}),i.useEffect(()=>{const b={linkReceived:S=>{const _=S.split("/");if(!(_.length<2))switch(_[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(T=>!T);return}},eventUrlPrefix:"inventory/"};return ft(b),()=>pt(b)},[]),i.useEffect(()=>(m(new ro(H(),++ro.PREVIEW_COUNTER)),()=>{m(b=>(b.dispose(),null))}),[]),i.useEffect(()=>{!t&&p&&s(!0)},[t,p]),t?e.jsxs(ae,{uniqueKey:"inventory",className:`${p?"nitro-inventory trading no-resize":"nitro-inventory"}`,theme:p?"primary":"",children:[e.jsx(re,{headerText:d("inventory.title"),onCloseClick:C}),e.jsxs(e.Fragment,{children:[e.jsx(yn,{children:mc.map((b,S)=>e.jsx(sn,{isActive:n===b,onClick:_=>r(b),count:I(qT[S]),children:d(b)},S))}),e.jsxs(se,{overflow:"hidden",children:[n!==dc&&n!==uc&&e.jsx(zT,{currentTab:n,groupItems:j,setGroupItems:u,badgeCodes:E,setBadgeCodes:f}),n===Sr&&e.jsx(ZT,{roomSession:a,roomPreviewer:c,isTrading:p,filteredGroupItems:h}),n===dc&&e.jsx(sy,{roomSession:a,roomPreviewer:c,isTrading:p}),n===Ta&&e.jsx(YT,{filteredBadgeCodes:g}),n===uc&&e.jsx(KT,{roomSession:a,roomPreviewer:c,isTrading:p}),p&&e.jsx(ey,{currentTab:n,setCurrentTab:b=>r(b),cancelTrade:C})]}),e.jsx(ny,{})]})]}):null},$c=o=>{const{records:t=null}=o,{openRoomInfo:s=null}=xa(),n=i.useMemo(()=>{const a=[];return t.forEach(l=>{a.push({isRoomInfo:!0,roomId:l.roomId,roomName:l.roomName}),l.chatlog.forEach(c=>{a.push({timestamp:c.timestamp,habboId:c.userId,username:c.userName,hasHighlighting:c.hasHighlighting,message:c.message,isRoomInfo:!1})})}),a},[t]),r=a=>e.jsxs(w,{gap:2,alignItems:"center",justifyContent:"between",className:"bg-muted rounded p-1",children:[e.jsxs(w,{gap:1,children:[e.jsx(v,{bold:!0,children:"Room name:"}),e.jsx(v,{children:a.roomName})]}),e.jsxs(w,{gap:1,children:[e.jsx(L,{onClick:l=>os(a.roomId),children:"Visit Room"}),e.jsx(L,{onClick:l=>s(a.roomId),children:"Room Tools"})]})]});return e.jsx(e.Fragment,{children:e.jsxs(N,{fit:!0,gap:0,overflow:"hidden",children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Time"}),e.jsx(A,{className:"g-col-3",children:"User"}),e.jsx(A,{className:"g-col-7",children:"Message"})]})}),t&&t.length>0&&e.jsx(rl,{rows:n,rowRender:a=>e.jsxs(e.Fragment,{children:[a.isRoomInfo&&e.jsx(r,{roomId:a.roomId,roomName:a.roomName}),!a.isRoomInfo&&e.jsxs(ne,{fullHeight:!1,gap:1,alignItems:"center",className:"log-entry py-1 border-bottom",children:[e.jsx(v,{className:"g-col-2",children:a.timestamp}),e.jsx(v,{className:"g-col-3",bold:!0,underline:!0,pointer:!0,onClick:l=>Z(`mod-tools/open-user-info/${a.habboId}`),children:a.username}),e.jsx(v,{textBreak:!0,wrap:!0,className:"g-col-7",children:a.message})]})]})})]})})},ay=o=>{const{roomId:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(null);return U(Ob,a=>{const l=a.getParser();!l||l.data.roomId!==t||r(l.data)}),i.useEffect(()=>{D(new kb(t))},[t]),n?e.jsxs(ae,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:`Room Chatlog ${n.roomName}`,onCloseClick:s}),e.jsx(se,{className:"text-black",overflow:"hidden",children:n&&e.jsx($c,{records:[n]})})]}):null},iy=o=>{const{roomId:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(!1),[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState(null),[g,f]=i.useState(null),[p,x]=i.useState(!1),[I,j]=i.useState(0),[E,C]=i.useState(!1),[b,S]=i.useState(!1),[_,T]=i.useState(!1),[P,k]=i.useState(""),R=(y,O)=>{if(y)switch(y){case"alert_only":if(P.trim().length===0)return;D(new Si(Si.ACTION_ALERT,P,"")),D(new ju(t,b?1:0,_?1:0,E?1:0));return;case"send_message":if(P.trim().length===0)return;D(new Si(Si.ACTION_MESSAGE,P,"")),D(new ju(t,b?1:0,_?1:0,E?1:0));return}};return U(Ab,y=>{const O=y.getParser();!O||O.data.flatId!==t||(l(O.data.flatId),m(O.data.room.name),u(O.data.ownerId),f(O.data.ownerName),x(O.data.ownerInRoom),j(O.data.userCount))}),i.useEffect(()=>{n||(D(new Db(t)),r(!0))},[t,n,r]),e.jsxs(ae,{className:"nitro-mod-tools-room",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:"Room Info"+(c?": "+c:""),onCloseClick:y=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(w,{gap:2,children:[e.jsxs(N,{justifyContent:"center",grow:!0,gap:1,children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(v,{bold:!0,align:"end",className:"col-7",children:"Room Owner:"}),e.jsx(v,{underline:!0,pointer:!0,truncate:!0,children:g})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(v,{bold:!0,align:"end",className:"col-7",children:"Users in room:"}),e.jsx(v,{children:I})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(v,{bold:!0,align:"end",className:"col-7",children:"Owner in room:"}),e.jsx(v,{children:p?"Yes":"No"})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(L,{onClick:y=>os(t),children:"Visit Room"}),e.jsx(L,{onClick:y=>Z(`mod-tools/open-room-chatlog/${t}`),children:"Chatlog"})]})]}),e.jsxs(N,{className:"bg-muted rounded p-2",gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:E,onChange:y=>C(y.target.checked)}),e.jsx(v,{small:!0,children:"Kick everyone out"})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:b,onChange:y=>S(y.target.checked)}),e.jsx(v,{small:!0,children:"Enable the doorbell"})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:_,onChange:y=>T(y.target.checked)}),e.jsx(v,{small:!0,children:"Change room name"})]})]}),e.jsx("textarea",{className:"form-control",placeholder:"Type a mandatory message to the users in this text box...",value:P,onChange:y=>k(y.target.value)}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(L,{variant:"danger",onClick:y=>R("send_message"),children:"Send Caution"}),e.jsx(L,{onClick:y=>R("alert_only"),children:"Send Alert only"})]})]})]})},oy=o=>{const{onCloseClick:t=null,issueId:s=null}=o,[n,r]=i.useState(null);return U(Pb,a=>{const l=a.getParser();!l||l.data.issueId!==s||r(l.data)}),i.useEffect(()=>{D(new Lb(s))},[s]),e.jsxs(ae,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",children:[e.jsx(re,{headerText:"Issue Chatlog",onCloseClick:t}),e.jsx(se,{className:"text-black",children:n&&e.jsx($c,{records:[n.chatRecord]})})]})},ly=o=>{const{issueId:t=null,onIssueInfoClosed:s=null}=o,[n,r]=i.useState(!1),{tickets:a=[],openUserInfo:l=null}=xa(),c=a.find(u=>u.issueId===t),m=u=>{D(new Vm([u])),s(u)},h=u=>{D(new wi([t],u)),s(t)};return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:"nitro-mod-tools-handle-issue",theme:"primary-slim",children:[e.jsx(re,{headerText:"Resolving issue "+t,onCloseClick:()=>s(t)}),e.jsxs(se,{className:"text-black",children:[e.jsx(v,{fontSize:4,children:"Issue Information"}),e.jsxs(ne,{overflow:"auto",children:[e.jsx(N,{size:8,children:e.jsx("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{children:"Source"}),e.jsx("td",{children:jv(c.categoryId)})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Category"}),e.jsx("td",{className:"text-break",children:d("help.cfh.topic."+c.reportedCategoryId)})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Description"}),e.jsx("td",{className:"text-break",children:c.message})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Caller"}),e.jsx("td",{children:e.jsx(v,{bold:!0,underline:!0,pointer:!0,onClick:u=>l(c.reporterUserId),children:c.reporterUserName})})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Reported User"}),e.jsx("td",{children:e.jsx(v,{bold:!0,underline:!0,pointer:!0,onClick:u=>l(c.reportedUserId),children:c.reportedUserName})})]})]})})}),e.jsxs(N,{size:4,gap:1,children:[e.jsx(L,{variant:"secondary",onClick:()=>r(!n),children:"Chatlog"}),e.jsx(L,{onClick:u=>h(wi.RESOLUTION_USELESS),children:"Close as useless"}),e.jsx(L,{variant:"danger",onClick:u=>h(wi.RESOLUTION_ABUSIVE),children:"Close as abusive"}),e.jsx(L,{variant:"success",onClick:u=>h(wi.RESOLUTION_RESOLVED),children:"Close as resolved"}),e.jsx(L,{variant:"secondary",onClick:u=>m(t),children:"Release"})]})]})]})]}),n&&e.jsx(oy,{issueId:t,onCloseClick:()=>r(!1)})]})},cy=o=>{const{myIssues:t=null,handleIssue:s=null}=o;return e.jsxs(N,{gap:0,overflow:"hidden",children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-3",children:"Opened"}),e.jsx(A,{className:"g-col-2"}),e.jsx(A,{className:"g-col-2"})]})}),e.jsx(N,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(n=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:n.categoryId}),e.jsx(A,{className:"g-col-3",children:n.reportedUserName}),e.jsx(A,{className:"g-col-3",children:new Date(Date.now()-n.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-2",children:e.jsx(L,{variant:"primary",onClick:r=>s(n.issueId),children:"Handle"})}),e.jsx(A,{className:"g-col-2",children:e.jsx(L,{variant:"danger",onClick:r=>D(new Vm([n.issueId])),children:"Release"})})]},n.issueId))})]})},uy=o=>{const{openIssues:t=null}=o;return e.jsxs(N,{gap:0,overflow:"hidden",children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-4",children:"Opened"}),e.jsx(A,{className:"g-col-3"})]})}),e.jsx(N,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(s=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:s.categoryId}),e.jsx(A,{className:"g-col-3",children:s.reportedUserName}),e.jsx(A,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-3",children:e.jsx(L,{variant:"success",onClick:n=>D(new Mb([s.issueId],!1,0,"pick issue button")),children:"Pick Issue"})})]},s.issueId))})]})},dy=o=>{const{pickedIssues:t=null}=o;return e.jsxs(N,{gap:0,overflow:"hidden",children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-4",children:"Opened"}),e.jsx(A,{className:"g-col-3",children:"Picker"})]})}),e.jsx(N,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(s=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:s.categoryId}),e.jsx(A,{className:"g-col-3",children:s.reportedUserName}),e.jsx(A,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-3",children:s.pickerUserName})]},s.issueId))})]})},my=["Open Issues","My Issues","Picked Issues"],hy=o=>{const{onCloseClick:t=null}=o,[s,n]=i.useState(0),[r,a]=i.useState([]),{tickets:l=[]}=xa(),c=l.filter(p=>p.state===bl.STATE_OPEN),m=l.filter(p=>p.state===bl.STATE_PICKED&&p.pickerUserId===G().userId),h=l.filter(p=>p.state===bl.STATE_PICKED),u=p=>{a(x=>{const I=[...x],j=I.indexOf(p);return j>=0&&I.splice(j,1),I})},g=p=>{a(x=>{const I=[...x],j=I.indexOf(p);return j===-1?I.push(p):I.splice(j,1),I})},f=()=>{switch(s){case 0:return e.jsx(uy,{openIssues:c});case 1:return e.jsx(cy,{myIssues:m,handleIssue:g});case 2:return e.jsx(dy,{pickedIssues:h})}return null};return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:"nitro-mod-tools-tickets",children:[e.jsx(re,{headerText:"Tickets",onCloseClick:t}),e.jsx(yn,{children:my.map((p,x)=>e.jsx(sn,{isActive:s===x,onClick:I=>n(x),children:p},x))}),e.jsx(se,{gap:1,children:e.jsx(f,{})})]}),r&&r.length>0&&r.map(p=>e.jsx(ly,{issueId:p,onIssueInfoClosed:u},p))]})},gy=o=>{const{userId:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(null),[a,l]=i.useState(null);return U(Ub,c=>{const m=c.getParser();!m||m.data.userId!==t||(l(m.data.username),r(m.data.roomChatlogs))}),i.useEffect(()=>{D(new Fb(t))},[t]),e.jsxs(ae,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:`User Chatlog: ${a||""}`,onCloseClick:s}),e.jsx(se,{className:"text-black h-100",children:n&&e.jsx($c,{records:n})})]})},xd=[new Ge(1,"Alert",Ge.ALERT,1,0),new Ge(2,"Mute 1h",Ge.MUTE,2,0),new Ge(3,"Ban 18h",Ge.BAN,3,0),new Ge(4,"Ban 7 days",Ge.BAN,4,0),new Ge(5,"Ban 30 days (step 1)",Ge.BAN,5,0),new Ge(7,"Ban 30 days (step 2)",Ge.BAN,7,0),new Ge(6,"Ban 100 years",Ge.BAN,6,0),new Ge(106,"Ban avatar-only 100 years",Ge.BAN,6,0),new Ge(101,"Kick",Ge.KICK,0,0),new Ge(102,"Lock trade 1 week",Ge.TRADE_LOCK,0,168),new Ge(104,"Lock trade permanent",Ge.TRADE_LOCK,0,876e3),new Ge(105,"Message",Ge.MESSAGE,0,0)],fy=o=>{const{user:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(-1),[a,l]=i.useState(-1),[c,m]=i.useState(""),{cfhCategories:h=null,settings:u=null}=xa(),{simpleAlert:g=null}=Fe(),f=i.useMemo(()=>{const j=[];if(h&&h.length)for(const E of h)for(const C of E.topics)j.push(C);return j},[h]),p=j=>g(j,je.DEFAULT,null,null,"Error"),x=()=>{let j=null;const E=f[n];if(n===-1&&(j="You must select a CFH topic"),j)return p(j);const C=c.trim().length===0?d(`help.cfh.topic.${E.id}`):c;D(new Vb(t.userId,n,C)),s()},I=()=>{let j=null;const E=f[n],C=xd[a];if(n===-1||a===-1?j="You must select a CFH topic and Sanction":!u||!u.cfhPermission?j="You do not have permission to do this":E?C||(j="You must select a sanction"):j="You must select a CFH topic",j){p(j);return}const b=c.trim().length===0?d(`help.cfh.topic.${E.id}`):c;switch(C.actionType){case Ge.ALERT:{if(!u.alertPermission){p("You have insufficient permissions");return}D(new qb(t.userId,b,E.id));break}case Ge.MUTE:D(new Wb(t.userId,b,E.id));break;case Ge.BAN:{if(!u.banPermission){p("You have insufficient permissions");return}D(new Hb(t.userId,b,E.id,a,C.actionId===106));break}case Ge.KICK:{if(!u.kickPermission){p("You have insufficient permissions");return}D(new Bb(t.userId,b,E.id));break}case Ge.TRADE_LOCK:{const S=C.actionLengthHours*60;D(new Gb(t.userId,b,S,E.id));break}case Ge.MESSAGE:{if(c.trim().length===0){p("Please write a message to user");return}D(new Gm(t.userId,c,E.id));break}}s()};return t?e.jsxs(ae,{className:"nitro-mod-tools-user-action",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:"Mod Action: "+(t?t.username:""),onCloseClick:()=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs("select",{className:"form-select form-select-sm",value:n,onChange:j=>r(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:"CFH Topic"}),f.map((j,E)=>e.jsx("option",{value:E,children:d("help.cfh.topic."+j.id)},E))]}),e.jsxs("select",{className:"form-select form-select-sm",value:a,onChange:j=>l(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:"Sanction Type"}),xd.map((j,E)=>e.jsx("option",{value:E,children:j.name},E))]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{small:!0,children:"Optional message type, overrides default"}),e.jsx("textarea",{className:"form-control",value:c,onChange:j=>m(j.target.value)})]}),e.jsxs(w,{justifyContent:"between",gap:1,children:[e.jsx(L,{variant:"primary",onClick:x,children:"Default Sanction"}),e.jsx(L,{variant:"success",onClick:I,children:"Sanction"})]})]})]}):null},py=o=>{const{userId:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(null);return U(zb,a=>{const l=a.getParser();l.data.userId===t&&r(l.data)}),i.useEffect(()=>{D(new Yb(t))},[t]),t?e.jsxs(ae,{className:"nitro-mod-tools-user-visits",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:"User Visits",onCloseClick:s}),e.jsx(se,{className:"text-black",gap:1,children:e.jsxs(N,{fullHeight:!0,gap:0,overflow:"hidden",children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Time"}),e.jsx(A,{className:"g-col-7",children:"Room name"}),e.jsx(A,{className:"g-col-3",children:"Visit"})]})}),e.jsx(rl,{rows:(n==null?void 0:n.rooms)??[],rowRender:a=>e.jsxs(ne,{fullHeight:!1,gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsxs(v,{className:"g-col-2",children:[a.enterHour.toString().padStart(2,"0"),": ",a.enterMinute.toString().padStart(2,"0")]}),e.jsx(v,{className:"g-col-7",children:a.roomName}),e.jsx(v,{bold:!0,underline:!0,pointer:!0,variant:"primary",className:"g-col-3",onClick:l=>os(a.roomId),children:"Visit Room"})]})})]})})]}):null},xy=o=>{const{user:t=null,onCloseClick:s=null}=o,[n,r]=i.useState(""),{simpleAlert:a=null}=Fe();if(!t)return null;const l=()=>{if(n.trim().length===0){a("Please write a message to user.",null,null,null,"Error",null);return}D(new Gm(t.userId,n,-999)),s()};return e.jsxs(ae,{className:"nitro-mod-tools-user-message",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:"Send Message",onCloseClick:()=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(v,{children:["Message To: ",t.username]}),e.jsx("textarea",{className:"form-control",value:n,onChange:c=>r(c.target.value)}),e.jsx(L,{fullWidth:!0,onClick:l,children:"Send message"})]})]})},jy=o=>{const{onCloseClick:t=null,userId:s=null}=o,[n,r]=i.useState(null),[a,l]=i.useState(!1),[c,m]=i.useState(!1),[h,u]=i.useState(!1),g=i.useMemo(()=>n?[{localeKey:"modtools.userinfo.userName",value:n.userName,showOnline:!0},{localeKey:"modtools.userinfo.cfhCount",value:n.cfhCount.toString()},{localeKey:"modtools.userinfo.abusiveCfhCount",value:n.abusiveCfhCount.toString()},{localeKey:"modtools.userinfo.cautionCount",value:n.cautionCount.toString()},{localeKey:"modtools.userinfo.banCount",value:n.banCount.toString()},{localeKey:"modtools.userinfo.lastSanctionTime",value:n.lastSanctionTime},{localeKey:"modtools.userinfo.tradingLockCount",value:n.tradingLockCount.toString()},{localeKey:"modtools.userinfo.tradingExpiryDate",value:n.tradingExpiryDate},{localeKey:"modtools.userinfo.minutesSinceLastLogin",value:en.format(n.minutesSinceLastLogin*60,".ago",2)},{localeKey:"modtools.userinfo.lastPurchaseDate",value:n.lastPurchaseDate},{localeKey:"modtools.userinfo.primaryEmailAddress",value:n.primaryEmailAddress},{localeKey:"modtools.userinfo.identityRelatedBanCount",value:n.identityRelatedBanCount.toString()},{localeKey:"modtools.userinfo.registrationAgeInMinutes",value:en.format(n.registrationAgeInMinutes*60,".ago",2)},{localeKey:"modtools.userinfo.userClassification",value:n.userClassification}]:null,[n]);return U($b,f=>{const p=f.getParser();!p||p.data.userId!==s||r(p.data)}),i.useEffect(()=>{D(new Kb(s))},[s]),n?e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:"nitro-mod-tools-user",theme:"primary-slim",windowPosition:Ot.TOP_LEFT,children:[e.jsx(re,{headerText:d("modtools.userinfo.title",["username"],[n.userName]),onCloseClick:()=>t()}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{overflow:"hidden",children:[e.jsx(N,{size:8,overflow:"auto",children:e.jsx("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:e.jsx("tbody",{children:g.map((f,p)=>e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:d(f.localeKey)}),e.jsxs("td",{children:[f.value,f.showOnline&&e.jsx("i",{className:`icon icon-pf-${n.online?"online":"offline"} ms-2`})]})]},p))})})}),e.jsxs(N,{size:4,gap:1,children:[e.jsx(L,{onClick:f=>Z(`mod-tools/open-user-chatlog/${s}`),children:"Room Chat"}),e.jsx(L,{onClick:f=>l(!a),children:"Send Message"}),e.jsx(L,{onClick:f=>u(!h),children:"Room Visits"}),e.jsx(L,{onClick:f=>m(!c),children:"Mod Action"})]})]})})]}),a&&e.jsx(xy,{user:{userId:s,username:n.userName},onCloseClick:()=>l(!1)}),c&&e.jsx(fy,{user:{userId:s,username:n.userName},onCloseClick:()=>m(!1)}),h&&e.jsx(py,{userId:s,onCloseClick:()=>u(!1)})]}):null},Iy=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(-1),[a,l]=i.useState(null),[c,m]=i.useState(!1),{openRooms:h=[],openRoomChatlogs:u=[],openUserChatlogs:g=[],openUserInfos:f=[],openRoomInfo:p=null,closeRoomInfo:x=null,toggleRoomInfo:I=null,openRoomChatlog:j=null,closeRoomChatlog:E=null,toggleRoomChatlog:C=null,openUserInfo:b=null,closeUserInfo:S=null,toggleUserInfo:_=null,openUserChatlog:T=null,closeUserChatlog:P=null,toggleUserChatlog:k=null}=xa(),R=i.useRef(null);return we([ys.INITIALIZED,ys.DISPOSED],y=>{if(!Cr.isRoomPreviewerId(y.roomId))switch(y.type){case ys.INITIALIZED:r(y.roomId);return;case ys.DISPOSED:r(-1);return}}),Gc(y=>{if(y.category!==Q.UNIT)return;const O=Oe();if(!O)return;const F=O.userDataManager.getUserDataByIndex(y.id);!F||F.type!==gt.USER||l({userId:F.webID,username:F.name})}),i.useEffect(()=>{const y={linkReceived:O=>{const F=O.split("/");if(!(F.length<2))switch(F[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(V=>!V);return;case"open-room-info":p(Number(F[2]));return;case"close-room-info":x(Number(F[2]));return;case"toggle-room-info":I(Number(F[2]));return;case"open-room-chatlog":j(Number(F[2]));return;case"close-room-chatlog":E(Number(F[2]));return;case"toggle-room-chatlog":C(Number(F[2]));return;case"open-user-info":b(Number(F[2]));return;case"close-user-info":S(Number(F[2]));return;case"toggle-user-info":_(Number(F[2]));return;case"open-user-chatlog":T(Number(F[2]));return;case"close-user-chatlog":P(Number(F[2]));return;case"toggle-user-chatlog":k(Number(F[2]));return}},eventUrlPrefix:"mod-tools/"};return ft(y),()=>pt(y)},[p,x,I,j,E,C,b,S,_,T,P,k]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ae,{uniqueKey:"mod-tools",className:"nitro-mod-tools",windowPosition:Ot.TOP_LEFT,theme:"primary-slim",children:[e.jsx(re,{headerText:"Mod Tools",onCloseClick:y=>s(!1)}),e.jsxs(se,{className:"text-black",gap:1,children:[e.jsxs(L,{gap:1,onClick:y=>Z(`mod-tools/toggle-room-info/${n}`),disabled:n<=0,className:"position-relative",children:[e.jsx(A,{className:"icon icon-small-room position-absolute start-1"})," Room Tool"]}),e.jsxs(L,{innerRef:R,gap:1,onClick:y=>Z(`mod-tools/toggle-room-chatlog/${n}`),disabled:n<=0,className:"position-relative",children:[e.jsx(A,{className:"icon icon-chat-history position-absolute start-1"})," Chatlog Tool"]}),e.jsxs(L,{gap:1,onClick:()=>Z(`mod-tools/toggle-user-info/${a.userId}`),disabled:!a,className:"position-relative",children:[e.jsx(A,{className:"icon icon-user position-absolute start-1"})," User: ",a?a.username:""]}),e.jsxs(L,{gap:1,onClick:()=>m(y=>!y),className:"position-relative",children:[e.jsx(A,{className:"icon icon-tickets position-absolute start-1"})," Report Tool"]})]})]}),h.length>0&&h.map(y=>e.jsx(iy,{roomId:y,onCloseClick:()=>Z(`mod-tools/close-room-info/${y}`)},y)),u.length>0&&u.map(y=>e.jsx(ay,{roomId:y,onCloseClick:()=>Z(`mod-tools/close-room-chatlog/${y}`)},y)),f.length>0&&f.map(y=>e.jsx(jy,{userId:y,onCloseClick:()=>Z(`mod-tools/close-user-info/${y}`)},y)),g.length>0&&g.map(y=>e.jsx(gy,{userId:y,onCloseClick:()=>Z(`mod-tools/close-user-chatlog/${y}`)},y)),c&&e.jsx(hy,{onCloseClick:()=>m(!1)})]})},by=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER,We.START_PASSWORD,We.STATE_WRONG_PASSWORD],Ey=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER],Cy=o=>{const[t,s]=i.useState(""),{doorData:n=null,setDoorData:r=null}=qs(),a=()=>{n&&n.state===We.STATE_WAITING&&Jl(),r(null)},l=()=>{!n||!n.roomInfo||(vr(n.roomInfo.roomId),r(h=>{const u={...h};return u.state=We.STATE_PENDING_SERVER,u}))},c=()=>{!n||!n.roomInfo||(vr(n.roomInfo.roomId,t),r(h=>{const u={...h};return u.state=We.STATE_PENDING_SERVER,u}))};if(i.useEffect(()=>{!n||n.state!==We.STATE_NO_ANSWER||Jl()},[n]),!n||n.state===We.NONE||by.indexOf(n.state)===-1)return null;const m=Ey.indexOf(n.state)>=0;return e.jsxs(ae,{className:"nitro-navigator-doorbell",theme:"primary",children:[e.jsx(re,{headerText:d(m?"navigator.doorbell.title":"navigator.password.title"),onCloseClick:a}),e.jsxs(se,{className:"px-3 pb-4",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{small:!0,bold:!0,children:n&&n.roomInfo&&n.roomInfo.roomName}),n.state===We.START_DOORBELL&&e.jsx(v,{small:!0,children:d("navigator.doorbell.info")}),n.state===We.STATE_WAITING&&e.jsx(v,{small:!0,children:d("navigator.doorbell.waiting")}),n.state===We.STATE_NO_ANSWER&&e.jsx(v,{small:!0,children:d("navigator.doorbell.no.answer")}),n.state===We.START_PASSWORD&&e.jsx(v,{small:!0,children:d("navigator.password.info")}),n.state===We.STATE_WRONG_PASSWORD&&e.jsx(v,{small:!0,children:d("navigator.password.retryinfo")})]}),m&&e.jsxs(w,{fullWidth:!0,gap:1,className:"align-items-end mt-auto pt-3",children:[e.jsx(v,{small:!0,className:"cursor-pointer",underline:!0,onClick:a,children:d("generic.cancel")}),n.state===We.START_DOORBELL&&e.jsx(L,{className:"ms-auto",onClick:l,children:d("navigator.doorbell.button.ring")})]}),!m&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"pt-3 align-items-center",gap:1,children:[e.jsx(v,{small:!0,fullWidth:!0,children:d("navigator.password.enter")}),e.jsx("input",{type:"password",className:"form-control form-control-sm",onChange:h=>s(h.target.value)})]}),e.jsxs(w,{fullWidth:!0,gap:1,className:"align-items-end mt-auto pt-3",children:[e.jsx(v,{small:!0,className:"cursor-pointer",underline:!0,onClick:a,children:d("generic.cancel")}),e.jsx(L,{className:"ms-auto",onClick:c,children:d("navigator.password.button.try")})]})]})]})]})},vy=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(null),[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState(null),[g,f]=i.useState(0),[p,x]=i.useState([]),[I,j]=i.useState(""),{categories:E=null}=qs(),C=K("hc.disabled",!1),b=T=>K("images.url")+`/navigator/models/model_${T}.png`,S=(T,P)=>{if(T){if(Cs()<T.clubLevel)return Z("habboUI/open/hccenter");j(p[P].name)}},_=()=>{!n||n.length<3||D(new Xb(n,a,"model_"+I,Number(c),Number(h),g))};return i.useEffect(()=>{if(!t){const T=[];for(let P=10;P<=100;P=P+10)T.push(P);s(T),u(T[0])}},[t]),i.useEffect(()=>{E&&E.length&&m(E[0].id)},[E]),i.useEffect(()=>{const T=K("navigator.room.models");T&&T.length&&(x(T),j(T[0].name))},[]),e.jsxs(ae,{className:"nitro-room-creator",theme:"primary",children:[e.jsx(re,{headerText:d("navigator.createroom.title"),onCloseClick:T=>Z("navigator/close-creator")}),e.jsx(se,{children:e.jsx(N,{overflow:"hidden",children:e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(N,{size:5,gap:1,overflow:"auto",className:"px-2 py-1",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("navigator.createroom.roomnameinfo")}),e.jsx("input",{type:"text",className:`room-creator-form ${!n||n.length<3?"input-error":""}`,maxLength:60,onChange:T=>r(T.target.value),placeholder:d("navigator.createroom.roomnameinfo")}),(!n||n.length<3)&&e.jsx(Lv,{text:d("navigator.createroom.nameerr")})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{children:d("navigator.createroom.roomdescinfo")}),e.jsx("textarea",{className:"flex-grow-1 room-creator-form",maxLength:255,onChange:T=>l(T.target.value),placeholder:d("navigator.createroom.roomdescinfo")})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",onChange:T=>m(Number(T.target.value)),children:E&&E.length>0&&E.map(T=>e.jsx("option",{value:T.id,children:d(T.name)},T.id))})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("navigator.maxvisitors")}),e.jsx("select",{className:"form-select form-select-sm",onChange:T=>u(Number(T.target.value)),children:t&&t.map(T=>e.jsx("option",{value:T,children:T},T))})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("navigator.tradesettings")}),e.jsxs("select",{className:"form-select form-select-sm",onChange:T=>f(Number(T.target.value)),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.trade_not_allowed")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.trade_not_with_Controller")}),e.jsx("option",{value:"2",children:d("navigator.roomsettings.trade_allowed")})]})]}),e.jsxs(w,{gap:2,children:[e.jsx(L,{fullWidth:!0,className:"volter-bold-button text-black",onClick:_,children:d("navigator.createroom.create")}),e.jsx(L,{fullWidth:!0,className:"volter-button text-black",onClick:T=>Z("navigator/close-creator"),children:d("cancel")})]})]}),e.jsx(N,{size:7,gap:1,overflow:"auto",children:e.jsx(Pe,{className:"room-creator-grid",gap:1,columnCount:2,columnMinWidth:100,columnMinHeight:50,overflow:"unset",children:p.map((T,P)=>e.jsxs(Fv,{fullHeight:!0,onClick:()=>S(T,P),itemActive:I===T.name,overflow:"unset",gap:0,className:"py-3",children:[e.jsx(w,{fullHeight:!0,center:!0,overflow:"hidden",children:e.jsx("img",{alt:"",src:b(T.name)})}),e.jsxs(v,{position:"absolute",className:"bottom-1 start-1",children:[e.jsx(A,{className:`icon ${I===T.name?"icon-tiles_room_selected":"icon-tiles"}`})," ",T.tileSize," ",d("navigator.createroom.tilesize")]}),!C&&T.clubLevel>Wt.NO_CLUB&&e.jsx(A,{className:"icon icon-hc_mini position-absolute top-1 end-1"}),I&&e.jsx("i",{className:"active-arrow"})]},T.name))})})]})})})]})},Ny=o=>{const{onCloseClick:t=null}=o,[s,n]=i.useState(!1),[r,a]=i.useState(!1),{report:l=null}=Ws(),{navigatorData:c=null}=qs(),{roomSession:m=null}=ke(),h=g=>{switch(g){case"settings":return G().userId===c.enteredGuestRoom.ownerId||G().isModerator;case"staff_pick":return G().securityLevel>=ao.COMMUNITY;case"floor":return(m==null?void 0:m.controllerLevel)>=Ke.GUEST;case"guest":return(m==null?void 0:m.controllerLevel)===Ke.GUEST;default:return!1}},u=(g,f)=>{if(!(!c||!c.enteredGuestRoom))switch(g){case"set_home_room":let p=0;c.homeRoomId!==c.enteredGuestRoom.roomId&&(p=c.enteredGuestRoom.roomId),D(new tE(p));return;case"navigator_search_tag":Z(`navigator/search/${f}`),D(new yr("hotel_view",`tag:${f}`));return;case"open_room_thumbnail_camera":Nt(new fn(fn.TOGGLE_THUMBNAIL));return;case"open_group_info":di(c.enteredGuestRoom.habboGroupId);return;case"toggle_room_link":Z("navigator/toggle-room-link");return;case"open_room_settings":D(new Am(c.enteredGuestRoom.roomId));return;case"toggle_pick":n(x=>!x),D(new eE(c.enteredGuestRoom.roomId));return;case"toggle_mute":a(x=>!x),D(new Zb);return;case"room_filter":D(new Jb(c.enteredGuestRoom.roomId));return;case"open_floorplan_editor":Z("floor-editor/toggle");return;case"report_room":l(rt.ROOM,{roomId:c.enteredGuestRoom.roomId,roomName:c.enteredGuestRoom.roomName});return;case"remove_rights":D(new Qb(c.enteredGuestRoom.roomId));return;case"close":t();return}};return i.useEffect(()=>{c&&(n(c.currentRoomIsStaffPick),c.enteredGuestRoom&&a(c.enteredGuestRoom.allInRoomMuted))},[c]),c.enteredGuestRoom?e.jsxs(ae,{className:"nitro-room-info",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.roomsettings.roominfo"),onCloseClick:()=>u("close")}),e.jsx(se,{className:"text-black",children:c.enteredGuestRoom&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsxs(w,{column:!0,gap:2,overflow:"hidden",shrink:!0,style:{maxWidth:"110px"},children:[e.jsx(el,{roomId:c.enteredGuestRoom.roomId,customUrl:c.enteredGuestRoom.officialRoomPicRef,children:h("settings")&&e.jsx("i",{className:"top-0 m-1 cursor-pointer icon icon-camera-small position-absolute b-0 r-0",onClick:()=>u("open_room_thumbnail_camera")})}),c.enteredGuestRoom.tags.length>0&&e.jsx(w,{column:!0,gap:1,children:c.enteredGuestRoom.tags.map((g,f)=>e.jsxs(v,{pointer:!0,className:"w-full p-1 rounded bg-muted",truncate:!0,onClick:p=>u("navigator_search_tag",g),children:["#",g]},"tag-"+f))})]}),e.jsxs(N,{grow:!0,gap:1,overflow:"hidden",children:[e.jsxs(w,{gap:1,children:[e.jsxs(N,{grow:!0,gap:1,overflow:"hidden",children:[e.jsx(v,{bold:!0,truncate:!0,children:c.enteredGuestRoom.roomName}),c.enteredGuestRoom.showOwner&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"muted",children:d("navigator.roomownercaption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:c.enteredGuestRoom.ownerId}),e.jsx(v,{children:c.enteredGuestRoom.ownerName})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"muted",children:d("navigator.roomrating")}),e.jsx(v,{children:c.currentRoomRating})]})]}),e.jsx(N,{children:e.jsxs(w,{column:!0,alignItems:"center",gap:1,className:"p-1 rounded bg-muted",children:[e.jsx("i",{onClick:()=>u("set_home_room"),className:$t("flex-shrink-0 icon icon-house-small cursor-pointer",c.homeRoomId!==c.enteredGuestRoom.roomId&&"gray")}),h("settings")&&e.jsx("i",{className:"cursor-pointer icon icon-cog",title:d("navigator.room.popup.info.room.settings"),onClick:g=>u("open_room_settings")}),e.jsx("i",{title:d("navigator.embed.caption"),className:"cursor-pointer icon icon-navigator-link",onClick:g=>Z("navigator/toggle-room-link")}),h("guest")&&e.jsx(gg,{title:d("navigator.roominfo.removerights.tooltip"),className:"cursor-pointer fa-icon",onClick:g=>u("remove_rights")})]})})]}),e.jsxs(v,{variant:"muted",children:[d("navigator.roomsettings.desc"),": "]}),e.jsx(v,{small:!0,overflow:"auto",style:{maxWidth:250,maxHeight:50},children:c.enteredGuestRoom.description}),c.enteredGuestRoom.habboGroupId>0&&e.jsxs(w,{pointer:!0,alignItems:"center",gap:1,onClick:()=>u("open_group_info"),children:[e.jsx(Xe,{className:"flex-none",badgeCode:c.enteredGuestRoom.groupBadgeCode,isGroup:!0}),e.jsx(v,{underline:!0,children:d("navigator.guildbase",["groupName"],[c.enteredGuestRoom.groupName])})]})]})]}),e.jsxs(N,{gap:1,children:[h("staff_pick")&&e.jsx(L,{onClick:()=>u("toggle_pick"),children:d(s?"navigator.staffpicks.unpick":"navigator.staffpicks.pick")}),h("settings")&&e.jsxs(e.Fragment,{children:[e.jsx(L,{onClick:()=>u("toggle_mute"),children:d(r?"navigator.muteall_on":"navigator.muteall_off")}),e.jsx(L,{onClick:()=>u("room_filter"),children:d("navigator.roomsettings.roomfilter")})]}),h("floor")&&e.jsx(L,{onClick:()=>u("open_floorplan_editor"),children:d("open.floor.plan.editor")}),e.jsx(L,{variant:"danger",onClick:()=>u("report_room"),children:d("help.emergency.main.report.room")})]})]})})]}):null},_y=o=>{const{onCloseClick:t=null}=o,{navigatorData:s=null}=qs();return s.enteredGuestRoom?e.jsxs(ae,{className:"nitro-room-link no-resize",theme:"primary",children:[e.jsx(re,{headerText:d("navigator.embed.title"),onCloseClick:t}),e.jsx(se,{className:"text-black d-flex align-items-center",children:e.jsxs(w,{gap:2,children:[e.jsx(el,{roomId:s.enteredGuestRoom.roomId,customUrl:s.enteredGuestRoom.officialRoomPicRef}),e.jsxs(N,{children:[e.jsx(v,{bold:!0,fontSize:5,children:d("navigator.embed.headline")}),e.jsx(v,{children:d("navigator.embed.info")}),e.jsxs(v,{children:[" ",d("navigator.embed.direct.info")]}),e.jsx("input",{type:"text",readOnly:!0,className:"form-control form-control-sm",value:d("navigator.embed.src",["roomId"],[s.enteredGuestRoom.roomId.toString()]).replace("${url.prefix}",K("url.prefix",""))})]})]})})]}):null},Sy=o=>{const{roomData:t=null,handleChange:s=null}=o,[n,r]=i.useState(""),[a,l]=i.useState(""),[c,m]=i.useState(!1),h=()=>{!c||n.length<=0||a.length<=0||n!==a||s("password",n)};return i.useEffect(()=>{r(""),l(""),m(!1)},[t]),e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.roomaccess.caption")}),e.jsx(v,{children:d("navigator.roomsettings.roomaccess.info")})]}),e.jsxs(N,{overflow:"auto",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.doormode")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===nt.OPEN_STATE&&!c,onChange:u=>s("lock_state",nt.OPEN_STATE)}),e.jsx(v,{children:d("navigator.roomsettings.doormode.open")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===nt.DOORBELL_STATE&&!c,onChange:u=>s("lock_state",nt.DOORBELL_STATE)}),e.jsx(v,{children:d("navigator.roomsettings.doormode.doorbell")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===nt.INVISIBLE_STATE&&!c,onChange:u=>s("lock_state",nt.INVISIBLE_STATE)}),e.jsx(v,{children:d("navigator.roomsettings.doormode.invisible")})]}),e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===nt.PASSWORD_STATE||c,onChange:u=>m(u.target.checked)}),!c&&t.lockState!==nt.PASSWORD_STATE&&e.jsx(v,{children:d("navigator.roomsettings.doormode.password")}),(c||t.lockState===nt.PASSWORD_STATE)&&e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("navigator.roomsettings.doormode.password")}),e.jsx("input",{type:"password",className:"form-control form-control-sm col-4",value:n,onChange:u=>r(u.target.value),placeholder:d("navigator.roomsettings.password"),onFocus:u=>m(!0)}),c&&n.length<=0&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.passwordismandatory")}),e.jsx("input",{type:"password",className:"form-control form-control-sm col-4",value:a,onChange:u=>l(u.target.value),onBlur:h,placeholder:d("navigator.roomsettings.passwordconfirm")}),c&&n.length>0&&n!==a&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.invalidconfirm")})]})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.pets")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowPets,onChange:u=>s("allow_pets",u.target.checked)}),e.jsx(v,{children:d("navigator.roomsettings.allowpets")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowPetsEat,onChange:u=>s("allow_pets_eat",u.target.checked)}),e.jsx(v,{children:d("navigator.roomsettings.allowfoodconsume")})]})]})]})]})},jd=3,Id=60,bd=255,qi=15,wy=o=>{const{roomData:t=null,handleChange:s=null,onClose:n=null}=o,[r,a]=i.useState(""),[l,c]=i.useState(""),[m,h]=i.useState(""),[u,g]=i.useState(""),[f,p]=i.useState(0),[x,I]=i.useState(""),{showConfirm:j=null}=Fe(),{categories:E=null}=qs();U(sE,T=>{const P=T.getParser();if(P)switch(P.code){case Iu.ERROR_INVALID_TAG:I("navigator.roomsettings.unacceptablewords");case Iu.ERROR_NON_USER_CHOOSABLE_TAG:I("navigator.roomsettings.nonuserchoosabletag");break;default:I("");break}});const C=()=>{j(d("navigator.roomsettings.deleteroom.confirm.message",["room_name"],[t.roomName]),()=>{D(new nE(t.roomId)),n&&n(),Z("navigator/search/myworld_view")},null,null,null,d("navigator.roomsettings.deleteroom.confirm.title"))},b=()=>{r===t.roomName||r.length<jd||r.length>Id||s("name",r)},S=()=>{l===t.roomDescription||l.length>bd||s("description",l)},_=T=>{T===0&&m===t.tags[0]||m.length>qi||T===1&&u===t.tags[1]||u.length>qi||(m===""&&u!==""&&g(""),I(""),p(T),s("tags",m===""&&u!==""?[u]:[m,u]))};return i.useEffect(()=>{a(t.roomName),c(t.roomDescription),h(t.tags.length>0&&t.tags[0]?t.tags[0]:""),g(t.tags.length>0&&t.tags[1]?t.tags[1]:"")},[t]),e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.roomname")}),e.jsxs(N,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:r,maxLength:Id,onChange:T=>a(T.target.value),onBlur:b}),r.length<jd&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.roomnameismandatory")})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.roomsettings.desc")}),e.jsx("textarea",{className:"form-control form-control-sm",value:l,maxLength:bd,onChange:T=>c(T.target.value),onBlur:S})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",value:t.categoryId,onChange:T=>s("category",T.target.value),children:E&&E.map(T=>e.jsx("option",{value:T.id,children:d(T.name)},T.id))})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.maxvisitors")}),e.jsx("select",{className:"form-select form-select-sm",value:t.userCount,onChange:T=>s("max_visitors",T.target.value),children:Vu&&Vu.map(T=>e.jsx("option",{value:T,children:T},T))})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.tradesettings")}),e.jsxs("select",{className:"form-select form-select-sm",value:t.tradeState,onChange:T=>s("trade_state",T.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.trade_not_allowed")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.trade_not_with_Controller")}),e.jsx("option",{value:"2",children:d("navigator.roomsettings.trade_allowed")})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{className:"col-3",children:d("navigator.tags")}),e.jsxs(N,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:m,onChange:T=>h(T.target.value),onBlur:()=>_(0)}),m.length>qi&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.toomanycharacters")}),f===0&&x!=""&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d(x)})]}),e.jsxs(N,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:u,onChange:T=>g(T.target.value),onBlur:()=>_(1)}),u.length>qi&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.toomanycharacters")}),f===1&&x!=""&&e.jsx(v,{bold:!0,small:!0,variant:"danger",children:d(x)})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"col-3"}),e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowWalkthrough,onChange:T=>s("allow_walkthrough",T.target.checked)}),e.jsx(v,{children:d("navigator.roomsettings.allow_walk_through")})]}),e.jsxs(v,{variant:"danger",underline:!0,bold:!0,pointer:!0,className:"d-flex justify-content-center align-items-center gap-1",onClick:C,children:[e.jsx(Hs,{className:"fa-icon"}),d("navigator.roomsettings.delete")]})]})},Ty=o=>{var m;const{roomData:t=null,handleChange:s=null}=o,[n,r]=i.useState(-1),[a,l]=i.useState([]),c=h=>{l(u=>{const g=[...u],f=g.findIndex(p=>p.userId===h);return f>=0&&g.splice(f,1),g}),D(new aE(h,t.roomId)),r(-1)};return U(rE,h=>{const u=h.getParser();!t||t.roomId!==u.roomId||l(u.bannedUsers)}),i.useEffect(()=>{D(new Bm(t.roomId))},[t.roomId]),e.jsxs(ne,{overflow:"auto",children:[e.jsxs(N,{size:6,children:[e.jsxs(v,{bold:!0,children:[d("navigator.roomsettings.moderation.banned.users")," (",a.length,")"]}),e.jsx(w,{overflow:"hidden",className:"bg-white rounded list-container p-2",children:e.jsx(N,{fullWidth:!0,overflow:"auto",gap:1,children:a&&a.length>0&&a.map((h,u)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(vs,{userName:h.userId}),e.jsxs(v,{pointer:!0,grow:!0,onClick:g=>r(h.userId),children:[" ",h.userName]})]},u))})}),e.jsxs(L,{disabled:n<=0,onClick:h=>c(n),children:[d("navigator.roomsettings.moderation.unban")," ",n>0&&((m=a.find(h=>h.userId===n))==null?void 0:m.userName)]})]}),e.jsxs(N,{size:6,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.moderation.mute.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowMute,onChange:h=>s("moderation_mute",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")})]})})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.moderation.kick.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowKick,onChange:h=>s("moderation_kick",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_ALL,children:d("navigator.roomsettings.moderation.all")})]})})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.moderation.ban.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowBan,onChange:h=>s("moderation_ban",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")})]})})]})]})]})},yy=o=>{const{roomData:t=null}=o,[s,n]=i.useState(new Map),{onlineFriends:r=[],offlineFriends:a=[]}=fs(),l=[...r,...a],c=l.filter(m=>!s.has(m.id));return U(iE,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(h.users)}),U(oE,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(u=>{const g=new Map(u);return g.set(h.data.userId,h.data.userName),g})}),U(lE,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(u=>{const g=new Map(u);return g.delete(h.userId),g})}),i.useEffect(()=>{D(new cE(t.roomId))},[t.roomId]),e.jsxs(ne,{children:[e.jsxs(N,{size:6,children:[e.jsx(v,{bold:!0,children:d("navigator.flatctrls.userswithrights",["displayed","total"],[s.size.toString(),s.size.toString()])}),e.jsx(w,{overflow:"hidden",className:"p-2 bg-white rounded list-container",children:e.jsx(N,{fullWidth:!0,overflow:"auto",gap:1,children:Array.from(s.entries()).map(([m,h],u)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(vs,{userId:m}),e.jsxs(v,{pointer:!0,grow:!0,onClick:g=>D(new uE(m)),children:[" ",h]})]},u))})}),e.jsx(L,{variant:"danger",disabled:!s.size,onClick:m=>D(new dE(t.roomId)),children:d("navigator.flatctrls.clear")})]}),e.jsxs(N,{size:6,children:[e.jsx(v,{bold:!0,children:d("navigator.flatctrls.friends",["displayed","total"],[c.length.toString(),l.length.toString()])}),e.jsx(w,{overflow:"hidden",className:"p-2 bg-white rounded list-container",children:e.jsx(N,{fullWidth:!0,overflow:"auto",gap:1,children:c.map((m,h)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(vs,{userId:m.id}),e.jsxs(v,{pointer:!0,grow:!0,onClick:u=>D(new mE(m.id)),children:[" ",m.name]})]},h))})})]})]})},Ry=o=>{const{roomData:t=null,handleChange:s=null}=o,[n,r]=i.useState(0);return i.useEffect(()=>{r(t.chatSettings.distance)},[t.chatSettings]),e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.vip.caption")}),e.jsx(v,{children:d("navigator.roomsettings.vip.info")})]}),e.jsxs(ne,{overflow:"auto",children:[e.jsxs(N,{size:6,gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.chat_settings")}),e.jsx(v,{children:d("navigator.roomsettings.chat_settings.info")}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.mode,onChange:a=>s("bubble_mode",a.target.value),children:[e.jsx("option",{value:vt.CHAT_MODE_FREE_FLOW,children:d("navigator.roomsettings.chat.mode.free.flow")}),e.jsx("option",{value:vt.CHAT_MODE_LINE_BY_LINE,children:d("navigator.roomsettings.chat.mode.line.by.line")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.weight,onChange:a=>s("chat_weight",a.target.value),children:[e.jsx("option",{value:vt.CHAT_BUBBLE_WIDTH_NORMAL,children:d("navigator.roomsettings.chat.bubbles.width.normal")}),e.jsx("option",{value:vt.CHAT_BUBBLE_WIDTH_THIN,children:d("navigator.roomsettings.chat.bubbles.width.thin")}),e.jsx("option",{value:vt.CHAT_BUBBLE_WIDTH_WIDE,children:d("navigator.roomsettings.chat.bubbles.width.wide")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.speed,onChange:a=>s("bubble_speed",a.target.value),children:[e.jsx("option",{value:vt.CHAT_SCROLL_SPEED_FAST,children:d("navigator.roomsettings.chat.speed.fast")}),e.jsx("option",{value:vt.CHAT_SCROLL_SPEED_NORMAL,children:d("navigator.roomsettings.chat.speed.normal")}),e.jsx("option",{value:vt.CHAT_SCROLL_SPEED_SLOW,children:d("navigator.roomsettings.chat.speed.slow")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.protection,onChange:a=>s("flood_protection",a.target.value),children:[e.jsx("option",{value:vt.FLOOD_FILTER_LOOSE,children:d("navigator.roomsettings.chat.flood.loose")}),e.jsx("option",{value:vt.FLOOD_FILTER_NORMAL,children:d("navigator.roomsettings.chat.flood.normal")}),e.jsx("option",{value:vt.FLOOD_FILTER_STRICT,children:d("navigator.roomsettings.chat.flood.strict")})]}),e.jsx(v,{children:d("navigator.roomsettings.chat_settings.hearing.distance")}),e.jsx("input",{type:"number",min:"0",className:"form-control form-control-sm",value:n,onChange:a=>r(a.target.valueAsNumber),onBlur:a=>s("chat_distance",n)})]}),e.jsxs(N,{size:6,gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roomsettings.vip_settings")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.hideWalls,onChange:a=>s("hide_walls",a.target.checked)}),e.jsx(v,{children:d("navigator.roomsettings.hide_walls")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.wallThickness,onChange:a=>s("wall_thickness",a.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.wall_thickness.normal")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.wall_thickness.thick")}),e.jsx("option",{value:"-1",children:d("navigator.roomsettings.wall_thickness.thin")}),e.jsx("option",{value:"-2",children:d("navigator.roomsettings.wall_thickness.thinnest")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.floorThickness,onChange:a=>s("floor_thickness",a.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.floor_thickness.normal")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.floor_thickness.thick")}),e.jsx("option",{value:"-1",children:d("navigator.roomsettings.floor_thickness.thin")}),e.jsx("option",{value:"-2",children:d("navigator.roomsettings.floor_thickness.thinnest")})]})]})]})]})},ln=["navigator.roomsettings.tab.1","navigator.roomsettings.tab.2","navigator.roomsettings.tab.3","navigator.roomsettings.tab.4","navigator.roomsettings.tab.5"],Oy=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(ln[0]);U(hE,c=>{const m=c.getParser();if(!m)return;const h=m.data;s({roomId:h.roomId,roomName:h.name,roomDescription:h.description,categoryId:h.categoryId,userCount:h.maximumVisitorsLimit,tags:h.tags,tradeState:h.tradeMode,allowWalkthrough:h.allowWalkThrough,lockState:h.doorMode,password:null,allowPets:h.allowPets,allowPetsEat:h.allowFoodConsume,hideWalls:h.hideWalls,wallThickness:h.wallThickness,floorThickness:h.floorThickness,chatSettings:{mode:h.chatSettings.mode,weight:h.chatSettings.weight,speed:h.chatSettings.speed,distance:h.chatSettings.distance,protection:h.chatSettings.protection},moderationSettings:{allowMute:h.roomModerationSettings.allowMute,allowKick:h.roomModerationSettings.allowKick,allowBan:h.roomModerationSettings.allowBan}}),D(new Bm(h.roomId))});const a=()=>{s(null),r(ln[0])},l=(c,m)=>{s(h=>{const u={...h};switch(c){case"name":u.roomName=String(m);break;case"description":u.roomDescription=String(m);break;case"category":u.categoryId=Number(m);break;case"max_visitors":u.userCount=Number(m);break;case"trade_state":u.tradeState=Number(m);break;case"tags":u.tags=m;break;case"allow_walkthrough":u.allowWalkthrough=!!m;break;case"allow_pets":u.allowPets=!!m;break;case"allow_pets_eat":u.allowPetsEat=!!m;break;case"hide_walls":u.hideWalls=!!m;break;case"wall_thickness":u.wallThickness=Number(m);break;case"floor_thickness":u.floorThickness=Number(m);break;case"lock_state":u.lockState=Number(m);break;case"password":u.lockState=nt.PASSWORD_STATE,u.password=String(m);break;case"moderation_mute":u.moderationSettings.allowMute=Number(m);break;case"moderation_kick":u.moderationSettings.allowKick=Number(m);break;case"moderation_ban":u.moderationSettings.allowBan=Number(m);break;case"bubble_mode":u.chatSettings.mode=Number(m);break;case"chat_weight":u.chatSettings.weight=Number(m);break;case"bubble_speed":u.chatSettings.speed=Number(m);break;case"flood_protection":u.chatSettings.protection=Number(m);break;case"chat_distance":u.chatSettings.distance=Number(m);break}return D(new gE(u.roomId,u.roomName,u.roomDescription,u.lockState,u.password,u.userCount,u.categoryId,u.tags.length,u.tags,u.tradeState,u.allowPets,u.allowPetsEat,u.allowWalkthrough,u.hideWalls,u.wallThickness,u.floorThickness,u.moderationSettings.allowMute,u.moderationSettings.allowKick,u.moderationSettings.allowBan,u.chatSettings.mode,u.chatSettings.weight,u.chatSettings.speed,u.chatSettings.distance,u.chatSettings.protection)),u})};return t?e.jsxs(ae,{uniqueKey:"nitro-room-settings",className:"nitro-room-settings",children:[e.jsx(re,{headerText:d("navigator.roomsettings"),isInfoToHabboPages:n===ln[3],onClickInfoHabboPages:()=>n===ln[3]?Z("habbopages/chat/options"):null,onCloseClick:a}),e.jsx(yn,{children:ln.map(c=>e.jsx(sn,{isActive:n===c,onClick:m=>r(c),children:d(c)},c))}),e.jsxs(se,{children:[n===ln[0]&&e.jsx(wy,{roomData:t,handleChange:l,onClose:a}),n===ln[1]&&e.jsx(Sy,{roomData:t,handleChange:l}),n===ln[2]&&e.jsx(yy,{roomData:t,handleChange:l}),n===ln[3]&&e.jsx(Ry,{roomData:t,handleChange:l}),n===ln[4]&&e.jsx(Ty,{roomData:t,handleChange:l})]})]}):null},Ed=o=>{const{roomData:t=null}=o,[s,n]=i.useState(!1),r=i.useRef(),[a,l]=i.useState(!1);i.useEffect(()=>{a&&n(!1)},[a]),i.useEffect(()=>(document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}),[]);const c=h=>{r.current.contains(h.target)||n(!1)},m=()=>{const h=100*(t.userCount/t.maxUserCount);let u="bg-primary";return h>=92?u="bg-danger":h>=50?u="bg-warning":h>0&&(u="bg-success"),u};return e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,innerRef:r,className:"icon icon-navigator-info",onClick:h=>{n(!(s||a)),h.stopPropagation()}}),e.jsx(qo,{show:s,target:r.current,placement:"right",rootClose:!0,children:e.jsx(ua,{children:e.jsxs(se,{overflow:"hidden",className:"room-info bg-transparent",children:[e.jsxs(w,{gap:2,overflow:"hidden",className:"room-info-bg p-2",children:[e.jsxs(el,{roomId:t.roomId,customUrl:t.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",children:[t.habboGroupId>0&&e.jsx(Xe,{badgeCode:t.groupBadgeCode,isGroup:!0,className:"position-absolute top-0 start-0 m-1 "}),t.doorMode!==nt.OPEN_STATE&&e.jsx("i",{className:"position-absolute end-0 mb-1 me-1 icon icon-navigator-room-"+(t.doorMode===nt.DOORBELL_STATE?"locked":t.doorMode===nt.PASSWORD_STATE?"password":t.doorMode===nt.INVISIBLE_STATE?"invisible":"")})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,truncate:!0,className:"flex-grow-1",style:{maxHeight:13},children:t.roomName}),e.jsxs(w,{gap:2,children:[e.jsx(v,{italics:!0,variant:"muted",children:d("navigator.roomownercaption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.ownerId,onClick:h=>{l(!0)}}),e.jsx(v,{italics:!0,children:t.ownerName})]})]}),e.jsx(v,{className:"flex-grow-1",children:t.description}),e.jsxs(w,{className:"badge p-1 position-absolute m-1 bottom-0 end-0 m-2 "+m(),gap:1,children:[e.jsx(mm,{className:"fa-icon"}),t.userCount]})]})]}),e.jsxs(N,{children:[e.jsxs(w,{children:[e.jsxs(w,{gap:1,className:"align-items-center",children:[e.jsx(vs,{userId:t.ownerId}),e.jsx(v,{bold:!0,underline:!0,children:t.ownerName})]}),e.jsxs(w,{gap:1,className:"align-items-center",justifyContent:"end",fullWidth:!0,children:[e.jsx("i",{className:"icon icon-navigator-room-group"}),e.jsx(v,{bold:!0,underline:!0,children:t.groupName})]})]}),e.jsxs(w,{gap:1,children:[e.jsx(v,{bold:!0,children:d("navigator.roompopup.property.max_users")}),e.jsx(v,{children:t.maxUserCount})]})]})]})})})]})},Cd=o=>{const{roomData:t=null,children:s=null,thumbnail:n=!1,...r}=o,{setDoorData:a=null}=qs(),l=()=>{const m=100*(t.userCount/t.maxUserCount);let h="badge-empty";return m>=92?h="badge-danger":m>=50?h="badge-warning":m>0&&(h="badge-success"),h},c=m=>{if(t.ownerId!==G().userId){if(t.habboGroupId!==0){os(t.roomId);return}switch(t.doorMode){case nt.DOORBELL_STATE:a(h=>{const u={...h};return u.roomInfo=t,u.state=We.START_DOORBELL,u});return;case nt.PASSWORD_STATE:a(h=>{const u={...h};return u.roomInfo=t,u.state=We.START_PASSWORD,u});return}}vr(t.roomId)};return n?e.jsxs(N,{pointer:!0,overflow:"hidden",alignItems:"center",onClick:c,gap:0,className:"nav-thumbnail p-1 rounded-3 small mb-1 flex-column",...r,children:[e.jsxs(el,{roomId:t.roomId,customUrl:t.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",children:[t.habboGroupId>0&&e.jsx(Xe,{badgeCode:t.groupBadgeCode,isGroup:!0,className:"position-absolute top-0 start-0 m-1"}),e.jsxs(w,{center:!0,className:"badge p-1 position-absolute m-1 "+l(),gap:1,children:[e.jsx(mm,{className:"fa-icon"}),t.userCount]}),t.doorMode!==nt.OPEN_STATE&&e.jsx("i",{className:"position-absolute end-0 mb-1 me-1 icon icon-navigator-room-"+(t.doorMode===nt.DOORBELL_STATE?"locked":t.doorMode===nt.PASSWORD_STATE?"password":t.doorMode===nt.INVISIBLE_STATE?"invisible":"")})]}),e.jsxs(w,{className:"w-100",children:[e.jsx(v,{truncate:!0,className:"flex-grow-1",children:t.roomName}),e.jsx(w,{reverse:!0,alignItems:"center",gap:1,children:e.jsx(Ed,{roomData:t})}),s]})]}):e.jsxs(w,{pointer:!0,overflow:"hidden",alignItems:"center",onClick:c,gap:2,className:"navigator-item px-2 small",...r,children:[e.jsxs(w,{center:!0,className:"p-1 fw-bold "+l(),gap:1,children:[e.jsx("div",{className:"nav-avatar-icon"}),t.userCount]}),e.jsx(v,{truncate:!0,grow:!0,children:t.roomName}),e.jsxs(w,{reverse:!0,alignItems:"center",gap:1,children:[e.jsx(Ed,{roomData:t}),t.habboGroupId>0&&e.jsx("i",{className:"icon icon-navigator-room-group"}),t.doorMode!==nt.OPEN_STATE&&e.jsx("i",{className:"icon icon-navigator-room-"+(t.doorMode===nt.DOORBELL_STATE?"locked":t.doorMode===nt.PASSWORD_STATE?"password":t.doorMode===nt.INVISIBLE_STATE?"invisible":"")})]}),s]})},ky=o=>{const{searchResult:t=null,...s}=o,[n,r]=i.useState(!0),[a,l]=i.useState(0),{topLevelContext:c=null}=qs(),m=()=>{let f=t.code;return!f||!f.length||d("navigator.searchcode.title."+f)=="navigator.searchcode.title."+f?t.data:f.startsWith("${")?f.slice(2,f.length-1):"navigator.searchcode.title."+f},h=()=>{l(f=>f===Xn.LIST?Xn.THUMBNAILS:Xn.LIST)},u=()=>{t.action==1?D(new yr(t.code,"")):t.action==2&&c&&D(new yr(c.code,""))};i.useEffect(()=>{t&&(r(!t.closed),l(t.mode))},[t]);const g=a>=Xn.THUMBNAILS;return e.jsxs(N,{className:"bg-white",gap:0,children:[e.jsxs(w,{fullWidth:!0,alignItems:"center",justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{grow:!0,pointer:!0,alignItems:"center",gap:1,onClick:f=>r(p=>!p),children:[n&&e.jsx(fg,{className:"text-secondary fa-icon"}),!n&&e.jsx(Wo,{className:"text-secondary fa-icon"}),e.jsxs("div",{className:"nav-category",children:[" ",d(m())]})]}),e.jsxs(w,{gap:2,children:[a===Xn.LIST&&e.jsx(pg,{className:"text-secondary fa-icon",onClick:h}),a>=Xn.THUMBNAILS&&e.jsx(xg,{className:"text-secondary fa-icon",onClick:h}),t.action>0&&t.action===1&&e.jsx(jg,{className:"text-secondary fa-icon",onClick:u}),t.action>0&&t.action!==1&&e.jsx(Ig,{className:"text-secondary fa-icon",onClick:u}),c.code!=="official_view"&&e.jsx(Ih,{title:d("navigator.tooltip.add.saved.search"),onClick:()=>D(new fE(m(),t.data))})]})]})," ",n&&e.jsx(e.Fragment,{children:g?e.jsx(Pe,{columnCount:3,...s,columnMinWidth:110,columnMinHeight:130,className:"mx-2",children:t.rooms.length>0&&t.rooms.map((f,p)=>e.jsx(Cd,{roomData:f,thumbnail:!0},p))}):e.jsx(ne,{columnCount:1,className:"navigator-grid",gap:0,children:t.rooms.length>0&&t.rooms.map((f,p)=>e.jsx(Cd,{roomData:f},p))})})]})},Ay=o=>{const{search:t=null}=o,[s,n]=i.useState(!1),[r,a]=i.useState(0),l=h=>{a(h),n(!0)},c=()=>{a(0),n(!1)},m=()=>{let h=t.code;return!h||!h.length||d("navigator.searchcode.title."+h)=="navigator.searchcode.title."+h?t.code:h.startsWith("${")?h.slice(2,h.length-1):"navigator.searchcode.title."+h};return e.jsxs(w,{grow:!0,pointer:!0,alignItems:"center",gap:1,onMouseEnter:()=>l(t.id),onMouseLeave:()=>c(),children:[s&&r===t.id&&e.jsx(A,{className:"icon nitro-navigator-search-delete",title:d("navigator.tooltip.remove.saved.search"),onClick:()=>D(new pE(t.id))}),e.jsx(v,{small:!0,pointer:!0,variant:"black",title:d("navigator.tooltip.open.saved.search"),onClick:()=>D(new yr(t.code.split(".").reverse()[0],t.filter)),children:d(m())})]})},Dy=o=>{const{searchs:t=[]}=o;return e.jsxs(N,{className:"nitro-navigator-search-saves-result",children:[e.jsxs(w,{className:"badge p-1 bg-orange",gap:1,children:[e.jsx(am,{color:"white"}),e.jsx(v,{variant:"white",children:d("navigator.quick.links.title")})]}),e.jsx(N,{className:"p-1",style:{overflowX:"hidden",overflowY:"auto"},children:t&&t.length>0&&t.map(s=>e.jsx(Ay,{search:s},s.id))})]})},Py=o=>{const{sendSearch:t=null}=o,[s,n]=i.useState(0),[r,a]=i.useState(""),{topLevelContext:l=null,searchResult:c=null}=qs(),m=()=>{if(!l)return;let u=Hr[s];u||(u=Hr[0]);const g=(u.query?u.query+":":"")+r;t(g||"",l.code)},h=u=>{u.key==="Enter"&&m()};return i.useEffect(()=>{if(!c)return;const u=c.data.split(":");let g=null,f="";if(u.length>=2){const[p,...x]=u;g=Hr.find(I=>I.query===p),f=x.join(":")}else f=c.data;g||(g=Hr[0]),n(Hr.findIndex(p=>p===g)),a(f)},[c]),e.jsxs(w,{fullWidth:!0,gap:1,className:"mb-2",children:[e.jsx(w,{shrink:!0,children:e.jsx("select",{className:"form-select form-select-sm",value:s,onChange:u=>n(parseInt(u.target.value)),children:Hr.map((u,g)=>e.jsx("option",{value:g,children:d("navigator.filter."+u.name)},g))})}),e.jsxs(w,{fullWidth:!0,gap:2,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("navigator.filter.input.placeholder"),value:r,onChange:u=>a(u.target.value),onKeyDown:u=>h(u)}),e.jsx("i",{className:"icon icon-pen navigator-search-button position-absolute",onClick:m})]})]})},Ly=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState(!1),[c,m]=i.useState(!1),[h,u]=i.useState(!1),[g,f]=i.useState(!1),[p,x]=i.useState(!1),[I,j]=i.useState(!0),[E,C]=i.useState(!1),{searchResult:b=null,topLevelContext:S=null,topLevelContexts:_=null,navigatorData:T=null,navigatorSearches:P=null}=qs(),k=i.useRef(null),R=i.useRef();He(Lt.CREATED,F=>{s(!1),l(!1)});const y=i.useCallback((F,V)=>{D(new yr(V,F)),x(!0)},[]),O=i.useCallback(()=>{if(!n){C(!0);return}if(k.current){y(k.current.value,k.current.code),k.current=null;return}if(b){y(b.data,b.code);return}S&&y("",S.code)},[n,b,S,y]);return i.useEffect(()=>{const F={linkReceived:V=>{const Y=V.split("/");if(!(Y.length<2))switch(Y[1]){case"show":{s(!0),C(!0);return}case"hide":s(!1);return;case"toggle":{if(t){s(!1);return}s(!0),C(!0);return}case"toggle-room-info":m(q=>!q);return;case"toggle-room-link":u(q=>!q);return;case"goto":if(Y.length<=2)return;switch(Y[2]){case"home":if(T.homeRoomId<=0)return;os(T.homeRoomId);break;default:{const q=parseInt(Y[2]);os(q)}}return;case"create":l(q=>!q);return;case"close-creator":l(!1);return;case"search":if(Y.length>2){const q=Y[2];let M="";Y.length>3&&(M=Y[3]),k.current={value:M,code:q},s(!0),C(!0)}return}},eventUrlPrefix:"navigator/"};return ft(F),()=>pt(F)},[t,T]),i.useEffect(()=>{b&&(x(!1),R&&R.current&&(R.current.scrollTop=0))},[b]),i.useEffect(()=>{!t||!n||!E||(O(),C(!1))},[t,n,E,O]),i.useEffect(()=>{n||!S||r(!0)},[n,S]),i.useEffect(()=>{!t||!I||(D(new xE),j(!1))},[t,I]),i.useEffect(()=>{Ya.addCallback(oi.OPENROOM,(F,V=!1,Y=null)=>D(new jE(F)))},[]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ae,{uniqueKey:"navigator",className:`nitro-navigator ${g?"expanded":""}`,children:[e.jsx(re,{headerText:d("navigator.title"),isInfoToHabboPages:!0,onClickInfoHabboPages:()=>Z("habbopages/navigator"),onCloseClick:F=>s(!1)}),e.jsxs(yn,{children:[e.jsx(A,{className:"mt-1",children:e.jsx(Ih,{style:{marginRight:g?"91px":"11px",marginLeft:"-2px",marginTop:"1px"},title:d("navigator.tooltip.left.show.hide"),onClick:()=>f(F=>!F)})}),_&&_.length>0&&_.map((F,V)=>e.jsx(sn,{isActive:S===F,onClick:Y=>y("",F.code),children:d("navigator.toplevelview."+F.code)},V))]}),e.jsxs(se,{position:"relative",children:[p&&e.jsx(A,{fit:!0,position:"absolute",className:"top-0 start-0 z-index-1 bg-muted opacity-0-5"}),e.jsx(N,{overflow:"hidden",children:e.jsxs(w,{fullWidth:!0,fullHeight:!0,children:[g&&e.jsx(N,{overflow:"hidden",className:"pe-5",children:e.jsx(Dy,{searchs:P})}),e.jsxs(w,{column:!0,className:"w-100",children:[e.jsx(Py,{sendSearch:y}),e.jsx(N,{overflow:"auto",children:b&&b.results.map((F,V)=>e.jsx(ky,{searchResult:F},V))}),e.jsx(w,{className:"nav-bottom",children:e.jsxs(w,{className:"position-absolute bottom-3",children:[e.jsx(w,{className:"nav-create-room",onClick:F=>l(V=>!V),children:e.jsx(v,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.createroom.create")})}),(b==null?void 0:b.code)!=="myworld_view"&&(b==null?void 0:b.code)!=="roomads_view"&&e.jsx(w,{className:"nav-random-room",onClick:()=>D(new Mm),children:e.jsx(v,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.random.room")})}),((b==null?void 0:b.code)==="myworld_view"||(b==null?void 0:b.code)==="roomads_view")&&e.jsx(w,{className:"nav-promote-room",onClick:()=>Z("catalog/open/room_event"),children:e.jsx(v,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.promote.room")})})]})})]})]})})]})]}),a&&e.jsx(vy,{}),e.jsx(Cy,{}),c&&e.jsx(Ny,{onCloseClick:()=>m(!1)}),h&&e.jsx(_y,{onCloseClick:()=>u(!1)}),e.jsx(Oy,{})]})},My=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(""),{chatHistory:a=[]}=gi(),l=i.useRef(null);if(i.useMemo(()=>{if(n.length===0)return a;let m=n.toLowerCase();return a.filter(h=>h.message&&h.message.toLowerCase().includes(m)||h.name&&h.name.toLowerCase().includes(m))},[a,n]),i.useEffect(()=>{l&&l.current&&t&&(l.current.scrollTop=l.current.scrollHeight)},[t]),i.useEffect(()=>{const m={linkReceived:h=>{const u=h.split("/");if(!(u.length<2))switch(u[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(g=>!g);return}},eventUrlPrefix:"nitrobubblehidden/"};return ft(m),()=>pt(m)},[]),!t)return null;var c="<style>.newbubblehe { visibility: hidden !important; }</style>";return e.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},Uy=/\n\r|\n|\r/mg,Fy=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(""),[a,l]=i.useState(null),c=i.useRef(null);return i.useEffect(()=>{const m=async u=>{try{const g=await fetch(u);if(!g)return;const p=(await g.text()).split(Uy),x=p.shift().split("|");r(x[0]),l(I=>x[1]&&x[1].split(";").length===2?{width:parseInt(x[1].split(";")[0]),height:parseInt(x[1].split(";")[1])}:null),s(p.join(""))}catch{jm.error(`Failed to fetch ${u}`)}},h={linkReceived:u=>{const g=u.split("/");g.length<2||(g.shift(),m(K("habbopages.url")+g.join("/")))},eventUrlPrefix:"habbopages/"};return ft(h),()=>pt(h)},[]),i.useEffect(()=>{const m=h=>{if(!(h.target instanceof HTMLAnchorElement))return;h.preventDefault();const u=h.target.href;!u||!u.length||Pr(u)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),t?e.jsxs(ae,{className:"nitropedia",theme:"primary-slim",style:a?{width:a.width,height:a.height}:{},children:[e.jsx(re,{headerText:n,onCloseClick:()=>s(null)}),e.jsx(se,{children:e.jsx(A,{fit:!0,innerRef:c,className:"text-black",dangerouslySetInnerHTML:{__html:t}})})]}):null},Vy=o=>{const{offer:t=null,setOpen:s=null}=o;if(t)return e.jsxs(Mc,{fadesOut:!1,onClose:null,onClick:n=>s(!0),gap:2,children:[e.jsx(A,{className:"nitro-targeted-offer-icon",style:{backgroundImage:`url(${K("image.library.url")+t.iconImageUrl})`}}),e.jsx(v,{variant:"light",className:"ubuntu-bold",children:t.title})]})},Gy=o=>{const{offer:t=null,setOpen:s=null}=o,{getCurrencyAmount:n}=Fr(),[r,a]=i.useState(1),l=i.useMemo(()=>{let h=!1,u=!1,g=!1;return t.priceInCredits>0&&(h=n(-1)>=t.priceInCredits),t.priceInActivityPoints>0?u=n(t.activityPointType)>=t.priceInActivityPoints:u=!0,t.purchaseLimit>0&&(g=!0),h&&u&&g},[t,n]),c=()=>{let h=Math.max(0,(t.expirationTime-Date.now())/1e3);return en.format(h)},m=()=>{D(new IE(t.id,r)),D(new Hm)};if(t)return e.jsxs(ae,{theme:"primary-slim",uniqueKey:"targeted-offer",className:"nitro-targeted-offer",children:[e.jsx(re,{headerText:d(t.title),onCloseClick:h=>s(!1)}),e.jsx(Qm,{position:"relative",className:"justify-content-center align-items-center cursor-pointer",variant:"danger",gap:3,children:d("targeted.offer.timeleft",["timeleft"],[c()])}),e.jsxs(se,{gap:1,children:[e.jsxs(w,{gap:1,fullHeight:!0,children:[e.jsxs(w,{gap:1,column:!0,className:"w-75 text-black",children:[e.jsxs(N,{className:"bg-warning p-2",fullHeight:!0,children:[e.jsx("h4",{children:d(t.title)}),e.jsx(A,{dangerouslySetInnerHTML:{__html:t.description}})]}),e.jsxs(w,{alignSelf:"center",alignItems:"center",justifyContent:"center",gap:2,children:[t.purchaseLimit>1&&e.jsxs(w,{gap:1,children:[e.jsx(v,{variant:"muted",children:d("catalog.bundlewidget.quantity")}),e.jsx("input",{type:"number",value:r,onChange:h=>a(parseInt(h.target.value)),min:1,max:t.purchaseLimit})]}),e.jsx(L,{variant:"primary",disabled:!l,onClick:()=>m(),children:d("targeted.offer.button.buy")})]})]}),e.jsx(A,{className:"w-50",fullHeight:!0,style:{background:`url(${K("image.library.url")+t.imageUrl}) no-repeat center`}})]}),e.jsxs(w,{className:"price-ray position-absolute",alignItems:"center",justifyContent:"center",column:!0,children:[e.jsx(v,{children:d("targeted.offer.price.label")}),t.priceInCredits>0&&e.jsxs(w,{gap:1,children:[e.jsx(v,{variant:"light",children:t.priceInCredits}),e.jsx(_t,{type:-1})]}),t.priceInActivityPoints>0&&e.jsxs(w,{gap:1,children:[e.jsxs(v,{className:"ubuntu-bold",variant:"light",children:["+",t.priceInActivityPoints]})," ",e.jsx(_t,{type:t.activityPointType})]})]})]})]})},By=()=>{const[o,t]=i.useState(null),[s,n]=i.useState(!1);if(U(bE,r=>{let a=r.getParser();a&&t(a.data)}),Hc(()=>{D(new Hm)}),!!o)return e.jsx(e.Fragment,{children:s?e.jsx(Gy,{offer:o,setOpen:n}):e.jsx(Vy,{offer:o,setOpen:n})})},Hy=o=>{const[t,s]=i.useState(0),[n,r]=i.useState(null),[a,l]=i.useState(!0),{showConfirm:c=null}=Fe();U(Wm,f=>{s(0),r(null)}),U(Tm,f=>{s(0),r(null)}),U(fa,f=>{const p=f.getParser();p.roomEnter&&(p.data.habboGroupId>0?(s(p.data.habboGroupId),D(new za(p.data.habboGroupId,!1))):(s(0),r(null)))}),U(EE,f=>{const p=f.getParser();!n||p.groupId!==n.id&&p.groupId!==t||(s(0),r(null))}),U(ci,f=>{const p=f.getParser();p.id===t&&r(p)});const m=()=>{c(d("group.leaveconfirm.desc"),()=>{D(new Nc(n.id,G().userId))},null)},h=n&&n.ownerName===G().userName,u=()=>{if(h)return"group.manage";if(n.type===Ts.PRIVATE)return"";if(n.membershipType===Pt.MEMBER)return"group.leave";if(n.membershipType===Pt.NOT_MEMBER&&n.type===Ts.REGULAR)return"group.join";if(n.membershipType===Pt.REQUEST_PENDING)return"group.membershippending";if(n.membershipType===Pt.NOT_MEMBER&&n.type===Ts.EXCLUSIVE)return"group.requestmembership"},g=()=>{if(h)return dh(n.id);if(!(n.type===Ts.PRIVATE&&n.membershipType===Pt.NOT_MEMBER)){if(n.membershipType===Pt.MEMBER){m();return}Ac(n.id)}};return n?e.jsx(A,{className:"nitro-notification-bubble rounded",children:e.jsxs(N,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:f=>l(p=>!p),children:[e.jsx(v,{variant:"white",children:d("group.homeroominfo.title")}),a&&e.jsx(Ic,{className:"fa-icon"}),!a&&e.jsx(bc,{className:"fa-icon"})]}),a&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{pointer:!0,alignItems:"center",gap:2,onClick:f=>di(n.id),children:[e.jsx(A,{className:"group-badge",children:e.jsx(Xe,{badgeCode:n.badge,isGroup:!0})}),e.jsx(v,{variant:"white",children:n.title})]}),(n.type!==Ts.PRIVATE||h)&&e.jsx(L,{fullWidth:!0,variant:"success",disabled:n.membershipType===Pt.REQUEST_PENDING,onClick:g,children:d(u())})]})]})}):null},Wy=o=>{const{title:t="Nitro Cool UI Edit",onClose:s=null,...n}=o;return e.jsx(Uv,{title:t,onClose:s,classNames:["nitro-credits"],...n,children:e.jsxs(ne,{children:[e.jsx(N,{size:12,children:e.jsx("div",{className:"nitro-logo-default"})}),e.jsxs(N,{size:10,children:[e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{bold:!0,fontSize:5,children:"Nitro React"}),e.jsx(v,{children:"Nitro was created by billsonnn"}),e.jsx("div",{className:"spacer"}),e.jsx(v,{children:"Nitro Versions"}),e.jsxs(v,{children:[e.jsx("b",{children:"Nitro:"})," ",uh()]})]}),e.jsxs(N,{alignItems:"center",children:[e.jsxs(v,{children:[e.jsx("b",{children:"Renderer:"})," v",mv()]}),e.jsxs(N,{fullWidth:!0,gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"success",onClick:r=>window.open("https://discord.nitrodev.co"),children:"Nitro Discord"}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,onClick:r=>window.open("https://git.krews.org/nitro/nitro-react"),children:"Nitro Git"}),e.jsx(L,{fullWidth:!0,onClick:r=>window.open("https://git.krews.org/nitro/nitro-react/-/issues"),children:"Nitro Bug Report"})]})]})]})]}),e.jsx("div",{className:"mysterytrophy-image"}),e.jsx(N,{size:12,children:e.jsx("div",{className:"credits-divider"})}),e.jsx(N,{size:12,children:e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(N,{size:6,justifyContent:"start",children:e.jsx("div",{className:"nitro-coolui-logo"})}),e.jsxs(N,{size:6,alignItems:"left",gap:0,children:[e.jsx(v,{center:!0,bold:!0,fontSize:5,children:"Cool UI"}),e.jsx(v,{children:"Was created by Wassehk"}),e.jsx(v,{children:"- DuckieTM (Re-Design)"}),e.jsx(v,{children:"- Jonas (Contributing)"}),e.jsx(v,{children:"- Ohlucas (Sunset resources)"}),e.jsx(v,{center:!0,bold:!0,small:!0,children:"v1.5.0"}),e.jsx(L,{fullWidth:!0,onClick:r=>window.open("https://github.com/duckietm/Nitro-Cool-UI"),children:"Cool UI Git"})]})]})}),e.jsx(N,{size:12,children:e.jsx("div",{className:"credits-divider"})}),e.jsx(N,{size:10,children:e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{center:!0,bold:!0,fontSize:5,children:"Special Thanks"}),e.jsx(v,{children:"The whole Discord community !!"}),e.jsx(v,{children:"- Billsonnn for creating Nitro."}),e.jsx(v,{children:"- Remco for testing."}),e.jsx(v,{children:"- Object from Atom."}),e.jsx(v,{children:"- Habbo for providing the assets"})]})}),e.jsx("div",{className:"notification-frank"})]})})},qy=o=>{const{item:t=null,title:s=o.item&&o.item.title||"",onClose:n=null,...r}=o,[a,l]=i.useState(!1),c=()=>{Pr(t.clickUrl),n()},m=t.alertType===je.DEFAULT,h=e.jsxs(N,{alignItems:"center",center:!0,gap:0,className:"my-1",children:[!t.clickUrl&&e.jsx(L,{onClick:n,variant:"success",children:d("generic.close")}),t.clickUrl&&t.clickUrl.length>0&&e.jsx(L,{variant:"success",onClick:c,children:d(t.clickUrlText)})]});return e.jsx(Lc,{title:s,onClose:n,...r,type:m?je.DEFAULT:t.alertType,options:h,children:e.jsxs(w,{fullHeight:!0,overflow:"auto",gap:m||t.imageUrl&&!a?2:0,children:[m&&!t.imageUrl&&e.jsx(A,{className:"notification-frank flex-shrink-0"}),t.imageUrl&&!a&&e.jsx("img",{src:t.imageUrl,alt:t.title,onError:()=>{l(!0)},className:"align-self-baseline"}),e.jsx(A,{classNames:["notification-text overflow-y-auto d-flex flex-column w-100",t.clickUrl&&!m?"justify-content-center":""],children:t.messages.length>0&&t.messages.map((u,g)=>{const f=u.replace(/\r\n|\r|\n/g,"<br />");return e.jsx(A,{dangerouslySetInnerHTML:{__html:f}},g)})})]})})},zy=o=>{const{item:t=null,title:s=o.item&&o.item.title||"",onClose:n=null,...r}=o,[a,l]=i.useState(""),[c,m]=i.useState([]),h=()=>{Pr(t.clickUrl),n()},u=f=>{let p=JSON.parse(t.messages[0]);m(p.filter(x=>x.includes(f))),l(f)};i.useEffect(()=>{m(JSON.parse(t.messages[0]))},[t]);const g=t.clickUrl&&t.clickUrl.startsWith("event:");return e.jsxs(Lc,{title:s,onClose:n,...r,children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:a,onChange:f=>u(f.target.value)})}),e.jsx(N,{fullHeight:!0,className:"py-1",overflow:"hidden",children:e.jsx(Pe,{gap:1,columnCount:1,children:c&&c.map((f,p)=>e.jsx("span",{children:f},p))})}),e.jsx("hr",{className:"my-2"}),e.jsxs(N,{alignItems:"center",center:!0,gap:1,children:[!g&&!t.clickUrl&&e.jsx(L,{onClick:n,children:d("generic.close")}),t.clickUrl&&t.clickUrl.length>0&&e.jsx(L,{onClick:h,children:d(t.clickUrlText)})]})]})},Yy=(o,t)=>{if(!o)return null;const s=o.id,n={item:o,onClose:t};switch(o.alertType){case je.NITRO:return e.jsx(Wy,{...n},s);case je.SEARCH:return e.jsx(zy,{...n},s);default:return e.jsx(qy,{...n},s)}},$y=o=>{const{item:t=null,onClose:s=null,...n}=o;return e.jsxs(Mc,{fadesOut:!1,className:"flex-column club-gift",onClose:s,...n,children:[e.jsxs("div",{className:"d-flex align-items-center gap-2 mb-2",children:[e.jsx(_t,{type:"hc",className:"flex-shrink-0"}),e.jsx("span",{className:"ms-1",children:d("notifications.text.club_gift")})]}),e.jsxs("div",{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx("button",{type:"button",className:"btn btn-success w-100 btn-sm",onClick:()=>Pr(t.linkUrl),children:d("notifications.button.show_gift_list")}),e.jsx("span",{className:"text-decoration-underline cursor-pointer text-nowrap",onClick:s,children:d("notifications.button.later")})]})]})},Ky=o=>{const{item:t=null,onClose:s=null,...n}=o,r=t.message.replace(/\r\n|\r|\n/g,"<br />");return e.jsxs(Mc,{onClose:s,gap:2,alignItems:"center",onClick:a=>t.linkUrl&&t.linkUrl.length&&Pr(t.linkUrl),...n,children:[e.jsx(w,{center:!0,className:"bubble-image-container",children:t.iconUrl&&t.iconUrl.length&&e.jsx("img",{className:"no-select",src:t.iconUrl,alt:""})}),e.jsx(v,{wrap:!0,variant:"white",dangerouslySetInnerHTML:{__html:r}})]})},Xy=(o,t)=>{if(!o)return null;const s={item:o,onClose:t};switch(o.notificationType){case ns.CLUBGIFT:return e.jsx($y,{...s},o.id);default:return e.jsx(Ky,{...s},o.id)}},Qy=o=>{const{item:t=null,onClose:s=null,...n}=o,{message:r=null,onConfirm:a=null,onCancel:l=null,confirmText:c=null,cancelText:m=null,title:h=null}=t,u=()=>{a&&a(),s()},g=()=>{l&&l(),s()};return e.jsxs(Lc,{title:h,onClose:s,...n,type:je.ALERT,children:[e.jsx(w,{grow:!0,center:!0,children:e.jsx(v,{children:r})}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"danger",onClick:g,children:m}),e.jsx(L,{fullWidth:!0,onClick:u,children:c})]})]})},Jy=(o,t)=>{if(!o)return null;const s={key:o.id,item:o,onClose:t};switch(o.confirmType){default:return e.jsx(Qy,{...s})}},Zy=o=>{const{alerts:t=[],bubbleAlerts:s=[],confirms:n=[],closeAlert:r=null,closeBubbleAlert:a=null,closeConfirm:l=null}=Fe(),c=i.useMemo(()=>!t||!t.length?null:t.map(u=>Yy(u,()=>r(u))),[t,r]),m=i.useMemo(()=>!s||!s.length?null:s.map(u=>{const g=Xy(u,()=>a(u));return u.notificationType===ns.CLUBGIFT,g}),[s,a]),h=i.useMemo(()=>!n||!n.length?null:n.map(u=>Jy(u,()=>l(u))),[n,l]);return e.jsxs(e.Fragment,{children:[e.jsx(N,{gap:1,className:"topnotifications",children:m}),h,c]})},vd=o=>{const{type:t=-1,amount:s=-1,short:n=!1}=o,r=i.useMemo(()=>e.jsxs(L,{gap:1,className:`nitro-purse-button rounded allcurrencypurse nitro-purse-button currency-${t}`,variant:"f-grey",onClick:()=>Z("catalog/open/currency-"+t),children:[e.jsx(v,{truncate:!0,bold:!0,textEnd:!0,variant:"white",grow:!0,children:n?BC(s):Ja(s)}),e.jsx(_t,{type:t})]}),[s,n,t]);return n?e.jsx(dm,{placement:"top",overlay:e.jsxs(bg,{id:`tooltip-${t}`,children:[" ",Ja(s)," "]}),children:r}):r},eR=o=>{const{type:t=-1,amount:s=-1}=o;return e.jsx(w,{fullWidth:!0,justifyContent:"between",className:"nitro-purse-seasonal-currency nitro-notification "+K("currency.seasonal.color"),children:e.jsxs(w,{fullWidth:!0,children:[e.jsx(v,{bold:!0,truncate:!0,fullWidth:!0,variant:"white",className:"seasonal-padding seasonal-bold",children:d(`purse.seasonal.currency.${t}`)}),e.jsx(v,{bold:!0,truncate:!0,variant:"white",className:"seasonal-amount text-end",title:s>99999?Ja(s):"",children:s>99999?"99 999":Ja(s)}),e.jsx(w,{className:"nitro-seasonal-box seasonal-padding",children:e.jsx(_t,{type:t})})]})})},tR=o=>{const{purse:t=null,hcDisabled:s=!1}=Fr(),n=i.useMemo(()=>K("system.currency.types",[]),[]),r=i.useMemo(()=>K("currency.display.number.short",!1),[]),a=(()=>{if(!t)return null;const c=t.clubPeriods*31+t.clubDays,m=t.minutesUntilExpiration;return t.clubLevel===Wt.NO_CLUB?d("purse.clubdays.zero.amount.text"):m>-1&&m<60*24?en.shortFormat(m*60):en.shortFormat(c*86400)})(),l=(c,m=-1,h=!1)=>{if(!t||!t.activityPoints||!t.activityPoints.size)return null;const u=Array.from(t.activityPoints.keys()).filter(p=>n.indexOf(p)>=0);u.sort((p,x)=>p===0?-1:x===0?1:p===5?-1:x===5?1:p-x);let g=0;for(;g<c;)u.shift(),g++;g=0;const f=[];for(const p of u){if(m>-1&&g===m)break;h?f.push(e.jsx(eR,{type:p,amount:t.activityPoints.get(p)},p)):f.push(e.jsx(vd,{type:p,amount:t.activityPoints.get(p),short:r},p)),g++}return f};return t?e.jsx(N,{alignItems:"end",className:"nitro-purse-container",gap:1,children:e.jsx(w,{className:"nitro-purse rounded-bottom p-1",children:e.jsxs(ne,{fullWidth:!0,gap:1,children:[e.jsxs(N,{justifyContent:"center",size:s?10:6,gap:0,children:[e.jsx(vd,{type:-1,amount:t.credits,short:r}),l(0,2)]}),!s&&e.jsxs(N,{center:!0,pointer:!0,size:4,gap:1,className:"nitro-purse-subscription rounded borderhccontent",onClick:c=>Z("habboUI/open/hccenter"),children:[e.jsx(_t,{type:"hc"}),e.jsx(v,{variant:"white",children:a})]}),e.jsxs(N,{justifyContent:"center",size:1,gap:0,children:[e.jsx(w,{center:!0,pointer:!0,fullHeight:!0,className:"nitro-purse-button p-1 rounded coffecurrencybutton",onClick:c=>Z("help/show"),children:e.jsx("i",{className:"icon icon-help"})}),e.jsx(w,{center:!0,pointer:!0,fullHeight:!0,className:"nitro-purse-button p-1 rounded coffecurrencybutton",onClick:c=>Z("user-settings/toggle"),children:e.jsx("i",{className:"icon icon-cog"})})]}),e.jsx(N,{justifyContent:"center",size:11,gap:0,children:l(2,-1,!0)})]})})}):null},sR={purple:9452386,blue:3891856,green:6459451,yellow:10658089,lilac:6897548,orange:10841125,turquoise:2661026,red:10104881},nR=o=>{const[t,s]=i.useState(!0),[n,r]=i.useState(""),[a,l]=i.useState("");Wv(CE.MYSTERY_BOX_KEYS_UPDATE,m=>{r(m.keyColor),l(m.boxColor)});const c=m=>{const h=sR[m];return gs.int2rgb(h)};return n===""&&a===""?null:e.jsx(A,{className:"nitro-notification-bubble rounded mysterybox-extension",children:e.jsxs(N,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:m=>s(h=>!h),children:[e.jsx(v,{variant:"white",children:d("mysterybox.tracker.title")}),t&&e.jsx(Ic,{className:"fa-icon"}),!t&&e.jsx(bc,{className:"fa-icon"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(v,{variant:"white",children:d("mysterybox.tracker.description")}),e.jsxs(w,{justifyContent:"center",alignItems:"center",gap:2,children:[e.jsx(_e,{className:"mysterybox-container",children:e.jsx("div",{className:"box-image flex-shrink-0",style:{backgroundColor:c(a)},children:e.jsx("div",{className:"chain-overlay-image"})})}),e.jsx(_e,{className:"mysterybox-container",children:e.jsx("div",{className:"key-image flex-shrink-0",style:{backgroundColor:c(n)},children:e.jsx("div",{className:"key-overlay-image"})})})]})]})]})})},rR=o=>{const{eventId:t=-1,eventName:s="",eventDescription:n="",setIsEditingPromote:r=null}=o,[a,l]=i.useState(s),[c,m]=i.useState(n),h=()=>{D(new vE(t,a,c)),r(!1)};return e.jsxs(ae,{className:"nitro-guide-tool",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.eventsettings.editcaption"),onCloseClick:()=>r(!1)}),e.jsxs(se,{className:"text-black",children:[e.jsxs(N,{children:[e.jsx(v,{bold:!0,children:d("navigator.eventsettings.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("navigator.eventsettings.name"),maxLength:64,value:a,onChange:u=>l(u.target.value)})]}),e.jsxs(N,{children:[e.jsx(v,{bold:!0,children:d("navigator.eventsettings.desc")}),e.jsx("textarea",{className:"form-control form-control-sm",placeholder:d("navigator.eventsettings.desc"),maxLength:64,value:c,onChange:u=>m(u.target.value)})]}),e.jsx(N,{children:e.jsx(L,{fullWidth:!0,disabled:!a||!c,variant:!a||!c?"danger":"success",onClick:u=>h(),children:d("navigator.eventsettings.edit")})})]})]})},aR=o=>{const{eventDescription:t="",setIsEditingPromote:s=null}=o,{setIsExtended:n}=Bc(),r=()=>{n(!0),Z("catalog/open/room_event")};return e.jsxs(e.Fragment,{children:[e.jsx(w,{alignItems:"center",gap:2,style:{overflowWrap:"anywhere"},children:e.jsx(v,{variant:"white",children:t})}),e.jsx("br",{}),e.jsx("br",{}),e.jsxs(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx(L,{className:"btn btn-primary w-100 btn-sm",onClick:a=>s(!0),children:d("navigator.roominfo.editevent")}),e.jsx(L,{className:"btn btn-success w-100 btn-sm",onClick:a=>r(),children:d("roomad.extend.event")})]})]})},iR=o=>{const{eventDescription:t=""}=o;return e.jsxs(e.Fragment,{children:[e.jsx(w,{alignItems:"center",gap:2,style:{overflowWrap:"anywhere"},children:e.jsx(v,{variant:"white",children:t})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx(N,{alignItems:"center",gap:1,children:e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(v,{variant:"white",center:!0,children:d("navigator.eventinprogress")})}),e.jsx(v,{children:" "})]})})]})},oR=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!0),{promoteInformation:a,setPromoteInformation:l}=Bc();return U(Wm,c=>{l(null)}),a?e.jsx(e.Fragment,{children:a.data.adId!==-1&&e.jsx(A,{className:"nitro-notification-bubble rounded",children:e.jsxs(N,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:c=>r(m=>!m),children:[e.jsx(v,{variant:"white",overflow:"hidden",children:a.data.eventName}),n&&e.jsx(Ic,{className:"fa-icon"}),!n&&e.jsx(bc,{className:"fa-icon"})]}),n&&G().userId!==a.data.ownerAvatarId&&e.jsx(iR,{eventDescription:a.data.eventDescription}),n&&G().userId===a.data.ownerAvatarId&&e.jsx(aR,{eventDescription:a.data.eventDescription,setIsEditingPromote:()=>s(!0)}),t&&e.jsx(rR,{eventId:a.data.adId,eventName:a.data.eventName,eventDescription:a.data.eventDescription,setIsEditingPromote:()=>s(!1)})]})})}):null},lR=o=>e.jsx("div",{className:"nitro-right-side",children:e.jsxs(N,{position:"relative",gap:1,children:[e.jsx(tR,{}),e.jsx(Hy,{}),e.jsx(nR,{}),e.jsx(By,{}),e.jsx(oR,{}),e.jsx(Zy,{})]})}),cR=o=>e.jsx("div",{className:"room-spectator"}),uR=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(null),{chatStyleId:a=0}=Yn(),{roomSession:l=null}=ke();U(NE,m=>{const h=m.getParser();if(!h)return;const u=l.userDataManager.getPetData(h.petId);u&&(s(u),r(h))});const c=(m,h)=>{!m||!h||l==null||l.sendChatMessage(`${m} ${h}`,a)};return!t||!n?null:e.jsxs(ae,{uniqueKey:"user-settings",className:"user-settings-window no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widgets.pet.commands.title"),onCloseClick:()=>r(null)}),e.jsxs(se,{className:"text-black",children:[e.jsx(w,{alignItems:"center",justifyContent:"center",gap:2,children:e.jsxs(ne,{columnCount:2,children:[e.jsx(N,{fullWidth:!0,overflow:"hidden",className:"body-image pet p-1",children:e.jsx(jn,{figure:t.figure,posture:"std",direction:2})}),e.jsx(v,{variant:"black",small:!0,wrap:!0,children:t.name})]})}),e.jsx(ne,{columnCount:2,children:n.commands&&n.commands.length>0&&n.commands.map((m,h)=>e.jsx(L,{disabled:!n.enabledCommands.includes(m),onClick:()=>c(t.name,d(`pet.command.${m}`)),children:d(`pet.command.${m}`)},h))})]})]})},as=o=>{const{justifyContent:t="center",alignItems:s="center",classNames:n=[],...r}=o,a=i.useMemo(()=>{const l=["menu-header","p-1"];return n.length&&l.push(...n),l},[n]);return e.jsx(w,{justifyContent:t,alignItems:s,classNames:a,...r})},dR=o=>{const{chatEvent:t=null,onClose:s=null}=o,[n,r]=i.useState(t.chat==="${bot.skill.chatter.configuration.text.placeholder}"?"":t.chat),[a,l]=i.useState(t.automaticChat),[c,m]=i.useState(t.mixSentences),[h,u]=i.useState(t.chatDelay),g=i.useMemo(()=>wc(Oe().roomId,t.objectId,t.category,1),[t]),f=x=>x.replace(/;#;/g," ").replace(/\r\n|\r|\n/g,"\r"),p=()=>{const x=f(n)+";#;"+a+";#;"+h+";#;"+c;D(new Ln(t.botId,Ye.SETUP_CHAT,x)),s()};return e.jsx(Ur,{windowPosition:Ot.NOTHING,handleSelector:".drag-handler",dragStyle:{top:g.y,left:g.x},children:e.jsxs(A,{className:"nitro-context-menu bot-chat",children:[e.jsx(as,{className:"drag-handler",children:d("bot.skill.chatter.configuration.title")}),e.jsxs(N,{className:"p-1",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{variant:"white",children:d("bot.skill.chatter.configuration.chat.text")}),e.jsx("textarea",{className:"form-control form-control-sm",placeholder:d("bot.skill.chatter.configuration.text.placeholder"),value:n,rows:7,onChange:x=>r(x.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(v,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.automatic.chat")}),e.jsx("input",{type:"checkbox",className:"form-check-input",checked:a,onChange:x=>l(x.target.checked)})]}),e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(v,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.markov")}),e.jsx("input",{type:"checkbox",className:"form-check-input",checked:c,onChange:x=>m(x.target.checked)})]}),e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(v,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.chat.delay")}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:h,onChange:x=>u(x.target.valueAsNumber)})]})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"primary",onClick:s,children:d("cancel")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:p,children:d("save")})]})]})]})})},Nd=-1,_d=0,Sd=1,wd=2,Td=3,yd=4,Rd=5,Od=6,mR=o=>{const{item:t=null,onClose:s=null}=o,[n,r]=i.useState(Nd),[a,l]=i.useState(null),[c,m]=i.useState(null),{roomSession:h=null}=ke(),u=()=>{a&&H().selectRoomObject(h.roomId,a.roomIndex,Q.UNIT)},g=()=>{h.usePetProduct(t.requestRoomObjectId,a.webID),s()},f=i.useMemo(()=>{if(!a||!c)return null;const p=new da(a.figure),x=c.customParams.split(" "),I=parseInt(x[0]);switch(c.specialType){case de.PET_SHAMPOO:{if(x.length<2)return null;const j=H().getPetColorResult(I,p.paletteId),E=H().getPetColorResultsForTag(I,x[1]);let C=-1;for(const b of E)if(b.breed===j.breed){C=parseInt(b.id);break}return e.jsx(jn,{typeId:p.typeId,paletteId:C,petColor:p.color,customParts:p.customParts,direction:2})}case de.PET_CUSTOM_PART:{if(x.length<4)return null;const j=[],E=x[1].split(",").map(_=>parseInt(_)),C=x[2].split(",").map(_=>parseInt(_)),b=x[3].split(",").map(_=>parseInt(_));let S=0;for(;S<E.length;){const _=E[S],T=p.getCustomPart(_);let P=b[S];T!=null&&(P=T.paletteId),j.push(new El(_,C[S],P)),S++}return e.jsx(jn,{typeId:p.typeId,paletteId:p.paletteId,petColor:p.color,customParts:j,direction:2})}case de.PET_CUSTOM_PART_SHAMPOO:{if(x.length<3)return null;const j=[],E=x[1].split(",").map(S=>parseInt(S)),C=x[2].split(",").map(S=>parseInt(S));let b=0;for(;b<E.length;){const S=E[b],_=p.getCustomPart(S);let T=-1;_!=null&&(T=_.partId),j.push(new El(E[b],T,C[b])),b++}return e.jsx(jn,{typeId:p.typeId,paletteId:p.paletteId,petColor:p.color,customParts:j,direction:2})}case de.PET_SADDLE:{if(x.length<4)return null;const j=[],E=x[1].split(",").map(_=>parseInt(_)),C=x[2].split(",").map(_=>parseInt(_)),b=x[3].split(",").map(_=>parseInt(_));let S=0;for(;S<E.length;)j.push(new El(E[S],C[S],b[S])),S++;for(const _ of p.customParts)E.indexOf(_.layerId)===-1&&j.push(_);return e.jsx(jn,{typeId:p.typeId,paletteId:p.paletteId,petColor:p.color,customParts:j,direction:2})}case de.MONSTERPLANT_REBREED:case de.MONSTERPLANT_REVIVAL:case de.MONSTERPLANT_FERTILIZE:{let j="rip";const E=H().getRoomObject(h.roomId,a.roomIndex,Q.UNIT);if(E&&(j=E.model.getValue(te.FIGURE_POSTURE),j==="rip")){const C=a.petLevel;C<7?j=`grw${C}`:j="std"}return e.jsx(jn,{typeId:p.typeId,paletteId:p.paletteId,petColor:p.color,customParts:p.customParts,posture:j,direction:2})}}},[a,c,h]);return i.useEffect(()=>{const p=h.userDataManager.getUserDataByIndex(t.id);l(p);const x=Yo(h.roomId,t.requestRoomObjectId,Q.FLOOR);if(!x)return;m(x);let I=Nd;switch(x.specialType){case de.PET_SHAMPOO:I=_d;break;case de.PET_CUSTOM_PART:I=Sd;break;case de.PET_CUSTOM_PART_SHAMPOO:I=wd;break;case de.PET_SADDLE:I=Td;break;case de.MONSTERPLANT_REVIVAL:I=yd;break;case de.MONSTERPLANT_REBREED:I=Rd;break;case de.MONSTERPLANT_FERTILIZE:I=Od;break}r(I)},[h,t]),a?e.jsxs(ae,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title",["name"],[a.name]),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(N,{children:e.jsx(A,{pointer:!0,className:"product-preview",onClick:u,children:f})}),e.jsxs(N,{justifyContent:"between",overflow:"auto",children:[e.jsxs(N,{gap:2,children:[n===_d&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.shampoo",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.shampoo")})]}),n===Sd&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.custompart",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.custompart")})]}),n===wd&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.custompartshampoo",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.custompartshampoo")})]}),n===Td&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.saddle",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.saddle")})]}),n===yd&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.revive_monsterplant",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.revive_monsterplant")})]}),n===Rd&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.rebreed_monsterplant",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.rebreed_monsterplant")})]}),n===Od&&e.jsxs(e.Fragment,{children:[e.jsx(v,{children:d("useproduct.widget.text.fertilize_monsterplant",["productName"],[c.name])}),e.jsx(v,{children:d("useproduct.widget.info.fertilize_monsterplant")})]})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(L,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(L,{variant:"success",onClick:g,children:d("useproduct.widget.use")})]})]})]})})]}):null},W=o=>{const{disabled:t=!1,fullWidth:s=!0,justifyContent:n="center",alignItems:r="center",classNames:a=[],onClick:l=null,...c}=o,m=u=>{t||l&&l(u)},h=i.useMemo(()=>{const u=["menu-item","list-item"];return t&&u.push("disabled"),a.length&&u.push(...a),u},[t,a]);return e.jsx(w,{fullWidth:s,justifyContent:n,alignItems:r,classNames:h,onClick:m,...c})},hR=o=>{const{justifyContent:t="center",alignItems:s="center",classNames:n=[],collapsed:r=!0,...a}=o,l=i.useMemo(()=>{const c=["menu-footer"];return n.length&&c.push(...n),c},[n]);return e.jsxs(w,{justifyContent:t,alignItems:s,classNames:l,...a,children:[!r&&e.jsx(fc,{className:"fa-icon align-self-center"}),r&&e.jsx(gc,{className:"fa-icon align-self-center"})]})},gR=25,kd=3,fR=5e3,pR=75,zr=10;let Ol=!1,zi=null,Yi=-1e6,kl=1;const Rn=o=>{const{objectId:t=-1,category:s=-1,userType:n=-1,fades:r=!1,onClose:a=null,position:l="absolute",classNames:c=[],style:m={},children:h=null,collapsable:u=!1,...g}=o,[f,p]=i.useState({x:null,y:null}),[x,I]=i.useState(1),[j,E]=i.useState(!1),[C,b]=i.useState(Ol),S=i.useRef(),_=i.useCallback(R=>{if(!j)return;kl+=R;let y=(1-kl/pR)*1;if(y<=0)return a(),!1;I(y)},[j,a]),T=i.useCallback((R,y)=>{if(!R||!y||!zi)return;let O=-S.current.offsetHeight;n>-1&&(n===gt.USER||n===gt.BOT||n===gt.RENTABLE_BOT)?O=O+(R.height>50?15:0):O=O-14,zi.addValue(y.y-R.top);let F=zi.getMax();F<Yi-kd&&(F=Yi-kd),Yi=F;const V=y.y-F;let Y=~~(y.x-S.current.offsetWidth/2),q=~~(V+O);const M=Ce().width-S.current.offsetWidth-zr,X=Ce().height-S.current.offsetHeight-zr;Y<zr?Y=zr:Y>M&&(Y=M),q<zr?q=zr:q>X&&(q=X),p({x:Y,y:q})},[n]),P=i.useMemo(()=>{const R=["nitro-context-menu"];return C&&R.push("menu-hidden"),R.push(f.x!==null?"visible":"invisible"),c.length&&R.push(...c),R},[f,c,C]),k=i.useMemo(()=>{let R={};return R.left=f.x||0,R.top=f.y||0,R.opacity=x,Object.keys(m).length&&(R={...R,...m}),R},[f,x,m]);return i.useEffect(()=>{if(!S.current)return;const R=y=>{if(!S.current)return;_(y);const O=wc(Oe().roomId,t,s),F=th(Oe().roomId,t,s);T(O,F)};return qn().add(R),()=>{qn().remove(R)}},[t,s,_,T]),i.useEffect(()=>{if(!r)return;const R=setTimeout(()=>E(!0),fR);return()=>clearTimeout(R)},[r]),i.useEffect(()=>{Ol=C},[C]),i.useEffect(()=>{zi=new _E(gR),Yi=-1e6,kl=1},[]),e.jsxs(A,{innerRef:S,position:l,classNames:P,style:k,...g,children:[!(u&&Ol)&&h,u&&e.jsx(hR,{onClick:()=>b(!C),collapsed:C})]})},Ad=0,Dd=1,Pd=2,Ld=3,Md=4,Ud=5,Fd=6,Vd=7,xR=o=>{const{item:t=null,updateConfirmingProduct:s=null,onClose:n=null}=o,[r,a]=i.useState(0),{roomSession:l=null}=ke(),c=m=>{if(m)switch(m){case"use_product":case"use_product_shampoo":case"use_product_custom_part":case"use_product_custom_part_shampoo":case"use_product_saddle":case"replace_product_saddle":case"revive_monsterplant":case"rebreed_monsterplant":case"fertilize_monsterplant":s(t);break}};return i.useEffect(()=>{if(!t)return;const m=Yo(l.roomId,t.requestRoomObjectId,Q.FLOOR);if(!m)return;let h=Ad;switch(m.specialType){case de.PET_SHAMPOO:h=Dd;break;case de.PET_CUSTOM_PART:h=Pd;break;case de.PET_CUSTOM_PART_SHAMPOO:h=Ld;break;case de.PET_SADDLE:h=Md;break;case de.MONSTERPLANT_REVIVAL:h=Ud;break;case de.MONSTERPLANT_REBREED:h=Fd;break;case de.MONSTERPLANT_FERTILIZE:h=Vd;break}a(h)},[l,t]),e.jsxs(Rn,{objectId:t.id,category:Q.UNIT,userType:gt.PET,onClose:n,collapsable:!0,children:[e.jsx(as,{children:t.name}),r===Ad&&e.jsx(W,{onClick:m=>c("use_product"),children:d("infostand.button.useproduct")}),r===Dd&&e.jsx(W,{onClick:m=>c("use_product_shampoo"),children:d("infostand.button.useproduct_shampoo")}),r===Pd&&e.jsx(W,{onClick:m=>c("use_product_custom_part"),children:d("infostand.button.useproduct_custom_part")}),r===Ld&&e.jsx(W,{onClick:m=>c("use_product_custom_part_shampoo"),children:d("infostand.button.useproduct_custom_part_shampoo")}),r===Md&&e.jsxs(e.Fragment,{children:[t.replace&&e.jsx(W,{onClick:m=>c("replace_product_saddle"),children:d("infostand.button.replaceproduct_saddle")}),!t.replace&&e.jsx(W,{onClick:m=>c("use_product_saddle"),children:d("infostand.button.useproduct_saddle")})]}),r===Ud&&e.jsx(W,{onClick:m=>c("revive_monsterplant"),children:d("infostand.button.revive_monsterplant")}),r===Fd&&e.jsx(W,{onClick:m=>c("rebreed_monsterplant"),children:d("infostand.button.rebreed_monsterplant")}),r===Vd&&e.jsx(W,{onClick:m=>c("fertilize_monsterplant"),children:d("infostand.button.fertilize_monsterplant")})]})},jR=o=>{const{avatarInfo:t=null,onClose:s=null}=o;return t?e.jsx(N,{className:"nitro-infostand rounded",children:e.jsxs(N,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(v,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(N,{fullWidth:!0,className:"body-image bot",children:e.jsx(it,{figure:t.figure,direction:4})}),e.jsx(N,{grow:!0,center:!0,gap:0,children:t.badges.length>0&&t.badges.map(n=>e.jsx(Xe,{badgeCode:n,showInfo:!0},n))})]}),e.jsx("hr",{className:"m-0"})]}),e.jsx(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:e.jsx(v,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",small:!0,className:"motto-content",children:t.motto})}),t.carryItem>0&&e.jsxs(N,{gap:1,children:[e.jsx("hr",{className:"m-0"}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+t.carryItem)])})]})]})}):null},Al=0,Gd=1,Bd=2,IR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,{roomSession:n=null}=ke(),[r,a]=i.useState(0),[l,c]=i.useState(!1),[m,h]=i.useState(!1),[u,g]=i.useState(!1),[f,p]=i.useState([]),[x,I]=i.useState([]),[j,E]=i.useState([]),[C,b]=i.useState([]),[S,_]=i.useState(!1),[T,P]=i.useState(0),[k,R]=i.useState(0),[y,O]=i.useState(!1),[F,V]=i.useState(!1),[Y,q]=i.useState(null),[M,X]=i.useState(!1),[he,pe]=i.useState(!1),[qe,wt]=i.useState(-1),[be,Qe]=i.useState(""),[Ee,Jt]=i.useState(""),[me,ge]=i.useState({x:-1,y:-1,z:-1}),[le,Ae]=i.useState(sessionStorage.getItem("dropdownOpen")==="true"),[qt,cs]=i.useState(null),[rn,Kn]=i.useState(null),[_s,On]=i.useState(null),[Re,Je]=i.useState(null),[ot,Zt]=i.useState(null),xs=i.useCallback((ie,ee,fe=0,ze=0)=>{if(!t)return;const Ue=H().activeRoomId,kt=H().getRoomObject(Ue,t.id,t.category);if(!kt)return;const B=kt.getLocation().x+ie,z=kt.getLocation().y+ee,J=fe*1e4,oe=kt.getDirection().x,Ne=ze!==0?Gr(kt,ze>0)/45:oe/45;D(new SE(t.id,B,z,J,Ne))},[t]);function ja(ie){switch(ie.x){case 0:return 0;case 45:return 1;case 90:return 2;case 135:return 3;case 180:return 4;case 225:return 5;case 270:return 6;case 315:return 7;default:return null}}i.useEffect(()=>{const ie=n.roomId,ee=t.id,fe=t.isWallItem,ze=H().getFurniLocation(ie,ee,fe),Ue=Ia(ze);Ue&&(cs(Ue.x),Kn(Ue.y),On(Ue.z));const kt=H().getFurniDirection(ie,ee,fe),B=Ia(kt),z=B?ja(B):null,J=H().getFurniState(ie,ee,fe);Je(z),Zt(J)},[t,n]);function Ia(ie){if(!ie)return null;const ee=ie.match(/\[Vector3d: ([\d.]+), ([\d.]+), ([\d.]+)/);return ee&&ee.length===4?{x:parseFloat(ee[1]),y:parseFloat(ee[2]),z:parseFloat(ee[3])}:null}U(wE,ie=>{const fe=ie.getParser().item;if(fe.itemId!==t.id)return;const ze={x:fe.x,y:fe.y,z:fe.z};ze&&(cs(ze.x),Kn(ze.y),On(ze.z));const Ue={x:fe.direction},kt=Ue?ja(Ue):null,B=fe.state;Je(kt),Zt(B)});const Vr=i.useCallback(ie=>{let ee=parseFloat(ie.target.value);isNaN(ee)||ee<0?ee=0:ee>40&&(ee=40),On(ee),xs(0,0,ee,0)},[xs]),ba=i.useCallback(ie=>{let ee=parseFloat(ie.target.value);isNaN(ee)||ee<0?ee=0:ee>40&&(ee=40),ee=parseFloat(ee.toFixed(4)),On(ee),xs(0,0,ee,0)},[xs]),kn=i.useCallback(ie=>{let ee=_s+ie;ee<0?ee=0:ee>40&&(ee=40),ee=parseFloat(ee.toFixed(4)),On(ee),xs(0,0,ee,0)},[_s,xs]);function Gr(ie,ee){if(!ie||!ie.model)return 0;let fe=[];ie.type==="monster_plant"?fe=ie.model.getValue("pet_allowed_directions"):fe=ie.model.getValue("furniture_allowed_directions");let ze=ie.getDirection().x;if(fe&&fe.length){let Ue=fe.indexOf(ze);if(Ue<0){Ue=0;for(let kt=0;kt<fe.length&&!(ze<=fe[kt]);kt++)Ue++;Ue=Ue%fe.length}ee?Ue=(Ue+1)%fe.length:Ue=(Ue-1+fe.length)%fe.length,ze=fe[Ue]}return ze}jr(ym.NPE_SONG_CHANGED,ie=>{wt(ie.id)},M||he),jr(yE.SIR_TRAX_SONG_INFO_RECEIVED,ie=>{if(ie.id!==qe)return;const ee=Ce().soundManager.musicController.getSongInfo(ie.id);ee&&(Qe(ee.name),Jt(ee.creator))},M||he),i.useEffect(()=>{let ie=Al,ee=!1,fe=!1,ze=!1,Ue=[],kt=[],B=[],z=[],J=!1,oe=0,Ne=0,Me=!1,bt=!1,Ie=!1,us=!1,ol=-1;const bi=H().getRoomObject(n.roomId,t.id,t.isWallItem?Q.WALL:Q.FLOOR).getLocation();bi&&ge({x:bi.x,y:bi.y,z:bi.z});const Ei=t.roomControllerLevel>=Ke.GUEST;if((Ei||t.isOwner||t.isRoomOwner||t.isAnyRoomController)&&(ee=!0,fe=!t.isWallItem,t.roomControllerLevel>=Ke.MODERATOR&&(Me=!0)),t.isAnyRoomController&&(bt=!0),(t.usagePolicy===bu.EVERYBODY||t.usagePolicy===bu.CONTROLLER&&Ei||t.extraParam===Mn.JUKEBOX&&Ei||t.extraParam===Mn.USABLE_PRODUCT&&Ei)&&(ze=!0),t.extraParam){if(t.extraParam===Mn.CRACKABLE_FURNI){const As=t.stuffData;ze=!0,J=!0,oe=As.hits,Ne=As.target}else if(t.extraParam===Mn.JUKEBOX){const As=Ce().soundManager.musicController.getRoomItemPlaylist();As&&(ol=As.nowPlayingSongId),Ie=!0}else t.extraParam.indexOf(Mn.SONGDISK)===0&&(ol=parseInt(t.extraParam.substr(Mn.SONGDISK.length)),us=!0);if(Me){const As=t.extraParam.substr(Mn.BRANDING_OPTIONS.length);if(As){const Ea=As.split(" ");for(const ll of Ea){const gr=ll.split("=");gr&&gr.length===2&&(Ue.push(gr[0]),kt.push(gr[1]))}}}}if(Me){const As=H().getRoomObject(n.roomId,t.id,t.isWallItem?Q.WALL:Q.FLOOR);if(As){const Ea=As.model.getValue(te.FURNITURE_CUSTOM_VARIABLES),ll=As.model.getValue(te.FURNITURE_DATA);if(Ea&&Ea.length)for(const gr of Ea)B.push(gr),z.push(ll[gr]||"")}}t.isOwner||t.isAnyRoomController?ie=Bd:(t.isRoomOwner||t.roomControllerLevel>=Ke.GUILD_ADMIN)&&(ie=Gd),t.isStickie&&(ie=Al),a(ie),c(ee),h(fe),g(ze),p(Ue),I(kt),E(B),b(z),_(J),P(oe),R(Ne),O(Me),V(bt),q(null),X(Ie),pe(us),wt(ol),t.groupId&&D(new za(t.groupId,!1))},[n,t]),U(ci,ie=>{const ee=ie.getParser();!t||t.groupId!==ee.id||ee.flag||(Y&&q(null),q(ee.title))}),i.useEffect(()=>{const ie=Ce().soundManager.musicController.getSongInfo(qe);Qe((ie==null?void 0:ie.name)??""),Jt((ie==null?void 0:ie.creator)??"")},[qe]);const ji=i.useCallback((ie,ee)=>{const fe=Array.from(x);fe[ie]=ee,I(fe)},[x]),Br=i.useCallback((ie,ee)=>{const fe=Array.from(C);fe[ie]=ee,b(fe)},[C]),hr=i.useCallback(()=>{if(f.length===0||x.length===0)return"";let ie="",ee=0;for(;ee<f.length;){const fe=f[ee],ze=x[ee];ie=ie+(fe+"="+ze+" "),ee++}return ie},[f,x]),an=i.useCallback(ie=>{if(!(!ie||ie===""))switch(ie){case"buy_one":Z(`catalog/open/offerId/${t.purchaseOfferId}`);return;case"move":H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_MOVE);break;case"rotate":H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_ROTATE_POSITIVE);break;case"pickup":r===Bd?H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_PICKUP):H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_EJECT);break;case"use":H().useRoomObject(t.id,t.category);break;case"save_branding_configuration":{const ee=new Map,fe=hr().split(" ");if(fe)for(const ze of fe){const[Ue,kt]=ze.split("=",2);ee.set(Ue,kt)}H().modifyRoomObjectDataWithMap(t.id,t.category,Bs.OBJECT_SAVE_STUFF_DATA,ee);break}case"save_custom_variables":{const ee=new Map;for(let fe=0;fe<j.length;fe++){const ze=j[fe],Ue=C[fe];ze&&ze.length&&Ue&&Ue.length&&ee.set(ze,Ue)}D(new TE(t.id,ee));break}}},[t,r,j,C,hr]),Ii=i.useCallback(()=>{const ie=t.stuffData;return!ie||!(ie instanceof li)?null:ie.getValue(2)},[t]);return t?e.jsxs(N,{gap:1,alignItems:"end",children:[e.jsx(N,{className:"nitro-infostand",children:e.jsxs(N,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[!he&&e.jsx(v,{variant:"white",wrap:!0,children:t.name}),be.length>0&&e.jsx(v,{variant:"white",wrap:!0,children:be}),e.jsx("i",{className:"infostand-close",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{position:"relative",gap:1,children:[t.stuffData.isUnique&&e.jsx("div",{className:"position-absolute end-0",children:e.jsx(xh,{uniqueNumber:t.stuffData.uniqueNumber,uniqueSeries:t.stuffData.uniqueSeries})}),t.stuffData.rarityLevel>-1&&e.jsx("div",{className:"position-absolute end-0",children:e.jsx(Fc,{level:t.stuffData.rarityLevel})}),t.image&&t.image.src.length&&e.jsx("img",{className:"d-block mx-auto",src:t.image.src,alt:""})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",children:t.description}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.ownerId}),e.jsx(v,{variant:"white",wrap:!0,children:d("furni.owner",["name"],[t.ownerName])})]}),t.purchaseOfferId>0&&e.jsx(w,{children:e.jsx(L,{className:"volter-button",onClick:ie=>an("buy_one"),children:d("infostand.button.buy")})})]}),(M||he)&&e.jsxs(N,{gap:1,children:[e.jsx("hr",{className:"m-0"}),qe===-1&&e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.jukebox.text.not.playing")}),!!be.length&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"icon disk-icon"}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:be})]}),!!Ee.length&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"icon disk-creator"}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:Ee})]})]}),e.jsxs(N,{gap:1,children:[S&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(v,{variant:"white",wrap:!0,children:d("infostand.crackable_furni.hits_remaining",["hits","target"],[T.toString(),k.toString()])})]}),t.groupId>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsxs(w,{pointer:!0,alignItems:"center",gap:2,onClick:()=>di(t.groupId),children:[e.jsx(Xe,{badgeCode:Ii(),isGroup:!0}),e.jsx(v,{variant:"white",underline:!0,children:Y})]})]}),e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsxs(v,{small:!0,wrap:!0,variant:"white",children:["X = ",me.x," and Y = ",me.y,e.jsx("br",{}),"BuildHeight = ",me.z<.01?0:me.z,e.jsx("br",{}),F&&e.jsxs(v,{wrap:!0,variant:"white",children:[" Room Furnishing ID: ",t.id]})]})]}),me.x>-1,y&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),!t.isWallItem&&l&&e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"infostand-buttons px-2",onClick:()=>Ae(!le),children:le?`${d("widget.furni.present.close")} Buildtools`:`${d("navigator.roomsettings.doormode.open")} Buildtools`}),le&&e.jsx(e.Fragment,{children:e.jsxs(w,{gap:1,children:[e.jsx(N,{className:"buildtool-box buildtool-box-left",children:e.jsxs(N,{fullWidth:!0,children:[e.jsx(v,{variant:"white",children:d("group.edit.badge.position")}),e.jsxs(N,{justifyContent:"center",alignItems:"center",className:"button-w-height",children:[e.jsxs(w,{className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-movefurni button-leftup",onClick:()=>xs(-1,0,_s,0),children:[" ",e.jsx(Ci,{className:"fa-icon icon-color",size:"1.7em"})," "]}),e.jsxs(A,{className:"buildtool-movefurni button-rightup",onClick:()=>xs(0,-1,_s,0),children:[" ",e.jsx(Ci,{className:"fa-icon icon-color",size:"1.7em"})," "]})]}),e.jsxs(w,{className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-movefurni button-leftdown",onClick:()=>xs(0,1,_s,0),children:[" ",e.jsx(Ci,{className:"fa-icon icon-color",size:"1.7em"})," "]}),e.jsxs(A,{className:"buildtool-movefurni button-rightdown",onClick:()=>xs(1,0,_s,0),children:[" ",e.jsx(Ci,{className:"fa-icon icon-color",size:"1.7em"})," "]})]})]}),e.jsx(v,{variant:"white",children:d("infostand.button.rotate")}),e.jsxs(w,{center:!0,className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-rotatefurni",onClick:()=>xs(0,0,_s,-1),children:[" ",e.jsx(Eg,{className:"fa-icon icon-color",size:"1.4em"})," "]}),e.jsxs(A,{className:"buildtool-rotatefurni",onClick:()=>xs(0,0,_s,1),children:[" ",e.jsx(Cg,{className:"fa-icon icon-color",size:"1.4em"})," "]})]})]})}),e.jsx(N,{className:"buildtool-box buildtool-box-right",children:e.jsxs(N,{fullWidth:!0,children:[e.jsx(v,{variant:"white",children:d("stack.magic.tile.height.label")}),e.jsx("input",{spellCheck:"false",type:"number",className:"form-control form-control-sm",value:_s!==null?_s.toString():"",onChange:Vr,onBlur:ba,min:0,max:40,step:.1}),e.jsxs(w,{justifyContent:"center",gap:1,children:[e.jsxs(N,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>kn(1),children:"↑"}),e.jsx(v,{variant:"white",align:"center",children:"█"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>kn(-1),children:"↓"})]}),e.jsxs(N,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>kn(.1),children:"↑"}),e.jsx(v,{variant:"white",align:"center",children:"▄"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>kn(-.1),children:"↓"})]}),e.jsxs(N,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>kn(.01),children:"↑"}),e.jsx(v,{variant:"white",align:"center",children:"_"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>kn(-.01),children:"↓"})]})]})]})})]})})]}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(N,{gap:1,children:f.map((ie,ee)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{wrap:!0,align:"end",variant:"white",className:"col-4",children:ie}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:x[ee],onChange:fe=>ji(ee,fe.target.value)})]},ee))})]})]}),j.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0 my-1"}),e.jsx(N,{gap:1,children:j.map((ie,ee)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(v,{small:!0,wrap:!0,align:"end",variant:"white",className:"col-4",children:ie}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:C[ee],onChange:fe=>Br(ee,fe.target.value)})]},ee))})]})]})]})}),e.jsxs(w,{gap:2,justifyContent:"end",children:[l&&e.jsx(L,{className:"infostand-buttons px-2",onClick:ie=>an("move"),children:d("infostand.button.move")}),m&&e.jsx(L,{className:"infostand-buttons px-2",onClick:ie=>an("rotate"),children:d("infostand.button.rotate")}),r!==Al&&e.jsx(L,{className:"infostand-buttons px-2",onClick:ie=>an("pickup"),children:d(r===Gd?"infostand.button.eject":"infostand.button.pickup")}),u&&e.jsx(L,{className:"infostand-buttons px-2",onClick:ie=>an("use"),children:d("infostand.button.use")}),f.length>0&&x.length>0&&f.length===x.length&&e.jsx(L,{className:"infostand-buttons px-2",onClick:()=>an("save_branding_configuration"),children:d("save")}),j.length>0&&C.length>0&&j.length===C.length&&e.jsx(L,{className:"infostand-buttons px-2",onClick:()=>an("save_custom_variables"),children:d("save")})]})]}):null},bR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,[n,r]=i.useState(0),[a,l]=i.useState(0),{roomSession:c=null}=ke(),{petRespectRemaining:m=0,respectPet:h=null}=Yn();if(i.useEffect(()=>{r(t.remainingGrowTime),l(t.remainingTimeToLive)},[t]),i.useEffect(()=>{if(t.petType!==Gt.MONSTERPLANT||t.dead)return;const g=setInterval(()=>{r(f=>f-1),l(f=>f-1)},1e3);return()=>clearInterval(g)},[t]),!t)return null;const u=g=>{let f=!0;if(!(!g||g=="")){switch(g){case"respect":h(t.id),m-1>=1&&(f=!1);break;case"buyfood":Z("catalog/open/"+K("catalog.links")["pets.buy_food"]);break;case"train":c==null||c.requestPetCommands(t.id);break;case"treat":D(new _c(t.id));break;case"compost":c==null||c.compostPlant(t.id);break;case"pick_up":c==null||c.pickupPet(t.id);break}f&&s()}};return e.jsxs(N,{gap:1,alignItems:"end",children:[e.jsx(N,{className:"nitro-infostand rounded",children:e.jsxs(N,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(v,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d(`pet.breed.${t.petType}.${t.petBreed}`)}),e.jsx("hr",{className:"m-0"})]}),t.petType===Gt.MONSTERPLANT&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{center:!0,gap:1,children:[e.jsx(jn,{figure:t.petFigure,posture:t.posture,direction:4}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:2,children:[!t.dead&&e.jsx(N,{alignItems:"center",gap:1,children:e.jsx(v,{variant:"white",center:!0,small:!0,wrap:!0,children:d("pet.level",["level","maxlevel"],[t.level.toString(),t.maximumLevel.toString()])})}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.wellbeing")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(v,{variant:"white",small:!0,children:t.dead?"00:00:00":fr(a==0?t.remainingTimeToLive:a).split(":")[1]+":"+fr(a==null||a==null?0:a).split(":")[2]+":"+fr(a==null||a==null?0:a).split(":")[3]})}),e.jsx(A,{className:"bg-success rounded pet-stats",style:{width:t.dead?"0":Math.round(t.maximumTimeToLive*100/a).toString()}})]})]}),n!=0&&n>0&&e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.growth")}),e.jsx(Dv,{className:"top-2 end-2",day:fr(n).split(":")[0],hour:fr(n).split(":")[1],minutes:fr(n).split(":")[2],seconds:fr(n).split(":")[3]})]}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.raritylevel",["level"],[d(`infostand.pet.raritylevel.${t.rarityLevel}`)])}),e.jsx(Fc,{className:"top-2 end-2",level:t.rarityLevel})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("pet.age",["age"],[t.age.toString()])}),e.jsx("hr",{className:"m-0"})]})]}),t.petType!==Gt.MONSTERPLANT&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(N,{fullWidth:!0,overflow:"hidden",className:"body-image pet p-1",children:e.jsx(jn,{figure:t.petFigure,posture:t.posture,direction:4})}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsx(v,{variant:"white",center:!0,small:!0,wrap:!0,children:d("pet.level",["level","maxlevel"],[t.level.toString(),t.maximumLevel.toString()])}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.happiness")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(v,{variant:"white",small:!0,children:t.happyness+"/"+t.maximumHappyness})}),e.jsx(A,{className:"bg-info rounded pet-stats",style:{width:t.happyness/t.maximumHappyness*100+"%"}})]})]}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.experience")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(v,{variant:"white",small:!0,children:t.experience+"/"+t.levelExperienceGoal})}),e.jsx(A,{className:"bg-purple rounded pet-stats",style:{width:t.experience/t.levelExperienceGoal*100+"%"}})]})]}),e.jsxs(N,{alignItems:"center",gap:1,children:[e.jsx(v,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.energy")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(v,{variant:"white",small:!0,children:t.energy+"/"+t.maximumEnergy})}),e.jsx(A,{className:"bg-success rounded pet-stats",style:{width:t.energy/t.maximumEnergy*100+"%"}})]})]})]})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[t.petType!==Gt.MONSTERPLANT&&e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.petrespect",["count"],[t.respect.toString()])}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("pet.age",["age"],[t.age.toString()])}),e.jsx("hr",{className:"m-0"})]})]}),e.jsx(N,{gap:1,children:e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.ownerId}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.petowner",["name"],[t.ownerName])})]})})]})}),e.jsxs(w,{gap:1,justifyContent:"end",children:[t.petType!==Gt.MONSTERPLANT&&e.jsx(L,{variant:"dark",onClick:g=>u("buyfood"),children:d("infostand.button.buyfood")}),t.isOwner&&t.petType!==Gt.MONSTERPLANT&&e.jsx(L,{variant:"dark",onClick:g=>u("train"),children:d("infostand.button.train")}),!t.dead&&t.energy/t.maximumEnergy<.98&&t.petType===Gt.MONSTERPLANT&&e.jsx(L,{variant:"dark",onClick:g=>u("treat"),children:d("infostand.button.pettreat")}),(c==null?void 0:c.isRoomOwner)&&t.petType===Gt.MONSTERPLANT&&e.jsx(L,{variant:"dark",onClick:g=>u("compost"),children:d("infostand.button.compost")}),t.isOwner&&e.jsx(L,{variant:"dark",onClick:g=>u("pick_up"),children:d("inventory.pets.pickup")}),m>0&&t.petType!==Gt.MONSTERPLANT&&e.jsx(L,{variant:"dark",onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[m.toString()])})]})]})},ER=o=>{const{avatarInfo:t=null,onClose:s=null}=o,n=i.useMemo(()=>!(t.botSkills.indexOf(Ye.NO_PICK_UP)>=0||!t.amIOwner&&!t.amIAnyRoomController),[t]),r=()=>D(new qm(t.webID));if(t)return e.jsxs(N,{gap:1,children:[e.jsx(N,{className:"nitro-infostand rounded",children:e.jsxs(N,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(v,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(N,{fullWidth:!0,className:"body-image bot",children:e.jsx(it,{figure:t.figure,direction:4})}),e.jsx(N,{grow:!0,center:!0,gap:0,children:t.badges.length>0&&t.badges.map(a=>e.jsx(Xe,{badgeCode:a,showInfo:!0},a))})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsx(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:e.jsx(v,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",small:!0,className:"motto-content",children:t.motto})}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.ownerId}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.botowner",["name"],[t.ownerName])})]}),t.carryItem>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+t.carryItem)])})]})]})]})}),n&&e.jsx(w,{justifyContent:"end",children:e.jsx(L,{variant:"dark",onClick:r,children:d("infostand.button.pickup")})})]})},Dl=o=>{const{type:t=-1,relationship:s=null}=o;if(!s)return null;const n=Js.RELATIONSHIP_NAMES[t].toLocaleLowerCase();return e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("i",{className:`nitro-friends-spritesheet icon-${n}`}),e.jsx(w,{alignItems:"center",gap:0,children:e.jsxs(v,{small:!0,variant:"white",onClick:r=>ls(s.randomFriendId),children:[e.jsx("u",{children:s.randomFriendName}),s.friendCount>1&&" "+d(`extendedprofile.relstatus.others.${n}`,["count"],[(s.friendCount-1).toString()])]})})]})},CR=o=>{const{relationships:t=null}=o;return!t||!t.relationshipStatusMap.length?null:e.jsxs(e.Fragment,{children:[e.jsx(Dl,{type:Js.HEART,relationship:t.relationshipStatusMap.getValue(Js.HEART)}),e.jsx(Dl,{type:Js.SMILE,relationship:t.relationshipStatusMap.getValue(Js.SMILE)}),e.jsx(Dl,{type:Js.BOBBA,relationship:t.relationshipStatusMap.getValue(Js.BOBBA)})]})},vR=o=>{Z(`navigator/search/${o}`),D(new yr("hotel_view",`tag:${o}`))},NR=o=>{const{tags:t=null}=o;return!t||!t.length?null:e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(w,{className:"flex-tags",children:t&&t.length>0&&t.map((s,n)=>e.jsx(v,{variant:"white",className:"text-tags",onClick:r=>vR(s),children:s},n))})]})},_R=["backgrounds","stands","overlays"],SR=({setIsVisible:o,selectedBackground:t,setSelectedBackground:s,selectedStand:n,setSelectedStand:r,selectedOverlay:a,setSelectedOverlay:l,setBackgroundDirection:c,setStandDirection:m,setOverlayDirection:h})=>{const[u,g]=i.useState("backgrounds"),{roomSession:f}=ke(),p=i.useMemo(()=>({isHcMember:Cs()>=Wt.CLUB,securityLevel:G().canChangeName,isAmbassador:G().isAmbassador}),[]),x=i.useCallback((C,b)=>C!=null&&C.length?C.filter(S=>{const _=p.securityLevel>=S.minRank,T=!S.isAmbassadorOnly||p.isAmbassador;return S.isHcOnly||_&&T}).map(S=>({id:S[`${b}Id`],...S,selectable:!S.isHcOnly||p.isHcMember,AvatarDirection:S.AvatarDirection??4})):[],[p]),I=i.useMemo(()=>({backgrounds:x(K("backgrounds.data"),"background"),stands:x(K("stands.data"),"stand"),overlays:x(K("overlays.data"),"overlay")}),[x]),j=i.useCallback(C=>{if(!f)return;const b={backgrounds:s,stands:r,overlays:l},S={backgrounds:c,stands:m,overlays:h},_={backgrounds:t,stands:n,overlays:a},T=I[u].find(P=>P.id===C);if(T){b[u](C),S[u](T.AvatarDirection);const P={..._,[u]:C};f.sendBackgroundMessage(P.backgrounds,P.stands,P.overlays)}},[u,f,t,n,a,s,r,l,c,m,h,I]),E=i.useCallback((C,b)=>e.jsxs(w,{pointer:!0,position:"relative",onClick:()=>C.selectable&&j(C.id),className:C.selectable?"":"non-selectable",children:[e.jsx(A,{className:`profile-${b} ${b}-${C.id}`}),C.isHcOnly&&e.jsx(_t,{position:"absolute",className:"top-1 end-1",type:"hc"})]},C.id),[j]);return e.jsxs(ae,{uniqueKey:"backgrounds",className:"nitro-backgrounds no-resize",theme:"primary",children:[e.jsx(re,{headerText:"Profile Background",onCloseClick:()=>o(!1)}),e.jsx(yn,{children:_R.map(C=>e.jsx(sn,{isActive:u===C,onClick:()=>g(C),children:C.charAt(0).toUpperCase()+C.slice(1)},C))}),e.jsxs(se,{gap:1,children:[e.jsx(v,{bold:!0,center:!0,children:"Select an Option"}),e.jsx(ne,{gap:1,columnCount:7,overflow:"auto",children:I[u].map(C=>E(C,u.slice(0,-1)))})]})]})},wR=o=>{const{avatarInfo:t=null,setAvatarInfo:s=null,onClose:n=null}=o,[r,a]=i.useState(null),[l,c]=i.useState(!1),[m,h]=i.useState(null),{roomSession:u=null}=ke(),[g,f]=i.useState(null),[p,x]=i.useState(null),[I,j]=i.useState(null),[E,C]=i.useState(2),[b,S]=i.useState(2),[_,T]=i.useState(2),[P,k]=i.useState(!1),R=`background-${g}`,y=`stand-${p}`,O=`overlay-${I}`,F=_??b??E,V=M=>{!l||M.length>K("motto.max.length",38)||(u.sendMottoMessage(M),c(!1))},Y=M=>V(M.target.value),q=M=>{switch(M.stopPropagation(),M.key){case"Enter":V(M.target.value);return}};return He(RE.RSUBE_BADGES,M=>{!t||t.webID!==M.userId||t.badges.join("")===M.badges.join("")||s(he=>{const pe=is(he);return pe.badges=M.badges,pe})}),He(OE.USER_FIGURE,M=>{if(!t||t.roomIndex!==M.roomIndex)return;s(Qe=>{const Ee=is(Qe);return Ee.figure=M.figure,Ee.motto=M.customInfo,Ee.backgroundId=M.backgroundId,Ee.standId=M.standId,Ee.overlayId=M.overlayId,Ee.achievementScore=M.activityPoints,Ee});const X=K("backgrounds.data")||[],he=K("stands.data")||[],pe=K("overlays.data")||[],qe=X.find(Qe=>Qe.backgroundId===M.backgroundId),wt=he.find(Qe=>Qe.standId===M.standId),be=pe.find(Qe=>Qe.overlayId===M.overlayId);C(qe?qe.AvatarDirection??2:2),S(wt?wt.AvatarDirection??2:2),T(be?be.AvatarDirection??2:2)}),He(kE.FAVOURITE_GROUP_UPDATE,M=>{!t||t.roomIndex!==M.roomIndex||s(X=>{const he=is(X),pe=M.status===-1||M.habboGroupId<=0;return he.groupId=pe?-1:M.habboGroupId,he.groupName=pe?null:M.habboGroupName,he.groupBadgeId=pe?null:G().getGroupBadge(M.habboGroupId),he})}),U(zm,M=>{const X=M.getParser();!t||t.webID!==X.userId||h(X)}),i.useEffect(()=>{c(!1),a(t.motto),f(t.backgroundId),x(t.standId),j(t.overlayId);const M=K("backgrounds.data")||[],X=K("stands.data")||[],he=K("overlays.data")||[],pe=M.find(be=>be.backgroundId===t.backgroundId),qe=X.find(be=>be.standId===t.standId),wt=he.find(be=>be.overlayId===t.overlayId);return C(pe?pe.AvatarDirection??2:2),S(qe?qe.AvatarDirection??2:2),T(wt?wt.AvatarDirection??2:2),D(new Ym(t.webID)),()=>{c(!1),a(null),h(null),f(null),x(null),j(null),C(2),S(2),T(2)}},[t]),t?e.jsxs(N,{className:"nitro-infostand rounded",children:[e.jsxs(N,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(vs,{userId:t.webID}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:t.name})]}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:n})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsxs(N,{position:"relative",pointer:!0,fullWidth:!0,className:`body-image profile-background ${R}`,onClick:M=>ls(t.webID),children:[e.jsx(A,{position:"absolute",className:`body-image profile-stand ${y}`}),e.jsx(it,{figure:t.figure,direction:F,style:{position:"relative",top:"-10px"}}),e.jsx(A,{position:"absolute",className:`body-image profile-overlay ${O}`}),t.type===It.OWN_USER&&e.jsx(A,{position:"absolute",className:"icon edit-icon edit-icon-position",onClick:M=>{M.stopPropagation(),k(X=>!X)}})]}),e.jsxs(N,{grow:!0,alignItems:"center",gap:0,children:[e.jsxs(w,{gap:1,children:[e.jsx(w,{center:!0,className:"badge-image",children:t.badges[0]&&e.jsx(Xe,{badgeCode:t.badges[0],showInfo:!0})}),e.jsx(w,{center:!0,pointer:t.groupId>0,className:"badge-image",onClick:M=>di(t.groupId),children:t.groupId>0&&e.jsx(Xe,{badgeCode:t.groupBadgeId,isGroup:!0,showInfo:!0,customTitle:t.groupName})})]}),e.jsxs(w,{center:!0,gap:1,children:[e.jsx(w,{center:!0,className:"badge-image",children:t.badges[1]&&e.jsx(Xe,{badgeCode:t.badges[1],showInfo:!0})}),e.jsx(w,{center:!0,className:"badge-image",children:t.badges[2]&&e.jsx(Xe,{badgeCode:t.badges[2],showInfo:!0})})]}),e.jsxs(w,{center:!0,gap:1,children:[e.jsx(w,{center:!0,className:"badge-image",children:t.badges[3]&&e.jsx(Xe,{badgeCode:t.badges[3],showInfo:!0})}),e.jsx(w,{center:!0,className:"badge-image",children:t.badges[4]&&e.jsx(Xe,{badgeCode:t.badges[4],showInfo:!0})})]})]})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:[t.type!==It.OWN_USER&&e.jsx(w,{grow:!0,alignItems:"center",className:"motto-content",children:e.jsx(v,{fullWidth:!0,pointer:!0,wrap:!0,textBreak:!0,small:!0,variant:"white",children:r})}),t.type===It.OWN_USER&&e.jsxs(w,{grow:!0,alignItems:"center",gap:2,children:[e.jsx(vg,{className:"small fa-icon"}),e.jsxs(w,{grow:!0,alignItems:"center",className:"motto-content",children:[!l&&e.jsxs(v,{fullWidth:!0,pointer:!0,wrap:!0,textBreak:!0,small:!0,variant:"white",onClick:M=>c(!0),children:[r," "]}),l&&e.jsx("input",{type:"text",className:"motto-input",maxLength:K("motto.max.length",38),value:r,onChange:M=>a(M.target.value),onBlur:Y,onKeyDown:q,autoFocus:!0})]})]})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.achievement_score")+" "+t.achievementScore}),t.carryItem>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(v,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+t.carryItem)])})]})]}),e.jsx(N,{gap:1,children:e.jsx(CR,{relationships:m})}),K("user.tags.enabled")&&e.jsx(N,{gap:1,className:"mt-1",children:e.jsx(NR,{tags:G().tags})})]}),P&&t.type===It.OWN_USER&&e.jsx(SR,{setIsVisible:k,selectedBackground:g,setSelectedBackground:f,selectedStand:p,setSelectedStand:x,selectedOverlay:I,setSelectedOverlay:j,setBackgroundDirection:C,setStandDirection:S,setOverlayDirection:T})]}):null},$i=0,Pl=1,Hd=2,Wd=3,Ll=4,qd=5,zd=6,TR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,[n,r]=i.useState($i),{canRequestFriend:a=null}=fs(),{report:l=null}=Ws(),{roomSession:c=null}=ke(),{userRespectRemaining:m=0,respectUser:h=null}=Yn(),u=i.useMemo(()=>t.amIOwner&&t.targetRoomControllerLevel<Ke.GUEST&&!t.isGuildRoom,[t]),g=i.useMemo(()=>t.amIOwner&&t.targetRoomControllerLevel===Ke.GUEST&&!t.isGuildRoom,[t]),f=i.useMemo(()=>t.canBeKicked||t.canBeBanned||t.canBeMuted||u||g,[u,g,t]),p=i.useMemo(()=>{let I=!1;const j=Mr();if(j){const E=j.model.getValue(te.FIGURE_CARRY_OBJECT);E>0&&E<999999&&(I=!0)}return I},[]),x=I=>{let j=!0;if(I)switch(I){case"moderate":j=!1,r(Pl);break;case"ban":j=!1,r(Hd);break;case"mute":j=!1,r(Wd);break;case"ambassador":j=!1,r(Ll);break;case"ambassador_mute":j=!1,r(qd);break;case"back_moderate":j=!1,r(Pl);break;case"back_ambassador":j=!1,r(Ll);break;case"back":j=!1,r($i);break;case"whisper":Nt(new Tr(Tr.WHISPER,t.name));break;case"friend":Z(`friends/request/${t.webID}/${t.name}`);break;case"relationship":j=!1,r(zd);break;case"respect":{h(t.webID),m-1>=1&&(j=!1);break}case"ignore":G().ignoreUser(t.name);break;case"unignore":G().unignoreUser(t.name);break;case"kick":c.sendKickMessage(t.webID);break;case"ban_hour":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_HOUR");break;case"ban_day":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_DAY");break;case"perm_ban":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_PERM");break;case"mute_2min":c.sendMuteMessage(t.webID,2);break;case"mute_5min":c.sendMuteMessage(t.webID,5);break;case"mute_10min":c.sendMuteMessage(t.webID,10);break;case"give_rights":c.sendGiveRightsMessage(t.webID);break;case"remove_rights":c.sendTakeRightsMessage(t.webID);break;case"trade":D(new DE(t.roomIndex));break;case"report":l(rt.BULLY,{reportedUserId:t.webID});break;case"pass_hand_item":D(new AE(t.webID));break;case"ambassador_alert":c.sendAmbassadorAlertMessage(t.webID);break;case"ambassador_kick":c.sendKickMessage(t.webID);break;case"ambassador_mute_2min":c.sendMuteMessage(t.webID,2);break;case"ambassador_mute_10min":c.sendMuteMessage(t.webID,10);break;case"ambassador_mute_60min":c.sendMuteMessage(t.webID,60);break;case"ambassador_mute_18hour":c.sendMuteMessage(t.webID,1080);break;case"rship_heart":D(new Na(t.webID,hs.RELATIONSHIP_HEART));break;case"rship_smile":D(new Na(t.webID,hs.RELATIONSHIP_SMILE));break;case"rship_bobba":D(new Na(t.webID,hs.RELATIONSHIP_BOBBA));break;case"rship_none":D(new Na(t.webID,hs.RELATIONSHIP_NONE));break}j&&s()};return i.useEffect(()=>{r($i)},[t]),e.jsxs(Rn,{objectId:t.roomIndex,category:Q.UNIT,userType:t.userType,onClose:s,collapsable:!0,children:[e.jsx(as,{className:"cursor-pointer",onClick:I=>ls(t.webID),dangerouslySetInnerHTML:{__html:`${t.name}`}}),n===$i&&e.jsxs(e.Fragment,{children:[a(t.webID)&&e.jsx(W,{onClick:I=>x("friend"),children:d("infostand.button.friend")}),e.jsx(W,{onClick:I=>x("trade"),children:d("infostand.button.trade")}),e.jsx(W,{onClick:I=>x("whisper"),children:d("infostand.button.whisper")}),m>0&&e.jsx(W,{onClick:I=>x("respect"),children:d("infostand.button.respect",["count"],[m.toString()])}),!a(t.webID)&&e.jsxs(W,{onClick:I=>x("relationship"),children:[d("infostand.link.relationship"),e.jsx(ws,{className:"right fa-icon"})]}),!t.isIgnored&&e.jsx(W,{onClick:I=>x("ignore"),children:d("infostand.button.ignore")}),t.isIgnored&&e.jsx(W,{onClick:I=>x("unignore"),children:d("infostand.button.unignore")}),e.jsx(W,{onClick:I=>x("report"),children:d("infostand.button.report")}),f&&e.jsxs(W,{onClick:I=>x("moderate"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.moderate")]}),t.isAmbassador&&e.jsxs(W,{onClick:I=>x("ambassador"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.ambassador")]}),p&&e.jsx(W,{onClick:I=>x("pass_hand_item"),children:d("avatar.widget.pass_hand_item")})]}),n===Pl&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("kick"),children:d("infostand.button.kick")}),e.jsxs(W,{onClick:I=>x("mute"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.button.mute")]}),e.jsxs(W,{onClick:I=>x("ban"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.button.ban")]}),u&&e.jsx(W,{onClick:I=>x("give_rights"),children:d("infostand.button.giverights")}),g&&e.jsx(W,{onClick:I=>x("remove_rights"),children:d("infostand.button.removerights")}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Hd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ban_hour"),children:d("infostand.button.ban_hour")}),e.jsx(W,{onClick:I=>x("ban_day"),children:d("infostand.button.ban_day")}),e.jsx(W,{onClick:I=>x("perm_ban"),children:d("infostand.button.perm_ban")}),e.jsxs(W,{onClick:I=>x("back_moderate"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Wd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("mute_2min"),children:d("infostand.button.mute_2min")}),e.jsx(W,{onClick:I=>x("mute_5min"),children:d("infostand.button.mute_5min")}),e.jsx(W,{onClick:I=>x("mute_10min"),children:d("infostand.button.mute_10min")}),e.jsxs(W,{onClick:I=>x("back_moderate"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Ll&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ambassador_alert"),children:d("infostand.button.alert")}),e.jsx(W,{onClick:I=>x("ambassador_kick"),children:d("infostand.button.kick")}),e.jsxs(W,{onClick:I=>x("ambassador_mute"),children:[d("infostand.button.mute"),e.jsx(ws,{className:"right fa-icon"})]}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===qd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ambassador_mute_2min"),children:d("infostand.button.mute_2min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_10min"),children:d("infostand.button.mute_10min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_60min"),children:d("infostand.button.mute_60min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_18hr"),children:d("infostand.button.mute_18hour")}),e.jsxs(W,{onClick:I=>x("back_ambassador"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===zd&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:I=>x("rship_heart"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-heart"})}),e.jsx(W,{onClick:I=>x("rship_smile"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-smile"})}),e.jsx(W,{onClick:I=>x("rship_bobba"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba"})})]}),e.jsx(W,{onClick:I=>x("rship_none"),children:d("avatar.widget.clear_relationship")}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]})]})},Yh=o=>{const{classNames:t=[],...s}=o,n=i.useMemo(()=>{const r=["menu-list"];return t.length&&r.push(...t),r},[t]);return e.jsx(N,{classNames:n,...s})},yR=o=>{const{userId:t=-1,userName:s="",roomIndex:n=-1,setIsDecorating:r=null}=o;return e.jsx(Rn,{objectId:n,category:Q.UNIT,onClose:null,children:e.jsx(Yh,{children:e.jsx(W,{onClick:a=>r(!1),children:d("widget.avatar.stop_decorating")})})})},RR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,n=r=>{if(r)switch(r){case"move":_r(t.id,t.category,Bs.OBJECT_MOVE);break;case"rotate":_r(t.id,t.category,Bs.OBJECT_ROTATE_POSITIVE);break;case"pickup":_r(t.id,t.category,Bs.OBJECT_PICKUP);break;case"eject":_r(t.id,t.category,Bs.OBJECT_EJECT);break}};return e.jsxs(Rn,{objectId:t.id,category:t.category,onClose:s,collapsable:!0,children:[e.jsx(as,{children:t.name}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:r=>n("move"),children:e.jsx(Ng,{className:"center fa-icon"})}),e.jsx(W,{onClick:r=>n("rotate"),disabled:t.isWallItem,children:e.jsx(_g,{className:"center fa-icon"})}),(t.isOwner||t.isAnyRoomController)&&e.jsx(W,{onClick:r=>n("pickup"),children:e.jsx(tu,{className:"center fa-icon"})}),!t.isOwner&&!t.isAnyRoomController&&(t.isRoomOwner||t.roomControllerLevel>=Ke.GUILD_ADMIN)&&e.jsx(W,{onClick:r=>n("eject"),children:e.jsx(tu,{className:"center fa-icon"})})]})]})},Yd=o=>{const{nameInfo:t=null,onClose:s=null}=o,n=i.useMemo(()=>{const r=["name-only"];return t.isFriend&&r.push("is-friend"),r},[t]);return e.jsx(Rn,{objectId:t.roomIndex,category:t.category,userType:t.userType,fades:t.id!==G().userId,classNames:n,onClose:s,children:e.jsx("div",{className:"text-shadow",dangerouslySetInnerHTML:{__html:`${t.name}`}})})},Ml=0,Ul=1,$d=3,Kd=4,OR=o=>{const{avatarInfo:t=null,isDancing:s=!1,setIsDecorating:n=null,onClose:r=null}=o,[a,l]=i.useState(s&&Nr()?Ul:Ml),{roomSession:c=null}=ke(),m=g=>{let f=!0;if(g)if(g.startsWith("sign_")){const p=parseInt(g.split("_")[1]);c.sendSignMessage(p)}else switch(g){case"decorate":n(!0);break;case"change_name":Nt(new ai(ai.INIT));break;case"change_looks":Z("avatar-editor/show");break;case"expressions":f=!1,l($d);break;case"sit":c.sendPostureMessage(po.POSTURE_SIT);break;case"stand":c.sendPostureMessage(po.POSTURE_STAND);break;case"wave":c.sendExpressionMessage(gn.WAVE.ordinal);break;case"blow":c.sendExpressionMessage(gn.BLOW.ordinal);break;case"laugh":c.sendExpressionMessage(gn.LAUGH.ordinal);break;case"idle":c.sendExpressionMessage(gn.IDLE.ordinal);break;case"dance_menu":f=!1,l(Ul);break;case"dance":c.sendDanceMessage(1);break;case"dance_stop":c.sendDanceMessage(0);break;case"dance_1":case"dance_2":case"dance_3":case"dance_4":c.sendDanceMessage(parseInt(g.charAt(g.length-1)));break;case"signs":f=!1,l(Kd);break;case"back":f=!1,l(Ml);break;case"drop_carry_item":D(new PE);break}f&&r()},h=()=>t.amIOwner||t.amIAnyRoomController||t.roomControllerLevel>Ke.GUEST,u=LC();return e.jsxs(Rn,{objectId:t.roomIndex,category:Q.UNIT,userType:t.userType,onClose:r,collapsable:!0,children:[e.jsx(as,{className:"cursor-pointer",onClick:g=>ls(t.webID),children:t.name}),a===Ml&&e.jsxs(e.Fragment,{children:[t.allowNameChange&&e.jsx(W,{onClick:g=>m("change_name"),children:d("widget.avatar.change_name")}),h()&&e.jsx(W,{onClick:g=>m("decorate"),children:d("widget.avatar.decorate")}),e.jsx(W,{onClick:g=>m("change_looks"),children:d("widget.memenu.myclothes")}),Nr()&&!u&&e.jsxs(W,{onClick:g=>m("dance_menu"),children:[e.jsx(ws,{className:"right fa-icon"}),d("widget.memenu.dance")]}),!s&&!Nr()&&!u&&e.jsx(W,{onClick:g=>m("dance"),children:d("widget.memenu.dance")}),s&&!Nr()&&!u&&e.jsx(W,{onClick:g=>m("dance_stop"),children:d("widget.memenu.dance.stop")}),e.jsxs(W,{onClick:g=>m("expressions"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.expressions")]}),e.jsxs(W,{onClick:g=>m("signs"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.show.signs")]}),t.carryItem>0&&e.jsx(W,{onClick:g=>m("drop_carry_item"),children:d("avatar.widget.drop_hand_item")})]}),a===Ul&&e.jsxs(e.Fragment,{children:[s&&e.jsx(W,{onClick:g=>m("dance_stop"),children:d("widget.memenu.dance.stop")}),e.jsx(W,{onClick:g=>m("dance_1"),children:d("widget.memenu.dance1")}),e.jsx(W,{onClick:g=>m("dance_2"),children:d("widget.memenu.dance2")}),e.jsx(W,{onClick:g=>m("dance_3"),children:d("widget.memenu.dance3")}),e.jsx(W,{onClick:g=>m("dance_4"),children:d("widget.memenu.dance4")}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),a===$d&&e.jsxs(e.Fragment,{children:[DC()===oa.POSTURE_STAND&&e.jsx(W,{onClick:g=>m("sit"),children:d("widget.memenu.sit")}),CC()&&e.jsx(W,{onClick:g=>m("stand"),children:d("widget.memenu.stand")}),_l()&&e.jsx(W,{onClick:g=>m("wave"),children:d("widget.memenu.wave")}),_l()&&e.jsxs(W,{disabled:!Li(),onClick:g=>m("laugh"),children:[!Li()&&e.jsx(_t,{type:"hc"}),d("widget.memenu.laugh")]}),_l()&&e.jsxs(W,{disabled:!Li(),onClick:g=>m("blow"),children:[!Li()&&e.jsx(_t,{type:"hc"}),d("widget.memenu.blow")]}),e.jsx(W,{onClick:g=>m("idle"),children:d("widget.memenu.idle")}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),a===Kd&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_1"),children:"1"}),e.jsx(W,{onClick:g=>m("sign_2"),children:"2"}),e.jsx(W,{onClick:g=>m("sign_3"),children:"3"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_4"),children:"4"}),e.jsx(W,{onClick:g=>m("sign_5"),children:"5"}),e.jsx(W,{onClick:g=>m("sign_6"),children:"6"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_7"),children:"7"}),e.jsx(W,{onClick:g=>m("sign_8"),children:"8"}),e.jsx(W,{onClick:g=>m("sign_9"),children:"9"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_10"),children:"10"}),e.jsx(W,{onClick:g=>m("sign_11"),children:e.jsx("i",{className:"icon icon-sign-heart"})}),e.jsx(W,{onClick:g=>m("sign_12"),children:e.jsx("i",{className:"icon icon-sign-skull"})})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_0"),children:"0"}),e.jsx(W,{onClick:g=>m("sign_13"),children:e.jsx("i",{className:"icon icon-sign-exclamation"})}),e.jsx(W,{onClick:g=>m("sign_15"),children:e.jsx("i",{className:"icon icon-sign-smile"})})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_14"),children:e.jsx("i",{className:"icon icon-sign-soccer"})}),e.jsx(W,{onClick:g=>m("sign_17"),children:e.jsx("i",{className:"icon icon-sign-yellow"})}),e.jsx(W,{onClick:g=>m("sign_16"),children:e.jsx("i",{className:"icon icon-sign-red"})})]}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]})]})},Fl=0,Xd=1,Qd=2,Jd=3,kR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,[n,r]=i.useState(Fl),{roomSession:a=null}=ke(),{petRespectRemaining:l=0,respectPet:c=null}=Yn(),m=i.useMemo(()=>{let u=!1;const g=Mr();if(g){const f=g.model.getValue(te.FIGURE_CARRY_OBJECT);f>0&&f<999999&&(u=!0)}return u},[]),h=u=>{let g=!0;if(u)switch(u){case"respect":c(t.id),l-1>=1&&(g=!1);break;case"treat":D(new _c(t.id));break;case"pass_handitem":D(new $m(t.id));break;case"train":a.requestPetCommands(t.id);break;case"pick_up":a.pickupPet(t.id);break;case"mount":a.mountPet(t.id);break;case"toggle_riding_permission":a.togglePetRiding(t.id);break;case"toggle_breeding_permission":a.togglePetBreeding(t.id);break;case"dismount":a.dismountPet(t.id);break;case"saddle_off":a.removePetSaddle(t.id);break;case"breed":break;case"harvest":a.harvestPet(t.id);break;case"revive":break;case"compost":a.compostPlant(t.id);break;case"buy_saddle":Z("catalog/open/"+K("catalog.links")["pets.buy_saddle"]);break}g&&s()};return i.useEffect(()=>{r(u=>t.petType===Gt.MONSTERPLANT?Jd:t.saddle&&!t.rider?Xd:t.rider?Qd:Fl)},[t]),e.jsxs(Rn,{objectId:t.roomIndex,category:Q.UNIT,userType:gt.PET,onClose:s,collapsable:!0,children:[e.jsx(as,{children:t.name}),n===Fl&&e.jsxs(e.Fragment,{children:[l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),e.jsx(W,{onClick:u=>h("train"),children:d("infostand.button.train")}),e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),t.petType===Gt.HORSE&&e.jsx(W,{onClick:u=>h("buy_saddle"),children:d("infostand.button.buy_saddle")}),[Gt.BEAR,Gt.TERRIER,Gt.CAT,Gt.DOG,Gt.PIG].indexOf(t.petType)>-1&&e.jsx(W,{onClick:u=>h("breed"),children:d("infostand.button.breed")})]}),n===Xd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("mount"),children:d("infostand.button.mount")}),e.jsxs(W,{onClick:u=>h("toggle_riding_permission"),gap:1,children:[e.jsx("input",{type:"checkbox",checked:!!t.publiclyRideable,readOnly:!0}),d("infostand.button.toggle_riding_permission")]}),l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),e.jsx(W,{onClick:u=>h("train"),children:d("infostand.button.train")}),e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),e.jsx(W,{onClick:u=>h("saddle_off"),children:d("infostand.button.saddleoff")})]}),n===Qd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("dismount"),children:d("infostand.button.dismount")}),l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===Jd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),t.dead&&e.jsx(W,{onClick:u=>h("revive"),children:d("infostand.button.revive")}),a.isRoomOwner&&e.jsx(W,{onClick:u=>h("compost"),children:d("infostand.button.compost")}),!t.dead&&t.energy/t.maximumEnergy<.98&&e.jsx(W,{onClick:u=>h("treat"),children:d("infostand.button.pettreat")}),!t.dead&&t.level===t.maximumLevel&&t.breedable&&e.jsxs(e.Fragment,{children:[e.jsxs(W,{onClick:u=>h("toggle_breeding_permission"),gap:1,children:[e.jsx("input",{type:"checkbox",checked:t.publiclyBreedable,readOnly:!0}),d("infostand.button.toggle_breeding_permission")]}),e.jsx(W,{onClick:u=>h("breed"),children:d("infostand.button.breed")})]})]}),m&&e.jsx(W,{onClick:u=>h("pass_hand_item"),children:d("infostand.button.pass_hand_item")})]})},Vl=0,Zd=1,em=2,tm=3,AR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,[n,r]=i.useState(Vl),{roomSession:a=null}=ke(),{petRespectRemaining:l=0,respectPet:c=null}=Yn(),m=i.useMemo(()=>a.isRoomOwner||a.controllerLevel>=Ke.GUEST||G().isModerator,[a]),h=i.useMemo(()=>{let g=!1;const f=Mr();if(f){const p=f.model.getValue(te.FIGURE_CARRY_OBJECT);p>0&&p<999999&&(g=!0)}return g},[]),u=g=>{let f=!0;if(g)switch(g){case"respect":c(t.id),l-1>=1&&(f=!1);break;case"treat":D(new _c(t.id));break;case"pass_handitem":D(new $m(t.id));break;case"pick_up":a.pickupPet(t.id);break;case"mount":a.mountPet(t.id);break;case"dismount":a.dismountPet(t.id);break}f&&s()};return i.useEffect(()=>{r(g=>t.petType===Gt.MONSTERPLANT?tm:t.saddle&&!t.rider?Zd:t.rider?em:Vl)},[t]),e.jsxs(Rn,{objectId:t.roomIndex,category:Q.UNIT,userType:gt.PET,onClose:s,collapsable:!0,children:[e.jsx(as,{children:t.name}),n===Vl&&l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),n===Zd&&e.jsxs(e.Fragment,{children:[!!t.publiclyRideable&&e.jsx(W,{onClick:g=>u("mount"),children:d("infostand.button.mount")}),l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===em&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:g=>u("dismount"),children:d("infostand.button.dismount")}),l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===tm&&!t.dead&&t.energy/t.maximumEnergy<.98&&e.jsx(W,{onClick:g=>u("treat"),children:d("infostand.button.pettreat")}),m&&e.jsx(W,{onClick:g=>u("pick_up"),children:d("infostand.button.pickup")}),h&&e.jsx(W,{onClick:g=>u("pass_hand_item"),children:d("infostand.button.pass_hand_item")})]})},Gl=0,sm=1,nm=2,DR=o=>{const{avatarInfo:t=null,onClose:s=null}=o,[n,r]=i.useState(Gl),[a,l]=i.useState(""),[c,m]=i.useState("");U(LE,f=>{const p=f.getParser();if(p.botId===t.webID)switch(p.commandId){case Ye.CHANGE_BOT_NAME:l(p.data),r(sm);return;case Ye.CHANGE_BOT_MOTTO:m(p.data),r(nm);return;case Ye.SETUP_CHAT:{const x=p.data,I=x.split(x.indexOf(";#;")===-1?";":";#;");(I.length===3||I.length===4)&&(Nt(new fo(t.roomIndex,Q.UNIT,t.webID,I[0],I[1].toLowerCase()==="true"||I[1]==="1",parseInt(I[2]),I[3]?I[3].toLowerCase()==="true"||I[3]==="1":!1)),s());return}}});const h=f=>D(new ME(t.webID,f)),u=f=>{let p=!0;if(f)switch(f){case"donate_to_all":h(Ye.DONATE_TO_ALL),D(new Ln(t.webID,Ye.DONATE_TO_ALL,""));break;case"donate_to_user":h(Ye.DONATE_TO_USER),D(new Ln(t.webID,Ye.DONATE_TO_USER,""));break;case"change_bot_name":h(Ye.CHANGE_BOT_NAME),p=!1;break;case"save_bot_name":D(new Ln(t.webID,Ye.CHANGE_BOT_NAME,a));break;case"change_bot_motto":h(Ye.CHANGE_BOT_MOTTO),p=!1;break;case"save_bot_motto":D(new Ln(t.webID,Ye.CHANGE_BOT_MOTTO,c));break;case"dress_up":D(new Ln(t.webID,Ye.DRESS_UP,""));break;case"random_walk":D(new Ln(t.webID,Ye.RANDOM_WALK,""));break;case"setup_chat":h(Ye.SETUP_CHAT),p=!1;break;case"dance":D(new Ln(t.webID,Ye.DANCE,""));break;case"nux_take_tour":Ce().createLinkEvent("help/tour"),D(new Ln(t.webID,Ye.NUX_TAKE_TOUR,""));break;case"pick":D(new qm(t.webID));break}p&&s()};i.useEffect(()=>{r(Gl)},[t]);const g=t.amIOwner||t.amIAnyRoomController;return e.jsxs(Rn,{objectId:t.roomIndex,category:Q.UNIT,userType:gt.RENTABLE_BOT,onClose:s,collapsable:!0,children:[e.jsx(as,{children:t.name}),n===Gl&&g&&e.jsxs(e.Fragment,{children:[t.botSkills.indexOf(Ye.DONATE_TO_ALL)>=0&&e.jsx(W,{onClick:f=>u("donate_to_all"),children:d("avatar.widget.donate_to_all")}),t.botSkills.indexOf(Ye.DONATE_TO_USER)>=0&&e.jsx(W,{onClick:f=>u("donate_to_user"),children:d("avatar.widget.donate_to_user")}),t.botSkills.indexOf(Ye.CHANGE_BOT_NAME)>=0&&e.jsx(W,{onClick:f=>u("change_bot_name"),children:d("avatar.widget.change_bot_name")}),t.botSkills.indexOf(Ye.CHANGE_BOT_MOTTO)>=0&&e.jsx(W,{onClick:f=>u("change_bot_motto"),children:d("avatar.widget.change_bot_motto")}),t.botSkills.indexOf(Ye.DRESS_UP)>=0&&e.jsx(W,{onClick:f=>u("dress_up"),children:d("avatar.widget.dress_up")}),t.botSkills.indexOf(Ye.RANDOM_WALK)>=0&&e.jsx(W,{onClick:f=>u("random_walk"),children:d("avatar.widget.random_walk")}),t.botSkills.indexOf(Ye.SETUP_CHAT)>=0&&e.jsx(W,{onClick:f=>u("setup_chat"),children:d("avatar.widget.setup_chat")}),t.botSkills.indexOf(Ye.DANCE)>=0&&e.jsx(W,{onClick:f=>u("dance"),children:d("avatar.widget.dance")}),t.botSkills.indexOf(Ye.NO_PICK_UP)===-1&&e.jsx(W,{onClick:f=>u("pick"),children:d("avatar.widget.pick_up")})]}),n===sm&&e.jsxs(N,{className:"menu-item",onClick:null,gap:1,children:[e.jsx(v,{variant:"white",children:d("bot.skill.name.configuration.new.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:a,maxLength:K("bot.name.max.length",15),onChange:f=>l(f.target.value)}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"secondary",onClick:f=>u(null),children:d("cancel")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:f=>u("save_bot_name"),children:d("save")})]})]}),n===nm&&e.jsxs(N,{className:"menu-item",onClick:null,gap:1,children:[e.jsx(v,{variant:"white",children:d("bot.skill.name.configuration.new.motto")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:c,maxLength:K("motto.max.length",38),onChange:f=>m(f.target.value)}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"secondary",onClick:f=>u(null),children:d("cancel")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:f=>u("save_bot_motto"),children:d("save")})]})]})]})},PR=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState(null),{avatarInfo:c=null,setAvatarInfo:m=null,activeNameBubble:h=null,setActiveNameBubble:u=null,nameBubbles:g=[],removeNameBubble:f=null,productBubbles:p=[],confirmingProduct:x=null,updateConfirmingProduct:I=null,removeProductBubble:j=null,isDecorating:E=!1,setIsDecorating:C=null}=v_(),{roomSession:b=null}=ke();we(ys.NORMAL_MODE,T=>{t&&s(!1)}),we(ys.GAME_MODE,T=>{t||s(!0)}),He(UE.RSDE_DANCE,T=>{T.roomIndex===b.ownRoomIndex&&r(T.danceId!==0)}),ut(fo.UPDATE_CHAT,T=>l(T));const S=()=>{if(!b||t)return null;if(h)return e.jsx(Yd,{nameInfo:h,onClose:()=>u(null)});if(c)switch(c.type){case Rr.FURNI:{const T=c;return E?e.jsx(RR,{avatarInfo:T,onClose:()=>m(null)}):null}case It.OWN_USER:case It.PEER:{const T=c;return K("user.tags.enabled")&&G().getUserTags(T.roomIndex),T.isSpectatorMode?null:T.isOwnUser?zl.isRunning()?null:e.jsx(OR,{avatarInfo:T,isDancing:n,setIsDecorating:C,onClose:()=>m(null)}):e.jsx(TR,{avatarInfo:T,onClose:()=>m(null)})}case Or.PET_INFO:{const T=c;return T.isOwner?e.jsx(kR,{avatarInfo:T,onClose:()=>m(null)}):e.jsx(AR,{avatarInfo:T,onClose:()=>m(null)})}case kr.RENTABLE_BOT:return e.jsx(DR,{avatarInfo:c,onClose:()=>m(null)})}return null},_=()=>{if(!c)return null;switch(c.type){case Rr.FURNI:return e.jsx(IR,{avatarInfo:c,onClose:()=>m(null)});case It.OWN_USER:case It.PEER:return e.jsx(wR,{avatarInfo:c,setAvatarInfo:m,onClose:()=>m(null)});case It.BOT:return e.jsx(jR,{avatarInfo:c,onClose:()=>m(null)});case kr.RENTABLE_BOT:return e.jsx(ER,{avatarInfo:c,onClose:()=>m(null)});case Or.PET_INFO:return e.jsx(bR,{avatarInfo:c,onClose:()=>m(null)})}};return e.jsxs(e.Fragment,{children:[E&&e.jsx(yR,{userId:G().userId,userName:G().userName,roomIndex:b.ownRoomIndex,setIsDecorating:C}),S(),c&&e.jsx(N,{alignItems:"end",className:"nitro-infostand-container",children:_()}),g.length>0&&g.map((T,P)=>e.jsx(Yd,{nameInfo:T,onClose:()=>f(P)},P)),p.length>0&&p.map((T,P)=>e.jsx(xR,{item:T,updateConfirmingProduct:I,onClose:()=>j(P)},T.id)),a&&e.jsx(dR,{chatEvent:a,onClose:()=>l(null)}),x&&e.jsx(mR,{item:x,onClose:()=>I(null)}),e.jsx(uR,{})]})},LR=o=>{const{chatStyleId:t=0,chatStyleIds:s=null,selectChatStyleId:n=null}=o,[r,a]=i.useState(null),[l,c]=i.useState(!1),m=u=>{n(u),c(!1)},h=u=>{let g=!1;c(f=>(g=!f,g)),g&&a(u.target)};return i.useEffect(()=>{l||a(null)},[l]),e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,className:"icon chatstyles-icon",onClick:h}),e.jsx(qo,{show:l,target:r,placement:"top",children:e.jsx(ua,{className:"nitro-chat-style-selector-container",children:e.jsx(se,{overflow:"hidden",className:"bg-transparent bubble-window image-rendering-pixelated",children:e.jsx(ne,{gap:1,columnCount:3,overflow:"auto",children:s&&s.length>0&&s.map(u=>e.jsx(w,{center:!0,pointer:!0,className:"bubble-parent-container",onClick:g=>m(u),children:e.jsx(A,{className:"bubble-container",children:e.jsx(A,{className:`chat-bubble bubble-${u}`,children:" "})},u)},u))})})})})]})},MR=o=>{const{addChatEmoji:t=null}=o,[s,n]=i.useState(!1),[r,a]=i.useState(null),l=i.useRef(null),c=i.useRef(null),m=g=>{t(g.native),n(!1)},h=g=>{c.current&&!c.current.contains(g.target)&&!g.target.classList.contains("emoji-icon")&&(n(!1),document.removeEventListener("mousedown",h),a(null))},u=g=>{n(f=>!f)};return i.useEffect(()=>{s?document.addEventListener("mousedown",h):a(null)},[c,s]),e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,onClick:u,innerRef:l,children:"🙂"}),e.jsx(qo,{show:s,target:l,placement:"top-end",children:e.jsx(ua,{children:e.jsx(Sg,{data:wg,onEmojiSelect:m})})})]})},UR=o=>{const{chatColour:t="black",selectColour:s=null}=o,[n,r]=i.useState(!1),[a,l]=i.useState(null),c=i.useRef(null);i.useEffect(()=>{const u=new Set(["r","b","g","y","w","o","c","br","pr","pk"]),g=new Map;$.forEach((f,p)=>{!u.has(p)&&!Array.from(g.values()).includes(f)&&g.set(p,f)}),l(g)},[]);const m=u=>{s(u),r(!1)},h=()=>{r(u=>!u)};return e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,onClick:()=>h(),innerRef:c,style:{color:(a&&a.get(t))??"black"},children:e.jsx(Tg,{})}),e.jsx(qo,{show:n,target:c,placement:"top",children:e.jsx(ua,{className:"nitro-chat-style-selector-container",children:e.jsx(se,{overflow:"hidden",className:"bg-transparent colour-container image-rendering-pixelated",children:e.jsx(Pe,{gap:1,columnCount:6,columnMinWidth:20,columnMinHeight:20,children:a&&a.size>0&&Array.from(a).map(([u,g])=>e.jsx(_e,{itemHighlight:!0,itemColor:g,itemActive:t===u,className:"clear-bg",onClick:f=>m(u)},u))})})})})]})},FR=o=>{const[t,s]=i.useState(""),{chatStyleId:n=0,updateChatStyleId:r=null,chatColour:a="",updateChatColour:l=null}=Yn(),{selectedUsername:c="",floodBlocked:m=!1,floodBlockedSeconds:h=0,setIsTyping:u=null,setIsIdle:g=null,sendChat:f=null}=__(),[p,x]=i.useState(!1),{roomSession:I=null}=ke(),j=i.useRef(),E=i.useMemo(()=>d("widgets.chatinput.mode.whisper"),[]),C=i.useMemo(()=>d("widgets.chatinput.mode.shout"),[]),b=i.useMemo(()=>d("widgets.chatinput.mode.speak"),[]),S=i.useMemo(()=>K("chat.input.maxlength",100),[]),_=i.useCallback(()=>{const V=document.activeElement;return!(!V||j&&j.current===V||!(V instanceof HTMLInputElement)&&!(V instanceof HTMLTextAreaElement))},[j]),T=i.useCallback(()=>{j.current.focus(),j.current.setSelectionRange(j.current.value.length*2,j.current.value.length*2)},[j]),P=i.useCallback(()=>{s(V=>V!==E||!c.length?V:`${V} ${c}`)},[c,E]),k=i.useCallback((V,Y=!1)=>{if(!V||V==="")return;let q=Y?xn.CHAT_SHOUT:xn.CHAT_DEFAULT,M=V;const X=M.split(" ");let he="",pe="";switch(X[0]){case E:q=xn.CHAT_WHISPER,he=X[1],pe=E+" "+he+" ",X.shift(),X.shift();break;case C:q=xn.CHAT_SHOUT,X.shift();break;case b:q=xn.CHAT_DEFAULT,X.shift();break}M=X.join(" "),u(!1),g(!1),M.length<=S&&(/%CC%/g.test(encodeURIComponent(M))?s(""):(s(""),f(M,q,he,n,a))),s(pe)},[E,C,b,S,n,u,g,f,a]),R=i.useCallback(V=>{!V||!V.length?u(!1):(u(!0),g(!0)),s(V)},[u,g]),y=i.useCallback(V=>{if(m||!j.current||_())return;document.activeElement!==j.current&&T();const Y=V.target.value;switch(V.key){case" ":case"Space":P();return;case"NumpadEnter":case"Enter":k(Y,V.shiftKey);return;case"Backspace":if(Y){const q=Y.split(" ");q[0]===E&&q.length===3&&q[2]===""&&s("")}return}},[m,j,E,_,T,P,k]);ut(Tr.CHAT_INPUT_CONTENT,V=>{switch(V.chatMode){case Tr.WHISPER:{s(`${E} ${V.userName} `);return}case Tr.SHOUT:return}});const O=i.useMemo(()=>{let V=[];const Y=K("chat.styles");for(const q of Y)if(q){if(q.minRank>0){G().hasSecurity(q.minRank)&&V.push(q.styleId);continue}if(q.isSystemStyle&&G().hasSecurity(Ke.MODERATOR)){V.push(q.styleId);continue}if(!(K("chat.styles.disabled").indexOf(q.styleId)>=0)){if(q.isHcOnly&&Cs()>=Wt.CLUB){V.push(q.styleId);continue}if(q.isAmbassadorOnly&&G().isAmbassador){V.push(q.styleId);continue}!q.isHcOnly&&!q.isAmbassadorOnly&&V.push(q.styleId)}}return V},[]),F=V=>{s(t+V),u(!0)};return i.useEffect(()=>(document.body.addEventListener("keydown",y),()=>{document.body.removeEventListener("keydown",y)}),[y]),i.useEffect(()=>{j.current&&(j.current.parentElement.dataset.value=t)},[t]),!I||I.isSpectator?null:Ho.createPortal(e.jsxs("div",{className:"nitro-chat-input-container",onMouseEnter:()=>x(!0),onMouseLeave:()=>setTimeout(()=>x(!1),100),children:[e.jsxs("div",{className:"input-sizer align-items-center",children:[!m&&e.jsx("input",{ref:j,type:"text",className:"chat-input",placeholder:d("widgets.chatinput.default"),value:t,maxLength:S,onChange:V=>R(V.target.value),onMouseDown:V=>T()}),m&&e.jsxs(v,{variant:"danger",children:[d("chat.input.alert.flood",["time"],[h.toString()])," "]})]}),e.jsxs(w,{children:[e.jsx(MR,{addChatEmoji:F}),e.jsx(UR,{chatColour:a,selectColour:l}),e.jsx(LR,{chatStyleId:n,chatStyleIds:O,selectChatStyleId:r}),p&&e.jsx(A,{className:"info-habbopages",onClick:()=>Z("habbopages/chat/chatting")})]})]}),document.getElementById("toolbar-chat-input-container"))},VR=()=>{let o=null;self.onmessage=t=>{if(!t)return;const s=t.data;switch(s.action){case"START":o=setInterval(()=>postMessage(null),s.content);break;case"STOP":o&&(clearInterval(o),o=null);break}}};class GR extends Worker{constructor(t){const s=t.toString(),n=new Blob([`(${s})()`]);super(URL.createObjectURL(n))}}const BR=o=>{const{chat:t=null,makeRoom:s=null,bubbleWidth:n=vt.CHAT_BUBBLE_WIDTH_NORMAL,selectedEmoji:r}=o,[a,l]=i.useState(!1),[c,m]=i.useState(!1),{onClickChat:h=null}=Rh(),u=i.useRef(),g=i.useMemo(()=>{switch(n){case vt.CHAT_BUBBLE_WIDTH_NORMAL:return 350;case vt.CHAT_BUBBLE_WIDTH_THIN:return 240;case vt.CHAT_BUBBLE_WIDTH_WIDE:return 2e3}},[n]);return i.useEffect(()=>{l(!1);const f=u.current;if(!f)return;const p=f.offsetWidth,x=f.offsetHeight;t.width=p,t.height=x,t.elementRef=f;let I=t.left,j=t.top;return!I&&!j&&(I=t.location.x-p/2,j=f.parentElement.offsetHeight-x,t.left=I,t.top=j),m(!0),()=>{t.elementRef=null,m(!1)}},[t]),i.useEffect(()=>{!c||!t||a||(s&&s(t),l(!0))},[t,c,a,s]),e.jsxs("div",{ref:u,className:`bubble-container newbubblehe ${a?"visible":"invisible"}`,onClick:f=>H().selectRoomObject(t.roomId,t.senderId,Q.UNIT),children:[r&&e.jsx("span",{children:DOMPurify.sanitize(r)}),t.styleId===0&&e.jsx("div",{className:"user-container-bg",style:{backgroundColor:t.color}}),e.jsxs("div",{className:`chat-bubble bubble-${t.styleId} type-${t.type}`,style:{maxWidth:g},children:[e.jsx("div",{className:"user-container",children:t.imageUrl&&t.imageUrl.length>0&&e.jsx("div",{className:"user-image",style:{backgroundImage:`url(${t.imageUrl})`}})}),e.jsxs("div",{className:"chat-content",children:[e.jsx("b",{className:"username mr-1",dangerouslySetInnerHTML:{__html:`${t.username}: `}}),e.jsx("span",{className:"message",style:{color:t.chatColours},dangerouslySetInnerHTML:{__html:`${t.formattedText}`},onClick:f=>h(f)})]}),e.jsx("div",{className:"pointer"})]})]})},HR=o=>{const{chatMessages:t=[],setChatMessages:s=null,chatSettings:n=null,getScrollSpeed:r=6e3}=w_(),a=i.useRef(),l=i.useCallback(()=>{s(h=>{if(h){const u=h.filter(g=>g.top>-g.height*2);if(u.length!==h.length)return u}return h})},[s]),c=i.useCallback((h,u,g)=>{for(let f=t.indexOf(h)-1;f>=0;f--){const p=t[f];if(!(!p||h===p||g.indexOf(p)>=0||p.top+p.height-u>h.top+h.height)&&Cv(h,p,-u,0)){const x=Math.abs(p.top+p.height-h.top);g.push(p),p.top-=x,p.skipMovement=!0,c(p,x,g)}}},[t]),m=i.useCallback(h=>{if(n.mode===vt.CHAT_MODE_FREE_FLOW)h.skipMovement=!0,c(h,0,[h]),l();else{const u=h.top+h.height,g=h.height,f=a.current.offsetHeight-u,p=g-f;f<g&&(s(x=>(x.forEach(I=>{I!==h&&(I.top-=p)}),x)),l())}},[n,c,l,s]);return i.useEffect(()=>{const h=(u=null)=>{if(!a||!a.current)return;const g=a.current.offsetHeight,f=Math.round(document.body.offsetHeight*K("chat.viewer.height.percentage"));a.current.style.height=`${f}px`,s(p=>(p&&p.forEach(x=>x.top-=g-f),p))};return window.addEventListener("resize",h),h(),()=>{window.removeEventListener("resize",h)}},[s]),i.useEffect(()=>{const h=g=>{s(f=>(f.forEach(p=>{if(p.skipMovement){p.skipMovement=!1;return}p.top-=g}),f)),l()},u=new GR(VR);return u.onmessage=()=>h(15),u.postMessage({action:"START",content:r}),()=>{u.postMessage({action:"STOP"}),u.terminate()}},[r,l,s]),e.jsx("div",{ref:a,className:"nitro-chat-widget",children:t.map(h=>e.jsx(BR,{chat:h,makeRoom:m,bubbleWidth:n.weight},h.id))})},rm=100,$h=o=>{const{title:t=null,items:s=[],selectItem:n=null,onClose:r=null,pickallFurni:a=!1,type:l="furni"}=o,[c,m]=i.useState([]),[h,u]=i.useState(""),g=G().isModerator,[f,p]=i.useState(!1),[x,I]=i.useState([]),j=i.useMemo(()=>Array.from(new Set(s.map(y=>y.ownerName||"Unknown"))).sort(),[s]),[E,C]=i.useState(()=>a?"all":j.length>0?j[0]:"");i.useEffect(()=>{!a&&j.length>0&&!E&&C(j[0])},[a,j,E]);const b=R=>{if(R)S(R)?I(x.filter(y=>y!==R)):x.length<rm&&I([...x,R]);else if(p(y=>!y),f)I([]);else{const y=T.map(O=>O.id).slice(0,rm);I(y)}},S=R=>x.includes(R),_=()=>{D(new FE(...x)),I([]),p(!1),Zs.clearAll(),m([])},T=i.useMemo(()=>{const R=h.toLocaleLowerCase();return s.filter(y=>{var V;const O=(V=y.name)==null?void 0:V.toLocaleLowerCase().includes(R),F=a?E==="all"||y.ownerName===E:E?y.ownerName===E:!0;return O&&F}).sort((y,O)=>y.name.localeCompare(O.name))},[s,h,E,a]);i.useEffect(()=>{c.length!==0&&(n(c[c.length-1]),Zs.clearAll(),c.forEach(R=>{R.id&&R.category&&Zs.show(R.id,R.category)}))},[c,n]);const P=R=>{m(y=>y.some(O=>O.id===R.id)?(Zs.hide(R.id,R.category),y.filter(O=>O.id!==R.id)):[...y,R])},k=()=>{Zs.clearAll(),m([]),r()};return e.jsxs(ae,{className:"nitro-chooser-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:t+" ("+T.length+")",onCloseClick:k}),e.jsxs(se,{overflow:"hidden",gap:1,children:[e.jsxs(w,{gap:2,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:h,onChange:R=>u(R.target.value)}),a&&e.jsxs("select",{className:"form-control form-control-sm",value:E,onChange:R=>C(R.target.value),children:[e.jsx("option",{value:"all",children:d("roomsettings.access_rights.anyone")}),j.length>0?j.map((R,y)=>e.jsx("option",{value:R,children:R},y)):e.jsx("option",{disabled:!0,children:"No owners found"})]})]}),a&&e.jsxs(w,{gap:2,className:"text-black",children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:f,onChange:()=>b()}),e.jsx("label",{className:"form-check-label",children:d("widget.chooser.checkall")})]}),e.jsx(rl,{rows:T,rowRender:R=>e.jsxs(w,{alignItems:"center",className:$t("rounded p-1",c.some(y=>y.id===R.id)&&"bg-muted"),pointer:!0,onClick:y=>{P(R)},children:[a&&e.jsx("input",{className:"flex-shrink-0 mx-1 form-check-input",type:"checkbox",checked:S(R.id),onChange:()=>b(R.id)}),e.jsxs(v,{truncate:!0,children:[R.name," ",g&&" - "+R.id,l==="furni"&&R.ownerName&&R.ownerName!=="-"&&` (Owner: ${R.ownerName})`]})]}),scrollToBottom:!1}),a&&e.jsx(L,{variant:"secondary",onClick:_,disabled:!x.length,children:d("widget.chooser.btn.pickall")})]})]})},WR=o=>{const{items:t=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=P_(),{roomSession:a=null}=ke();return i.useEffect(()=>{const l={linkReceived:c=>{c.split("/"),r()},eventUrlPrefix:"furni-chooser/"};return ft(l),()=>{Zs.clearAll(),pt(l)}},[r]),t?e.jsx($h,{title:d("widget.chooser.furni.title"),items:t,selectItem:n,onClose:()=>{Zs.clearAll(),s()},pickallFurni:a==null?void 0:a.isRoomOwner,type:"furni"}):null},qR=o=>{const{items:t=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=G_(),{roomSession:a=null}=ke();return i.useEffect(()=>{const l={linkReceived:c=>{c.split("/"),r()},eventUrlPrefix:"user-chooser/"};return ft(l),()=>{Zs.clearAll(),pt(l)}},[r]),t?e.jsx($h,{title:d("widget.chooser.user.title"),items:t,selectItem:n,onClose:()=>{Zs.clearAll(),s()},pickallFurni:!1,type:"users"}):null},zR=o=>{const[t,s]=i.useState(!1),{users:n=[],answer:r=null}=y_();return i.useEffect(()=>{s(!!n.length)},[n]),t?e.jsxs(ae,{className:"nitro-widget-doorbell",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.doorbell.title"),onCloseClick:a=>s(!1)}),e.jsxs(se,{overflow:"hidden",gap:0,children:[e.jsx(N,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom px-1 pb-1",children:[e.jsx(A,{className:"g-col-6",children:d("generic.username")}),e.jsx(A,{className:"g-col-6"})]})}),e.jsx(N,{overflow:"auto",className:"striped-children",gap:0,children:n&&n.length>0&&n.map(a=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black border-bottom p-1",children:[e.jsx(A,{className:"g-col-6",children:a}),e.jsx(A,{className:"g-col-6",children:e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(L,{variant:"success",onClick:()=>r(a,!0),children:d("generic.accept")}),e.jsx(L,{variant:"danger",onClick:()=>r(a,!1),children:d("generic.deny")})]})})]},a))})]})]}):null},Kc=o=>{const{objectId:t=-1,category:s=-1,noFollow:n=!1,position:r="absolute",...a}=o,[l,c]=i.useState({x:-1,y:-1}),m=i.useRef();return i.useEffect(()=>{let h=!1;const u=()=>{const f=Oe();return wc(f.roomId,t,s,1)},g=()=>{const f=u();!f||!m.current||c({x:Math.round(f.left+f.width/2-m.current.offsetWidth/2),y:Math.round(f.top-m.current.offsetHeight+10)})};return n?g():(h=!0,qn().add(g)),()=>{h&&qn().remove(g)}},[t,s,n]),e.jsx(A,{innerRef:m,position:r,visible:l.x+(m.current?m.current.offsetWidth:0)>-1,className:"object-location",style:{left:l.x,top:l.y},...a})},YR=o=>{const{roomIndex:t=-1,request:s=null,hideFriendRequest:n=null,requestResponse:r=null}=o;return e.jsx(Kc,{objectId:t,category:Q.UNIT,children:e.jsx(A,{className:"nitro-friend-request-dialog nitro-context-menu p-2",children:e.jsxs(N,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,children:[e.jsx(v,{variant:"white",fontSize:6,children:d("widget.friendrequest.from",["username"],[s.name])}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:a=>n(s.requesterUserId)})]}),e.jsxs(w,{justifyContent:"end",gap:1,children:[e.jsx(L,{variant:"danger",onClick:a=>r(s.requesterUserId,!1),children:d("widget.friendrequest.decline")}),e.jsx(L,{variant:"success",onClick:a=>r(s.requesterUserId,!0),children:d("widget.friendrequest.accept")})]})]})})})},$R=o=>{const{displayedRequests:t=[],hideFriendRequest:s=null}=A_(),{requestResponse:n=null}=fs();return t.length?e.jsx(e.Fragment,{children:t.map((r,a)=>e.jsx(YR,{roomIndex:r.roomIndex,request:r.request,hideFriendRequest:s,requestResponse:n},a))}):null},KR=o=>{const{productType:t=xe.FLOOR,classId:s=-1,extraParam:n=void 0}=o;switch(t){case xe.WALL:case xe.FLOOR:return e.jsx(Jo,{productType:t,productClassId:s});case xe.BADGE:return e.jsx(Xe,{badgeCode:n});case xe.HABBO_CLUB:return e.jsx(_t,{type:"hc"})}return null},XR=o=>{const{ownerId:t=-1}=o,[s,n]=i.useState(0),[r,a]=i.useState(void 0),l=()=>{s===1&&D(new HE(t)),n(0),a(void 0)};U(VE,m=>{n(1)}),U(GE,m=>{n(0),a(void 0)}),U(BE,m=>{const h=m.getParser();a({contentType:h.contentType,classId:h.classId}),n(2)});const c=G().userId===t;return s===0?null:e.jsxs(ae,{className:"nitro-mysterybox-dialog",theme:"primary-slim",children:[e.jsx(re,{headerText:d(s===1?`mysterybox.dialog.${c?"owner":"other"}.title`:"mysterybox.reward.title"),onCloseClick:l}),e.jsxs(se,{children:[s===1&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:"primary",children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.subtitle`)," "]}),e.jsxs(v,{children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.description`)," "]}),e.jsxs(v,{children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.waiting`)]}),e.jsxs(L,{variant:"danger",onClick:l,className:"mt-auto",children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.cancel`)," "]})]}),s===2&&r&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:"black",children:[" ",d("mysterybox.reward.text")," "]}),e.jsx(w,{className:"prize-container justify-content-center mx-auto",children:e.jsx(KR,{classId:r.classId,productType:r.contentType})}),e.jsxs(L,{variant:"success",onClick:l,className:"mt-auto",children:[" ",d("mysterybox.reward.close")," "]})]})]})]})},QR=o=>{const{objectId:t=-1,onClose:s=null}=o,[n,r]=i.useState(""),a=()=>{D(new WE(t,n)),s()};return t===-1?null:e.jsxs(ae,{className:"nitro-mysterytrophy-dialog no-resize",theme:"primary-slim",children:[e.jsx(re,{center:!0,headerText:d("mysterytrophy.header.title"),onCloseClick:s}),e.jsxs(se,{children:[e.jsxs(w,{className:"mysterytrophy-dialog-top p-3",children:[e.jsx("div",{className:"mysterytrophy-image flex-shrink-0"}),e.jsx("div",{className:"m-2",children:e.jsx(v,{variant:"white",className:"mysterytrophy-text-big",children:d("mysterytrophy.header.description")})})]}),e.jsx(w,{className:"mysterytrophy-dialog-bottom p-2",children:e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"bg-white rounded py-1 px-2 input-mysterytrophy-dialog",children:[e.jsx("textarea",{className:"form-control form-control-sm input-mysterytrophy",value:n,onChange:l=>r(l.target.value)}),e.jsx("div",{className:"mysterytrophy-pencil-image flex-shrink-0 small fa-icon"})]}),e.jsxs(w,{className:"mt-2",gap:5,display:"flex",justifyContent:"center",alignItems:"center",children:[e.jsx(v,{pointer:!0,className:"text-decoration",onClick:()=>s(),children:d("cancel")}),e.jsx(L,{variant:"success",onClick:()=>a(),children:d("generic.ok")})]})]})})]})]})},JR=o=>{const{objectId:t=-1,onClose:s=null}=o,{roomSession:n=null}=ke(),r=()=>{n.useMultistateItem(t),s()};return e.jsxs(ae,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("effectbox.header.title"),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsx(w,{gap:2,children:e.jsxs(N,{justifyContent:"between",children:[e.jsx(v,{children:d("effectbox.header.description")}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(L,{variant:"danger",onClick:s,children:d("generic.cancel")}),e.jsx(L,{variant:"success",onClick:r,children:d("generic.ok")})]})]})})})]})},Ki=-1,ZR=0,eO=o=>{const{objectId:t=-1,onClose:s=null}=o,[n,r]=i.useState(null),[a,l]=i.useState(Ki),{roomSession:c=null}=ke(),m=()=>{c.useMultistateItem(t),s()};return i.useEffect(()=>{if(!c||t===-1)return;const h=Yo(c.roomId,t,Q.FLOOR);if(!h)return;r(h);let u=Ki;switch(h.specialType){case de.MONSTERPLANT_SEED:u=ZR;break}if(u===Ki){s();return}l(u)},[c,t,s]),a===Ki?null:e.jsxs(ae,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title.plant_seed",["name"],[n.name]),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(N,{children:e.jsx(A,{className:"product-preview",children:e.jsx(A,{className:"monsterplant-image"})})}),e.jsxs(N,{justifyContent:"between",overflow:"auto",children:[e.jsxs(N,{gap:2,children:[e.jsx(v,{children:d("useproduct.widget.text.plant_seed",["productName"],[n.name])}),e.jsx(v,{children:d("useproduct.widget.info.plant_seed")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(L,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(L,{variant:"success",onClick:m,children:d("widget.monsterplant_seed.button.use")})]})]})]})})]})},Xi=-1,tO=0,sO=o=>{const{objectId:t=-1,onClose:s=null}=o,[n,r]=i.useState(Xi),[a,l]=i.useState(Se.MALE),[c,m]=i.useState(null),{roomSession:h=null}=ke(),u=()=>{Xl().send(new qE(t)),Xl().send(new Dm(a,c)),s()};return i.useEffect(()=>{let g=Xi;const f=G().figure,p=G().gender,x=[];if(h&&t>=0){const I=Yo(h.roomId,t,Q.FLOOR);if(I)switch(I.specialType){case de.FIGURE_PURCHASABLE_SET:g=tO;const j=I.customParams.split(",").map(E=>parseInt(E));for(const E of j)St().isValidFigureSetForGender(E,p)&&x.push(E);break}}if(g===Xi){s();return}l(p),m(St().getFigureStringWithFigureIds(f,p,x)),r(g)},[h,t,s]),n===Xi?null:e.jsxs(ae,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title.bind_clothing"),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(N,{children:e.jsx(A,{className:"mannequin-preview",children:e.jsx(it,{figure:c,direction:2})})}),e.jsxs(N,{justifyContent:"between",overflow:"auto",children:[e.jsxs(N,{gap:2,children:[e.jsx(v,{children:d("useproduct.widget.text.bind_clothing")}),e.jsx(v,{children:d("useproduct.widget.info.bind_clothing")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(L,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(L,{variant:"success",onClick:u,children:d("useproduct.widget.bind_clothing")})]})]})]})})]})},nO=o=>{const{closeConfirm:t=null,processAction:s=null,onClose:n=null,objectId:r=-1,mode:a=null,confirmMode:l=null,confirmingObjectId:c=-1,groupData:m=null,isGroupMember:h=!1,objectOwnerId:u=-1}=kN(),{simpleAlert:g=null}=Fe();U(zE,p=>{const x=p.getParser();if(x)switch(x.count){case 1:g(d("costumehopper.costumerequired.bodytext"),null,"catalog/open/temporary_effects",d("costumehopper.costumerequired.buy"),d("costumehopper.costumerequired.header"),null);break;case 2:g(d("viphopper.viprequired.bodytext"),null,"catalog/open/habbo_club",d("viprequired.buy.vip"),d("viprequired.header"),null);break;case 3:g(d("gate.viprequired.bodytext"),null,"catalog/open/habbo_club",d("viprequired.buy.vip"),d("gate.viprequired.title"),null);break}});const f=G().userId===u;return e.jsxs(e.Fragment,{children:[l===ic&&e.jsx(eO,{objectId:c,onClose:t}),l===oc&&e.jsx(sO,{objectId:c,onClose:t}),l===yh&&e.jsx(JR,{objectId:c,onClose:t}),l===lc&&e.jsx(QR,{objectId:c,onClose:t}),e.jsx(XR,{ownerId:u}),r>=0&&a&&e.jsxs(Rn,{objectId:r,category:Q.FLOOR,onClose:n,fades:!0,children:[a===Vt.FRIEND_FURNITURE&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("friendfurni.context.title")}),e.jsx(W,{onClick:p=>s("use_friend_furni"),children:d("friendfurni.context.use")})]}),a===Vt.MONSTERPLANT_SEED&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("furni.mnstr_seed.name")}),e.jsx(W,{onClick:p=>s("use_monsterplant_seed"),children:d("widget.monsterplant_seed.button.use")})]}),a===Vt.RANDOM_TELEPORT&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("furni.random_teleport.name")}),e.jsx(W,{onClick:p=>s("use_random_teleport"),children:d("widget.random_teleport.button.use")})]}),a===Vt.PURCHASABLE_CLOTHING&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("furni.generic_usable.name")}),e.jsx(W,{onClick:p=>s("use_purchaseable_clothing"),children:d("widget.generic_usable.button.use")})]}),a===Vt.MYSTERY_BOX&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("mysterybox.context.title")}),e.jsx(W,{onClick:p=>s("use_mystery_box"),children:d("mysterybox.context."+(f?"owner":"other")+".use")})]}),a===Vt.MYSTERY_TROPHY&&e.jsxs(e.Fragment,{children:[e.jsx(as,{children:d("mysterytrophy.header.title")}),e.jsx(W,{onClick:p=>s("use_mystery_trophy"),children:d("friendfurni.context.use")})]}),a===Th&&m&&e.jsxs(e.Fragment,{children:[e.jsx(as,{className:"cursor-pointer text-truncate",onClick:()=>di(m.guildId),children:m.guildName}),!h&&e.jsx(W,{onClick:p=>s("join_group"),children:d("widget.furniture.button.join.group")}),e.jsx(W,{onClick:p=>s("go_to_group_homeroom"),children:d("widget.furniture.button.go.to.group.home.room")}),m.guildHasReadableForum&&e.jsx(W,{onClick:p=>s("open_forum"),children:d("widget.furniture.button.open_group_forum")})]})]})]})},rO=o=>{const{objectId:t=-1,color:s=0,setColor:n=null,applyToner:r=null,toggleToner:a=null,onClose:l=null}=TN();return t===-1?null:e.jsxs(ae,{theme:"primary-slim",className:"nitro-room-widget-toner",children:[e.jsx(re,{headerText:d("widget.backgroundcolor.title"),onCloseClick:l}),e.jsxs(se,{overflow:"hidden",justifyContent:"between",children:[e.jsx(N,{overflow:"auto",gap:1,children:e.jsx("input",{type:"color",className:"form-control",value:gs.makeColorNumberHex(s),onChange:c=>n(gs.convertFromHex(c.target.value))})}),e.jsxs(N,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"primary",onClick:a,children:d("widget.backgroundcolor.button.on")}),e.jsx(L,{fullWidth:!0,variant:"primary",onClick:r,children:d("widget.backgroundcolor.button.apply")})]})]})]})},aO=o=>{const{objectId:t=-1,color:s="1",badgeName:n="",badgeDesc:r="",date:a="",senderName:l="",onClose:c=null}=RN();return t===-1?null:e.jsx(jh,{color:s,message:r,date:a,senderName:l,customTitle:n,onCloseClick:c})},iO=o=>{const{objectId:t=-1,recipes:s=[],ingredients:n=[],selectedRecipe:r=null,requiredIngredients:a=null,isCrafting:l=!1,craft:c=null,selectRecipe:m=null,onClose:h=null}=DN(),{roomSession:u=null}=ke(),[g,f]=i.useState(!1),p=i.useMemo(()=>{if(!u)return!1;const j=H().getRoomObject(u.roomId,t,Q.FLOOR);return Xt(j)},[t,u]),x=i.useMemo(()=>{if(!a||!a.length)return!1;for(const j of a){const E=n.find(C=>C.name===j.itemName);if(!E||E.count<j.count)return!1}return!0},[n,a]),I=()=>{if(!g){f(!0);return}c(),f(!1)};return i.useEffect(()=>{f(!1)},[r]),t===-1?null:e.jsxs(ae,{className:"nitro-widget-crafting",theme:"primary-slim",children:[e.jsx(re,{headerText:d("crafting.title"),onCloseClick:h}),e.jsx(se,{children:e.jsxs(w,{grow:!0,overflow:"hidden",gap:2,children:[e.jsxs(w,{column:!0,fullWidth:!0,gap:2,children:[e.jsxs(N,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.title.products")}),e.jsx(Pe,{columnCount:5,children:s.length>0&&s.map(j=>e.jsx(_e,{itemImage:j.iconUrl,itemActive:r&&r.name===j.name,onClick:()=>m(j)},j.name))})]}),e.jsxs(N,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.title.mixer")}),e.jsx(Pe,{columnCount:5,children:n.length>0&&n.map(j=>e.jsx(_e,{itemImage:j.iconUrl,itemCount:j.count,itemCountMinimum:0,className:(j.count?"":"opacity-0-5 ")+"cursor-default"},j.name))})]})]}),e.jsxs(w,{column:!0,fullWidth:!0,gap:2,children:[!r&&e.jsx(N,{center:!0,fullHeight:!0,className:"text-black text-center",children:d("crafting.info.start")}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.current_recipe")}),e.jsx(Pe,{columnCount:5,children:!!a&&a.length>0&&a.map(j=>{const E=n.find(b=>b.name===j.itemName),C=[];for(let b=0;b<j.count;b++)C.push(e.jsx(_e,{itemImage:E.iconUrl,className:(E.count-b<=0?"opacity-0-5 ":"")+"cursor-default"},b));return C})})]}),e.jsxs(w,{gap:2,column:!0,fullHeight:!0,children:[e.jsxs(w,{gap:2,className:"bg-muted rounded",column:!0,fullHeight:!0,children:[e.jsx("div",{className:"py-1 text-center",children:d("crafting.result")}),e.jsxs(w,{gap:1,center:!0,column:!0,fullHeight:!0,className:"pb-1",children:[e.jsx(N,{fullHeight:!0,children:e.jsx("img",{src:r.iconUrl})}),e.jsx("div",{className:"text-black",children:r.localizedName})]})]}),e.jsxs(L,{variant:!p||!x?"danger":g?"warning":l?"primary":"success",disabled:!p||!x||l,onClick:I,children:[!l&&d(p?x?g?"generic.confirm":"crafting.btn.craft":"crafting.status.recipe.incomplete":"crafting.btn.notowner"),l&&e.jsx(Pc,{})]})]})]})]})]})})]})},oO=o=>{const[t,s]=i.useState(!1),{presets:n=[],dimmerState:r=0,selectedPresetId:a=0,color:l=16777215,brightness:c=255,effectId:m=0,selectedColor:h=0,setSelectedColor:u=null,selectedBrightness:g=0,setSelectedBrightness:f=null,selectedEffectId:p=0,setSelectedEffectId:x=null,selectPresetId:I=null,applyChanges:j}=LN(),E=()=>{Fs.previewDimmer(l,c,m===2),s(!1)};we(ye.REMOVE_DIMMER,b=>s(!1)),i.useEffect(()=>{!n||!n.length||s(!0)},[n]);const C=i.useMemo(()=>K("widget.dimmer.colorwheel",!1),[]);return t?e.jsxs(ae,{className:"nitro-room-widget-dimmer",children:[e.jsx(re,{headerText:d("widget.dimmer.title"),onCloseClick:E}),r===1&&e.jsx(yn,{children:n.map(b=>e.jsx(sn,{isActive:a===b.id,onClick:S=>I(b.id),children:d(`widget.dimmer.tab.${b.id}`)},b.id))}),e.jsxs(se,{children:[r===0&&e.jsxs(N,{alignItems:"center",children:[e.jsx(A,{className:"dimmer-banner"}),e.jsx(v,{center:!0,className:"bg-muted rounded p-1",children:d("widget.dimmer.info.off")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:()=>Fs.changeState(),children:d("widget.dimmer.button.on")})]}),r===1&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{fontWeight:"bold",children:d("widget.backgroundcolor.hue")}),C&&e.jsx("input",{type:"color",className:"form-control",value:gs.makeColorNumberHex(h),onChange:b=>u(gs.convertFromHex(b.target.value))}),!C&&e.jsx(ne,{gap:1,columnCount:7,children:Fs.AVAILABLE_COLORS.map((b,S)=>e.jsx(N,{fullWidth:!0,pointer:!0,className:$t("color-swatch rounded",b===h&&"active"),onClick:()=>u(b),style:{backgroundColor:Fs.HTML_COLORS[S]}},S))})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{fontWeight:"bold",children:d("widget.backgroundcolor.lightness")}),e.jsx(Mt,{min:Fs.MIN_BRIGHTNESS,max:Fs.MAX_BRIGHTNESS,value:g,onChange:b=>f(b),thumbClassName:"thumb percent",renderThumb:(b,S)=>e.jsx("div",{...b,children:Fs.scaleBrightness(S.valueNow)})})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:p===2,onChange:b=>x(b.target.checked?2:1)}),e.jsx(v,{children:d("widget.dimmer.type.checkbox")})]}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"danger",onClick:()=>Fs.changeState(),children:d("widget.dimmer.button.off")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:j,children:d("widget.dimmer.button.apply")})]})]})]})]}):null},lO=o=>{const{objectId:t=-1,value:s=0,onClose:n=null,redeem:r=null}=UN();return t===-1?null:e.jsxs(ae,{className:"nitro-widget-exchange-credit",theme:"primary-slim",children:[e.jsx(re,{headerText:d("catalog.redeem.dialog.title"),onCloseClick:n}),e.jsx(se,{center:!0,children:e.jsxs(w,{overflow:"hidden",gap:2,children:[e.jsx(N,{center:!0,children:e.jsx(A,{className:"exchange-image"})}),e.jsxs(N,{grow:!0,justifyContent:"between",overflow:"hidden",children:[e.jsxs(N,{gap:1,overflow:"auto",children:[e.jsx(v,{fontWeight:"bold",children:d("creditfurni.description",["credits"],[s.toString()])}),e.jsx(v,{children:d("creditfurni.prompt")})]}),e.jsx(L,{variant:"success",onClick:r,children:d("catalog.redeem.dialog.button.exchange")})]})]})})]})},cO=o=>{const{currentIndex:t=-1,currentPhotos:s=null}=o,[n,r]=i.useState(0),a=s&&s.length?s[n]:null,l=()=>{r(h=>{let u=h+1;return u>=s.length&&(u=0),u})},c=()=>{r(h=>{let u=h-1;return u<0&&(u=s.length-1),u})},m=(h,u,g)=>{const f=H().getRoomObject(h,u,Q.WALL);if(f)return g=="username"?f.model.getValue(te.FURNITURE_OWNER_NAME):f.model.getValue(te.FURNITURE_OWNER_ID)};return i.useEffect(()=>{r(t)},[t]),a?e.jsxs(ne,{style:{display:"flex",flexDirection:"column"},children:[e.jsx(w,{center:!0,className:"picture-preview border border-black",style:a.w?{backgroundImage:"url("+a.w+")"}:{},children:!a.w&&e.jsx(v,{bold:!0,children:d("camera.loading")})}),a.m&&a.m.length&&e.jsx(v,{center:!0,children:a.m}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsxs(v,{children:[" ",new Date(a.t*1e3).toLocaleDateString(void 0,{day:"numeric",month:"long",year:"numeric"})," "]}),e.jsxs(v,{className:"username",onClick:()=>ls(Number(m(a.s,Number(a.u),"id"))),children:[" ",m(a.s,Number(a.u),"username")," "]})]}),s.length>1&&e.jsxs(w,{className:"picture-preview-buttons",children:[e.jsx(cm,{className:"cursor-pointer",onClick:c}),e.jsx(um,{className:"cursor-pointer",onClick:l})]})]}):null},uO=o=>{const{objectId:t=-1,currentPhotoIndex:s=-1,currentPhotos:n=null,onClose:r=null}=VN(),{report:a=null}=Ws();return t===-1||s===-1?null:e.jsxs(ae,{className:"nitro-external-image-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:d("camera.interface.title"),isGalleryPhoto:!0,onReportPhoto:()=>a(rt.PHOTO,{extraData:n[s].w,roomId:n[s].s,reportedUserId:G().userId,roomObjectId:Number(n[s].u)}),onCloseClick:r}),e.jsx(se,{children:e.jsx(cO,{currentIndex:s,currentPhotos:n})})]})},dO=o=>{const{objectId:t=-1,type:s=0,stage:n=0,usernames:r=[],figures:a=[],date:l=null,onClose:c=null,respond:m=null}=BN();if(t===-1)return null;if(n>0)return e.jsxs(ae,{className:"nitro-engraving-lock",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friend.furniture.confirm.lock.caption"),onCloseClick:c}),e.jsxs(se,{children:[e.jsx("h5",{className:"text-black text-center fw-bold mt-2 mb-2",children:d("friend.furniture.confirm.lock.subtitle")}),e.jsx("div",{className:"d-flex justify-content-center mb-2",children:e.jsx("div",{className:`engraving-lock-stage-${n}`})}),n===2&&e.jsx("div",{className:"text-small text-black text-center mb-2",children:d("friend.furniture.confirm.lock.other.locked")}),e.jsxs(w,{gap:1,children:[e.jsx(L,{fullWidth:!0,onClick:h=>m(!1),children:d("friend.furniture.confirm.lock.button.cancel")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:h=>m(!0),children:d("friend.furniture.confirm.lock.button.confirm")})]})]})]});if(r.length>0)return e.jsx(Ur,{handleSelector:".nitro-engraving-lock-view",children:e.jsxs("div",{className:`nitro-engraving-lock-view engraving-lock-${s}`,children:[e.jsx("div",{className:"engraving-lock-close",onClick:c}),e.jsxs(w,{justifyContent:"center",children:[e.jsx("div",{className:"engraving-lock-avatar",children:e.jsx(it,{figure:a[0],direction:2})}),e.jsx("div",{className:"engraving-lock-avatar",children:e.jsx(it,{figure:a[1],direction:4})})]}),e.jsxs(N,{justifyContent:"between",className:"mt-1",children:[e.jsxs(N,{alignItems:"center",justifyContent:"center",gap:1,children:[e.jsxs("div",{children:[s===0&&d("lovelock.engraving.caption"),s===3&&d("wildwest.engraving.caption")]}),e.jsx("div",{children:l})]}),e.jsxs(w,{justifyContent:"center",gap:4,children:[e.jsx("div",{children:r[0]}),e.jsx("div",{children:r[1]})]})]})]})})},mO=o=>{const{objectId:t=-1,itemType:s=null,text:n=null,isOwnerOfFurniture:r=!1,senderName:a=null,senderFigure:l=null,placedItemId:c=-1,placedInRoom:m=!1,imageUrl:h=null,openPresent:u=null,onClose:g=null}=n_(),{groupItems:f=[]}=dr();if(t===-1)return null;const p=I=>{const j=f.find(E=>{var C;return((C=E.getItemById(I))==null?void 0:C.id)===I});j&&ha(j),g()},x=I=>{_r(I,s===xe.WALL?Q.WALL:Q.FLOOR,Bs.OBJECT_PICKUP),g()};return e.jsxs(ae,{className:"nitro-gift-opening",theme:"primary-slim",children:[e.jsx(re,{headerText:d(a?"widget.furni.present.window.title_from":"widget.furni.present.window.title",["name"],[a]),onCloseClick:g}),e.jsxs(se,{children:[c===-1&&e.jsxs(N,{overflow:"hidden",children:[e.jsx(w,{center:!0,overflow:"auto",children:e.jsx(ph,{userName:a,figure:l,message:n})}),r&&e.jsxs(w,{gap:1,children:[a&&e.jsx(L,{fullWidth:!0,onClick:I=>Z("catalog/open"),children:d("widget.furni.present.give_gift",["name"],[a])}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:u,children:d("widget.furni.present.open_gift")})]})]}),c>-1&&e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(N,{center:!0,className:"p-2",children:e.jsx(Tn,{imageUrl:h})}),e.jsxs(N,{grow:!0,children:[e.jsxs(N,{center:!0,gap:1,children:[e.jsx(v,{wrap:!0,small:!0,children:d("widget.furni.present.message_opened")}),e.jsx(v,{bold:!0,fontSize:5,children:n})]}),e.jsxs(N,{grow:!0,gap:1,children:[e.jsxs(w,{gap:1,children:[m&&e.jsx(L,{fullWidth:!0,onClick:I=>x(c),children:d("widget.furni.present.put_in_inventory")}),e.jsx(L,{fullWidth:!0,variant:"success",onClick:I=>p(c),children:d(m?"widget.furni.present.keep_in_room":"widget.furni.present.place_in_room")})]}),a&&a.length&&e.jsx(L,{fullWidth:!0,onClick:I=>Z("catalog/open"),children:d("widget.furni.present.give_gift",["name"],[a])})]})]})]})]})]})},hO=o=>{const{stuffDatas:t=null,getScoreType:s=null,getClearType:n=null}=zN();return!t||!t.size?null:e.jsx(e.Fragment,{children:Array.from(t.entries()).map(([r,a],l)=>e.jsx(Kc,{objectId:r,category:Q.FLOOR,children:e.jsxs(N,{className:"nitro-widget-high-score nitro-context-menu",gap:0,children:[e.jsx(as,{children:d("high.score.display.caption",["scoretype","cleartype"],[d(`high.score.display.scoretype.${s(a.scoreType)}`),d(`high.score.display.cleartype.${n(a.clearType)}`)])}),e.jsxs(Yh,{overflow:"hidden",gap:1,className:"h-100",children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"px-2",children:[e.jsx(v,{bold:!0,variant:"white",className:"col-8",children:d("high.score.display.users.header")}),e.jsx(v,{align:"end",bold:!0,variant:"white",className:"col-4",children:d("high.score.display.score.header")})]}),e.jsx("hr",{className:"m-0"})]}),e.jsx(N,{overflow:"auto",gap:1,className:"px-2 overflow-y-scroll",children:a.entries.map((c,m)=>e.jsxs(w,{alignItems:"center",children:[e.jsx(v,{variant:"white",className:"col-8",children:c.users.join(", ")}),e.jsx(v,{align:"end",variant:"white",className:"col-4",children:c.score})]},m))})]})]})},l))})},gO=o=>(KN(),null),fO=-1,Qi=0,Bl=1,Hl=2,Wl=3,ql=4,pO=o=>{const[t,s]=i.useState(null),[n,r]=i.useState(fO),{objectId:a=-1,figure:l=null,gender:c=null,clubLevel:m=Wt.NO_CLUB,name:h=null,setName:u=null,saveFigure:g=null,wearFigure:f=null,saveName:p=null,onClose:x=null}=QN();return i.useEffect(()=>{if(a===-1)return;const I=Oe();if(I.isRoomOwner||I.controllerLevel>=Ke.GUEST||G().isModerator){r(Qi);return}if(G().gender.toLowerCase()!==c.toLowerCase()){r(ql);return}if(Cs()<m){r(Wl);return}r(Hl)},[a,c,m]),i.useEffect(()=>{switch(n){case Qi:case ql:{const I=St().createFigureContainer(l);ca.transformAsMannequinFigure(I),s(I.getFigureString());break}case Bl:{const I=St().createFigureContainer(G().figure);ca.transformAsMannequinFigure(I),s(I.getFigureString());break}case Hl:case Wl:{const I=ca.getMergedMannequinFigureContainer(G().figure,l);s(I.getFigureString());break}}},[n,l,m]),a===-1?null:e.jsxs(ae,{className:"nitro-mannequin no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("mannequin.widget.title"),onCloseClick:x}),e.jsx(se,{center:!0,children:e.jsxs(w,{fullWidth:!0,gap:2,overflow:"hidden",children:[e.jsx(N,{children:e.jsxs(A,{position:"relative",className:"mannequin-preview",children:[e.jsx(it,{position:"absolute",figure:t,direction:2}),m>0&&e.jsx(_t,{className:"position-absolute end-2 bottom-2",type:"hc"})]})}),e.jsxs(N,{grow:!0,justifyContent:"between",overflow:"auto",children:[n===Qi&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",value:h,onChange:I=>u(I.target.value),onBlur:p}),e.jsxs(N,{gap:1,children:[e.jsx(L,{variant:"success",onClick:I=>r(Bl),children:d("mannequin.widget.style")}),e.jsx(L,{variant:"success",onClick:f,children:d("mannequin.widget.wear")})]})]}),n===Bl&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:h}),e.jsx(v,{wrap:!0,children:d("mannequin.widget.savetext")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(v,{underline:!0,pointer:!0,onClick:I=>r(Qi),children:d("mannequin.widget.back")}),e.jsx(L,{variant:"success",onClick:g,children:d("mannequin.widget.save")})]})]}),n===Hl&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:h}),e.jsx(v,{children:d("mannequin.widget.weartext")})]}),e.jsx(L,{variant:"success",onClick:f,children:d("mannequin.widget.wear")})]}),n===Wl&&e.jsx(w,{center:!0,grow:!0,children:e.jsx(v,{children:d("mannequin.widget.clubnotification")})}),n===ql&&e.jsx(v,{children:d("mannequin.widget.wronggender")})]})]})})]})},xO=o=>(i_(),null),Kh=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],jO=["blue","pink","green","yellow"],IO=o=>{let t=Kh.indexOf(o);return t===-1&&(t=0),jO[t]},bO=o=>{const{objectId:t=-1,color:s="0",setColor:n=null,text:r="",setText:a=null,canModify:l=!1,onClose:c=null}=l_();return t===-1?null:e.jsx(Ur,{handleSelector:".drag-handler",windowPosition:Ot.TOP_LEFT,children:e.jsxs("div",{className:"nitro-stickie nitro-stickie-image stickie-"+IO(s),children:[e.jsxs("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[e.jsx("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:c}),Kh.map(m=>e.jsx("div",{className:"stickie-color ms-1",onClick:h=>n(m),style:{backgroundColor:gs.makeColorHex(m)}},m))]})}),e.jsx("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:c})]}),e.jsx("div",{className:"stickie-context",children:e.jsx("textarea",{className:"context-text",value:r,onChange:m=>a(m.target.value),tabIndex:0,autoFocus:!0})})]})})},EO=o=>{const{objectId:t=-1,height:s=0,maxHeight:n=40,onClose:r=null,updateHeight:a=null}=u_(),[l,c]=i.useState(""),m=h=>{c(h);const u=parseFloat(h);isNaN(u)||u===s||a(u)};return i.useEffect(()=>{c(s.toString())},[s]),t===-1?null:e.jsxs(ae,{className:"nitro-widget-custom-stack-height",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widget.custom.stack.height.title"),onCloseClick:r}),e.jsxs(se,{justifyContent:"between",children:[e.jsx(v,{children:d("widget.custom.stack.height.text")}),e.jsxs(w,{gap:2,children:[e.jsx(Mt,{min:0,max:n,step:.01,value:s,onChange:h=>a(h),renderThumb:(h,u)=>e.jsx("div",{...h,children:u.valueNow})}),e.jsx("input",{className:"show-number-arrows",style:{width:50},type:"number",min:0,max:n,value:l,onChange:h=>m(h.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(L,{onClick:h=>D(new Kl(t,-100)),children:d("furniture.above.stack")}),e.jsx(L,{onClick:h=>D(new Kl(t,0)),children:d("furniture.floor.level")})]})]})]})},Xh=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],CO=["blue","pink","green","yellow"],vO=["post_it","post_it_shakesp","post_it_dreams","post_it_xmas","post_it_vd","post_it_juninas"],NO=["post_it","shakesp","dreams","christmas","heart","juninas"],_O=o=>{let t=Xh.indexOf(o);return t===-1&&(t=0),CO[t]},SO=o=>{let t=vO.indexOf(o);return t===-1&&(t=0),NO[t]},wO=o=>{const{objectId:t=-1,color:s="0",text:n="",type:r="",canModify:a=!1,updateColor:l=null,updateText:c=null,trash:m=null,onClose:h=null}=m_(),[u,g]=i.useState(!1);return i.useEffect(()=>{g(!1)},[t,s,n,r]),t===-1?null:e.jsx(Ur,{handleSelector:".drag-handler",windowPosition:Ot.TOP_LEFT,children:e.jsxs("div",{className:"nitro-stickie nitro-stickie-image stickie-"+(r=="post_it"?_O(s):SO(r)),children:[e.jsxs("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[e.jsx("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:m}),r=="post_it"&&e.jsx(e.Fragment,{children:Xh.map(f=>e.jsx("div",{className:"stickie-color ms-1",onClick:p=>l(f),style:{backgroundColor:gs.makeColorHex(f)}},f))})]})}),e.jsx("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:h})]}),e.jsx("div",{className:"stickie-context",children:!u||!a?e.jsx("div",{className:"context-text",onClick:f=>a&&g(!0),children:n}):e.jsx("textarea",{className:"context-text",defaultValue:n,tabIndex:0,onBlur:f=>c(f.target.value),autoFocus:!0})})]})})},TO=o=>{const{objectId:t=-1,color:s="1",senderName:n="",date:r="",message:a="",onClose:l=null}=g_();return t===-1?null:e.jsx(jh,{color:s,message:a,date:r,senderName:n,onCloseClick:l})},yO=o=>{const[t,s]=i.useState(null),{objectId:n=-1,videoId:r=null,videoStart:a=0,videoEnd:l=0,currentVideoState:c=null,selectedVideo:m=null,playlists:h=[],onClose:u=null,previous:g=null,next:f=null,pause:p=null,play:x=null,selectVideo:I=null}=b_(),j=C=>{if(s(C.target),n!==-1)switch(C.target.getPlayerState()){case-1:case 1:c!==1&&x();return;case 2:c!==2&&p()}};if(i.useEffect(()=>{if(!(c===null||!t)){if(c===ar.PLAYING&&t.getPlayerState()!==ar.PLAYING){t.playVideo();return}if(c===ar.PAUSED&&t.getPlayerState()!==ar.PAUSED){t.pauseVideo();return}}},[c,t]),n===-1)return null;const E={height:"375",width:"500",playerVars:{autoplay:1,disablekb:1,controls:0,origin:window.origin,modestbranding:1,start:a,end:l}};return e.jsxs(ae,{className:"youtube-tv-widget",children:[e.jsx(re,{headerText:d("catalog.page.youtube_tvs"),onCloseClick:u}),e.jsx(se,{children:e.jsxs("div",{className:"row w-100 h-100",children:[e.jsxs("div",{className:"youtube-video-container col-9 overflow-hidden",children:[r&&r.length>0&&e.jsx(yg,{videoId:r,opts:E,onReady:C=>s(C.target),onStateChange:j,containerClassName:"youtubeContainer"}),(!r||r.length===0)&&e.jsx("div",{className:"empty-video w-100 h-100 justify-content-center align-items-center d-flex",children:d("widget.furni.video_viewer.no_videos")})]}),e.jsxs("div",{className:"playlist-container col-3 d-flex flex-column",children:[e.jsxs("span",{className:"playlist-controls justify-content-center d-flex",children:[e.jsx("i",{className:"icon icon-youtube-prev cursor-pointer",onClick:g}),e.jsx("i",{className:"icon icon-youtube-next cursor-pointer",onClick:f})]}),e.jsx("div",{className:"mb-1",children:d("widget.furni.video_viewer.playlists")}),e.jsx(Pe,{columnCount:1,columnMinWidth:80,columnMinHeight:100,className:"mb-1",overflow:"auto",children:h&&h.map((C,b)=>e.jsx(_e,{onClick:S=>I(C.video),itemActive:C.video===m,children:e.jsx("b",{children:C.title})},b))})]})]})})]})},RO=o=>{const{diskInventory:t=null,addToPlaylist:s=null}=o,[n,r]=i.useState(-1),[a,l]=i.useState(-1),c=i.useCallback((u,g)=>{u.stopPropagation(),l(f=>f===g?-1:g)},[]),m=i.useCallback((u,g)=>{var f,p;u.stopPropagation(),s(g,(p=(f=Ce().soundManager.musicController)==null?void 0:f.getRoomItemPlaylist())==null?void 0:p.length)},[s]),h=()=>{Z("catalog/open/"+co.TRAX_SONGS)};return i.useEffect(()=>{var u;if(a!==-1)return(u=Ce().soundManager.musicController)==null||u.playSong(a,Sa.PRIORITY_SONG_PLAY,0,0,0,0),()=>{var g;(g=Ce().soundManager.musicController)==null||g.stop(Sa.PRIORITY_SONG_PLAY)}},[a]),i.useEffect(()=>()=>l(-1),[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-success py-3 container-fluid justify-content-center d-flex rounded",children:[e.jsx("img",{src:K("image.library.url")+"playlist/title_mymusic.gif",className:"my-music"}),e.jsx("h2",{className:"ms-4",children:d("playlist.editor.my.music")})]}),e.jsx("div",{className:"h-100 overflow-y-scroll mt-4 py-2",children:e.jsx(Pe,{columnCount:3,columnMinWidth:95,gap:1,children:t&&t.getKeys().map((u,g)=>{var I;const f=t.getKey(g),p=t.getWithIndex(g),x=(I=Ce().soundManager.musicController)==null?void 0:I.getSongInfo(p);return e.jsxs(_e,{itemActive:n===g,onClick:()=>r(j=>j===g?-1:g),classNames:["text-black"],children:[e.jsx("div",{className:"disk-image flex-shrink-0 mb-n2",style:{backgroundColor:hh(x==null?void 0:x.songData)}}),e.jsx(v,{truncate:!0,fullWidth:!0,className:"text-center",children:x==null?void 0:x.name}),n===g&&e.jsxs(w,{position:"absolute",className:"bottom-0 mb-1 bg-secondary p-1 rounded",alignItems:"center",justifyContent:"center",gap:2,children:[e.jsx(L,{onClick:j=>c(j,p),variant:"light",children:e.jsx(A,{className:a===p?"pause-btn":"preview-song"})}),e.jsx(L,{onClick:j=>m(j,f),variant:"light",children:e.jsx(A,{className:"move-disk"})})]})]},g)})})}),e.jsxs("div",{className:"playlist-bottom text-black p-1",children:[e.jsx("h5",{children:d("playlist.editor.text.get.more.music")}),e.jsx("div",{children:d("playlist.editor.text.you.have.no.songdisks.available")}),e.jsx("div",{children:d("playlist.editor.text.you.can.buy.some.from.the.catalogue")}),e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>h(),children:d("playlist.editor.button.open.catalogue")})]}),e.jsx("img",{src:K("image.library.url")+"playlist/background_get_more_music.gif",className:"get-more"})]})},OO=o=>{var u,g;const{furniId:t=-1,playlist:s=null,currentPlayingIndex:n=-1,removeFromPlaylist:r=null,togglePlayPause:a=null}=o,[l,c]=i.useState(-1),m=f=>{l===f&&r(f)},h=(f,p)=>{a(f,p!==-1?p:0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-primary py-3 container-fluid justify-content-center d-flex rounded",children:[e.jsx("img",{src:K("image.library.url")+"playlist/title_playlist.gif",className:"playlist-img"}),e.jsx("h2",{className:"ms-4",children:d("playlist.editor.playlist")})]}),e.jsx("div",{className:"h-100 overflow-y-scroll py-2",children:e.jsx(w,{column:!0,gap:2,children:s&&s.map((f,p)=>e.jsxs(w,{gap:1,className:"text-black cursor-pointer "+(l===p?"border border-muted border-2 rounded":"border-2"),alignItems:"center",onClick:()=>c(x=>x===p?-1:p),children:[e.jsx(A,{onClick:()=>m(p),className:"disk-2 "+(l===p?"selected-song":""),style:{backgroundColor:l===p?"":hh(f.songData)}}),f.name]},p))})}),(!s||s.length===0)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"playlist-bottom text-black p-1 ms-5",children:[e.jsx("h5",{children:d("playlist.editor.add.songs.to.your.playlist")}),e.jsx("div",{children:d("playlist.editor.text.click.song.to.choose.click.again.to.move")})]}),e.jsx("img",{src:K("image.library.url")+"playlist/background_add_songs.gif",className:"add-songs"})]}),s&&s.length>0&&e.jsxs(e.Fragment,{children:[n===-1&&e.jsx(L,{variant:"success",size:"lg",onClick:()=>h(t,l),children:d("playlist.editor.button.play.now")}),n!==-1&&e.jsxs(w,{gap:1,children:[e.jsx(L,{variant:"danger",onClick:()=>h(t,l),children:e.jsx(A,{className:"pause-song"})}),e.jsxs(w,{column:!0,children:[e.jsx(v,{bold:!0,display:"block",children:d("playlist.editor.text.now.playing.in.your.room")}),e.jsx(v,{children:((u=s[n])==null?void 0:u.name)+" - "+((g=s[n])==null?void 0:g.creator)})]})]})]})]})},kO=o=>{const{objectId:t=-1,currentPlayingIndex:s=-1,playlist:n=null,diskInventory:r=null,onClose:a=null,togglePlayPause:l=null,removeFromPlaylist:c=null,addToPlaylist:m=null}=ZN();return t===-1?null:e.jsxs(ae,{className:"nitro-playlist-editor-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:d("playlist.editor.title"),onCloseClick:a}),e.jsx(se,{children:e.jsxs("div",{className:"d-flex flex-row gap-1 h-100",children:[e.jsx("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:e.jsx(RO,{addToPlaylist:m,diskInventory:r})}),e.jsx("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:e.jsx(OO,{furniId:t,removeFromPlaylist:c,playlist:n,togglePlayPause:l,currentPlayingIndex:s})})]})})]})},AO=o=>e.jsxs(A,{fit:!0,position:"absolute",className:"nitro-room-widgets top-0 start-0",children:[e.jsx(rO,{}),e.jsx(aO,{}),e.jsx(iO,{}),e.jsx(oO,{}),e.jsx(lO,{}),e.jsx(uO,{}),e.jsx(dO,{}),e.jsx(mO,{}),e.jsx(hO,{}),e.jsx(gO,{}),e.jsx(pO,{}),e.jsx(kO,{}),e.jsx(xO,{}),e.jsx(bO,{}),e.jsx(EO,{}),e.jsx(wO,{}),e.jsx(TO,{}),e.jsx(nO,{}),e.jsx(yO,{})]}),DO=o=>{const{isVisible:t=!1,errorResult:s=null,petName:n=null,objectType:r=null,onChangePetName:a=null,onConfirm:l=null,onClose:c=null}=M_();return e.jsx(e.Fragment,{children:t&&e.jsxs(ae,{className:"nitro-pet-package no-resize",theme:"primary-slim",children:[e.jsx(re,{center:!0,headerText:d(r==="gnome_box"?"widgets.gnomepackage.name.title":"furni.petpackage.open"),onCloseClick:()=>c()}),e.jsxs(se,{children:[e.jsxs(w,{className:"pet-package-container-top p-3",children:[e.jsx("div",{className:`package-image-${r} flex-shrink-0`}),e.jsx("div",{className:"m-2",children:e.jsx(v,{variant:"white",className:"package-text-big",children:d(r==="gnome_box"?"widgets.gnomepackage.name.title":"furni.petpackage")})})]}),e.jsx(w,{className:"pet-package-container-bottom p-2",children:e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"bg-white rounded py-1 px-2 input-pet-package-container",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm input-pet-package",maxLength:K("pet.package.name.max.length"),placeholder:d(r==="gnome_box"?"widgets.gnomepackage.name.select":"widgets.petpackage.name.title"),value:n,onChange:m=>a(m.target.value)}),e.jsx("div",{className:"package-pencil-image flex-shrink-0 small fa-icon"})]}),s.length>0&&e.jsx(A,{className:"invalid-feedback d-block m-0",children:s}),e.jsxs(w,{className:"mt-2",gap:5,display:"flex",justifyContent:"center",alignItems:"center",children:[e.jsx(v,{pointer:!0,className:"text-decoration",onClick:()=>c(),children:d("cancel")}),e.jsx(Rg,{variant:n.length<3?"danger":"success",disabled:n.length<3,onClick:()=>l(),children:d(r==="gnome_box"?"widgets.gnomepackage.name.pick":"furni.petpackage.confirm")})]})]})})]})]})})},PO=o=>{const[t,s]=i.useState("bobba"),[n,r]=i.useState(""),[a,l]=i.useState(!1),{wordsFilter:c=[],isVisible:m=null,setWordsFilter:h,onClose:u=null}=O_(),{navigatorData:g=null}=qs(),f=I=>{(a?!n:!t)||(D(new YE(g.enteredGuestRoom.roomId,I,a?n:t)),r(""),s("bobba"),l(!1),!(I&&c.includes(a?n:t))&&h(j=>{const E=[...j];return I?E.push(a?n:t):E.splice(E.indexOf(a?n:t),1),E}))},p=I=>{s(I),l(!1)},x=I=>{r(I),l(!0)};return m?e.jsxs(ae,{className:"nitro-guide-tool no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.roomsettings.roomfilter"),onCloseClick:()=>u()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:255,value:t,onChange:I=>p(I.target.value)}),e.jsx(L,{onClick:()=>f(!0),children:d("navigator.roomsettings.roomfilter.addword")})]}),e.jsx(N,{overflow:"auto",gap:0,className:"form-control form-control-sm",style:{height:"100px"},children:c&&c.length>0&&c.map((I,j)=>e.jsx(w,{alignItems:"center",className:$t("rounded p-1",n===I&&"bg-muted"),pointer:!0,onClick:E=>x(I),children:e.jsx(v,{truncate:!0,children:I})},j))}),e.jsx(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:e.jsx(L,{variant:"danger",onClick:()=>f(!1),disabled:c.length===0||!a,children:d("navigator.roomsettings.roomfilter.removeword")})})]})]}):null},LO=o=>{const[t,s]=i.useState(!1),{roomSession:n=null}=ke();ut([fn.SHOW_THUMBNAIL,fn.HIDE_THUMBNAIL,fn.TOGGLE_THUMBNAIL],a=>{switch(a.type){case fn.SHOW_THUMBNAIL:s(!0);return;case fn.HIDE_THUMBNAIL:s(!1);return;case fn.TOGGLE_THUMBNAIL:s(l=>!l);return}});const r=a=>{H().saveTextureAsScreenshot(a,!0),s(!1)};return t?e.jsx(Mv,{roomId:n.roomId,textureReceiver:r,onClose:()=>s(!1)}):null},MO=o=>{var P,k,R,y;const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState(null),[c,m]=i.useState(null),[h,u]=i.useState(null),[g,f]=i.useState(!1),[p,x]=i.useState(!1),[I,j]=i.useState(!0),[E,C]=i.useState([]),{navigatorData:b=null}=qs(),{roomSession:S=null}=ke();i.useEffect(()=>{a||l(d("landing.view.generic.welcome.first_login"))},[a]);const _=(O,F)=>{switch(O){case"settings":Z("navigator/toggle-room-info");return;case"zoom":r(M=>{let X=H().getRoomInstanceRenderingCanvasScale(S.roomId,1);return M?X*=2:X/=2,H().setRoomInstanceRenderingCanvasScale(S.roomId,1,X),!M});return;case"chat_history":Z("chat-history/toggle");return;case"hiddenbubbles":Z("nitrobubblehidden/toggle");const V=document.getElementById("bubble");V&&V.classList.toggle("icon-chat-disablebubble");const Y=document.getElementById("hiddenbubblesText");if(Y){const M=d(t?"room.unmute.button.text":"room.mute.button.text");Y.innerText=M}s(!t);const q=document.getElementById("bubbleIcon");q&&q.classList.toggle("icon-chat-disablebubble");return;case"like_room":D(new $E(1));return;case"toggle_room_link":Z("navigator/toggle-room-link");return;case"navigator_search_tag":Z(`navigator/search/${F}`),D(new yr("hotel_view",`tag:${F}`));return;case"room_history":E.length>0&&x(M=>!M);return;case"room_history_back":os(E[E.findIndex(M=>M.roomId===b.currentRoomId)-1].roomId);return;case"room_history_next":os(E[E.findIndex(M=>M.roomId===b.currentRoomId)+1].roomId);return}},T=(O,F)=>{let V=JSON.parse(window.localStorage.getItem("nitro.room.history"));if(V&&V.filter(q=>q.roomId===O).length>0)return;V&&V.length>=10&&V.shift();const Y=V?[...V,{roomId:O,roomName:F}]:[{roomId:O,roomName:F}];return C(Y),kc("nitro.room.history",Y)};return U(fa,O=>{const F=O.getParser();!F.roomEnter||F.data.roomId!==S.roomId||(a!==F.data.roomName&&l(F.data.roomName),c!==F.data.ownerName&&m(F.data.ownerName),h!==F.data.tags&&u(F.data.tags),T(F.data.roomId,F.data.roomName))}),i.useEffect(()=>{const O=()=>{JSON.parse(window.localStorage.getItem("nitro.room.history"))&&window.localStorage.removeItem("nitro.room.history")};return window.addEventListener("beforeunload",O),()=>window.removeEventListener("beforeunload",O)},[]),i.useEffect(()=>{f(!0);const O=setTimeout(()=>f(!1),5e3);return()=>clearTimeout(O)},[a,c,h,I]),i.useEffect(()=>{C(JSON.parse(window.localStorage.getItem("nitro.room.history"))??[])},[]),e.jsxs(w,{className:"nitro-room-tools-container",gap:2,children:[e.jsx("div",{className:"btn-toggle toggle-roomtool d-flex align-items-center",onClick:()=>j(!I),children:e.jsx("div",{className:"toggle-icon "+(I?"left":"right")})}),I&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{gap:0,center:!0,className:"nitro-room-tools p-3 px-3",children:[e.jsxs(w,{children:[e.jsxs(N,{center:!0,className:"margin-icons p-2 gap-2",children:[e.jsx(A,{pointer:!0,title:d("room.settings.button.text"),className:"icon icon-cog",onClick:()=>_("settings")}),e.jsx(A,{pointer:!0,title:d("room.zoom.button.text"),onClick:()=>_("zoom"),className:$t("icon",!n&&"icon-zoom-less",n&&"icon-zoom-more")}),e.jsx(A,{pointer:!0,title:d("room.chathistory.button.text"),onClick:()=>_("chat_history"),className:"icon icon-chat-history"}),b.canRate&&e.jsx(A,{pointer:!0,title:d("room.like.button.text"),onClick:()=>_("like_room"),className:"icon icon-like-room"}),e.jsx(A,{pointer:!0,onClick:()=>_("toggle_room_link"),className:"icon icon-room-link"}),e.jsx(A,{pointer:!0,onClick:()=>_("hiddenbubbles"),className:`icon ${t?"icon-chat-disablebubble":"icon-chat-enablebubble"}`})]}),e.jsxs(N,{className:"d-flex flex-column",children:[e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("settings"),children:d("room.settings.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("zoom"),children:d("room.zoom.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("chat_history"),children:d("room.chathistory.button.text")})}),b.canRate&&e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("like_room"),children:d("room.like.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("toggle_room_link"),children:d("navigator.embed.caption")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsxs(v,{variant:"muted",underline:!0,small:!0,onClick:()=>_("hiddenbubbles"),children:[" ",d(t?"room.unmute.button.text":"room.mute.button.text")]})})]})]}),e.jsxs(w,{justifyContent:"center",children:[e.jsx(A,{pointer:E.length>1&&((P=E[0])==null?void 0:P.roomId)!==b.currentRoomId,title:d("room.history.button.back.tooltip"),className:`icon ${(E==null?void 0:E.length)===0||((k=E[0])==null?void 0:k.roomId)===b.currentRoomId?"icon-room-history-back-disabled":"icon-room-history-back-enabled"}`,onClick:()=>{var O;return(E==null?void 0:E.length)===0||((O=E[0])==null?void 0:O.roomId)===b.currentRoomId?null:_("room_history_back")}}),e.jsx(A,{pointer:(E==null?void 0:E.length)>0,title:d("room.history.button.tooltip"),className:`icon ${(E==null?void 0:E.length)===0?"icon-room-history-disabled":"icon-room-history-enabled"} margin-button-history`,onClick:()=>(E==null?void 0:E.length)===0?null:_("room_history")}),e.jsx(A,{pointer:E.length>1&&((R=E[E.length-1])==null?void 0:R.roomId)!==b.currentRoomId,title:d("room.history.button.forward.tooltip"),className:`icon ${(E==null?void 0:E.length)===0||((y=E[E.length-1])==null?void 0:y.roomId)===b.currentRoomId?"icon-room-history-next-disabled":"icon-room-history-next-enabled"}`,onClick:()=>{var O;return(E==null?void 0:E.length)===0||((O=E[E.length-1])==null?void 0:O.roomId)===b.currentRoomId?null:_("room_history_next")}})]})]}),e.jsxs(w,{className:"nitro-room-tools-side-container",children:[e.jsx(or,{children:p&&e.jsx(lr.div,{initial:{x:-400},animate:{x:0},exit:{x:-400},children:e.jsx(N,{center:!0,children:e.jsx(N,{className:"px-3 py-2 rounded nitro-room-history",children:e.jsx(N,{gap:1,children:E.length>0&&E.map(O=>e.jsx(v,{bold:O.roomId===b.currentRoomId,variant:O.roomId===b.currentRoomId?"white":"muted",pointer:!0,onClick:()=>os(O.roomId),children:O.roomName},O.roomId))})})})})}),e.jsx(or,{children:g&&e.jsx(lr.div,{initial:{x:-400},animate:{x:0},exit:{x:-400},children:e.jsx(N,{center:!0,children:e.jsxs(N,{className:"px-3 py-2 rounded nitro-room-tools-info",overflow:"hidden",children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{wrap:!0,variant:"white",fontSize:4,truncate:!0,children:a}),e.jsx(v,{variant:"muted",fontSize:5,truncate:!0,children:c})]}),h&&h.length>0?e.jsx(w,{gap:2,children:h.map((O,F)=>e.jsxs(v,{small:!0,pointer:!0,truncate:!0,variant:"white",className:"rounded bg-primary p-1",onClick:()=>_("navigator_search_tag",O),children:["#",O]},F))}):e.jsx(v,{variant:"muted",children:d("navigator.notagsfound")})]})})})})]})]})]})},UO=o=>{const{question:t=null,canVote:s=null,vote:n=null,noVotes:r=null,yesVotes:a=null}=o;return e.jsxs(N,{gap:2,className:"wordquiz-question p-2",children:[!s&&e.jsxs(w,{fullWidth:!0,alignItems:"center",gap:2,children:[e.jsx(w,{center:!0,pointer:!0,className:"bg-danger rounded p-2",children:e.jsx(v,{variant:"white",children:r})}),e.jsx(v,{variant:"white",center:!0,textBreak:!0,children:t}),e.jsx(w,{center:!0,pointer:!0,className:"bg-success rounded p-2",children:e.jsx(v,{variant:"white",children:a})})]}),s&&e.jsxs(N,{children:[e.jsx(v,{variant:"white",center:!0,textBreak:!0,children:t}),e.jsxs(w,{fullWidth:!0,justifyContent:"center",gap:1,children:[e.jsx(w,{center:!0,pointer:!0,className:"bg-danger rounded p-1",onClick:l=>n(xo),children:e.jsx(A,{className:"word-quiz-dislike"})}),e.jsx(w,{center:!0,pointer:!0,className:"bg-success rounded p-1",onClick:l=>n(gh),children:e.jsx(A,{className:"word-quiz-like"})})]})]})]})},FO=o=>{const{userIndex:t=null,vote:s=null,...n}=o;return e.jsx(Kc,{objectId:t,category:Q.UNIT,...n,children:e.jsx(w,{center:!0,pointer:!0,className:`bg-${s===xo?"danger":"success"} rounded p-1`,children:e.jsx(A,{className:`word-quiz-${s===xo?"dislike":"like"}-sm`})})})},VO=o=>{const{question:t=null,answerSent:s=!1,answerCounts:n=null,userAnswers:r=null,vote:a=null}=W_();return e.jsxs(e.Fragment,{children:[t&&e.jsx(UO,{question:t.content,canVote:!s,vote:a,noVotes:n.get(xo)||0,yesVotes:n.get(gh)||0}),r&&Array.from(r.entries()).map(([l,c],m)=>e.jsx(FO,{userIndex:l,vote:c.value},m))]})},GO=o=>{const{roomSession:t=null}=ke(),{simpleAlert:s=null}=Fe();return we(_a.ROOM_ZOOM,n=>H().setRoomInstanceRenderingCanvasScale(n.roomId,1,n.level,null,null,!1,n.asDelta)),we([ye.REQUEST_TEASER,ye.REQUEST_ECOTRONBOX,ye.REQUEST_CLOTHING_CHANGE,ye.REQUEST_PLAYLIST_EDITOR,ye.OPEN_WIDGET,ye.CLOSE_WIDGET,Ti.FURNI_CLICK,Ti.FURNI_DOUBLE_CLICK,Ti.TOOLTIP_SHOW,Ti.TOOLTIP_HIDE],n=>{if(t)switch(n.objectId,n.category,n.type){}}),He([jt.RSEME_KICKED,jt.RSEME_PETS_FORBIDDEN_IN_HOTEL,jt.RSEME_PETS_FORBIDDEN_IN_FLAT,jt.RSEME_MAX_PETS,jt.RSEME_MAX_NUMBER_OF_OWN_PETS,jt.RSEME_NO_FREE_TILES_FOR_PET,jt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET,jt.RSEME_BOTS_FORBIDDEN_IN_HOTEL,jt.RSEME_BOTS_FORBIDDEN_IN_FLAT,jt.RSEME_BOT_LIMIT_REACHED,jt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT,jt.RSEME_BOT_NAME_NOT_ACCEPTED],n=>{let r=d("error.title"),a="";switch(n.type){case jt.RSEME_MAX_PETS:a=d("room.error.max_pets");break;case jt.RSEME_MAX_NUMBER_OF_OWN_PETS:a=d("room.error.max_own_pets");break;case jt.RSEME_KICKED:a=d("room.error.kicked"),r=d("generic.alert.title");break;case jt.RSEME_PETS_FORBIDDEN_IN_HOTEL:a=d("room.error.pets.forbidden_in_hotel");break;case jt.RSEME_PETS_FORBIDDEN_IN_FLAT:a=d("room.error.pets.forbidden_in_flat");break;case jt.RSEME_NO_FREE_TILES_FOR_PET:a=d("room.error.pets.no_free_tiles");break;case jt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET:a=d("room.error.pets.selected_tile_not_free");break;case jt.RSEME_BOTS_FORBIDDEN_IN_HOTEL:a=d("room.error.bots.forbidden_in_hotel");break;case jt.RSEME_BOTS_FORBIDDEN_IN_FLAT:a=d("room.error.bots.forbidden_in_flat");break;case jt.RSEME_BOT_LIMIT_REACHED:a=d("room.error.max_bots");break;case jt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT:a=d("room.error.bots.selected_tile_not_free");break;case jt.RSEME_BOT_NAME_NOT_ACCEPTED:a=d("room.error.bots.name.not.accepted");break;default:return}s(a,je.DEFAULT,null,null,r)}),e.jsxs(e.Fragment,{children:[e.jsx(PR,{}),e.jsx(HR,{}),e.jsx(FR,{}),e.jsx(zR,{}),e.jsx(AO,{}),e.jsx(MO,{}),e.jsx(PO,{}),e.jsx(LO,{}),e.jsx(WR,{}),e.jsx(DO,{}),e.jsx(qR,{}),e.jsx(VO,{}),e.jsx($R,{})]})},BO=o=>{const{roomSession:t=null}=ke(),s=i.useRef();return i.useEffect(()=>{if(!t)return;const n=Ce().application.renderer.view;if(!n)return;n.onclick=a=>ki(a),n.onmousemove=a=>ki(a),n.onmousedown=a=>ki(a),n.onmouseup=a=>ki(a),n.ontouchstart=a=>Pi(a),n.ontouchmove=a=>Pi(a),n.ontouchend=a=>Pi(a),n.ontouchcancel=a=>Pi(a);const r=s.current;r&&r.appendChild(n)},[t]),e.jsx(or,{children:e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx("div",{ref:s,className:"w-100 h-100",children:t instanceof KE&&e.jsxs(e.Fragment,{children:[e.jsx(GO,{}),t.isSpectator&&e.jsx(cR,{})]})})})})},HO=o=>{const{useGuideTool:t=!1,unseenAchievementCount:s=0,setMeExpanded:n=null,children:r=null,...a}=o,l=i.useRef();i.useEffect(()=>{const m=Oe();m&&H().selectRoomObject(m.roomId,m.ownRoomIndex,Q.UNIT)},[]),i.useEffect(()=>{const m=h=>{l.current&&!l.current.contains(h.target)&&n(!1)};return document.addEventListener("click",m),()=>document.removeEventListener("click",m)},[n]);const c=m=>{m.stopPropagation()};return e.jsxs(w,{innerRef:l,alignItems:"center",className:"nitro-toolbar-me p-2",gap:2,onClick:c,children:[K("guides.enabled")&&t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-helper-tool click-box",onClick:m=>Nt(new Is(Is.TOGGLE_GUIDE_TOOL))}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-achievements click-box",onClick:m=>Z("achievements/toggle"),children:s>0&&e.jsx(Cn,{className:"text-black",count:s})}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-profile click-box",onClick:m=>ls(G().userId)}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-rooms click-box",onClick:m=>Z("navigator/search/myworld_view")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-clothing click-box",onClick:m=>Z("avatar-editor/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-settings click-box",onClick:m=>Z("user-settings/toggle")}),r]})},WO=o=>{const{isInRoom:t}=o,[s,n]=i.useState(!1),[r,a]=i.useState(!1),{userFigure:l=null}=Yn(),{getFullCount:c=0}=Os(),{getTotalUnseen:m=0}=tl(),{requests:h=[]}=fs(),{iconState:u=In.HIDDEN}=vh(),g=G().isModerator;U(Fm,p=>{const x=p.getParser();a(x.isAllowed(Um.USE_GUIDE_TOOL))}),we(tC.ANIMATE_ICON,p=>{((I,j,E,C)=>{const b=document.body.getElementsByClassName(I)[0];if(!b)return;j.className="toolbar-icon-animation",j.style.visibility="visible",j.style.left=E+"px",j.style.top=C+"px",document.body.append(j);const S=b.getBoundingClientRect(),_=j.getBoundingClientRect(),T=_.x-S.x,P=_.y-S.y,k=Math.sqrt(T*T+P*P),R=500-Math.abs(1/k*100*500*.5),y=20,O=`ToolbarBouncing[${I}]`;Cl.getMotionByTag(O)||(Cl.runMotion(new Eu(new XE(R+8),new QE(b,400,12))).tag=O);const F=new Eu(new JE(new ZE(j,R,S.x-_.x+y,S.y-_.y,100,1),1),new eC(j));Cl.runMotion(F)})("icon-inventory",p.image,p.x,p.y)});const f=p=>{p.stopPropagation(),n(x=>!x)};return e.jsxs(e.Fragment,{children:[e.jsx(or,{children:s&&e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"nitro-toolbar-me",children:e.jsx(HO,{useGuideTool:r,unseenAchievementCount:m,setMeExpanded:n})})}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,className:"nitro-toolbar py-1 px-3",children:[e.jsxs(w,{gap:2,alignItems:"center",className:"widthsizemax",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsxs(w,{center:!0,pointer:!0,className:"navigation-item item-avatar "+(s?"active ":""),onClick:f,children:[e.jsx(it,{figure:l,headOnly:!0,direction:2,position:"absolute"}),m>0&&e.jsx(Cn,{className:"text-black",count:m})]}),t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-habbo click-box",onClick:p=>Sc()}),!t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-house click-box",onClick:p=>Z("navigator/goto/home")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-rooms click-box",onClick:p=>Z("navigator/toggle")}),K("game.center.enabled")&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-game click-box",onClick:p=>Z("games/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-catalog click-box",onClick:p=>Z("catalog/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-inventory click-box",onClick:p=>Z("inventory/toggle"),children:c>0&&e.jsx(Cn,{className:"text-black",count:c})}),t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-camera click-box",onClick:p=>Z("camera/toggle")}),g&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-modtools click-box",onClick:p=>Z("mod-tools/toggle")})]}),e.jsx(w,{alignItems:"center",id:"toolbar-chat-input-container"})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsxs(w,{gap:2,children:[e.jsx(A,{pointer:!0,className:"navigation-item icon icon-friendall click-box friendsmovilgen",onClick:p=>Z("friends/toggle"),children:h.length>0&&e.jsx(Cn,{className:"text-black",count:h.length})}),(u===In.SHOW||u===In.UNREAD)&&e.jsx(A,{pointer:!0,className:`navigation-item icon icon-message click-box mensajesmovilgen ${u===In.UNREAD&&"is-unseen"}`,onClick:p=>Qo()})]}),e.jsx(A,{id:"toolbar-friend-bar-container",className:"d-none d-lg-block"})]})]})]})},qO=o=>{const{badges:t=null,gap:s=1,justifyContent:n="between",...r}=o;return e.jsx(e.Fragment,{children:t&&t.length>0&&t.map((a,l)=>e.jsx(N,{center:!0,children:e.jsx(Xe,{badgeCode:a},a)},a))})},zO=o=>{const{relationships:t=null}=o,s=({type:n})=>{const r=t&&t.relationshipStatusMap.hasKey(n)?t.relationshipStatusMap.getValue(n):null,a=Js.RELATIONSHIP_NAMES[n].toLocaleLowerCase();return e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx(w,{center:!0,className:"user-relationship",children:e.jsx("i",{className:`nitro-friends-spritesheet icon-${a}`})}),e.jsxs(N,{grow:!0,gap:0,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",className:"bg-white rounded px-2 py-1 user-relationship",children:[e.jsxs(v,{small:!0,underline:!0,pointer:!0,onClick:l=>r&&r.randomFriendId>=1&&ls(r.randomFriendId),children:[(!r||r.friendCount===0)&&d("extendedprofile.add.friends"),r&&r.friendCount>=1&&r.randomFriendName]}),r&&r.friendCount>=1&&e.jsx(w,{center:!0,position:"relative",className:"avatar-image-container",children:e.jsx(it,{figure:r.randomFriendFigure,headOnly:!0,direction:4})})]}),e.jsxs(v,{small:!0,italics:!0,className:"user-relationship-count",children:[(!r||r.friendCount===0)&&d("extendedprofile.no.friends.in.this.category"),r&&r.friendCount>1&&d(`extendedprofile.relstatus.others.${a}`,["count"],[(r.friendCount-1).toString()])," "]})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(s,{type:Js.HEART}),e.jsx(s,{type:Js.SMILE}),e.jsx(s,{type:Js.BOBBA})]})},YO=o=>{const{relationships:t=null,friendsCount:s=null}=o;return e.jsxs(N,{gap:1,children:[e.jsxs(v,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.friends.count")})," ",s]}),e.jsx(v,{bold:!0,small:!0,children:d("extendedprofile.relstatus")}),e.jsx(N,{children:e.jsx(zO,{relationships:t})})]})},$O=o=>{const{itsMe:t=null,groups:s=null,onLeaveGroup:n=null,overflow:r="hidden",gap:a=2,...l}=o,[c,m]=i.useState(null),[h,u]=i.useState(null);return U(ci,g=>{const f=g.getParser();!c||c!==f.id||f.flag||u(f)}),i.useEffect(()=>{c&&D(new za(c,!1))},[c]),i.useEffect(()=>{u(null),s.length>0&&m(g=>(g===s[0].groupId&&D(new za(s[0].groupId,!1)),s[0].groupId))},[s]),!s||!s.length?e.jsx(N,{center:!0,fullHeight:!0,children:e.jsxs(w,{justifyContent:"center",gap:2,children:[e.jsx(A,{className:"no-group-spritesheet image-1"}),e.jsx(A,{className:"no-group-spritesheet image-2"}),e.jsx(A,{className:"no-group-spritesheet image-3"})]})}):e.jsxs(ne,{overflow:r,gap:2,...l,children:[e.jsx(N,{alignItems:"center",size:2,overflow:"auto",children:e.jsx(Pe,{overflow:null,columnCount:1,columnMinHeight:50,className:"user-groups-container",children:s.map((g,f)=>e.jsxs(_e,{overflow:"unset",itemActive:c===g.groupId,onClick:()=>m(g.groupId),className:"p-1",children:[t&&e.jsx("i",{className:"position-absolute end-0 top-0 z-index-1 icon icon-group-"+(g.favourite?"favorite":"not-favorite"),onClick:()=>hv(g)}),e.jsx(Xe,{badgeCode:g.badgeCode,isGroup:!0})]},f))})}),e.jsx(N,{size:10,overflow:"hidden",children:h&&e.jsx(zh,{groupInformation:h,onClose:n})})]})},KO=o=>{const{userProfile:t=null}=o,[s,n]=i.useState(t.requestSent),r=t.id===G().userId,a=!s&&!r&&!t.isMyFriend&&!t.requestSent,l=()=>{n(!0),D(new vm(t.username))};return i.useEffect(()=>{n(t.requestSent)},[t]),e.jsxs(w,{gap:2,children:[e.jsx(N,{center:!0,className:"avatar-container",children:e.jsx(it,{figure:t.figure,direction:2})}),e.jsxs(N,{children:[e.jsxs(N,{gap:0,children:[e.jsx(v,{bold:!0,children:t.username}),e.jsxs(v,{italics:!0,textBreak:!0,small:!0,children:[t.motto," "]})]}),e.jsxs(N,{gap:1,children:[e.jsxs(v,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.created")})," ",t.registration]}),e.jsxs(v,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.last.login")})," ",en.format(t.secondsSinceLastVisit,".ago",2)]}),e.jsxs(v,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.achievementscore")})," ",t.achievementPoints]})]}),e.jsxs(w,{gap:1,children:[t.isOnline&&e.jsx("i",{className:"icon icon-pf-online"}),!t.isOnline&&e.jsx("i",{className:"icon icon-pf-offline"}),e.jsxs(w,{alignItems:"center",gap:1,children:[a&&e.jsx(v,{small:!0,underline:!0,pointer:!0,onClick:l,children:d("extendedprofile.addasafriend")}),!a&&e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"icon icon-pf-tick"}),r&&e.jsx(v,{children:d("extendedprofile.me")}),t.isMyFriend&&e.jsx(v,{children:d("extendedprofile.friend")}),(s||t.requestSent)&&e.jsx(v,{children:d("extendedprofile.friendrequestsent")})]})]})]})]})]})},XO=o=>{const[t,s]=i.useState(null),[n,r]=i.useState([]),[a,l]=i.useState(null),c=()=>{s(null),r([]),l(null)},m=()=>{!t||t.id!==G().userId||ls(t.id)};return U(sC,h=>{const u=h.getParser();!t||u.userId!==t.id||r(u.badges)}),U(zm,h=>{const u=h.getParser();!t||u.userId!==t.id||l(u)}),U(rC,h=>{const u=h.getParser();let g=!1;s(f=>(f&&f.id&&(g=f.id===u.id),u)),g||(r([]),l(null)),D(new nC(u.id)),D(new Ym(u.id))}),U(aC,h=>{const u=h.getParser();u.userId==(t==null?void 0:t.id)&&ls(u.userId)}),we(Ct.SELECTED,h=>{if(!t||h.category!==Q.UNIT)return;const u=Oe().userDataManager.getUserDataByIndex(h.objectId);u.type===gt.USER&&ls(u.webID)}),t?e.jsxs(ae,{uniqueKey:"nitro-user-profile",theme:"primary-slim",className:"user-profile",children:[e.jsx(re,{headerText:d("extendedprofile.caption"),onCloseClick:c}),e.jsxs(se,{overflow:"hidden",children:[e.jsxs(ne,{fullHeight:!1,gap:2,children:[e.jsxs(N,{size:7,gap:1,className:"user-container pe-2",children:[e.jsx(KO,{userProfile:t}),e.jsx(ne,{columnCount:5,fullHeight:!0,className:"bg-muted rounded px-2 py-1",children:e.jsx(qO,{fullWidth:!0,center:!0,badges:n})})]}),e.jsx(N,{size:5,children:a&&e.jsx(YO,{relationships:a,friendsCount:t.friendsCount})})]}),e.jsx(w,{alignItems:"center",className:"rooms-button-container px-2 py-1",children:e.jsxs(w,{alignItems:"center",gap:1,onClick:h=>Z(`navigator/search/hotel_view/owner:${t.username}`),children:[e.jsx("i",{className:"icon icon-rooms"}),e.jsx(v,{bold:!0,underline:!0,pointer:!0,children:d("extendedprofile.rooms")})]})}),e.jsx($O,{fullWidth:!0,itsMe:t.id===G().userId,groups:t.groups,onLeaveGroup:m})]})]}):null},QO=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(null),[a,l]=Eh(),[c,m]=Ch(),h=(g,f)=>{let p=!0;const x=n.clone();switch(g){case"close_view":s(!1),p=!1;return;case"oldchat":x.oldChat=f,D(new lC(x.oldChat));break;case"room_invites":x.roomInvites=f,D(new oC(x.roomInvites));break;case"camera_follow":x.cameraFollow=f,D(new iC(x.cameraFollow));break;case"system_volume":x.volumeSystem=f,x.volumeSystem=Math.max(0,x.volumeSystem),x.volumeSystem=Math.min(100,x.volumeSystem);break;case"furni_volume":x.volumeFurni=f,x.volumeFurni=Math.max(0,x.volumeFurni),x.volumeFurni=Math.min(100,x.volumeFurni);break;case"trax_volume":x.volumeTrax=f,x.volumeTrax=Math.max(0,x.volumeTrax),x.volumeTrax=Math.min(100,x.volumeTrax);break}p&&r(x),Zl(x)},u=g=>{switch(g){case"volume":D(new cC(Math.round(n.volumeSystem),Math.round(n.volumeFurni),Math.round(n.volumeTrax)));break}};return U(dC,g=>{const f=g.getParser(),p=new uC;p.volumeSystem=f.volumeSystem,p.volumeFurni=f.volumeFurni,p.volumeTrax=f.volumeTrax,p.oldChat=f.oldChat,p.roomInvites=f.roomInvites,p.cameraFollow=f.cameraFollow,p.flags=f.flags,p.chatType=f.chatType,r(p),Zl(p)}),i.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(x=>!x);return}},eventUrlPrefix:"user-settings/"};return ft(g),()=>pt(g)},[]),i.useEffect(()=>{n&&Nt(n)},[n]),!t||!n?null:e.jsxs(ae,{uniqueKey:"user-settings",className:"user-settings-window",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widget.memenu.settings.title"),onCloseClick:g=>h("close_view")}),e.jsxs(se,{className:"text-black",children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.oldChat,onChange:g=>h("oldchat",g.target.checked)}),e.jsx(v,{children:d("memenu.settings.chat.prefer.old.chat")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.roomInvites,onChange:g=>h("room_invites",g.target.checked)}),e.jsx(v,{children:d("memenu.settings.other.ignore.room.invites")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.cameraFollow,onChange:g=>h("camera_follow",g.target.checked)}),e.jsx(v,{children:d("memenu.settings.other.disable.room.camera.follow")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:a,onChange:g=>l(g.target.checked)}),e.jsx(v,{children:d("memenu.settings.other.place.multiple.objects")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:c,onChange:g=>m(g.target.checked)}),e.jsx(v,{children:d("memenu.settings.other.skip.purchase.confirmation")})]})]}),e.jsxs(N,{children:[e.jsx(v,{bold:!0,children:d("widget.memenu.settings.volume")}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("widget.memenu.settings.volume.ui")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeSystem===0&&e.jsx(cl,{className:$t(n.volumeSystem>=50&&"text-muted","fa-icon")}),n.volumeSystem>0&&e.jsx(ul,{className:$t(n.volumeSystem>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeSystem",value:n.volumeSystem,onChange:g=>h("system_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(dl,{className:$t(n.volumeSystem<50&&"text-muted","fa-icon")})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("widget.memenu.settings.volume.furni")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeFurni===0&&e.jsx(cl,{className:$t(n.volumeFurni>=50&&"text-muted","fa-icon")}),n.volumeFurni>0&&e.jsx(ul,{className:$t(n.volumeFurni>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeFurni",value:n.volumeFurni,onChange:g=>h("furni_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(dl,{className:$t(n.volumeFurni<50&&"text-muted","fa-icon")})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{children:d("widget.memenu.settings.volume.trax")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeTrax===0&&e.jsx(cl,{className:$t(n.volumeTrax>=50&&"text-muted","fa-icon")}),n.volumeTrax>0&&e.jsx(ul,{className:$t(n.volumeTrax>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeTrax",value:n.volumeTrax,onChange:g=>h("trax_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(dl,{className:$t(n.volumeTrax<50&&"text-muted","fa-icon")})]})]})]})]})]})},JO=o=>{const{maxItemSelectionCount:t}=o,{furniIds:s,selectObjectForWired:n}=Te(),r=d("wiredfurni.pickfurnis.caption",["count","limit"],[s.length.toString(),t.toString()]);return e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:r}),e.jsx(v,{small:!0,children:d("wiredfurni.pickfurnis.desc")})]})},Xc=o=>{const{wiredType:t="",requiresFurni:s=ue.STUFF_SELECTION_OPTION_NONE,save:n=null,validate:r=null,children:a=null,hasSpecialInput:l=!1,maxItemSelectionCount:c=5}=o,[m,h]=i.useState(null),[u,g]=i.useState(null),[f,p]=i.useState(!1),{trigger:x,setTrigger:I,setIntParams:j,setStringParam:E,setFurniIds:C,setAllowsFurni:b,saveWired:S,setMaxItemSelectionCount:_}=Te();i.useEffect(()=>{_(c)},[c,_]);const T=()=>I(null),P=()=>{r&&!r()||(n&&n(),p(!0))};return i.useEffect(()=>{f&&(S(),p(!1))},[f,S]),i.useEffect(()=>{if(!x)return;const k=x.spriteId||-1,R=G().getFloorItemData(k);R?(h(R.name),g(R.description)):(h("NAME: "+k),g("NAME: "+k)),l&&(j(x.intData),E(x.stringData)),s>ue.STUFF_SELECTION_OPTION_NONE&&C(y=>(y&&y.length&&Wn.clearSelectionShaderFromFurni(y),x.selectedItems&&x.selectedItems.length?(Wn.applySelectionShaderToFurni(x.selectedItems),x.selectedItems):[])),b(s),Wn.setMaxItemSelectionCount&&Wn.setMaxItemSelectionCount(c)},[x,l,s,j,E,C,b,c]),e.jsxs(ae,{uniqueKey:"nitro-wired",className:"nitro-wired",theme:"primary-slim",children:[e.jsx(re,{headerText:d("wiredfurni.title"),onCloseClick:T}),e.jsxs(se,{children:[e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("i",{className:`icon icon-wired-${t}`}),e.jsx(v,{bold:!0,children:m})]}),e.jsx(v,{small:!0,children:u})]}),!!a&&e.jsx("hr",{className:"m-0 bg-dark"}),a,s>ue.STUFF_SELECTION_OPTION_NONE&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0 bg-dark"}),e.jsx(JO,{maxItemSelectionCount:c})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(L,{fullWidth:!0,variant:"success",onClick:P,children:d("wiredfurni.ready")}),e.jsx(L,{fullWidth:!0,variant:"secondary",onClick:T,children:d("cancel")})]})]})]})},xt=o=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=o,{trigger:a=null,actionDelay:l=0,setActionDelay:c=null}=Te();return i.useEffect(()=>{c(a.delayInPulses)},[a,c]),e.jsxs(Xc,{wiredType:"action",requiresFurni:t,save:s,hasSpecialInput:n,children:[r,!!r&&e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(N,{children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.delay",["seconds"],[hi(l)])}),e.jsx(Mt,{min:0,max:20,value:l,snapDragDisabled:!1,onChange:m=>c(m)})]})]})},ZO="hd-180-1.ch-210-66.lg-270-82.sh-290-81",e1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(""),{trigger:a=null,setStringParam:l=null}=Te(),c=()=>l(t+ga+n);return i.useEffect(()=>{const m=a.stringData.split(ga);m.length>0&&s(m[0]),m.length>1&&r(m[1].length>0?m[1]:ZO)},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:m=>s(m.target.value)})]}),e.jsxs(w,{center:!0,children:[e.jsx(it,{figure:n,direction:4}),e.jsx(L,{onClick:m=>r(G().figure),children:d("wiredfurni.params.capture.figure")})]})]})},t1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(-1),{trigger:a=null,setStringParam:l=null,setIntParams:c=null}=Te(),m=()=>{l(t),c([n])};return i.useEffect(()=>{s(a.stringData),r(a.intData.length>0?a.intData[0]:0)},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"followMode",id:"followMode1",checked:n===1,onChange:h=>r(1)}),e.jsx(v,{children:d("wiredfurni.params.start.following")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"followMode",id:"followMode2",checked:n===0,onChange:h=>r(0)}),e.jsx(v,{children:d("wiredfurni.params.stop.following")})]})]})]})},s1=[2,5,7,8,9,10,27],n1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(-1),{trigger:a=null,setStringParam:l=null,setIntParams:c=null}=Te(),m=()=>{l(t),c([n])};return i.useEffect(()=>{s(a.stringData),r(a.intData.length>0?a.intData[0]:0)},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.handitem")}),e.jsxs("select",{className:"form-select form-select-sm",value:n,onChange:h=>r(parseInt(h.target.value)),children:[e.jsx("option",{value:"0",children:"------"}),s1.map(h=>e.jsx("option",{value:h,children:d(`handitem${h}`)},h))]})]})]})},r1=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},a1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(""),[a,l]=i.useState(-1),{trigger:c=null,setStringParam:m=null,setIntParams:h=null}=Te(),u=()=>{m(t+ga+n),h([a])};return i.useEffect(()=>{const g=c.stringData.split(ga);g.length>0&&s(g[0]),g.length>1&&r(g[1].length>0?g[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:g=>s(g.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:K("wired.action.bot.talk.to.avatar.max.length",64),value:n,onChange:g=>r(g.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode1",checked:a===0,onChange:g=>l(0)}),e.jsx(v,{children:d("wiredfurni.params.talk")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode2",checked:a===1,onChange:g=>l(1)}),e.jsx(v,{children:d("wiredfurni.params.whisper")})]})]})]})},i1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(""),[a,l]=i.useState(-1),{trigger:c=null,setStringParam:m=null,setIntParams:h=null}=Te(),u=()=>{m(t+ga+n),h([a])};return i.useEffect(()=>{const g=c.stringData.split(ga);g.length>0&&s(g[0]),g.length>1&&r(g[1].length>0?g[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:g=>s(g.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:K("wired.action.bot.talk.max.length",64),value:n,onChange:g=>r(g.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode1",checked:a===0,onChange:g=>l(0)}),e.jsx(v,{children:d("wiredfurni.params.talk")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode2",checked:a===1,onChange:g=>l(1)}),e.jsx(v,{children:d("wiredfurni.params.shout")})]})]})]})},o1=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},l1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),c1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),u1=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value),maxLength:K("wired.action.chat.max.length",100)})]})})},d1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),m1=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(1),[a,l]=i.useState(!1),[c,m]=i.useState(1),[h,u]=i.useState(1),[g,f]=i.useState([]),{trigger:p=null,setIntParams:x=null,setStringParam:I=null}=Te(),j=()=>f(S=>[...S,{isBadge:!1,itemCode:"",probability:null}]),E=S=>{f(_=>{const T=Array.from(_);return T.splice(S,1),T})},C=(S,_,T,P)=>{const k=Array.from(g),R=k[S];R&&(R.isBadge=_,R.itemCode=T,R.probability=P,f(k))},b=()=>{let S=[];for(const _ of g){if(!_.itemCode)continue;const T=[_.isBadge?"0":"1",_.itemCode,_.probability.toString()];S.push(T.join(","))}S.length>0&&(I(S.join(";")),x([n,a?1:0,c,h]))};return i.useEffect(()=>{const S=[];if(p.stringData.length>0&&p.stringData.includes(";")){const _=p.stringData.split(";");for(const T of _){const P=T.split(",");P.length===3&&S.push({isBadge:P[0]==="0",itemCode:P[1],probability:Number(P[2])})}}S.length===0&&S.push({isBadge:!1,itemCode:"",probability:null}),r(p.intData.length>0?p.intData[0]:0),l(p.intData.length>1?p.intData[1]===1:!1),m(p.intData.length>2?p.intData[2]:0),u(p.intData.length>3?p.intData[3]:0),s(p.intData.length>3?p.intData[3]>0:!1),f(S)},[p]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:b,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"limitEnabled",onChange:S=>s(S.target.checked)}),e.jsx(v,{children:d("wiredfurni.params.prizelimit",["amount"],[t?c.toString():""])})]}),!t&&e.jsx(v,{center:!0,small:!0,className:"bg-muted rounded p-1",children:"Reward limit not set. Make sure rewards are badges or non-tradeable items."}),t&&e.jsx(Mt,{min:1,max:1e3,value:c,onChange:S=>m(S)}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:"How often can a user be rewarded?"}),e.jsxs(w,{gap:1,children:[e.jsxs("select",{className:"form-select form-select-sm w-100",value:n,onChange:S=>r(Number(S.target.value)),children:[e.jsx("option",{value:"0",children:"Once"}),e.jsxs("option",{value:"3",children:["Once every ",h," minutes"]}),e.jsxs("option",{value:"2",children:["Once every ",h," hours"]}),e.jsxs("option",{value:"1",children:["Once every ",h," days"]})]}),n>0&&e.jsx("input",{type:"number",className:"form-control form-control-sm",value:h,onChange:S=>u(Number(S.target.value))})]})]}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"uniqueRewards",checked:a,onChange:S=>l(S.target.checked)}),e.jsx(v,{children:"Unique rewards"})]}),e.jsx(v,{center:!0,small:!0,className:"bg-muted rounded p-1",children:"If checked each reward will be given once to each user. This will disable the probabilities option."}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[e.jsx(v,{bold:!0,children:"Rewards"}),e.jsx(L,{variant:"success",onClick:j,children:e.jsx(Wo,{className:"fa-icon"})})]}),e.jsx(N,{gap:1,children:g&&g.map((S,_)=>e.jsxs(w,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:S.isBadge,onChange:T=>C(_,T.target.checked,S.itemCode,S.probability)}),e.jsx(v,{small:!0,children:"Badge?"})]}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:S.itemCode,onChange:T=>C(_,S.isBadge,T.target.value,S.probability),placeholder:"Item Code"}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:S.probability,onChange:T=>C(_,S.isBadge,S.itemCode,Number(T.target.value)),placeholder:"Probability"}),_>0&&e.jsx(L,{variant:"danger",onClick:T=>E(_),children:e.jsx(pc,{className:"fa-icon"})})]},_))})]})},h1=o=>{const[t,s]=i.useState(1),[n,r]=i.useState(1),[a,l]=i.useState(1),{trigger:c=null,setIntParams:m=null}=Te(),h=()=>m([t,n,a]);return i.useEffect(()=>{c.intData.length>=2?(s(c.intData[0]),r(c.intData[1]),l(c.intData[2])):(s(1),r(1),l(1))},[c]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:h,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.setpoints",["points"],[t.toString()])}),e.jsx(Mt,{min:1,max:100,value:t,onChange:u=>s(u)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.settimesingame",["times"],[n.toString()])}),e.jsx(Mt,{min:1,max:10,value:n,onChange:u=>r(u)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.team")}),[1,2,3,4].map(u=>e.jsxs(w,{gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${u}`,checked:a===u,onChange:g=>l(u)}),e.jsx(v,{children:d("wiredfurni.params.team."+u)})]},u))]})]})},g1=o=>{const[t,s]=i.useState(1),[n,r]=i.useState(1),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>l([t,n]);return i.useEffect(()=>{a.intData.length>=2?(s(a.intData[0]),r(a.intData[1])):(s(1),r(1))},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.setpoints",["points"],[t.toString()])}),e.jsx(Mt,{min:1,max:100,value:t,onChange:m=>s(m)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.settimesingame",["times"],[n.toString()])}),e.jsx(Mt,{min:1,max:10,value:n,onChange:m=>r(m)})]})]})},f1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.team")}),[1,2,3,4].map(l=>e.jsxs(w,{gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(v,{children:d(`wiredfurni.params.team.${l}`)})]},l))]})})},p1=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value),maxLength:K("wired.action.kick.from.room.max.length",100)})]})})},x1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),j1=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],I1=[0,1,2,3,4,5,6],b1=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(-1),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>l([t,n]);return i.useEffect(()=>{a.intData.length>=2?(s(a.intData[0]),r(a.intData[1])):(s(-1),r(-1))},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.startdir")}),e.jsx(w,{gap:1,children:j1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:t===m.value,onChange:h=>s(m.value)}),e.jsx(v,{children:e.jsx("i",{className:`icon icon-${m.icon}`})})]},m.value))})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.turn")}),I1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"rotation",id:`rotation${m}`,checked:n===m,onChange:h=>r(m)}),e.jsx(v,{children:d(`wiredfurni.params.turn.${m}`)})]},m))]})]})},E1=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],C1=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(-1),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>l([n,t]);return i.useEffect(()=>{a.intData.length>=2?(s(a.intData[1]),r(a.intData[0])):(s(-1),r(-1))},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.emptytiles",["tiles"],[t.toString()])}),e.jsx(Mt,{min:1,max:5,value:t,onChange:m=>s(m)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.startdir")}),e.jsx(w,{gap:1,children:E1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:n===m.value,onChange:h=>r(m.value)}),e.jsx(v,{children:e.jsx("i",{className:`icon icon-${m.icon}`})})]},m.value))})]})]})},v1=[{value:4,icon:"ne"},{value:5,icon:"se"},{value:6,icon:"sw"},{value:7,icon:"nw"},{value:2,icon:"mv-2"},{value:3,icon:"mv-3"},{value:1,icon:"mv-1"}],N1=[0,1,2,3],_1=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(-1),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>l([t,n]);return i.useEffect(()=>{a.intData.length>=2?(s(a.intData[0]),r(a.intData[1])):(s(-1),r(-1))},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.movefurni")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:"movement0",checked:t===0,onChange:m=>s(0)}),e.jsx(v,{children:d("wiredfurni.params.movefurni.0")})]}),e.jsxs(w,{gap:1,children:[v1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:t===m.value,onChange:h=>s(m.value)}),e.jsx("i",{className:`icon icon-${m.icon}`})]},m.value)),e.jsx("div",{className:"col"})]})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.rotatefurni")}),N1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"rotation",id:`rotation${m}`,checked:n===m,onChange:h=>r(m)}),e.jsxs(v,{children:[[1,2].includes(m)&&e.jsx("i",{className:`icon icon-rot-${m}`}),d(`wiredfurni.params.rotatefurni.${m}`)]})]},m))]})]})},S1=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(""),{trigger:a=null,setIntParams:l=null,setStringParam:c=null}=Te(),m=()=>{l([t]),c(n)};return i.useEffect(()=>{s(a.intData.length>0?a.intData[0]:0),r(a.stringData)},[a]),e.jsxs(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.length.minutes",["minutes"],[t.toString()])}),e.jsx(Mt,{min:1,max:10,value:t,onChange:h=>s(h)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:n,onChange:h=>r(h.target.value),maxLength:K("wired.action.mute.user.max.length",100)})]})]})},w1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),T1=o=>{const[t,s]=i.useState(0),[n,r]=i.useState(0),[a,l]=i.useState(0),{trigger:c=null,setIntParams:m=null}=Te(),h=()=>m([t,n,a]);return i.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.conditions")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"stateFlag",checked:!!t,onChange:u=>s(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.state")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:u=>r(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.direction")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"positionFlag",checked:!!a,onChange:u=>l(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.position")})]})]})})},y1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),R1=o=>e.jsx(xt,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),O1=o=>{switch(o){case st.BOT_CHANGE_FIGURE:return e.jsx(e1,{});case st.BOT_FOLLOW_AVATAR:return e.jsx(t1,{});case st.BOT_GIVE_HAND_ITEM:return e.jsx(n1,{});case st.BOT_MOVE:return e.jsx(r1,{});case st.BOT_TALK:return e.jsx(i1,{});case st.BOT_TALK_DIRECT_TO_AVTR:return e.jsx(a1,{});case st.BOT_TELEPORT:return e.jsx(o1,{});case st.CALL_ANOTHER_STACK:return e.jsx(l1,{});case st.CHASE:return e.jsx(c1,{});case st.CHAT:return e.jsx(u1,{});case st.FLEE:return e.jsx(d1,{});case st.GIVE_REWARD:return e.jsx(m1,{});case st.GIVE_SCORE:return e.jsx(g1,{});case st.GIVE_SCORE_TO_PREDEFINED_TEAM:return e.jsx(h1,{});case st.JOIN_TEAM:return e.jsx(f1,{});case st.KICK_FROM_ROOM:return e.jsx(p1,{});case st.LEAVE_TEAM:return e.jsx(x1,{});case st.MOVE_FURNI:return e.jsx(_1,{});case st.MOVE_AND_ROTATE_FURNI:return e.jsx(b1,{});case st.MOVE_FURNI_TO:return e.jsx(C1,{});case st.MUTE_USER:return e.jsx(S1,{});case st.RESET:return e.jsx(w1,{});case st.SET_FURNI_STATE:return e.jsx(T1,{});case st.TELEPORT:return e.jsx(y1,{});case st.TOGGLE_FURNI_STATE:return e.jsx(R1,{})}return null},ps=o=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null,maxItemSelectionCount:a=50}=o,l=()=>s&&s();return e.jsx(Xc,{wiredType:"condition",requiresFurni:t,hasSpecialInput:n,save:l,maxItemSelectionCount:a,children:r})},k1=[2,5,7,8,9,10,27],A1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.handitem")}),e.jsx("select",{className:"form-select form-select-sm",value:t,onChange:l=>s(parseInt(l.target.value)),children:k1.map(l=>e.jsx("option",{value:l,children:d(`handitem${l}`)},l))})]})})},D1=o=>e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),P1=o=>e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null}),L1=[1,2,3,4],M1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.team")}),L1.map(l=>e.jsxs(w,{gap:1,alignItems:"center",children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(v,{children:d(`wiredfurni.params.team.${l}`)})]},l))]})})},U1=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.badgecode")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value)})]})})},F1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s((n==null?void 0:n.intData[0])??0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.tooltip.effectid")}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:t,onChange:l=>s(parseInt(l.target.value))})]})})},V1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(""),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>{let m=0,h=0;const u=new Date(t),g=new Date(n);u&&g&&(m=u.getTime()/1e3,h=g.getTime()/1e3),l([m,h])};return i.useEffect(()=>{if(a.intData.length>=2){let m=new Date,h=new Date;a.intData[0]>0&&(m=new Date(a.intData[0]*1e3)),a.intData[1]>0&&(h=new Date(a.intData[1]*1e3)),s(Hu(m)),r(Hu(h))}},[a]),e.jsxs(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.startdate")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:m=>s(m.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.enddate")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:n,onChange:m=>r(m.target.value)})]})]})},G1=o=>{const[t,s]=i.useState(5),n=r=>{s(r)};return e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null,maxItemSelectionCount:t,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.requireall.caption")}),[1,5].map(r=>e.jsxs(w,{gap:1,alignItems:"center",children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${r}`,checked:t===r,onChange:()=>n(r)}),e.jsx("label",{className:"text-black form-check-label",htmlFor:`requireAll${r}`,children:d(r===1?"wiredfurni.params.requireall.2":"wiredfurni.params.requireall.3")})]},r))]})})},B1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.requireall")}),[0,1].map(l=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(v,{children:d("wiredfurni.params.requireall."+l)})]},l))]})})},H1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.not_requireall")}),[0,1].map(l=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(v,{children:d(`wiredfurni.params.not_requireall.${l}`)})]},l))]})})},W1=o=>e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),q1=o=>{const[t,s]=i.useState(0),[n,r]=i.useState(0),[a,l]=i.useState(0),{trigger:c=null,setIntParams:m=null}=Te(),h=()=>m([t,n,a]);return i.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.conditions")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"stateFlag",checked:!!t,onChange:u=>s(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.state")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:u=>r(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.direction")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"positionFlag",checked:!!a,onChange:u=>l(u.target.checked?1:0)}),e.jsx(v,{children:d("wiredfurni.params.condition.position")})]})]})})},z1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.allowbefore",["seconds"],[hi(t)])}),e.jsx(Mt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},Y1=o=>{const[t,s]=i.useState(-1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.allowafter",["seconds"],[hi(t)])}),e.jsx(Mt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},$1=o=>{const[t,s]=i.useState(1),[n,r]=i.useState(1),{trigger:a=null,setIntParams:l=null}=Te(),c=()=>l([t,n]);return i.useEffect(()=>{a.intData.length>=2?(s(a.intData[0]),r(a.intData[1])):(s(1),r(1))},[a]),e.jsxs(ps,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.usercountmin",["value"],[t.toString()])}),e.jsx(Mt,{min:1,max:50,value:t,onChange:m=>s(m)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.usercountmax",["value"],[n.toString()])}),e.jsx(Mt,{min:1,max:50,value:n,onChange:m=>r(m)})]})]})},K1=o=>{switch(o){case lt.ACTOR_HAS_HANDITEM:return e.jsx(A1,{});case lt.ACTOR_IS_GROUP_MEMBER:case lt.NOT_ACTOR_IN_GROUP:return e.jsx(D1,{});case lt.ACTOR_IS_ON_FURNI:case lt.NOT_ACTOR_ON_FURNI:return e.jsx(P1,{});case lt.ACTOR_IS_IN_TEAM:case lt.NOT_ACTOR_IN_TEAM:return e.jsx(M1,{});case lt.ACTOR_IS_WEARING_BADGE:case lt.NOT_ACTOR_WEARS_BADGE:return e.jsx(U1,{});case lt.ACTOR_IS_WEARING_EFFECT:case lt.NOT_ACTOR_WEARING_EFFECT:return e.jsx(F1,{});case lt.DATE_RANGE_ACTIVE:return e.jsx(V1,{});case lt.FURNIS_HAVE_AVATARS:case lt.FURNI_NOT_HAVE_HABBO:return e.jsx(G1,{});case lt.HAS_STACKED_FURNIS:return e.jsx(B1,{});case lt.NOT_HAS_STACKED_FURNIS:return e.jsx(H1,{});case lt.STUFF_TYPE_MATCHES:case lt.NOT_FURNI_IS_OF_TYPE:return e.jsx(W1,{});case lt.STATES_MATCH:case lt.NOT_STATES_MATCH:return e.jsx(q1,{});case lt.TIME_ELAPSED_LESS:return e.jsx(z1,{});case lt.TIME_ELAPSED_MORE:return e.jsx(Y1,{});case lt.USER_COUNT_IN:case lt.NOT_USER_COUNT_IN:return e.jsx($1,{})}return null},Ns=o=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=o,a=()=>s&&s();return e.jsx(Xc,{wiredType:"trigger",requiresFurni:t,hasSpecialInput:n,save:a,children:r})},X1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(0),{trigger:a=null,setStringParam:l=null}=Te(),c=()=>l(n===1?t:"");return i.useEffect(()=>{s(a.stringData),r(a.stringData?1:0)},[a]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.picktriggerer")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"avatarMode",id:"avatarMode0",checked:n===0,onChange:m=>r(0)}),e.jsx(v,{children:d("wiredfurni.params.anyavatar")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"avatarMode",id:"avatarMode1",checked:n===1,onChange:m=>r(1)}),e.jsx(v,{children:d("wiredfurni.params.certainavatar")})]}),n===1&&e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:m=>s(m.target.value)})]})})},Q1=o=>{const[t,s]=i.useState(""),[n,r]=i.useState(-1),{trigger:a=null,setStringParam:l=null,setIntParams:c=null}=Te(),m=()=>{l(t),c([n])};return i.useEffect(()=>{s(a.stringData),r(a.intData.length>0?a.intData[0]:0)},[a]),e.jsxs(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.whatissaid")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.picktriggerer")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar0",checked:n===0,onChange:h=>r(0)}),e.jsx(v,{children:d("wiredfurni.params.anyavatar")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar1",checked:n===1,onChange:h=>r(1)}),e.jsx(v,{children:G().userName})]})]})]})},J1=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),Z1=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),ek=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},tk=o=>{const[t,s]=i.useState(""),{trigger:n=null,setStringParam:r=null}=Te(),a=()=>r(t);return i.useEffect(()=>{s(n.stringData)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},sk=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),nk=o=>{const[t,s]=i.useState(1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.settime",["seconds"],[hi(t)])}),e.jsx(Mt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},rk=o=>{const[t,s]=i.useState(1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.setlongtime",["time"],[en.format(t*5).toString()])}),e.jsx(Mt,{min:1,max:120,value:t,onChange:l=>s(l)})]})})},ak=o=>{const[t,s]=i.useState(1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.settime",["seconds"],[hi(t)])}),e.jsx(Mt,{min:1,max:60,value:t,onChange:l=>s(l)})]})})},ik=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),ok=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),lk=o=>{const[t,s]=i.useState(1),{trigger:n=null,setIntParams:r=null}=Te(),a=()=>r([t]);return i.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:a,children:e.jsxs(N,{gap:1,children:[e.jsx(v,{bold:!0,children:d("wiredfurni.params.setscore",["points"],[t.toString()])}),e.jsx(Mt,{min:1,max:1e3,value:t,onChange:l=>s(l)})]})})},ck=o=>e.jsx(Ns,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),uk=o=>{switch(o){case es.AVATAR_ENTERS_ROOM:return e.jsx(X1,{});case es.AVATAR_SAYS_SOMETHING:return e.jsx(Q1,{});case es.AVATAR_WALKS_OFF_FURNI:return e.jsx(J1,{});case es.AVATAR_WALKS_ON_FURNI:return e.jsx(Z1,{});case es.BOT_REACHED_AVATAR:return e.jsx(ek,{});case es.BOT_REACHED_STUFF:return e.jsx(tk,{});case es.COLLISION:return e.jsx(sk,{});case es.EXECUTE_ONCE:return e.jsx(nk,{});case es.EXECUTE_PERIODICALLY:return e.jsx(ak,{});case es.EXECUTE_PERIODICALLY_LONG:return e.jsx(rk,{});case es.GAME_ENDS:return e.jsx(ik,{});case es.GAME_STARTS:return e.jsx(ok,{});case es.SCORE_ACHIEVED:return e.jsx(lk,{});case es.TOGGLE_FURNI:return e.jsx(ck,{})}return null},dk=o=>{const{trigger:t=null}=Te();return t?t instanceof Rm?O1(t.code):t instanceof Om?uk(t.code):t instanceof km?K1(t.code):null:null},mk=o=>{const[t,s]=i.useState(-1),[n,r]=i.useState(""),[a,l]=i.useState(""),[c,m]=i.useState(!1),h=()=>{m(!1)};i.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<3))switch(p[1]){case"show":m(!0),r(p[2]);return}},eventUrlPrefix:"youtube-tv/"};return ft(g),()=>pt(g)},[]);const u=i.useMemo(()=>K("url.prefix"),[]);return c?e.jsxs(ae,{className:"youtube-tv-widget",children:[e.jsx(re,{headerText:"Tv Youtube",onCloseClick:h}),e.jsx(se,{grow:!0,gap:0,children:e.jsx("div",{className:"youtube-video-container d-flex w-100 h-100",children:n&&n.length>0&&e.jsx("iframe",{allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}?autoplay=1&mute=0&controls=1&origin=`+u+"&playsinline=1&showinfo=0&rel=0&iv_load_policy=3&modestbranding=1&disablekb=1&enablejsapi=1&widgetid=3"})})})]}):null},hk=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!0);return He(Lt.CREATED,a=>r(!1)),He(Lt.ENDED,a=>r(a.openLandingView)),i.useEffect(()=>{s(!0),$a().connection.onReady()},[]),i.useEffect(()=>{const a={linkReceived:l=>{const c=l.split("/");if(!(c.length<2))switch(c[1]){case"open":if(c.length>2)switch(c[2]){case"credits":break;default:{const m=c[2];oi.openHabblet(m)}}return}},eventUrlPrefix:"habblet/"};return ft(a),()=>pt(a)},[]),e.jsxs(A,{fit:!0,children:[e.jsx(or,{children:n&&e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(WT,{})})}),e.jsx(WO,{isInRoom:!n}),e.jsx(Iy,{}),e.jsx(BO,{}),e.jsx(dw,{}),e.jsx(dk,{}),e.jsx(pS,{}),e.jsx(tS,{}),e.jsx(Ly,{}),e.jsx(My,{}),e.jsx(ry,{}),e.jsx(uw,{}),e.jsx(Pw,{}),e.jsx(lR,{}),e.jsx(QO,{}),e.jsx(XO,{}),e.jsx(Jw,{}),e.jsx(vS,{}),e.jsx(TT,{}),e.jsx(Fy,{}),e.jsx(cT,{}),e.jsx(uT,{}),e.jsx(SS,{}),e.jsx(Fw,{}),e.jsx(Cw,{}),e.jsx(mk,{})]})};hm.UI_VERSION=uh();const gk=o=>{const[t,s]=i.useState(!1),[n,r]=i.useState(!1),[a,l]=i.useState("Getting Ready"),[c,m]=i.useState(0),[h,u]=i.useState(!0);if(!Ce()){if(!NitroConfig)throw new Error("NitroConfig is not defined!");Yr.bootstrap()}const g=i.useCallback(async f=>{switch(f.type){case yi.LOADED:Ce().localization.init(),m(p=>p+20);return;case yi.FAILED:r(!0),l("Configuration Failed");return;case Yr.WEBGL_UNAVAILABLE:r(!0),l("WebGL Required");return;case Yr.WEBGL_CONTEXT_LOST:r(!0),l("WebGL Context Lost - Reloading"),setTimeout(()=>window.location.reload(),1500);return;case on.CONNECTION_HANDSHAKING:m(p=>p+20);return;case on.CONNECTION_HANDSHAKE_FAILED:r(!0),l("Handshake Failed");return;case on.CONNECTION_AUTHENTICATED:m(p=>p+20),Ce().init(),Ya.available&&Ya.call("legacyTrack","authentication","authok",[]);return;case on.CONNECTION_ERROR:r(!0),l("Connection Error");return;case on.CONNECTION_CLOSED:l("Connection Error"),oi.send(-1,"client.init.handshake.fail");return;case ys.ENGINE_INITIALIZED:m(p=>p+20),setTimeout(()=>s(!0),300);return;case Cu.LOADED:{const p=K("preload.assets.urls"),x=[];if(p&&p.length)for(const j of p)x.push(Ec.interpolate(j));await mC().downloadAssets(x)?($a().init(),m(j=>j+20)):(r(!0),l("Assets Failed"));return}}},[]);return pr(Yr.WEBGL_UNAVAILABLE,g),pr(Yr.WEBGL_CONTEXT_LOST,g),pr(on.CONNECTION_HANDSHAKING,g),pr(on.CONNECTION_HANDSHAKE_FAILED,g),pr(on.CONNECTION_AUTHENTICATED,g),pr(on.CONNECTION_ERROR,g),pr(on.CONNECTION_CLOSED,g),we(ys.ENGINE_INITIALIZED,g),Hv(Cu.LOADED,g),$u(yi.LOADED,g),$u(yi.FAILED,g),i.useEffect(()=>{Ce().core.configuration.init();const f=p=>u(!(window.devicePixelRatio%1));return window.addEventListener("resize",f),f(),()=>{window.removeEventListener("resize",f)}},[]),e.jsxs(A,{fit:!0,overflow:"hidden",className:h&&"image-rendering-pixelated",children:[(!t||n)&&e.jsx($_,{isError:n,message:a,percent:c}),e.jsx(or,{children:t&&e.jsx(lr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:e.jsx(hk,{})})}),e.jsx(A,{id:"draggable-windows-container"})]})};Og(document.getElementById("root")).render(e.jsx(gk,{}));
|