1import * as Gn from "react"; 2import qn, { useState as Zn, useEffect as Xt, createContext as Jo, useContext as qo, useCallback as Yt, memo as Fr, useMemo as rn, createElement as Qn } from "react"; 3import { ReactIntlErrorCode as Qo, useIntl as Or, FormattedMessage as Rt, IntlProvider as ea } from "react-intl"; 4import { useConfigs as ta, useTimeZone as na, useLocale as ra, useTranslations as ia } from "rsi-react-hooks"; 5import { usePropPacksMLBRewardsPlayerCard as oa, usePropPacksContext as at, usePropPacksPlayerCardBackground as aa, useFormattedStartTime as Gi, usePropPacksConfig as sa, usePropPacksAssets as _n, usePropPacksMLBCompletedPlayerCard as ua, usePropPacksNBACompletedPlayerCard as la, PropPacksContextProvider as ca } from "rsi-react-hooks-sports"; 6import ae, { keyframes as bt, css as Xi, createGlobalStyle as fa, ThemeProvider as da } from "styled-components"; 7import { Icon as ha, Picture as Gt, Button as It, theme as pa } from "ui-component-library"; 8import Mt from "rsi-analytics"; 9import { PropPacksGameType as Ki, PropPacksPlayerCardStatus as Zi } from "rsi-interfaces-sports"; 10import er from "rsi-utils"; 11import ma from "rsi-logger"; 12import va from "util-modal"; 13import { MLBRewardsPlayerCard as ga, NBARewardsPlayerCard as Pr, MLBPlayerCard as ki, NBAPlayerCard as Rr } from "ui-component-library-sports"; 14import Ji from "util-event-bus"; 15var br = { exports: {} }, gn = {}; 16var Li; 17function ya() { 18 if (Li) return gn; 19 Li = 1; 20 var u = qn, d = /* @__PURE__ */ Symbol.for("react.element"), C = /* @__PURE__ */ Symbol.for("react.fragment"), P = Object.prototype.hasOwnProperty, V = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Q = { key: !0, ref: !0, __self: !0, __source: !0 }; 21 function N(F, k, K) { 22 var J, ie = {}, Z = null, a = null; 23 K !== void 0 && (Z = "" + K), k.key !== void 0 && (Z = "" + k.key), k.ref !== void 0 && (a = k.ref); 24 for (J in k) P.call(k, J) && !Q.hasOwnProperty(J) && (ie[J] = k[J]); 25 if (F && F.defaultProps) for (J in k = F.defaultProps, k) ie[J] === void 0 && (ie[J] = k[J]); 26 return { $$typeof: d, type: F, key: Z, ref: a, props: ie, _owner: V.current }; 27 } 28 return gn.Fragment = C, gn.jsx = N, gn.jsxs = N, gn; 29} 30var Fi; 31function ba() { 32 return Fi || (Fi = 1, br.exports = ya()), br.exports; 33} 34var E = ba(); 35const Tt = { 36 GA4_EVENT_NAME: "sports_proppacks" 37}, Jn = { 38 NAME: "MfeSportsProppacksFunnel", 39 TEAM: "SPORTS", 40 PUBLIC_URL: "https://micro-frontends.rushstreetcontent.com/mfe-sports-proppacks-funnel/1.35.0" 41}, jr = new ma([Jn.TEAM, Jn.NAME]); 42let Yn = [], wr; 43const wa = (u) => { 44 if (u.code === Qo.MISSING_TRANSLATION) { 45 u.descriptor?.id && !Yn.includes(u.descriptor.id) && Yn.push(u.descriptor.id), wr && globalThis.clearTimeout(wr), wr = globalThis.setTimeout(() => { 46 jr.error("Translations missing:", { 47 missingTranslations: Yn 48 }), Yn = []; 49 }, 3e3); 50 return; 51 } 52 throw u; 53}, Oi = (u) => u ? u.endsWith("/") ? u : `${u}/` : null; 54function _a({ 55 fileName: u, 56 folderName: d 57}) { 58 const { 59 api: C 60 } = ta(["api"]), [P, V] = Zn(null); 61 return Xt(() => { 62 if (!C || P || !u || !d) 63 return; 64 const Q = `${Oi(C?.baseUrl)}cms/${Oi(d)}${u}.riv`; 65 (async () => { 66 try { 67 const F = await fetch(Q); 68 if (!(F.status >= 200 && F.status < 300)) 69 throw new Error(`Failed to fetch Card Reveal Asset: ${u}`); 70 const k = await F.arrayBuffer(); 71 V(() => k); 72 } catch (F) { 73 jr.error(`Failed to fetch Card Reveal Asset: ${u}`, F); 74 } 75 })(); 76 }, [C, P, u, d]), P; 77} 78const qi = Jo(void 0); 79function Ca({ 80 modalId: u, 81 children: d 82}) { 83 const C = Yt((P) => { 84 va.dismiss(u, P); 85 }, [u]); 86 return /* @__PURE__ */ E.jsx(qi.Provider, { value: C, children: d }); 87} 88function Qi() { 89 const u = qo(qi); 90 if (!u) 91 throw new Error("useCloseFunnelModal must be used within FunnelModalProvider"); 92 return u; 93} 94function eo({ 95 category: u, 96 eventGroupId: d 97}) { 98 const C = Qi(); 99 return Yt(() => { 100 Mt.event({ 101 event: Tt.GA4_EVENT_NAME,
102 category: "PropPacks Funnel", 103 action: "Navigate to Lobby", 104 label: u 105 }); 106 const P = { 107 action: "LOBBY_REDIRECT_REQUESTED", 108 tabName: u, 109 ...d === void 0 ? {} : { 110 eventGroupId: d 111 } 112 }; 113 C(P); 114 }, [u, C, d]); 115} 116const Aa = ae.button(["position:", ";top:12px;right:12px;margin:0;padding:0;border:0;cursor:pointer;background:transparent;z-index:20;"], er.detector.isMobileApp ? "fixed" : "absolute"); 117function xa() { 118 const u = Qi(), d = Yt(() => { 119 Mt.event({ 120 event: Tt.GA4_EVENT_NAME, 121 category: "PropPacks Funnel", 122 action: "Modal close icon click" 123 }), u(); 124 }, [u]); 125 return /* @__PURE__ */ E.jsx(Aa, { onClick: d, children: /* @__PURE__ */ E.jsx(ha, { name: "close", width: 28, height: 28 }) }); 126} 127const Cn = Fr(xa), tr = ae.div` 128 color: ${({ 129 light: u 130}) => u ? "#00204E" : "#F3CB2A"}; 131 text-align: center; 132 font-family: ${({ 133 theme: u 134}) => u.typography.fonts.secondary}; 135 font-size: 26px; 136 font-weight: 700; 137 line-height: 26px; /* 100% */ 138 text-transform: uppercase; 139`, to = ae.p` 140 color: ${({ 141 light: u 142}) => u ? "#121212" : "#FFF"}; 143 text-align: center; 144 font-family: ${({ 145 theme: u 146}) => u.typography.fonts.primary}; 147 font-size: 14px; 148 font-style: normal; 149 font-weight: 500; 150 line-height: 17px; /* 121.429% */ 151 padding: 0; 152 margin-top: 8px; 153`, bn = ae.div` 154 display: flex; 155 align-items: center; 156 background-color: ${({ 157 light: u 158}) => u ? "rgba(255, 255, 255, 0.70)" : "rgba(255, 255, 255, 0.07)"}; 159 border-radius: 16px; 160 justify-content: center; 161 margin-bottom: 8px; 162`, Ea = ae.div` 163 padding: 17px; 164 color: #F3CB2A; 165 background-color: ${({ 166 theme: u, 167 light: d 168}) => d ? u.colors.neutral[50] : "rgba(255, 255, 255, 0.07)"}; 169 font-family: ${({ 170 theme: u 171}) => u.typography.fonts.secondary}; 172 font-size: 26px; 173 font-weight: 700; 174 line-height: 26px; /* 100% */ 175 text-align: center; 176 text-transform: uppercase; 177 max-width: 26px; 178 display: flex; 179 align-items: center; 180 justify-content: center; 181 align-self: stretch; 182 border-radius: 16px 0 0 16px; 183`, Pa = ae.div` 184 align-items: center; 185 display: flex; 186 padding-left: 16px; 187 width: 100%; 188 color: ${({ 189 theme: u, 190 light: d 191}) => d ? "#33414F" : u.colors.neutral[50]}; 192`, Ra = ae.div` 193 font-family: ${({ 194 theme: u 195}) => u.typography.fonts.primary}; 196 font-size: 16px; 197 padding: 16px 0; 198 flex: 1; 199`, Ia = ae.div``, Ma = ae.div` 200 & img { 201 width: 100px; 202 } 203`, Ta = ae.div` 204 font-size: 18px; 205 font-weight: 700; 206 margin-bottom: 16px; 207 font-family: ${({ 208 theme: u 209}) => u.typography.fonts.secondary}; 210 text-transform: uppercase; 211 212`, Sr = ae.div` 213 & img { 214 width: 100%; 215 max-width: 320px; 216 margin-bottom: 20px; 217 } 218`, An = ae.div` 219 & img { 220 display: ${({ 221 hideOnMobile: u 222}) => u ? "none" : "block"}; 223 max-width: 185px; 224 width: 100%; 225 margin: 0 auto; 226 227 @media only screen and (min-width: ${({ 228 theme: u 229}) => u.breakpoints.md}) { 230 display: block; 231 } 232 } 233`; 234ae.div` 235 margin-bottom: 6px; 236 text-align: left; 237 `; 238ae.input` 239 margin: 10px !important; 240 transform: scale(1.5); 241 -webkit-transform: scale(1.5); 242`; 243function ka({ 244 card: u, 245 teamUUID: d, 246 variant: C, 247 size: P, 248 participants: V, 249 time: Q, 250 jerseyAlt: N, 251 teamKambiId: F 252}) { 253 const k = oa({ 254 playerCard: u, 255 isNotStarted: !0, 256 gamePoints: u.points, 257 showStats: !1 258 }), { 259 leagueBranding: K 260 } = at(), J = !!K?.propPacksTeamLogosEnabled, ie = rn(() => K?.teams?.find(({ 261 teamId: Z 262 }) => Number(Z) === F), [K?.teams, F]); 263 return /* @__PURE__ */ Qn(ga, { ...k, key: u.cardUUID, teamUUID: d, variant: C, size: P, participants: V, time: Q, jerseyAlt: N, stats: void 0, teamLogoEnabled: J, teamFillColor: ie?.teamPropPacksFillColor, teamStrokeColor: ie?.teamPropPacksStrokeColor, teamKambiId: F }); 264} 265function La({ 266 card: u, 267 teamUUID: d, 268 variant: C, 269 size: P, 270 participants: V, 271 time: Q, 272 jerseyAlt: N, 273 teamKambiId: F 274}) { 275 const { 276 leagueBranding: k 277 } = at(), K = aa(C), { 278 formatMessage: J 279 } = Or(), ie = !!k?.propPacksTeamLogosEnabled, Z = rn(() => k?.teams?.find(({ 280 teamId: M 281 }) => Number(M) === F), [k?.teams, F]), a = { 282 variant: C, 283 backgroundImageSet: K, 284 size: Pr.Size.LARGE, 285 playerName: `${u.playerInfo?.firstName} ${u.playerInfo?.lastName}`, 286 points: u.pointsPerGame, 287 pointsActive: !1, 288 rewards: u.prizes, 289 playerNumber: u?.playerInfo?.jerseyNumber, 290 pointsLabel: J({ 291 id: "POINTS_PER_GAME_LABEL_SHORT" 292 }), 293 rewardsPointsLabel: J({ 294 id: "POINTS_LABEL_SHORT" 295 }) 296 }; 297 return /* @__PURE__ */ Qn(Pr, { ...a, key: u.cardUUID, teamUUID: d, size: P, participants: V, time: Q, jerseyAlt: N, teamLogoEnabled: ie, teamFillColor: Z?.teamPropPacksFillColor, teamStrokeColor: Z?.teamPropPacksStrokeColor, teamKambiId: F }); 298} 299function Fa({ 300 card: u, 301 cardRevealPack: d 302}) { 303 const C = Gi({ 304 closingTime: d?.startDate, 305 dateTimeFormat: "M/D/YY", 306 timeFormat: "", 307 hasStarted: !1, 308 isShortFormat: !0 309 }), P = u.playerInfo?.isHomeTeam ? d.home : d.away, V = u.packType.toLowerCase(), { 310 config: Q 311 } = at(); 312 if (!Q) 313 return null; 314 const N = P.teamUUID, F = Pr?.Size?.LARGE, k = `${P.shortname} Jersey`, K = d.eventName.short.join(" "), J = C;
315 return Q.gameType === Ki.MLB ? /* @__PURE__ */ E.jsx(ka, { card: u, teamUUID: N, variant: V, size: F, participants: K, time: J, jerseyAlt: k, teamKambiId: P.kambiTeamId }) : /* @__PURE__ */ E.jsx(La, { card: u, teamUUID: N, variant: V, size: F, participants: K, time: J, jerseyAlt: k, teamKambiId: P.kambiTeamId }); 316} 317var _r = {}, Xn = { exports: {} }, Oa = Xn.exports, ji; 318function ja() { 319 return ji || (ji = 1, (function(u, d) { 320 (function(P, V) { 321 u.exports = V(); 322 })(Oa, () => ( 323 /******/ 324 (() => { 325 var C = [ 326 , 327 /* 1 */ 328 /***/ 329 ((N, F, k) => { 330 k.r(F), k.d(F, { 331 /* harmony export */ 332 default: () => J 333 /* harmony export */ 334 }); 335 var K = (() => { 336 var ie = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0; 337 return (function(Z = {}) { 338 var a = Z, M, _; 339 a.ready = new Promise((e, t) => { 340 M = e, _ = t; 341 }); 342 function ue() { 343 function e(p) { 344 const y = o; 345 r = t = 0, o = /* @__PURE__ */ new Map(), y.forEach((x) => { 346 try { 347 x(p); 348 } catch (g) { 349 console.error(g); 350 } 351 }), this.pb(), l && l.Tb(); 352 } 353 let t = 0, r = 0, o = /* @__PURE__ */ new Map(), l = null, f = null; 354 this.requestAnimationFrame = function(p) { 355 t || (t = requestAnimationFrame(e.bind(this))); 356 const y = ++r; 357 return o.set(y, p), y; 358 }, this.cancelAnimationFrame = function(p) { 359 o.delete(p), t && o.size == 0 && (cancelAnimationFrame(t), t = 0); 360 }, this.Rb = function(p) { 361 f && (document.body.remove(f), f = null), p || (f = document.createElement("div"), f.style.backgroundColor = "black", f.style.position = "fixed", f.style.right = 0, f.style.top = 0, f.style.color = "white", f.style.padding = "4px", f.innerHTML = "RIVE FPS", p = function(y) { 362 f.innerHTML = "RIVE FPS " + y.toFixed(1); 363 }, document.body.appendChild(f)), l = new function() { 364 let y = 0, x = 0; 365 this.Tb = function() { 366 var g = performance.now(); 367 x ? (++y, g -= x, 1e3 < g && (p(1e3 * y / g), y = x = 0)) : (x = g, y = 0); 368 }; 369 }(); 370 }, this.Ob = function() { 371 f && (document.body.remove(f), f = null), l = null; 372 }, this.pb = function() { 373 }; 374 } 375 function q(e) { 376 console.assert(!0); 377 const t = /* @__PURE__ */ new Map(); 378 let r = -1 / 0; 379 this.push = function(o) { 380 return o = o + ((1 << e) - 1) >> e, t.has(o) && clearTimeout(t.get(o)), t.set(o, setTimeout(function() { 381 t.delete(o), t.length == 0 ? r = -1 / 0 : o == r && (r = Math.max(...t.keys()), console.assert(r < o)); 382 }, 1e3)), r = Math.max(o, r), r << e; 383 }; 384 } 385 const oe = a.onRuntimeInitialized; 386 a.onRuntimeInitialized = function() { 387 oe && oe(); 388 let e = a.decodeAudio; 389 a.decodeAudio = function(l, f) { 390 l = e(l), f(l); 391 }; 392 let t = a.decodeFont; 393 a.decodeFont = function(l, f) { 394 l = t(l), f(l); 395 }; 396 const r = a.FileAssetLoader; 397 a.ptrToAsset = (l) => { 398 let f = a.ptrToFileAsset(l); 399 return f.isImage ? a.ptrToImageAsset(l) : f.isFont ? a.ptrToFontAsset(l) : f.isAudio ? a.ptrToAudioAsset(l) : f; 400 }, a.CustomFileAssetLoader = r.extend("CustomFileAssetLoader", { __construct: function({ loadContents: l }) { 401 this.__parent.__construct.call(this), this.Gb = l; 402 }, loadContents: function(l, f) { 403 return l = a.ptrToAsset(l), this.Gb(l, f); 404 } }), a.CDNFileAssetLoader = r.extend("CDNFileAssetLoader", { __construct: function() { 405 this.__parent.__construct.call(this); 406 }, loadContents: function(l) { 407 let f = a.ptrToAsset(l); 408 return l = f.cdnUuid, l === "" ? !1 : ((function(p, y) { 409 var x = new XMLHttpRequest(); 410 x.responseType = "arraybuffer", x.onreadystatechange = function() { 411 x.readyState == 4 && x.status == 200 && y(x); 412 }, x.open("GET", p, !0), x.send(null); 413 })(f.cdnBaseUrl + "/" + l, (p) => { 414 f.decode(new Uint8Array(p.response)); 415 }), !0); 416 } }), a.FallbackFileAssetLoader = r.extend("FallbackFileAssetLoader", { __construct: function() { 417 this.__parent.__construct.call(this), this.lb = []; 418 }, addLoader: function(l) {
419 this.lb.push(l); 420 }, loadContents: function(l, f) { 421 for (let p of this.lb) 422 if (p.loadContents(l, f)) 423 return !0; 424 return !1; 425 } }); 426 let o = a.computeAlignment; 427 a.computeAlignment = function(l, f, p, y, x = 1) { 428 return o.call(this, l, f, p, y, x); 429 }; 430 }; 431 const fe = "createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "), de = new function() { 432 function e() { 433 if (!t) { 434 let _e = function(Ae, G, De) { 435 if (G = S.createShader(G), S.shaderSource(G, De), S.compileShader(G), De = S.getShaderInfoLog(G), 0 < (De || "").length) 436 throw De; 437 S.attachShader(Ae, G); 438 }; 439 var v = document.createElement("canvas"), W = { alph
439a: 1, depth: 0, stencil: 0, antialias: 0, premultipliedAlpha: 1, preserveDrawingBuffer: 0, powerPreference: "high-performance", failIfMajorPerformanceCaveat: 0, enableExtensionsByDefault: 1, explicitSwapControl: 1, renderViaOffscreenBackBuffer: 1 }; 440 let S; 441 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 442 if (S = v.getContext("webgl", W), r = 1, !S) 443 return console.log("No WebGL support. Image mesh will not be drawn."), !1; 444 } else if (S = v.getContext("webgl2", W)) 445 r = 2; 446 else if (S = v.getContext("webgl", W)) 447 r = 1; 448 else 449 return console.log("No WebGL support. Image mesh will not be drawn."), !1; 450 if (S = new Proxy(S, { get(Ae, G) { 451 if (Ae.isContextLost()) { 452 if (x || (console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ", G), x = !0), typeof Ae[G] == "function") 453 return function() { 454 }; 455 } else 456 return typeof Ae[G] == "function" ? function(...De) { 457 return Ae[G].apply(Ae, De); 458 } : Ae[G]; 459 }, set(Ae, G, De) { 460 if (Ae.isContextLost()) 461 x || (console.error("Cannot render the mesh because the GL Context was lost. Tried to set property " + G), x = !0); 462 else 463 return Ae[G] = De, !0; 464 } }), o = Math.min(S.getParameter(S.MAX_RENDERBUFFER_SIZE), S.getParameter(S.MAX_TEXTURE_SIZE)), v = S.createProgram(), _e(v, S.VERTEX_SHADER, `attribute vec2 vertex; 465 attribute vec2 uv; 466 uniform vec4 mat; 467 uniform vec2 translate; 468 varying vec2 st; 469 void main() { 470 st = uv; 471 gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1); 472 }`), _e(v, S.FRAGMENT_SHADER, `precision highp float; 473 uniform sampler2D image; 474 varying vec2 st; 475 void main() { 476 gl_FragColor = texture2D(image, st); 477 }`), S.bindAttribLocation(v, 0, "vertex"), S.bindAttribLocation(v, 1, "uv"), S.linkProgram(v), W = S.getProgramInfoLog(v), 0 < (W || "").trim().length) 478 throw W; 479 l = S.getUniformLocation(v, "mat"), f = S.getUniformLocation(v, "translate"), S.useProgram(v), S.bindBuffer(S.ARRAY_BUFFER, S.createBuffer()), S.enableVertexAttribArray(0), S.enableVertexAttribArray(1), S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, S.createBuffer()), S.uniform1i(S.getUniformLocation(v, "image"), 0), S.pixelStorei(S.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), t = S; 480 } 481 return !0; 482 } 483 let t = null, r = 0, o = 0, l = null, f = null, p = 0, y = 0, x = !1; 484 e(), this.hc = function() { 485 return e(), o; 486 }, this.Mb = function(v) { 487 t.deleteTexture && t.deleteTexture(v); 488 }, this.Lb = function(v) { 489 if (!e()) 490 return null; 491 const W = t.createTexture(); 492 return W ? (t.bindTexture(t.TEXTURE_2D, W), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, v), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), r == 2 ? (t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR_MIPMAP_LINEAR), t.generateMipmap(t.TEXTURE_2D)) : t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), W) : null; 493 }; 494 const g = new q(8), D = new q(8), U = new q(10), ee = new q(10); 495 this.Qb = function(v, W, S, _e, Ae) { 496 if (e()) { 497 var G = g.push(v), De = D.push(W); 498 if (t.canvas) { 499 (t.canvas.width != G || t.canvas.height != De) && (t.canvas.width = G, t.canvas.height = De), t.viewport(0, De - W, v, W), t.disable(t.SCISSOR_TEST), t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.enable(t.SCISSOR_TEST), S.sort((Me, yt) => yt.xb - Me.xb), G = U.push(_e), p != G && (t.bufferData(t.ARRAY_BUFFER, 8 * G, t.DYNAMIC_DRAW), p = G), G = 0; 500 for (var Je of S) 501 t.bufferSubData(t.ARRAY_BUFFER, G, Je.Ua), G += 4 * Je.Ua.length; 502 console.assert(G == 4 * _e); 503 for (var gt of S) 504 t.bufferSubData(t.ARRAY_BUFFER, G, gt.Db), G += 4 * gt.Db.length; 505 console.assert(G == 8 * _e), G = ee.push(Ae), y != G && (t.bufferData(t.ELEMENT_ARRAY_BUFFER, 2 * G, t.DYNAMIC_DRAW), y = G), Je = 0; 506 for (var Nt of S) 507 t.bufferSubData(t.ELEMENT_ARRAY_BUFFER, Je, Nt.indices), Je += 2 * Nt.indices.length; 508 console.assert(Je == 2 * Ae), Nt = 0, gt = !0, G = Je = 0; 509 for (const Me of S) { 510 Me.image.Ka != Nt && (t.bindTexture(t.TEXTURE_2D, Me.image.Ja || null), Nt = Me.image.Ka), Me.mc ? (t.scissor(Me.Za, De - Me.$a - Me.kb, Me.Ac, Me.kb), gt = !0) : gt && (t.scissor(0, De - W, v, W), gt = !1), S = 2 / v; 511 const yt = -2 / W; 512 t.uniform4f(l, Me.ha[0] * S * Me.Ba, Me.ha[1] * yt * Me.Ca, Me.ha[2] * S * Me.Ba, Me.ha[3] * yt * Me.Ca), t.uniform2f(f, Me.ha[4] * S * Me.Ba + S * (Me.Za - Me.ic * Me.Ba) - 1, Me.ha[5] * yt * Me.Ca + yt * (Me.$a - Me.jc * Me.Ca) + 1), t.vertexAttribPointer(0, 2, t.FLOAT, !1, 0, G), t.vertexAttribPointer(1, 2, t.FLOAT, !1, 0, G + 4 * _e), t.drawElements(t.TRIANGLES, Me.indices.length, t.UNSIGNED_SHORT, Je), G += 4 * Me.Ua.length, Je += 2 * Me.indices.length; 513 } 514 console.assert(G == 4 * _e), console.assert(Je == 2 * Ae); 515 } 516 } 517 }, this.canvas = function() { 518 return e() && t.canvas; 519 }; 520 }(), ye = a.onRuntimeInitialized; 521 a.onRuntimeInitialized = function() { 522 function e(j) { 523 switch (j) { 524 case g.srcOver: 525 return "source-over"; 526 case g.screen: 527 return "screen"; 528 case g.overlay: 529 return "overlay"; 530 case g.darken: 531 return "darken"; 532 case g.lighten: 533 return "lighten"; 534 case g.colorDodge: 535 return "color-dodge"; 536 case g.colorBurn: 537 return "color-burn"; 538 case g.hardLight: 539 return "hard-light"; 540 case g.softLight: 541 return "soft-light"; 542 case g.difference: 543 return "difference"; 544 case g.exclusion: 545 return "exclusion"; 546 case g.multiply: 547 return "multiply"; 548 case g.hue: 549 return "hue"; 550 case g.saturation: 551 return "saturation"; 552 case g.color: 553 return "color"; 554 case g.luminosity: 555 return "luminosity"; 556 } 557 } 558 function t(j) { 559 return "rgba(" + ((16711680 & j) >>> 16) + "," + ((65280 & j) >>> 8) + "," + ((255 & j) >>> 0) + "," + ((4278190080 & j) >>> 24) / 255 + ")"; 560 } 561 function r() { 562 0 < De.length && (de.Qb(G.drawWidth(), G.drawHeight(), De, Je, gt), De = [], gt = Je = 0, G.reset(512, 512)); 563 for (const j of Ae) { 564 for (const X of j.H) 565 X(); 566 j.H = []; 567 } 568 Ae.clear(); 569 } 570 ye && ye(); 571 var o = a.RenderPaintStyle; 572 const l = a.RenderPath, f = a.RenderPaint, p = a.Renderer, y = a.StrokeCap, x = a.StrokeJoin, g = a.BlendMode, D = o.fill, U = o.stroke, ee = a.FillRule.evenOdd; 573 let v = 1; 574 var W = a.RenderImage.extend("CanvasRenderImage", { __construct: function({ la: j, xa: X } = {}) { 575 this.__parent.__construct.call(this), this.Ka = v, v = v + 1 & 2147483647 || 1, this.la = j, this.xa = X; 576 }, __destruct: function() { 577 this.Ja && (de.Mb(this.Ja), URL.revokeObjectURL(this.Xa)), this.__parent.__destruct.call(this); 578 }, decode: function(j) { 579 var X = this; 580 X.xa && X.xa(X); 581 var Ee = new Image(); 582 X.Xa = URL.createObjectURL(new Blob([j], { type: "image/png" })), Ee.onload = function() { 583 X.Fb = Ee, X.Ja = de.Lb(Ee), X.size(Ee.width, Ee.height), X.la && X.la(X); 584 }, Ee.src = X.Xa; 585 } }), S = l.extend("CanvasRenderPath", { __construct: function() { 586 this.__parent.__construct.call(this), this.T = new Path2D(); 587 }, rewind: function() { 588 this.T = new Path2D(); 589 }, addPath: function(j, X, Ee, Te, Ce, Re, Oe) { 590 var Se = this.T, ht = Se.addPath; 591 j = j.T; 592 const Ke = new DOMMatrix(); 593 Ke.a = X, Ke.b = Ee, Ke.c = Te, Ke.d = Ce, Ke.e = Re, Ke.f = Oe, ht.call(Se, j, Ke); 594 }, fillRule: function(j) { 595 this.Wa = j; 596 }, moveTo: function(j, X) { 597 this.T.moveTo(j, X); 598 }, lineTo: function(j, X) { 599 this.T.lineTo(j, X); 600 }, cubicTo: function(j, X, Ee, Te, Ce, Re) { 601 this.T.bezierCurveTo(j, X, Ee, Te, Ce, Re); 602 }, close: function() { 603 this.T.closePath(); 604 } }
604), _e = f.extend("CanvasRenderPaint", { color: function(j) { 605 this.Ya = t(j); 606 }, thickness: function(j) { 607 this.Ib = j; 608 }, join: function(j) { 609 switch (j) { 610 case x.miter: 611 this.Ia = "miter"; 612 break; 613 case x.round: 614 this.Ia = "round"; 615 break; 616 case x.bevel: 617 this.Ia = "bevel"; 618 } 619 }, cap: function(j) { 620 switch (j) { 621 case y.butt: 622 this.Ha = "butt"; 623 break; 624 case y.round: 625 this.Ha = "round"; 626 break; 627 case y.square: 628 this.Ha = "square"; 629 } 630 }, style: function(j) { 631 this.Hb = j; 632 }, blendMode: function(j) { 633 this.Eb = e(j); 634 }, clearGradient: function() { 635 this.ja = null; 636 }, linearGradient: function(j, X, Ee, Te) { 637 this.ja = { zb: j, Ab: X, cb: Ee, eb: Te, Ra: [] }; 638 }, radialGradient: function(j, X, Ee, Te) { 639 this.ja = { zb: j, Ab: X, cb: Ee, eb: Te, Ra: [], ec: !0 }; 640 }, addStop: function(j, X) { 641 this.ja.Ra.push({ color: j, stop: X }); 642 }, completeGradient: function() { 643 }, draw: function(j, X, Ee) { 644 let Te = this.Hb; 645 var Ce = this.Ya, Re = this.ja; 646 if (j.globalCompositeOperation = this.Eb, Re != null) { 647 Ce = Re.zb; 648 var Oe = Re.Ab; 649 const ht = Re.cb; 650 var Se = Re.eb; 651 const Ke = Re.Ra; 652 Re.ec ? (Re = ht - Ce, Se -= Oe, Ce = j.createRadialGradient(Ce, Oe, 0, Ce, Oe, Math.sqrt(Re * Re + Se * Se))) : Ce = j.createLinearGradient(Ce, Oe, ht, Se); 653 for (let ot = 0, Ze = Ke.length; ot < Ze; ot++) 654 Oe = Ke[ot], Ce.addColorStop(Oe.stop, t(Oe.color)); 655 this.Ya = Ce, this.ja = null; 656 } 657 switch (Te) { 658 case U: 659 j.strokeStyle = Ce, j.lineWidth = this.Ib, j.lineCap = this.Ha, j.lineJoin = this.Ia, j.stroke(X); 660 break; 661 case D: 662 j.fillStyle = Ce, j.fill(X, Ee); 663 } 664 } }); 665 const Ae = /* @__PURE__ */ new Set(); 666 let G = null, De = [], Je = 0, gt = 0; 667 var Nt = a.CanvasRenderer = p.extend("Renderer", { __construct: function(j) { 668 this.__parent.__construct.call(this), this.S = [1, 0, 0, 1, 0, 0], this.C = j.getContext("2d"), this.Va = j, this.H = []; 669 }, save: function() { 670 this.S.push(...this.S.slice(this.S.length - 6)), this.H.push(this.C.save.bind(this.C)); 671 }, restore: function() { 672 const j = this.S.length - 6; 673 if (6 > j) 674 throw "restore() called without matching save()."; 675 this.S.splice(j), this.H.push(this.C.restore.bind(this.C)); 676 }, transform: function(j, X, Ee, Te, Ce, Re) { 677 const Oe = this.S, Se = Oe.length - 6; 678 Oe.splice(Se, 6, Oe[Se] * j + Oe[Se + 2] * X, Oe[Se + 1] * j + Oe[Se + 3] * X, Oe[Se] * Ee + Oe[Se + 2] * Te, Oe[Se + 1] * Ee + Oe[Se + 3] * Te, Oe[Se] * Ce + Oe[Se + 2] * Re + Oe[Se + 4], Oe[Se + 1] * Ce + Oe[Se + 3] * Re + Oe[Se + 5]), this.H.push(this.C.transform.bind(this.C, j, X, Ee, Te, Ce, Re)); 679 }, rotate: function(j) { 680 const X = Math.sin(j); 681 j = Math.cos(j), this.transform(j, X, -X, j, 0, 0); 682 }, _drawPath: function(j, X) { 683 this.H.push(X.draw.bind(X, this.C, j.T, j.Wa === ee ? "evenodd" : "nonzero")); 684 }, _drawRiveImage: function(j, X, Ee, Te) { 685 var Ce = j.Fb; 686 if (Ce) { 687 var Re = this.C, Oe = e(Ee); 688 this.H.push(function() { 689 Re.globalCompositeOperation = Oe, Re.globalAlpha = Te, Re.drawImage(Ce, 0, 0), Re.globalAlpha = 1; 690 }); 691 } 692 }, _getMatrix: function(j) { 693 const X = this.S, Ee = X.length - 6; 694 for (let Te = 0; 6 > Te; ++Te) 695 j[Te] = X[Ee + Te]; 696 }, _drawImageMesh: function(j, X, Ee, Te, Ce, Re, Oe, Se, ht, Ke, ot) { 697 X = this.C.canvas.width; 698 var Ze = this.C.canvas.height; 699 const Pi = Ke - Se, Ri = ot - ht; 700 Se = Math.max(Se, 0), ht = Math.max(ht, 0), Ke = Math.min(Ke, X), ot = Math.min(ot, Ze); 701 const mn = Ke - Se, vn = ot - ht; 702 if (console.assert(mn <= Math.min(Pi, X)), console.assert(vn <= Math.min(Ri, Ze)), !(0 >= mn || 0 >= vn)) { 703 Ke = mn < Pi || vn < Ri, X = ot = 1;
704 var Ut = Math.ceil(mn * ot), zt = Math.ceil(vn * X); 705 Ze = de.hc(), Ut > Ze && (ot *= Ze / Ut, Ut = Ze), zt > Ze && (X *= Ze / zt, zt = Ze), G || (G = new a.DynamicRectanizer(Ze), G.reset(512, 512)), Ze = G.addRect(Ut, zt), 0 > Ze && (r(), Ae.add(this), Ze = G.addRect(Ut, zt), console.assert(0 <= Ze)); 706 var Ii = Ze & 65535, Mi = Ze >> 16; 707 De.push({ ha: this.S.slice(this.S.length - 6), image: j, Za: Ii, $a: Mi, ic: Se, jc: ht, Ac: Ut, kb: zt, Ba: ot, Ca: X, Ua: new Float32Array(Ce), Db: new Float32Array(Re), indices: new Uint16Array(Oe), mc: Ke, xb: j.Ka << 1 | (Ke ? 1 : 0) }), Je += Ce.length, gt += Oe.length; 708 var tn = this.C, Zo = e(Ee); 709 this.H.push(function() { 710 tn.save(), tn.resetTransform(), tn.globalCompositeOperation = Zo, tn.globalAlpha = Te; 711 const Ti = de.canvas(); 712 Ti && tn.drawImage(Ti, Ii, Mi, Ut, zt, Se, ht, mn, vn), tn.restore(); 713 }); 714 } 715 }, _clipPath: function(j) { 716 this.H.push(this.C.clip.bind(this.C, j.T, j.Wa === ee ? "evenodd" : "nonzero")); 717 }, clear: function() { 718 Ae.add(this), this.H.push(this.C.clearRect.bind(this.C, 0, 0, this.Va.width, this.Va.height)); 719 }, flush: function() { 720 }, translate: function(j, X) { 721 this.transform(1, 0, 0, 1, j, X); 722 } }); 723 a.makeRenderer = function(j) { 724 const X = new Nt(j), Ee = X.C; 725 return new Proxy(X, { get(Te, Ce) { 726 if (typeof Te[Ce] == "function") 727 return function(...Re) { 728 return Te[Ce].apply(Te, Re); 729 }; 730 if (typeof Ee[Ce] == "function") { 731 if (-1 < fe.indexOf(Ce)) 732 throw Error("RiveException: Method call to '" + Ce + "()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods."); 733 return function(...Re) { 734 X.H.push(Ee[Ce].bind(Ee, ...Re)); 735 }; 736 } 737 return Te[Ce]; 738 }, set(Te, Ce, Re) { 739 if (Ce in Ee) 740 return X.H.push(() => { 741 Ee[Ce] = Re; 742 }), !0; 743 } }); 744 }, a.decodeImage = function(j, X) { 745 new W({ la: X }).decode(j); 746 }, a.renderFactory = { makeRenderPaint: function() { 747 return new _e(); 748 }, makeRenderPath: function() { 749 return new S(); 750 }, makeRenderImage: function() { 751 let j = yt; 752 return new W({ xa: () => { 753 j.total++; 754 }, la: () => { 755 if (j.loaded++, j.loaded === j.total) { 756 const X = j.ready; 757 X && (X(), j.ready = null); 758 } 759 } }); 760 } }; 761 let Me = a.load, yt = null; 762 a.load = function(j, X, Ee = !0) { 763 const Te = new a.FallbackFileAssetLoader(); 764 return X !== void 0 && Te.addLoader(X), Ee && (X = new a.CDNFileAssetLoader(), Te.addLoader(X)), new Promise(function(Ce) { 765 let Re = null; 766 yt = { total: 0, loaded: 0, ready: function() { 767 Ce(Re); 768 } }, Re = Me(j, Te), yt.total == 0 && Ce(Re); 769 }); 770 }; 771 let Ko = a.RendererWrapper.prototype.align; 772 a.RendererWrapper.prototype.align = function(j, X, Ee, Te, Ce = 1) { 773 Ko.call(this, j, X, Ee, Te, Ce); 774 }, o = new ue(), a.requestAnimationFrame = o.requestAnimationFrame.bind(o), a.cancelAnimationFrame = o.
774cancelAnimationFrame.bind(o), a.enableFPSCounter = o.Rb.bind(o), a.disableFPSCounter = o.Ob, o.pb = r, a.resolveAnimationFrame = r, a.cleanup = function() { 775 G && G.delete(); 776 }; 777 }; 778 var Ie = Object.assign({}, a), be = "./this.program", je = typeof window == "object", z = typeof importScripts == "function", $ = "", h, R; 779 (je || z) && (z ? $ = self.location.href : typeof document < "u" && document.currentScript && ($ = document.currentScript.src), ie && ($ = ie), $.indexOf("blob:") !== 0 ? $ = $.substr(0, $.replace(/[?#].*/, "").lastIndexOf("/") + 1) : $ = "", z && (R = (e) => { 780 var t = new XMLHttpRequest(); 781 return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response); 782 }), h = (e, t, r) => { 783 var o = new XMLHttpRequest(); 784 o.open("GET", e, !0), o.responseType = "arraybuffer", o.onload = () => { 785 o.status == 200 || o.status == 0 && o.response ? t(o.response) : r(); 786 }, o.onerror = r, o.send(null); 787 }); 788 var I = a.print || console.log.bind(console), b = a.printErr || console.error.bind(console); 789 Object.assign(a, Ie), Ie = null, a.thisProgram && (be = a.thisProgram); 790 var w; 791 a.wasmBinary && (w = a.wasmBinary), a.noExitRuntime, typeof WebAssembly != "object" && We("no native wasm support detected"); 792 var B, L, ne = !1, T, Y, H, ge, se, he, Le, me; 793 function $e() { 794 var e = B.buffer; 795 a.HEAP8 = T = new Int8Array(e), a.HEAP16 = H = new Int16Array(e), a.HEAP32 = se = new Int32Array(e), a.HEAPU8 = Y = new Uint8Array(e), a.HEAPU16 = ge = new Uint16Array(e), a.HEAPU32 = he = new Uint32Array(e), a.HEAPF32 = Le = new Float32Array(e), a.HEAPF64 = me = new Float64Array(e); 796 } 797 var Ve, Ge = [], Ne = [], Ue = []; 798 function le() { 799 var e = a.preRun.shift(); 800 Ge.unshift(e); 801 } 802 var Pe = 0, ze = null; 803 function We(e) { 804 throw a.onAbort && a.onAbort(e), e = "Aborted(" + e + ")", b(e), ne = !0, e = new WebAssembly.RuntimeError(e + ". Build with -sASSERTIONS for more info."), _(e), e; 805 } 806 function wt(e) { 807 return e.startsWith("data:application/octet-stream;base64,"); 808 } 809 var st; 810 if (st = "canvas_advanced.wasm", !wt(st)) { 811 var Kt = st; 812 st = a.locateFile ? a.locateFile(Kt, $) : $ + Kt; 813 } 814 function Ye(e) { 815 if (e == st && w) 816 return new Uint8Array(w); 817 if (R) 818 return R(e); 819 throw "both async and sync fetching of the wasm failed"; 820 } 821 function Zt(e) { 822 if (!w && (je || z)) { 823 if (typeof fetch == "function" && !e.startsWith("file://")) 824 return fetch(e, { credentials: "same-origin" }).then((t) => { 825 if (!t.ok) 826 throw "failed to load wasm binary file at '" + e + "'"; 827 return t.arrayBuffer(); 828 }).catch(() => Ye(e)); 829 if (h) 830 return new Promise((t, r) => { 831 h(e, (o) => t(new Uint8Array(o)), r); 832 }); 833 } 834 return Promise.resolve().then(() => Ye(e)); 835 } 836 function Jt(e, t, r) { 837 return Zt(e).then((o) => WebAssembly.instantiate(o, t)).then((o) => o).then(r, (o) => { 838 b("failed to asynchronously prepare wasm: " + o), We(o); 839 }); 840 } 841 function on(e, t) { 842 var r = st; 843 return w || typeof WebAssembly.instantiateStreaming != "function" || wt(r) || r.startsWith("file://") || typeof fetch != "function" ? Jt(r, e, t) : fetch(r, { credentials: "same-origin" }).then((o) => WebAssembly.instantiateStreaming(o, e).then(t, function(l) { 844 return b("wasm streaming compile failed: " + l), b("falling back to ArrayBuffer instantiation"), Jt(r, e, t); 845 })); 846 } 847 var ut, s, n = { 461592: (e, t, r, o, l) => { 848 if (typeof window > "u" || (window.AudioContext || window.webkitAudioContext) === void 0) 849 return 0; 850 if (typeof window.h > "u") { 851 window.h = { Aa: 0 }, window.h.I = {}, window.h.I.ya = e, window.h.I.capture = t, window.h.I.La = r, window.h.ga = {}, window.h.ga.stopped = o, window.h.ga.yb = l; 852 let f = window.h; 853 f.D = [], f.yc = function(p) { 854 for (var y = 0; y < f.D.length; ++y) 855 if (f.D[y] == null) 856 return f.D[y] = p, y; 857 return f.D.push(p), f.D.length - 1; 858 }, f.Cb = function(p) { 859 for (f.D[p] = null; 0 < f.D.length && f.D[f.D.length - 1] == null; ) 860 f.D.pop(); 861 }, f.Sc = function(p) { 862 for (var y = 0; y < f.D.length; ++y) 863 if (f.D[y] == p) 864 return f.Cb(y); 865 }, f.ra = function(p) { 866 return f.D[p]; 867 }, f.Ta = ["touchend", "click"], f.unlock = function() { 868 for (var p = 0; p < f.D.length; ++p) { 869 var y = f.D[p]; 870 y != null && y.J != null && y.state === f.ga.yb && y.J.resume().then(() => { 871 _i(y.qb); 872 }, (x) => { 873 console.error("Failed to resume audiocontext", x); 874 }); 875 } 876 f.Ta.map(function(x) { 877 document.removeEventListener(x, f.unlock, !0); 878 }); 879 }, f.Ta.map(function(p) { 880 document.addEventListener(p, f.unlock, !0); 881 }); 882 } 883 return window.h.Aa += 1, 1; 884 }, 463770: () => { 885 typeof window.h < "u" && (window.h.Ta.map(function(e) { 886 document.removeEventListener(e, window.h.unlock, !0); 887 }), --window.h.Aa, window.h.Aa === 0 && delete window.h); 888 }, 464074: () => navigator.mediaDevices !== void 0 && navigator.mediaDevices.getUserMedia !== void 0, 464178: () => { 889 try { 890 var e = new (window.AudioContext || window.webkitAudioContext)(), t = e.sampleRate; 891 return e.close(), t; 892 } catch { 893 return 0; 894 } 895 }, 464349: (e, t, r, o, l, f) => { 896 if (typeof window.h > "u") 897 return -1; 898 var p = {}, y = {}; 899 return e == window.h.I.ya && r != 0 && (y.sampleRate = r), p.J = new (window.AudioContext || window.webkitAudioContext)(y), p.J.suspend(), p.state = window.h.ga.stopped, r = 0, e != window.h.I.ya && (r = t), p.Z = p.J.createScriptProcessor(o, r, t), p.Z.onaudioprocess = function(x) { 900 if ((p.sa == null || p.sa.length == 0) && (p.sa = new Float32Array(Le.buffer, l, o * t)), e == window.h.I.capture || e == window.h.I.La) { 901 for (var g = 0; g < t; g += 1) 902 for (var D = x.inputBuffer.getChannelData(g), U = p.sa, ee = 0; ee < o; ee += 1) 903 U[ee * t + g] = D[ee]; 904 Ci(f, o, l); 905 } 906 if (e == window.h.I.ya || e == window.h.I.La) 907 for (Ai(f, o, l), g = 0; g < x.outputBuffer.numberOfChannels; ++g) 908 for (D = x.outputBuffer.getChannelData(g), U = p.sa, ee = 0; ee < o; ee += 1) 909 D[ee] = U[ee * t + g]; 910 else 911 for (g = 0; g < x.outputBuffer.numberOfChannels; ++g) 912 x.outputBuffer.getChannelData(g).fill(0); 913 }, e != window.h.I.capture && e != window.h.I.La || navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 }).then(function(x) { 914 p.Da = p.J.createMediaStreamSource(x), p.Da.connect(p.Z), p.Z.connect(p.J.destination); 915 }).catch(function(x) { 916 console.log("Failed to get user media: " + x); 917 }), e == window.h.I.ya && p.Z.connect(p.J.destination), p.qb = f, window.h.yc(p); 918 }, 467226: (e) => window.h.ra(e).J.sampleRate, 467299: (e) => { 919 e = window.h.ra(e), e.Z !== void 0 && (e.Z.onaudioprocess = function() { 920 }, e.Z.disconnect(), e.Z = void 0), e.Da !== void 0 && (e.Da.disconnect(), e.Da = void 0), e.J.close(), e.J = void 0, e.qb = void 0; 921 }, 467699: (e) => { 922 window.h.Cb(e); 923 }, 467749: (e) => { 924 e = window.h.ra(e), e.J.resume(), e.state = window.h.ga.yb; 925 }, 467888: (e) => { 926 e = window.h.ra(e), e.J.suspend(), e.state = window.h.ga.stopped; 927 } }, i = (e) => { 928 for (; 0 < e.length; ) 929 e.shift()(a); 930 }, c = (e, t) => { 931 for (var r = 0, o = e.length - 1; 0 <= o; o--) { 932 var l = e[o]; 933 l === "." ? e.splice(o, 1) : l === ".." ? (e.splice(o, 1), r++) : r && (e.splice(o, 1), r--); 934 } 935 if (t) 936 for (; r; r--) 937 e.unshift(".."); 938 return e; 939 }, m = (e) => { 940 var t = e.charAt(0) === "/", r = e.substr(-1) === "/"; 941 return (e = c(e.split("/").filter((o) => !!o), !t).join("/")) || t || (e = "."), e && r && (e += "/"), (t ? "/" : "") + e; 942 }, A = (e) => { 943 var t = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1); 944 return e = t[0], t = t[1], !e && !t ? "." : (t && (t = t.substr(0, t.length - 1)), e + t); 945 }, O = (e) => { 946 if (e === "/") 947 return "/"; 948 e = m(e), e = e.replace(/\/$/, ""); 949 var t = e.lastIndexOf("/"); 950 return t === -1 ? e : e.substr(t + 1); 951 }, ce = () => { 952 if (typeof crypto == "object" && typeof crypto.getRandomValues == "function") 953 return (e) => crypto.getRandomValues(e); 954 We("initRandomDevice"); 955 }, ve = (e) => (ve = ce())(e); 956 function re() { 957 for (var e = "", t = !1, r = arguments.length - 1; -1 <= r && !t; r--) { 958 if (t = 0 <= r ? arguments[r] : "/", typeof t != "string") 959 throw new TypeError("Arguments to path.resolve must be strings"); 960 if (!t) 961 return "";
962 e = t + "/" + e, t = t.charAt(0) === "/"; 963 } 964 return e = c(e.split("/").filter((o) => !!o), !t).join("/"), (t ? "/" : "") + e || "."; 965 } 966 var xe = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0, Fe = (e, t, r) => { 967 var o = t + r; 968 for (r = t; e[r] && !(r >= o); ) 969 ++r; 970 if (16 < r - t && e.buffer && xe) 971 return xe.decode(e.subarray(t, r)); 972 for (o = ""; t < r; ) { 973 var l = e[t++]; 974 if (l & 128) { 975 var f = e[t++] & 63; 976 if ((l & 224) == 192) 977 o += String.fromCharCode((l & 31) << 6 | f); 978 else { 979 var p = e[t++] & 63; 980 l = (l & 240) == 224 ? (l & 15) << 12 | f << 6 | p : (l & 7) << 18 | f << 12 | p << 6 | e[t++] & 63, 65536 > l ? o += String.fromCharCode(l) : (l -= 65536, o += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023)); 981 } 982 } else 983 o += String.fromCharCode(l); 984 } 985 return o; 986 }, Xe = [], Be = (e) => { 987 for (var t = 0, r = 0; r < e.length; ++r) { 988 var o = e.charCodeAt(r); 989 127 >= o ? t++ : 2047 >= o ? t += 2 : 55296 <= o && 57343 >= o ? (t += 4, ++r) : t += 3; 990 } 991 return t; 992 }, lt = (e, t, r, o) => { 993 if (!(0 < o)) 994 return 0; 995 var l = r; 996 o = r + o - 1; 997 for (var f = 0; f < e.length; ++f) { 998 var p = e.charCodeAt(f); 999 if (55296 <= p && 57343 >= p) { 1000 var y = e.charCodeAt(++f); 1001 p = 65536 + ((p & 1023) << 10) | y & 1023; 1002 } 1003 if (127 >= p) { 1004 if (r >= o) 1005 break; 1006 t[r++] = p; 1007 } else { 1008 if (2047 >= p) { 1009 if (r + 1 >= o) 1010 break; 1011 t[r++] = 192 | p >> 6; 1012 } else { 1013 if (65535 >= p) { 1014 if (r + 2 >= o) 1015 break; 1016 t[r++] = 224 | p >> 12; 1017 } else { 1018 if (r + 3 >= o) 1019 break; 1020 t[r++] = 240 | p >> 18, t[r++] = 128 | p >> 12 & 63; 1021 } 1022 t[r++] = 128 | p >> 6 & 63; 1023 } 1024 t[r++] = 128 | p & 63; 1025 } 1026 } 1027 return t[r] = 0, r - l; 1028 }; 1029 function nt(e, t) { 1030 var r = Array(Be(e) + 1); 1031 return e = lt(e, r, 0, r.length), t && (r.length = e), r; 1032 } 1033 var Qe = []; 1034 function et(e, t) { 1035 Qe[e] = { input: [], F: [], V: t }, ir(e, rt); 1036 } 1037 var rt = { open: function(e) { 1038 var t = Qe[e.node.za]; 1039 if (!t) 1040 throw new te(43); 1041 e.s = t, e.seekable = !1; 1042 }, close: function(e) { 1043 e.s.V.qa(e.s); 1044 }, qa: function(e) { 1045 e.s.V.qa(e.s); 1046 }, read: function(e, t, r, o) { 1047 if (!e.s || !e.s.V.jb) 1048 throw new te(60); 1049 for (var l = 0, f = 0; f < o; f++) { 1050 try { 1051 var p = e.s.V.jb(e.s); 1052 } catch { 1053 throw new te(29); 1054 } 1055 if (p === void 0 && l === 0) 1056 throw new te(6); 1057 if (p == null) 1058 break; 1059 l++, t[r + f] = p; 1060 } 1061 return l && (e.node.timestamp = Date.now()), l; 1062 }, write: function(e, t, r, o) { 1063 if (!e.s || !e.s.V.Oa) 1064 throw new te(60); 1065 try { 1066 for (var l = 0; l < o; l++) 1067 e.s.V.Oa(e.s, t[r + l]); 1068 } catch { 1069 throw new te(29); 1070 } 1071 return o && (e.node.timestamp = Date.now()), l; 1072 } }, kt = { jb: function() { 1073 e: { 1074 if (!Xe.length) { 1075 var e = null; 1076 if (typeof window < "u" && typeof window.prompt == "function" ? (e = window.prompt("Input: "), e !== null && (e += ` 1077`)) : typeof readline == "function" && (e = readline(), e !== null && (e += ` 1078`)), !e) { 1079 e = null; 1080 break e; 1081 } 1082 Xe = nt(e, !0); 1083 } 1084 e = Xe.shift(); 1085 } 1086 return e; 1087 }, Oa: function(e, t) { 1088 t === null || t === 10 ? (I(Fe(e.F, 0)), e.F = []) : t != 0 && e.F.push(t); 1089 }, qa: function(e) { 1090 e.F && 0 < e.F.length && (I(Fe(e.F, 0)), e.F = []); 1091 }, bc: function() { 1092 return { Fc: 25856, Hc: 5, Ec: 191, Gc: 35387, Dc: [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }; 1093 }, cc: function() { 1094 return 0; 1095 }, dc: function() { 1096 return [24, 80]; 1097 } }, Lt = { Oa: function(e, t) { 1098 t === null || t === 10 ? (b(Fe(e.F, 0)), e.F = []) : t != 0 && e.F.push(t); 1099 }, qa: function(e) { 1100 e.F && 0 < e.F.length && (b(Fe(e.F, 0)), e.F = []); 1101 } }; 1102 function pt(e, t) { 1103 var r = e.j ? e.j.length : 0; 1104 r >= t || (t = Math.max(t, r * (1048576 > r ? 2 : 1.125) >>> 0), r != 0 && (t = Math.max(t, 256)), r = e.j, e.j = new Uint8Array(t), 0 < e.v && e.j.set(r.subarray(0, e.v), 0)); 1105 } 1106 var pe = { O: null, U() { 1107 return pe.createNode(null, "/", 16895, 0); 1108 }, createNode(e, t, r, o) { 1109 if ((r & 61440) === 24576 || (r & 61440) === 4096) 1110 throw new te(63); 1111 return pe.O || (pe.O = { dir: { node: { Y: pe.l.Y, P: pe.l.P, ka: pe.l.ka, va: pe.l.va, vb: pe.l.vb, Bb: pe.l.Bb, wb: pe.l.wb, tb: pe.l.tb, Ea: pe.l.Ea }, stream: { ba: pe.m.ba } }, file: { node: { Y: pe.l.Y, P: pe.l.P }, stream: { ba: pe.m.ba, read: pe.m.read, write: pe.m.write, pa: pe.m.pa, mb: pe.m.mb, ob: pe.m.ob } }, link: { node: { Y: pe.l.Y, P: pe.l.P, ma: pe.l.ma }, stream: {} }, ab: { node: { Y: pe.l.Y, P: pe.l.P }, stream: Ro } }), r = zr(e, t, r, o), (r.mode & 61440) === 16384 ? (r.l = pe.O.dir.node, r.m = pe.O.dir.stream, r.j = {}
1111) : (r.mode & 61440) === 32768 ? (r.l = pe.O.file.node, r.m = pe.O.file.stream, r.v = 0, r.j = null) : (r.mode & 61440) === 40960 ? (r.l = pe.O.link.node, r.m = pe.O.link.stream) : (r.mode & 61440) === 8192 && (r.l = pe.O.ab.node, r.m = pe.O.ab.stream), r.timestamp = Date.now(), e && (e.j[t] = r, e.timestamp = r.timestamp), r; 1112 }, Kc(e) { 1113 return e.j ? e.j.subarray ? e.j.subarray(0, e.v) : new Uint8Array(e.j) : new Uint8Array(0); 1114 }, l: { Y(e) { 1115 var t = {}; 1116 return t.Jc = (e.mode & 61440) === 8192 ? e.id : 1, t.Mc = e.id, t.mode = e.mode, t.Oc = 1, t.uid = 0, t.Lc = 0, t.za = e.za, (e.mode & 61440) === 16384 ? t.size = 4096 : (e.mode & 61440) === 32768 ? t.size = e.v : (e.mode & 61440) === 40960 ? t.size = e.link.length : t.size = 0, t.Bc = new Date(e.timestamp), t.Nc = new Date(e.timestamp), t.Ic = new Date(e.timestamp), t.Jb = 4096, t.Cc = Math.ceil(t.size / t.Jb), t; 1117 }, P(e, t) { 1118 if (t.mode !== void 0 && (e.mode = t.mode), t.timestamp !== void 0 && (e.timestamp = t.timestamp), t.size !== void 0 && (t = t.size, e.v != t)) 1119 if (t == 0) 1120 e.j = null, e.v = 0; 1121 else { 1122 var r = e.j; 1123 e.j = new Uint8Array(t), r && e.j.set(r.subarray(0, Math.min(t, e.v))), e.v = t; 1124 } 1125 }, ka() { 1126 throw rr[44]; 1127 }, va(e, t, r, o) { 1128 return pe.createNode(e, t, r, o); 1129 }, vb(e, t, r) { 1130 if ((e.mode & 61440) === 16384) { 1131 try { 1132 var o = En(t, r); 1133 } catch { 1134 } 1135 if (o) 1136 for (var l in o.j) 1137 throw new te(55); 1138 } 1139 delete e.parent.j[e.name], e.parent.timestamp = Date.now(), e.name = r, t.j[r] = e, t.timestamp = e.parent.timestamp, e.parent = t; 1140 }, Bb(e, t) { 1141 delete e.j[t], e.timestamp = Date.now(); 1142 }, wb(e, t) { 1143 var r = En(e, t), o; 1144 for (o in r.j) 1145 throw new te(55); 1146 delete e.j[t], e.timestamp = Date.now(); 1147 }, tb(e) { 1148 var t = [".", ".."], r; 1149 for (r in e.j) 1150 e.j.hasOwnProperty(r) && t.push(r); 1151 return t; 1152 }, Ea(e, t, r) { 1153 return e = pe.createNode(e, t, 41471, 0), e.link = r, e; 1154 }, ma(e) { 1155 if ((e.mode & 61440) !== 40960) 1156 throw new te(28); 1157 return e.link; 1158 } }, m: { read(e, t, r, o, l) { 1159 var f = e.node.j; 1160 if (l >= e.node.v) 1161 return 0; 1162 if (e = Math.min(e.node.v - l, o), 8 < e && f.subarray) 1163 t.set(f.subarray(l, l + e), r); 1164 else 1165 for (o = 0; o < e; o++) 1166 t[r + o] = f[l + o]; 1167 return e; 1168 }, write(e, t, r, o, l, f) { 1169 if (t.buffer === T.buffer && (f = !1), !o) 1170 return 0; 1171 if (e = e.node, e.timestamp = Date.now(), t.subarray && (!e.j || e.j.subarray)) { 1172 if (f) 1173 return e.j = t.subarray(r, r + o), e.v = o; 1174 if (e.v === 0 && l === 0) 1175 return e.j = t.slice(r, r + o), e.v = o; 1176 if (l + o <= e.v) 1177 return e.j.set(t.subarray(r, r + o), l), o; 1178 } 1179 if (pt(e, l + o), e.j.subarray && t.subarray) 1180 e.j.set(t.subarray(r, r + o), l); 1181 else 1182 for (f = 0; f < o; f++) 1183 e.j[l + f] = t[r + f]; 1184 return e.v = Math.max(e.v, l + o), o; 1185 }, ba(e, t, r) { 1186 if (r === 1 ? t += e.position : r === 2 && (e.node.mode & 61440) === 32768 && (t += e.node.v), 0 > t) 1187 throw new te(28); 1188 return t; 1189 }, pa(e, t, r) {
1190 pt(e.node, t + r), e.node.v = Math.max(e.node.v, t + r); 1191 }, mb(e, t, r, o, l) { 1192 if ((e.node.mode & 61440) !== 32768) 1193 throw new te(43); 1194 if (e = e.node.j, l & 2 || e.buffer !== T.buffer) { 1195 if ((0 < r || r + t < e.length) && (e.subarray ? e = e.subarray(r, r + t) : e = Array.prototype.slice.call(e, r, r + t)), r = !0, We(), t = void 0, !t) 1196 throw new te(48); 1197 T.set(e, t); 1198 } else 1199 r = !1, t = e.byteOffset; 1200 return { o: t, M: r }; 1201 }, ob(e, t, r, o) { 1202 return pe.m.write(e, t, 0, o, r, !1), 0; 1203 } } }; 1204 function ke(e, t) { 1205 var r = 0; 1206 return e && (r |= 365), t && (r |= 146), r; 1207 } 1208 var mt = null, $r = {}, xn = [], Eo = 1, an = null, Br = !0, te = null, rr = {}, Dt = (e, t = {}) => { 1209 if (e = re(e), !e) 1210 return { path: "", node: null }; 1211 if (t = Object.assign({ hb: !0, Qa: 0 }, t), 8 < t.Qa) 1212 throw new te(32); 1213 e = e.split("/").filter((p) => !!p); 1214 for (var r = mt, o = "/", l = 0; l < e.length; l++) { 1215 var f = l === e.length - 1; 1216 if (f && t.parent) 1217 break; 1218 if (r = En(r, e[l]), o = m(o + "/" + e[l]), r.wa && (!f || f && t.hb) && (r = r.wa.root), !f || t.gb) { 1219 for (f = 0; (r.mode & 61440) === 40960; ) 1220 if (r = Io(o), o = re(A(o), r), r = Dt(o, { Qa: t.Qa + 1 }).node, 40 < f++) 1221 throw new te(32); 1222 } 1223 } 1224 return { path: o, node: r }; 1225 }, Nr = (e) => { 1226 for (var t; ; ) { 1227 if (e === e.parent) 1228 return e = e.U.nb, t ? e[e.length - 1] !== "/" ? `${e}/${t}` : e + t : e; 1229 t = t ? `${e.name}/${t}` : e.name, e = e.parent; 1230 } 1231 }, Ur = (e, t) => { 1232 for (var r = 0, o = 0; o < t.length; o++) 1233 r = (r << 5) - r + t.charCodeAt(o) | 0; 1234 return (e + r >>> 0) % an.length; 1235 }, En = (e, t) => { 1236 var r; 1237 if (r = (r = Pn(e, "x")) ? r : e.l.ka ? 0 : 2) 1238 throw new te(r, e); 1239 for (r = an[Ur(e.id, t)]; r; r = r.lc) { 1240 var o = r.name; 1241 if (r.parent.id === e.id && o === t) 1242 return r; 1243 } 1244 return e.l.ka(e, t); 1245 }, zr = (e, t, r, o) => (e = new gi(e, t, r, o), t = Ur(e.parent.id, e.name), e.lc = an[t], an[t] = e), Hr = (e) => { 1246 var t = ["r", "w", "rw"][e & 3]; 1247 return e & 512 && (t += "w"), t; 1248 }, Pn = (e, t) => { 1249 if (Br) 1250 return 0; 1251 if (!t.includes("r") || e.mode & 292) { 1252 if (t.includes("w") && !(e.mode & 146) || t.includes("x") && !(e.mode & 73)) 1253 return 2; 1254 } else 1255 return 2; 1256 return 0; 1257 }, Yr = (e, t) => { 1258 try { 1259 return En(e, t), 20; 1260 } catch { 1261 } 1262 return Pn(e, "wx"); 1263 }, Po = () => { 1264 for (var e = 0; 4096 >= e; e++) 1265 if (!xn[e]) 1266 return e; 1267 throw new te(33); 1268 }, Ft = (e) => { 1269 if (e = xn[e], !e) 1270 throw new te(8); 1271 return e; 1272 }, Gr = (e, t = -1) => (un || (un = function() { 1273 this.h = {}; 1274 }, un.prototype = {}, Object.defineProperties(un.prototype, { object: { get() { 1275 return this.node; 1276 }, set(r) { 1277 this.node = r; 1278 } }, flags: { get() { 1279 return this.h.flags; 1280 }, set(r) { 1281 this.h.flags = r; 1282 } }, position: { get() { 1283 return this.h.position; 1284 }, set(r) { 1285 this.h.position = r; 1286 } } })), e = Object.assign(new un(), e), t == -1 && (t = Po()), e.X = t, xn[t] = e), Ro = { open: (e) => { 1287 e.m = $r[e.node.za].m, e.m.open && e.m.open(e); 1288 }, ba: () => { 1289 throw new te(70); 1290 } }, ir = (e, t) => { 1291 $r[e] = { m: t }; 1292 }, Xr = (e, t) => { 1293 var r = t === "/", o = !t; 1294 if (r && mt) 1295 throw new te(10); 1296 if (!r && !o) { 1297 var l = Dt(t, { hb: !1 }); 1298 if (t = l.path, l = l.node, l.wa) 1299 throw new te(10); 1300 if ((l.mode & 61440) !== 16384) 1301 throw new te(54); 1302 } 1303 t = { type: e, Qc: {}, nb: t, kc: [] }, e = e.U(t), e.U = t, t.root = e, r ? mt = e : l && (l.wa = t, l.U && l.U.kc.push(t)); 1304 }, ct = (e, t, r) => { 1305 var o = Dt(e, { parent: !0 }).node; 1306 if (e = O(e), !e || e === "." || e === "..") 1307 throw new te(28); 1308 var l = Yr(o, e); 1309 if (l) 1310 throw new te(l); 1311 if (!o.l.va) 1312 throw new te(63); 1313 return o.l.va(o, e, t, r); 1314 }, Rn = (e, t, r) => { 1315 typeof r > "u" && (r = t, t = 438), ct(e, t | 8192, r); 1316 }, or = (e, t) => { 1317 if (!re(e)) 1318 throw new te(44); 1319 var r = Dt(t, { parent: !0 }).node; 1320 if (!r) 1321 throw new te(44); 1322 t = O(t); 1323 var o = Yr(r, t); 1324 if (o) 1325 throw new te(o); 1326 if (!r.l.Ea) 1327 throw new te(63); 1328 r.l.Ea(r, t, e); 1329 }, Io = (e) => { 1330 if (e = Dt(e).node, !e) 1331 throw new te(44); 1332 if (!e.l.ma) 1333 throw new te(28); 1334 return re(Nr(e.parent), e.l.ma(e)); 1335 }, In = (e, t, r) => { 1336 if (e === "") 1337 throw new te(44); 1338 if (typeof t == "string") { 1339 var o = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }[t]; 1340 if (typeof o > "u") 1341 throw Error(`Unknown file open mode: ${t}`); 1342 t = o; 1343 } 1344 if (r = t & 64 ? (typeof r > "u" ? 438 : r) & 4095 | 32768 : 0, typeof e == "object") 1345 var l = e; 1346 else { 1347 e = m(e); 1348 try { 1349 l = Dt(e, { gb: !(t & 131072) }).node; 1350 } catch { 1351 } 1352 } 1353 if (o = !1, t & 64) 1354 if (l) { 1355 if (t & 128) 1356 throw new te(20); 1357 } else 1358 l = ct(e, r, 0), o = !0; 1359 if (!l) 1360 throw new te(44); 1361 if ((l.mode & 61440) === 8192 && (t &= -513), t & 65536 && (l.mode & 61440) !== 16384) 1362 throw new te(54); 1363 if (!o && (r = l ? (l.mode & 61440) === 40960 ? 32 : (l.mode & 61440) === 16384 && (Hr(t) !== "r" || t & 512) ? 31 : Pn(l, Hr
1363(t)) : 44)) 1364 throw new te(r); 1365 if (t & 512 && !o) { 1366 if (r = l, r = typeof r == "string" ? Dt(r, { gb: !0 }).node : r, !r.l.P) 1367 throw new te(63); 1368 if ((r.mode & 61440) === 16384) 1369 throw new te(31); 1370 if ((r.mode & 61440) !== 32768) 1371 throw new te(28); 1372 if (o = Pn(r, "w")) 1373 throw new te(o); 1374 r.l.P(r, { size: 0, timestamp: Date.now() }); 1375 } 1376 return t &= -131713, l = Gr({ node: l, path: Nr(l), flags: t, seekable: !0, position: 0, m: l.m, zc: [], error: !1 }), l.m.open && l.m.open(l), !a.logReadFiles || t & 1 || (Mn || (Mn = {}), e in Mn || (Mn[e] = 1)), l; 1377 }, Kr = (e, t, r) => { 1378 if (e.X === null) 1379 throw new te(8); 1380 if (!e.seekable || !e.m.ba) 1381 throw new te(70); 1382 if (r != 0 && r != 1 && r != 2) 1383 throw new te(28); 1384 e.position = e.m.ba(e, t, r), e.zc = []; 1385 }, Zr = () => { 1386 te || (te = function(e, t) { 1387 this.name = "ErrnoError", this.node = t, this.pc = function(r) { 1388 this.aa = r; 1389 }, this.pc(e), this.message = "FS error"; 1390 }, te.prototype = Error(), te.prototype.constructor = te, [44].forEach((e) => { 1391 rr[e] = new te(e), rr[e].stack = "<generic error, no stack>"; 1392 })); 1393 }, Jr, sn = (e, t, r) => { 1394 e = m("/dev/" + e); 1395 var o = ke(!!t, !!r); 1396 ar || (ar = 64); 1397 var l = ar++ << 8 | 0; 1398 ir(l, { open: (f) => { 1399 f.seekable = !1; 1400 }, close: () => { 1401 r && r.buffer && r.buffer.length && r(10); 1402 }, read: (f, p, y, x) => { 1403 for (var g = 0, D = 0; D < x; D++) { 1404 try { 1405 var U = t(); 1406 } catch { 1407 throw new te(29); 1408 } 1409 if (U === void 0 && g === 0) 1410 throw new te(6); 1411 if (U == null) 1412 break; 1413 g++, p[y + D] = U; 1414 } 1415 return g && (f.node.timestamp = Date.now()), g; 1416 }, write: (f, p, y, x) => { 1417 for (var g = 0; g < x; g++) 1418 try { 1419 r(p[y + g]); 1420 } catch { 1421 throw new te(29); 1422 } 1423 return x && (f.node.timestamp = Date.now()), g; 1424 } }), Rn(e, o, l); 1425 }, ar, $t = {}, un, Mn, ln = void 0; 1426 function _t() { 1427 return ln += 4, se[ln - 4 >> 2]; 1428 } 1429 function qr(e) { 1430 if (e === void 0) 1431 return "_unknown"; 1432 e = e.replace(/[^a-zA-Z0-9_]/g, "$"); 1433 var t = e.charCodeAt(0); 1434 return 48 <= t && 57 >= t ? `_${e}` : e; 1435 } 1436 function Tn(e, t) { 1437 return e = qr(e), { [e]: function() { 1438 return t.apply(this, arguments); 1439 } }[e]; 1440 } 1441 function Qr() { 1442 this.M = [void 0], this.ib = []; 1443 } 1444 var it = new Qr(), qt = void 0; 1445 function we(e) { 1446 throw new qt(e); 1447 } 1448 var ft = (e) => (e || we("Cannot use deleted val. handle = " + e), it.get(e).value), dt = (e) => { 1449 switch (e) { 1450 case void 0: 1451 return 1; 1452 case null: 1453 return 2; 1454 case !0: 1455 return 3; 1456 case !1: 1457 return 4; 1458 default: 1459 return it.pa({ ub: 1, value: e }); 1460 } 1461 }; 1462 function ei(e) { 1463 var t = Error, r = Tn(e, function(o) { 1464 this.name = e, this.message = o, o = Error(o).stack, o !== void 0 && (this.stack = this.toString() + ` 1465` + o.replace(/^Error(:[^\n]*)?\n/, "")); 1466 }); 1467 return r.prototype = Object.create(t.prototype), r.prototype.constructor = r, r.prototype.toString = function() { 1468 return this.message === void 0 ? this.name : `${this.name}: ${this.message}`; 1469 }, r; 1470 } 1471 var ti = void 0, ni = void 0; 1472 function He(e) { 1473 for (var t = ""; Y[e]; )
vendor: 4,930 bytes, lines 1474-1594
1474 t += ni[Y[e++]]; 1475 return t; 1476 } 1477 var cn = []; 1478 function sr() { 1479 for (; cn.length; ) { 1480 var e = cn.pop(); 1481 e.g.fa = !1, e.delete(); 1482 } 1483 } 1484 var fn = void 0, Ct = {}; 1485 function ur(e, t) { 1486 for (t === void 0 && we("ptr should not be undefined"); e.A; ) 1487 t = e.na(t), e = e.A; 1488 return t; 1489 } 1490 var Bt = {}; 1491 function ri(e) { 1492 e = xi(e); 1493 var t = He(e); 1494 return Et(e), t; 1495 } 1496 function dn(e, t) { 1497 var r = Bt[e]; 1498 return r === void 0 && we(t + " has unknown type " + ri(e)), r; 1499 } 1500 function kn() { 1501 } 1502 var lr = !1; 1503 function ii(e) { 1504 --e.count.value, e.count.value === 0 && (e.G ? e.L.W(e.G) : e.u.i.W(e.o)); 1505 } 1506 function oi(e, t, r) { 1507 return t === r ? e : r.A === void 0 ? null : (e = oi(e, t, r.A), e === null ? null : r.Pb(e)); 1508 } 1509 var ai = {}; 1510 function Mo(e, t) { 1511 return t = ur(e, t), Ct[t]; 1512 } 1513 var si = void 0; 1514 function Ln(e) { 1515 throw new si(e); 1516 } 1517 function Fn(e, t) { 1518 return t.u && t.o || Ln("makeClassHandle requires ptr and ptrType"), !!t.L != !!t.G && Ln("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, Qt(Object.create(e, { g: { value: t } })); 1519 } 1520 function Qt(e) { 1521 return typeof FinalizationRegistry > "u" ? (Qt = (t) => t, e) : (lr = new FinalizationRegistry((t) => { 1522 ii(t.g); 1523 }), Qt = (t) => { 1524 var r = t.g; 1525 return r.G && lr.register(t, { g: r }, t), t; 1526 }, kn = (t) => { 1527 lr.unregister(t); 1528 }, Qt(e)); 1529 } 1530 var On = {}; 1531 function hn(e) { 1532 for (; e.length; ) { 1533 var t = e.pop(); 1534 e.pop()(t); 1535 } 1536 } 1537 function pn(e) { 1538 return this.fromWireType(se[e >> 2]); 1539 } 1540 var en = {}, jn = {}; 1541 function tt(e, t, r) { 1542 function o(y) { 1543 y = r(y), y.length !== e.length && Ln("Mismatched type converter count"); 1544 for (var x = 0; x < e.length; ++x) 1545 vt(e[x], y[x]); 1546 } 1547 e.forEach(function(y) { 1548 jn[y] = t; 1549 }); 1550 var l = Array(t.length), f = [], p = 0; 1551 t.forEach((y, x) => { 1552 Bt.hasOwnProperty(y) ? l[x] = Bt[y] : (f.push(y), en.hasOwnProperty(y) || (en[y] = []), en[y].push(() => { 1553 l[x] = Bt[y], ++p, p === f.length && o(l); 1554 })); 1555 }), f.length === 0 && o(l); 1556 } 1557 function Sn(e) { 1558 switch (e) { 1559 case 1: 1560 return 0; 1561 case 2: 1562 return 1; 1563 case 4: 1564 return 2; 1565 case 8: 1566 return 3; 1567 default: 1568 throw new TypeError(`Unknown type size: ${e}`); 1569 } 1570 } 1571 function To(e, t, r = {}) { 1572 var o = t.name; 1573 if (e || we(`type "${o}" must have a positive integer typeid pointer`), Bt.hasOwnProperty(e)) { 1574 if (r.$b) 1575 return; 1576 we(`Cannot register type '${o}' twice`); 1577 } 1578 Bt[e] = t, delete jn[e], en.hasOwnProperty(e) && (t = en[e], delete en[e], t.forEach((l) => l())); 1579 } 1580 function vt(e, t, r = {}) { 1581 if (!("argPackAdvance" in t)) 1582 throw new TypeError("registerType registeredInstance requires argPackAdvance"); 1583 To(e, t, r); 1584 } 1585 function cr(e) { 1586 we(e.g.u.i.name + " instance already deleted"); 1587 } 1588 function Ot() { 1589 } 1590 function fr(e, t, r) { 1591 if (e[t].B === void 0) { 1592 var o = e[t]; 1593 e[t] = function() { 1594 return e[t].B.hasOwnProperty(arguments.length) || we(`Function '${r}
1594' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].B})!`), e[t].B[arguments.length].apply(this, arguments); 1595 }, e[t].B = [], e[t].B[o.ea] = o; 1596 } 1597 } 1598 function dr(e, t, r) { 1599 a.hasOwnProperty(e) ? ((r === void 0 || a[e].B !== void 0 && a[e].B[r] !== void 0) && we(`Cannot register public name '${e}' twice`), fr(a, e, e), a.hasOwnProperty(r) && we(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), a[e].B[r] = t) : (a[e] = t, r !== void 0 && (a[e].Pc = r)); 1600 } 1601 function ko(e, t, r, o, l, f, p, y) { 1602 this.name = e, this.constructor = t, this.N = r, this.W = o, this.A = l, this.Ub = f, this.na = p, this.Pb = y, this.rb = []; 1603 } 1604 function Vn(e, t, r) { 1605 for (; t !== r; ) 1606 t.na || we(`Expected null or instance of ${r.name}, got an instance of ${t.name}`), e = t.na(e), t = t.A; 1607 return e; 1608 } 1609 function Lo(e, t) { 1610 return t === null ? (this.Na && we(`null is not a valid ${this.name}`), 0) : (t.g || we(`Cannot pass "${pr(t)}" as a ${this.name}`), t.g.o || we(`Cannot pass deleted object as a pointer of type ${this.name}`), Vn(t.g.o, t.g.u.i, this.i)); 1611 } 1612 function Fo(e, t) { 1613 if (t === null) { 1614 if (this.Na && we(`null is not a valid ${this.name}`), this.ua) { 1615 var r = this.Pa(); 1616 return e !== null && e.push(this.W, r), r; 1617 } 1618 return 0; 1619 } 1620 if (t.g || we(`Cannot pass "${pr(t)}" as a ${this.name}`), t.g.o || we(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.ta && t.g.u.ta && we(`Cannot convert argument of type ${t.g.L ? t.g.L.name : t.g.u.name} to parameter type ${this.name}`), r = Vn(t.g.o, t.g.u.i, this.i), this.ua) 1621 switch (t.g.G === void 0 && we("Passing raw pointer to smart pointer is illegal"), this.tc) { 1622 case 0: 1623 t.g.L === this ? r = t.g.G : we(`Cannot convert argument of type ${t.g.L ? t.g.L.name : t.g.u.name} to parameter type ${this.name}`); 1624 break; 1625 case 1: 1626 r = t.g.G; 1627 break; 1628 case 2: 1629 if (t.g.L === this) 1630 r = t.g.G; 1631 else { 1632 var o = t.clone(); 1633 r = this.oc(r, dt(function() { 1634 o.delete(); 1635 })), e !== null && e.push(this.W, r); 1636 } 1637 break; 1638 default: 1639 we("Unsupporting sharing policy"); 1640 } 1641 return r; 1642 } 1643 function Oo(e, t) { 1644 return t === null ? (this.Na && we(`null is not a valid ${this.name}`), 0) : (t.g || we(`Cannot pass "${pr(t)}" as a ${this.name}`), t.g.o || we(`Cannot pass deleted object as a pointer of type ${this.name}`), t.g.u.ta && we(`Cannot convert argument of type ${t.g.u.name} to parameter type ${this.name}`), Vn(t.g.o, t.g.u.i, this.i)); 1645 } 1646 function At(e, t, r, o) { 1647 this.name = e, this.i = t, this.Na = r, this.ta = o, this.ua = !1, this.W = this.oc = this.Pa = this.sb = this.tc = this.nc = void 0, t.A !== void 0 ? this.toWireType = Fo : (this.toWireType = o ? Lo : Oo, this.K = null); 1648 } 1649 function ui(e, t, r) { 1650 a.hasOwnProperty(e) || Ln("Replacing nonexistant public symbol"), a[e].B !== void 0 && r !== void 0 ? a[e].B[r] = t : (a[e] = t, a[e].ea = r); 1651 } 1652 var Wn = [], li = (e) => { 1653 var t = Wn[e]; 1654 return t || (e >= Wn.length && (Wn.length = e + 1), Wn[e] = t = Ve.get(e)), t; 1655 }, jo = (e, t) => { 1656 var r = []; 1657 return function() { 1658 if (r.length = 0, Object.assign(r, arguments), e.includes("j")) { 1659 var o = a["dynCall_" + e]; 1660 o = r && r.length ? o.apply(null, [t].concat(r)) : o.call(null, t); 1661 } else 1662 o = li(t).apply(null, r); 1663 return o; 1664 }; 1665 }; 1666 function qe(e, t) { 1667 e = He(e); 1668 var r = e.includes("j") ? jo(e, t) : li(t); 1669 return typeof r != "function" && we(`unknown function pointer with signature ${e}: ${t}`), r; 1670 } 1671 var ci = void 0; 1672 function xt(e, t) { 1673 function r(f) { 1674 l[f] || Bt[f] || (jn[f] ? jn[f].forEach(r) : (o.push(f), l[f] = !0)); 1675 } 1676 var o = [], l = {}; 1677 throw t.forEach(r), new ci(`${e}: ` + o.map(ri).join([", "])); 1678 } 1679 function Dn(e, t, r, o, l) { 1680 var f = t.length; 1681 2 > f && we("argTypes array size mismatch! Must at least get return value and 'this' types!"); 1682 var p = t[1] !== null && r !== null, y = !1; 1683 for (r = 1; r < t.length; ++r) 1684 if (t[r] !== null && t[r].K === void 0) { 1685 y = !0; 1686 break; 1687 } 1688 var x = t[0].name !== "void", g = f - 2, D = Array(g), U = [], ee = []; 1689 return function() { 1690 if (arguments.length !== g && we(`function ${e} called with ${arguments.length} arguments, expected ${g} args!`), ee.length = 0, U.length = p ? 2 : 1, U[0] = l, p) { 1691 var v = t[1].toWireType(ee, this); 1692 U[1] = v; 1693 } 1694 for (var W = 0; W < g; ++W) 1695 D[W] = t[W + 2].toWireType(ee, arguments[W]), U.push(D[W]); 1696 if (W = o.apply(null, U), y) 1697 hn(ee); 1698 else 1699 for (var S = p ? 1 : 2; S < t.length; S++) { 1700 var _e = S === 1 ? v : D[S - 2]; 1701 t[S].K !== null && t[S].K(_e); 1702 } 1703 return v = x ? t[0].fromWireType(W) : void 0, v; 1704 }; 1705 } 1706 function $n(e, t) { 1707 for (var r = [], o = 0; o < e; o++) 1708 r.push(he[t + 4 * o >> 2]); 1709 return r; 1710 } 1711 function fi(e, t, r) { 1712 return e instanceof Object || we(`${r}
1712 with invalid "this": ${e}`), e instanceof t.i.constructor || we(`${r} incompatible with "this" of type ${e.constructor.name}`), e.g.o || we(`cannot call emscripten binding method ${r} on deleted object`), Vn(e.g.o, e.g.u.i, t.i); 1713 } 1714 function hr(e) { 1715 e >= it.h && --it.get(e).ub === 0 && it.Zb(e); 1716 } 1717 function So(e, t, r) { 1718 switch (t) { 1719 case 0: 1720 return function(o) { 1721 return this.fromWireType((r ? T : Y)[o]); 1722 }; 1723 case 1: 1724 return function(o) { 1725 return this.fromWireType((r ? H : ge)[o >> 1]); 1726 }; 1727 case 2: 1728 return function(o) { 1729 return this.fromWireType((r ? se : he)[o >> 2]); 1730 }; 1731 default: 1732 throw new TypeError("Unknown integer type: " + e); 1733 } 1734 } 1735 function pr(e) { 1736 if (e === null) 1737 return "null"; 1738 var t = typeof e; 1739 return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e; 1740 } 1741 function Vo(e, t) { 1742 switch (t) { 1743 case 2: 1744 return function(r) { 1745 return this.fromWireType(Le[r >> 2]); 1746 }; 1747 case 3: 1748 return function(r) { 1749 return this.fromWireType(me[r >> 3]); 1750 }; 1751 default: 1752 throw new TypeError("Unknown float type: " + e); 1753 } 1754 } 1755 function Wo(e, t, r) { 1756 switch (t) { 1757 case 0: 1758 return r ? function(o) { 1759 return T[o]; 1760 } : function(o) { 1761 return Y[o]; 1762 }; 1763 case 1: 1764 return r ? function(o) { 1765 return H[o >> 1]; 1766 } : function(o) { 1767 return ge[o >> 1]; 1768 }; 1769 case 2: 1770 return r ? function(o) { 1771 return se[o >> 2]; 1772 } : function(o) { 1773 return he[o >> 2]; 1774 }; 1775 default: 1776 throw new TypeError("Unknown integer type: " + e); 1777 } 1778 } 1779 var di = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Do = (e, t) => { 1780 for (var r = e >> 1, o = r + t / 2; !(r >= o) && ge[r]; ) 1781 ++r; 1782 if (r <<= 1, 32 < r - e && di) 1783 return di.decode(Y.subarray(e, r)); 1784 for (r = "", o = 0; !(o >= t / 2); ++o) { 1785 var l = H[e + 2 * o >> 1]; 1786 if (l == 0) 1787 break; 1788 r += String.fromCharCode(l); 1789 } 1790 return r; 1791 }, $o = (e, t, r) => { 1792 if (r === void 0 && (r = 2147483647), 2 > r) 1793 return 0; 1794 r -= 2; 1795 var o = t; 1796 r = r < 2 * e.length ? r / 2 : e.length; 1797 for (var l = 0; l < r; ++l) 1798 H[t >> 1] = e.charCodeAt(l), t += 2; 1799 return H[t >> 1] = 0, t - o; 1800 }, Bo = (e) => 2 * e.length, No = (e, t) => { 1801 for (var r = 0, o = ""; !(r >= t / 4); ) { 1802 var l = se[e + 4 * r >> 2]; 1803 if (l == 0) 1804 break; 1805 ++r, 65536 <= l ? (l -= 65536, o += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023)) : o += String.fromCharCode(l); 1806 } 1807 return o; 1808 }, Uo = (e, t, r) => { 1809 if (r === void 0 && (r = 2147483647), 4 > r) 1810 return 0; 1811 var o = t; 1812 r = o + r - 4; 1813 for (var l = 0; l < e.length; ++l) { 1814 var f = e.charCodeAt(l); 1815 if (55296 <= f && 57343 >= f) { 1816 var p = e.charCodeAt(++l); 1817 f = 65536 + ((f & 1023) << 10) | p & 1023; 1818 } 1819 if (se[t >> 2] = f, t += 4, t + 4 > r) 1820 break; 1821 } 1822 return se[t >> 2] = 0, t - o; 1823 }, zo = (e) => { 1824 for (var t = 0, r = 0; r < e.length; ++r) { 1825 var o = e.charCodeAt(r); 1826 55296 <= o && 57343 >= o && ++r, t += 4; 1827 } 1828 return t; 1829 }, Ho = {}; 1830 function Bn(e) { 1831 var t = Ho[e]; 1832 return t === void 0 ? He(e) : t; 1833 } 1834 var Nn = []; 1835 function Yo(e) { 1836 var t = Nn.length; 1837 return Nn.push(e), t; 1838 } 1839 function Go(e, t) { 1840 for (var r = Array(e), o = 0; o < e; ++o) 1841 r[o] = dn(he[t + 4 * o >> 2], "parameter " + o); 1842 return r; 1843 } 1844 var hi = [], mr = [], vr = {}
1844, pi = () => { 1845 if (!gr) { 1846 var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: be || "./this.program" }, t; 1847 for (t in vr) 1848 vr[t] === void 0 ? delete e[t] : e[t] = vr[t]; 1849 var r = []; 1850 for (t in e) 1851 r.push(`${t}=${e[t]}`); 1852 gr = r; 1853 } 1854 return gr; 1855 }, gr, Un = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), mi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], vi = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Xo = (e, t, r, o) => { 1856 function l(v, W, S) { 1857 for (v = typeof v == "number" ? v.toString() : v || ""; v.length < W; ) 1858 v = S[0] + v; 1859 return v; 1860 } 1861 function f(v, W) { 1862 return l(v, W, "0"); 1863 } 1864 function p(v, W) { 1865 function S(Ae) { 1866 return 0 > Ae ? -1 : 0 < Ae ? 1 : 0; 1867 } 1868 var _e; 1869 return (_e = S(v.getFullYear() - W.getFullYear())) === 0 && (_e = S(v.getMonth() - W.getMonth())) === 0 && (_e = S(v.getDate() - W.getDate())), _e; 1870 } 1871 function y(v) { 1872 switch (v.getDay()) { 1873 case 0: 1874 return new Date(v.getFullYear() - 1, 11, 29); 1875 case 1: 1876 return v; 1877 case 2: 1878 return new Date(v.getFullYear(), 0, 3); 1879 case 3: 1880 return new Date(v.getFullYear(), 0, 2); 1881 case 4: 1882 return new Date(v.getFullYear(), 0, 1); 1883 case 5: 1884 return new Date(v.getFullYear() - 1, 11, 31); 1885 case 6: 1886 return new Date(v.getFullYear() - 1, 11, 30); 1887 } 1888 } 1889 function x(v) { 1890 var W = v.ca; 1891 for (v = new Date(new Date(v.da + 1900, 0, 1).getTime()); 0 < W; ) { 1892 var S = v.getMonth(), _e = (Un(v.getFullYear()) ? mi : vi)[S]; 1893 if (W > _e - v.getDate()) 1894 W -= _e - v.getDate() + 1, v.setDate(1), 11 > S ? v.setMonth(S + 1) : (v.setMonth(0), v.setFullYear(v.getFullYear() + 1)); 1895 else { 1896 v.setDate(v.getDate() + W); 1897 break; 1898 } 1899 } 1900 return S = new Date(v.getFullYear() + 1, 0, 4), W = y(new Date(v.getFullYear(), 0, 4)), S = y(S), 0 >= p(W, v) ? 0 >= p(S, v) ? v.getFullYear() + 1 : v.getFullYear() : v.getFullYear() - 1; 1901 } 1902 var g = se[o + 40 >> 2]; 1903 o = { wc: se[o >> 2], vc: se[o + 4 >> 2], Fa: se[o + 8 >> 2], Sa: se[o + 12 >> 2], Ga: se[o + 16 >> 2], da: se[o + 20 >> 2], R: se[o + 24 >> 2], ca: se[o + 28 >> 2], Rc: se[o + 32 >> 2], uc: se[o + 36 >> 2], xc: g && g ? Fe(Y, g) : "" }, r = r ? Fe(Y, r) : "", g = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" }; 1904 for (var D in g) 1905 r = r.replace(new RegExp(D, "g"), g[D]); 1906 var U = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), ee = "January February March April May June July August September October November December".split(" "); 1907 g = { "%a": (v) => U[v.R].substring(0, 3), "%A": (v) => U[v.R], "%b": (v) => ee[v.Ga].substring(0, 3), "%B": (v) => ee[v.Ga], "%C": (v) => f((v.da + 1900) / 100 | 0, 2), "%d": (v) => f(v.Sa, 2), "%e": (v) => l(v.Sa, 2, " "), "%g": (v) => x(v).toString().substring(2), "%G": (v) => x(v), "%H": (v) => f(v.Fa, 2), "%I": (v) => (v = v.Fa, v == 0 ? v = 12 : 12 < v && (v -= 12), f(v, 2)), "%j": (v) => { 1908 for (var W = 0, S = 0; S <= v.Ga - 1; W += (Un(v.da + 1900) ? mi : vi)[S++]) 1909 ; 1910 return f(v.Sa + W, 3); 1911 }, "%m": (v) => f(v.Ga + 1, 2), "%M": (v) => f(v.vc, 2), "%n": () => ` 1912`, "%p": (v) => 0 <= v.Fa && 12 > v.Fa ? "AM" : "PM", "%S": (v) => f(v.wc, 2), "%t": () => " ", "%u": (v) => v.R || 7, "%U": (v) => f(Math.floor((v.ca + 7 - v.R) / 7), 2), "%V": (v) => { 1913 var W = Math.floor((v.ca + 7 - (v.R + 6) % 7) / 7); 1914 if (2 >= (v.R + 371 - v.ca - 2) % 7 && W++, W) 1915 W == 53 && (S = (v.R + 371 - v.ca) % 7, S == 4 || S == 3 && Un(v.da) || (W = 1)); 1916 else { 1917 W = 52; 1918 var S = (v.R + 7 - v.ca - 1) % 7; 1919 (S == 4 || S == 5 && Un(v.da % 400 - 1)) && W++; 1920 } 1921 return f(W, 2); 1922 }, "%w": (v) => v.R, "%W": (v) => f(Math.floor((v.ca + 7 - (v.R + 6) % 7) / 7), 2), "%y": (v) => (v.da + 1900).toString().substring(2), "%Y": (v) => v.da + 1900, "%z": (v) => { 1923 v = v.uc; 1924 var W = 0 <= v; 1925 return v = Math.abs(v) / 60, (W ? "+" : "-") + ("0000" + (v / 60 * 100 + v % 60)).slice(-4); 1926 }, "%Z": (v) => v.xc, "%%": () => "%" }, r = r.replace(/%%/g, "\0\0"); 1927 for (D in g) 1928 r.includes(D) && (r = r.replace(new RegExp(D, "g"), g[D](o))); 1929 return r = r.replace(/\0\0/g, "%"), D = nt(r, !1), D.length > t ? 0 : (T.set(D, e), D.length - 1); 1930 }; 1931 function gi(e, t, r, o) { 1932 e || (e = this), this.parent = e, this.U = e.U, this.wa = null, this.id = Eo++, this.name = t, this.mode = r, this.l = {}, this.m = {}, this.za = o; 1933 } 1934 Object.defineProperties(gi.prototype, { read: { get: function() { 1935 return (this.mode & 365) === 365; 1936 }, set: function(e) { 1937 e ? this.mode |= 365 : this.mode &= -366; 1938 } }, write: { get: function() { 1939 return (this.mode & 146) === 146; 1940 }, set: function(e) { 1941 e ? this.mode |= 146 : this.mode &= -147; 1942 } } }), Zr(), an = Array(4096), Xr(pe, "/"), ct("/tmp", 16895, 0), ct("/home", 16895, 0), ct("/home/web_user", 16895, 0), (() => { 1943 ct("/dev", 16895, 0), ir(259, { read: () => 0, write: (o, l, f, p) => p }), Rn("/dev/null", 259), et(1280, kt), et(1536, Lt), Rn("/dev/tty", 1280), Rn("/dev/tty1", 1536); 1944 var e = new Uint8Array(1024), t = 0, r = () => (t === 0 && (t = ve(e).byteLength), e[--t]); 1945 sn("random", r), sn("urandom", r), ct("/dev/shm", 16895, 0), ct("/dev/shm/tmp", 16895, 0); 1946 })(), (() => { 1947 ct("/proc", 16895, 0); 1948 var e = ct("/proc/self", 16895, 0); 1949 ct("/proc/self/fd", 16895, 0), Xr({ U: () => { 1950 var t = zr(e, "fd", 16895, 73); 1951 return t.l = { ka: (r, o) => { 1952 var l = Ft(+o); 1953 return r = { parent: null, U: { nb: "fake" }, l: { ma: () => l.path } }, r.parent = r; 1954 } }, t; 1955 } }, "/proc/self/fd"); 1956 })(), Object.assign(Qr.prototype, { get(e) { 1957 return this.M[e]; 1958 }, has(e) { 1959 return this.M[e] !== void 0; 1960 }, pa(e) { 1961 var t = this.ib.pop() || this.M.length; 1962 return this.M[t] = e, t; 1963 }, Zb(e) { 1964 this.M[e] = void 0, this.ib.push(e); 1965 } }
1965), qt = a.BindingError = class extends Error { 1966 constructor(e) { 1967 super(e), this.name = "BindingError"; 1968 } 1969 }, it.M.push({ value: void 0 }, { value: null }, { value: !0 }, { value: !1 }), it.h = it.M.length, a.count_emval_handles = function() { 1970 for (var e = 0, t = it.h; t < it.M.length; ++t) 1971 it.M[t] !== void 0 && ++e; 1972 return e; 1973 }, ti = a.PureVirtualError = ei("PureVirtualError"); 1974 for (var yi = Array(256), zn = 0; 256 > zn; ++zn) 1975 yi[zn] = String.fromCharCode(zn); 1976 ni = yi, a.getInheritedInstanceCount = function() { 1977 return Object.keys(Ct).length; 1978 }, a.getLiveInheritedInstances = function() { 1979 var e = [], t; 1980 for (t in Ct) 1981 Ct.hasOwnProperty(t) && e.push(Ct[t]); 1982 return e; 1983 }, a.flushPendingDeletes = sr, a.setDelayFunction = function(e) { 1984 fn = e, cn.length && fn && fn(sr); 1985 }, si = a.InternalError = class extends Error { 1986 constructor(e) { 1987 super(e), this.name = "InternalError"; 1988 } 1989 }, Ot.prototype.isAliasOf = function(e) { 1990 if (!(this instanceof Ot && e instanceof Ot)) 1991 return !1; 1992 var t = this.g.u.i, r = this.g.o, o = e.g.u.i; 1993 for (e = e.g.o; t.A; ) 1994 r = t.na(r), t = t.A; 1995 for (; o.A; ) 1996 e = o.na(e), o = o.A; 1997 return t === o && r === e; 1998 }, Ot.prototype.clone = function() { 1999 if (this.g.o || cr(this), this.g.ia) 2000 return this.g.count.value += 1, this; 2001 var e = Qt, t = Object, r = t.create, o = Object.getPrototypeOf(this), l = this.g; 2002 return e = e(r.call(t, o, { g: { value: { count: l.count, fa: l.fa, ia: l.ia, o: l.o, u: l.u, G: l.G, L: l.L } } })), e.g.count.value += 1, e.g.fa = !1, e; 2003 }, Ot.prototype.delete = function() { 2004 this.g.o || cr(this), this.g.fa && !this.g.ia && we("Object already scheduled for deletion"), kn(this), ii(this.g), this.g.ia || (this.g.G = void 0, this.g.o = void 0); 2005 }, Ot.prototype.isDeleted = function() { 2006 return !this.g.o; 2007 }, Ot.prototype.deleteLater = function() { 2008 return this.g.o || cr(this), this.g.fa && !this.g.ia && we("Object already scheduled for deletion"), cn.push(this), cn.length === 1 && fn && fn(sr), this.g.fa = !0, this; 2009 }, At.prototype.Vb = function(e) { 2010 return this.sb && (e = this.sb(e)), e; 2011 }, At.prototype.bb = function(e) { 2012 this.W && this.W(e); 2013 }, At.prototype.argPackAdvance = 8, At.prototype.readValueFromPointer = pn, At.prototype.deleteObject = function(e) { 2014 e !== null && e.delete(); 2015 }, At.prototype.fromWireType = function(e) { 2016 function t() { 2017 return this.ua ? Fn(this.i.N, { u: this.nc, o: r, L: this, G: e }) : Fn(this.i.N, { u: this, o: e }); 2018 } 2019 var r = this.Vb(e); 2020 if (!r) 2021 return this.bb(e), null; 2022 var o = Mo(this.i, r); 2023 if (o !== void 0) 2024 return o.g.count.value === 0 ? (o.g.o = r, o.g.G = e, o.clone()) : (o = o.clone(), this.bb(e), o); 2025 if (o = this.i.Ub(r), o = ai[o], !o) 2026 return t.call(this); 2027 o = this.ta ? o.Kb : o.pointerType; 2028 var l = oi(r, this.i, o.i); 2029 return l === null ? t.call(this) : this.ua ? Fn(o.i.N, { u: o, o: l, L: this, G: e }) : Fn(o.i.N, { u: o, o: l }); 2030 }, ci = a.UnboundTypeError = ei("UnboundTypeError"); 2031 var bi = { __syscall_fcntl64: function(e, t, r) { 2032 ln = r; 2033 try { 2034 var o = Ft(e); 2035 switch (t) { 2036 case 0: 2037 var l = _t(); 2038 return 0 > l ? -28 : Gr(o, l).X; 2039 case 1: 2040 case 2: 2041 return 0; 2042 case 3: 2043 return o.flags; 2044 case 4: 2045 return l = _t(), o.flags |= l, 0; 2046 case 5: 2047 return l = _t(), H[l + 0 >> 1] = 2, 0; 2048 case 6: 2049 case 7: 2050 return 0; 2051 case 16: 2052 case 8: 2053 return -28; 2054 case 9: 2055 return se[wi() >> 2] = 28, -1; 2056 default: 2057 return -28; 2058 } 2059 } catch (f) { 2060 if (typeof $t >
2060 "u" || f.name !== "ErrnoError") 2061 throw f; 2062 return -f.aa; 2063 } 2064 }, __syscall_ioctl: function(e, t, r) { 2065 ln = r; 2066 try { 2067 var o = Ft(e); 2068 switch (t) { 2069 case 21509: 2070 return o.s ? 0 : -59; 2071 case 21505: 2072 if (!o.s) 2073 return -59; 2074 if (o.s.V.bc) { 2075 t = [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 2076 var l = _t(); 2077 se[l >> 2] = 25856, se[l + 4 >> 2] = 5, se[l + 8 >> 2] = 191, se[l + 12 >> 2] = 35387; 2078 for (var f = 0; 32 > f; f++) 2079 T[l + f + 17 >> 0] = t[f] || 0; 2080 } 2081 return 0; 2082 case 21510: 2083 case 21511: 2084 case 21512: 2085 return o.s ? 0 : -59; 2086 case 21506: 2087 case 21507: 2088 case 21508: 2089 if (!o.s) 2090 return -59; 2091 if (o.s.V.cc) 2092 for (l = _t(), t = [], f = 0; 32 > f; f++) 2093 t.push(T[l + f + 17 >> 0]); 2094 return 0; 2095 case 21519: 2096 return o.s ? (l = _t(), se[l >> 2] = 0) : -59; 2097 case 21520: 2098 return o.s ? -28 : -59; 2099 case 21531: 2100 if (l = _t(), !o.m.ac) 2101 throw new te(59); 2102 return o.m.ac(o, t, l); 2103 case 21523: 2104 return o.s ? (o.s.V.dc && (f = [24, 80], l = _t(), H[l >> 1] = f[0], H[l + 2 >> 1] = f[1]), 0) : -59; 2105 case 21524: 2106 return o.s ? 0 : -59; 2107 case 21515: 2108 return o.s ? 0 : -59; 2109 default: 2110 return -28; 2111 } 2112 } catch (p) { 2113 if (typeof $t > "u" || p.name !== "ErrnoError") 2114 throw p; 2115 return -p.aa; 2116 } 2117 }
2117, __syscall_openat: function(e, t, r, o) { 2118 ln = o; 2119 try { 2120 t = t ? Fe(Y, t) : ""; 2121 var l = t; 2122 if (l.charAt(0) === "/") 2123 t = l; 2124 else { 2125 var f = e === -100 ? "/" : Ft(e).path; 2126 if (l.length == 0) 2127 throw new te(44); 2128 t = m(f + "/" + l); 2129 } 2130 var p = o ? _t() : 0; 2131 return In(t, r, p).X; 2132 } catch (y) { 2133 if (typeof $t > "u" || y.name !== "ErrnoError") 2134 throw y; 2135 return -y.aa; 2136 } 2137 }, _embind_create_inheriting_constructor: function(e, t, r) { 2138 e = He(e), t = dn(t, "wrapper"), r = ft(r); 2139 var o = [].slice, l = t.i, f = l.N, p = l.A.N, y = l.A.constructor; 2140 e = Tn(e, function() { 2141 l.A.rb.forEach((function(g) { 2142 if (this[g] === p[g]) 2143 throw new ti(`Pure virtual function ${g} must be implemented in JavaScript`); 2144 }).bind(this)), Object.defineProperty(this, "__parent", { value: f }), this.__construct.apply(this, o.call(arguments)); 2145 }), f.__construct = function() { 2146 this === f && we("Pass correct 'this' to __construct"); 2147 var g = y.implement.apply(void 0, [this].concat(o.call(arguments))); 2148 kn(g); 2149 var D = g.g; 2150 g.notifyOnDestruction(), D.ia = !0, Object.defineProperties(this, { g: { value: D } }), Qt(this), g = D.o, g = ur(l, g), Ct.hasOwnProperty(g) ? we(`Tried to register registered instance: ${g}`) : Ct[g] = this; 2151 }, f.__destruct = function() { 2152 this === f && we("Pass correct 'this' to __destruct"), kn(this); 2153 var g = this.g.o; 2154 g = ur(l, g), Ct.hasOwnProperty(g) ? delete Ct[g] : we(`Tried to unregister unregistered instance: ${g}`); 2155 }, e.prototype = Object.create(f); 2156 for (var x in r) 2157 e.prototype[x] = r[x]; 2158 return dt(e); 2159 }, _embind_finalize_value_object: function(e) { 2160 var t = On[e]; 2161 delete On[e]; 2162 var r = t.Pa, o = t.W, l = t.fb, f = l.map((p) => p.Yb).concat(l.map((p) => p.rc)); 2163 tt([e], f, (p) => { 2164 var y = {}; 2165 return l.forEach((x, g) => { 2166 var D = p[g], U = x.Wb, ee = x.Xb, v = p[g + l.length], W = x.qc, S = x.sc; 2167 y[x.Sb] = { read: (_e) => D.fromWireType(U(ee, _e)), write: (_e, Ae) => { 2168 var G = []; 2169 W(S, _e, v.toWireType(G, Ae)), hn(G); 2170 } }; 2171 }), [{ name: t.name, fromWireType: function(x) { 2172 var g = {}, D; 2173 for (D in y) 2174 g[D] = y[D].read(x); 2175 return o(x), g; 2176 }, toWireType: function(x, g) { 2177 for (var D in y) 2178 if (!(D in g)) 2179 throw new TypeError(`Missing field: "${D}"`); 2180 var U = r(); 2181 for (D in y) 2182 y[D].write(U, g[D]); 2183 return x !== null && x.push(o, U), U; 2184 }, argPackAdvance: 8, readValueFromPointer: pn, K: o }]; 2185 }); 2186 }, _embind_register_bigint: function() { 2187 }, _embind_register_bool: function(e, t, r, o, l) { 2188 var f = Sn(r); 2189 t = He(t), vt(e, { name: t, fromWireType: function(p) { 2190 return !!p; 2191 }, toWireType: function(p, y) { 2192 return y ? o : l; 2193 }, argPackAdvance: 8, readValueFromPointer: function(p) { 2194 if (r === 1) 2195 var y = T; 2196 else if (r === 2) 2197 y = H; 2198 else if (r === 4) 2199 y = se; 2200 else 2201 throw new TypeError("Unknown boolean type size: " + t); 2202 return this.fromWireType(y[p >> f]); 2203 }, K: null }); 2204 }, _embind_register_class: function(e, t, r, o, l, f, p, y, x, g, D, U, ee) { 2205 D = He(D), f = qe(l, f), y && (y = qe(p, y)), g && (g = qe(x, g)), ee = qe(U, ee); 2206 var v = qr(D); 2207 dr(v, function() { 2208 xt(`Cannot construct ${D} due to unbound types`, [o]); 2209 }), tt([e, t, r], o ? [o] : [], function(W) { 2210 if (W = W[0], o) 2211 var S = W.i, _e = S.N; 2212 else 2213 _e = Ot.prototype; 2214 W = Tn(v, function() { 2215 if (Object.getPrototypeOf(this) !== Ae) 2216 throw new qt("Use 'new' to construct " + D); 2217 if (G.$ === void 0) 2218 throw new qt(D + " has no accessible constructor"); 2219 var Je = G.$[arguments.length]; 2220 if (Je === void 0) 2221 throw new qt(`Tried to invoke ctor of ${D}
2221 with invalid number of parameters (${arguments.length}) - expected (${Object.keys(G.$).toString()}) parameters instead!`); 2222 return Je.apply(this, arguments); 2223 }); 2224 var Ae = Object.create(_e, { constructor: { value: W } }); 2225 W.prototype = Ae; 2226 var G = new ko(D, W, Ae, ee, S, f, y, g); 2227 G.A && (G.A.oa === void 0 && (G.A.oa = []), G.A.oa.push(G)), S = new At(D, G, !0, !1), _e = new At(D + "*", G, !1, !1); 2228 var De = new At(D + " const*", G, !1, !0); 2229 return ai[e] = { pointerType: _e, Kb: De }, ui(v, W), [S, _e, De]; 2230 }); 2231 }, _embind_register_class_class_function: function(e, t, r, o, l, f, p) { 2232 var y = $n(r, o); 2233 t = He(t), f = qe(l, f), tt([], [e], function(x) { 2234 function g() { 2235 xt(`Cannot call ${D} due to unbound types`, y); 2236 } 2237 x = x[0]; 2238 var D = `${x.name}.${t}`; 2239 t.startsWith("@@") && (t = Symbol[t.substring(2)]); 2240 var U = x.i.constructor; 2241 return U[t] === void 0 ? (g.ea = r - 1, U[t] = g) : (fr(U, t, D), U[t].B[r - 1] = g), tt([], y, function(ee) { 2242 if (ee = Dn(D, [ee[0], null].concat(ee.slice(1)), null, f, p), U[t].B === void 0 ? (ee.ea = r - 1, U[t] = ee) : U[t].B[r - 1] = ee, x.i.oa) 2243 for (const v of x.i.oa) 2244 v.constructor.hasOwnProperty(t) || (v.constructor[t] = ee); 2245 return []; 2246 }), []; 2247 }); 2248 }, _embind_register_class_class_property: function(e, t, r, o, l, f, p, y) { 2249 t = He(t), f = qe(l, f), tt([], [e], function(x) { 2250 x = x[0]; 2251 var g = `${x.name}.${t}`, D = { get() { 2252 xt(`Cannot access ${g} due to unbound types`, [r]); 2253 }, enumerable: !0, configurable: !0 }; 2254 return D.set = y ? () => { 2255 xt(`Cannot access ${g} due to unbound types`, [r]); 2256 } : () => { 2257 we(`${g} is a read-only property`); 2258 }, Object.defineProperty(x.i.constructor, t, D), tt([], [r], function(U) { 2259 U = U[0]; 2260 var ee = { get() { 2261 return U.fromWireType(f(o)); 2262 }, enumerable: !0 }; 2263 return y && (y = qe(p, y), ee.set = (v) => { 2264 var W = []; 2265 y(o, U.toWireType(W, v)), hn(W); 2266 }), Object.defineProperty(x.i.constructor, t, ee), []; 2267 }), []; 2268 }); 2269 }, _embind_register_class_constructor: function(e, t, r, o, l, f) { 2270 var p = $n(t, r); 2271 l = qe(o, l), tt([], [e], function(y) { 2272 y = y[0]; 2273 var x = `constructor ${y.name}`; 2274 if (y.i.$ === void 0 && (y.i.$ = []), y.i.$[t - 1] !== void 0) 2275 throw new qt(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${y.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`); 2276 return y.i.$[t - 1] = () => { 2277 xt(`Cannot construct ${y.name} due to unbound types`, p); 2278 }, tt([], p, function(g) { 2279 return g.splice(1, 0, null), y.i.$[t - 1] = Dn(x, g, null, l, f), []; 2280 }), []; 2281 }); 2282 }, _embind_register_class_function: function(e, t, r, o, l, f, p, y) { 2283 var x = $n(r, o); 2284 t = He(t), f = qe(l, f), tt([], [e], function(g) { 2285 function D() { 2286 xt(`Cannot call ${U} due to unbound types`, x); 2287 } 2288 g = g[0]; 2289 var U = `${g.name}.${t}`; 2290 t.startsWith("@@") && (t = Symbol[t.substring(2)]), y && g.i.rb.push(t); 2291 var ee = g.i.N, v = ee[t]; 2292 return v === void 0 || v.B === void 0 && v.className !== g.name && v.ea === r - 2 ? (D.ea = r - 2, D.className = g.name, ee[t] = D) : (fr(ee, t, U), ee[t].B[r - 2] = D), tt([], x, function(W) { 2293 return W = Dn(U, W, g, f, p), ee[t].B === void 0 ? (W.ea = r - 2, ee[t] = W) : ee[t].B[r - 2] = W, []; 2294 }), []; 2295 }); 2296 }, _embind_register_class_property: function(e, t, r, o, l, f, p, y, x, g) { 2297 t = He(t), l = qe(o, l), tt([], [e], function(D) { 2298 D = D[0]; 2299 var U = `${D.name}.${t}`, ee = { get() { 2300 xt(`Cannot access ${U} due to unbound types`, [r, p]); 2301 }, enumerable: !0, configurable: !0 }; 2302 return ee.set = x ? () => { 2303 xt(`Cannot access ${U} due to unbound types`, [r, p]); 2304 } : () => { 2305 we(U + " is a read-only property"); 2306 }, Object.defineProperty(D.i.N, t, ee), tt([], x ? [r, p] : [r], function(v) { 2307 var W = v[0], S = { get() { 2308 var Ae = fi(this, D, U + " getter"); 2309 return W.fromWireType(l(f, Ae)); 2310 }, enumerable: !0 }; 2311 if (x) { 2312 x = qe(y, x); 2313 var _e = v[1]; 2314 S.set = function(Ae) { 2315 var G = fi(this, D, U + " setter"), De = []; 2316 x(g, G, _e.toWireType(De, Ae)), hn(De); 2317 }; 2318 } 2319 return Object.defineProperty(D.i.N, t, S), []; 2320 }), []; 2321 }); 2322 }, _embind_register_emval: function(e, t) { 2323 t = He(t), vt(e, { name: t, fromWireType: function(r) { 2324 var o = ft(r); 2325 return hr(r), o; 2326 }, toWireType: function(r, o) { 2327 return dt(o); 2328 }, argPackAdvance: 8, readValueFromPointer: pn, K: null }); 2329 }, _embind_register_enum: function(e, t, r, o) { 2330 function l() { 2331 } 2332 r = Sn(r), t = He(t), l.values = {}, vt(e, { name: t, constructor: l, fromWireType: function(f) { 2333 return this.constructor.values[f]; 2334 }, toWireType: function(f, p) { 2335 return p.value; 2336 }, argPackAdvance: 8, readValueFromPointer: So(t, r, o), K: null }), dr(t, l); 2337 }, _embind_register_enum_value: function(e, t, r) { 2338 var o = dn(e, "enum"); 2339 t = He(t), e = o.constructor, o = Object.create(o.constructor.prototype, { value: { value: r }
2339, constructor: { value: Tn(`${o.name}_${t}`, function() { 2340 }) } }), e.values[r] = o, e[t] = o; 2341 }, _embind_register_float: function(e, t, r) { 2342 r = Sn(r), t = He(t), vt(e, { name: t, fromWireType: function(o) { 2343 return o; 2344 }, toWireType: function(o, l) { 2345 return l; 2346 }, argPackAdvance: 8, readValueFromPointer: Vo(t, r), K: null }); 2347 }, _embind_register_function: function(e, t, r, o, l, f) { 2348 var p = $n(t, r); 2349 e = He(e), l = qe(o, l), dr(e, function() { 2350 xt(`Cannot call ${e} due to unbound types`, p); 2351 }, t - 1), tt([], p, function(y) { 2352 return ui(e, Dn(e, [y[0], null].concat(y.slice(1)), null, l, f), t - 1), []; 2353 }); 2354 }, _embind_register_integer: function(e, t, r, o, l) { 2355 t = He(t), l === -1 && (l = 4294967295), l = Sn(r); 2356 var f = (y) => y; 2357 if (o === 0) { 2358 var p = 32 - 8 * r; 2359 f = (y) => y << p >>> p; 2360 } 2361 r = t.includes("unsigned") ? function(y, x) { 2362 return x >>> 0; 2363 } : function(y, x) { 2364 return x; 2365 }, vt(e, { name: t, fromWireType: f, toWireType: r, argPackAdvance: 8, readValueFromPointer: Wo(t, l, o !== 0), K: null }); 2366 }, _embind_register_memory_view: function(e, t, r) { 2367 function o(f) { 2368 f >>= 2; 2369 var p = he; 2370 return new l(p.buffer, p[f + 1], p[f]); 2371 } 2372 var l = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][t]; 2373 r = He(r), vt(e, { name: r, fromWireType: o, argPackAdvance: 8, readValueFromPointer: o }, { $b: !0 }); 2374 }, _embind_register_std_string: function(e, t) { 2375 t = He(t); 2376 var r = t === "std::string"; 2377 vt(e, { name: t, fromWireType: function(o) { 2378 var l = he[o >> 2], f = o + 4; 2379 if (r) 2380 for (var p = f, y = 0; y <= l; ++y) { 2381 var x = f + y; 2382 if (y == l || Y[x] == 0) { 2383 if (p = p ? Fe(Y, p, x - p) : "", g === void 0) 2384 var g = p; 2385 else 2386 g += "\0", g += p; 2387 p = x + 1; 2388 } 2389 } 2390 else { 2391 for (g = Array(l), y = 0; y < l; ++y) 2392 g[y] = String.fromCharCode(Y[f + y]); 2393 g = g.join(""); 2394 } 2395 return Et(o), g; 2396 }, toWireType: function(o, l) { 2397 l instanceof ArrayBuffer && (l = new Uint8Array(l)); 2398 var f = typeof l == "string"; 2399 f || l instanceof Uint8Array || l instanceof Uint8ClampedArray || l instanceof Int8Array || we("Cannot pass non-string to std::string"); 2400 var p = r && f ? Be(l) : l.length, y = yr(4 + p + 1), x = y + 4; 2401 if (he[y >> 2] = p, r && f) 2402 lt(l, Y, x, p + 1); 2403 else if (f) 2404 for (f = 0; f < p; ++f) { 2405 var g = l.charCodeAt(f); 2406 255 < g && (Et(x), we("String has UTF-16 code units that do not fit in 8 bits")), Y[x + f] = g; 2407 } 2408 else 2409 for (f = 0; f < p; ++f) 2410 Y[x + f] = l[f]; 2411 return o !== null && o.push(Et, y), y; 2412 }, argPackAdvance: 8, readValueFromPointer: pn, K: function(o) { 2413 Et(o); 2414 } }); 2415 }, _embind_register_std_wstring: function(e, t, r) { 2416 if (r = He(r), t === 2) 2417 var o = Do, l = $o, f = Bo, p = () => ge, y = 1; 2418 else 2419 t === 4 && (o = No, l = Uo, f = zo, p = () => he, y = 2); 2420 vt(e, { name: r, fromWireType: function(x) { 2421 for (var g = he[x >> 2], D = p(), U, ee = x + 4, v = 0; v <= g; ++v) { 2422 var W = x + 4 + v * t; 2423 (v == g || D[W >> y] == 0) && (ee = o(ee, W - ee), U === void 0 ? U = ee : (U += "\0", U += ee), ee = W + t); 2424 }
2425 return Et(x), U; 2426 }, toWireType: function(x, g) { 2427 typeof g != "string" && we(`Cannot pass non-string to C++ string type ${r}`); 2428 var D = f(g), U = yr(4 + D + t); 2429 return he[U >> 2] = D >> y, l(g, U + 4, D + t), x !== null && x.push(Et, U), U; 2430 }, argPackAdvance: 8, readValueFromPointer: pn, K: function(x) { 2431 Et(x); 2432 } }); 2433 }, _embind_register_value_object: function(e, t, r, o, l, f) { 2434 On[e] = { name: He(t), Pa: qe(r, o), W: qe(l, f), fb: [] }; 2435 }, _embind_register_value_object_field: function(e, t, r, o, l, f, p, y, x, g) { 2436 On[e].fb.push({ Sb: He(t), Yb: r, Wb: qe(o, l), Xb: f, rc: p, qc: qe(y, x), sc: g }); 2437 }, _embind_register_void: function(e, t) { 2438 t = He(t), vt(e, { fc: !0, name: t, argPackAdvance: 0, fromWireType: function() { 2439 }, toWireType: function() { 2440 } }); 2441 }, _emscripten_get_now_is_monotonic: () => !0, _emval_as: function(e, t, r) { 2442 e = ft(e), t = dn(t, "emval::as"); 2443 var o = [], l = dt(o); 2444 return he[r >> 2] = l, t.toWireType(o, e); 2445 }, _emval_call_method: function(e, t, r, o, l) { 2446 e = Nn[e], t = ft(t), r = Bn(r); 2447 var f = []; 2448 return he[o >> 2] = dt(f), e(t, r, f, l); 2449 }, _emval_call_void_method: function(e, t, r, o) { 2450 e = Nn[e], t = ft(t), r = Bn(r), e(t, r, null, o); 2451 }, _emval_decref: hr, _emval_get_method_caller: function(e, t) { 2452 var r = Go(e, t), o = r[0]; 2453 t = o.name + "_$" + r.slice(1).map(function(p) { 2454 return p.name; 2455 }).join("_") + "$"; 2456 var l = hi[t]; 2457 if (l !== void 0) 2458 return l; 2459 var f = Array(e - 1); 2460 return l = Yo((p, y, x, g) => { 2461 for (var D = 0, U = 0; U < e - 1; ++U) 2462 f[U] = r[U + 1].readValueFromPointer(g + D), D += r[U + 1].argPackAdvance; 2463 for (p = p[y].apply(p, f), U = 0; U < e - 1; ++U) 2464 r[U + 1].Nb && r[U + 1].Nb(f[U]); 2465 if (!o.fc) 2466 return o.toWireType(x, p); 2467 }), hi[t] = l; 2468 }, _emval_get_module_property: function(e) { 2469 return e = Bn(e), dt(a[e]); 2470 }, _emval_get_property: function(e, t) { 2471 return e = ft(e), t = ft(t), dt(e[t]); 2472 }, _emval_incref: function(e) { 2473 4 < e && (it.get(e).ub += 1); 2474 }, _emval_new_array: function() { 2475 return dt([]); 2476 }, _emval_new_cstring: function(e) { 2477 return dt(Bn(e)); 2478 }, _emval_new_object: function() { 2479 return dt({}); 2480 }, _emval_run_destructors: function(e) { 2481 var t = ft(e); 2482 hn(t), hr(e); 2483 }, _emval_set_property: function(e, t, r) { 2484 e = ft(e), t = ft(t), r = ft(r), e[t] = r; 2485 }, _emval_take_value: function(e, t) { 2486 return e = dn(e, "_emval_take_value"), e = e.readValueFromPointer(t), dt(e); 2487 }, abort: () => { 2488 We(""); 2489 }, emscripten_asm_const_int: (e, t, r) => { 2490 mr.length = 0; 2491 var o; 2492 for (r >>= 2; o = Y[t++]; ) 2493 r += o != 105 & r, mr.push(o == 105 ? se[r] : me[r++ >> 1]), ++r; 2494 return n[e].apply(null, mr); 2495 }, emscripten_date_now: function() { 2496 return Date.now(); 2497 }, emscripten_get_now: () => performance.now(), emscripten_memcpy_big: (e, t, r) => Y.copyWithin(e, t, t + r), emscripten_resize_heap: (e) => { 2498 var t = Y.length; 2499 if (e >>>= 0, 2147483648 < e) 2500 return !1; 2501 for (var r = 1; 4 >= r; r *= 2) { 2502 var o = t * (1 + 0.2 / r); 2503 o = Math.min(o, e + 100663296); 2504 var l = Math; 2505 o = Math.max(e, o); 2506 e: { 2507 l = l.min.call(l, 2147483648, o + (65536 - o % 65536) % 65536) - B.buffer.byteLength + 65535 >>> 16; 2508 try { 2509 B.grow(l), $e(); 2510 var f = 1; 2511 break e; 2512 } catch { 2513 } 2514 f = void 0; 2515 } 2516 if (f) 2517 return !0; 2518 } 2519 return !1; 2520 }, environ_get: (e, t) => { 2521 var r = 0;
2522 return pi().forEach(function(o, l) { 2523 var f = t + r; 2524 for (l = he[e + 4 * l >> 2] = f, f = 0; f < o.length; ++f) 2525 T[l++ >> 0] = o.charCodeAt(f); 2526 T[l >> 0] = 0, r += o.length + 1; 2527 }), 0; 2528 }, environ_sizes_get: (e, t) => { 2529 var r = pi(); 2530 he[e >> 2] = r.length; 2531 var o = 0; 2532 return r.forEach(function(l) { 2533 o += l.length + 1; 2534 }), he[t >> 2] = o, 0; 2535 }, fd_close: function(e) { 2536 try { 2537 var t = Ft(e); 2538 if (t.X === null) 2539 throw new te(8); 2540 t.Ma && (t.Ma = null); 2541 try { 2542 t.m.close && t.m.close(t); 2543 } catch (r) { 2544 throw r; 2545 } finally { 2546 xn[t.X] = null; 2547 } 2548 return t.X = null, 0; 2549 } catch (r) { 2550 if (typeof $t > "u" || r.name !== "ErrnoError") 2551 throw r; 2552 return r.aa; 2553 } 2554 }, fd_read: function(e, t, r, o) { 2555 try { 2556 e: { 2557 var l = Ft(e); 2558 e = t; 2559 for (var f, p = t = 0; p < r; p++) { 2560 var y = he[e >> 2], x = he[e + 4 >> 2]; 2561 e += 8; 2562 var g = l, D = y, U = x, ee = f, v = T; 2563 if (0 > U || 0 > ee) 2564 throw new te(28); 2565 if (g.X === null) 2566 throw new te(8); 2567 if ((g.flags & 2097155) === 1) 2568 throw new te(8); 2569 if ((g.node.mode & 61440) === 16384) 2570 throw new te(31); 2571 if (!g.m.read) 2572 throw new te(28); 2573 var W = typeof ee < "u"; 2574 if (!W) 2575 ee = g.position; 2576 else if (!g.seekable) 2577 throw new te(70); 2578 var S = g.m.read(g, v, D, U, ee); 2579 W || (g.position += S); 2580 var _e = S; 2581 if (0 > _e) { 2582 var Ae = -1; 2583 break e; 2584 } 2585 if (t += _e, _e < x) 2586 break; 2587 typeof f < "u" && (f += _e); 2588 } 2589 Ae = t; 2590 } 2591 return he[o >> 2] = Ae, 0; 2592 } catch (G) { 2593 if (typeof $t > "u" || G.name !== "ErrnoError") 2594 throw G; 2595 return G.aa; 2596 } 2597 }, fd_seek: function(e, t, r, o, l) { 2598 t = r + 2097152 >>> 0 < 4194305 - !!t ? (t >>> 0) + 4294967296 * r : NaN; 2599 try { 2600 if (isNaN(t)) 2601 return 61; 2602 var f = Ft(e); 2603 return Kr(f, t, o), s = [f.position >>> 0, (ut = f.position, 1 <= +Math.abs(ut) ? 0 < ut ? +Math.floor(ut / 4294967296) >>> 0 : ~~+Math.ceil((ut - +(~~ut >>> 0)) / 4294967296) >>> 0 : 0)], se[l >> 2] = s[0], se[l + 4 >> 2] = s[1], f.Ma && t === 0 && o === 0 && (f.Ma = null), 0; 2604 } catch (p) { 2605 if (typeof $t > "u" || p.name !== "ErrnoError") 2606 throw p; 2607 return p.aa; 2608 } 2609 }, fd_write: function(e, t, r, o) { 2610 try { 2611 e: { 2612 var l = Ft(e); 2613 e = t; 2614 for (var f, p = t = 0; p < r; p++) { 2615 var y = he[e >> 2], x = he[e + 4 >> 2]; 2616 e += 8; 2617 var g = l, D = y, U = x, ee = f, v = T; 2618 if (0 > U || 0 > ee) 2619 throw new te(28); 2620 if (g.X === null) 2621 throw new te(8); 2622 if ((g.flags & 2097155) === 0) 2623 throw new te(8); 2624 if ((g.node.mode & 61440) === 16384) 2625 throw new te(31); 2626 if (!g.m.write) 2627 throw new te(28); 2628 g.seekable && g.flags & 1024 && Kr(g, 0, 2); 2629 var W = typeof ee < "u"; 2630 if (!W) 2631 ee = g.position; 2632 else if (!g.seekable) 2633 throw new te(70); 2634 var S = g.m.write(g, v, D, U, ee, void 0); 2635 W || (g.position += S); 2636 var _e = S; 2637 if (0 > _e) { 2638 var Ae = -1; 2639 break e; 2640 } 2641 t += _e, typeof f < "u" && (f += _e); 2642 } 2643 Ae = t; 2644 } 2645 return he[o >> 2] = Ae, 0; 2646 } catch (G) { 2647 if (typeof $t >
2647 "u" || G.name !== "ErrnoError") 2648 throw G; 2649 return G.aa; 2650 } 2651 }, strftime_l: (e, t, r, o) => Xo(e, t, r, o) }; 2652 (function() { 2653 function e(r) { 2654 if (L = r = r.exports, B = L.memory, $e(), Ve = L.__indirect_function_table, Ne.unshift(L.__wasm_call_ctors), Pe--, a.monitorRunDependencies && a.monitorRunDependencies(Pe), Pe == 0 && ze) { 2655 var o = ze; 2656 ze = null, o(); 2657 } 2658 return r; 2659 } 2660 var t = { env: bi, wasi_snapshot_preview1: bi }; 2661 if (Pe++, a.monitorRunDependencies && a.monitorRunDependencies(Pe), a.instantiateWasm) 2662 try { 2663 return a.instantiateWasm(t, e); 2664 } catch (r) { 2665 b("Module.instantiateWasm callback failed with error: " + r), _(r); 2666 } 2667 return on(t, function(r) { 2668 e(r.instance); 2669 }).catch(_), {}; 2670 })(); 2671 var Et = (e) => (Et = L.free)(e), yr = (e) => (yr = L.malloc)(e), wi = () => (wi = L.__errno_location)(), _i = a._ma_device__on_notification_unlocked = (e) => (_i = a._ma_device__on_notification_unlocked = L.ma_device__on_notification_unlocked)(e); 2672 a._ma_malloc_emscripten = (e, t) => (a._ma_malloc_emscripten = L.ma_malloc_emscripten)(e, t), a._ma_free_emscripten = (e, t) => (a._ma_free_emscripten = L.ma_free_emscripten)(e, t); 2673 var Ci = a._ma_device_process_pcm_frames_capture__webaudio = (e, t, r) => (Ci = a._ma_device_process_pcm_frames_capture__webaudio = L.ma_device_process_pcm_frames_capture__webaudio)(e, t, r), Ai = a._ma_device_process_pcm_frames_playback__webaudio = (e, t, r) => (Ai = a._ma_device_process_pcm_frames_playback__webaudio = L.ma_device_process_pcm_frames_playback__webaudio)(e, t, r), xi = (e) => (xi = L.__getTypeName)(e); 2674 a.__embind_initialize_bindings = () => (a.__embind_initialize_bindings = L._embind_initialize_bindings)(), a.dynCall_iiji = (e, t, r, o, l) => (a.dynCall_iiji = L.dynCall_iiji)(e, t, r, o, l), a.dynCall_jiji = (e, t, r, o, l) => (a.dynCall_jiji = L.dynCall_jiji)(e, t, r, o, l), a.dynCall_iiiji = (e, t, r, o, l, f) => (a.dynCall_iiiji = L.dynCall_iiiji)(e, t, r, o, l, f), a.dynCall_iij = (e, t, r, o) => (a.dynCall_iij = L.dynCall_iij)(e, t, r, o), a.dynCall_jii = (e, t, r) => (a.dynCall_jii = L.dynCall_jii)(e, t, r), a.dynCall_viijii = (e, t, r, o, l, f, p) => (a.dynCall_viijii = L.dynCall_viijii)(e, t, r, o, l, f, p), a.dynCall_iiiiij = (e, t, r, o, l, f, p) => (a.dynCall_iiiiij = L.dynCall_iiiiij)(e, t, r, o, l, f, p), a.dynCall_iiiiijj = (e, t, r, o, l, f, p, y, x) => (a.dynCall_iiiiijj = L.dynCall_iiiiijj)(e, t, r, o, l, f, p, y, x), a.dynCall_iiiiiijj = (e, t, r, o, l, f, p, y, x, g) => (a.dynCall_iiiiiijj = L.dynCall_iiiiiijj)(e, t, r, o, l, f, p, y, x, g); 2675 var Hn; 2676 ze = function e() { 2677 Hn || Ei(), Hn || (ze = e); 2678 }; 2679 function Ei() { 2680 function e() { 2681 if (!Hn && (Hn = !0, a.calledRun = !0, !ne)) { 2682 if (a.noFSInit || Jr || (Jr = !0, Zr(), a.stdin = a.stdin, a.stdout = a.stdout, a.stderr = a.stderr, a.stdin ? sn("stdin", a.stdin) : or("/dev/tty", "/dev/stdin"), a.stdout ? sn("stdout", null, a.stdout) : or("/dev/tty", "/dev/stdout"), a.stderr ? sn("stderr", null, a.stderr) : or("/dev/tty1", "/dev/stderr"), In("/dev/stdin", 0), In("/dev/stdout", 1), In("/dev/stderr", 1)), Br = !1, i(Ne), M(a), a.onRuntimeInitialized && a.onRuntimeInitialized(), a.postRun) 2683 for (typeof a.postRun == "function" && (a.postRun = [a.postRun]); a.postRun.length; ) { 2684 var t = a.postRun.shift(); 2685 Ue.unshift(t); 2686 } 2687 i(Ue); 2688 } 2689 } 2690 if (!(0 < Pe)) { 2691 if (a.preRun) 2692 for (typeof a.preRun == "function" && (a.preRun = [a.preRun]); a.preRun.length; ) 2693 le(); 2694 i(Ge), 0 < Pe || (a.setStatus ? (a.setStatus("Running..."), setTimeout(function() { 2695 setTimeout(function() { 2696 a.setStatus(""); 2697 }, 1), e(); 2698 }, 1)) : e()); 2699 } 2700 } 2701 if (a.preInit) 2702 for (typeof a.preInit == "function" && (a.preInit = [a.preInit]); 0 < a.preInit.length; ) 2703 a.preInit.pop()(); 2704 return Ei(), Z.ready; 2705 }); 2706 })(); 2707 const J = K; 2708 }), 2709 /* 2 */ 2710 /***/ 2711 ((N) => { 2712 N.exports = /* @__PURE__ */ JSON.parse(`{"name":"@rive-app/canvas","version":"2.31.5","description":"Rive's canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <[email protected]> (https://rive.app)","Maxwell Talbot <[email protected]> (https://rive.app)","Arthur Vivian <[email protected]> (https://rive.app)","Umberto Sonnino <[email protected]> (https://rive.app)","Matthew Sullivan <[email protected]> (mailto:[email protected])"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`); 2713 }), 2714 /* 3 */ 2715 /***/ 2716 ((N, F, k) => { 2717 k.r(F), k.d(F, { 2718 /* harmony export */ 2719 Animation: () => ( 2720 /* reexport safe */ 2721 K.Animation 2722 ) 2723 /* harmony export */ 2724 }); 2725 var K = k(4); 2726 }), 2727 /* 4 */ 2728 /***/ 2729 ((N, F, k) => { 2730 k.r(F), k.d(F, { 2731 /* harmony export */ 2732 Animation: () => ( 2733 /* binding */ 2734 K 2735 ) 2736 /* harmony export */ 2737 }); 2738 var K = ( 2739 /** @class */ 2740 (function() { 2741 function J(ie, Z, a, M) { 2742 this.animation = ie, this.artboard = Z, this.playing = M, this.loopCount = 0, this.scrubTo = null, this.instance = new a.LinearAnimationInstance(ie, Z); 2743 }
2744 return Object.defineProperty(J.prototype, "name", { 2745 /** 2746 * Returns the animation's name 2747 */ 2748 get: function() { 2749 return this.animation.name; 2750 }, 2751 enumerable: !1, 2752 configurable: !0 2753 }), Object.defineProperty(J.prototype, "time", { 2754 /** 2755 * Returns the animation's name 2756 */ 2757 get: function() { 2758 return this.instance.time; 2759 }, 2760 /** 2761 * Sets the animation's current time 2762 */ 2763 set: function(ie) { 2764 this.instance.time = ie; 2765 }, 2766 enumerable: !1, 2767 configurable: !0 2768 }), Object.defineProperty(J.prototype, "loopValue", { 2769 /** 2770 * Returns the animation's loop type 2771 */ 2772 get: function() { 2773 return this.animation.loopValue; 2774 }, 2775 enumerable: !1, 2776 configurable: !0 2777 }), Object.defineProperty(J.prototype, "needsScrub", { 2778 /** 2779 * Indicates whether the animation needs to be scrubbed. 2780 * @returns `true` if the animation needs to be scrubbed, `false` otherwise. 2781 */ 2782 get: function() { 2783 return this.scrubTo !== null; 2784 }, 2785 enumerable: !1, 2786 configurable: !0 2787 }), J.prototype.advance = function(ie) { 2788 this.scrubTo === null ? this.instance.advance(ie) : (this.instance.time = 0, this.instance.advance(this.scrubTo), this.scrubTo = null); 2789 }, J.prototype.apply = function(ie) { 2790 this.instance.apply(ie); 2791 }, J.prototype.cleanup = function() { 2792 this.instance.delete(); 2793 }, J; 2794 })() 2795 ); 2796 }), 2797 /* 5 */ 2798 /***/ 2799 ((N, F, k) => { 2800 k.r(F), k.d(F, { 2801 /* harmony export */ 2802 AudioAssetWrapper: () => ( 2803 /* reexport safe */ 2804 ie.AudioAssetWrapper 2805 ), 2806 /* harmony export */ 2807 AudioWrapper: () => ( 2808 /* reexport safe */ 2809 ie.AudioWrapper 2810 ), 2811 /* harmony export */ 2812 BLANK_URL: () => ( 2813 /* reexport safe */ 2814 J.BLANK_URL 2815 ), 2816 /* harmony export */ 2817 CustomFileAssetLoaderWrapper: () => ( 2818 /* reexport safe */ 2819 ie.CustomFileAssetLoaderWrapper 2820 ), 2821 /* harmony export */ 2822 FileAssetWrapper: () => ( 2823 /* reexport safe */ 2824 ie.FileAssetWrapper 2825 ), 2826 /* harmony export */ 2827 FileFinalizer: () => ( 2828 /* reexport safe */ 2829 ie.FileFinalizer 2830 ), 2831 /* harmony export */ 2832 FontAssetWrapper: () => ( 2833 /* reexport safe */ 2834 ie.FontAssetWrapper 2835 ), 2836 /* harmony export */ 2837 FontWrapper: () => ( 2838 /* reexport safe */ 2839 ie.FontWrapper 2840 ), 2841 /* harmony export */ 2842 ImageAssetWrapper: () => ( 2843 /* reexport safe */ 2844 ie.ImageAssetWrapper 2845 ), 2846 /* harmony export */ 2847 ImageWrapper: () => ( 2848 /* reexport safe */ 2849 ie.ImageWrapper 2850 ), 2851 /* harmony export */ 2852 createFinalization: () => ( 2853 /* reexport safe */ 2854 ie.createFinalization 2855 ), 2856 /* harmony export */ 2857 finalizationRegistry: () => ( 2858 /* reexport safe */ 2859 ie.finalizationRegistry 2860 ), 2861 /* harmony export */ 2862 registerTouchInteractions: () => ( 2863 /* reexport safe */ 2864 K.registerTouchInteractions 2865 ), 2866 /* harmony export */ 2867 sanitizeUrl: () => ( 2868 /* reexport safe */ 2869 J.sanitizeUrl 2870 ) 2871 /* harmony export */ 2872 }); 2873 var K = k(6), J = k(7), ie = k(8); 2874 }), 2875 /* 6 */ 2876 /***/ 2877 ((N, F, k) => { 2878 k.r(F), k.d(F, { 2879 /* harmony export */ 2880 registerTouchInteractions: () => ( 2881 /* binding */ 2882 ie 2883 ) 2884 /* harmony export */ 2885 }); 2886 var K = void 0, J = function(Z, a) { 2887 var M, _; 2888 return ["touchstart", "touchmove"].indexOf(Z.type) > -1 && (!((M = Z.touches) === null || M === void 0) && M.length) ? (a || Z.preventDefault(), { 2889 clientX: Z.touches[0].clientX, 2890 clientY: Z.touches[0].clientY 2891 }) : Z.type === "touchend" && (!((_ = Z.changedTouches) === null || _ === void 0) && _.length) ? { 2892 clientX: Z.changedTouches[0].clientX, 2893 clientY: Z.changedTouches[0].clientY 2894 } : { 2895 clientX: Z.clientX, 2896 clientY: Z.clientY 2897 }; 2898 }, ie = function(Z) { 2899 var a = Z.canvas, M = Z.artboard, _ = Z.stateMachines, ue = _ === void 0 ? [] : _, q = Z.renderer, oe = Z.rive, fe = Z.fit, de = Z.alignment, ye = Z.isTouchScrollEnabled, Ie = ye === void 0 ? !1 : ye, be = Z.layoutScaleFactor, je = be === void 0 ? 1 : be; 2900 if (!a || !ue.length || !q || !oe || !M || typeof window > "u") 2901 return null; 2902 var z = null, $ = !1, h = function(I) { 2903 if ($ && I instanceof MouseEvent) { 2904 I.type == "mouseup" && ($ = !1); 2905 return; 2906 } 2907 $ = Ie && I.type === "touchend" && z === "touchstart", z = I.type; 2908 var b = I.currentTarget.getBoundingClientRect(), w = J
2908(I, Ie), B = w.clientX, L = w.clientY; 2909 if (!(!B && !L)) { 2910 var ne = B - b.left, T = L - b.top, Y = oe.computeAlignment(fe, de, { 2911 minX: 0, 2912 minY: 0, 2913 maxX: b.width, 2914 maxY: b.height 2915 }, M.bounds, je), H = new oe.Mat2D(); 2916 Y.invert(H); 2917 var ge = new oe.Vec2D(ne, T), se = oe.mapXY(H, ge), he = se.x(), Le = se.y(); 2918 switch (se.delete(), H.delete(), ge.delete(), Y.delete(), I.type) { 2919 /** 2920 * There's a 2px buffer for a hitRadius when translating the pointer coordinates 2921 * down to the state machine. In cases where the hitbox is about that much away 2922 * from the Artboard border, we don't have exact precision on determining pointer 2923 * exit. We're therefore adding to the translated coordinates on mouseout of a canvas 2924 * to ensure that we report the mouse has truly exited the hitarea. 2925 * https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L336 2926 * 2927 * We add/subtract 10000 to account for when the graphic goes beyond the canvas bound 2928 * due to for example, a fit: 'cover'. Not perfect, but helps reliably (for now) ensure 2929 * we report going out of bounds when the mouse is out of the canvas 2930 */ 2931 case "mouseout": 2932 for (var me = 0, $e = ue; me < $e.length; me++) { 2933 var Ve = $e[me]; 2934 Ve.pointerMove(he, Le); 2935 } 2936 break; 2937 // Pointer moving/hovering on the canvas 2938 case "touchmove": 2939 case "mouseover": 2940 case "mousemove": { 2941 for (var Ge = 0, Ne = ue; Ge < Ne.length; Ge++) { 2942 var Ve = Ne[Ge]; 2943 Ve.pointerMove(he, Le); 2944 } 2945 break; 2946 } 2947 // Pointer click initiated but not released yet on the canvas 2948 case "touchstart": 2949 case "mousedown": { 2950 for (var Ue = 0, le = ue; Ue < le.length; Ue++) { 2951 var Ve = le[Ue]; 2952 Ve.pointerDown(he, Le); 2953 } 2954 break; 2955 } 2956 // Pointer click released on the canvas 2957 case "touchend": 2958 case "mouseup": { 2959 for (var Pe = 0, ze = ue; Pe < ze.length; Pe++) { 2960 var Ve = ze[Pe]; 2961 Ve.pointerUp(he, Le); 2962 } 2963 break; 2964 } 2965 } 2966 } 2967 }, R = h.bind(K); 2968 return a.addEventListener("mouseover", R), a.addEventListener("mouseout", R), a.addEventListener("mousemove", R), a.addEventListener("mousedown", R), a.addEventListener("mouseup", R), a.addEventListener("touchmove", R, { 2969 passive: Ie 2970 }), a.addEventListener("touchstart", R, { 2971 passive: Ie 2972 }), a.addEventListener("touchend", R), function() { 2973 a.removeEventListener("mouseover", R), a.removeEventListener("mouseout", R), a.removeEventListener("mousemove", R), a.removeEventListener("mousedown", R), a.removeEventListener("mouseup", R), a.removeEventListener("touchmove", R), a.removeEventListener("touchstart", R), a.removeEventListener("touchend", R); 2974 }; 2975 }; 2976 }), 2977 /* 7 */ 2978 /***/ 2979 ((N, F, k) => { 2980 k.r(F), k.d(F, { 2981 /* harmony export */ 2982 BLANK_URL: () => ( 2983 /* binding */ 2984 _ 2985 ), 2986 /* harmony export */ 2987 sanitizeUrl: () => ( 2988 /* binding */ 2989 oe 2990 ) 2991 /* harmony export */ 2992 }); 2993 var K = /^([^\w]*)(javascript|data|vbscript)/im, J = /&#(\w+)(^\w|;)?/g, ie = /&(newline|tab);/gi, Z = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, a = /^.+(:|:)/gim, M = [".", "/"], _ = "about:blank"; 2994 function ue(fe) { 2995 return M.indexOf(fe[0]) > -1; 2996 } 2997 function q(fe) { 2998 var de = fe.replace(Z, ""); 2999 return de.replace(J, function(ye, Ie) { 3000 return String.fromCharCode(Ie); 3001 }); 3002 } 3003 function oe(fe) { 3004 if (!fe) 3005 return _; 3006 var de = q(fe).replace(ie, "").replace(Z, "").trim(); 3007 if (!de) 3008 return _; 3009 if (ue(de)) 3010 return de; 3011 var ye = de.match(a); 3012 if (!ye) 3013 return de; 3014 var Ie = ye[0]; 3015 return K.test(Ie) ? _ : de; 3016 } 3017 }), 3018 /* 8 */ 3019 /***/ 3020 ((N, F, k) => { 3021 k.r(F), k.d(F, { 3022 /* harmony export */ 3023 AudioAssetWrapper: () => ( 3024 /* binding */ 3025 fe 3026 ), 3027 /* harmony export */ 3028 AudioWrapper: () => ( 3029 /* binding */ 3030 M 3031 ), 3032 /* harmony export */ 3033 CustomFileAssetLoaderWrapper: () => ( 3034 /* binding */ 3035 ue 3036 ), 3037 /* harmony export */ 3038 FileAssetWrapper: () => ( 3039 /* binding */ 3040 q 3041 ), 3042 /* harmony export */ 3043 FileFinalizer: () => ( 3044 /* binding */ 3045 J 3046 ), 3047 /* harmony export */ 3048 FontAssetWrapper: () => ( 3049 /* binding */ 3050 de 3051 ), 3052 /* harmony export */ 3053 FontWrapper: () => ( 3054 /* binding */ 3055 _ 3056 ), 3057 /* harmony export */ 3058 ImageAssetWrapper: () => ( 3059 /* binding */ 3060 oe 3061 ), 3062 /* harmony export */ 3063 ImageWrapper: () => ( 3064 /* binding */ 3065 a 3066 ), 3067 /* harmony export */ 3068 createFinalization: () => ( 3069 /* binding */ 3070 je 3071 ), 3072 /* harmony export */ 3073 finalizationRegistry: () => ( 3074 /* binding */ 3075 be 3076 ) 3077 /* harmony export */ 3078 }); 3079 var K = /* @__PURE__ */ (function() { 3080 var z = function($, h) { 3081 return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(R, I) { 3082 R.__proto__ = I; 3083 } || function(R, I) { 3084 for (var b in I) Object.prototype.hasOwnProperty.call(I, b) && (R[b] = I[b]); 3085 }, z($, h); 3086 }; 3087 return function($, h) { 3088 if (typeof h != "function" && h !== null) 3089 throw new TypeError("Class extends value " + String(h) + " is not a constructor or null"); 3090 z($, h); 3091 function R() { 3092 this.constructor = $; 3093 } 3094 $.prototype = h === null ? Object.create(h) : (R.prototype = h.prototype, new R()); 3095 }; 3096 })(), J = ( 3097 /** @class */ 3098 (function() { 3099 function z($) { 3100 this.selfUnref = !1, this._file = $; 3101 } 3102 return z.prototype.unref = function() { 3103 this._file && this._file.unref(); 3104 }, z; 3105 })() 3106 ), ie = ( 3107 /** @class */ 3108 (function() { 3109 function z($) { 3110 this._finalizableObject = $; 3111 } 3112 return z.prototype.unref = function() { 3113 this._finalizableObject.unref(); 3114 }, z; 3115 })() 3116 ), Z = ( 3117 /** @class */ 3118 (function() { 3119 function z() { 3120 this.selfUnref = !1; 3121 } 3122 return z.prototype.unref = function() { 3123 }, z; 3124 })() 3125 ), a = ( 3126 /** @class */ 3127 (function(z) { 3128 K($, z); 3129 function $(h) { 3130 var R = z.call(this) || this; 3131 return R._nativeImage = h, R; 3132 }
3133 return Object.defineProperty($.prototype, "nativeImage", { 3134 get: function() { 3135 return this._nativeImage; 3136 }, 3137 enumerable: !1, 3138 configurable: !0 3139 }), $.prototype.unref = function() { 3140 this.selfUnref && this._nativeImage.unref(); 3141 }, $; 3142 })(Z) 3143 ), M = ( 3144 /** @class */ 3145 (function(z) { 3146 K($, z); 3147 function $(h) { 3148 var R = z.call(this) || this; 3149 return R._nativeAudio = h, R; 3150 } 3151 return Object.defineProperty($.prototype, "nativeAudio", { 3152 get: function() { 3153 return this._nativeAudio; 3154 }, 3155 enumerable: !1, 3156 configurable: !0 3157 }), $.prototype.unref = function() { 3158 this.selfUnref && this._nativeAudio.unref(); 3159 }, $; 3160 })(Z) 3161 ), _ = ( 3162 /** @class */ 3163 (function(z) { 3164 K($, z); 3165 function $(h) { 3166 var R = z.call(this) || this; 3167 return R._nativeFont = h, R; 3168 } 3169 return Object.defineProperty($.prototype, "nativeFont", { 3170 get: function() { 3171 return this._nativeFont; 3172 }, 3173 enumerable: !1, 3174 configurable: !0 3175 }), $.prototype.unref = function() { 3176 this.selfUnref && this._nativeFont.unref(); 3177 }, $; 3178 })(Z) 3179 ), ue = ( 3180 /** @class */ 3181 (function() { 3182 function z($, h) { 3183 this._assetLoaderCallback = h, this.assetLoader = new $.CustomFileAssetLoader({ 3184 loadContents: this.loadContents.bind(this) 3185 }); 3186 } 3187 return z.prototype.loadContents = function($, h) { 3188 var R; 3189 return $.isImage ? R = new oe($) : $.isAudio ? R = new fe($) : $.isFont && (R = new de($)), this._assetLoaderCallback(R, h); 3190 }, z; 3191 })() 3192 ), q = ( 3193 /** @class */ 3194 (function() { 3195 function z($) { 3196 this._nativeFileAsset = $; 3197 } 3198 return z.prototype.decode = function($) { 3199 this._nativeFileAsset.decode($); 3200 }, Object.defineProperty(z.prototype, "name", { 3201 get: function() { 3202 return this._nativeFileAsset.name; 3203 }, 3204 enumerable: !1, 3205 configurable: !0 3206 }), Object.defineProperty(z.prototype, "fileExtension", { 3207 get: function() { 3208 return this._nativeFileAsset.fileExtension; 3209 }, 3210 enumerable: !1, 3211 configurable: !0 3212 }), Object.defineProperty(z.prototype, "uniqueFilename", { 3213 get: function() { 3214 return this._nativeFileAsset.uniqueFilename; 3215 }, 3216 enumerable: !1, 3217 configurable: !0 3218 }), Object.defineProperty(z.prototype, "isAudio", { 3219 get: function() { 3220 return this._nativeFileAsset.isAudio; 3221 }, 3222 enumerable: !1, 3223 configurable: !0 3224 }), Object.defineProperty(z.prototype, "isImage", { 3225 get: function() { 3226 return this._nativeFileAsset.isImage; 3227 }, 3228 enumerable: !1, 3229 configurable: !0 3230 }), Object.defineProperty(z.prototype, "isFont", { 3231 get: function() { 3232 return this._nativeFileAsset.isFont; 3233 }, 3234 enumerable: !1, 3235 configurable: !0 3236 }), Object.defineProperty(z.prototype, "cdnUuid", { 3237 get: function() { 3238 return this._nativeFileAsset.cdnUuid; 3239 }, 3240 enumerable: !1, 3241 configurable: !0 3242 }
3242), Object.defineProperty(z.prototype, "nativeFileAsset", { 3243 get: function() { 3244 return this._nativeFileAsset; 3245 }, 3246 enumerable: !1, 3247 configurable: !0 3248 }), z; 3249 })() 3250 ), oe = ( 3251 /** @class */ 3252 (function(z) { 3253 K($, z); 3254 function $() { 3255 return z !== null && z.apply(this, arguments) || this; 3256 } 3257 return $.prototype.setRenderImage = function(h) { 3258 this._nativeFileAsset.setRenderImage(h.nativeImage); 3259 }, $; 3260 })(q) 3261 ), fe = ( 3262 /** @class */ 3263 (function(z) { 3264 K($, z); 3265 function $() { 3266 return z !== null && z.apply(this, arguments) || this; 3267 } 3268 return $.prototype.setAudioSource = function(h) { 3269 this._nativeFileAsset.setAudioSource(h.nativeAudio); 3270 }, $; 3271 })(q) 3272 ), de = ( 3273 /** @class */ 3274 (function(z) { 3275 K($, z); 3276 function $() { 3277 return z !== null && z.apply(this, arguments) || this; 3278 } 3279 return $.prototype.setFont = function(h) { 3280 this._nativeFileAsset.setFont(h.nativeFont); 3281 }, $; 3282 })(q) 3283 ), ye = ( 3284 /** @class */ 3285 (function() { 3286 function z($) { 3287 } 3288 return z.prototype.register = function($) { 3289 $.selfUnref = !0; 3290 }, z.prototype.unregister = function($) { 3291 }, z; 3292 })() 3293 ), Ie = typeof FinalizationRegistry < "u" ? FinalizationRegistry : ye, be = new Ie(function(z) { 3294 z?.unref(); 3295 }), je = function(z, $) { 3296 var h = new ie($); 3297 be.register(z, h); 3298 }; 3299 }) 3300 /******/ 3301 ], P = {}; 3302 function V(N) { 3303 var F = P[N]; 3304 if (F !== void 0) 3305 return F.exports; 3306 var k = P[N] = { 3307 /******/ 3308 // no module.id needed 3309 /******/ 3310 // no module.loaded needed 3311 /******/ 3312 exports: {} 3313 /******/ 3314 }; 3315 return C[N](k, k.exports, V), k.exports; 3316 } 3317 V.d = (N, F) => { 3318 for (var k in F) 3319 V.o(F, k) && !V.o(N, k) && Object.defineProperty(N, k, { enumerable: !0, get: F[k] }); 3320 }, V.o = (N, F) => Object.prototype.hasOwnProperty.call(N, F), V.r = (N) => { 3321 typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(N, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(N, "__esModule", { value: !0 }); 3322 }; 3323 var Q = {}; 3324 return (() => { 3325 V.r(Q), V.d(Q, { 3326 /* harmony export */ 3327 Alignment: () => ( 3328 /* binding */ 3329 oe 3330 ), 3331 /* harmony export */ 3332 DataEnum: () => ( 3333 /* binding */ 3334 Le 3335 ), 3336 /* harmony export */ 3337 EventType: () => ( 3338 /* binding */ 3339 h 3340 ), 3341 /* harmony export */ 3342 Fit: () => ( 3343 /* binding */ 3344 q 3345 ), 3346 /* harmony export */ 3347 Layout: () => ( 3348 /* binding */ 3349 fe 3350 ), 3351 /* harmony export */ 3352 LoopType: () => ( 3353 /* binding */ 3354 R 3355 ), 3356 /* harmony export */ 3357 Rive: () => ( 3358 /* binding */ 3359 se 3360 ), 3361 /* harmony export */ 3362 RiveEventType: () => ( 3363 /* binding */ 3364 be 3365 ), 3366 /* harmony export */ 3367 RiveFile: () => ( 3368 /* binding */ 3369 ge 3370 ), 3371 /* harmony export */ 3372 RuntimeLoader: () => ( 3373 /* binding */ 3374 de 3375 ), 3376 /* harmony export */ 3377 StateMachineInput: () => ( 3378 /* binding */ 3379 Ie 3380 ), 3381 /* harmony export */ 3382 StateMachineInputType: () => ( 3383 /* binding */ 3384 ye 3385 ), 3386 /* harmony export */ 3387 Testing: () => ( 3388 /* binding */ 3389 Zt 3390 ), 3391 /* harmony export */ 3392 ViewModel: () => ( 3393 /* binding */ 3394 he 3395 ), 3396 /* harmony export */ 3397 ViewModelInstance: () => ( 3398 /* binding */ 3399 $e 3400 ), 3401 /* harmony export */ 3402 ViewModelInstanceArtboard: () => ( 3403 /* binding */ 3404 st 3405 ), 3406 /* harmony export */ 3407 ViewModelInstanceAssetImage: () => ( 3408 /* binding */ 3409 wt 3410 ), 3411 /* harmony export */ 3412 ViewModelInstanceBoolean: () => ( 3413 /* binding */ 3414 Ue 3415 ), 3416 /* harmony export */ 3417 ViewModelInstanceColor: () => ( 3418 /* binding */ 3419 We 3420 ), 3421 /* harmony export */ 3422 ViewModelInstanceEnum: () => ( 3423 /* binding */ 3424 Pe 3425 ), 3426 /* harmony export */ 3427 ViewModelInstanceList: () => ( 3428 /* binding */ 3429 ze 3430 ), 3431 /* harmony export */ 3432 ViewModelInstanceNumber: () => ( 3433 /* binding */ 3434 Ne 3435 ), 3436 /* harmony export */ 3437 ViewModelInstanceString: () => ( 3438 /* binding */ 3439 Ge 3440 ), 3441 /* harmony export */ 3442 ViewModelInstanceTrigger: () => ( 3443 /* binding */ 3444 le 3445 ), 3446 /* harmony export */ 3447 ViewModelInstanceValue: () => ( 3448 /* binding */ 3449 Ve 3450 ), 3451 /* harmony export */ 3452 decodeAudio: () => ( 3453 /* binding */ 3454 Jt 3455 ), 3456 /* harmony export */ 3457 decodeFont: () => ( 3458 /* binding */ 3459 ut 3460 ), 3461 /* harmony export */ 3462 decodeImage: () => ( 3463 /* binding */ 3464 on 3465 ) 3466 /* harmony export */ 3467 }); 3468 var N = V(1), F = V(2), k = V(3), K = V(5), J = /* @__PURE__ */ (function() { 3469 var s = function(n, i) { 3470 return s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, m) { 3471 c.__proto__ = m; 3472 } || function(c, m) { 3473 for (var A in m) Object.prototype.hasOwnProperty.call(m, A) && (c[A] = m[A]); 3474 }, s(n, i); 3475 }; 3476 return function(n, i) { 3477 if (typeof i != "function" && i !== null) 3478 throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); 3479 s(n, i); 3480 function c() { 3481 this.constructor = n; 3482 } 3483 n.prototype = i === null ? Object.create(i) : (c.prototype = i.prototype, new c()); 3484 }; 3485 })(), ie = function() { 3486 return ie = Object.assign || function(s) { 3487 for (var n, i = 1, c = arguments.length; i < c; i++) { 3488 n = arguments[i]; 3489 for (var m in n) Object.prototype.hasOwnProperty.call(n, m) && (s[m] = n[m]); 3490 } 3491 return s; 3492 }, ie.apply(this, arguments); 3493 }, Z = function(s, n, i, c) { 3494 function m(A) { 3495 return A instanceof i ? A : new i(function(O) { 3496 O(A); 3497 }); 3498 } 3499 return new (i || (i = Promise))(function(A, O) { 3500 function ce(xe) { 3501 try { 3502 re(c.next(xe)); 3503 } catch (Fe) { 3504 O(Fe); 3505 } 3506 } 3507 function ve(xe) { 3508 try { 3509 re(c.throw(xe)); 3510 } catch (Fe) { 3511 O(Fe); 3512 } 3513 } 3514 function re(xe) { 3515 xe.done ? A(xe.value) : m(xe.value).then(ce, ve); 3516 } 3517 re((c = c.apply(s, n || [])).next()); 3518 }); 3519 }, a = function(s, n) { 3520 var i = { label: 0, sent: function() { 3521 if (A[0] & 1) throw A[1]; 3522 return A[1]; 3523 }, trys: [], ops: [] }, c, m, A, O = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype); 3524 return O.next = ce(0), O.throw = ce(1), O.return = ce(2), typeof Symbol == "function" && (O[Symbol.iterator] = function() { 3525 return this; 3526 }), O; 3527 function ce(re) { 3528 return function(xe) { 3529 return ve([re, xe]); 3530 }; 3531 } 3532 function ve(re) { 3533 if (c) throw new TypeError("Generator is already executing."); 3534 for (; O && (O = 0, re[0] && (i = 0)), i; ) try { 3535 if (c = 1, m && (A = re[0] & 2 ? m.return : re[0] ? m.throw || ((A = m.return) && A.call(m), 0) : m.next) && !(A = A.call(m, re[1])
3535).done) return A; 3536 switch (m = 0, A && (re = [re[0] & 2, A.value]), re[0]) { 3537 case 0: 3538 case 1: 3539 A = re; 3540 break; 3541 case 4: 3542 return i.label++, { value: re[1], done: !1 }; 3543 case 5: 3544 i.label++, m = re[1], re = [0]; 3545 continue; 3546 case 7: 3547 re = i.ops.pop(), i.trys.pop(); 3548 continue; 3549 default: 3550 if (A = i.trys, !(A = A.length > 0 && A[A.length - 1]) && (re[0] === 6 || re[0] === 2)) { 3551 i = 0; 3552 continue; 3553 } 3554 if (re[0] === 3 && (!A || re[1] > A[0] && re[1] < A[3])) { 3555 i.label = re[1]; 3556 break; 3557 } 3558 if (re[0] === 6 && i.label < A[1]) { 3559 i.label = A[1], A = re; 3560 break; 3561 } 3562 if (A && i.label < A[2]) { 3563 i.label = A[2], i.ops.push(re); 3564 break; 3565 } 3566 A[2] && i.ops.pop(), i.trys.pop(); 3567 continue; 3568 } 3569 re = n.call(s, i); 3570 } catch (xe) { 3571 re = [6, xe], m = 0; 3572 } finally { 3573 c = A = 0; 3574 } 3575 if (re[0] & 5) throw re[1]; 3576 return { value: re[0] ? re[1] : void 0, done: !0 }; 3577 } 3578 }, M = function(s, n, i) { 3579 if (i || arguments.length === 2) for (var c = 0, m = n.length, A; c < m; c++) 3580 (A || !(c in n)) && (A || (A = Array.prototype.slice.call(n, 0, c)), A[c] = n[c]); 3581 return s.concat(A || Array.prototype.slice.call(n)); 3582 }, _ = ( 3583 /** @class */ 3584 (function(s) { 3585 J(n, s); 3586 function n() { 3587 var i = s !== null && s.apply(this, arguments) || this; 3588 return i.isHandledError = !0, i; 3589 } 3590 return n; 3591 })(Error) 3592 ), ue = function(s) { 3593 return s && s.isHandledError ? s.message : "Problem loading file; may be corrupt!"; 3594 }, q; 3595 (function(s) { 3596 s.Cover = "cover", s.Contain = "contain", s.Fill = "fill", s.FitWidth = "fitWidth", s.FitHeight = "fitHeight", s.None = "none", s.ScaleDown = "scaleDown", s.Layout = "layout"; 3597 })(q || (q = {})); 3598 var oe; 3599 (function(s) { 3600 s.Center = "center", s.TopLeft = "topLeft", s.TopCenter = "topCenter", s.TopRight = "topRight", s.CenterLeft = "centerLeft", s.CenterRight = "centerRight", s.BottomLeft = "bottomLeft", s.BottomCenter = "bottomCenter", s.BottomRight = "bottomRight"; 3601 })(oe || (oe = {})); 3602 var fe = ( 3603 /** @class */ 3604 (function() { 3605 function s(n) { 3606 var i, c, m, A, O, ce, ve; 3607 this.fit = (i = n?.fit) !== null && i !== void 0 ? i : q.Contain, this.alignment = (c = n?.alignment) !== null && c !== void 0 ? c : oe.Center, this.layoutScaleFactor = (m = n?.layoutScaleFactor) !== null && m !== void 0 ? m : 1, this.minX = (A = n?.minX) !== null && A !== void 0 ? A : 0, this.minY = (O = n?.minY) !== null && O !== void 0 ? O : 0, this.maxX = (ce = n?.maxX) !== null && ce !== void 0 ? ce : 0, this.maxY = (ve = n?.maxY) !== null && ve !== void 0 ? ve : 0; 3608 } 3609 return s.new = function(n) { 3610 var i = n.fit, c = n.alignment, m = n.minX, A = n.minY, O = n.maxX, ce = n.maxY; 3611 return console.warn("This function is deprecated: please use `new Layout({})` instead"), new s({ fit: i, alignment: c, minX: m, minY: A, maxX: O, maxY: ce }); 3612 }, s.prototype.copyWith = function(n) { 3613 var i = n.fit, c = n.alignment, m = n.layoutScaleFactor, A = n.minX, O = n.minY, ce = n.maxX, ve = n.maxY; 3614 return new s({ 3615 fit: i ?? this.fit, 3616 alignment: c ?? this.alignment, 3617 layoutScaleFactor: m ?? this.layoutScaleFactor, 3618 minX: A ?? this.minX, 3619 minY: O ?? this.minY, 3620 maxX: ce ?? this.maxX, 3621 maxY: ve ?? this.maxY 3622 }); 3623 }, s.prototype.runtimeFit = function(n) { 3624 if (this.cachedRuntimeFit) 3625 return this.cachedRuntimeFit; 3626 var i; 3627 return this.fit === q.Cover ? i = n.Fit.cover : this.fit === q.Contain ? i = n.Fit.contain : this.fit === q.Fill ? i = n.Fit.fill : this.fit === q.FitWidth ? i = n.Fit.fitWidth : this.fit === q.FitHeight ? i = n.Fit.fitHeight : this.fit === q.ScaleDown ? i = n.Fit.scaleDown : this.fit === q.Layout ? i = n.Fit.layout : i = n.Fit.none, this.cachedRuntimeFit = i, i; 3628 }, s.prototype.runtimeAlignment = function(n) { 3629 if (this.cachedRuntimeAlignment) 3630 return this.cachedRuntimeAlignment; 3631 var i; 3632 return this.alignment === oe.TopLeft ? i = n.Alignment.topLeft : this.alignment === oe.TopCenter ? i = n.Alignment.topCenter : this.alignment === oe.TopRight ? i = n.Alignment.topRight : this.alignment === oe.CenterLeft ? i = n.Alignment.centerLeft : this.alignment === oe.CenterRight ? i = n.Alignment.centerRight : this.alignment === oe.BottomLeft ? i = n.Alignment.bottomLeft : this.alignment === oe.BottomCenter ? i = n.Alignment.bottomCenter : this.alignment === oe.BottomRight ? i = n.Alignment.bottomRight : i = n.Alignment.center, this.cachedRuntimeAlignment = i, i; 3633 }, s; 3634 })() 3635 ), de = ( 3636 /** @class */ 3637 (function() { 3638 function s() { 3639 } 3640 return s.loadRuntime = function() { 3641 N.default({ 3642 // Loads Wasm bundle 3643 locateFile: function() { 3644 return s.wasmURL; 3645 } 3646 }).then(function(n) { 3647 var i; 3648 for (s.runtime = n; s.callBackQueue.length > 0; ) 3649 (i = s.callBackQueue.shift()) === null || i === void 0 || i(s.runtime); 3650 }).catch(function(n) { 3651 var i = { 3652 message: n?.message || "Unknown error", 3653 type: n?.name || "Error", 3654 // Some browsers may provide additional WebAssembly-specific details 3655 wasmError: n instanceof WebAssembly.CompileError || n instanceof WebAssembly.RuntimeError, 3656 originalError: n 3657 };
3658 console.debug("Rive WASM load error details:", i); 3659 var c = "https://cdn.jsdelivr.net/npm/".concat(F.name, "@").concat(F.version, "/rive_fallback.wasm"); 3660 if (s.wasmURL.toLowerCase() !== c) 3661 console.warn("Failed to load WASM from ".concat(s.wasmURL, " (").concat(i.message, "), trying jsdelivr as a backup")), s.setWasmUrl(c), s.loadRuntime(); 3662 else { 3663 var m = [ 3664 "Could not load Rive WASM file from ".concat(s.wasmURL, " or ").concat(c, "."), 3665 "Possible reasons:", 3666 "- Network connection is down", 3667 "- WebAssembly is not supported in this environment", 3668 "- The WASM file is corrupted or incompatible", 3669 ` 3670Error details:`, 3671 "- Type: ".concat(i.type), 3672 "- Message: ".concat(i.message), 3673 "- WebAssembly-specific error: ".concat(i.wasmError), 3674 ` 3675To resolve, you may need to:`, 3676 "1. Check your network connection", 3677 "2. Set a new WASM source via RuntimeLoader.setWasmUrl()", 3678 "3. Call RuntimeLoader.loadRuntime() again" 3679 ].join(` 3680`); 3681 console.error(m); 3682 } 3683 }); 3684 }, s.getInstance = function(n) { 3685 s.isLoading || (s.isLoading = !0, s.loadRuntime()), s.runtime ? n(s.runtime) : s.callBackQueue.push(n); 3686 }, s.awaitInstance = function() { 3687 return new Promise(function(n) { 3688 return s.getInstance(function(i) { 3689 return n(i); 3690 }); 3691 }); 3692 }, s.setWasmUrl = function(n) { 3693 s.wasmURL = n; 3694 }, s.getWasmUrl = function() { 3695 return s.wasmURL; 3696 }, s.isLoading = !1, s.callBackQueue = [], s.wasmURL = "https://unpkg.com/".concat(F.name, "@").concat(F.version, "/rive.wasm"), s; 3697 })() 3698 ), ye; 3699 (function(s) { 3700 s[s.Number = 56] = "Number", s[s.Trigger = 58] = "Trigger", s[s.Boolean = 59] = "Boolean"; 3701 })(ye || (ye = {})); 3702 var Ie = ( 3703 /** @class */ 3704 (function() { 3705 function s(n, i) { 3706 this.type = n, this.runtimeInput = i; 3707 } 3708 return Object.defineProperty(s.prototype, "name", { 3709 /** 3710 * Returns the name of the input 3711 */ 3712 get: function() { 3713 return this.runtimeInput.name; 3714 }, 3715 enumerable: !1, 3716 configurable: !0 3717 }), Object.defineProperty(s.prototype, "value", { 3718 /** 3719 * Returns the current value of the input 3720 */ 3721 get: function() { 3722 return this.runtimeInput.value; 3723 }, 3724 /** 3725 * Sets the value of the input 3726 */ 3727 set: function(n) { 3728 this.runtimeInput.value = n; 3729 }, 3730 enumerable: !1, 3731 configurable: !0 3732 }), s.prototype.fire = function() { 3733 this.type === ye.Trigger && this.runtimeInput.fire(); 3734 }, s.prototype.delete = function() { 3735 this.runtimeInput = null; 3736 }, s; 3737 })() 3738 ), be; 3739 (function(s) { 3740 s[s.General = 128] = "General", s[s.OpenUrl = 131] = "OpenUrl"; 3741 })(be || (be = {})); 3742 var je = ( 3743 /** @class */
3744 /* @__PURE__ */ (function() { 3745 function s(n) { 3746 this.nativeArtboard = n; 3747 } 3748 return s; 3749 })() 3750 ), z = ( 3751 /** @class */ 3752 (function() { 3753 function s(n, i, c, m) { 3754 this.stateMachine = n, this.playing = c, this.artboard = m, this.inputs = [], this.instance = new i.StateMachineInstance(n, m), this.initInputs(i); 3755 } 3756 return Object.defineProperty(s.prototype, "name", { 3757 get: function() { 3758 return this.stateMachine.name; 3759 }, 3760 enumerable: !1, 3761 configurable: !0 3762 }), Object.defineProperty(s.prototype, "statesChanged", { 3763 /** 3764 * Returns a list of state names that have changed on this frame 3765 */ 3766 get: function() { 3767 for (var n = [], i = 0; i < this.instance.stateChangedCount(); i++) 3768 n.push(this.instance.stateChangedNameByIndex(i)); 3769 return n; 3770 }, 3771 enumerable: !1, 3772 configurable: !0 3773 }), s.prototype.advance = function(n) { 3774 this.instance.advance(n); 3775 }, s.prototype.advanceAndApply = function(n) { 3776 this.instance.advanceAndApply(n); 3777 }, s.prototype.reportedEventCount = function() { 3778 return this.instance.reportedEventCount(); 3779 }, s.prototype.reportedEventAt = function(n) { 3780 return this.instance.reportedEventAt(n); 3781 }, s.prototype.initInputs = function(n) { 3782 for (var i = 0; i < this.instance.inputCount(); i++) { 3783 var c = this.instance.input(i); 3784 this.inputs.push(this.mapRuntimeInput(c, n)); 3785 } 3786 }, s.prototype.mapRuntimeInput = function(n, i) { 3787 if (n.type === i.SMIInput.bool) 3788 return new Ie(ye.Boolean, n.asBool()); 3789 if (n.type === i.SMIInput.number) 3790 return new Ie(ye.Number, n.asNumber()); 3791 if (n.type === i.SMIInput.trigger) 3792 return new Ie(ye.Trigger, n.asTrigger()); 3793 }, s.prototype.cleanup = function() { 3794 this.inputs.forEach(function(n) { 3795 n.delete(); 3796 }), this.inputs.length = 0, this.instance.delete(); 3797 }, s.prototype.bindViewModelInstance = function(n) { 3798 n.runtimeInstance != null && this.instance.bindViewModelInstance(n.runtimeInstance); 3799 }, s; 3800 })() 3801 ), $ = ( 3802 /** @class */ 3803 (function() { 3804 function s(n, i, c, m, A) { 3805 m === void 0 && (m = []), A === void 0 && (A = []), this.runtime = n, this.artboard = i, this.eventManager = c, this.animations = m, this.stateMachines = A; 3806 } 3807 return s.prototype.add = function(n, i, c) { 3808 if (c === void 0 && (c = !0), n = Ye(n), n.length === 0) 3809 this.animations.forEach(function(Be) { 3810 return Be.playing = i; 3811 }), this.stateMachines.forEach(function(Be) { 3812 return Be.playing = i; 3813 }); 3814 else 3815 for (var m = this.animations.map(function(Be) { 3816 return Be.name; 3817 }), A = this.stateMachines.map(function(Be) { 3818 return Be.name; 3819 }), O = 0; O < n.length; O++) { 3820 var ce = m.indexOf(n[O]), ve = A.indexOf(n[O]); 3821 if (ce >= 0 || ve >= 0) 3822 ce >= 0 ? this.animations[ce].playing = i : this.stateMachines[ve].playing = i; 3823 else { 3824 var re = this.artboard.animationByName(n[O]); 3825 if (re) { 3826 var xe = new k.Animation(re, this.artboard, this.runtime, i); 3827 xe.advance(0), xe.apply(1), this.animations.push(xe); 3828 } else { 3829 var Fe = this.artboard.stateMachineByName(n[O]); 3830 if (Fe) { 3831 var Xe = new z(Fe, this.runtime, i, this.artboard); 3832 this.stateMachines.push(Xe); 3833 } 3834 } 3835 } 3836 } 3837 return c && (i ? this.eventManager.fire({ 3838 type: h.Play, 3839 data: this.playing 3840 }) : this.eventManager.fire({ 3841 type: h.Pause, 3842 data: this.paused 3843 })), i ? this.playing : this.paused; 3844 }, s.prototype.initLinearAnimations = function(n, i) { 3845 for (var c = this.animations.map(function(ve) { 3846 return ve.name; 3847 }), m = 0; m < n.length; m++) { 3848 var A = c.indexOf(n[m]); 3849 if (A >= 0) 3850 this.animations[A].playing = i; 3851 else { 3852 var O = this.artboard.animationByName(n[m]); 3853 if (O) { 3854 var ce = new k.Animation(O, this.artboard, this.runtime, i); 3855 ce.advance(0), ce.apply(1), this.animations.push(ce); 3856 } else 3857 console.error("Animation with name ".concat(n[m], " not found.")); 3858 } 3859 } 3860 }, s.prototype.initStateMachines = function(n, i) { 3861 for (var c = this.stateMachines.map(function(ve) { 3862 return ve.name; 3863 }), m = 0; m < n.length; m++) { 3864 var A = c.indexOf(n[m]); 3865 if (A >= 0) 3866 this.stateMachines[A].playing = i; 3867 else { 3868 var O = this.artboard.stateMachineByName(n[m]); 3869 if (O) { 3870 var ce = new z(O, this.runtime, i, this.artboard); 3871 this.stateMachines.push(ce); 3872 } else 3873 console.warn("State Machine with name ".concat(n[m], " not found.")), this.initLinearAnimations([n[m]], i); 3874 } 3875 } 3876 }, s.prototype.play = function(n) { 3877 return this.add(n, !0); 3878 }, s.prototype.advanceIfPaused = function() {
3879 this.stateMachines.forEach(function(n) { 3880 n.playing || n.advanceAndApply(0); 3881 }); 3882 }, s.prototype.pause = function(n) { 3883 return this.add(n, !1); 3884 }, s.prototype.scrub = function(n, i) { 3885 var c = this.animations.filter(function(m) { 3886 return n.includes(m.name); 3887 }); 3888 return c.forEach(function(m) { 3889 return m.scrubTo = i; 3890 }), c.map(function(m) { 3891 return m.name; 3892 }); 3893 }, Object.defineProperty(s.prototype, "playing", { 3894 /** 3895 * Returns a list of names of all animations and state machines currently 3896 * playing 3897 */ 3898 get: function() { 3899 return this.animations.filter(function(n) { 3900 return n.playing; 3901 }).map(function(n) { 3902 return n.name; 3903 }).concat(this.stateMachines.filter(function(n) { 3904 return n.playing; 3905 }).map(function(n) { 3906 return n.name; 3907 })); 3908 }, 3909 enumerable: !1, 3910 configurable: !0 3911 }), Object.defineProperty(s.prototype, "paused", { 3912 /** 3913 * Returns a list of names of all animations and state machines currently 3914 * paused 3915 */ 3916 get: function() { 3917 return this.animations.filter(function(n) { 3918 return !n.playing; 3919 }).map(function(n) { 3920 return n.name; 3921 }).concat(this.stateMachines.filter(function(n) { 3922 return !n.playing; 3923 }).map(function(n) { 3924 return n.name; 3925 })); 3926 }, 3927 enumerable: !1, 3928 configurable: !0 3929 }), s.prototype.stop = function(n) { 3930 var i = this; 3931 n = Ye(n); 3932 var c = []; 3933 if (n.length === 0) 3934 c = this.animations.map(function(O) { 3935 return O.name; 3936 }).concat(this.stateMachines.map(function(O) { 3937 return O.name; 3938 })), this.animations.forEach(function(O) { 3939 return O.cleanup(); 3940 }), this.stateMachines.forEach(function(O) { 3941 return O.cleanup(); 3942 }), this.animations.splice(0, this.animations.length), this.stateMachines.splice(0, this.stateMachines.length); 3943 else { 3944 var m = this.animations.filter(function(O) { 3945 return n.includes(O.name); 3946 }); 3947 m.forEach(function(O) { 3948 O.cleanup(), i.animations.splice(i.animations.indexOf(O), 1); 3949 }); 3950 var A = this.stateMachines.filter(function(O) { 3951 return n.includes(O.name); 3952 }); 3953 A.forEach(function(O) { 3954 O.cleanup(), i.stateMachines.splice(i.stateMachines.indexOf(O), 1); 3955 }), c = m.map(function(O) { 3956 return O.name; 3957 }).concat(A.map(function(O) { 3958 return O.name; 3959 })); 3960 } 3961 return this.eventManager.fire({ 3962 type: h.Stop, 3963 data: c 3964 }), c; 3965 }, Object.defineProperty(s.prototype, "isPlaying", { 3966 /** 3967 * Returns true if at least one animation is active 3968 */ 3969 get: function() { 3970 return this.animations.reduce(function(n, i) { 3971 return n || i.playing; 3972 }, !1) || this.stateMachines.reduce(function(n, i) { 3973 return n || i.playing; 3974 }, !1); 3975 }, 3976 enumerable: !1, 3977 configurable: !0 3978 }), Object.defineProperty(s.prototype, "isPaused", { 3979 /** 3980 * Returns true if all animations are paused and there's at least one animation 3981 */ 3982 get: function() { 3983 return !this.isPlaying && (this.animations.length > 0 || this.stateMachines.length > 0); 3984 }, 3985 enumerable: !1, 3986 configurable: !0 3987 }), Object.defineProperty(s.prototype, "isStopped", { 3988 /** 3989 * Returns true if there are no playing or paused animations/state machines 3990 */ 3991 get: function() { 3992 return this.animations.length === 0 && this.stateMachines.length === 0; 3993 }, 3994 enumerable: !1, 3995 configurable: !0 3996 }), s.prototype.atLeastOne = function(n, i) { 3997 i === void 0 && (i = !0); 3998 var c; 3999 return this.animations.length === 0 && this.stateMachines.length === 0 && (this.artboard.animationCount() > 0 ? this.add([c = this.artboard.animationByIndex(0).name], n, i) : this.artboard.stateMachineCount() > 0 && this.add([c = this.artboard.stateMachineByIndex(0).name], n, i)), c; 4000 }, s.prototype.handleLooping = function() { 4001 for (var n = 0, i = this.animations.filter(function(m) { 4002 return m.playing; 4003 }); n < i.length; n++) { 4004 var c = i[n]; 4005 c.loopValue === 0 && c.loopCount ? (c.loopCount = 0, this.stop(c.name)) : c.loopValue === 1 && c.loopCount ? (this.eventManager.fire({ 4006 type: h.Loop, 4007 data: { animation: c.name, type: R.Loop } 4008 }), c.loopCount = 0) : c.loopValue === 2 && c.loopCount > 1 && (this.eventManager.fire({ 4009 type: h.Loop, 4010 data: { animation: c.name, type: R.PingPong } 4011 }), c.loopCount = 0); 4012 } 4013 }, s.prototype.handleStateChanges = function() { 4014 for (var n = [], i = 0, c = this.stateMachines.filter(function(A) { 4015 return A.playing; 4016 }); i < c.length; i++) { 4017 var m = c[i]; 4018 n.push.apply(n, m.statesChanged); 4019 } 4020 n.length > 0 && this.eventManager.fire({ 4021 type: h.StateChange, 4022 data: n 4023 }); 4024 }, s.prototype.handleAdvancing = function(n) { 4025 this.eventManager.fire({ 4026 type: h.Advance, 4027 data: n 4028 }); 4029 }, s; 4030 })() 4031 ), h; 4032 (function(s) { 4033 s.Load = "load", s.LoadError = "loaderror", s.Play = "play", s.Pause = "pause", s.Stop = "stop", s.Loop = "loop", s.Draw = "draw", s.Advance = "advance", s.StateChange = "statechange", s.RiveEvent = "riveevent", s.AudioStatusChange = "audiostatuschange"; 4034 })(h || (h = {})); 4035 var R; 4036 (function(s) { 4037 s.OneShot = "oneshot", s.Loop = "loop", s.PingPong = "pingpong"; 4038 })(R || (R = {})); 4039 var I = ( 4040 /** @class */ 4041 (function() { 4042 function s(n) { 4043 n === void 0 && (n = []), this.listeners = n; 4044 } 4045 return s.prototype.getListeners = function(n) { 4046 return this.listeners.filter(function(i) { 4047 return i.type === n; 4048 }); 4049 }, s.prototype.add = function(n) { 4050 this.listeners.includes(n) || this.listeners.push(n); 4051 }, s.prototype.remove = function(n) { 4052 for (var i = 0; i < this.listeners.length; i++) { 4053 var c = this.listeners[i];
4054 if (c.type === n.type && c.callback === n.callback) { 4055 this.listeners.splice(i, 1); 4056 break; 4057 } 4058 } 4059 }, s.prototype.removeAll = function(n) { 4060 var i = this; 4061 n ? this.listeners.filter(function(c) { 4062 return c.type === n; 4063 }).forEach(function(c) { 4064 return i.remove(c); 4065 }) : this.listeners.splice(0, this.listeners.length); 4066 }, s.prototype.fire = function(n) { 4067 var i = this.getListeners(n.type); 4068 i.forEach(function(c) { 4069 return c.callback(n); 4070 }); 4071 }, s; 4072 })() 4073 ), b = ( 4074 /** @class */ 4075 (function() { 4076 function s(n) { 4077 this.eventManager = n, this.queue = []; 4078 } 4079 return s.prototype.add = function(n) { 4080 this.queue.push(n); 4081 }, s.prototype.process = function() { 4082 for (; this.queue.length > 0; ) { 4083 var n = this.queue.shift(); 4084 n?.action && n.action(), n?.event && this.eventManager.fire(n.event); 4085 } 4086 }, s; 4087 })() 4088 ), w; 4089 (function(s) { 4090 s[s.AVAILABLE = 0] = "AVAILABLE", s[s.UNAVAILABLE = 1] = "UNAVAILABLE"; 4091 })(w || (w = {})); 4092 var B = ( 4093 /** @class */ 4094 (function(s) { 4095 J(n, s); 4096 function n() { 4097 var i = s !== null && s.apply(this, arguments) || this; 4098 return i._started = !1, i._enabled = !1, i._status = w.UNAVAILABLE, i; 4099 } 4100 return n.prototype.delay = function(i) { 4101 return Z(this, void 0, void 0, function() { 4102 return a(this, function(c) { 4103 return [2, new Promise(function(m) { 4104 return setTimeout(m, i); 4105 })]; 4106 }); 4107 }); 4108 }, n.prototype.timeout = function() { 4109 return Z(this, void 0, void 0, function() { 4110 return a(this, function(i) { 4111 return [2, new Promise(function(c, m) { 4112 return setTimeout(m, 50); 4113 })]; 4114 }); 4115 }); 4116 }, n.prototype.reportToListeners = function() { 4117 this.fire({ type: h.AudioStatusChange }), this.removeAll(); 4118 }, n.prototype.enableAudio = function() { 4119 return Z(this, void 0, void 0, function() { 4120 return a(this, function(i) { 4121 return this._enabled || (this._enabled = !0, this._status = w.AVAILABLE, this.reportToListeners()), [ 4122 2 4123 /*return*/ 4124 ]; 4125 }); 4126 }); 4127 }, n.prototype.testAudio = function() { 4128 return Z(this, void 0, void 0, function() { 4129 return a(this, function(i) { 4130 switch (i.label) { 4131 case 0: 4132 if (!(this._status === w.UNAVAILABLE && this._audioContext !== null)) return [3, 4]; 4133 i.label = 1; 4134 case 1: 4135 return i.trys.push([1, 3, , 4]), [4, Promise.race([this._audioContext.resume(), this.timeout()])]; 4136 case 2: 4137 return i.sent(), this.enableAudio(), [3, 4]; 4138 case 3: 4139 return i.sent(), [3, 4]; 4140 case 4: 4141 return [ 4142 2 4143 /*return*/ 4144 ]; 4145 } 4146 }); 4147 }); 4148 }, n.prototype._establishAudio = function() { 4149 return Z(this, void 0, void 0, function() { 4150 return a(this, function(i) { 4151 switch (i.label) { 4152 case 0: 4153 return this._started ? [3, 5] : (this._started = !0, typeof window > "u" ? (this.enableAudio(), [3, 5]) : [3, 1]); 4154 case 1: 4155 this._audioContext = new AudioContext(), this.listenForUserAction(), i.label = 2; 4156 case 2: 4157 return this._status !== w.UNAVAILABLE ? [3, 5] : [4, this.testAudio()]; 4158 case 3: 4159 return i.sent(), [4, this.delay(1e3)]; 4160 case 4: 4161 return i.sent(), [3, 2]; 4162 case 5: 4163 return [ 4164 2 4165 /*return*/ 4166 ]; 4167 } 4168 }); 4169 }); 4170 }, n.prototype.listenForUserAction = function() { 4171 var i = this, c = function() { 4172 return Z(i, void 0, void 0, function() { 4173 return a(this, function(m) { 4174 return this.enableAudio(), [ 4175 2 4176 /*return*/ 4177 ]; 4178 }); 4179 }); 4180 }; 4181 document.addEventListener("pointerdown", c, { 4182 once: !0 4183 }); 4184 }, n.prototype.establishAudio = function() { 4185 return Z(this, void 0, void 0, function() { 4186 return a(this, function(i) { 4187 return this._establishAudio(), [ 4188 2 4189 /*return*/ 4190 ]; 4191 }); 4192 }); 4193 }, Object.defineProperty(n.prototype, "systemVolume", { 4194 get: function() { 4195 return this._status === w.UNAVAILABLE ? (this.testAudio(), 0) : 1; 4196 }, 4197 enumerable: !1, 4198 configurable: !0 4199 }), Object.defineProperty(n.prototype, "status", { 4200 get: function() { 4201 return this._status; 4202 }, 4203 enumerable: !1, 4204 configurable: !0 4205 }), n; 4206 })(I) 4207 ), L = new B(), ne = ( 4208 /** @class */ 4209 (function() { 4210 function s() { 4211 } 4212 return s.prototype.observe = function() { 4213 }, s.prototype.unobserve = function() { 4214 }, s.prototype.disconnect = function() { 4215 }, s; 4216 })() 4217 ), T = globalThis.ResizeObserver || ne, Y = ( 4218 /** @class */ 4219 (function() { 4220 function s() { 4221 var n = this; 4222 this._elementsMap = /* @__PURE__ */ new Map(), this._onObservedEntry = function(i) { 4223 var c = n._elementsMap.get(i.target); 4224 c !== null ? c.onResize(i.target.clientWidth == 0 || i.target.clientHeight == 0) : n._resizeObserver.unobserve(i.target); 4225 }, this._onObserved = function(i) {
4226 i.forEach(n._onObservedEntry); 4227 }, this._resizeObserver = new T(this._onObserved); 4228 } 4229 return s.prototype.add = function(n, i) { 4230 var c = { 4231 onResize: i, 4232 element: n 4233 }; 4234 return this._elementsMap.set(n, c), this._resizeObserver.observe(n), c; 4235 }, s.prototype.remove = function(n) { 4236 this._resizeObserver.unobserve(n.element), this._elementsMap.delete(n.element); 4237 }, s; 4238 })() 4239 ), H = new Y(), ge = ( 4240 /** @class */ 4241 (function() { 4242 function s(n) { 4243 this.enableRiveAssetCDN = !0, this.referenceCount = 0, this.destroyed = !1, this.selfUnref = !1, this.src = n.src, this.buffer = n.buffer, n.assetLoader && (this.assetLoader = n.assetLoader), this.enableRiveAssetCDN = typeof n.enableRiveAssetCDN == "boolean" ? n.enableRiveAssetCDN : !0, this.eventManager = new I(), n.onLoad && this.on(h.Load, n.onLoad), n.onLoadError && this.on(h.LoadError, n.onLoadError); 4244 } 4245 return s.prototype.releaseFile = function() { 4246 var n; 4247 this.selfUnref && ((n = this.file) === null || n === void 0 || n.unref()), this.file = null; 4248 }, s.prototype.initData = function() { 4249 return Z(this, void 0, void 0, function() { 4250 var n, i, c, m, A; 4251 return a(this, function(O) { 4252 switch (O.label) { 4253 case 0: 4254 return this.src ? (n = this, [4, Kt(this.src)]) : [3, 2]; 4255 case 1: 4256 n.buffer = O.sent(), O.label = 2; 4257 case 2: 4258 return this.destroyed ? [ 4259 2 4260 /*return*/ 4261 ] : (this.assetLoader && (c = new K.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader), i = c.assetLoader), m = this, [4, this.runtime.load(new Uint8Array(this.buffer), i, this.enableRiveAssetCDN)]); 4262 case 3: 4263 return m.file = O.sent(), A = new K.FileFinalizer(this.file), K.finalizationRegistry.register(this, A), this.destroyed ? (this.releaseFile(), [ 4264 2 4265 /*return*/ 4266 ]) : (this.file !== null ? this.eventManager.fire({ 4267 type: h.Load, 4268 data: this 4269 }) : this.fireLoadError(s.fileLoadErrorMessage), [ 4270 2 4271 /*return*/ 4272 ]); 4273 } 4274 }); 4275 }); 4276 }, s.prototype.init = function() { 4277 return Z(this, void 0, void 0, function() { 4278 var n, i; 4279 return a(this, function(c) { 4280 switch (c.label) { 4281 case 0: 4282 if (!this.src && !this.buffer) 4283 return this.fireLoadError(s.missingErrorMessage), [ 4284 2 4285 /*return*/ 4286 ]; 4287 c.label = 1; 4288 case 1: 4289 return c.trys.push([1, 4, , 5]), n = this, [4, de.awaitInstance()]; 4290 case 2: 4291 return n.runtime = c.sent(), this.destroyed ? [ 4292 2 4293 /*return*/ 4294 ] : [4, this.initData()]; 4295 case 3: 4296 return c.sent(), [3, 5]; 4297 case 4: 4298 return i = c.sent(), this.fireLoadError(i instanceof Error ? i.message : s.fileLoadErrorMessage), [3, 5]; 4299 case 5: 4300 return [ 4301 2 4302 /*return*/ 4303 ]; 4304 } 4305 }); 4306 }); 4307 }, s.prototype.fireLoadError = function(n) { 4308 throw this.eventManager.fire({ 4309 type: h.LoadError, 4310 data: n 4311 }), new Error(n); 4312 }, s.prototype.on = function(n, i) { 4313 this.eventManager.add({ 4314 type: n, 4315 callback: i 4316 }); 4317 }, s.prototype.off = function(n, i) { 4318 this.eventManager.remove({ 4319 type: n, 4320 callback: i 4321 }); 4322 }, s.prototype.cleanup = function() { 4323 this.referenceCount -= 1, this.referenceCount <= 0 && (this.removeAllRiveEventListeners(), this.releaseFile(), this.destroyed = !0); 4324 }, s.prototype.removeAllRiveEventListeners = function(n) { 4325 this.eventManager.removeAll(n); 4326 }, s.prototype.getInstance = function() { 4327 if (this.file !== null) 4328 return this.referenceCount += 1, this.file; 4329 }, s.prototype.destroyIfUnused = function() { 4330 this.referenceCount <= 0 && this.cleanup(); 4331 }, s.prototype.getArtboard = function(n) { 4332 var i = this.file.artboardByName(n); 4333 return i != null ? new je(i) : null; 4334 }, s.missingErrorMessage = "Rive source file or data buffer required", s.fileLoadErrorMessage = "The file failed to load", s; 4335 })() 4336 ), se = ( 4337 /** @class */ 4338 (function() { 4339 function s(n) { 4340 var i = this, c; 4341 this.loaded = !1, this.destroyed = !1, this._observed = null, this.readyForPlaying = !1, this.artboard = null, this.eventCleanup = null, this.shouldDisableRiveListeners = !1, this.automaticallyHandleEvents = !1, this.enableRiveAssetCDN = !0, this._volume = 1, this._artboardWidth = void 0, this._artboardHeight = void 0, this._devicePixelRatioUsed = 1, this._hasZeroSize = !1, this._audioEventListener = null, this._boundDraw = null, this._viewModelInstance = null, this._dataEnums = null, this.durations = [], this.frameTimes = [], this.frameCount = 0, this.isTouchScrollEnabled = !1, this.onCanvasResize = function(m) { 4342 var A = i._hasZeroSize !== m; 4343 i._hasZeroSize = m, m ? (!i._layout.maxX || !i._layout.maxY) && i.resizeToCanvas() : A && i.resizeDrawingSurfaceToCanvas(); 4344 }, this.renderSecondTimer = 0, this._boundDraw = this.draw.bind(this), this.canvas = n.canvas, n.canvas.constructor === HTMLCanvasElement && (this._observed = H.add(this.canvas, this.onCanvasResize)), this.src = n.src, this.buffer = n.buffer, this.riveFile = n.riveFile, this.layout = (c = n.layout) !== null && c !== void 0 ? c : new fe(), this.shouldDisableRiveListeners = !!n.shouldDisableRiveListeners, this.isTouchScrollEnabled = !!n.isTouchScrollEnabled, this.automaticallyHandleEvents = !!n.automaticallyHandleEvents, this.enableRiveAssetCDN = n.enableRiveAssetCDN === void 0 ? !0 : n.enableRiveAssetCDN, this.eventManager = new I(), n.onLoad && this.on(h.Load, n.onLoad), n.onLoadError && this.on(h.LoadError, n.onLoadError), n.onPlay && this.on(h.Play, n.onPlay), n.onPause && this.on(h.Pause, n.onPause), n.onStop && this.on(h.Stop, n.onStop), n.onLoop && this.on(h.Loop, n.onLoop), n.onStateChange && this.on(h.StateChange, n.onStateChange), n.onAdvance && this.on(h.Advance, n.onAdvance), n.onload && !n.onLoad && this.on(h.Load, n.onload), n.onloaderror && !n.onLoadError && this.on(h.LoadError, n.onloaderror), n.onplay && !n.onPlay && this.on(h.Play, n.onplay), n.onpause && !n.onPause && this.on(h.Pause, n.onpause), n.onstop && !n.onStop && this.on(h.Stop, n.onstop), n.onloop && !n.onLoop && this.on(h.Loop, n.onloop), n.onstatechange && !n.onStateChange && this.on(h.StateChange, n.onstatechange), n.assetLoader && (this.assetLoader = n.assetLoader), this.taskQueue = new b(this.eventManager), this.init({ 4345 src: this.src, 4346 buffer: this.buffer, 4347 riveFile: this.riveFile, 4348 autoplay: n.autoplay, 4349 autoBind: n.autoBind, 4350 animations: n.animations, 4351 stateMachines: n.stateMachines, 4352 artboard: n.artboard, 4353 useOffscreenRenderer: n.useOffscreenRenderer 4354 }); 4355 } 4356 return Object.defineProperty(s.prototype, "viewModelCount", { 4357 get: function() { 4358 return this.file.viewModelCount(); 4359 }, 4360 enumerable: !1, 4361 configurable: !0 4362 }), s.new = function(n) { 4363 return console.warn("This function is deprecated: please use `new Rive({})` instead"), new s(n); 4364 }, s.prototype.onSystemAudioChanged = function() { 4365 this.volume = this._volume; 4366 }, s.prototype.init = function(n) { 4367 var i = this, c = n.src, m = n.buffer, A = n.riveFile, O = n.animations, ce = n.stateMachines, ve = n.artboard, re = n.autoplay, xe = re === void 0 ? !1 : re, Fe = n.useOffscreenRenderer, Xe = Fe === void 0 ? !1 : Fe, Be = n.autoBind, lt = Be === void 0 ? !1 : Be; 4368 if (!this.destroyed) { 4369 if (this.src = c, this.buffer = m, this.riveFile = A, !this.src && !this.buffer && !this.riveFile) 4370 throw new _(s.missingErrorMessage); 4371 var nt = Ye(O), Qe = Ye(ce); 4372 this.loaded = !1, this.readyForPlaying = !1, de.awaitInstance().then(function(et) { 4373 i.destroyed || (i.runtime = et, i.removeRiveListeners(), i.deleteRiveRen
4373derer(), i.renderer = i.runtime.makeRenderer(i.canvas, Xe), i.canvas.width || i.canvas.height || i.resizeDrawingSurfaceToCanvas(), i.initData(ve, nt, Qe, xe, lt).then(function(rt) { 4374 if (rt) 4375 return i.setupRiveListeners(); 4376 }).catch(function(rt) { 4377 console.error(rt); 4378 })); 4379 }).catch(function(et) { 4380 console.error(et); 4381 }); 4382 } 4383 }, s.prototype.setupRiveListeners = function(n) { 4384 var i = this; 4385 if (this.eventCleanup && this.eventCleanup(), !this.shouldDisableRiveListeners) { 4386 var c = (this.animator.stateMachines || []).filter(function(A) { 4387 return A.playing && i.runtime.hasListeners(A.instance); 4388 }).map(function(A) { 4389 return A.instance; 4390 }), m = this.isTouchScrollEnabled; 4391 n && "isTouchScrollEnabled" in n && (m = n.isTouchScrollEnabled), this.eventCleanup = (0, K.registerTouchInteractions)({ 4392 canvas: this.canvas, 4393 artboard: this.artboard, 4394 stateMachines: c, 4395 renderer: this.renderer, 4396 rive: this.runtime, 4397 fit: this._layout.runtimeFit(this.runtime), 4398 alignment: this._layout.runtimeAlignment(this.runtime), 4399 isTouchScrollEnabled: m, 4400 layoutScaleFactor: this._layout.layoutScaleFactor 4401 }); 4402 } 4403 }, s.prototype.removeRiveListeners = function() { 4404 this.eventCleanup && (this.eventCleanup(), this.eventCleanup = null); 4405 }, s.prototype.initializeAudio = function() { 4406 var n = this, i; 4407 L.status == w.UNAVAILABLE && !((i = this.artboard) === null || i === void 0) && i.hasAudio && this._audioEventListener === null && (this._audioEventListener = { 4408 type: h.AudioStatusChange, 4409 callback: function() { 4410 return n.onSystemAudioChanged(); 4411 } 4412 }, L.add(this._audioEventListener), L.establishAudio()); 4413 }, s.prototype.initArtboardSize = function() { 4414 this.artboard && (this._artboardWidth = this.artboard.width = this._artboardWidth || this.artboard.width, this._artboardHeight = this.artboard.height = this._artboardHeight || this.artboard.height); 4415 }, s.prototype.initData = function(n, i, c, m, A) { 4416 return Z(this, void 0, void 0, function() { 4417 var O, ce, ve, re; 4418 return a(this, function(xe) { 4419 switch (xe.label) { 4420 case 0: 4421 return xe.trys.push([0, 3, , 4]), this.riveFile != null ? [3, 2] : (O = new ge({ 4422 src: this.src, 4423 buffer: this.buffer, 4424 enableRiveAssetCDN: this.enableRiveAssetCDN, 4425 assetLoader: this.assetLoader 4426 }), this.riveFile = O, [4, O.init()]); 4427 case 1: 4428 if (xe.sent(), this.destroyed) 4429 return O.destroyIfUnused(), [2, !1]; 4430 xe.label = 2; 4431 case 2: 4432 return this.file = this.riveFile.getInstance(), this.initArtboard(n, i, c, m, A), this.initArtboardSize(), this.initializeAudio(), this.loaded = !0, this.eventManager.fire({ 4433 type: h.Load, 4434 data: (re = this.src) !== null && re !== void 0 ? re : "buffer" 4435 }), this.animator.advanceIfPaused(), this.readyForPlaying = !0, this.taskQueue.process(), this.drawFrame(), [2, !0]; 4436 case 3: 4437 return ce = xe.sent(), ve = ue(ce), console.warn(ve), this.eventManager.fire({ type: h.LoadError, data: ve }), [2, Promise.reject(ve)]; 4438 case 4: 4439 return [ 4440 2 4441 /*return*/ 4442 ]; 4443 } 4444 }); 4445 }); 4446 }, s.prototype.initArtboard = function(n, i, c, m, A) { 4447 if (this.file) { 4448 var O = n ? this.file.artboardByName(n) : this.file.defaultArtboard(); 4449 if (!O) { 4450 var ce = "Invalid artboard name or no default artboard"; 4451 console.warn(ce), this.eventManager.fire({ type: h.LoadError, data: ce }); 4452 return; 4453 } 4454 this.artboard = O, O.volume = this._volume * L.systemVolume, this.animator = new $(this.runtime, this.artboard, this.eventManager); 4455 var ve; 4456 if (i.length > 0 || c.length > 0 ? (ve = i.concat(c), this.animator.initLinearAnimations(i, m), this.animator.initStateMachines(c, m)) : ve = [this.animator.atLeastOne(m, !1)], this.taskQueue.add({ 4457 event: {
4458 type: m ? h.Play : h.Pause, 4459 data: ve 4460 } 4461 }), A) { 4462 var re = this.file.defaultArtboardViewModel(O); 4463 if (re !== null) { 4464 var xe = re.defaultInstance(); 4465 if (xe !== null) { 4466 var Fe = new $e(xe, null); 4467 this.bindViewModelInstance(Fe); 4468 } 4469 } 4470 } 4471 } 4472 }, s.prototype.drawFrame = function() { 4473 var n, i; 4474 !((n = document?.timeline) === null || n === void 0) && n.currentTime ? this.loaded && this.artboard && !this.frameRequestId && (this._boundDraw(document.timeline.currentTime), (i = this.runtime) === null || i === void 0 || i.resolveAnimationFrame()) : this.startRendering(); 4475 }, s.prototype.draw = function(n, i) { 4476 var c; 4477 this.frameRequestId = null; 4478 var m = performance.now(); 4479 this.lastRenderTime || (this.lastRenderTime = n), this.renderSecondTimer += n - this.lastRenderTime, this.renderSecondTimer > 5e3 && (this.renderSecondTimer = 0, i?.()); 4480 var A = (n - this.lastRenderTime) / 1e3; 4481 this.lastRenderTime = n; 4482 for (var O = this.animator.animations.filter(function(mt) { 4483 return mt.playing || mt.needsScrub; 4484 }).sort(function(mt) { 4485 return mt.needsScrub ? -1 : 1; 4486 }), ce = 0, ve = O; ce < ve.length; ce++) { 4487 var re = ve[ce]; 4488 re.advance(A), re.instance.didLoop && (re.loopCount += 1), re.apply(1); 4489 } 4490 for (var xe = this.animator.stateMachines.filter(function(mt) { 4491 return mt.playing; 4492 }), Fe = 0, Xe = xe; Fe < Xe.length; Fe++) { 4493 var Be = Xe[Fe], lt = Be.reportedEventCount(); 4494 if (lt) 4495 for (var nt = 0; nt < lt; nt++) { 4496 var Qe = Be.reportedEventAt(nt); 4497 if (Qe) 4498 if (Qe.type === be.OpenUrl) { 4499 if (this.eventManager.fire({ 4500 type: h.RiveEvent, 4501 data: Qe 4502 }), this.automaticallyHandleEvents) { 4503 var et = document.createElement("a"), rt = Qe, kt = rt.url, Lt = rt.target, pt = (0, K.sanitizeUrl)(kt); 4504 kt && et.setAttribute("href", pt), Lt && et.setAttribute("target", Lt), pt && pt !== K.BLANK_URL && et.click(); 4505 } 4506 } else 4507 this.eventManager.fire({ 4508 type: h.RiveEvent, 4509 data: Qe 4510 }); 4511 } 4512 Be.advanceAndApply(A); 4513 } 4514 this.animator.stateMachines.length == 0 && this.artboard.advance(A); 4515 var pe = this.renderer; 4516 pe.clear(), pe.save(), this.alignRenderer(), this._hasZeroSize || this.artboard.draw(pe), pe.restore(), pe.flush(), this.animator.handleLooping(), this.animator.handleStateChanges(), this.animator.handleAdvancing(A), this.frameCount++; 4517 var ke = performance.now(); 4518 for (this.frameTimes.push(ke), this.durations.push(ke - m); this.frameTimes[0] <= ke - 1e3; ) 4519 this.frameTimes.shift(), this.durations.shift(); 4520 (c = this._viewModelInstance) === null || c === void 0 || c.handleCallbacks(), this.animator.isPlaying ? this.startRendering() : this.animator.isPaused ? this.lastRenderTime = 0 : this.animator.isStopped && (this.lastRenderTime = 0); 4521 }, s.prototype.alignRenderer = function() { 4522 var n = this, i = n.renderer, c = n.runtime, m = n._layout, A = n.artboard; 4523 i.align(m.runtimeFit(c), m.runtimeAlignment(c), { 4524 minX: m.minX, 4525 minY: m.minY, 4526 maxX: m.maxX, 4527 maxY: m.maxY 4528 }, A.bounds, this._devicePixelRatioUsed * m.layoutScaleFactor); 4529 }, Object.defineProperty(s.prototype, "fps", { 4530 get: function() { 4531 return this.durations.length; 4532 }, 4533 enumerable: !1, 4534 configurable: !0 4535 }), Object.defineProperty(s.prototype, "frameTime", { 4536 get: function() { 4537 return this.durations.length === 0 ? 0 : (this.durations.reduce(function(n, i) { 4538 return n + i; 4539 }, 0) / this.durations.length).toFixed(4); 4540 }, 4541 enumerable: !1, 4542 configurable: !0 4543 }), s.prototype.cleanup = function() { 4544 var n, i; 4545 this.destroyed = !0, this.stopRendering(), this.cleanupInstances(), this._observed !== null && H.remove(this._observed), this.removeRiveListeners(), this.file && ((n = this.riveFile) === null || n === void 0 || n.cleanup(), this.file = null), this.riveFile = null, this.deleteRiveRen
4545derer(), this._audioEventListener !== null && (L.remove(this._audioEventListener), this._audioEventListener = null), (i = this._viewModelInstance) === null || i === void 0 || i.cleanup(), this._viewModelInstance = null, this._dataEnums = null; 4546 }, s.prototype.deleteRiveRenderer = function() { 4547 var n; 4548 (n = this.renderer) === null || n === void 0 || n.delete(), this.renderer = null; 4549 }, s.prototype.cleanupInstances = function() { 4550 this.eventCleanup !== null && this.eventCleanup(), this.stop(), this.artboard && (this.artboard.delete(), this.artboard = null); 4551 }, s.prototype.retrieveTextRun = function(n) { 4552 var i; 4553 if (!n) { 4554 console.warn("No text run name provided"); 4555 return; 4556 } 4557 if (!this.artboard) { 4558 console.warn("Tried to access text run, but the Artboard is null"); 4559 return; 4560 } 4561 var c = this.artboard.textRun(n); 4562 if (!c) { 4563 console.warn("Could not access a text run with name '".concat(n, "' in the '").concat((i = this.artboard) === null || i === void 0 ? void 0 : i.name, "' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime.")); 4564 return; 4565 } 4566 return c; 4567 }, s.prototype.getTextRunValue = function(n) { 4568 var i = this.retrieveTextRun(n); 4569 return i ? i.text : void 0; 4570 }, s.prototype.setTextRunValue = function(n, i) { 4571 var c = this.retrieveTextRun(n); 4572 c && (c.text = i); 4573 }, s.prototype.play = function(n, i) { 4574 var c = this; 4575 if (n = Ye(n), !this.readyForPlaying) { 4576 this.taskQueue.add({ 4577 action: function() { 4578 return c.play(n, i); 4579 } 4580 }); 4581 return; 4582 } 4583 this.animator.play(n), this.eventCleanup && this.eventCleanup(), this.setupRiveListeners(), this.startRendering(); 4584 }, s.prototype.pause = function(n) { 4585 var i = this; 4586 if (n = Ye(n), !this.readyForPlaying) { 4587 this.taskQueue.add({ 4588 action: function() { 4589 return i.pause(n); 4590 } 4591 }); 4592 return; 4593 } 4594 this.eventCleanup && this.eventCleanup(), this.animator.pause(n); 4595 }, s.prototype.scrub = function(n, i) { 4596 var c = this; 4597 if (n = Ye(n), !this.readyForPlaying) { 4598 this.taskQueue.add({ 4599 action: function() { 4600 return c.scrub(n, i); 4601 } 4602 }); 4603 return; 4604 } 4605 this.animator.scrub(n, i || 0), this.drawFrame(); 4606 }, s.prototype.stop = function(n) { 4607 var i = this; 4608 if (n = Ye(n), !this.readyForPlaying) { 4609 this.taskQueue.add({ 4610 action: function() { 4611 return i.stop(n); 4612 } 4613 }); 4614 return; 4615 } 4616 this.animator && this.animator.stop(n), this.eventCleanup && this.eventCleanup(); 4617 }, s.prototype.reset = function(n) { 4618 var i, c, m = n?.artboard, A = Ye(n?.animations), O = Ye(n?.stateMachines), ce = (i = n?.autoplay) !== null && i !== void 0 ? i : !1, ve = (c = n?.autoBind) !== null && c !== void 0 ? c : !1; 4619 this.cleanupInstances(), this.initArtboard(m, A, O, ce, ve), this.taskQueue.process(); 4620 }, s.prototype.load = function(n) { 4621 this.file = null, this.stop(), this.init(n); 4622 }, Object.defineProperty(s.prototype, "layout", { 4623 /** 4624 * Returns the current layout. Note that layout should be treated as 4625 * immutable. If you want to change the layout, create a new one use the 4626 * layout setter 4627 */ 4628 get: function() { 4629 return this._layout; 4630 }, 4631 // Sets a new layout 4632 set: function(n) { 4633 this._layout = n, (!n.maxX || !n.maxY) && this.resizeToCanvas(), this.loaded && !this.animator.isPlaying && this.drawFrame(); 4634 }, 4635 enumerable: !1, 4636 configurable: !0 4637 }), s.prototype.resizeToCanvas = function() { 4638 this._layout = this.layout.copyWith({ 4639 minX: 0, 4640 minY: 0, 4641 maxX: this.canvas.width, 4642 maxY: this.canvas.height 4643 }); 4644 }, s.prototype.resizeDrawingSurfaceToCanvas = function(n) { 4645 if (this.canvas instanceof HTMLCanvasElement && window) { 4646 var i = this.canvas.getBoundingClientRect(), c = i.width, m = i.height, A = n || window.devicePixelRatio || 1; 4647 if (this.devicePixelRatioUsed = A, this.canvas.width = A * c, this.canvas.height = A * m, this.resizeToCanvas(), this.drawFrame(), this.layout.fit === q.Layout) { 4648 var O = this._layout.layoutScaleFactor; 4649 this.artboard.width = c / O, this.artboard.height = m / O; 4650 } 4651 } 4652 }, Object.defineProperty(s.prototype, "source", { 4653 // Returns the animation source, which may be undefined 4654 get: function() { 4655 return this.src; 4656 }, 4657 enumerable: !1, 4658 configurable: !0 4659 }), Object.defineProperty(s.prototype, "activeArtboard", { 4660 /** 4661 * Returns the name of the active artboard 4662 */ 4663 get: function() { 4664 return this.artboard ? this.artboard.name : ""; 4665 }, 4666 enumerable: !1, 4667 configurable: !0 4668 }), Object.defineProperty(s.prototype, "animationNames", { 4669 // Returns a list of animation names on the chosen artboard 4670 get: function() { 4671 if (!this.loaded || !this.artboard) 4672 return []; 4673 for (var n = [], i = 0; i < this.artboard.animationCount(); i++) 4674 n.push(this.artboard.animationByIndex(i).name); 4675 return n; 4676 }, 4677 enumerable: !1, 4678 configurable: !0 4679 }), Object.defineProperty(s.prototype, "stateMachineNames", { 4680 /** 4681 * Returns a list of state machine names from the current artboard 4682 */ 4683 get: function() { 4684 if (!this.loaded || !this.artboard) 4685 return []; 4686 for (var n = [], i = 0; i < this.artboard.stateMachineCount(); i++) 4687 n.push(this.artboard.stateMachineByIndex(i).name); 4688 return n; 4689 }, 4690 enumerable: !1, 4691 configurable: !0 4692 }), s.prototype.stateMachineInputs = function(n) { 4693 if (this.loaded) { 4694 var i = this.animator.stateMachines.find(function(c) { 4695 return c.name === n; 4696 });
4697 return i?.inputs; 4698 } 4699 }, s.prototype.retrieveInputAtPath = function(n, i) { 4700 if (!n) { 4701 console.warn("No input name provided for path '".concat(i, "'")); 4702 return; 4703 } 4704 if (!this.artboard) { 4705 console.warn("Tried to access input: '".concat(n, "', at path: '").concat(i, "', but the Artboard is null")); 4706 return; 4707 } 4708 var c = this.artboard.inputByPath(n, i); 4709 if (!c) { 4710 console.warn("Could not access an input with name: '".concat(n, "', at path:'").concat(i, "'")); 4711 return; 4712 } 4713 return c; 4714 }, s.prototype.setBooleanStateAtPath = function(n, i, c) { 4715 var m = this.retrieveInputAtPath(n, c); 4716 m && (m.type === ye.Boolean ? m.asBool().value = i : console.warn("Input with name: '".concat(n, "', at path:'").concat(c, "' is not a boolean"))); 4717 }, s.prototype.setNumberStateAtPath = function(n, i, c) { 4718 var m = this.retrieveInputAtPath(n, c); 4719 m && (m.type === ye.Number ? m.asNumber().value = i : console.warn("Input with name: '".concat(n, "', at path:'").concat(c, "' is not a number"))); 4720 }, s.prototype.fireStateAtPath = function(n, i) { 4721 var c = this.retrieveInputAtPath(n, i); 4722 c && (c.type === ye.Trigger ? c.asTrigger().fire() : console.warn("Input with name: '".concat(n, "', at path:'").concat(i, "' is not a trigger"))); 4723 }, s.prototype.retrieveTextAtPath = function(n, i) { 4724 if (!n) { 4725 console.warn("No text name provided for path '".concat(i, "'")); 4726 return; 4727 } 4728 if (!i) { 4729 console.warn("No path provided for text '".concat(n, "'")); 4730 return; 4731 } 4732 if (!this.artboard) { 4733 console.warn("Tried to access text: '".concat(n, "', at path: '").concat(i, "', but the Artboard is null")); 4734 return; 4735 } 4736 var c = this.artboard.textByPath(n, i); 4737 if (!c) { 4738 console.warn("Could not access text with name: '".concat(n, "', at path:'").concat(i, "'")); 4739 return; 4740 } 4741 return c; 4742 }, s.prototype.getTextRunValueAtPath = function(n, i) { 4743 var c = this.retrieveTextAtPath(n, i); 4744 if (!c) { 4745 console.warn("Could not get text with name: '".concat(n, "', at path:'").concat(i, "'")); 4746 return; 4747 } 4748 return c.text; 4749 }, s.prototype.setTextRunValueAtPath = function(n, i, c) { 4750 var m = this.retrieveTextAtPath(n, c); 4751 if (!m) { 4752 console.warn("Could not set text with name: '".concat(n, "', at path:'").concat(c, "'")); 4753 return; 4754 } 4755 m.text = i; 4756 }, Object.defineProperty(s.prototype, "playingStateMachineNames", { 4757 // Returns a list of playing machine names 4758 get: function() { 4759 return this.loaded ? this.animator.stateMachines.filter(function(n) { 4760 return n.playing; 4761 }).map(function(n) { 4762 return n.name; 4763 }) : []; 4764 }, 4765 enumerable: !1, 4766 configurable: !0 4767 }), Object.defineProperty(s.prototype, "playingAnimationNames", { 4768 // Returns a list of playing animation names 4769 get: function() { 4770 return this.loaded ? this.animator.animations.filter(function(n) { 4771 return n.playing; 4772 }).map(function(n) { 4773 return n.name; 4774 }) : []; 4775 }, 4776 enumerable: !1, 4777 configurable: !0 4778 }), Object.defineProperty(s.prototype, "pausedAnimationNames", { 4779 // Returns a list of paused animation names 4780 get: function() { 4781 return this.loaded ? this.animator.animations.filter(function(n) { 4782 return !n.playing; 4783 }).map(function(n) { 4784 return n.name; 4785 }) : []; 4786 }, 4787 enumerable: !1, 4788 configurable: !0 4789 }), Object.defineProperty(s.prototype, "pausedStateMachineNames", { 4790 /** 4791 * Returns a list of paused machine names 4792 * @returns a list of state machine names that are paused 4793 */ 4794 get: function() { 4795 return this.loaded ? this.animator.stateMachines.filter(function(n) { 4796 return !n.playing; 4797 }).map(function(n) { 4798 return n.name; 4799 }) : []; 4800 }, 4801 enumerable: !1, 4802 configurable: !0 4803 }), Object.defineProperty(s.prototype, "isPlaying", { 4804 /** 4805 * @returns true if any animation is playing 4806 */ 4807 get: function() { 4808 return this.animator.isPlaying; 4809 }, 4810 enumerable: !1, 4811 configurable: !0 4812 }), Object.defineProperty(s.prototype, "isPaused", { 4813 /** 4814 * @returns true if all instanced animations are paused 4815 */ 4816 get: function() { 4817 return this.animator.isPaused; 4818 }, 4819 enumerable: !1, 4820 configurable: !0 4821 }), Object.defineProperty(s.prototype, "isStopped", { 4822 /** 4823 * @returns true if no animations are playing or paused 4824 */ 4825 get: function() { 4826 return this.animator.isStopped; 4827 }, 4828 enumerable: !1, 4829 configurable: !0 4830 }), Object.defineProperty(s.prototype, "bounds", { 4831 /** 4832 * @returns the bounds of the current artboard, or undefined if the artboard 4833 * isn't loaded yet. 4834 */ 4835 get: function() { 4836 return this.artboard ? this.artboard.bounds : void 0; 4837 }, 4838 enumerable: !1, 4839 configurable: !0 4840 }), s.prototype.on = function(n, i) { 4841 this.eventManager.add({ 4842 type: n, 4843 callback: i 4844 }); 4845 }, s.prototype.off = function(n, i) { 4846 this.eventManager.remove({ 4847 type: n, 4848 callback: i 4849 }); 4850 }, s.prototype.unsubscribe = function(n, i) { 4851 console.warn("This function is deprecated: please use `off()` instead."), this.off(n, i); 4852 }, s.prototype.removeAllRiveEventListeners = function(n) { 4853 this.eventManager.removeAll(n); 4854 }, s.prototype.unsubscribeAll = function(n) { 4855 console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."), this.removeAllRiveEventListeners(n); 4856 }, s.prototype.stopRendering = function() { 4857 this.loaded && this.frameRequestId && (this.runtime.cancelAnimationFrame ? this.runtime.cancelAnimationFrame(this.frameRequestId) : cancelAnimationFrame(this.frameRequestId), this.frameRequestId = null); 4858 }, s.prototype.startRendering = function() { 4859 this.loaded && this.artboard && !this.frameRequestId && (this.runtime.requestAnimationFrame ? this.frameRequestId = this.runtime.requestAnimationFrame(this._boundDraw) : this.frameRequestId = requestAnimationFrame(this._boundDraw)); 4860 }, s.prototype.enableFPSCounter = function(n) { 4861 this.runtime.enableFPSCounter(n); 4862 }, s.prototype.disableFPSCounter = function() { 4863 this.runtime.disableFPSCounter(); 4864 }, Object.defineProperty(s.prototype, "contents", { 4865 /** 4866 * Returns the contents of a Rive file: the artboards, animations, and state machines 4867 */ 4868 get: function() { 4869 if (this.loaded) { 4870 for (var n = { 4871 artboards: [] 4872 }, i = 0; i < this.file.artboardCount(); i++) { 4873 for (var c = this.file.artboardByIndex(i), m = { 4874 name: c.name, 4875 animations: [], 4876 stateMachines: [] 4877 }, A = 0; A < c.animationCount(); A++) { 4878 var O = c.animationByIndex(A); 4879 m.animations.push(O.name); 4880 } 4881 for (var ce = 0; ce < c.stateMachineCount(); ce++) { 4882 for (var ve = c.stateMachineByIndex(ce), re = ve.name, xe = new this.runtime.StateMachineInstance(ve, c), Fe = [], Xe = 0; Xe < xe.inputCount(); Xe++) { 4883 var Be = xe.input(Xe); 4884 Fe.push({ name: Be.name, type: Be.type }); 4885 } 4886 m.stateMachines.push({ 4887 name: re, 4888 inputs: Fe 4889 }); 4890 } 4891 n.artboards.push(m); 4892 } 4893 return n; 4894 } 4895 }, 4896 enumerable: !1, 4897 configurable: !0 4898 }), Object.defineProperty(s.prototype, "volume", { 4899 /** 4900 * Getter / Setter for the volume of the artboard 4901 */ 4902 get: function() { 4903 return this.artboard && this.artboard.volume !== this._volume && (this._volume = this.artboard.volume), this._volume; 4904 }, 4905 set: function(n) { 4906 this._volume = n, this.artboard && (this.artboard.volume = n * L.systemVolume); 4907 }, 4908 enumerable: !1, 4909 configurable: !0 4910 }), Object.defineProperty(s.prototype, "artboardWidth", { 4911 /** 4912 * The width of the artboard. 4913 * 4914 * This will return 0 if the artboard is not loaded yet and a custom 4915 * width has not been set. 4916 * 4917 * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas} 4918 * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard width is 4919 * automatically set. 4920 */ 4921 get: function() { 4922 var n; 4923 return this.artboard ? this.artboard.width : (n = this._artboardWidth) !== null && n !== void 0 ? n : 0; 4924 }, 4925 set: function(n) { 4926 this._artboardWidth = n, this.artboard && (this.artboard.width = n); 4927 }, 4928 enumerable: !1, 4929 configurable: !0 4930 }), Object.defineProperty(s.prototype, "artboardHeight", { 4931 /** 4932 * The height of the artboard. 4933 * 4934 * This will return 0 if the artboard is not loaded yet and a custom 4935 * height has not been set. 4936 * 4937 * Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas} 4938 * with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard height is 4939 * automatically set. 4940 */ 4941 get: function() { 4942 var n; 4943 return this.artboard ? this.artboard.height : (n = this._artboardHeight) !== null && n !== void 0 ? n : 0; 4944 }, 4945 set: function(n) { 4946 this._artboardHeight = n, this.artboard && (this.artboard.height = n); 4947 }, 4948 enumerable: !1, 4949 configurable: !0 4950 }), s.prototype.resetArtboardSize = function() { 4951 this.artboard ? (this.artboard.resetArtboardSize(), this._artboardWidth = this.artboard.width, this._artboardHeight = this.artboard.height) : (this._artboardWidth = void 0, this._artboardHeight = void 0); 4952 }, Object.defineProperty(s.prototype, "devicePixelRatioUsed", { 4953 /** 4954 * The device pixel ratio used in rendering and canvas/artboard resizing. 4955 * 4956 * This value will be overidden by the device pixel ratio used in 4957 * {@link resizeDrawingSurfaceToCanvas}. If you use that method, do not set this value. 4958 */ 4959 get: function() { 4960 return this._devicePixelRatioUsed; 4961 }, 4962 set: function(n) { 4963 this._devicePixelRatioUsed = n; 4964 }, 4965 enumerable: !1, 4966 configurable: !0 4967 }), s.prototype.bindViewModelInstance = function(n) { 4968 var i; 4969 this.artboard && !this.destroyed && n && n.runtimeInstance && (n.internalIncrementReferenceCount(), (i = this._viewModelInstance) === null || i === void 0 || i.cleanup(), this._viewModelInstance = n, this.animator.stateMachines.length >
4969 0 ? this.animator.stateMachines.forEach(function(c) { 4970 return c.bindViewModelInstance(n); 4971 }) : this.artboard.bindViewModelInstance(n.runtimeInstance)); 4972 }, Object.defineProperty(s.prototype, "viewModelInstance", { 4973 get: function() { 4974 return this._viewModelInstance; 4975 }, 4976 enumerable: !1, 4977 configurable: !0 4978 }), s.prototype.viewModelByIndex = function(n) { 4979 var i = this.file.viewModelByIndex(n); 4980 return i !== null ? new he(i) : null; 4981 }, s.prototype.viewModelByName = function(n) { 4982 var i = this.file.viewModelByName(n); 4983 return i !== null ? new he(i) : null; 4984 }, s.prototype.enums = function() { 4985 if (this._dataEnums === null) { 4986 var n = this.file.enums(); 4987 this._dataEnums = n.map(function(i) { 4988 return new Le(i); 4989 }); 4990 } 4991 return this._dataEnums; 4992 }, s.prototype.defaultViewModel = function() { 4993 if (this.artboard) { 4994 var n = this.file.defaultArtboardViewModel(this.artboard); 4995 if (n) 4996 return new he(n); 4997 } 4998 return null; 4999 }, s.prototype.getArtboard = function(n) { 5000 var i, c; 5001 return (c = (i = this.riveFile) === null || i === void 0 ? void 0 : i.getArtboard(n)) !== null && c !== void 0 ? c : null; 5002 }, s.missingErrorMessage = "Rive source file or data buffer required", s.cleanupErrorMessage = "Attempt to use file after calling cleanup.", s; 5003 })() 5004 ), he = ( 5005 /** @class */ 5006 (function() { 5007 function s(n) { 5008 this._viewModel = n; 5009 } 5010 return Object.defineProperty(s.prototype, "instanceCount", { 5011 get: function() { 5012 return this._viewModel.instanceCount; 5013 }, 5014 enumerable: !1, 5015 configurable: !0 5016 }), Object.defineProperty(s.prototype, "name", { 5017 get: function() { 5018 return this._viewModel.name; 5019 }, 5020 enumerable: !1, 5021 configurable: !0 5022 }), s.prototype.instanceByIndex = function(n) { 5023 var i = this._viewModel.instanceByIndex(n); 5024 return i !== null ? new $e(i, null) : null; 5025 }, s.prototype.instanceByName = function(n) { 5026 var i = this._viewModel.instanceByName(n); 5027 return i !== null ? new $e(i, null) : null; 5028 }, s.prototype.defaultInstance = function() { 5029 var n = this._viewModel.defaultInstance(); 5030 return n !== null ? new $e(n, null) : null; 5031 }, s.prototype.instance = function() { 5032 var n = this._viewModel.instance(); 5033 return n !== null ? new $e(n, null) : null; 5034 }, Object.defineProperty(s.prototype, "properties", { 5035 get: function() { 5036 return this._viewModel.getProperties(); 5037 }, 5038 enumerable: !1, 5039 configurable: !0 5040 }), Object.defineProperty(s.prototype, "instanceNames", { 5041 get: function() { 5042 return this._viewModel.getInstanceNames(); 5043 }, 5044 enumerable: !1, 5045 configurable: !0 5046 }), s; 5047 })() 5048 ), Le = ( 5049 /** @class */ 5050 (function() { 5051 function s(n) { 5052 this._dataEnum = n; 5053 } 5054 return Object.defineProperty(s.prototype, "name", { 5055 get: function() { 5056 return this._dataEnum.name; 5057 }, 5058 enumerable: !1, 5059 configurable: !0 5060 }), Object.defineProperty(s.prototype, "values", { 5061 get: function() { 5062 return this._dataEnum.values; 5063 }, 5064 enumerable: !1, 5065 configurable: !0 5066 }), s; 5067 })() 5068 ), me; 5069 (function(s) { 5070 s.Number = "number", s.String = "string", s.Boolean = "boolean", s.Color = "color", s.Trigger = "trigger", s.Enum = "enum", s.List = "list", s.Image = "image", s.Artboard = "artboard"; 5071 })(me || (me = {})); 5072 var $e = ( 5073 /** @class */ 5074 (function() { 5075 function s(n, i) { 5076 this._parents = [], this._children = [], this._viewModelInstances = /* @__PURE__ */ new Map(), this._propertiesWithCallbacks = [], this._referenceCount = 0, this._runtimeInstance = n, i !== null && this._parents.push(i); 5077 } 5078 return Object.defineProperty(s.prototype, "runtimeInstance", { 5079 get: function() { 5080 return this._runtimeInstance; 5081 }, 5082 enumerable: !1, 5083 configurable: !0 5084 }), s.prototype.handleCallbacks = function() { 5085 this._propertiesWithCallbacks.length !== 0 && (this._propertiesWithCallbacks.forEach(function(n) { 5086 n.handleCallbacks(); 5087 }), this._propertiesWithCallbacks.forEach(function(n) { 5088 n.clearChanges(); 5089 }
5089)), this._children.forEach(function(n) { 5090 return n.handleCallbacks(); 5091 }); 5092 }, s.prototype.addParent = function(n) { 5093 this._parents.includes(n) || (this._parents.push(n), (this._propertiesWithCallbacks.length > 0 || this._children.length > 0) && n.addToViewModelCallbacks(this)); 5094 }, s.prototype.removeParent = function(n) { 5095 var i = this._parents.indexOf(n); 5096 if (i !== -1) { 5097 var c = this._parents[i]; 5098 c.removeFromViewModelCallbacks(this), this._parents.splice(i, 1); 5099 } 5100 }, s.prototype.addToPropertyCallbacks = function(n) { 5101 var i = this; 5102 this._propertiesWithCallbacks.includes(n) || (this._propertiesWithCallbacks.push(n), this._propertiesWithCallbacks.length > 0 && this._parents.forEach(function(c) { 5103 c.addToViewModelCallbacks(i); 5104 })); 5105 }, s.prototype.removeFromPropertyCallbacks = function(n) { 5106 var i = this; 5107 this._propertiesWithCallbacks.includes(n) && (this._propertiesWithCallbacks = this._propertiesWithCallbacks.filter(function(c) { 5108 return c !== n; 5109 }), this._children.length === 0 && this._propertiesWithCallbacks.length === 0 && this._parents.forEach(function(c) { 5110 c.removeFromViewModelCallbacks(i); 5111 })); 5112 }, s.prototype.addToViewModelCallbacks = function(n) { 5113 var i = this; 5114 this._children.includes(n) || (this._children.push(n), this._parents.forEach(function(c) { 5115 c.addToViewModelCallbacks(i); 5116 })); 5117 }, s.prototype.removeFromViewModelCallbacks = function(n) { 5118 var i = this; 5119 this._children.includes(n) && (this._children = this._children.filter(function(c) { 5120 return c !== n; 5121 }), this._children.length === 0 && this._propertiesWithCallbacks.length === 0 && this._parents.forEach(function(c) { 5122 c.removeFromViewModelCallbacks(i); 5123 })); 5124 }, s.prototype.clearCallbacks = function() { 5125 this._propertiesWithCallbacks.forEach(function(n) { 5126 n.clearCallbacks(); 5127 }); 5128 }, s.prototype.propertyFromPath = function(n, i) { 5129 var c = n.split("/"); 5130 return this.propertyFromPathSegments(c, 0, i); 5131 }, s.prototype.viewModelFromPathSegments = function(n, i) { 5132 var c = this.internalViewModelInstance(n[i]); 5133 return c !== null ? i == n.length - 1 ? c : c.viewModelFromPathSegments(n, i++) : null; 5134 }, s.prototype.propertyFromPathSegments = function(n, i, c) { 5135 var m, A, O, ce, ve, re, xe, Fe, Xe, Be, lt, nt, Qe, et, rt, kt, Lt, pt; 5136 if (i < n.length - 1) { 5137 var pe = this.internalViewModelInstance(n[i]); 5138 return pe !== null ? pe.propertyFromPathSegments(n, i + 1, c) : null; 5139 } 5140 var ke = null; 5141 switch (c) { 5142 case me.Number: 5143 if (ke = (A = (m = this._runtimeInstance) === null || m === void 0 ? void 0 : m.number(n[i])) !== null && A !== void 0 ? A : null, ke !== null) 5144 return new Ne(ke, this); 5145 break; 5146 case me.String: 5147 if (ke = (ce = (O = this._runtimeInstance) === null || O === void 0 ? void 0 : O.string(n[i])) !== null && ce !== void 0 ? ce : null, ke !== null) 5148 return new Ge(ke, this); 5149 break; 5150 case me.Boolean: 5151 if (ke = (re = (ve = this._runtimeInstance) === null || ve === void 0 ? void 0 : ve.boolean(n[i])) !== null && re !== void 0 ? re : null, ke !== null) 5152 return new Ue(ke, this); 5153 break; 5154 case me.Color: 5155 if (ke = (Fe = (xe = this._runtimeInstance) === null || xe === void 0 ? void 0 : xe.color(n[i])) !== null && Fe !== void 0 ? Fe : null, ke !== null) 5156 return new We(ke, this); 5157 break; 5158 case me.Trigger: 5159 if (ke = (Be = (Xe = this._runtimeInstance) === null || Xe === void 0 ? void 0 : Xe.trigger(n[i])) !== null && Be !== void 0 ? Be : null, ke !== null) 5160 return new le(ke, this); 5161 break; 5162 case me.Enum: 5163 if (ke = (nt = (lt = this._runtimeInstance) === null || lt === void 0 ? void 0 : lt.enum
5163(n[i])) !== null && nt !== void 0 ? nt : null, ke !== null) 5164 return new Pe(ke, this); 5165 break; 5166 case me.List: 5167 if (ke = (et = (Qe = this._runtimeInstance) === null || Qe === void 0 ? void 0 : Qe.list(n[i])) !== null && et !== void 0 ? et : null, ke !== null) 5168 return new ze(ke, this); 5169 break; 5170 case me.Image: 5171 if (ke = (kt = (rt = this._runtimeInstance) === null || rt === void 0 ? void 0 : rt.image(n[i])) !== null && kt !== void 0 ? kt : null, ke !== null) 5172 return new wt(ke, this); 5173 break; 5174 case me.Artboard: 5175 if (ke = (pt = (Lt = this._runtimeInstance) === null || Lt === void 0 ? void 0 : Lt.artboard(n[i])) !== null && pt !== void 0 ? pt : null, ke !== null) 5176 return new st(ke, this); 5177 break; 5178 } 5179 return null; 5180 }, s.prototype.internalViewModelInstance = function(n) { 5181 var i; 5182 if (this._viewModelInstances.has(n)) 5183 return this._viewModelInstances.get(n); 5184 var c = (i = this._runtimeInstance) === null || i === void 0 ? void 0 : i.viewModel(n); 5185 if (c !== null) { 5186 var m = new s(c, this); 5187 return m.internalIncrementReferenceCount(), this._viewModelInstances.set(n, m), m; 5188 } 5189 return null; 5190 }, s.prototype.number = function(n) { 5191 var i = this.propertyFromPath(n, me.Number); 5192 return i; 5193 }, s.prototype.string = function(n) { 5194 var i = this.propertyFromPath(n, me.String); 5195 return i; 5196 }, s.prototype.boolean = function(n) { 5197 var i = this.propertyFromPath(n, me.Boolean); 5198 return i; 5199 }, s.prototype.color = function(n) { 5200 var i = this.propertyFromPath(n, me.Color); 5201 return i; 5202 }, s.prototype.trigger = function(n) { 5203 var i = this.propertyFromPath(n, me.Trigger); 5204 return i; 5205 }, s.prototype.enum = function(n) { 5206 var i = this.propertyFromPath(n, me.Enum); 5207 return i; 5208 }, s.prototype.list = function(n) { 5209 var i = this.propertyFromPath(n, me.List); 5210 return i; 5211 }, s.prototype.image = function(n) { 5212 var i = this.propertyFromPath(n, me.Image); 5213 return i; 5214 }, s.prototype.artboard = function(n) { 5215 var i = this.propertyFromPath(n, me.Artboard); 5216 return i; 5217 }, s.prototype.viewModel = function(n) { 5218 var i = n.split("/"), c = i.length > 1 ? this.viewModelFromPathSegments(i.slice(0, i.length - 1), 0) : this; 5219 return c != null ? c.internalViewModelInstance(i[i.length - 1]) : null; 5220 }, s.prototype.internalReplaceViewModel = function(n, i) { 5221 var c; 5222 if (i.runtimeInstance !== null) { 5223 var m = ((c = this._runtimeInstance) === null || c === void 0 ? void 0 : c.replaceViewModel(n, i.runtimeInstance)) || !1; 5224 if (m) { 5225 i.internalIncrementReferenceCount(); 5226 var A = this.internalViewModelInstance(n); 5227 A !== null && (A.removeParent(this), this._children.includes(A) && (this._children = this._children.filter(function(O) { 5228 return O !== A; 5229 })), A.cleanup()), this._viewModelInstances.set(n, i), i.addParent(this); 5230 } 5231 return m; 5232 } 5233 return !1; 5234 }, s.prototype.replaceViewModel = function(n, i) { 5235 var c, m = n.split("/"), A = m.length > 1 ? this.viewModelFromPathSegments(m.slice(0, m.length - 1), 0) : this; 5236 return (c = A?.internalReplaceViewModel(m[m.length - 1], i)) !== null && c !== void 0 ? c : !1; 5237 }, s.prototype.incrementReferenceCount = function() { 5238 var n; 5239 this._referenceCount++, (n = this._runtimeInstance) === null || n === void 0 || n.incrementReferenceCount(); 5240 }, s.prototype.decrementReferenceCount = function() { 5241 var n; 5242 this._referenceCount--, (n = this._runtimeInstance) === null || n === void 0 || n.decrementReferenceCount(); 5243 }, Object.defineProperty(s.prototype, "properties", { 5244 get: function() { 5245 var n; 5246 return ((n = this._runtimeInstance) === null || n === void 0 ? void 0 : n.getProperties().map(function(i) { 5247 return ie({}, i); 5248 })) || []; 5249 }, 5250 enumerable: !1, 5251 configurable: !0 5252 }), s.prototype.internalIncrementReferenceCount = function() { 5253 this._referenceCount++; 5254 }, s.prototype.cleanup = function() { 5255 var n = this; 5256 if (this._referenceCount--, this._referenceCount <= 0) { 5257 this._runtimeInstance = null, this.clearCallbacks(), this._propertiesWithCallbacks = [], this._viewModelInstances.forEac
5257h(function(m) { 5258 m.cleanup(); 5259 }), this._viewModelInstances.clear(); 5260 var i = M([], this._children, !0); 5261 this._children.length = 0; 5262 var c = M([], this._parents, !0); 5263 this._parents.length = 0, i.forEach(function(m) { 5264 m.removeParent(n); 5265 }), c.forEach(function(m) { 5266 m.removeFromViewModelCallbacks(n); 5267 }); 5268 } 5269 }, s; 5270 })() 5271 ), Ve = ( 5272 /** @class */ 5273 (function() { 5274 function s(n, i) { 5275 this.callbacks = [], this._viewModelInstanceValue = n, this._parentViewModel = i; 5276 } 5277 return s.prototype.on = function(n) { 5278 this.callbacks.length === 0 && this._viewModelInstanceValue.clearChanges(), this.callbacks.includes(n) || (this.callbacks.push(n), this._parentViewModel.addToPropertyCallbacks(this)); 5279 }, s.prototype.off = function(n) { 5280 n ? this.callbacks = this.callbacks.filter(function(i) { 5281 return i !== n; 5282 }) : this.callbacks.length = 0, this.callbacks.length === 0 && this._parentViewModel.removeFromPropertyCallbacks(this); 5283 }, s.prototype.internalHandleCallback = function(n) { 5284 }, s.prototype.handleCallbacks = function() { 5285 var n = this; 5286 this._viewModelInstanceValue.hasChanged && this.callbacks.forEach(function(i) { 5287 n.internalHandleCallback(i); 5288 }); 5289 }, s.prototype.clearChanges = function() { 5290 this._viewModelInstanceValue.clearChanges(); 5291 }, s.prototype.clearCallbacks = function() { 5292 this.callbacks.length = 0; 5293 }, Object.defineProperty(s.prototype, "name", { 5294 get: function() { 5295 return this._viewModelInstanceValue.name; 5296 }, 5297 enumerable: !1, 5298 configurable: !0 5299 }), s; 5300 })() 5301 ), Ge = ( 5302 /** @class */ 5303 (function(s) { 5304 J(n, s); 5305 function n(i, c) { 5306 return s.call(this, i, c) || this; 5307 } 5308 return Object.defineProperty(n.prototype, "value", { 5309 get: function() { 5310 return this._viewModelInstanceValue.value; 5311 }, 5312 set: function(i) { 5313 this._viewModelInstanceValue.value = i; 5314 }, 5315 enumerable: !1, 5316 configurable: !0 5317 }), n.prototype.internalHandleCallback = function(i) { 5318 i(this.value); 5319 }, n; 5320 })(Ve) 5321 ), Ne = ( 5322 /** @class */ 5323 (function(s) { 5324 J(n, s); 5325 function n(i, c) { 5326 return s.call(this, i, c) || this; 5327 } 5328 return Object.defineProperty(n.prototype, "value", { 5329 get: function() { 5330 return this._viewModelInstanceValue.value; 5331 }, 5332 set: function(i) { 5333 this._viewModelInstanceValue.value = i; 5334 }, 5335 enumerable: !1, 5336 configurable: !0 5337 }), n.prototype.internalHandleCallback = function(i) { 5338 i(this.value); 5339 }, n; 5340 })(Ve) 5341 ), Ue = ( 5342 /** @class */ 5343 (function(s) { 5344 J(n, s); 5345 function n(i, c) { 5346 return s.call(this, i, c) || this; 5347 } 5348 return Object.defineProperty(n.prototype, "value", { 5349 get: function() { 5350 return this._viewModelInstanceValue.value; 5351 }, 5352 set: function(i) { 5353 this._viewModelInstanceValue.value = i; 5354 }, 5355 enumerable: !1, 5356 configurable: !0 5357 }), n.prototype.internalHandleCallback = function(i) { 5358 i(this.value); 5359 }, n; 5360 })(Ve) 5361 ), le = ( 5362 /** @class */ 5363 (function(s) { 5364 J(n, s); 5365 function n(i, c) { 5366 return s.call(this, i, c) || this; 5367 } 5368 return n.prototype.trigger = function() { 5369 return this._viewModelInstanceValue.trigger(); 5370 }, n.prototype.internalHandleCallback = function(i) { 5371 i(); 5372 }, n; 5373 })(Ve) 5374 ), Pe = ( 5375 /** @class */ 5376 (function(s) { 5377 J(n, s); 5378 function n(i, c) { 5379 return s.call(this, i, c) || this; 5380 } 5381 return Object.defineProperty(n.prototype, "value", { 5382 get: function() { 5383 return this._viewModelInstanceValue.value; 5384 }, 5385 set: function(i) { 5386 this._viewModelInstanceValue.value = i; 5387 }, 5388 enumerable: !1, 5389 configurable: !0 5390 }), Object.defineProperty(n.prototype, "valueIndex", { 5391 get: function() { 5392 return this._viewModelInstanceValue.valueIndex; 5393 }, 5394 set: function(i) { 5395 this._viewModelInstanceValue.valueIndex = i; 5396 }, 5397 enumerable: !1, 5398 configurable: !0 5399 }), Object.defineProperty(n.prototype, "values", { 5400 get: function() { 5401 return this._viewModelInstanceValue.values; 5402 }, 5403 enumerable: !1, 5404 configurable: !0 5405 }), n.prototype.internalHandleCallback = function(i) { 5406 i(this.value); 5407 }, n; 5408 })(Ve) 5409 ), ze = ( 5410 /** @class */ 5411 (function(s) { 5412 J(n, s); 5413 function n(i, c) { 5414 return s.call(this, i, c) || this; 5415 } 5416 return Object.defineProperty(n.prototype, "length", { 5417 get: function() { 5418 return this._viewModelInstanceValue.size; 5419 }, 5420 enumerable: !1, 5421 configurable: !0 5422 }), n.prototype.addInstance = function(i) { 5423 i.runtimeInstance != null && (this._viewModelInstanceValue.addInstance(i.runtimeInstance), i.addParent(this._parentViewModel)); 5424 }, n.prototype.addInstanceAt = function(i, c) { 5425 return i.runtimeInstance != null && this._viewModelInstanceValue.addInstanceAt(i.runtimeInstance, c) ? (i.addParent(this._parentViewModel), !0) : !1; 5426 }, n.prototype.removeInstance = function(i) { 5427 i.runtimeInstance != null && (this._viewModelInstanceValue.removeInstance(i.runtimeInstance), i.removeParent(this._parentViewModel)); 5428 }, n.prototype.removeInstanceAt = function(i) { 5429 this._viewModelInstanceValue.removeInstanceAt(i); 5430 }, n.prototype.instanceAt = function(i) { 5431 var c = this._viewModelInstanceValue.instanceAt(i); 5432 if (c != null) { 5433 var m = new $e(c, this._parentViewModel); 5434 return m; 5435 } 5436 return null; 5437 }, n.prototype.swap = function(i, c) { 5438 this._viewModelInstanceValue.swap(i, c); 5439 }, n.prototype.internalHandleCallback = function(i) { 5440 i(); 5441 }, n; 5442 })(Ve) 5443 ), We = ( 5444 /** @class */ 5445 (function(s) { 5446 J(n, s); 5447 function n(i, c) { 5448 return s.call(this, i, c) || this; 5449 } 5450 return Object.defineProperty(n.prototype, "value", { 5451 get: function() { 5452 return this._viewModelInstanceValue.value; 5453 }, 5454 set: function(i) { 5455 this._viewModelInstanceValue.value = i; 5456 }, 5457 enumerable: !1, 5458 configurable: !0 5459 }), n.prototype.rgb = function(i, c, m) { 5460 this._viewModelInstanceValue.rgb(i, c, m); 5461 }, n.prototype.rgba = function(i, c, m, A) { 5462 this._viewModelInstanceValue.argb(A, i, c, m); 5463 }, n.prototype.argb = function(i, c, m, A) { 5464 this._viewModelInstanceValue.argb(i, c, m, A); 5465 }, n.prototype.alpha = function(i) { 5466 this._viewModelInstanceValue.alpha(i); 5467 }, n.prototype.opacity = function(i) { 5468 this._viewModelInstanceValue.alpha(Math.round(Math.max(0, Math.min(1, i)) * 255)); 5469 }, n.prototype.internalHandleCallback = function(i) { 5470 i(this.value); 5471 }, n; 5472 })(Ve) 5473 ), wt = ( 5474 /** @class */ 5475 (function(s) { 5476 J(n, s); 5477 function n(i, c) { 5478 return s.call(this, i, c) || this; 5479 } 5480 return Object.defineProperty(n.prototype, "value", { 5481 set: function(i) { 5482 var c; 5483 this._viewModelInstanceValue.value((c = i?.nativeImage) !== null && c !== void 0 ? c : null); 5484 }, 5485 enumerable: !1, 5486 configurable: !0 5487 }), n.prototype.internalHandleCallback = function(i) { 5488 i(); 5489 }, n; 5490 })(Ve) 5491 ), st = ( 5492 /** @class */ 5493 (function(s) { 5494 J(n, s); 5495 function n(i, c) { 5496 return s.call(this, i, c) || this; 5497 } 5498 return Object.defineProperty(n.prototype, "value", { 5499 set: function(i) { 5500 var c; 5501 this._viewModelInstanceValue.value((c = i?.nativeArtboard) !== null && c !== void 0 ? c : null); 5502 }, 5503 enumerable: !1, 5504 configurable: !0 5505 }), n.prototype.internalHandleCallback = function(i) { 5506 i(); 5507 }, n; 5508 })(Ve) 5509 ), Kt = function(s) { 5510 return Z(void 0, void 0, void 0, function() { 5511 var n, i, c; 5512 return a(this, function(m) { 5513 switch (m.label) { 5514 case 0:
5515 return n = new Request(s), [4, fetch(n)]; 5516 case 1: 5517 return i = m.sent(), [4, i.arrayBuffer()]; 5518 case 2: 5519 return c = m.sent(), [2, c]; 5520 } 5521 }); 5522 }); 5523 }, Ye = function(s) { 5524 return typeof s == "string" ? [s] : s instanceof Array ? s : []; 5525 }, Zt = { 5526 EventManager: I, 5527 TaskQueueManager: b 5528 }, Jt = function(s) { 5529 return Z(void 0, void 0, void 0, function() { 5530 var n, i, c; 5531 return a(this, function(m) { 5532 switch (m.label) { 5533 case 0: 5534 return n = new Promise(function(A) { 5535 return de.getInstance(function(O) { 5536 O.decodeAudio(s, A); 5537 }); 5538 }), [4, n]; 5539 case 1: 5540 return i = m.sent(), c = new K.AudioWrapper(i), K.finalizationRegistry.register(c, i), [2, c]; 5541 } 5542 }); 5543 }); 5544 }, on = function(s) { 5545 return Z(void 0, void 0, void 0, function() { 5546 var n, i, c; 5547 return a(this, function(m) { 5548 switch (m.label) { 5549 case 0: 5550 return n = new Promise(function(A) { 5551 return de.getInstance(function(O) { 5552 O.decodeImage(s, A); 5553 }); 5554 }), [4, n]; 5555 case 1: 5556 return i = m.sent(), c = new K.ImageWrapper(i), K.finalizationRegistry.register(c, i), [2, c]; 5557 } 5558 }); 5559 }); 5560 }, ut = function(s) { 5561 return Z(void 0, void 0, void 0, function() { 5562 var n, i, c; 5563 return a(this, function(m) { 5564 switch (m.label) { 5565 case 0: 5566 return n = new Promise(function(A) { 5567 return de.getInstance(function(O) { 5568 O.decodeFont(s, A); 5569 }); 5570 }), [4, n]; 5571 case 1: 5572 return i = m.sent(), c = new K.FontWrapper(i), K.finalizationRegistry.register(c, i), [2, c]; 5573 } 5574 }); 5575 }); 5576 }; 5577 })(), Q; 5578 })() 5579 )); 5580 })(Xn)), Xn.exports; 5581} 5582var Si; 5583function Sa() { 5584 return Si || (Si = 1, (function(u) { 5585 Object.defineProperty(u, "__esModule", { value: !0 }); 5586 var d = qn, C = ja(); 5587 function P(h) { 5588 return h && typeof h == "object" && "default" in h ? h : { default: h }; 5589 } 5590 var V = /* @__PURE__ */ P(d), Q = function() { 5591 return Q = Object.assign || function(h) { 5592 for (var R, I = 1, b = arguments.length; I < b; I++) for (var w in R = arguments[I]) Object.prototype.hasOwnProperty.call(R, w) && (h[w] = R[w]); 5593 return h; 5594 }, Q.apply(this, arguments); 5595 }; 5596 function N(h, R) { 5597 var I = {}; 5598 for (var b in h) Object.prototype.hasOwnProperty.call(h, b) && R.indexOf(b) < 0 && (I[b] = h[b]); 5599 if (h != null && typeof Object.getOwnPropertySymbols == "function") { 5600 var w = 0; 5601 for (b = Object.getOwnPropertySymbols(h); w < b.length; w++) R.indexOf(b[w]) < 0 && Object.prototype.propertyIsEnumerable.call(h, b[w]) && (I[b[w]] = h[b[w]]); 5602 } 5603 return I; 5604 } 5605 function F(h, R, I, b) { 5606 return new (I || (I = Promise))(function(w, B) { 5607 function L(Y) { 5608 try { 5609 T(b.next(Y)); 5610 } catch (H) { 5611 B(H); 5612 } 5613 } 5614 function ne(Y) { 5615 try { 5616 T(b.throw(Y)); 5617 } catch (H) { 5618 B(H); 5619 } 5620 } 5621 function T(Y) { 5622 var H; 5623 Y.done ? w(Y.value) : (H = Y.value, H instanceof I ? H : new I(function(ge) { 5624 ge(H); 5625 })).then(L, ne); 5626 } 5627 T((b = b.apply(h, [])).next()); 5628 }); 5629 } 5630 function k(h, R) { 5631 var I, b, w, B, L = { label: 0, sent: function() { 5632 if (1 & w[0]) throw w[1]; 5633 return w[1]; 5634 }, trys: [], ops: [] };
5635 return B = { next: ne(0), throw: ne(1), return: ne(2) }, typeof Symbol == "function" && (B[Symbol.iterator] = function() { 5636 return this; 5637 }), B; 5638 function ne(T) { 5639 return function(Y) { 5640 return (function(H) { 5641 if (I) throw new TypeError("Generator is already executing."); 5642 for (; L; ) try { 5643 if (I = 1, b && (w = 2 & H[0] ? b.return : H[0] ? b.throw || ((w = b.return) && w.call(b), 0) : b.next) && !(w = w.call(b, H[1])).done) return w; 5644 switch (b = 0, w && (H = [2 & H[0], w.value]), H[0]) { 5645 case 0: 5646 case 1: 5647 w = H; 5648 break; 5649 case 4: 5650 return L.label++, { value: H[1], done: !1 }; 5651 case 5: 5652 L.label++, b = H[1], H = [0]; 5653 continue; 5654 case 7: 5655 H = L.ops.pop(), L.trys.pop(); 5656 continue; 5657 default: 5658 if (w = L.trys, !((w = w.length > 0 && w[w.length - 1]) || H[0] !== 6 && H[0] !== 2)) { 5659 L = 0; 5660 continue; 5661 } 5662 if (H[0] === 3 && (!w || H[1] > w[0] && H[1] < w[3])) { 5663 L.label = H[1]; 5664 break; 5665 } 5666 if (H[0] === 6 && L.label < w[1]) { 5667 L.label = w[1], w = H; 5668 break; 5669 } 5670 if (w && L.label < w[2]) { 5671 L.label = w[2], L.ops.push(H); 5672 break; 5673 } 5674 w[2] && L.ops.pop(), L.trys.pop(); 5675 continue; 5676 } 5677 H = R.call(h, L); 5678 } catch (ge) { 5679 H = [6, ge], b = 0; 5680 } finally { 5681 I = w = 0; 5682 } 5683 if (5 & H[0]) throw H[1]; 5684 return { value: H[0] ? H[1] : void 0, done: !0 }; 5685 })([T, Y]); 5686 }; 5687 } 5688 } 5689 function K(h) { 5690 var R = h || J(), I = d.useState(R), b = I[0], w = I[1]; 5691 return d.useEffect(function() {
5692 if (typeof window < "u" && "matchMedia" in window) { 5693 var B = function() { 5694 var ne = h || J(); 5695 w(ne); 5696 }, L = window.matchMedia("screen and (resolution: ".concat(b, "dppx)")); 5697 return L.hasOwnProperty("addEventListener") ? L.addEventListener("change", B) : L.addListener(B), function() { 5698 L.hasOwnProperty("removeEventListener") ? L.removeEventListener("change", B) : L.removeListener(B); 5699 }; 5700 } 5701 }, [b, h]), b; 5702 } 5703 function J() { 5704 var h = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : 1; 5705 return Math.min(Math.max(1, h), 3); 5706 } 5707 var ie = (function() { 5708 function h() { 5709 } 5710 return h.prototype.observe = function() { 5711 }, h.prototype.unobserve = function() { 5712 }, h.prototype.disconnect = function() { 5713 }, h; 5714 })(), Z = globalThis.ResizeObserver || ie, a = globalThis.ResizeObserver !== void 0, M = !a; 5715 function _(h, R) { 5716 R === void 0 && (R = !0); 5717 var I = d.useState({ width: 0, height: 0 }), b = I[0], w = I[1]; 5718 d.useEffect(function() { 5719 if (typeof window < "u" && R) { 5720 var Y = function() { 5721 w({ width: window.innerWidth, height: window.innerHeight }); 5722 }; 5723 return M && (Y(), window.addEventListener("resize", Y)), function() { 5724 return window.removeEventListener("resize", Y); 5725 }; 5726 } 5727 }, []); 5728 var B, L, ne, T = d.useRef(new Z((B = function(Y) { 5729 a && w({ width: Y[Y.length - 1].contentRect.width, height: Y[Y.length - 1].contentRect.height }); 5730 }, L = 0, ne = 0, function() { 5731 for (var Y = this, H = [], ge = 0; ge < arguments.length; ge++) H[ge] = arguments[ge]; 5732 clearTimeout(ne), ne = window.setTimeout(function() { 5733 return B.apply(Y, H); 5734 }, L); 5735 }))); 5736 return d.useEffect(function() { 5737 var Y = T.current; 5738 if (R) { 5739 var H = h.current; 5740 return h.current && a && Y.observe(h.current), function() { 5741 Y.disconnect(), H && a && Y.unobserve(H); 5742 }; 5743 } 5744 Y.disconnect(); 5745 }, [h, T]), b; 5746 } 5747 var ue = { useDevicePixelRatio: !0, fitCanvasToArtboardHeight: !1, useOffscreenRenderer: !0, shouldResizeCanvasToContainer: !0 }; 5748 function q(h) { 5749 return Object.assign({}, ue, h); 5750 } 5751 function oe(h) { 5752 var R = h.riveLoaded, I = R !== void 0 && R, b = h.canvasElem, w = h.containerRef, B = h.options, L = B === void 0 ? {} : B, ne = h.onCanvasHasResized, T = h.artboardBounds, Y = q(L), H = d.useState({ height: 0, width: 0 }), ge = H[0], se = ge.height, he = ge.width, Le = H[1], me = d.useState({ height: 0, width: 0 }), $e = me[0], Ve = $e.height, Ge = $e.width, Ne = me[1], Ue = d.useState(!0), le = Ue[0], Pe = Ue[1], ze = Y.fitCanvasToArtboardHeight, We = Y.shouldResizeCanvasToContainer, wt = Y.useDevicePixelRatio, st = Y.customDevicePixelRatio, Kt = _(w, We), Ye = K(st), Zt = T ?? {}, Jt = Zt.maxX, on = Zt.maxY, ut = d.useCallback(function() { 5753 var s, n, i, c, m = (n = (s = w.current) === null || s === void 0 ? void 0 : s.clientWidth) !== null && n !== void 0 ? n : 0, A = (c = (i = w.current) === null || i === void 0 ? void 0 : i.clientHeight) !== null && c !== void 0 ? c : 0; 5754 return ze && T ? { width: m, height: m * (T.maxY / T.maxX) } : { width: m, height: A }; 5755 }, [w, ze, Jt, on]); 5756 d.useEffect(function() { 5757 if (We && w.current && I) { 5758 var s = ut(), n = s.width, i = s.height, c = !1; 5759 if (b) { 5760 var m = n !== he || i !== se; 5761 if (Y.fitCanvasToArtboardHeight && m && (w.current.style.height = i + "px", c = !0), Y.useDevicePixelRatio) { 5762 if (m || n * Ye !== Ge || i * Ye !== Ve) { 5763 var A = Ye * n, O = Ye * i; 5764 b.width = A, b.height = O, b.style.width = n + "px", b.style.height = i + "px", Ne({ width: A, height: O }), c = !0; 5765 } 5766 } else m && (b.width = n, b.height = i, Ne({ width: n, height: i }), c = !0); 5767 Le({ width: n, height: i }); 5768 } 5769 ne && (le || c) && ne && ne(), le && Pe(!1); 5770 } 5771 }, [b, w, Kt, Ye, ut, le, Pe, Ve, Ge, se, he, ne, We, ze, wt, I]), d.useEffect(function() { 5772 Ne({ width: 0, height: 0 }); 5773 }, [b]); 5774 } 5775 var fe, de = (function() { 5776 function h() { 5777 } 5778 return h.prototype.observe = function() { 5779 }, h.prototype.unobserve = function() { 5780 }, h.prototype.disconnect = function() { 5781 }, h; 5782 })(), ye = globalThis.IntersectionObserver || de, Ie = (function() { 5783 function h() { 5784 var R = this; 5785 this.elementsMap = /* @__PURE__ */ new Map(), this.onObserved = function(I) { 5786 I.forEach(function(b) { 5787 var w = R.elementsMap.get(b.target); 5788 w && w(b); 5789 }); 5790 }, this.observer = new ye(this.onObserved); 5791 } 5792 return h.prototype.registerCallback = function(R, I) { 5793 this.observer.observe(R), this.elementsMap.set(R, I); 5794 }, h.prototype.removeCallback = function(R) { 5795 this.observer.unobserve(R), this.elementsMap.delete(R); 5796 }, h; 5797 })(), be = function() { 5798 return fe || (fe = new Ie()), fe; 5799 }; 5800 function je(h) { 5801 var R = h.setContainerRef, I = h.setCanvasRef, b = h.className, w = b === void 0 ? "" : b, B = h.style, L = h.children, ne = N(h, ["setContainerRef", "setCanvasRef", "className", "style", "children"]), T = Q({ width: "100%", height: "100%" }, B); 5802 return V.default.createElement("div", Q({ ref: R, className: w }, !w && { style: T }), V.default.createElement("canvas", Q({ ref: I, style: { verticalAlign: "top", width: 0, height: 0 } }, ne), L)); 5803 } 5804 function z(h, R) { 5805 R === void 0 && (R = {}); 5806 var I = d.useState(null), b = I[0], w = I[1], B = d.useRef(null), L = d.useRef(null), ne = d.useState(null), T = ne[0], Y = ne[1], H = !!h, ge = q(R), se = K(), he = d.useCallback(function() { 5807 if (T) { 5808 if (T.layout && T.layout.fit === C.Fit.Layout && b) { 5809 var le = se * T.layout.layoutScaleFactor; 5810 T.devicePixelRatioUsed = se, T.artboardWidth = b?.width / le, T.artboardHeight = b?.height / le; 5811 } 5812 T.startRendering(), T.resizeToCanvas(); 5813 } 5814 }, [T, se]); 5815 oe({ riveLoaded: !!T, canvasElem: b, containerRef: B, options: ge, onCanvasHasResized: he, artboardBounds: T?.bounds }); 5816 var Le = d.useCallback(function(le) { 5817 le === null && b && (b.height = 0, b.width = 0), w(le); 5818 }, []); 5819 d.useEffect(function() { 5820 if (b && h) { 5821 var le, Pe = T != null; 5822 if (T == null) { 5823 var ze = ge.useOffscreenRenderer, We = h.onRiveReady, wt = N(h, ["onRiveReady"]); 5824 le = new C.Rive(Q(Q({ useOffscreenRenderer: ze }, wt), { canvas: b })), L.current != null && L.current.cleanup(), L.current = le, le.on(C.EventType.Load, function() { 5825 Pe = !0, We && We(le), b ? Y(le) : le.cleanup(); 5826 }); 5827 } 5828 return function() { 5829 Pe || le == null || le.cleanup(); 5830 }; 5831 } 5832 }, [b, H, T]); 5833 var me = d.useCallback(function(le) { 5834 B.current = le; 5835 }, []), $e = { observe: d.useCallback(function(le, Pe) { 5836 be().registerCallback(le, Pe); 5837 }, []), unobserve: d.useCallback(function(le) { 5838 be().removeCallback(le); 5839 }, []) }, Ve = $e.observe, Ge = $e.unobserve; 5840 d.useEffect(function() { 5841 var le, Pe = !1, ze = function() { 5842 if (b && Pe) { 5843 var We = b.getBoundingClientRect(); 5844 We.width > 0 && We.height > 0 && We.top < (window.innerHeight || document.documentElement.clientHeight) && We.bottom > 0 && We.left < (window.innerWidth || document.documentElement.clientWidth) && We.right > 0 && (T?.startRendering(), Pe = !1); 5845 } 5846 }; 5847 return b && ge.shouldUseIntersectionObserver !== !1 && Ve(b, function(We) { 5848 We.isIntersecting ? T && T.startRendering() : T && T.stopRendering(), Pe = !We.isIntersecting, clearTimeout(le), We.isIntersecting || We.boun
5848dingClientRect.width !== 0 || (le = setTimeout(ze, 10)); 5849 }), function() { 5850 b && Ge(b); 5851 }; 5852 }, [Ve, Ge, T, b, ge.shouldUseIntersectionObserver]), d.useEffect(function() { 5853 return function() { 5854 T && (T.cleanup(), Y(null)); 5855 }; 5856 }, [T, b]), d.useEffect(function() { 5857 return function() { 5858 L.current != null && L.current.cleanup(); 5859 }; 5860 }, []); 5861 var Ne = h?.animations; 5862 d.useEffect(function() { 5863 T && Ne && (T.isPlaying ? (T.stop(T.animationNames), T.play(Ne)) : T.isPaused && (T.stop(T.animationNames), T.pause(Ne))); 5864 }, [Ne, T]); 5865 var Ue = d.useCallback(function(le) { 5866 return V.default.createElement(je, Q({ setContainerRef: me, setCanvasRef: Le }, le)); 5867 }, [Le, me]); 5868 return { canvas: b, container: B.current, setCanvasRef: Le, setContainerRef: me, rive: T, RiveComponent: Ue }; 5869 } 5870 function $(h, R, I) { 5871 var b = d.useState(null), w = b[0], B = b[1], L = d.useState(I.defaultValue), ne = L[0], T = L[1], Y = d.useState(null), H = Y[0], ge = Y[1], se = d.useRef(null), he = d.useRef(h), Le = d.useRef(I); 5872 d.useEffect(function() { 5873 Le.current = I; 5874 }, [I]); 5875 var me = d.useCallback(function() { 5876 var Ne = se.current, Ue = he.current, le = Le.current; 5877 if (!Ne || !Ue) return B(null), T(le.defaultValue), ge(null), function() { 5878 }; 5879 var Pe = le.getProperty(Ne, Ue); 5880 if (Pe) { 5881 B(Pe), T(le.getValue(Pe)), le.getExtendedData && ge(le.getExtendedData(Pe)); 5882 var ze = function() { 5883 T(le.getValue(Pe)), le.getExtendedData && ge(le.getExtendedData(Pe)), le.onPropertyEvent && le.onPropertyEvent(); 5884 }; 5885 return Pe.on(ze), function() { 5886 Pe.off(ze); 5887 }; 5888 } 5889 return function() { 5890 }; 5891 }, []); 5892 d.useEffect(function() { 5893 return se.current = R, he.current = h, me(); 5894 }, [R, h, me]); 5895 var $e = d.useCallback(function(Ne) { 5896 if (w && se.current === R) try { 5897 return Ne(w), void (Le.current.getExtendedData && ge(Le.current.getExtendedData(w))); 5898 } catch { 5899 } 5900 if (se.current) try { 5901 var Ue = Le.current.getProperty(se.current, he.current); 5902 Ue && (B(Ue), Ne(Ue), Le.current.getExtendedData && ge(Le.current.getExtendedData(Ue))); 5903 } catch { 5904 } 5905 }, [w, R]), Ve = d.useMemo(function() { 5906 return Le.current.buildPropertyOperations($e); 5907 }, [$e]), Ge = Q({ value: ne }, Ve); 5908 return I.getExtendedData && (Ge.extendedData = H), Ge; 5909 } 5910 u.default = function(h) { 5911 var R = h.src, I = h.artboard, b = h.animations, w = h.stateMachines, B = h.layout, L = h.useOffscreenRenderer, ne = L === void 0 || L, T = h.shouldDisableRiveListeners, Y = T !== void 0 && T, H = h.shouldResizeCanvasToContainer, ge = H === void 0 || H, se = h.automaticallyHandleEvents, he = se !== void 0 && se, Le = h.children, me = N(h, ["src", "artboard", "animations", "stateMachines", "layout", "useOffscreenRenderer", "shouldDisableRiveListeners", "shouldResizeCanvasToContainer", "automaticallyHandleEvents", "children"]), $e = z({ src: R, artboard: I, animations: b, layout: B, stateMachines: w, autoplay: !0, shouldDisableRiveListeners: Y, automaticallyHandleEvents: he }, { useOffscreenRenderer: ne, shouldResizeCanvasToContainer: ge }).RiveComponent; 5912 return V.default.createElement($e, Q({}, me), Le); 5913 }, u.useResizeCanvas = oe, u.useRive = z, u.useRiveFile = function(h) { 5914 var R = this, I = d.useState(null), b = I[0], w = I[1], B = d.useState("idle"), L = B[0], ne = B[1]; 5915 return d.useEffect(function() { 5916 var T = null; 5917 return F(R, void 0, void 0, function() { 5918 return k(this, function(Y) { 5919 try { 5920 ne("loading"), (T = new C.RiveFile(h)).init(), T.on(C.EventType.Load, function() { 5921 T?.getInstance(), w(T), ne("success"); 5922 }), T.on(C.EventType.LoadError, function() { 5923 ne("failed"); 5924 }), w(T); 5925 } catch (H) { 5926 console.error(H), ne("failed"); 5927 } 5928 return [2]; 5929 }); 5930 }), function() { 5931 T?.cleanup(); 5932 }; 5933 }, [h.src, h.buffer]), { riveFile: b, status: L }; 5934 }, u.useStateMachineInput = function(h, R, I, b) { 5935 var w = d.useState(null), B = w[0], L = w[1]; 5936 return d.useEffect(function() { 5937 function ne() { 5938 if (h && R && I || L(null), h && R && I) { 5939 var T = h.stateMachineInputs(R); 5940 if (T) { 5941 var Y = T.find(function(H) { 5942 return H.name === I; 5943 }); 5944 b !== void 0 && Y && (Y.value = b), L(Y || null); 5945 } 5946 } else L(null); 5947 } 5948 ne(), h && h.on(C.EventType.Load, function() { 5949 ne(); 5950 }); 5951 }, [h]), B; 5952 }, u.useViewModel = function(h, R) { 5953 var I = R ?? {}, b = I.name, w = I.useDefault, B = w !== void 0 && w, L = d.useState(null), ne = L[0], T = L[1]; 5954 return d.useEffect(function() { 5955 function Y() { 5956 var H; 5957 if (h) { 5958 var ge = null; 5959 ge = b != null ? ((H = h.viewModelByName) === null || H === void 0 ? void 0 : H.call(h, b)) || null : h.defaultViewModel() || null, T(ge); 5960 } else T(null); 5961 } 5962 return Y(), h && h.on(C.EventType.Load, Y), function() { 5963 h && h.off(C.EventType.Load, Y); 5964 }; 5965 }, [h, b, B]), ne; 5966 }, u.useViewModelInstance = function(h, R) { 5967 var I = R ?? {}, b = I.name, w = I.useDefault, B = w !== void 0 && w, L = I.useNew, ne = L !== void 0 && L, T = I.rive, Y = d.useState(null), H = Y[0], ge = Y[1]; 5968 return d.useEffect(function() { 5969 var se, he, Le; 5970 if (h) { 5971 var me = null; 5972 me = b != null ? h.instanceByName(b) || null : B ? ((se = h.defaultInstance) === null || se === void 0 ? void 0 : se.call(h)) || null : ne ? ((he = h.instance) === null || he === void 0 ? void 0 : he.call(h)) || null : ((Le = h.defaultInstance) === null || Le === void 0 ? void 0 : Le.call(h)) || null, ge(me), T && me && T.viewModelInstance !== me && T.bindViewModelInstance(me); 5973 } else ge(null); 5974 }, [h, b, B, ne, T]), H; 5975 }, u.useViewModelInstanceArtboard = function(h, R) { 5976 return { setValue: $(h, R, { getProperty: d.useCallback(function(I, b) { 5977 return I.artboard(b); 5978 }, []), getValue: d.useCallback(function() { 5979 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(I) { 5980 return { setValue: function(b) { 5981 I(function(w) { 5982 w.value = b; 5983 }); 5984 } }; 5985 }, []) }).setValue }; 5986 }, u.useViewModelInstanceBoolean = function(h, R) { 5987 var I = $(h, R, { getProperty: d.useCallback(function(b, w) { 5988 return b.boolean(w); 5989 }, []), getValue: d.useCallback(function(b) { 5990 return b.value; 5991 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(b) { 5992 return { setValue: function(w) { 5993 b(function(B) { 5994 B.value = w; 5995 }); 5996 } }; 5997 }, []) }); 5998 return { value: I.value, setValue: I.setValue }; 5999 }, u.useViewModelInstanceColor = function(h, R) { 6000 var I = $(h, R, { getProperty: d.useCallback(function(b, w) { 6001 return b.color(w); 6002 }, []), getValue: d.useCallback(function(b) { 6003 return b.value; 6004 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(b) { 6005 return { setValue: function(w) { 6006 b(function(B) { 6007 B.value = w; 6008 }); 6009 }, setRgb: function(w, B, L) { 6010 b(function(ne) { 6011 ne.rgb(w, B, L); 6012 }); 6013 }, setRgba: function(w, B, L, ne) { 6014 b(function(T) { 6015 T.rgba(w, B, L, ne); 6016 }); 6017 }, setAlpha: function(w) { 6018 b(function(B) { 6019 B.alpha(w); 6020 }); 6021 }, setOpacity: function(w) { 6022 b(function(B) { 6023 B.opacity(w); 6024 }); 6025 } }; 6026 }, []) }); 6027 return { value: I.value, setValue: I.setValue, setRgb: I.setRgb, setRgba: I.setRgba, setAlpha: I.setAlpha, setOpacity: I.setOpacity }; 6028 }, u.useViewModelInstanceEnum = function(h, R) { 6029 var I = $(h, R, { getProperty: d.useCallback(function(b, w) { 6030 return b.enum(w); 6031 }, []), getValue: d.useCallback(function(b) { 6032 return b.value; 6033 }, []), defaultValue: null, getExtendedData: d.useCallback(function(b) { 6034 return b.values; 6035 }, []), buildPropertyOperations: d.useCallback(function(b) { 6036 return { setValue: function(w) { 6037 b(function(B) { 6038 B.value = w; 6039 }); 6040 } }; 6041 }, []) }); 6042 return { value: I.value, values: I.extendedData || [], setValue: I.setValue }; 6043 }, u.useViewModelInstanceImage = function(h, R) { 6044 return { setValue: $(h, R, { getProperty: d.useCallback(function(I, b) { 6045 return I.image(b); 6046 }, []), getValue: d.useCallback(function() { 6047 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(I) { 6048 return { setValue: function(b) { 6049 I(function(w) { 6050 w.value = b; 6051 }); 6052 } }; 6053 }, []) }).setValue }; 6054 }, u.useViewModelInstanceList = function(h, R) { 6055 var I, b = d.useState(0)[1], w = $(h, R, { getProperty: d.useCallback(function(B, L) { 6056 return B.list(L); 6057 }, []), getValue: d.useCallback(function(B) { 6058 return B.length; 6059 }, []), defaultValue: null, onPropertyEvent: function() { 6060 b(function(B) { 6061 return B + 1; 6062 }); 6063 }, buildPropertyOperations: d.useCallback(function(B) { 6064 return { addInstance: function(L) { 6065 B(function(ne) { 6066 return ne.addInstance(L); 6067 }); 6068 }, addInstanceAt: function(L, ne) { 6069 var T = !1; 6070 return B(function(Y) { 6071 T = Y.addInstanceAt(L, ne); 6072 }), T; 6073 }, removeInstance: function(L) { 6074 B(function(ne) { 6075 return ne.removeInstance(L); 6076 }); 6077 }, removeInstanceAt: function(L) { 6078 B(function(ne) { 6079 return ne.removeInstanceAt(L); 6080 }); 6081 }, getInstanceAt: function(L) { 6082 var ne = null; 6083 return B(function(T) { 6084 ne = T.instanceAt(L); 6085 }), ne; 6086 }, swap: function(L, ne) { 6087 B(function(T) {
6088 return T.swap(L, ne); 6089 }); 6090 } }; 6091 }, []) }); 6092 return { length: (I = w.value) !== null && I !== void 0 ? I : 0, addInstance: w.addInstance, addInstanceAt: w.addInstanceAt, removeInstance: w.removeInstance, removeInstanceAt: w.removeInstanceAt, getInstanceAt: w.getInstanceAt, swap: w.swap }; 6093 }, u.useViewModelInstanceNumber = function(h, R) { 6094 var I = $(h, R, { getProperty: d.useCallback(function(b, w) { 6095 return b.number(w); 6096 }, []), getValue: d.useCallback(function(b) { 6097 return b.value; 6098 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(b) { 6099 return { setValue: function(w) { 6100 b(function(B) { 6101 B.value = w; 6102 }); 6103 } }; 6104 }, []) }); 6105 return { value: I.value, setValue: I.setValue }; 6106 }, u.useViewModelInstanceString = function(h, R) { 6107 var I = $(h, R, { getProperty: d.useCallback(function(b, w) { 6108 return b.string(w); 6109 }, []), getValue: d.useCallback(function(b) { 6110 return b.value; 6111 }, []), defaultValue: null, buildPropertyOperations: d.useCallback(function(b) { 6112 return { setValue: function(w) { 6113 b(function(B) { 6114 B.value = w; 6115 }); 6116 } }; 6117 }, []) }); 6118 return { value: I.value, setValue: I.setValue }; 6119 }, u.useViewModelInstanceTrigger = function(h, R, I) { 6120 var b = (I ?? {}).onTrigger; 6121 return { trigger: $(h, R, { getProperty: d.useCallback(function(w, B) { 6122 return w.trigger(B); 6123 }, []), getValue: d.useCallback(function() { 6124 }, []), defaultValue: null, onPropertyEvent: b, buildPropertyOperations: d.useCallback(function(w) { 6125 return { trigger: function() { 6126 w(function(B) { 6127 B.trigger(); 6128 }); 6129 } }; 6130 }, []) }).trigger }; 6131 }, Object.keys(C).forEach(function(h) { 6132 h === "default" || u.hasOwnProperty(h) || Object.defineProperty(u, h, { enumerable: !0, get: function() { 6133 return C[h]; 6134 } }); 6135 }); 6136 })(_r)), _r; 6137} 6138var jt = Sa(); 6139const Va = bt` 6140 0% { transform: scale(0.6); opacity: 0.4; } 6141 70% { transform: translateY(-40px) scale(1.3); } 6142 100% { transform: translateY(0) scale(1); opacity: 1; } 6143`, Wa = bt` 6144 0% { transform: translateY(10px); opacity: 0.2 } 6145 100% { transform: translateY(0); opacity: 1 } 6146`, Da = bt` 6147 0% { opacity: 0.5; transform: translateY(-15px) } 6148 100% { opacity: 1; transform: translateY(0) } 6149`, $a = bt` 6150 0% { 6151 transform: scale(1.3) rotate(0deg) translate(0, 0) translateZ(0); 6152 opacity: 1; 6153 } 6154 6155 100% { 6156 transform: scale(6) rotate(-120deg) translate(-50%, 40%) translateZ(500px); 6157 opacity: 1; 6158 } 6159`, Ba = bt` 6160 0% { transform: scale(0.9) } 6161 60% { transform: scale(0.7) } 6162 100% { transform: scale(1.3) translateY(0) } 6163`, Na = (u, d) => d === 1 ? null : u === 0 ? bt` 6164 0% { transform: translate3d(0, 0, 0) } 6165 100% { transform: translate3d(20px, -5px, 0) } 6166 ` : u + 1 === d ? bt` 6167 0% { transform: translate3d(0, 0, 0) rotate3d(0, 0, 0, 0)} 6168 100% { transform: translate3d(-10px, 15px, 0) rotate3d(1, 0, 1, -15deg) } 6169 ` : bt` 6170 0% { transform: rotate3d(0, 0, 0, 0) translateY(0) } 6171 100% { transform: rotate3d(0, 0, 1, -4deg) translateY(15px) } 6172 `, Ua = (u, d) => d === 1 ? null : u === 0 ? bt` 6173 0% { transform: 'none' } 6174 100% { transform: translateX(0) } 6175 ` : bt` 6176 0% { transform: translate3d(0, 0, 0) rotate3d(1, 1, 1, 0deg) } 6177 30% { transform: rotate3d(0, 1, 1, -15deg) } 6178 100% { transform: translateX(-500px) } 6179 `, Ir = "15px", Vr = 1.5, za = 1, Ha = Vr, Ya = 0.4, Mr = Vr * 0.9, Ga = ae.div` 6180 position: relative; 6181 height: 100%; 6182 overflow: hidden; 6183`, Xa = ae.div` 6184 background: transparent; 6185 color: #FFFFFF; 6186 height: 100%; 6187 max-width: 100%; 6188 overflow: hidden; 6189 z-index: 10; 6190 6191 scrollbar-width: none; 6192 &::-webkit-scrollbar {
6193 display: none; 6194 } 6195`, Ka = ae.div` 6196 height: 100%; 6197 margin: 30px ${Ir}; 6198`, Za = ae.div` 6199 display: flex; 6200 flex-direction: column; 6201 justify-content: center; 6202 align-items: center; 6203 position: relative; 6204`, Ja = ae.div` 6205 position: absolute; 6206 left: 50%; 6207 top: 55%; 6208 transform: translate(-50%, -55%); 6209`, qa = ae.div``, Qa = ae.div` 6210 animation: ${Va} ${Ya}s ease-in-out ${Mr}s 1 forwards; 6211 display: flex; 6212 justify-content: center; 6213 align-items: center; 6214 height: inherit; 6215 opacity: 0; 6216 width: 100%; 6217`, es = ae.div` 6218 animation: ${Wa} 0.3s ease-in ${({ 6219 totalCards: u 6220}) => u * 1.5}s forwards; 6221 flex: 1; 6222 opacity: 0; 6223 position: absolute; 6224 bottom: calc(${Ir} * 2); 6225 display: flex; 6226 justify-content: center; 6227 width: 100%; 6228 6229 button { 6230 width: calc(100% - (${Ir} * 2)); 6231 } 6232`, ts = ae.div` 6233 display: ${({ 6234 hide: u 6235}) => u ? "none" : "flex"}; 6236 flex-direction: column; 6237 align-items: center; 6238 opacity: 0; 6239 width: fit-content; 6240 6241 ${({ 6242 animateCopy: u 6243}) => u && Xi` 6244 animation: ${Da} 0.3s ease-in-out 1 forwards; 6245 `} 6246`, ns = ae.div` 6247 color: #F3CB2A; 6248 font-family: ${({ 6249 theme: u 6250}) => u.typography.fonts.secondary}; 6251 font-size: 26px; 6252 font-weight: ${({ 6253 theme: u 6254}) => u.typography.weights.bold}; 6255 line-height: 1.1; 6256 text-transform: uppercase; 6257 text-align: center; 6258 width: 80%; 6259`, rs = ae.div` 6260 color: #FFFFFF; 6261 font-family: ${({ 6262 theme: u 6263}) => u.typography.fonts.secondary}; 6264 font-weight: ${({ 6265 theme: u 6266}) => u.typography.weights.bold}; 6267 margin-top: 10px; 6268`, is = ae.div` 6269 position: absolute; 6270 animation: ${({ 6271 index: u, 6272 totalCards: d 6273}) => Na(u, d)} 0.3s ease-out ${Mr + 1}s forwards, 6274 ${({ 6275 index: u, 6276 totalCards: d 6277}) => Xi`${Ua(u, d)} 1.5s cubic-bezier(.64,.01,.01,1.01) ${d - u + 0.5 + Mr + 1.5}s forwards`}; 6278 z-index: ${({ 6279 index: u 6280}) => u}; 6281`, os = ae.div` 6282 position: absolute; 6283 top: 5%; 6284 left: 0; 6285 width: 100%; 6286 height: 100%; 6287 max-width: 100%; 6288 max-height: 100%; 6289 display: flex; 6290 align-items: center; 6291 justify-content: center; 6292 animation: ${Ba} ${Vr}s ease-in-out 0.5s 1 forwards, ${$a} ${za}s ease-in-out ${Ha}s 1 forwards; 6293 pointer-events: none; 6294 will-change: transform; 6295 perspective: 1000px; 6296 transform: scale(0.9); 6297 z-index: 11; 6298`, as = ae.div` 6299 background: #0A012D; 6300 border-top-left-radius: 20px; 6301 border-top-right-radius: 20px; 6302 position: absolute; 6303 top: 50%; 6304 left: 50%; 6305 transform: translate(-50%, -50%); 6306 height: 100%; 6307 overflow: hidden; 6308 pointer-events: none; 6309 width: 100%; 6310`; 6311function ss({ 6312 totalCards: u, 6313 riveAsset: d 6314}) { 6315 const { 6316 RiveComponent: C 6317 } = jt.useRive({ 6318 buffer: d, 6319 animations: [`bottomSheetLaunch${u}`], 6320 autoplay: !0, 6321 layout: new jt.Layout({ 6322 fit: jt.Fit.Cover, 6323 alignment: jt.Alignment.Center 6324 }) 6325 }), { 6326 RiveComponent: P 6327 } = jt.useRive({ 6328 buffer: d, 6329 animations: ["ConfettiVFX"], 6330 autoplay: !0, 6331 layout: new jt.Layout({ 6332 fit: jt.Fit.Cover, 6333 alignment: jt.Alignment.Center 6334 }) 6335 }); 6336 return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [ 6337 /* @__PURE__ */ E.jsx(os, { children: /* @__PURE__ */ E.jsx(C, {}) }), 6338 /* @__PURE__ */ E.jsx(as, { children: /* @__PURE__ */ E.jsx(P, {}) }) 6339 ] }); 6340} 6341const us = qn.memo(ss), ls = "mfe-sports-proppacks-funnel", Vi = 700; 6342function cs({ 6343 cardRevealPack: u 6344}) { 6345 const [d, C] = Zn(!1), [P, V] = Zn(), Q = sa(u.eventGroupId), N = _a({ 6346 fileName: Q?.gameType ? `card_reveal_animation-${Q?.gameType.toLowerCase()}` : "", 6347 folderName: ls 6348 }); 6349 Xt(() => { 6350 Mt.event({ 6351 event: Tt.GA4_EVENT_NAME, 6352 category: "PropPacks Card Reveal", 6353 action: "Impression" 6354 }); 6355 }, []); 6356 const F = Yt(() => { 6357 C(!0); 6358 }, []), k = Yt((M) => { 6359 V(M?.clientHeight); 6360 }, []), K = rn(() => er.detector.isMobileApp ? globalThis.innerHeight < Vi : P && P < Vi, [P]), J = eo({ 6361 category: Zi.UPCOMING, 6362 eventGroupId: u.eventGroupId 6363 }), { 6364 logoImageSet: ie 6365 } = _n(); 6366 if (!N) 6367 return null; 6368 const Z = u.newPlayerCards.length, a = u.eventName.short.join(" "); 6369 return /* @__PURE__ */ E.jsxs(Ga, { ref: k, children: [ 6370 /* @__PURE__ */ E.jsx(Cn, {}),
6371 /* @__PURE__ */ E.jsx(us, { totalCards: Z, riveAsset: N }), 6372 /* @__PURE__ */ E.jsxs(Xa, { children: [ 6373 /* @__PURE__ */ E.jsxs(Ka, { children: [ 6374 /* @__PURE__ */ E.jsxs(Za, { children: [ 6375 /* @__PURE__ */ E.jsx(qa, { children: ie?.length > 0 && /* @__PURE__ */ E.jsx(An, { children: /* @__PURE__ */ E.jsx(Gt, { sources: ie, alt: "PropPacks Logo" }) }) }), 6376 /* @__PURE__ */ E.jsxs(ts, { animateCopy: d, hide: !!K, children: [ 6377 /* @__PURE__ */ E.jsx(ns, { children: /* @__PURE__ */ E.jsx(Rt, { id: "CARDS_REVEAL_TITLE" }) }), 6378 /* @__PURE__ */ E.jsx(rs, { children: a }) 6379 ] }) 6380 ] }), 6381 /* @__PURE__ */ E.jsx(Ja, { children: /* @__PURE__ */ E.jsx(Qa, { onAnimationStart: F, children: u.newPlayerCards?.map((M, _) => /* @__PURE__ */ E.jsx(is, { index: _, totalCards: Z, children: /* @__PURE__ */ E.jsx(Fa, { card: M, cardRevealPack: u }) }, M.cardUUID)) }) }) 6382 ] }), 6383 /* @__PURE__ */ E.jsx(es, { totalCards: Z, children: /* @__PURE__ */ E.jsx(It, { variant: It.Variant.Primary, size: It.Size.MD, onClick: J, children: /* @__PURE__ */ E.jsx(Rt, { id: "LOBBY_BTN_CTA" }) }) }) 6384 ] }) 6385 ] }); 6386} 6387function Ht() { 6388 return Ht = Object.assign ? Object.assign.bind() : function(u) { 6389 for (var d = 1; d < arguments.length; d++) { 6390 var C = arguments[d]; 6391 for (var P in C) Object.prototype.hasOwnProperty.call(C, P) && (u[P] = C[P]); 6392 } 6393 return u; 6394 }, Ht.apply(this, arguments); 6395} 6396const fs = ["children", "options"]; 6397var Wi, Di; 6398(function(u) { 6399 u.blockQuote = "0", u.breakLine = "1", u.breakThematic = "2", u.codeBlock = "3", u.codeFenced = "4", u.codeInline = "5", u.footnote = "6", u.footnoteReference = "7", u.gfmTask = "8", u.heading = "9", u.headingSetext = "10", u.htmlBlock = "11", u.htmlComment = "12", u.htmlSelfClosing = "13", u.image = "14", u.link = "15", u.linkAngleBraceStyleDetector = "16", u.linkBareUrlDetector = "17", u.linkMailtoDetector = "18", u.newlineCoalescer = "19", u.orderedList = "20", u.paragraph = "21", u.ref = "22", u.refImage = "23", u.refLink = "24", u.table = "25", u.tableSeparator = "26", u.text = "27", u.textBolded = "28", u.textEmphasized = "29", u.textEscaped = "30", u.textMarked = "31", u.textStrikethroughed = "32", u.unorderedList = "33"; 6400})(Wi || (Wi = {})), (function(u) { 6401 u[u.MAX = 0] = "MAX", u[u.HIGH = 1] = "HIGH", u[u.MED = 2] = "MED", u[u.LOW = 3] = "LOW", u[u.MIN = 4] = "MIN"; 6402})(Di || (Di = {})); 6403const $i = ["allowFullScreen", "allowTransparency", "autoComplete", "autoFocus", "autoPlay", "cellPadding", "cellSpacing", "charSet", "className", "classId", "colSpan", "contentEditable", "contextMenu", "crossOrigin", "encType", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "frameBorder", "hrefLang", "inputMode", "keyParams", "keyType", "marginHeight", "marginWidth", "maxLength", "mediaGroup", "minLength", "noValidate", "radioGroup", "readOnly", "rowSpan", "spellCheck", "srcDoc", "srcLang", "srcSet", "tabIndex", "useMap"].reduce((u, d) => (u[d.toLowerCase()] = d, u), { for: "htmlFor" }), Bi = { amp: "&", apos: "'", gt: ">", lt: "<", nbsp: "Â ", quot: "â" }, ds = ["style", "script"], hs = /([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi, ps = /mailto:/i, ms = /\n{2,}$/, no = /^(\s*>[\s\S]*?)(?=\n{2,})/, vs = /^ *> ?/gm, gs = /^ {2,}\n/, ys = /^(?:( *[-*_])){3,} *(?:\n *)+\n/, ro = /^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/, io = /^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/, bs = /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, ws = /^(?:\n *)*\n/, _s = /\r\n?/g, Cs = /^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/, As = /^\[\^([^\]]+)]/, xs = /\f/g, Es = /^---[ \t]*\n(.|\n)*\n---[ \t]*\n/, Ps = /^\s*?\[(x|\s)\]/, oo = /^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, ao = /^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, so = /^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/, Tr = /^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i, Rs = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});
6403/gi, uo = /^<!--[\s\S]*?(?:-->)/, Is = /^(data|aria|x)-[a-z_][a-z\d_.-]*$/, kr = /^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i, Ms = /^\{.*\}$/, Ts = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, ks = /^<([^ >]+@[^ >]+)>/, Ls = /^<([^ >]+:\/[^ >]+)>/, Fs = /-([a-z])?/gi, lo = /^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/, Os = /^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/, js = /^!\[([^\]]*)\] ?\[([^\]]*)\]/, Ss = /^\[([^\]]*)\] ?\[([^\]]*)\]/, Vs = /(\[|\])/g, Ws = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/, Ds = /\t/g, $s = /(^ *\||\| *$)/g, Bs = /^ *:-+: *$/, Ns = /^ *:-+ *$/, Us = /^ *-+: *$/, nr = "((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)", zs = new RegExp(`^([*_])\\1${nr}\\1\\1(?!\\1)`), Hs = new RegExp(`^([*_])${nr}\\1(?!\\1|\\w)`), Ys = new RegExp(`^==${nr}==`), Gs = new RegExp(`^~~${nr}~~`), Xs = /^\\([^0-9A-Za-z\s])/, Ks = /^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i, Zs = /^\n+/, Js = /^([ \t]*)/, qs = /\\([^\\])/g, Ni = / *\n+$/, Qs = /(?:^|\n)( *)$/, Wr = "(?:\\d+\\.)", Dr = "(?:[*+-])"; 6404function co(u) { 6405 return "( *)(" + (u === 1 ? Wr : Dr) + ") +"; 6406} 6407const fo = co(1), ho = co(2); 6408function po(u) { 6409 return new RegExp("^" + (u === 1 ? fo : ho)); 6410} 6411const eu = po(1), tu = po(2); 6412function mo(u) { 6413 return new RegExp("^" + (u === 1 ? fo : ho) + "[^\\n]*(?:\\n(?!\\1" + (u === 1 ? Wr : Dr) + " )[^\\n]*)*(\\n|$)", "gm"); 6414} 6415const vo = mo(1), go = mo(2); 6416function yo(u) { 6417 const d = u === 1 ? Wr : Dr; 6418 return new RegExp("^( *)(" + d + ") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1" + d + " (?!" + d + " ))\\n*|\\s*\\n*$)"); 6419} 6420const bo = yo(1), wo = yo(2); 6421function Ui(u, d) { 6422 const C = d === 1, P = C ? bo : wo, V = C ? vo : go, Q = C ? eu : tu; 6423 return { match(N, F, k) { 6424 const K = Qs.exec(k); 6425 return K && (F.list || !F.inline && !F.simple) ? P.exec(N = K[1] + N) : null; 6426 }, order: 1, parse(N, F, k) { 6427 const K = C ? +N[2] : void 0, J = N[0].replace(ms, ` 6428`).match(V); 6429 let ie = !1; 6430 return { items: J.map(function(Z, a) { 6431 const M = Q.exec(Z)[0].length, _ = new RegExp("^ {1," + M + "}", "gm"), ue = Z.replace(_, "").replace(Q, ""), q = a === J.length - 1, oe = ue.indexOf(` 6432 6433`) !== -1 || q && ie; 6434 ie = oe; 6435 const fe = k.inline, de = k.list; 6436 let ye; 6437 k.list = !0, oe ? (k.inline = !1, ye = ue.replace(Ni, ` 6438 6439`)) : (k.inline = !0, ye = ue.replace(Ni, "")); 6440 const Ie = F(ye, k); 6441 return k.inline = fe, k.list = de, Ie; 6442 }), ordered: C, start: K }; 6443 }, render: (N, F, k) => u(N.ordered ? "ol" : "ul", { key: k.key, start: N.type === "20" ? N.start : void 0 }, N.items.map(function(K, J) { 6444 return u("li", { key: J }, F(K, k)); 6445 })) }; 6446} 6447const nu = new RegExp(`^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`), ru = /^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/, _o = [no, ro, io, oo, so, ao, uo, lo, vo, bo, go, wo], iu = [..._o, /^[^\n]+(?: \n|\n{2,})/, Tr, kr]; 6448function ou(u) { 6449 return u.replace(/[ÃÃÃÃÃà à áâãäåæÃ]/g, "a").replace(/[çÃ]/g, "c").replace(/[ðÃ]/g, "d").replace(/[ÃÃÃÃéèêë]/g, "e").replace(/[ÃïÃîÃÃÃì]/g, "i").replace(/[Ãñ]/g, "n").replace(/[øÃÅÅÃõÃôÃóÃò]/g, "o").replace(/[ÃüÃûÃúÃù]/g, "u").replace(/[ŸÿÃý]/g, "y").replace(/[^a-z0-9- ]/gi, "").replace(/ /gi, "-").toLowerCase(); 6450} 6451function au(u) { 6452 return Us.test(u) ? "right" : Bs.test(u) ? "center" : Ns.test(u) ? "left" : null; 6453} 6454function zi(u, d, C, P) { 6455 const V = C.inTable; 6456 C.inTable = !0; 6457 let Q = u.trim().split(/( *(?:`[^`]*`|<.*?>.*?<\/.*?>(?!<\/.*?>)|\\\||\|) *)/).reduce((F, k) => (k.trim() === "|" ? F.push(P ? { type: "26" } : { type: "27", text: k }) : k !== "" && F.push.apply(F, d(k, C)), F), []); 6458 C.inTable = V; 6459 let N = [[]]; 6460 return Q.forEach(function(F, k) { 6461 F.type === "26" ? k !== 0 && k !== Q.length - 1 && N.push([]) : (F.type !== "27" || Q[k + 1] != null && Q[k + 1].type !== "26" || (F.text = F.text.trimEnd()), N[N.length - 1].push(F)); 6462 }), N; 6463} 6464function su(u, d, C) { 6465 C.inline = !0; 6466 const P = u[2] ? u[2].replace($s, "").split("|").map(au) : [], V = u[3] ? (function(N, F, k) { 6467 return N.trim().split(` 6468`).map(function(K) { 6469 return zi(K, F, k, !0); 6470 }); 6471 })(u[3], d, C) : [], Q = zi(u[1], d, C, !!V.length); 6472 return C.inline = !1, V.length ? { align: P, cells: V, header: Q, type: "25" } : { children: Q, type: "21" }; 6473} 6474function Hi(u, d) { 6475 return u.align[d] == null ? {} : { textAlign: u.align[d] }; 6476} 6477function St(u) { 6478 return function(d, C) { 6479 return C.inline ? u.exec(d) : null; 6480 }; 6481} 6482function Vt(u) { 6483 return function(d, C) { 6484 return C.inline || C.simple ? u.exec(d) : null; 6485 }; 6486} 6487function Pt(u) { 6488 return function(d, C) { 6489 return C.inline || C.simple ? null : u.exec(d); 6490 }; 6491} 6492function yn(u) { 6493 return function(d) { 6494 return u.exec(d); 6495 }; 6496} 6497function uu(u, d, C) { 6498 if (d.inline || d.simple || C && !C.endsWith(` 6499`)) return null; 6500 let P = ""; 6501 u.split(` 6502`).every((Q) => !_o.some((N) => N.test(Q)) && (P += Q + ` 6503`, Q.trim())); 6504 const V = P.trimEnd(); 6505 return V == "" ? null : [P, V]; 6506} 6507function nn(u) { 6508 try { 6509 if (decodeURIComponent(u).replace(/[^A-Za-z0-9/:]/g, "").match(/^\s*(javascript|vbscript|data(?!:image)):/i)) return; 6510 } catch { 6511 return null; 6512 } 6513 return u; 6514} 6515function Yi(u) { 6516 return u.replace(qs, "$1"); 6517} 6518function Kn(u, d, C) { 6519 const P = C.inline || !1, V = C.simple || !1; 6520 C.inline = !0, C.simple = !0; 6521 const Q = u(d, C); 6522 return C.inline = P, C.simple = V, Q; 6523} 6524function lu(u, d, C) { 6525 const P = C.inline || !1, V = C.simple || !1; 6526 C.inline = !1, C.simple = !0; 6527 const Q = u(d, C); 6528 return C.inline = P, C.simple = V, Q; 6529} 6530function cu(u, d, C) { 6531 const P = C.inline || !1; 6532 C.inline = !1; 6533 const V = u(d, C); 6534 return C.inline = P, V; 6535} 6536const Cr = (u, d, C) => ({ children: Kn(d, u[1], C) }); 6537function Ar() { 6538 return {}; 6539} 6540function xr() { 6541 return null; 6542} 6543function fu(...u) { 6544 return u.filter(Boolean).join(" "); 6545} 6546function Er(u, d, C) { 6547 let P = u; 6548 const V = d.split("."); 6549 for (; V.length && (P = P[V[0]], P !== void 0); ) V.shift(); 6550 return P || C; 6551} 6552function du(u = "", d = {}) { 6553 d.overrides = d.overrides || {}, d.slugify = d.slugify || ou, d.namedCodesToUnicode = d.namedCodesToUnicode ? Ht({}, Bi, d.namedCodesToUnicode) : Bi; 6554 const C = d.createElement || Gn.createElement; 6555 function P(a, M, ..._) { 6556 const ue = Er(d.overrides, `${a}.props`, {}); 6557 return C((function(q, oe) { 6558 const fe = Er(oe, q); 6559 return fe ? typeof fe == "function" || typeof fe == "object" && "render" in fe ? fe : Er(oe, `${q}.component`, q) : q; 6560 })(a, d.overrides), Ht({}, M, ue, { className: fu(M?.className, ue.className) || void 0 }), ..._); 6561 } 6562 function V(a) { 6563 a = a.replace(Es, ""); 6564 let M = !1; 6565 d.forceInline ? M = !0 : d.forceBlock || (M = Ws.test(a) === !1); 6566 const _ = J(K(M ? a : `${a.trimEnd().replace(Zs, "")} 6567 6568`, { inline: M })); 6569 for (; typeof _[_.length - 1] == "string" && !_[_.length - 1].trim(); ) _.pop(); 6570 if (d.wrapper === null) return _; 6571 const ue = d.wrapper || (M ? "span" : "div"); 6572 let q; 6573 if (_.length > 1 || d.forceWrapper) q = _; 6574 else { 6575 if (_.length === 1) return q = _[0], typeof q == "string" ? P("span", { key: "outer" }, q) : q; 6576 q = null; 6577 } 6578 return Gn.createElement(ue, { key: "outer" }, q); 6579 } 6580 function Q(a) { 6581 const M = a.match(hs); 6582 return M ? M.reduce(function(_, ue, q) { 6583 const oe = ue.indexOf("="); 6584 if (oe !== -1) { 6585 const fe = (function(be) { 6586 return be.indexOf("-") !== -1 && be.match(Is) === null && (be = be.replace(Fs, function(je, z) { 6587 return z.toUpperCase(); 6588 })), be; 6589 })(ue.slice(0, oe)).trim(), de = (function(be) { 6590 const je = be[0]; 6591 return (je === '"' || je === "'") && be.length >= 2 && be[be.length - 1] === je ? be.slice(1, -1) : be; 6592 })(ue.slice(oe + 1).trim()), ye = $i[fe] || fe, Ie = _[ye] = (function(be, je) { 6593 return be === "style" ? je.split(/;\s?/).reduce(function(z, $) { 6594 const h = $.slice(0, $.indexOf(":")); 6595 return z[h.trim().replace(/(-[a-z])/g, (R) => R[1].toUpperCase())] = $.slice(h.length + 1).trim(), z; 6596 }, {}
6596) : be === "href" || be === "src" ? nn(je) : (je.match(Ms) && (je = je.slice(1, je.length - 1)), je === "true" || je !== "false" && je); 6597 })(fe, de); 6598 typeof Ie == "string" && (Tr.test(Ie) || kr.test(Ie)) && (_[ye] = Gn.cloneElement(V(Ie.trim()), { key: q })); 6599 } else ue !== "style" && (_[$i[ue] || ue] = !0); 6600 return _; 6601 }, {}) : null; 6602 } 6603 const N = [], F = {}, k = { 0: { match: Pt(no), order: 1, parse: (a, M, _) => ({ children: M(a[0].replace(vs, ""), _) }), render: (a, M, _) => P("blockquote", { key: _.key }, M(a.children, _)) }, 1: { match: yn(gs), order: 1, parse: Ar, render: (a, M, _) => P("br", { key: _.key }) }, 2: { match: Pt(ys), order: 1, parse: Ar, render: (a, M, _) => P("hr", { key: _.key }) }, 3: { match: Pt(io), order: 0, parse: (a) => ({ lang: void 0, text: a[0].replace(/^ {4}/gm, "").replace(/\n+$/, "") }), render: (a, M, _) => P("pre", { key: _.key }, P("code", Ht({}, a.attrs, { className: a.lang ? `lang-${a.lang}` : "" }), a.text)) }, 4: { match: Pt(ro), order: 0, parse: (a) => ({ attrs: Q(a[3] || ""), lang: a[2] || void 0, text: a[4], type: "3" }) }, 5: { match: Vt(bs), order: 3, parse: (a) => ({ text: a[2] }), render: (a, M, _) => P("code", { key: _.key }, a.text) }, 6: { match: Pt(Cs), order: 0, parse: (a) => (N.push({ footnote: a[2], identifier: a[1] }), {}), render: xr }, 7: { match: St(As), order: 1, parse: (a) => ({ target: `#${d.slugify(a[1])}`, text: a[1] }), render: (a, M, _) => P("a", { key: _.key, href: nn(a.target) }, P("sup", { key: _.key }, a.text)) }, 8: { match: St(Ps), order: 1, parse: (a) => ({ completed: a[1].toLowerCase() === "x" }), render: (a, M, _) => P("input", { checked: a.completed, key: _.key, readOnly: !0, type: "checkbox" }) }, 9: { match: Pt(d.enforceAtxHeadings ? ao : oo), order: 1, parse: (a, M, _) => ({ children: Kn(M, a[2], _), id: d.slugify(a[2]), level: a[1].length }), render: (a, M, _) => P(`h${a.level}`, { id: a.id, key: _.key }, M(a.children, _)) }, 10: { match: Pt(so), order: 0, parse: (a, M, _) => ({ children: Kn(M, a[1], _), level: a[2] === "=" ? 1 : 2, type: "9" }) }, 11: { match: yn(Tr), order: 1, parse(a, M, _) { 6604 const [, ue] = a[3].match(Js), q = new RegExp(`^${ue}`, "gm"), oe = a[3].replace(q, ""), fe = (de = oe, iu.some((je) => je.test(de)) ? cu : Kn); 6605 var de; 6606 const ye = a[1].toLowerCase(), Ie = ds.indexOf(ye) !== -1, be = { attrs: Q(a[2]), noInnerParse: Ie, tag: (Ie ? ye : a[1]).trim() }; 6607 return _.inAnchor = _.inAnchor || ye === "a", Ie ? be.text = a[3] : be.children = fe(M, oe, _), _.inAnchor = !1, be; 6608 }, render: (a, M, _) => P(a.tag, Ht({ key: _.key }, a.attrs), a.text || M(a.children, _)) }, 13: { match: yn(kr), order: 1, parse: (a) => ({ attrs: Q(a[2] || ""), tag: a[1].trim() }), render: (a, M, _) => P(a.tag, Ht({}, a.attrs, { key: _.key })) }, 12: { match: yn(uo), order: 1, parse: () => ({}), render: xr }, 14: { match: Vt(ru), order: 1, parse: (a) => ({ alt: a[1], target: Yi(a[2]), title: a[3] }), render: (a, M, _) => P("img", { key: _.key, alt: a.alt || void 0, title: a.title || void 0, src: nn(a.target) }) }, 15: { match: St(nu), order: 3, parse: (a, M, _) => ({ children: lu(M, a[1], _), target: Yi(a[2]), title: a[3] }), render: (a, M, _) => P("a", { key: _.key, href: nn(a.target), title: a.title }, M(a.children, _)) }, 16: { match: St(Ls), order: 0, parse: (a) => ({ children: [{ text: a[1], type: "27" }], target: a[1], type: "15" }) }, 17: { match: (a, M) => M.inAnchor ? null : St(Ts)(a, M), order: 0, parse: (a) => ({ children: [{ text: a[1], type: "27" }], target: a[1], title: void 0, type: "15" }) }, 18: { match: St(ks), order: 0, parse(a) { 6609 let M = a[1], _ = a[1]; 6610 return ps.test(_) || (_ = "mailto:" + _), { children: [{ text: M.replace("mailto:", ""), type: "27" }], target: _, type: "15" }; 6611 } }, 20: Ui(P, 1), 33: Ui(P, 2), 19: { match: Pt(ws), order: 3, parse: Ar, render: () => ` 6612` }, 21: { match: uu, order: 3, parse: Cr, render: (a, M, _) => P("p", { key: _.key }, M(a.children, _)) }, 22: { match: St(Os), order: 0, parse: (a) => (F[a[1]] = { target: a[2], title: a[4] }, {}), render: xr }, 23: { match: Vt(js), order: 0, parse: (a) => ({ alt: a[1] || void 0, ref: a[2] }), render: (a, M, _) => F[a.ref] ? P("img", { key: _.key, alt: a.alt, src: nn(F[a.ref].target), title: F[a.ref].title }) : null }, 24: { match: St(Ss), order: 0, parse: (a, M, _) => ({ children: M(a[1], _), fallbackChildren: M(a[0].replace(Vs, "\\$1"), _), ref: a[2] }), render: (a, M, _) =>
6612 F[a.ref] ? P("a", { key: _.key, href: nn(F[a.ref].target), title: F[a.ref].title }, M(a.children, _)) : P("span", { key: _.key }, M(a.fallbackChildren, _)) }, 25: { match: Pt(lo), order: 1, parse: su, render(a, M, _) { 6613 const ue = a; 6614 return P("table", { key: _.key }, P("thead", null, P("tr", null, ue.header.map(function(q, oe) { 6615 return P("th", { key: oe, style: Hi(ue, oe) }, M(q, _)); 6616 }))), P("tbody", null, ue.cells.map(function(q, oe) { 6617 return P("tr", { key: oe }, q.map(function(fe, de) { 6618 return P("td", { key: de, style: Hi(ue, de) }, M(fe, _)); 6619 })); 6620 }))); 6621 } }, 27: { match: yn(Ks), order: 4, parse: (a) => ({ text: a[0].replace(Rs, (M, _) => d.namedCodesToUnicode[_] ? d.namedCodesToUnicode[_] : M) }), render: (a) => a.text }, 28: { match: Vt(zs), order: 2, parse: (a, M, _) => ({ children: M(a[2], _) }), render: (a, M, _) => P("strong", { key: _.key }, M(a.children, _)) }, 29: { match: Vt(Hs), order: 3, parse: (a, M, _) => ({ children: M(a[2], _) }), render: (a, M, _) => P("em", { key: _.key }, M(a.children, _)) }, 30: { match: Vt(Xs), order: 1, parse: (a) => ({ text: a[1], type: "27" }) }, 31: { match: Vt(Ys), order: 3, parse: Cr, render: (a, M, _) => P("mark", { key: _.key }, M(a.children, _)) }, 32: { match: Vt(Gs), order: 3, parse: Cr, render: (a, M, _) => P("del", { key: _.key }, M(a.children, _)) } }; 6622 d.disableParsingRawHTML === !0 && (delete k[11], delete k[13]); 6623 const K = (function(a) { 6624 let M = Object.keys(a); 6625 function _(ue, q) { 6626 let oe = [], fe = ""; 6627 for (; ue; ) { 6628 let de = 0; 6629 for (; de < M.length; ) { 6630 const ye = M[de], Ie = a[ye], be = Ie.match(ue, q, fe); 6631 if (be) { 6632 const je = be[0]; 6633 ue = ue.substring(je.length); 6634 const z = Ie.parse(be, _, q); 6635 z.type == null && (z.type = ye), oe.push(z), fe = je; 6636 break; 6637 } 6638 de++; 6639 } 6640 } 6641 return oe; 6642 } 6643 return M.sort(function(ue, q) { 6644 let oe = a[ue].order, fe = a[q].order; 6645 return oe !== fe ? oe - fe : ue < q ? -1 : 1; 6646 }), function(ue, q) { 6647 return _((function(oe) { 6648 return oe.replace(_s, ` 6649`).replace(xs, "").replace(Ds, " "); 6650 })(ue), q); 6651 }; 6652 })(k), J = (ie = /* @__PURE__ */ (function(a, M) { 6653 return function(_, ue, q) { 6654 const oe = a[_.type].render; 6655 return M ? M(() => oe(_, ue, q), _, ue, q) : oe(_, ue, q); 6656 }; 6657 })(k, d.renderRule), function a(M, _ = {}) { 6658 if (Array.isArray(M)) { 6659 const ue = _.key, q = []; 6660 let oe = !1; 6661 for (let fe = 0; fe < M.length; fe++) { 6662 _.key = fe; 6663 const de = a(M[fe], _), ye = typeof de == "string"; 6664 ye && oe ? q[q.length - 1] += de : de !== null && q.push(de), oe = ye; 6665 } 6666 return _.key = ue, q; 6667 } 6668 return ie(M, a, _); 6669 }); 6670 var ie; 6671 const Z = V(u); 6672 return N.length ? P("div", null, Z, P("footer", { key: "footer" }, N.map(function(a) { 6673 return P("div", { id: d.slugify(a.identifier), key: a.identifier }, a.identifier, J(K(a.footnote, { inline: !0 }))); 6674 }))) : Z; 6675} 6676const wn = (u) => { 6677 let { children: d = "", options: C } = u, P = (function(V, Q) { 6678 if (V == null) return {}; 6679 var N, F, k = {}, K = Object.keys(V); 6680 for (F = 0; F < K.length; F++) Q.indexOf(N = K[F]) >= 0 || (k[N] = V[N]); 6681 return k; 6682 })(u, fs); 6683 return Gn.cloneElement(du(d, C), P); 6684}, hu = ae.div(["display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;height:100%;color:", ";font-family:", ";font-size:", ";font-style:normal;font-weight:", ";line-height:24px;word-wrap:break-word;padding:24px 16px 16px 16px;background-color:#0A012D;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"], ({ 6685 theme: u 6686}) => u.colors.neutral[50], ({ 6687 theme: u 6688}) => u.typography.fonts.primary, ({ 6689 theme: u 6690}) => u.typography.sizes.md, ({ 6691 theme: u 6692}) => u.typography.weights.regular), pu = ae.div(["margin-bottom:65px;"]), mu = ae.h1(["border:none;font-weight:bold;font-size:24px;margin:0;text-align:center;"]), vu = ae.h2(["font-size:22px;text-align:center;"]), gu = ae.h3(["font-size:", ";"], ({ 6693 theme: u 6694}) => u.typography.sizes.lg), yu = ae.p(["&:first-of-type{margin-bottom:0;margin-top:0;}strong{font-size:17px;}"]), bu = ae.table(["border-collapse:collapse;margin:16px 0;th,td{border:1px solid grey;padding:5px;}"]); 6695function wu() { 6696 const { 6697 config: u 6698 } = at(); 6699 return Xt(() => { 6700 Mt.event({ 6701 event: Tt.GA4_EVENT_NAME, 6702 category: "PropPacks Game Rules View", 6703 action: "Impression", 6704 label: "PropPacks Game Rules View Loaded" 6705 }); 6706 }
6706, []), u?.rules ? /* @__PURE__ */ E.jsxs(hu, { children: [ 6707 /* @__PURE__ */ E.jsx(Cn, {}), 6708 /* @__PURE__ */ E.jsx(pu, { children: /* @__PURE__ */ E.jsx(wn, { options: { 6709 wrapper: "div", 6710 overrides: { 6711 h1: { 6712 component: mu 6713 }, 6714 h2: { 6715 component: vu 6716 }, 6717 p: { 6718 component: yu 6719 }, 6720 table: { 6721 component: bu 6722 }, 6723 h3: { 6724 component: gu 6725 } 6726 } 6727 }, children: u.rules }) }) 6728 ] }) : null; 6729} 6730function _u({ 6731 ruleNo: u, 6732 content: d, 6733 title: C, 6734 light: P = !1 6735}) { 6736 const V = _n(), Q = rn(() => { 6737 const N = Math.floor(Math.random() * 3) + 1, F = V?.[`gameRule${N}ImageSet`]; 6738 if (!u || u > 3) 6739 return F; 6740 switch (u) { 6741 case 1: 6742 return V?.gameRule1ImageSet ?? []; 6743 case 2: 6744 return V?.gameRule2ImageSet ?? []; 6745 case 3: 6746 return V?.gameRule3ImageSet ?? []; 6747 default: 6748 return F; 6749 } 6750 }, [V, u]); 6751 return /* @__PURE__ */ E.jsxs(bn, { light: P, children: [ 6752 /* @__PURE__ */ E.jsx(Ea, { light: P, children: u }), 6753 /* @__PURE__ */ E.jsxs(Pa, { light: P, children: [
6754 /* @__PURE__ */ E.jsxs(Ra, { children: [ 6755 /* @__PURE__ */ E.jsx(Ta, { children: /* @__PURE__ */ E.jsx(wn, { children: C }) }), 6756 /* @__PURE__ */ E.jsx(wn, { children: d }) 6757 ] }), 6758 /* @__PURE__ */ E.jsx(Ia, { children: /* @__PURE__ */ E.jsx(Ma, { children: /* @__PURE__ */ E.jsx(Gt, { sources: Q, alt: `Rule ${u}` }) }) }) 6759 ] }) 6760 ] }); 6761} 6762function Cu({ 6763 light: u = !1 6764}) { 6765 const { 6766 messages: d 6767 } = Or(), { 6768 config: C 6769 } = at(); 6770 if (!C) 6771 return null; 6772 const P = Object.keys(d).filter((V) => V.startsWith(`${C?.gameType}_RULE_CONTENT_`)); 6773 return /* @__PURE__ */ E.jsx(E.Fragment, { children: P.map((V, Q) => { 6774 const N = Q + 1, F = `${C?.gameType}_RULE_TITLE_${N}`, k = d[F], K = d[V]; 6775 return /* @__PURE__ */ E.jsx(_u, { content: K, ruleNo: N, title: k, light: u }, V); 6776 }) }); 6777} 6778const Co = Fr(Cu), Wt = new Ji.Client(Jn.TEAM), { 6779 eventTypes: bl 6780} = Ji; 6781function Au({ 6782 analyticsCategory: u, 6783 isLoggedIn: d 6784}) { 6785 const { 6786 config: C 6787 } = at(); 6788 return Yt(() => { 6789 if (Mt.event({ 6790 event: Tt.GA4_EVENT_NAME, 6791 category: u, 6792 action: "Opt-in button clicked", 6793 label: `isLoggedIn: ${d}` 6794 }), !d) { 6795 Wt.publish(Wt.eventTypes.LOGIN_REQUESTED, {}, { 6796 withHistory: !0 6797 }); 6798 return; 6799 } 6800 if (!C) { 6801 jr.warn("PropPacksSettings are not available."); 6802 return; 6803 } 6804 Wt.publish(Wt.eventTypes.PROMO_GAME_OPT_IN_REQUESTED, { 6805 gameName: "PROPPACKS", 6806 groupId: Number(C.groupId) 6807 }, { 6808 withHistory: !0 6809 }); 6810 }, [u, C, d]); 6811} 6812function Lr({ 6813 analyticsCategory: u, 6814 isLoggedIn: d 6815}) { 6816 const C = Au({ 6817 analyticsCategory: u, 6818 isLoggedIn: d 6819 }), P = d ? "OPT_IN_POST_LOGIN_BUTTON_LABEL" : "OPT_IN_PRE_LOGIN_BUTTON_LABEL"; 6820 return /* @__PURE__ */ E.jsx(It, { variant: It.Variant.Primary, size: It.Size.LG, onClick: C, children: /* @__PURE__ */ E.jsx(Rt, { id: P }) }); 6821} 6822const xu = ae.div(["display:flex;flex-direction:column;align-items:center;color:#192027;text-align:center;font-family:", ";font-size:", ";font-weight:", ";line-height:24px;padding:12px 12px 0 12px;div{margin-top:8px;}button{background:none;padding:0;margin:0;border:none;text-decoration:underline;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;}span{margin-right:4px;}"], ({ 6823 theme: u 6824}) => u.typography.fonts.primary, ({ 6825 theme: u 6826}) => u.typography.sizes.md, ({ 6827 theme: u 6828}) => u.typography.weights.normal); 6829function Eu() { 6830 const { 6831 config: u 6832 } = at(), d = Yt((C) => { 6833 Mt.event({ 6834 event: Tt.GA4_EVENT_NAME, 6835 category: "PropPacks HowTo", 6836 action: "HowTo Lobby Footer Link clicked", 6837 label: C 6838 }), Wt.publish(Wt.eventTypes.OPEN_PROPPACKS_FUNNEL, { 6839 variant: C, 6840 eventGroupId: Number(u?.groupId) 6841 }); 6842 }, [u?.groupId]); 6843 return /* @__PURE__ */ E.jsxs(xu, { children: [ 6844 /* @__PURE__ */ E.jsxs("div", { children: [
6845 /* @__PURE__ */ E.jsx("span", { children: /* @__PURE__ */ E.jsx(Rt, { id: "LOBBY_FOOTER_GAME_RULES_PROPPACKS" }) }), 6846 /* @__PURE__ */ E.jsx("button", { type: "button", onClick: () => d("GAME_RULES"), children: /* @__PURE__ */ E.jsx(Rt, { id: "LOBBY_FOOTER_GAME_RULES_LINK" }) }) 6847 ] }), 6848 /* @__PURE__ */ E.jsx("div", { children: /* @__PURE__ */ E.jsx("button", { type: "button", onClick: () => d("TERMS"), children: /* @__PURE__ */ E.jsx(Rt, { id: "LOBBY_FOOTER_TERMS_LINK" }) }) }) 6849 ] }); 6850} 6851const Pu = Fr(Eu), Ru = ae.div` 6852 padding: 24px 20px; 6853 height: 100%; 6854 overflow-x: hidden; 6855 overflow-y: auto; 6856 position: relative; 6857 background-color: #ecf4fb; 6858 6859 scrollbar-width: none; 6860 &::-webkit-scrollbar { 6861 display: none; 6862 } 6863 6864 @media only screen and (min-width: ${({ 6865 theme: u 6866}) => u.breakpoints.md}) { 6867 padding: 32px; 6868 } 6869`, Iu = ae.div` 6870 padding-top: 8px; 6871 display: flex; 6872 flex-direction: column; 6873 box-sizing: border-box; 6874 color: #33414F; 6875 flex: 1; 6876 width: 100%; 6877 6878 button { 6879 flex: 1 6880 } 6881 6882 @media only screen and (min-width: ${({ 6883 theme: u 6884}) => u.breakpoints.md}) { 6885 display: none; 6886 } 6887`, Ao = ae.div` 6888 display: none; 6889 color: #33414F; 6890 6891 @media only screen and (min-width: ${({ 6892 theme: u 6893}) => u.breakpoints.md}) { 6894 display: flex; 6895 flex-direction: column; 6896 6897 > button { 6898 flex: 1; 6899 } 6900 } 6901`, Mu = ae.div` 6902 display: flex; 6903 flex-direction: column; 6904 align-items: center; 6905 6906 @media only screen and (min-width: ${({ 6907 theme: u 6908}) => u.breakpoints.md}) { 6909 display: grid; 6910 grid-template-columns: 6fr 4fr; 6911 grid-template-rows: min-content auto auto auto; 6912 grid-gap: 8px; 6913 margin-bottom: 40px; 6914 6915 > { 6916 margin: 0; 6917 } 6918 6919 // Column 1 6920 ${An} { 6921 grid-column: 1 / 2; 6922 grid-row: 1 / 2; 6923 } 6924 6925 ${tr} { 6926 grid-column: 1 / 2; 6927 grid-row: 2 / 3; 6928 margin: 0; 6929 } 6930 6931 ${to} { 6932 grid-column: 1 / 2; 6933 grid-row: 3 / 4; 6934 margin: 0; 6935 } 6936 6937 ${Ao} { 6938 grid-column: 1 / 2; 6939 grid-row: 4 / 5; 6940 } 6941 6942 // Column 2 6943 ${Sr} { 6944 grid-column: 2 / 3; 6945 grid-row: 1 / 5; 6946 align-self: center; 6947 } 6948 } 6949 6950 @media only screen and (min-width: ${({ 6951 theme: u 6952}) => u.breakpoints.lg}) { 6953 grid-template-columns: 7fr 3fr; 6954 } 6955`, Tu = ae.div` 6956 display: flex; 6957 flex-direction: column; 6958 6959 @media only screen and (min-width: ${({ 6960 theme: u 6961}) => u.breakpoints.md}) { 6962 display: grid; 6963 grid-template-columns: 1fr 1fr; 6964 grid-template-rows: auto 1fr; 6965 grid-gap: 8px; 6966 6967 > ${bn} { 6968 margin: 0; 6969 } 6970 6971 > ${bn}:first-of-type { 6972 grid-column: 1 / 2; 6973 grid-row: 1 / 3; 6974 } 6975 6976 > ${bn}:nth-of-type(2) { 6977 grid-column: 2 / 3; 6978 grid-row: 1 / 2; 6979 } 6980 6981 > ${bn}:last-of-type { 6982 grid-column: 2 / 3; 6983 grid-row: 2 / 3; 6984 } 6985 } 6986`; 6987function ku({ 6988 isLoggedIn: u 6989}) { 6990 const { 6991 formatMessage: d 6992 } = Or(), { 6993 config: C 6994 } = at(); 6995 Xt(() => { 6996 Mt.event({ 6997 event: Tt.GA4_EVENT_NAME, 6998 category: "PropPacks HowTo Lobby", 6999 action: "Impression" 7000 }); 7001 }, []); 7002 const { 7003 logoImageSet: P, 7004 packAndTwoCardsImageSet: V 7005 } = _n(); 7006 return /* @__PURE__ */ E.jsxs(Ru, { children: [ 7007 /* @__PURE__ */ E.jsxs(Mu, { children: [ 7008 P?.length > 0 && /* @__PURE__ */ E.jsx(An, { hideOnMobile: !0, children: /* @__PURE__ */ E.jsx(Gt, { sources: P, alt: "PropPacks Logo" }) }),
7009 /* @__PURE__ */ E.jsx(tr, { light: !0, children: /* @__PURE__ */ E.jsx(wn, { children: d({ 7010 id: "HOW_TO_TITLE" 7011 }) }) }), 7012 /* @__PURE__ */ E.jsx(Iu, { children: /* @__PURE__ */ E.jsx(Lr, { analyticsCategory: "PropPacks HowTo Lobby", isLoggedIn: u }) }), 7013 /* @__PURE__ */ E.jsx(to, { light: !0, children: /* @__PURE__ */ E.jsx(Rt, { id: `${C?.gameType}_HOW_TO_DESC` }) }), 7014 /* @__PURE__ */ E.jsx(Ao, { children: /* @__PURE__ */ E.jsx(Lr, { analyticsCategory: "PropPacks HowTo Lobby", isLoggedIn: u }) }), 7015 V?.length > 0 && /* @__PURE__ */ E.jsx(Sr, { children: /* @__PURE__ */ E.jsx(Gt, { sources: V, alt: "PropPacks Cards" }) }) 7016 ] }), 7017 /* @__PURE__ */ E.jsx(Tu, { children: /* @__PURE__ */ E.jsx(Co, { light: !0 }) }), 7018 /* @__PURE__ */ E.jsx(Pu, {}) 7019 ] }); 7020} 7021function xo() { 7022 const [u, d] = Zn(0); 7023 return Xt(() => { 7024 const C = Wt.subscribe(Wt.eventTypes.RSI_BOTTOM_NAVIGATION_HEIGHT_CHANGE, (P) => { 7025 d(Number(P)); 7026 }); 7027 return () => { 7028 C?.unsubscribe(); 7029 }; 7030 }, []), u; 7031} 7032const Lu = ae.div` 7033 height: 100%; 7034 position: relative; 7035 background-color: #0A012D; 7036 padding-top: 24px; 7037 overflow-y: auto; 7038 7039 scrollbar-width: none; 7040 &::-webkit-scrollbar {
7041 display: none; 7042 } 7043`, Fu = ae.div` 7044 display: flex; 7045 flex-direction: column; 7046 align-items: center; 7047 padding: 16px 20px; 7048 overflow-x: hidden; 7049 7050 7051 ${({ 7052 theme: u, 7053 fixed: d 7054}) => d && ` 7055 @media only screen and (max-width: ${u.breakpoints.md}) { 7056 padding-bottom: 78px; 7057 } 7058 `}; 7059`, Ou = ae.div` 7060 position: sticky; 7061 z-index: 2; 7062 bottom: 0; 7063 left: 0%; 7064 width: 100%; 7065 background: #0A002C; 7066 padding: 16px 20px; 7067 box-sizing: border-box; 7068 color: ${({ 7069 theme: u 7070}) => u.colors.neutral[50]}; 7071 7072 ${({ 7073 theme: u, 7074 fixed: d, 7075 bottomOffset: C 7076}) => d && ` 7077 @media only screen and (max-width: ${u.breakpoints.md}) { 7078 position: fixed; 7079 bottom: ${C}; 7080 padding-bottom: 24px; 7081 } 7082 `}; 7083`, ju = ae.div` 7084 display: flex; 7085 7086 > button { 7087 flex: 1; 7088 } 7089`; 7090function Su({ 7091 isLoggedIn: u 7092}) { 7093 const d = er.detector.isMobileApp, C = xo(), { 7094 logoImageSet: P, 7095 packAndTwoCardsImageSet: V 7096 } = _n(); 7097 return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [ 7098 /* @__PURE__ */ E.jsx(Cn, {}), 7099 /* @__PURE__ */ E.jsxs(Lu, { children: [
7100 /* @__PURE__ */ E.jsxs(Fu, { fixed: d, children: [ 7101 P?.length > 0 && /* @__PURE__ */ E.jsx(An, { children: /* @__PURE__ */ E.jsx(Gt, { sources: P, alt: "PropPacks Logo" }) }), 7102 V?.length > 0 && /* @__PURE__ */ E.jsx(Sr, { children: /* @__PURE__ */ E.jsx(Gt, { sources: V, alt: "PropPacks Cards" }) }), 7103 /* @__PURE__ */ E.jsx(Co, {}) 7104 ] }), 7105 /* @__PURE__ */ E.jsx(Ou, { fixed: d, bottomOffset: C, children: /* @__PURE__ */ E.jsx(ju, { children: /* @__PURE__ */ E.jsx(Lr, { analyticsCategory: "PropPacks HowTo", isLoggedIn: u }) }) }) 7106 ] }) 7107 ] }); 7108} 7109const Vu = `${Jn.PUBLIC_URL}/images`, Wu = ae.div` 7110 height: 100%; 7111 flex: 1; 7112 background-color: #0A012D; 7113 padding-top: 24px; 7114 display: flex; 7115 flex-direction: column; 7116 overflow-y: auto; 7117 7118 scrollbar-width: none; 7119 &::-webkit-scrollbar { 7120 display: none; 7121 } 7122 7123 ${({ 7124 theme: u, 7125 fixed: d 7126}) => d && ` 7127 @media only screen and (max-width: ${u.breakpoints.md}) { 7128 padding-bottom: 80px; 7129 } 7130 `}; 7131`, Du = ae.div` 7132 &::after { 7133 position: absolute; 7134 top: 0; 7135 width: 100%; 7136 height: 100%; 7137 content: ''; 7138 background-image: url(${Vu}/confetti.webp); 7139 background-size: cover; 7140 z-index: 1; 7141 pointer-events: none; 7142 } 7143`, $u = ae.div` 7144 display: flex; 7145 flex-direction: column; 7146 align-items: center; 7147 padding: 16px 20px; 7148 overflow-x: hidden; 7149 7150 > * { 7151 z-index: 2 7152 } 7153 7154 ${tr} { 7155 margin-top: 0px; 7156 max-width: 250px; 7157 } 7158`, Bu = ae.div` 7159 position: sticky; 7160 bottom: 0; 7161 left: 0%; 7162 width: 100%; 7163 background: transparent; 7164 padding: 16px 20px; 7165 box-sizing: border-box; 7166 z-index: 2; 7167 margin-top: auto; 7168 7169 ${({ 7170 fixed: u, 7171 bottomOffset: d 7172}) => u && ` 7173 position: fixed; 7174 bottom: ${d}px; 7175 left: 0; 7176 width: 100%; 7177 padding-bottom: 24px; 7178 `}; 7179`, Nu = ae.div` 7180 display: flex; 7181 7182 > button { 7183 flex: 1; 7184 } 7185`, Uu = ae.div` 7186 padding: 16px 0; 7187`; 7188function zu({ 7189 card: u, 7190 teamUUID: d, 7191 teamKambiId: C, 7192 variant: P, 7193 size: V, 7194 participants: Q, 7195 jerseyAlt: N 7196}) { 7197 const F = ua(u, !1), { 7198 leagueBranding: k 7199 } = at(), K = !!k?.propPacksTeamLogosEnabled, J = rn(() => k?.teams?.find(({ 7200 teamId: ie 7201 }) => Number(ie) === C), [k?.teams, C]); 7202 return /* @__PURE__ */ Qn(ki, { ...F, key: u.cardUUID, teamUUID: d, variant: P, size: V, participants: Q, jerseyAlt: N, teamLogoEnabled: K, teamFillColor: J?.teamPropPacksFillColor, teamStrokeColor: J?.teamPropPacksStrokeColor, teamKambiId: C }, /* @__PURE__ */ E.jsx(ki.Text, { children: u.award?.message })); 7203} 7204function Hu({ 7205 card: u, 7206 teamUUID: d, 7207 teamKambiId: C, 7208 variant: P, 7209 size: V, 7210 participants: Q, 7211 jerseyAlt: N, 7212 eventStartDate: F 7213}) { 7214 const { 7215 leagueBranding: k 7216 } = at(), K = !!k?.propPacksTeamLogosEnabled, J = rn(() => k?.teams?.find(({ 7217 teamId: a 7218 }) => Number(a) === C), [k?.teams, C]), ie = la(u, P), Z = Gi({ 7219 closingTime: F, 7220 dateTimeFormat: "M/D/YY", 7221 timeFormat: "", 7222 isShortFormat: !0, 7223 hasStarted: !1 7224 }); 7225 return /* @__PURE__ */ Qn(Rr, { ...ie, time: Z, key: u.cardUUID, teamUUID: d, size: V, participants: Q, jerseyAlt: N, teamLogoEnabled: K, teamFillColor: J?.teamPropPacksFillColor, teamStrokeColor: J?.teamPropPacksStrokeColor, teamKambiId: C }, /* @__PURE__ */ E.jsx(Rr.Text, { children: u.award?.message })); 7226} 7227function Yu({ 7228 playerCard: u, 7229 eventStartDate: d, 7230 teamHome: C, 7231 teamAway: P 7232}) { 7233 const V = `${P.shortname} ${P.score} ${C.shortname} ${C.score}`, Q = u.playerInfo?.isHomeTeam ? C : P, N = u.packType.toLowerCase(), { 7234 config: F 7235 } = at(); 7236 if (!F) 7237 return null; 7238 const k = Q.teamUUID, K = Rr?.Size?.LARGE, J = `${Q.shortname} Jersey`, ie = Q.kambiTeamId; 7239 return F.gameType === Ki.MLB ? /* @__PURE__ */ E.jsx(zu, { card: u, teamUUID: k, variant: N, size: K, participants: V, jerseyAlt: J, teamKambiId: ie }) : /* @__PURE__ */ E.jsx(Hu, { card: u, teamUUID: k, variant: N, size: K, participants: V, jerseyAlt: J, teamKambiId: ie, eventStartDate: d }); 7240} 7241function Gu({ 7242 majorPrizeEvent: u 7243}) { 7244 Xt(() => { 7245 Mt.event({ 7246 event: Tt.GA4_EVENT_NAME, 7247 category: "PropPacks MajorPrize", 7248 action: "Impression" 7249 }); 7250 }, []); 7251 const d = eo({ 7252 category: Zi.WINNERS, 7253 eventGroupId: u.eventGroupId 7254 }), C = er.detector.isMobileApp, P = xo(), { 7255 logoImageSet: V 7256 } = _n(); 7257 return /* @__PURE__ */ E.jsxs(Du, { children: [
7258 /* @__PURE__ */ E.jsx(Cn, {}), 7259 /* @__PURE__ */ E.jsxs(Wu, { fixed: C, children: [ 7260 /* @__PURE__ */ E.jsxs($u, { children: [ 7261 V?.length > 0 && /* @__PURE__ */ E.jsx(An, { children: /* @__PURE__ */ E.jsx(Gt, { sources: V, alt: "PropPacks Logo" }) }), 7262 /* @__PURE__ */ E.jsx(tr, { children: /* @__PURE__ */ E.jsx(Rt, { id: "MAJOR_PRIZE_TITLE" }) }), 7263 /* @__PURE__ */ E.jsx(Uu, { children: /* @__PURE__ */ E.jsx(Yu, { playerCard: u.playerCard, eventStartDate: u.startDate, teamHome: u.home, teamAway: u.away }) }) 7264 ] }), 7265 /* @__PURE__ */ E.jsx(Bu, { fixed: C, bottomOffset: P, children: /* @__PURE__ */ E.jsx(Nu, { children: /* @__PURE__ */ E.jsx(It, { variant: It.Variant.Primary, size: It.Size.LG, onClick: d, children: /* @__PURE__ */ E.jsx(Rt, { id: "MAJOR_PRIZE_CTA" }) }) }) }) 7266 ] }) 7267 ] }); 7268} 7269const Xu = ae.div(["display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;height:100%;word-wrap:break-word;padding-top:24px;background-color:#0A012D;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]), Ku = ae.div(["color:#FFF;font-family:", ";font-size:", ";font-style:normal;font-weight:", ";line-height:24px;margin-bottom:65px;padding:16px;"], ({ 7270 theme: u 7271}) => u.typography.fonts.primary, ({ 7272 theme: u 7273}) => u.typography.sizes.md, ({ 7274 theme: u 7275}) => u.typography.weights.regular), Zu = ae.h1(["border:none;font-weight:", ";font-size:24px;margin:0;padding:16px 0 24px;text-align:center;"], ({ 7276 theme: u 7277}) => u.typography.weights.medium), Ju = ae.h2(["font-weight:", ";line-height:24px;font-size:", ";&:first-of-type{margin-top:0;}"], ({ 7278 theme: u 7279}) => u.typography.weights.bold, ({ 7280 theme: u 7281}) => u.typography.sizes.md), qu = ae.p(["&:first-of-type{margin-bottom:0;}"]), Qu = ae.a(["color:", ";word-break:break-all;padding:0 3px;&:visited{color:", ";}&:hover{color:black;text-decoration:underline;background:", ";border-radius:2px;}"], ({ 7282 theme: u 7283}) => u.colors.secondary[300], ({ 7284 theme: u 7285}) => u.colors.secondary[400], ({ 7286 theme: u 7287}) => u.colors.secondary[300]), el = ae.ol(["padding-inline-start:16px;"]); 7288function tl() { 7289 const { 7290 config: u 7291 } = at(); 7292 return Xt(() => { 7293 Mt.event({ 7294 event: Tt.GA4_EVENT_NAME, 7295 category: "PropPacks Terms View", 7296 action: "Impression", 7297 label: "PropPacks Terms View Loaded" 7298 }); 7299 }, []), u?.termsOfService ? /* @__PURE__ */ E.jsxs(Xu, { children: [ 7300 /* @__PURE__ */ E.jsx(Cn, {}), 7301 /* @__PURE__ */ E.jsx(Ku, { children: /* @__PURE__ */ E.jsx(wn, { options: { 7302 wrapper: "div", 7303 overrides: { 7304 h1: { 7305 component: Zu 7306 }, 7307 h2: { 7308 component: Ju 7309 }, 7310 p: { 7311 component: qu 7312 }, 7313 a: { 7314 component: Qu 7315 }, 7316 ol: { 7317 component: el 7318 } 7319 } 7320 }, children: u.termsOfService }) }) 7321 ] }) : null; 7322} 7323const nl = qn.memo(tl), rl = fa` 7324 /* 7325 * The web modal's ready sheet wrapper needs a definite height for the 7326 * PropPacks content to resolve its 100% height. Keep this override scoped 7327 * to this MFE instead of changing the shared modal layout. 7328 */ 7329 .presentation-content-wrapper:has( 7330 > .presentation-content-container > .proppacks-funnel-root 7331 ) { 7332 height: 100%; 7333 } 7334 7335 @font-face { 7336 font-family: 'Industry-BlackItalic'; 7337 src: url('${"https://micro-frontends.rushstreetcontent.com"}/ui-component-library/latest/fonts/Industry-BlackItalic.woff2') format('woff2'); 7338 font-weight: normal; 7339 font-style: normal; 7340 margin: 0; 7341 padding: 0; 7342 -webkit-font-smoothing: antialiased; /* Chrome, Safari */ 7343 -moz-osx-font-smoothing: grayscale; /* Firefox */ 7344 } 7345`, il = ae.div(["width:100%;height:100%;"]); 7346function ol(u) { 7347 switch (u.variant) { 7348 case "CARD_REVEAL": 7349 return /* @__PURE__ */ E.jsx(cs, { cardRevealPack: u.cardRevealPack }); 7350 case "HOW_TO": 7351 return /* @__PURE__ */ E.jsx(Su, { isLoggedIn: u.isLoggedIn }); 7352 case "HOW_TO_LOBBY": 7353 return /* @__PURE__ */ E.jsx(ku, { isLoggedIn: u.isLoggedIn }); 7354 case "TERMS": 7355 return /* @__PURE__ */ E.jsx(nl, {}); 7356 case "GAME_RULES": 7357 return /* @__PURE__ */ E.jsx(wu, {}); 7358 case "MAJOR_PRIZE": 7359 return /* @__PURE__ */ E.jsx(Gu, { majorPrizeEvent: u.majorPrizeEvent }); 7360 } 7361} 7362function wl(u) {
7363 const d = na(), C = ra(), P = ia("propPacksTranslations"); 7364 if (!C || !d || !P) 7365 return null; 7366 const { 7367 groupId: V, 7368 modalId: Q 7369 } = u, N = /* @__PURE__ */ E.jsxs(da, { theme: pa, children: [ 7370 /* @__PURE__ */ E.jsx(rl, {}), 7371 /* @__PURE__ */ E.jsx(ca, { groupId: V, children: /* @__PURE__ */ E.jsx(il, { className: "proppacks-funnel-root", "data-testid": "proppacks-funnel", children: /* @__PURE__ */ E.jsx(ol, { ...u }) }) }) 7372 ] }); 7373 return /* @__PURE__ */ E.jsx( 7374 ea, 7375 { 7376 timeZone: d, 7377 locale: C, 7378 defaultLocale: C, 7379 messages: P, 7380 onError: wa, 7381 children: Q ? /* @__PURE__ */ E.jsx(Ca, { modalId: Q, children: N }) : N 7382 } 7383 ); 7384} 7385export { 7386 wl as default 7387};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.